@akjamie/agentic-sdlc 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +57 -29
  2. package/assets/commands/asdlc-approve.md +2 -2
  3. package/assets/config/config.yaml +1 -1
  4. package/assets/policy/policy.yaml +6 -0
  5. package/assets/schema/risk-assessment.schema.json +2 -1
  6. package/assets/schema/schema.yaml +168 -168
  7. package/assets/skills/asdlc-apply/SKILL.md +1 -1
  8. package/assets/skills/asdlc-approve/SKILL.md +2 -2
  9. package/assets/skills/asdlc-archive/SKILL.md +17 -13
  10. package/assets/skills/asdlc-doctor/SKILL.md +8 -8
  11. package/assets/skills/asdlc-impl-review/SKILL.md +15 -25
  12. package/assets/skills/asdlc-init/SKILL.md +11 -18
  13. package/assets/skills/asdlc-new/SKILL.md +5 -2
  14. package/assets/skills/asdlc-pr/SKILL.md +13 -8
  15. package/assets/skills/asdlc-review/SKILL.md +7 -7
  16. package/assets/skills/asdlc-spec-review/SKILL.md +10 -20
  17. package/package.json +2 -1
  18. package/src/assess/ai_judge.js +106 -36
  19. package/src/assess/decide.js +8 -6
  20. package/src/assess/index.js +13 -3
  21. package/src/assess/rules/builtin.js +7 -2
  22. package/src/assess/schema.js +6 -1
  23. package/src/assess/vectors/v1_intent.js +53 -8
  24. package/src/assess/vectors/v2_security.js +24 -1
  25. package/src/assess/vectors/v3_topology.js +125 -13
  26. package/src/commands/apply.js +33 -4
  27. package/src/commands/approve.js +2 -3
  28. package/src/commands/archive.js +116 -64
  29. package/src/commands/doctor.js +22 -19
  30. package/src/commands/init.js +24 -50
  31. package/src/commands/lint.js +32 -2
  32. package/src/commands/new.js +23 -22
  33. package/src/commands/pr.js +106 -25
  34. package/src/commands/status.js +1 -1
  35. package/src/commands/test.js +101 -5
  36. package/src/commands/update.js +1 -11
  37. package/src/commands/verify.js +141 -34
  38. package/src/lib/agents.js +2 -2
  39. package/src/lib/cliutil.js +57 -7
  40. package/src/lib/git.js +10 -4
  41. package/src/lib/graphify.js +89 -14
  42. package/src/lib/level.js +63 -9
  43. package/src/lib/openspec.js +61 -31
  44. package/src/lib/paths.js +0 -2
  45. package/src/lib/policy.js +4 -0
  46. package/src/lib/schema.js +32 -11
  47. package/src/lib/speclint.js +5 -3
  48. package/src/lib/tdd.js +35 -11
  49. package/assets/ci/asdlc-ai-review.yml +0 -65
  50. package/assets/githooks/post-merge +0 -22
  51. package/assets/githooks/pre-push +0 -17
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@akjamie/agentic-sdlc?color=6366f1&label=npm)](https://www.npmjs.com/package/@akjamie/agentic-sdlc)
4
4
  [![license: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-10b981.svg)](LICENSE)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20.19.0-38bdf8.svg)](https://nodejs.org/)
6
- [![tests](https://img.shields.io/badge/tests-128%20passing-10b981.svg)](#development--verification)
6
+ [![tests](https://img.shields.io/badge/tests-168%20passing-10b981.svg)](#development--verification)
7
7
  [![architecture](https://img.shields.io/badge/governance-L0--L3%20Adaptive%20Dual--Track-f59e0b.svg)](#adaptive-risk-tiered-governance-l0l3)
8
8
 
9
9
  > **The Intelligent Governance Engine for Autonomous AI Coding.**
@@ -15,33 +15,42 @@
15
15
 
16
16
  ---
17
17
 
18
- ## ⚡ The Dilemma: "Vibe Coding" vs. "Enterprise Bureaucracy"
18
+ ## ⚡ The Practical Bottlenecks of Autonomous AI Coding
19
19
 
20
- Autonomous AI coding agents (Claude Code, Cursor, OpenCode, Codex) are transforming software delivery. But engineering leads face a frustrating dilemma:
20
+ AI coding agents (Claude Code, Cursor, OpenCode, Codex) write hundreds of lines of code in seconds. However, as code generation velocity increases, enterprise engineering teams encounter **three practical bottlenecks in real-world delivery**:
21
21
 
22
22
  ```
23
- UNGOVERNED "VIBE CODING" RIGID "ALWAYS TWO-PR" FRAMEWORKS
24
- (Chaos & Silent Drift) (Suffocating Bureaucracy)
25
- ┌───────────────────────────┐ ┌───────────────────────────┐
26
- │ 💥 Hallucinated contracts │ │ 🐌 2 PRs for a 1-line doc │
27
- │ 💥 Code shipped w/o tests │ VS │ 🐌 45-min review for typo │
28
- │ 💥 Agents rewrite specs │ │ 🐌 Dev velocity tanks │
29
- │ 💥 Self-grading exams │ │ 🐌 Agents circumvent tool │
30
- └───────────────────────────┘ └───────────────────────────┘
23
+ THE PRACTICAL BOTTLENECKS OF AUTONOMOUS CODING
24
+ ┌───────────────────────────┐ ┌───────────────────────────┐ ┌───────────────────────────┐
25
+ │ 1. Review Bandwidth │ │ 2. Verification Bias │ │ 3. Boundary & Assumptions │
26
+ ├───────────────────────────┤ ├───────────────────────────┤ ├───────────────────────────┤
27
+ │ Generation throughput has │ │ When the same agent writes│ │ Natural language leaves │
28
+ │ outpaced human review │ │ both code and tests, tests│ │ scope implicit. Agents may│
29
+ │ capacity, risking review │ │ risk validating own bias │ │ overstep boundaries and │
30
+ │ depth dilution. │ │ rather than actual specs. │ │ cause cascading breaks. │
31
+ └───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘
31
32
  ```
32
33
 
34
+ 1. **Review Bandwidth Asymmetry**: Code generation throughput has scaled by an order of magnitude, but human cognitive capacity for deep architectural comprehension remains constant. When teams are inundated with frequent multi-file PRs, line-by-line review becomes unsustainable, inadvertently diluting review depth on critical paths.
35
+ 2. **Shared-Context Verification Bias (The "Player == Referee" Dilemma)**: When an agent implements code and writes unit tests within the same reasoning context, tests naturally inherit the agent’s internal interpretations. Passing tests confirm that code aligns with the agent’s own understanding, which can mask divergence from actual system contracts.
36
+ 3. **Implicit Assumptions & Boundary Spillover**: Natural language prompts are inherently concise, stating localized intent while leaving architectural boundaries, blast-radius limits, and edge behaviors unspecified. Autonomous agents resolve these ambiguities independently and frequently modify high fan-in shared modules, common middleware, or public contracts to satisfy a localized prompt. Without early alignment on scope and contracts, unverified boundary crossovers trigger unintended cascading regressions across dependent components.
37
+
38
+ > **Why prompts alone (`AGENTS.md`, `CLAUDE.md`) cannot fix this:**
39
+ > Prompts are **guidelines**, not deterministic gates. Under complex task and token constraints, agents prioritize code completion over subtle governance boundaries. Robust governance requires **deterministic exit-coded gates, Git-anchored contracts, and independent verification**.
40
+
33
41
  ### The Solution: Adaptive Dual-Track SDLC (`asdlc`)
34
42
 
35
- `agentic-sdlc` bridges this gap with an **Intelligent, Neuro-Symbolic Governance Plane**:
43
+ `agentic-sdlc` bridges these bottlenecks with a **practical, Git-native governance plane**:
36
44
  - 🚀 **Frictionless Agility for Routine Work (L0 / L1)**: Pure test additions, documentation updates, and bounded local refactors run in a streamlined **Single-PR** mode with automated validation and zero red tape.
37
- - 🛡️ **Ironclad Rigor for High-Impact Changes (L2 / L3)**: Cross-boundary APIs (Spring Boot, FastAPI, Go, NestJS), database schemas, security tokens, and constitutional rules enforce **Dual-PR Spec-First** contracts with human sign-off.
38
- - 🤝 **Humane In-Place Scope Escalation**: If scope unexpectedly expands during implementation, the system **never punishes the engineer** by ripping their Git branch apart. It maintains the single PR in-place, revokes auto-merge, and routes to a Tech Lead for human review.
45
+ - 🛡️ **Structured Rigor for High-Impact Changes (L2 / L3)**: Cross-boundary APIs (Spring Boot, FastAPI, Go, NestJS), database schemas, security tokens, and constitutional rules enforce **Dual-PR Spec-First** contracts with human sign-off on intent.
46
+ - 🔍 **Player ≠ Referee Verification**: Independent Review Agent Sessions (`asdlc-spec-review`, `asdlc-impl-review`) evaluate specifications and implementations against locked contracts in isolated reasoning sessions, eliminating shared-context verification bias.
47
+ - 🤝 **Humane In-Place Scope Escalation**: If scope expands or crosses boundaries during implementation, the system **never punishes the engineer** by tearing branches apart. It preserves the single PR in-place, revokes auto-merge, and routes to a Tech Lead for approval.
39
48
 
40
49
  ---
41
50
 
42
51
  ## 🧭 Adaptive Risk-Tiered Governance (L0–L3)
43
52
 
44
- Every change evaluated by `asdlc` is continuously assessed along its lifecycle across 5 orthogonal risk vectors (Intent, Architecture/API, Security/Data, AST Topology, and Test/Doc Semantics).
53
+ Every change evaluated by `asdlc` is continuously assessed along its lifecycle across core risk vectors (Task Intent, Security/Data Boundaries, and AST Topology/Architecture).
45
54
 
46
55
  ```mermaid
47
56
  flowchart TD
@@ -63,7 +72,7 @@ flowchart TD
63
72
  T_L2 --> DP1["Spec PR to main<br/>(asdlc pr spec)"]
64
73
  T_L3 --> DP1
65
74
  DP1 --> G_SPEC["CI Spec Review & Human TL Approval"]
66
- G_SPEC --> S_LOCK["approvedSha Cryptographic Lock<br/>(asdlc approve)"]
75
+ G_SPEC --> S_LOCK["approvedSha Git SHA Lock<br/>(asdlc approve)"]
67
76
  S_LOCK --> DP2["Implementation Unlocked<br/>(asdlc apply)"]
68
77
  DP2 --> DP3["Task-Level TDD Red-Green Loop<br/>(asdlc test)"]
69
78
  DP3 --> PR_IMPL["Implementation PR to main<br/>(Human Tech Lead Final Gate)"]
@@ -102,17 +111,17 @@ flowchart TD
102
111
 
103
112
  ## 🛡️ Non-Negotiable Engineering Invariants
104
113
 
105
- Enterprise teams rely on deterministic code, not agent compliance or prompt enthusiasm. Every invariant is backed by cryptographic proofs or exit-coded engines:
114
+ Enterprise teams rely on deterministic code, not agent compliance or prompt enthusiasm. Every invariant is backed by Git-anchored proofs, hash-chain integrity, or exit-coded engines:
106
115
 
107
116
  | # | Enterprise Invariant | How `asdlc` Enforces It | Failure Mode |
108
117
  | :-: | :--- | :--- | :--- |
109
118
  | **1** | **No Apply Before Spec Approval (L2/L3)** | `asdlc apply` physically inspects path-limited Git history for `approvedSha` on `main`. | 🚫 **Hard Refusal** — Zero production code allowed without an approved spec. |
110
- | **2** | **Cryptographic Anti-Tamper (`spec-tamper`)** | Implementation diffs must NOT modify locked spec files once approved on `main`. | 🚫 **Instant Rejection** — Agents cannot alter requirements to make failing tests pass. |
119
+ | **2** | **Git-Anchored Anti-Tamper (`spec-tamper`)** | Implementation diffs must NOT modify locked spec files once approved on `main`. | 🚫 **Instant Rejection** — Agents cannot alter requirements to make failing tests pass. |
111
120
  | **3** | **Anti-Gaming Hash Chain** | Every level transition is sealed in an append-only, SHA-256 hash-chained `risk-history.jsonl`. | 🚫 **Integrity Breach** — Manual downgrades (`L2 -> L1`) are detected and blocked. |
112
121
  | **4** | **AI Classifier Invariant Defense** | AI semantic classifier output is validated against hard mathematical expectations. | 🚫 **Evasion Shield** — Prompts claiming a `DROP TABLE` is "just a test" are vetoed to L3. |
113
122
  | **5** | **Zero Untested Code (`test-presence`)** | Any change touching production source code (`src/**`, `app/**`) requires test diffs. | 🚫 **Rejection** — Stops AI "code dumps" without corresponding test coverage. |
114
123
  | **6** | **Deterministic AC Assertions (`asdlc test`)** | Parses `- [ ] ACn: (test: <path>)` annotations and runs native test suites. | 🚫 **Fake Claim Gate** — Unimplemented acceptance criteria immediately fail CI. |
115
- | **7** | **Player ≠ Referee Isolation** | CI runs independent verification with a fresh LLM instance outside the author agent context. | 🚫 **Audit Integrity** — Authoring agents can never grade their own exam. |
124
+ | **7** | **Player ≠ Referee Isolation** | Independent review agent sessions (`asdlc-spec-review`, `asdlc-impl-review`) evaluate contracts and diffs in fresh sessions. | 🚫 **Audit Integrity** — Authoring agents can never grade their own exam. |
116
125
  | **8** | **Humane In-Place Scope Escalation** | If an L1 change touches an API during implementation, single PR is preserved with mandatory human sign-off. | **Safe Convergence** — No messy branch rebases; human stays in control. |
117
126
 
118
127
  ---
@@ -140,12 +149,31 @@ Enterprise teams rely on deterministic code, not agent compliance or prompt enth
140
149
  │ ├─ assess/ Neuro-symbolic risk evaluation & hash-chain history │
141
150
  │ ├─ speclint/ R0–R8 BDD/AC linting & scenario coverage traceability │
142
151
  │ ├─ graphify/ Knowledge graph & code AST topology discovery │
143
- │ └─ verify/ 12 cryptographic & structural quality gates │
152
+ │ └─ verify/ 12 deterministic & structural quality gates │
144
153
  └────────────────────────────────────────────────────────────────────────┘
145
154
  ```
146
155
 
147
156
  ---
148
157
 
158
+ ## 🏛️ Explicit Architectural Boundaries & Non-Goals
159
+
160
+ To maintain high engineering discipline and avoid platform over-engineering, `agentic-sdlc` establishes three explicit architectural boundaries:
161
+
162
+ 1. **Strict Spec Immutability on L2/L3 (`spec-tamper` — Why We Explicitly Reject `asdlc amend`)**:
163
+ - In autonomous AI coding, allowing an in-flight spec amendment (`asdlc amend`) inside an active implementation loop opens the door to **Agent Reward Hacking**: an agent failing a difficult contract test could quietly modify the specification to match its buggy code rather than fixing the implementation.
164
+ - For routine changes (L0/L1), engineers and agents already iterate freely within Single-PR mode.
165
+ - For high-impact contracts (L2/L3), once a spec is approved and its Git commit hash locked (`specSha`), **the specification is immutable law**. If implementation reveals a genuine architectural flaw or contract gap, the change must be closed and re-scaffolded via `asdlc new`. A bad spec is never mutated in-place.
166
+
167
+ 2. **Single-Repository Sovereign AST & Git Boundary (Why We Do Not Orchestrate Multi-Repo State Machines)**:
168
+ - `1 Repository = 1 AST Knowledge Graph + 1 Git History + 1 Autonomous Verification Boundary`.
169
+ - Cross-repository orchestration across microservices introduces distributed state-machine split-brain risks, partial rollouts, and brittle inter-repo lockups. Cross-service contract alignment belongs in upstream System Design RFCs / Architecture Epics (`proposal.md ## System Design refs`), while each repository sovereignly governs and independently verifies its own contracts, tests, and blast radius.
170
+
171
+ 3. **Session-Isolated Agent Review & Platform-Native RBAC (Player ≠ Referee)**:
172
+ - Review is not a cosmetic echo stub in CI. `asdlc` provides dedicated, independent review skills (`asdlc-spec-review`, `asdlc-impl-review`) designed to run in fresh, isolated agent sessions outside the authoring agent's context.
173
+ - We do not reinvent bespoke user RBAC or token auth engines inside the CLI. Enterprise access control and merge permissions are delegated to platform-native, battle-tested Git forge controls (GitHub/GitLab `CODEOWNERS`, protected branch rules, and signed commits).
174
+
175
+ ---
176
+
149
177
  ## 🚀 Quickstart: 5-Minute Walkthrough
150
178
 
151
179
  > 🧭 **New to Agentic SDLC?**
@@ -220,11 +248,11 @@ asdlc pr user-auth main
220
248
  | [`asdlc-new`](assets/skills/asdlc-new/SKILL.md) | Scaffolds change, queries AST hubs, runs conversational anti-fatigue `grill-me`. |
221
249
  | [`asdlc-lint`](assets/skills/asdlc-lint/SKILL.md) | Enforces deterministic BDD GIVEN/WHEN/THEN and R5 scenario-to-AC coverage. |
222
250
  | [`asdlc-pr`](assets/skills/asdlc-pr/SKILL.md) | Smart PR dispatcher: automatically handles Spec PR vs. Implementation PR. |
223
- | [`asdlc-approve`](assets/skills/asdlc-approve/SKILL.md) | Stamps cryptographic `specSha` lock upon Spec PR merge. |
251
+ | [`asdlc-approve`](assets/skills/asdlc-approve/SKILL.md) | Stamps Git `specSha` lock upon Spec PR merge. |
224
252
  | [`asdlc-apply`](assets/skills/asdlc-apply/SKILL.md) | Strict task-level TDD engine (`Red -> Green -> Refactor -> Evidence -> Converge`). |
225
253
  | [`asdlc-verify`](assets/skills/asdlc-verify/SKILL.md) | Pre-flight audit across 12 gates (test presence, evidence, tamper guard, schema). |
226
- | [`asdlc-spec-review`](assets/skills/asdlc-spec-review/SKILL.md) | CI-triggered 6-dimensional spec review before human lead approval. |
227
- | [`asdlc-impl-review`](assets/skills/asdlc-impl-review/SKILL.md) | CI-triggered Player ≠ Referee implementation reviewer with Anthropic convergence rules. |
254
+ | [`asdlc-spec-review`](assets/skills/asdlc-spec-review/SKILL.md) | Independent review agent: 6-dimensional spec review before human lead approval. |
255
+ | [`asdlc-impl-review`](assets/skills/asdlc-impl-review/SKILL.md) | Independent review agent: Player ≠ Referee verification with test execution and Anthropic convergence rules. |
228
256
  | [`asdlc-archive`](assets/skills/asdlc-archive/SKILL.md) | Syncs specs to living catalog, refreshes AST graph, and updates system status. |
229
257
  | [`asdlc-doctor`](assets/skills/asdlc-doctor/SKILL.md) | 12-invariant diagnostic engine with 1-click automated remediation (`--fix`). |
230
258
  | [`asdlc-status`](assets/skills/asdlc-status/SKILL.md) | Real-time change lifecycle dashboard and next actionable command guidance. |
@@ -239,7 +267,7 @@ Every implementation diff must pass the 12 deterministic gates in `asdlc verify`
239
267
  flowchart TD
240
268
  V["<b>asdlc verify &lt;ID&gt;</b><br/>Deterministic Implementation Gatekeeper"]
241
269
 
242
- subgraph TIER1 ["Tier 1 · Cryptographic & Contract Integrity"]
270
+ subgraph TIER1 ["Tier 1 · Contract & Hash-Chain Integrity"]
243
271
  G_APPROVED["<b>approved-spec</b><br/>Matches commit on main"]
244
272
  G_TAMPER["<b>spec-tamper</b><br/>Zero spec modifications in Impl PR"]
245
273
  G_LEVEL["<b>level-integrity</b><br/>Hash-chain tamper check"]
@@ -278,15 +306,15 @@ flowchart TD
278
306
  ## 🛠️ CLI Reference
279
307
 
280
308
  ```bash
281
- asdlc init [--ci jenkins|github] # Scaffold repository with OpenSpec, Graphify, and skills
309
+ asdlc init # Scaffold repository with OpenSpec, Graphify, and skills
282
310
  asdlc new "<intent>" # Scaffold change with AST explore + grill-me interview
283
311
  asdlc lint <ID> # Validate BDD scenarios, AC rules, and coverage (docs/spec-format.md)
284
- asdlc pr <ID> <target-branch> # Smart PR creator (auto-handles Spec PR vs Impl PR)
312
+ asdlc pr <ID> <target-branch> # Smart PR creator (auto-handles Spec PR vs Impl PR + smart staging)
285
313
  asdlc approve <ID> # Record approvedSha and transition to ready_for_impl
286
314
  asdlc apply <ID> # Guarded implementation launcher (checks approvedSha)
287
315
  asdlc test <ID> [--json] # Execute real test runners mapped to AC annotations
288
316
  asdlc verify <ID> # Audit diff against all 12 quality gates
289
- asdlc archive <ID> # Sync delta to living specs and refresh code graph
317
+ asdlc archive [<ID> | --merged] # Post-merge compaction: sync living specs & refresh code graph
290
318
  asdlc doctor [--fix] # 12-point toolchain & governance health check
291
319
  asdlc status [<ID>] # Change progress orientation or portfolio dashboard
292
320
  asdlc upgrade [--global] # Seamless upgrade of CLI, engine, and schemas
@@ -303,7 +331,7 @@ git clone https://github.com/akjamie/agentic-sdlc.git
303
331
  cd agentic-sdlc
304
332
  npm install
305
333
 
306
- # Run complete test suite (128 tests passing, 100% pass rate)
334
+ # Run complete test suite (168 tests passing, 100% pass rate)
307
335
  npm test
308
336
 
309
337
  # Run end-to-end multi-language simulation tests
@@ -319,7 +347,7 @@ Explore the complete documentation in the [`docs/`](docs/) directory:
319
347
  - ⏱️ [**30-Minute Getting Started Guide**](docs/getting-started.md): Frictionless step-by-step tutorial from install to first Spec PR.
320
348
  - 📐 [**Spec Format & Lint Reference**](docs/spec-format.md): Human-readable guide to R0–R8 lint rules with pass/fail examples.
321
349
  - 🌐 [**Quickstart Guide (Bilingual)**](docs/quickstart.md): End-to-end walkthrough covering the complete 7-stage lifecycle.
322
- - 🏛️ [**System Architecture & Whitepaper**](docs/about.md): Why Agentic SDLC, L0–L3 governance, and cryptographic anti-tamper proofs.
350
+ - 🏛️ [**System Architecture & Whitepaper**](docs/about.md): Why Agentic SDLC, L0–L3 governance, and Git SHA anti-tamper locks.
323
351
  - 🩺 [**Environment Doctor Manual**](docs/doctor.md): Diagnostic reference for all 12 health checks and `--fix` automated healing.
324
352
  - ⌨️ [**CLI Command Reference**](docs/usage.md): Full flag, option, and exit code reference for all `asdlc` commands.
325
353
  - 📖 [**Standard Glossary**](docs/glossary.md): Authoritative lexicon for living specs, spec SHAs, and architectural god nodes.
@@ -3,7 +3,7 @@ name: asdlc-approve
3
3
  description: "Stage 4: Lock approvedSha and transition change to READY_FOR_IMPL"
4
4
  ---
5
5
 
6
- # /asdlc-approve - Approve Spec & Cryptographic Lock
6
+ # /asdlc-approve - Approve Spec & Git SHA Lock
7
7
 
8
8
  Lock the approved specification state and unlock implementation for the change.
9
9
 
@@ -16,6 +16,6 @@ asdlc approve <CHANGE_ID>
16
16
  ## Behavior
17
17
 
18
18
  1. Evaluates human lead approval (or PR merge commit on target branch).
19
- 2. Computes and locks cryptographic `approvedSha` for the spec files.
19
+ 2. Computes and locks the Git-anchored `approvedSha` snapshot for the spec files.
20
20
  3. Stamps `review.md` with `verdict: APPROVE` and `specSha`.
21
21
  4. Transitions change state to `READY_FOR_IMPL`.
@@ -11,7 +11,7 @@ context: |
11
11
  asdlc approve <ID> after the spec PR merges: record the approved SHA
12
12
  asdlc apply <ID> guard, then /opsx-apply
13
13
  asdlc verify <ID> check the implementation
14
- asdlc archive <ID> finish (refresh the graph + AGENTS.md)
14
+ asdlc archive <ID> post-merge compaction (sync living specs; refresh AGENTS.md only on constitutional changes)
15
15
  - The spec PR carries intent: proposal + spec delta + review.md (a change-dir
16
16
  convention). tasks.md is execution state, generated AFTER approval.
17
17
  - A code knowledge graph runs behind the scenes (graphify-out/); `asdlc new`
@@ -39,6 +39,12 @@ rollout_mode: {}
39
39
  # allow: agent may search (default); deny: offline/air-gapped mode, agent skips search silently.
40
40
  web_search: allow
41
41
 
42
+ # Smart staging hygiene for `asdlc pr`: skips untracked secrets, crash dumps, and
43
+ # oversized blobs (> max_file_size_mb) with a warning without halting automation.
44
+ staging:
45
+ max_file_size_mb: 50
46
+ ignore_patterns: []
47
+
42
48
  # Issue tracker integration (optional). Set required: true to enforce a ticket link in verify.
43
49
  # type: jira | github | linear | none
44
50
  issue_tracker:
@@ -199,6 +199,7 @@
199
199
  "properties": {
200
200
  "level": { "type": "string", "enum": ["L0", "L1", "L2", "L3"] },
201
201
  "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
202
+ "evaluator_mode": { "type": "string", "enum": ["agent_native", "llm_classifier", "heuristic_seed"] },
202
203
  "evidence": {
203
204
  "type": "array",
204
205
  "items": {
@@ -207,7 +208,7 @@
207
208
  "additionalProperties": false,
208
209
  "properties": {
209
210
  "id": { "type": "string" },
210
- "kind": { "type": "string", "enum": ["repository_fact", "task_statement", "scanner_result", "rule_hit", "reviewer_finding"] },
211
+ "kind": { "type": "string", "enum": ["repository_fact", "task_statement", "scanner_result", "rule_hit", "reviewer_finding", "semantic_intent", "topology_centrality"] },
211
212
  "signal": { "type": "string", "enum": ["hard", "soft"] },
212
213
  "summary": { "type": "string" },
213
214
  "source": { "type": "string" },
@@ -1,168 +1,168 @@
1
- name: agentic-repo-change
2
- version: 1
3
- description: Agentic SDLC change flow - intent (proposal/specs/review) then, after approval, tasks
4
- artifacts:
5
- - id: proposal
6
- generates: proposal.md
7
- description: WHY this change is needed
8
- template: proposal.md
9
- instruction: |
10
- Create the proposal establishing WHY this change is needed.
11
-
12
- Sections:
13
- - **Why**: 1-2 sentences on the problem or opportunity, and why now.
14
- - **What Changes**: specific changes; mark breaking changes with **BREAKING**.
15
- - **Capabilities**: which spec deltas will be created/modified. Each needs a
16
- corresponding specs/**/*.md file.
17
- - **Impact**: affected code, APIs, dependencies, systems.
18
- - **Out of Scope**: what this change explicitly does NOT cover.
19
- - **Dependencies & Assumptions**: what this assumes about other systems/teams.
20
- - **System Design refs**: reference any System Design / cross-repo contract
21
- this change touches (e.g. payment-settlement@v2). Leave empty if none.
22
-
23
- Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
24
- graph and wrote explore.md (structured queries against the real code, not
25
- guesses). Read explore.md, then READ the specific files it points to (and
26
- openspec/specs/**) before writing. If you need more detail, query the
27
- graph directly: `graphify query "<q>"` / `graphify explain <node>` /
28
- `graphify path <A> <B>`. The graph is a navigation map, never the truth.
29
-
30
- Keep it 1-2 pages. Focus on WHY; HOW belongs in design.md.
31
- requires: []
32
-
33
- - id: specs
34
- generates: "specs/**/*.md"
35
- description: Approved intent - behavior contract for this repo
36
- template: spec.md
37
- instruction: |
38
- Create the spec delta(s). This is the APPROVED INTENT artifact, not an
39
- implementation plan. Enforced by `asdlc lint`:
40
-
41
- Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
42
- graph and wrote explore.md. Read explore.md, then READ the files it points
43
- to (and openspec/specs/**) before writing. The graph is a map, not the truth.
44
-
45
- - Each requirement: `### Requirement: <name>` using SHALL/MUST.
46
- - Each scenario: `#### Scenario: <name>` with GIVEN / WHEN / THEN (4 '#').
47
- - Each requirement needs an `**Acceptance criteria**` block:
48
- `- [ ] AC1: <concrete, testable assertion - not prose> (test: <path/to/test>)`
49
- - Add a `## Constraints & NFRs` section: performance, security, compliance
50
- as verifiable statements, not adjectives (e.g. "p99 < 200ms for read ops").
51
- - Add a `## Out of Scope` section: what this change explicitly does NOT cover.
52
- - Add a `## Test Strategy` section describing how every AC is verified.
53
- - New capabilities: first section is `## Purpose` (50+ chars).
54
- - Every requirement must reference its Jira story (the change ID is the key).
55
-
56
- Exclude internal class/function names and implementation steps - those
57
- belong in design.md or tasks.md.
58
-
59
- IMPORTANT: once approved (PR merged) this is IMMUTABLE. Never edit it to
60
- record execution state - that is what tasks.md is for.
61
- requires:
62
- - proposal
63
-
64
- - id: review
65
- generates: review.md
66
- description: Independent fresh-context review output (read-only)
67
- template: review.md
68
- instruction: |
69
- You are an INDEPENDENT reviewer with a FRESH CONTEXT, different from the
70
- Draft agent. You MUST NOT modify proposal.md, specs/** or tasks.md. Your
71
- only output is review.md.
72
-
73
- Give a verdict per dimension (PASS / CONCERN / FAIL):
74
- Completeness, Ambiguity, Cross-repo consistency, Contract impact,
75
- Testability, Security.
76
-
77
- Findings must have severity: blocker / major / minor.
78
-
79
- Also produce a requirement -> implementation -> test mapping table
80
- (implementation/test may be TBD pre-code; AC must be listed).
81
-
82
- End with an overall verdict APPROVE / NEEDS_REVISION and the blocking
83
- findings. Do not rubber-stamp.
84
- requires:
85
- - specs
86
-
87
- - id: design
88
- generates: design.md
89
- description: Repo-internal technical design (HOW) - required for UI and external APIs
90
- template: design.md
91
- instruction: |
92
- Required when the change introduces UI/frontend views, 3rd-party API integrations,
93
- architectural patterns, new data models, or security/perf complexity. Mandatory in asdlc lint.
94
-
95
- Sections:
96
- - **Context & Background**: constraints, current architecture.
97
- - **System Architecture**: component interaction, Mermaid sequence/flowcharts.
98
- - **Interface Contracts**: TypeScript interfaces / schemas for requests & responses.
99
- - **External API Integration**: endpoints, auth, rate-limits, client caching & error taxonomy.
100
- - **UI/UX Design & Aesthetics**: tokens, typography, component layout, responsive breakpoints (mobile/tablet/desktop), and states (loading/empty/error).
101
- - **Security & NFRs**: input validation, path traversal defense, resource bounds.
102
- - **Decisions & Migration**: choices made with rationale and deployment plan.
103
-
104
- Do NOT restate requirements. Do NOT make cross-repo design decisions here;
105
- raise a System Design Amendment instead.
106
- requires:
107
- - proposal
108
-
109
- - id: tasks
110
- generates: tasks.md
111
- description: Mutable execution checklist - generated AFTER approval
112
- template: tasks.md
113
- instruction: |
114
- Create the implementation checklist from the APPROVED spec. tasks.md is
115
- MUTABLE EXECUTION STATE and is NOT part of approved intent - never edit
116
- the spec to record progress.
117
-
118
- Format:
119
- - Group related tasks under `## N. <group>` headings
120
- - Follow task-level TDD structure: pair test creation with implementation
121
- (`- [ ] N.M [TEST] ... (AC<n>) verify: <command>`) followed by
122
- (`- [ ] N.M+1 [IMPL] ... (AC<n>) evidence: <pass-evidence>`)
123
- - Every task references the AC it implements and states its verification method
124
- - Include test execution output under completed tasks as immutable evidence
125
- - Order by dependency
126
- requires:
127
- - specs
128
- - review
129
-
130
- apply:
131
- requires: [tasks]
132
- tracks: tasks.md
133
- instruction: |
134
- Work through the pending tasks in tasks.md. For EACH task, follow task-level
135
- TDD (v6 5.2):
136
- 1. write a FAILING test that expresses the task's verification;
137
- 2. implement the minimum to make it pass;
138
- 3. run the tests and PASTE the output under the task before claiming it is done;
139
- 4. before moving on, a fresh-context reviewer checks the task against the
140
- approved spec first, code quality second.
141
- Mark each task complete only after its verification passes and test evidence is recorded.
142
-
143
- NEVER modify the spec (approved intent: proposal.md, specs/**).
144
-
145
- CONVERGE = Report First (v6 6). When reality disagrees with the spec, first
146
- classify the gap and NEVER silently absorb it into code:
147
- A implementation error -> write a reproducing test, append a fix task, stay in this PR
148
- B missing test -> add the test, stay in this PR
149
- C spec gap/conflict -> STOP the affected tasks and report a SPEC_GAP
150
- (needs the spec approver; see asdlc review/lint)
151
- D post-merge defect -> new Jira bug; spec said the right thing -> fast fix,
152
- spec itself wrong -> new change
153
- Cross-repo contract changes are always C: stop and raise a System Design
154
- Amendment - never absorb them here.
155
-
156
- archive:
157
- description: Sync living specs, update README, and conditionally update AGENTS.md
158
- instruction: |
159
- Archive the verified change:
160
- 1. Living Specs (Knowledge Layer):
161
- Merge delta specs into `openspec/specs/` and record the capability in `README.md`.
162
- Do NOT touch `AGENTS.md` for standard business or feature specs (zero prompt pollution).
163
- 2. Constitutional Changes (Governance Layer):
164
- Automatically detected when the change modifies governance policies, SDLC rules,
165
- or workflow contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `AGENTS.md`, `governance/**`).
166
- In these cases, `AGENTS.md` is automatically refreshed so all agent IDE sessions
167
- immediately adhere to the updated constitution.
168
-
1
+ name: agentic-repo-change
2
+ version: 1
3
+ description: Agentic SDLC change flow - intent (proposal/specs/review) then, after approval, tasks
4
+ artifacts:
5
+ - id: proposal
6
+ generates: proposal.md
7
+ description: WHY this change is needed
8
+ template: proposal.md
9
+ instruction: |
10
+ Create the proposal establishing WHY this change is needed.
11
+
12
+ Sections:
13
+ - **Why**: 1-2 sentences on the problem or opportunity, and why now.
14
+ - **What Changes**: specific changes; mark breaking changes with **BREAKING**.
15
+ - **Capabilities**: which spec deltas will be created/modified. Each needs a
16
+ corresponding specs/**/*.md file.
17
+ - **Impact**: affected code, APIs, dependencies, systems.
18
+ - **Out of Scope**: what this change explicitly does NOT cover.
19
+ - **Dependencies & Assumptions**: what this assumes about other systems/teams.
20
+ - **System Design refs**: reference any System Design / cross-repo contract
21
+ this change touches (e.g. payment-settlement@v2). Leave empty if none.
22
+
23
+ Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
24
+ graph and wrote explore.md (structured queries against the real code, not
25
+ guesses). Read explore.md, then READ the specific files it points to (and
26
+ openspec/specs/**) before writing. If you need more detail, query the
27
+ graph directly: `graphify query "<q>"` / `graphify explain <node>` /
28
+ `graphify path <A> <B>`. The graph is a navigation map, never the truth.
29
+
30
+ Keep it 1-2 pages. Focus on WHY; HOW belongs in design.md.
31
+ requires: []
32
+
33
+ - id: specs
34
+ generates: "specs/**/*.md"
35
+ description: Approved intent - behavior contract for this repo
36
+ template: spec.md
37
+ instruction: |
38
+ Create the spec delta(s). This is the APPROVED INTENT artifact, not an
39
+ implementation plan. Enforced by `asdlc lint`:
40
+
41
+ Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
42
+ graph and wrote explore.md. Read explore.md, then READ the files it points
43
+ to (and openspec/specs/**) before writing. The graph is a map, not the truth.
44
+
45
+ - Each requirement: `### Requirement: <name>` using SHALL/MUST.
46
+ - Each scenario: `#### Scenario: <name>` with GIVEN / WHEN / THEN (4 '#').
47
+ - Each requirement needs an `**Acceptance criteria**` block:
48
+ `- [ ] AC1: <concrete, testable assertion - not prose> (test: <path/to/test>)`
49
+ - Add a `## Constraints & NFRs` section: performance, security, compliance
50
+ as verifiable statements, not adjectives (e.g. "p99 < 200ms for read ops").
51
+ - Add a `## Out of Scope` section: what this change explicitly does NOT cover.
52
+ - Add a `## Test Strategy` section describing how every AC is verified.
53
+ - New capabilities: first section is `## Purpose` (50+ chars).
54
+ - Every requirement must reference its Jira story (the change ID is the key).
55
+
56
+ Exclude internal class/function names and implementation steps - those
57
+ belong in design.md or tasks.md.
58
+
59
+ IMPORTANT: once approved (PR merged) this is IMMUTABLE. Never edit it to
60
+ record execution state - that is what tasks.md is for.
61
+ requires:
62
+ - proposal
63
+
64
+ - id: review
65
+ generates: review.md
66
+ description: Independent fresh-context review output (read-only)
67
+ template: review.md
68
+ instruction: |
69
+ You are an INDEPENDENT reviewer with a FRESH CONTEXT, different from the
70
+ Draft agent. You MUST NOT modify proposal.md, specs/** or tasks.md. Your
71
+ only output is review.md.
72
+
73
+ Give a verdict per dimension (PASS / CONCERN / FAIL):
74
+ Completeness, Ambiguity, Cross-repo consistency, Contract impact,
75
+ Testability, Security.
76
+
77
+ Findings must have severity: blocker / major / minor.
78
+
79
+ Also produce a requirement -> implementation -> test mapping table
80
+ (implementation/test may be TBD pre-code; AC must be listed).
81
+
82
+ End with an overall verdict APPROVE / NEEDS_REVISION and the blocking
83
+ findings. Do not rubber-stamp.
84
+ requires:
85
+ - specs
86
+
87
+ - id: design
88
+ generates: design.md
89
+ description: Repo-internal technical design (HOW) - required for UI and external APIs
90
+ template: design.md
91
+ instruction: |
92
+ Required when the change introduces UI/frontend views, 3rd-party API integrations,
93
+ architectural patterns, new data models, or security/perf complexity. Mandatory in asdlc lint.
94
+
95
+ Sections:
96
+ - **Context & Background**: constraints, current architecture.
97
+ - **System Architecture**: component interaction, Mermaid sequence/flowcharts.
98
+ - **Interface Contracts**: TypeScript interfaces / schemas for requests & responses.
99
+ - **External API Integration**: endpoints, auth, rate-limits, client caching & error taxonomy.
100
+ - **UI/UX Design & Aesthetics**: tokens, typography, component layout, responsive breakpoints (mobile/tablet/desktop), and states (loading/empty/error).
101
+ - **Security & NFRs**: input validation, path traversal defense, resource bounds.
102
+ - **Decisions & Migration**: choices made with rationale and deployment plan.
103
+
104
+ Do NOT restate requirements. Do NOT make cross-repo design decisions here;
105
+ raise a System Design Amendment instead.
106
+ requires:
107
+ - proposal
108
+
109
+ - id: tasks
110
+ generates: tasks.md
111
+ description: Mutable execution checklist - generated AFTER approval
112
+ template: tasks.md
113
+ instruction: |
114
+ Create the implementation checklist from the APPROVED spec. tasks.md is
115
+ MUTABLE EXECUTION STATE and is NOT part of approved intent - never edit
116
+ the spec to record progress.
117
+
118
+ Format:
119
+ - Group related tasks under `## N. <group>` headings
120
+ - Follow task-level TDD structure: pair test creation with implementation
121
+ (`- [ ] N.M [TEST] ... (AC<n>) verify: <command>`) followed by
122
+ (`- [ ] N.M+1 [IMPL] ... (AC<n>) evidence: <pass-evidence>`)
123
+ - Every task references the AC it implements and states its verification method
124
+ - Include test execution output under completed tasks as immutable evidence
125
+ - Order by dependency
126
+ requires:
127
+ - specs
128
+ - review
129
+
130
+ apply:
131
+ requires: [tasks]
132
+ tracks: tasks.md
133
+ instruction: |
134
+ Work through the pending tasks in tasks.md. For EACH task, follow task-level
135
+ TDD (v6 5.2):
136
+ 1. write a FAILING test that expresses the task's verification;
137
+ 2. implement the minimum to make it pass;
138
+ 3. run the tests and PASTE the output under the task before claiming it is done;
139
+ 4. before moving on, a fresh-context reviewer checks the task against the
140
+ approved spec first, code quality second.
141
+ Mark each task complete only after its verification passes and test evidence is recorded.
142
+
143
+ NEVER modify the spec (approved intent: proposal.md, specs/**).
144
+
145
+ CONVERGE = Report First (v6 6). When reality disagrees with the spec, first
146
+ classify the gap and NEVER silently absorb it into code:
147
+ A implementation error -> write a reproducing test, append a fix task, stay in this PR
148
+ B missing test -> add the test, stay in this PR
149
+ C spec gap/conflict -> STOP the affected tasks and report a SPEC_GAP
150
+ (needs the spec approver; see asdlc review/lint)
151
+ D post-merge defect -> new Jira bug; spec said the right thing -> fast fix,
152
+ spec itself wrong -> new change
153
+ Cross-repo contract changes are always C: stop and raise a System Design
154
+ Amendment - never absorb them here.
155
+
156
+ archive:
157
+ description: Sync living specs into openspec/specs/ and conditionally update AGENTS.md
158
+ instruction: |
159
+ Archive the verified change:
160
+ 1. Living Specs (Knowledge Layer):
161
+ Merge delta specs into `openspec/specs/` and record the capability in `README.md`.
162
+ Do NOT touch `AGENTS.md` for standard business or feature specs (zero merge-conflict hotspot & zero prompt pollution).
163
+ 2. Constitutional Changes (Governance Layer):
164
+ Automatically detected when the change modifies governance policies, SDLC rules,
165
+ or workflow contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `AGENTS.md`, `governance/**`).
166
+ In these cases, `AGENTS.md` is automatically refreshed so all agent IDE sessions
167
+ immediately adhere to the updated constitution.
168
+
@@ -25,7 +25,7 @@ Before editing any implementation or test code, run the apply guard:
25
25
  asdlc apply <CHANGE_ID> [--auto-pr] [--target-branch <ref>]
26
26
  ```
27
27
 
28
- `asdlc apply` deterministically verifies cryptographic preconditions:
28
+ `asdlc apply` deterministically verifies Git-anchored preconditions:
29
29
  1. **Target Branch Approved Commit (`approvedSha`)**: Confirms that a commit touching the locked paths (`proposal.md` and `specs/**`) is physically merged into the target branch (`main` or `origin/main`).
30
30
  2. **Change State Machine (`ready_for_impl`)**: Confirms `.openspec.yaml` has been transitioned to `status: ready_for_impl` (via `asdlc approve <ID>`).
31
31
  3. **Spec Fingerprint Integrity (`specSha`)**: Verifies that the declared `specSha` in `.openspec.yaml` exactly matches the `approvedSha` on the protected branch.
@@ -13,7 +13,7 @@ This skill executes **Stage 4 (Approve)** of the Agentic SDLC. It transitions a
13
13
 
14
14
  `asdlc approve` is **branch-agnostic**. It does not enforce a rigid branching dogma, nor does it require selecting artificial "modes".
15
15
 
16
- In enterprise environments (whether using `feature -> staging -> main`, trunk-based, or multi-level git flow), **Approve** represents a single cryptographic gate:
16
+ In enterprise environments (whether using `feature -> staging -> main`, trunk-based, or multi-level git flow), **Approve** represents a single Git-anchored tamper-detection gate:
17
17
 
18
18
  ```text
19
19
  [Stage 2: Grilling / Proposal]
@@ -52,7 +52,7 @@ From this moment on, **Stage 5 (`asdlc apply`) is unlocked**, and **Stage 6 (`as
52
52
 
53
53
  ### 2. Spec-First Staged PR Flow (Multi-tier Enterprise Pipelines)
54
54
  - Spec is submitted as an isolated Spec-only PR into `staging` or `main`.
55
- - When the Spec PR merges, the `post-merge` hook or CI automatically runs `asdlc approve <ID>`.
55
+ - When the Spec PR merges, the target-branch merge commit SHA is recognized by `asdlc apply` and `asdlc verify`, or stamped via `asdlc approve <ID>`.
56
56
  - The implementation is then performed on an implementation branch branching from the approved merge commit.
57
57
 
58
58
  ### 3. Local / In-Place Fast Loop (Agile Squads)