version v7.2.
For up-to-date documentation, see the
latest version.
Code Companion
7 minute read
1. Application
| Reference: | LLD – Software Factory as a Product - Code Companion |
| Type & Classification: | Product |
| Step: | Continuous Delivery |
| Bid/Project/Product Name & ID: | Software Factory as a Product (SWaaP) |
| Solution Level: | Digital product |
| Solution Name: | Software Factory as a Product |
| Solution description: | As deployed, create and update a Software Factory |
| Key Products/Solution: |
2. Introduction
2.1 Document purpose
This document is a low level design - LLD which aims to describe how the architecture evoked in high level design - HLD will be implemented. This document will describe the protocols used in the target architecture, how to implement them and any modifications made to their default behavior. Once validated by Thales, this document will then serve as a basis for the implementation of configurations on equipment.
2.2 Document scope
This document is not a manual and is not intended to replace the reference literature describing with great precision all network protocols.
The protocols used will be briefly described as well as the modifications made to their default behavior.
2.3 Referenced documentation
| Document reference | Document Name |
|---|---|
| TASD | Technical Architecture and Security Document of SWaaP |
| SCOM-CodeCompanion | Software Center Operation Manual of Code Companion |
3. Component general description
This component is part of Software Factory as a Product (SWaaP), and it is visible in the TASD .
Code Companion is an AI-powered solution designed to assist software developers within their integrated development environment (IDE).
This tool, which is based on an open-source VSCode/JetBrains extension called Continue dev , provides developers with interactive and contextual support as they write code.
Additionally, Code Companion includes a Python-based backend that manages integration to the platform for authentication and key management for the billing part, and optionally integration to the API Manager (APIM) with on-behalf tokens and error management.
This component permits the exposure of Code Companion services to any Software engineer (end user of SWaaP). The Code Companion service is exposed using:
- Code Companion IDE extension, available for VSCode and JetBrains solutions.
- Code Companion Python-based Backend.
4. Functional & Business Requirements
No formal list of requirements has been expressed by clients. It is designed and developed based on business use cases.
4.1 Feature summary
The IDE extensions based on Continue dev have the following features:
- Chat to understand and iterate on code in the sidebar
- Autocomplete to receive inline code suggestions as you type
- Edit to modify code without leaving your current file
- Actions to establish shortcuts for common use cases
Continue dev also permit the definition and use of:
- Several models for Chat, Edit and Autocompletion
- Context Providers to RAG contexts from several internal (e.g. Codebase, Files, Terminal) or external (e.g. Url, Search, Documentations) sources.
- Custom commands to quickly reuse predefined context providers and prompts.
Additionally, Code Companion offers predefined configuration and integration for:
- TDP C2 based on OpenAI GPT4/GPT4o and using MCS APIM and Guardrails
- TDP C3-CA based on OpenAI GPT4/GPT4o and using MCS APIM and Guardrails
- TDP C3-BS based on Codestral and using Thalesgroup APIM
- RTDP DR based on Codestral provided by ClearML
4.2 Prerequisites
Every prerequisites of the product are applicable to this component. See the TASD .
In detail:
- Identity Provider (IdP (e.g Azure AD))
- LLM/SLM (PRE_016)
- APIM (PRE_017) (optional)
- Guardrails (PRE_018) (optional, depending on the platform and it’s data sensibility)
4.3 Variability
TDP C2/C3-CA
- Identity Provider (IdP): Azure AD
- LLM/SLM: OpenAI
- APIM: MCS APIM
- Guardrails: MCS Guardrails (with Thales internal list of words)
C3-BS on CASTLE
- Identity Provider (IdP): Azure AD
- LLM/SLM: Codestral
- APIM: Thalesgroup APIM
- Guardrails: Not applicable
RTDP
- Identity Provider (IdP): Microsoft ADFS
- LLM/SLM: Codestral
- APIM: Not applicable (ClearML)
- Guardrails: Not applicable
5. Architecture decision record
Here is a list of decisions
6. Architecture description
6.1 Business architecture and allocation to services
6.1.1 Code Companion
You will find in Figure 0 business architecture for Code Companion allocated to services:
Figure 0 - Business architecture allocated to services.
Note: in dash, external items.
6.2.1 Code Companion
You will find in Figure 1 Functions for Code Companion
Figure 1 - Functions for Code Companion
You will find in Figure 2 Data Flow for Code Companion
Figure 2 - Data Flow for Code Companion
You will find in Figure 3 Components for Code Companion
Figure 3 - Components for Code Companion
You will find in Figure 4 Deployment for Code Companion
Figure 4 - Deployment for Code Companion
6.2.2 User management
This role matrix has been defined in TASD:
| User role | Description user role | Comment |
|---|---|---|
| UC1 | End user / Software engineer | Person that can write in a solution/product/project tenant |
| UC2 | Reader | Person that can read content of a solution/product/project tenant |
| UC3 | Tenant owner | Person that can administrate a solution/product/project tenant |
| UC4 | Software Factory application admin | Person that can administrate Software Factory instance components |
| UC5 | Software Factory system admin | Person that can administrate the deployment/upgrade of the Software Factory instance |
| UC6 | Software Factory tribe | Person that are delivering asset to deploy/upgrade a Software Factory instance |
6.2.3 RACI
In addition of global RACI (Responsible, Accountable, Consulted, Informed) of the SWaaP defined in TASD:
| Action | Description | UC4 | UC3 | UC2 | UC1 |
|---|---|---|---|---|---|
| Generate/Edit/Comment Code | Generate/Edit/Comment Code in the IDE Extensions | R/A | |||
| Manage Subscription key | Manage Subscription key in Continue Server | C/I | R/A | ||
| Onboard user | Onboard user in Code Companion | C/I | R/A | ||
| Offboard user | Offboard user in Code Companion | C/I | R/A | ||
| Support Request | Ask for help on Code Companion usage | C/I | R/A |
6.3 Delivery
Component is part of the Software Factory as a Product (SWaaP) delivery. See TASD for more details.
6.3.1 Latest Version
- Component repository: continue
- Component repository: continue-server
- Latest version editor
- Reference Component repository
- SWaaP integration part
6.3.2 Version 2.2.0
- Component repository: Release 2.2.0
- Building pipeline: Pipeline from tags
- Component registry:
- Continue-server Release 2.2.0
- Redis (*) 7.4.0-debian-12-r4
- Helm chart registry: Release 2.2.0
- Security Report: BSS vulnerability report
6.3.3 Version 2.1.0
- Component repository: Release 2.1.0
- Building pipeline: Pipeline from tags
- Component registry:
- Continue-server Release 2.1.0
- Redis (*) 7.4.0-debian-12-r4
- Helm chart registry: Release 2.1.0
- Security Report: BSS vulnerability report
(*) Notes on redis option dependency:
- redis is optional on platforms that configures the product without Set
APIM_AUTHENTICATION_METHODtooauth_onbehalfof. (this is currently the case for non-TDP platforms) - redis can also be configured as external service
6.3.4 Version 2.0.2
- Component repository: Release 2.0.2
- Building pipeline: Pipeline from tags
- Component registry: Release 2.0.2
- Helm chart registry: Release 2.0.2
- Security Report: BSS vulnerability report
6.4 Infrastructure architecture
6.4.1 Software Factory API
Here is a list of services that can be integrated with the Code Companion.
| Ref. | Name | Required | Description |
|---|---|---|---|
| SFE01 | Flux → Git in Software Factory for deployment | Mandatory | Code in a Git server for deployment of the product |
| SFE02 | Flux → Registry in Software Factory for deployment | Mandatory | Registries with helm charts and containers for deployment of the product |
| SFE04 | IAM - SAML SSO | Highly recommended | Users should be authenticated using SAML SSO |
| SFE16 | LLM Backend | Mandatory | Users requires a LLM Backend to create their prompts. |
| SFE17 | API Management | Highly recommended | LLM Backend should be served by an APIM and handles logging, authentication and usage statistics. |
7. Operational and maintenance
In this chapter you will find strategy and policy. Detail implementation will be described in the SCOM.
7.1 Life cycle policy
Cadence of version is describe in the Product Lifecycle .
7.2 License
Not applicable.
7.3 Deployment
The component is deployed as a standard component using Flux and SWaaP packaging. See TASD for more details.
7.4 IAM
We support and recommend integration with IAM using SAML SSO.
7.5 Scaling
- Redis HA (High Availablilty) enabled .
- Specs:
- limits for continue-server: 200m/256Mi
- limits for bitnami/redis: 150m/192Mi(nano sizing but could scale up according to our load test)
- HPA (Horizontal Pod Autoscaling) was configured for continue-server pods .
7.6 Backup / restore
No persistent data.
7.7 Monitoring
No applicative monitoring. Use classical platform’s one (cpu/ram/ingress success rate, …)
7.8 Logging
- The applicative logs can be obtained from the kubelet stdout/stderr corresponding to the container output.
- Core Services Logging on our LLM Usage
- K8SaaS Log Analytics for continue-server
- Azure Active Directory Audit Logs