Act II · How a change flows
AI Factory · Lifecycle
From Issue to closed Issue, step by step
PlanUnderstand and specify
- step 1
Issue
One GitHub Issue per change, labeled and linked to a Use Case (CU-XX), RF-XX or RNF-XX, with acceptance criteria.
Checked by
.github/ISSUE_TEMPLATE/issue.md - step 2
Refine the requirement
Confirm the Use Case is accurate; create or update it first if not.
- step 3Gate 1
Specification
An OpenSpec change on the notaire-sdlc schema describes only this change: proposal, traceability, delta specs, design, tasks.
Checked by
openspec validate <change> --strict · validate-sdlc-plan.sh - step 4
Impact analysis
Affected modules from workspace/modules.yaml, entities, endpoints, schema, tests and docs.
Checked by
python3 workspace/modules.py affected <path> - step 5
Architecture review
Follow the existing architecture (hexagonal, ADR-030); write an ADR when the change is architectural.
- step 6
Branch
From an updated main: <type>/<issue>_<description>. Push it at once (continuous publication).
Checked by
Branch Naming Convention Check - step 7
Acceptance criteria
Given-When-Then scenarios in the delta spec are the acceptance criteria.
ProveTests first, then code
- step 8Gate 2
Design test cases
Happy path, edge cases and error paths at unit, integration and E2E level.
- step 9–10
Write failing tests
Unit and integration tests first, and watch them fail. A test you never saw fail proves nothing (P1).
Checked by
check-tdd-evidence.sh: production code needs test changes - step 11
Implement
The minimum code that makes the tests pass, following the conventions.
- step 12
Update existing tests
Never weaken an assertion to force green.
- step 13–14
Run tests and full regression
Unit, integration, coverage ratchet, Bruno API tests. No @Disabled without approval.
Checked by
mvn verify -pl backend-api - step 15
Playwright E2E
Every UI change: golden path and edge cases at mobile, tablet and desktop widths.
Checked by
testing/e2e — TS-nnnn suites
PublishDocument, commit, open the PR
- step 16Gate 3
Permanent documentation
Update the docs the change affects, in the same diff. Never duplicate; point at the permanent document.
Checked by
check-doc-traceability.py - step 17
Atomic commits
Conventional Commits; Refs #N on intermediate commits, Closes #N on the closing one.
Checked by
check-commit-messages.sh - step 17.5
Full local pipeline
One dashboarded pre-PR gate: plan check, security cases, preflight --full, markdown lint.
Checked by
bash workspace/sdlc/run_pipeline.sh - step 18–19
Pull request and green CI
PR titled [#N] type(scope): description, with the PR template; wait for every required workflow.
ShipReview, merge, deploy, verify
- step 20Gate 4
Code review
Code owner, or the Foreman's Gate 4 review with no open finding. Heavy CI must be terminal success.
Checked by
check-heavy-ci.sh <pr> - step 21
Merge
Via the PR only. The OpenSpec change is archived in that same PR (#1623).
- step 22
Deploy
CI → CD builds, signs (cosign) and publishes images to GHCR; SBOMs on version tags.
- step 23Gate 5
Smoke test
Health endpoint and the key flow of the change on the target environment.
- step 24
Close the issue
Only after deploy and smoke. Board Status Done, WIP labels removed.
The five hard gates
- Issue linked to a Use Case
- Specification written
- Acceptance criteria defined
validate-sdlc-plan.sh resolves the Issue live with gh: an invented or closed number fails
- Test cases designed
- Unit tests written and observed failing
- Integration tests where applicable
check-tdd-evidence.sh; the local harness requires TEST_CMD to fail
- Docs not updated
- Any test failing
- Coverage below the JaCoCo ratchet
- Lint/format failing
- run_pipeline.sh not run or red
preflight.sh pre-push hook + run_pipeline.sh dashboard
- CI red or pending
- Review unresolved
- Merge conflicts
- Docs pending
protect-main ruleset (5 required checks) + check-heavy-ci.sh
- Deploy succeeded
- Smoke test passed
- Issue closed
- Board Status and labels coherent
check-board-status-label-coherence.py; archive hygiene on main (Main Health)
Definition of Done
A change is Done only when the Issue is linked to a Use Case with acceptance criteria, the specification passed Gate 1, tests were written first and seen failing, the full suite and coverage ratchet are green, Playwright is green for UI changes, permanent docs are updated without duplication, commits are atomic and conventional, the PR is green and reviewed, and the change is merged, deployed, smoke-tested and its Issue closed.