The SDLC pipeline
Compliance
The design assessed against the regulatory frameworks that apply, with every gap flagged.
11 min read9 sections
The Compliance step checks the project's design against the regulatory and security frameworks Alara Code ships with. For each control that applies, the agent reads the design documents, lists which of the control's required evidence they contain and which they lack, and gives the control a status. The result is a Compliance Assessment: a control-by-control table, gap counts, the critical gaps and an overall risk level. It runs beside the chain once the STS is written, finishes as Awaiting your review, and approving it unlocks nothing.
What you get
A Markdown document titled Compliance Assessment. The agent returns structured rows and the bridge lays out every section, so the layout is fixed:
| Section | Contents |
|---|---|
| Title block | Project, client, version, date. |
| Summary | The mode (full), the frameworks assessed and the overall risk level. |
| Findings | One row per control: framework, control, title, what triggered it (requirement ids, or "design review"), severity, status, evidence found, gaps and remediation. |
| Gap Analysis | Total controls and the compliant, partial, non-compliant and not-applicable counts, with a pie chart of control status. |
| Critical Gaps | Each critical or high control that is partial or non-compliant, with its first gap, or "None." |
| Recommendations | A fix-first sentence naming up to five of the critical or high gaps. |
| Version History | One row per run. |
Each control gets one status:
| Status | Meaning |
|---|---|
| compliant | Every required evidence item is found in the documents. |
| partial | Some items are found and some are missing. The gaps column says which. |
| non-compliant | None of the required evidence is found. |
| not-applicable | The control cannot apply to this product. The gaps column starts "Not applicable:" and gives the reason. |
| pending-review | Only in a fallback run that had no design documents to read. Nothing was checked. |
"Found" means the agent cites a document, a section and what it says, such as "SDS § Security DC-003: AES-256 at rest". A requirement is a trigger, not design evidence, and an assumption is not evidence.
Which controls are assessed
The bridge decides the scope in code, before any agent call:
- It scans each requirement's title, description and acceptance criteria for control keywords, ignoring case. A keyword is a phrase such as "multi-factor authentication" or "data at rest encryption", matched as plain text. A synonym or an abbreviation does not match, so no flag does not prove a control is irrelevant.
- A framework is applicable when a keyword hit names it, when a regulatory constraint in the approved scope names it (by code or name), or when it is ISO 27001, which is always included as the baseline.
- Every control of every applicable framework is assessed. Controls with a keyword hit come first, the rest are marked "design review". If the total would pass 80, lowest-severity design-review controls are dropped first; keyword hits never are.
A project with no regulated scope is therefore still checked against the 20 ISO 27001 controls. One stray keyword brings in its whole framework.
| Code | Framework | Controls | Critical |
|---|---|---|---|
AAOIFI | AAOIFI IT governance and Sharia compliance standards | 10 | 3 |
CBUAE-2024 | Central Bank of the UAE, Information Assurance Regulation 2024 | 10 | 8 |
GDPR | EU General Data Protection Regulation | 20 | 6 |
ISO-27001 | ISO/IEC 27001:2022 Information Security Management System | 20 | 0 |
PCI-DSS-4 | Payment Card Industry Data Security Standard 4.0 | 12 | 6 |
PPRA-2024 | Public Procurement Regulatory Authority Rules 2024 | 18 | 5 |
SAMA-2024 | Saudi Arabian Monetary Authority Cybersecurity Framework 2024 | 20 | 14 |
SBP-2024 | State Bank of Pakistan IT Governance Framework 2024 | 25 | 12 |
Severity (critical, high, medium or low) comes from the framework definition, and the agent is told to copy it as written.
Before you run it
- The STS must be written. It does not need to be approved. Until it exists, the step rail says "Run System Test Spec first" and the slash menu says "Run /sts first". The project state must also hold a non-empty requirement list.
- Run it once the design documents have settled. The evidence is the latest written SDS, TAD, API Contract, Threat Model and STS, approved or not, as people edited them. A missing document counts as missing, so a project with no Threat Model shows gaps in logging, detection and secrets handling. Each document is cut at 80,000 characters, with a marker.
- Name the frameworks you are bound by. Put them in a regulatory constraint in the scope before you approve it, so they are assessed even when no requirement uses a keyword.
How it works
The skill is sdlc-compliance-checker, the one the SRS uses for its preliminary flags. Here it assesses; it does not scan.
- Bridge to Bridge: Scan requirements, pick frameworks, list controls
- loop: Each batch of 8 controls, run side by side
- Bridge to Project agent: sdlc-compliance-checker with the controls and the design documents
- Project agent to Bridge: matrix rows and flags
- Bridge to Bridge: Check against the compliance schema, retry up to 3 times
- Bridge to Bridge: Merge batches, recompute counts, risk and recommendation
- Bridge to Bridge: Merge flags into state, write compliance-vN.md
Short batches keep replies reliable, so 20 controls take three calls. Each batch has its own correction loop of one attempt by default (ALARA_CORRECTION_MAX_ATTEMPTS, 1 to 5). The bridge sends back a reply with an invalid status, a "compliant" with no cited evidence, a gap status with no gap, or a contradiction.
The agent writes the rows. The bridge computes the four counts, the critical gaps and the risk level, so they cannot be miscounted. The risk level is critical when a critical control is non-compliant, high when a critical control is partial or a high control is non-compliant, medium when any other gap remains, and low otherwise.
The run panel shows: Checking project state, Assessing frameworks, Persisting to project state, Writing the Markdown document. The completion message gives the mode, the number of flags and how many are critical. That count is controls whose severity is critical, not critical gaps.
Ids this step owns
None. Findings are identified by a framework code such as SBP-2024 and that framework's control id, and point at the requirement ids (REQ-...) that triggered them.
Reviewing it
The agent can be wrong in both directions: evidence cited that a document does not contain, or a gap reported for something it does. Read the report with the documents open.
- Start with Critical Gaps.
- For compliant and partial controls that matter, open a cited section and confirm it says what the row claims.
- For each gap, decide whether it is real and whether the named document is the right place to fix it.
- Check every not-applicable reason. One based on an assumption is worse than an open gap.
- Check the Summary frameworks. If one does not apply to you, a keyword pulled it in: find the requirement under "Triggered by", reword it and re-run. If Total controls is lower than the framework sizes suggest, a batch came back short; re-run.
What to do with a gap
- A partial or non-compliant control to Does the control apply to this product?
- Does the control apply to this product? to Request changes: ask for not-applicable with the reason, No
- Does the control apply to this product? to Do the documents already cover it?, Yes
- Do the documents already cover it? to Request changes: name the section so it is reassessed, Yes
- Do the documents already cover it? to Change the SDS, TAD, API Contract or Threat Model, No
- Change the SDS, TAD, API Contract or Threat Model to Re-run Compliance
A note is not evidence. A gap closes when a document says the missing thing. Approved documents are read-only, so change them through Request changes while they are under review, or start a new version.
Request changes
The agent receives the full assessment and your change list and returns only the controls it changes. The bridge lays them on the previous assessment, so every other verdict stays as you read it, and recomputes the totals, risk level and recommendation. Name the control id.
| What you see | Wording that works |
|---|---|
| A control that does not apply | "Mark PCI-REQ-01 not-applicable: payments go through a hosted page and the product never stores or transmits card data." |
| Evidence the agent missed | "Reassess GDPR-ART6-001. The TAD records the lawful basis under its data protection decision." |
| A vague gap or remediation | "Make the gap for ISO-A5-001 name the SDS section that should hold the policy." |
Request changes cannot add a control or framework outside the scope above, or set the totals. To change what is assessed, change a requirement or the scope and re-run. If the draft has no stored assessment (written before this behaviour), Request changes runs the whole assessment again with your changes as notes.
You can edit the draft while it is under review, except Version History. An edit changes the text only. The flags in the project data stay as they were, and a later re-run or Request changes writes the report again from the stored assessment, so your edits are not carried over.
Re-running
A re-run assesses every control again against the current requirements and documents, replacing earlier Request changes verdicts. Under review it rewrites the same version; after approval the next run writes the next. Nothing marks the assessment out of date when a design document changes, so re-run it after changing the SDS, TAD, API Contract, Threat Model or STS.
Approving records that you read it. It does not change any flag's status.
How it fits with other steps
| Step | Relationship |
|---|---|
| SRS | Raises the first flags: keyword matches on the requirements, status "pending-review". Compliance replaces each one's status, evidence and gaps with the assessed result and adds the design-review controls. |
| Threat Model | Maps its controls to the frameworks in the flags, and is read here as evidence. Run it before Compliance. |
| Proposal | Names the frameworks in the compliance flags, with their status and gaps. Run Compliance first for assessed statuses. |
| Traceability | A different question: requirement to design component to test case. Neither step reads the other. |
| Tasks | Does not read the assessment. A remediation becomes build work only when the design changes and Tasks runs again. |
When it fails
| What you see | Why | What to do |
|---|---|---|
| Step rail "Run System Test Spec first", slash menu "Run /sts first" | The STS has not been written. | Run /sts. |
| "artifacts.sts missing ... run /sts first." | The project state has no STS registered. | Run /sts. |
| "requirements[] is empty ... run /srs first." | The project state has no requirements. | Run /srs. |
| "The agent did not return a usable reply." | On every attempt of a batch the reply could not be read, was empty, or was a refusal. | Run it again. If it keeps happening, run Check agent in Project Settings › Agent. |
| "The agent's reply still fails N check(s) the next step depends on, after M attempt(s)." | A batch still broke the compliance schema after the last attempt: an unknown key such as bySeverity, a wrong mode, severity or status value, or a missing field. One failed batch fails the run. | Run it again. The best reply is kept at .sdlc/tmp/compliance-data-<batch>-last-response.json. |
Under the hood
- The driver is
bridge/src/services/compliancePipeline.service.ts. The scope rules are inbridge/src/lib/complianceScope.ts, the message incomplianceMessage.ts, the revision inamendPatch.ts, the loop incorrectionLoop.ts, the frameworks inbridge/sdlc-engine/frameworks/and the schema inbridge/sdlc-engine/schemas/compliance.schema.json. - If no design document can be read, the step falls back to
requirements-onlymode: all eight frameworks are sent, the agent scans the keywords and every control stays "pending-review". - Written to the project state:
complianceFlags, merged by framework and control (an existing flag gets the new status, evidence, gaps and date; a new control is added; none is ever removed), each requirement'scomplianceFrameworks, andartifacts.compliance. The phase moves to compliance unless the project is already further along. - The stored assessment for Request changes is
.sdlc/tmp/compliance-result.json. The document is.sdlc/artifacts/compliance-vN.md. The flags are also available fromGET /api/projects/:id/compliance-flags. - The gate sits in
bridge/sdlc-engine/lib/sdlc/gate-rules.js:compliancerequires only thatstsexists. See Document checks and versioning.