|
| 1 | +active_intents: |
| 2 | + - id: INT-001 |
| 3 | + name: INT-001 — Intent-Code Traceability (Spec) |
| 4 | + status: IN_PROGRESS |
| 5 | + owned_scope: |
| 6 | + - src/core/assistant-message/** |
| 7 | + - src/core/tools/** |
| 8 | + - src/core/hooks/** |
| 9 | + - src/core/orchestration/** |
| 10 | + - src/core/prompts/** |
| 11 | + - .orchestration/** |
| 12 | + constraints: |
| 13 | + - Must enforce **intent selection before any destructive tool** |
| 14 | + (`write_to_file`, `edit_file`, `apply_diff`, etc.). |
| 15 | + - "Must keep **privilege separation**: UI emits events; extension host |
| 16 | + executes privileged actions; hooks are middleware." |
| 17 | + - Must log **spatially independent** traces via content hashing. |
| 18 | + acceptance_criteria: |
| 19 | + - Agent cannot write code before calling `select_active_intent(intent_id)`. |
| 20 | + - "When a file is written, a JSONL entry is appended to |
| 21 | + `.orchestration/agent_trace.jsonl` that includes:" |
| 22 | + - intent id |
| 23 | + - file path |
| 24 | + - line range (best-effort) |
| 25 | + - "`sha256:` content hash of the modified block" |
| 26 | + - "`.orchestration/active_intents.yaml` exists and contains this intent." |
| 27 | + created_at: 2026-02-18T08:56:57.063Z |
| 28 | + updated_at: 2026-02-18T08:56:57.086Z |
| 29 | + spec_hash: sha256:7966563e9a7886587d3c421761708195d8a1ce21addd4632f560965411fd839b |
| 30 | + spec_file: specs/INT-001-intent-code-traceability.md |
| 31 | + - id: INT-002 |
| 32 | + name: INT-002 — Hook System Implementation |
| 33 | + status: IN_PROGRESS |
| 34 | + owned_scope: |
| 35 | + - src/core/hooks/** |
| 36 | + - src/core/assistant-message/presentAssistantMessage.ts |
| 37 | + - src/core/tools/** |
| 38 | + - .orchestration/** |
| 39 | + constraints: |
| 40 | + - Must integrate with existing `presentAssistantMessage()` function |
| 41 | + without breaking current tool execution flow. |
| 42 | + - Pre-hooks must run **before** `tool.handle()` is called. |
| 43 | + - Post-hooks must run **after** `tool.execute()` completes but before |
| 44 | + result is returned. |
| 45 | + - Hook system must be non-blocking for non-destructive tools (read-only |
| 46 | + operations). |
| 47 | + - Must maintain backward compatibility with existing tools. |
| 48 | + acceptance_criteria: |
| 49 | + - "`HookEngine` class exists in `src/core/hooks/HookEngine.ts`." |
| 50 | + - Pre-hook validates intent selection for destructive tools |
| 51 | + (`write_to_file`, `edit_file`, `execute_command`, etc.). |
| 52 | + - Pre-hook enforces scope validation (file path must be within intent's |
| 53 | + `owned_scope`). |
| 54 | + - Post-hook logs trace entries to `.orchestration/agent_trace.jsonl` for |
| 55 | + mutating actions. |
| 56 | + - "`presentAssistantMessage()` integrates `HookEngine` with Pre-Hook and |
| 57 | + Post-Hook calls." |
| 58 | + - All existing tests pass after hook integration. |
| 59 | + created_at: 2026-02-18T08:56:57.094Z |
| 60 | + updated_at: 2026-02-18T08:56:57.094Z |
| 61 | + spec_hash: sha256:e10e923c607996643684be16016bc8305d7259b543eae623e92b5e49db8b902c |
| 62 | + spec_file: specs/INT-002-hook-system-implementation.md |
| 63 | + - id: INT-003 |
| 64 | + name: INT-003 — Two-Stage Reasoning Loop |
| 65 | + status: IN_PROGRESS |
| 66 | + owned_scope: |
| 67 | + - src/core/hooks/HookEngine.ts |
| 68 | + - src/core/prompts/sections/tool-use-guidelines.ts |
| 69 | + - src/core/tools/SelectActiveIntentTool.ts |
| 70 | + - src/core/task/Task.ts |
| 71 | + constraints: |
| 72 | + - "**Stage 1 (Reasoning Intercept):** Agent MUST call |
| 73 | + `select_active_intent(intent_id)` before any destructive tool." |
| 74 | + - "**Stage 2 (Contextualized Action):** Agent receives intent context and |
| 75 | + must include it when making code changes." |
| 76 | + - System prompt must enforce this protocol in tool-use guidelines. |
| 77 | + - Intent context must be injected into the agent's context before code |
| 78 | + generation. |
| 79 | + acceptance_criteria: |
| 80 | + - System prompt includes instructions requiring `select_active_intent` |
| 81 | + before code changes. |
| 82 | + - "`SelectActiveIntentTool` returns XML `<intent_context>` block with |
| 83 | + scope, constraints, and acceptance criteria." |
| 84 | + - Pre-hook blocks destructive tools if no active intent is selected. |
| 85 | + - Agent receives intent context in subsequent tool calls. |
| 86 | + - Intent context is logged in `agent_trace.jsonl` entries. |
| 87 | + created_at: 2026-02-18T08:56:57.098Z |
| 88 | + updated_at: 2026-02-18T08:56:57.098Z |
| 89 | + spec_hash: sha256:a75817698c5b1479c68e43dd41b04752d3a6df7c4af71f3ab60fdedf705e4dda |
| 90 | + spec_file: specs/INT-003-reasoning-loop.md |
| 91 | + - id: INT-004 |
| 92 | + name: INT-004 — Orchestration Directory Management |
| 93 | + status: IN_PROGRESS |
| 94 | + owned_scope: |
| 95 | + - src/core/orchestration/OrchestrationDataModel.ts |
| 96 | + - .orchestration/active_intents.yaml |
| 97 | + - .orchestration/agent_trace.jsonl |
| 98 | + - .orchestration/intent_map.md |
| 99 | + - .orchestration/AGENT.md |
| 100 | + constraints: |
| 101 | + - "`.orchestration/` directory must be machine-managed (not user-edited |
| 102 | + directly)." |
| 103 | + - "`active_intents.yaml` must be valid YAML and follow the schema defined |
| 104 | + in `document.md`." |
| 105 | + - "`agent_trace.jsonl` must be append-only (no modifications, only |
| 106 | + appends)." |
| 107 | + - All file operations must be atomic (write to temp file, then rename). |
| 108 | + - Directory and files must be initialized on first use. |
| 109 | + acceptance_criteria: |
| 110 | + - "`OrchestrationDataModel` class provides methods:" |
| 111 | + - "`initialize()`: Creates directory and initializes files if missing." |
| 112 | + - "`readActiveIntents()`: Parses and returns active intents." |
| 113 | + - "`appendAgentTrace()`: Appends trace entry to JSONL file." |
| 114 | + - "`updateIntentMap()`: Updates intent-to-file mapping." |
| 115 | + - "`appendAgentKnowledge()`: Appends to AGENT.md." |
| 116 | + - All methods handle errors gracefully and log failures. |
| 117 | + - Files are created with proper templates if missing. |
| 118 | + - YAML parsing validates schema and reports errors clearly. |
| 119 | + created_at: 2026-02-18T08:56:57.099Z |
| 120 | + updated_at: 2026-02-18T08:56:57.099Z |
| 121 | + spec_hash: sha256:659bd435cecc3223171c3fce81f671c26baac9ce354c9a6e3c967164983ed9fb |
| 122 | + spec_file: specs/INT-004-orchestration-directory.md |
| 123 | + - id: INT-005 |
| 124 | + name: INT-005 — Logging & Traceability |
| 125 | + status: IN_PROGRESS |
| 126 | + owned_scope: |
| 127 | + - src/core/hooks/HookEngine.ts` (Post-Hook implementation) |
| 128 | + - src/core/orchestration/OrchestrationDataModel.ts |
| 129 | + - .orchestration/agent_trace.jsonl |
| 130 | + - src/utils/git.ts` (for VCS revision tracking) |
| 131 | + constraints: |
| 132 | + - Trace entries must include `sha256:` content hash of modified code |
| 133 | + blocks. |
| 134 | + - Line ranges must be best-effort (may be approximate for complex edits). |
| 135 | + - "Each trace entry must link to:" |
| 136 | + - Intent ID |
| 137 | + - File path (relative to workspace root) |
| 138 | + - VCS revision (Git SHA) |
| 139 | + - Timestamp |
| 140 | + - Model identifier |
| 141 | + - Content hashing must be spatially independent (same code block = same |
| 142 | + hash regardless of file location). |
| 143 | + acceptance_criteria: |
| 144 | + - Post-hook computes SHA-256 hash of modified content for file tools. |
| 145 | + - "Trace entry includes all required fields per `document.md` schema:" |
| 146 | + - "`id` (UUID)" |
| 147 | + - "`timestamp` (ISO 8601)" |
| 148 | + - "`vcs.revision_id` (Git SHA)" |
| 149 | + - "`files[]` with `relative_path`, `conversations[]`, `ranges[]`, |
| 150 | + `content_hash`" |
| 151 | + - Trace entries are appended atomically to `agent_trace.jsonl`. |
| 152 | + - "Content hash format: `sha256:<hex>`." |
| 153 | + - Git SHA is retrieved from workspace root (handles non-Git repos |
| 154 | + gracefully). |
| 155 | + created_at: 2026-02-18T08:56:57.099Z |
| 156 | + updated_at: 2026-02-18T08:56:57.099Z |
| 157 | + spec_hash: sha256:2b3421a22c9e27a817e27aea652f3332cdbc821338b52e112ff654ff88c36317 |
| 158 | + spec_file: specs/INT-005-logging-traceability.md |
| 159 | + - id: INT-006 |
| 160 | + name: INT-006 — Testing & Validation |
| 161 | + status: IN_PROGRESS |
| 162 | + owned_scope: |
| 163 | + - src/core/hooks/**/*.test.ts |
| 164 | + - src/core/orchestration/**/*.test.ts |
| 165 | + - src/core/tools/SelectActiveIntentTool.test.ts |
| 166 | + - tests/integration/hook-system.test.ts |
| 167 | + - tests/e2e/intent-traceability.test.ts |
| 168 | + constraints: |
| 169 | + - Tests must not modify production `.orchestration/` files (use temp |
| 170 | + directories). |
| 171 | + - Tests must be deterministic and isolated (no shared state). |
| 172 | + - Integration tests must verify hook system works with real tool execution. |
| 173 | + - E2E tests must simulate full agent workflow (intent selection → code |
| 174 | + change → trace logging). |
| 175 | + acceptance_criteria: |
| 176 | + - Unit tests for `HookEngine.preHook()` and `HookEngine.postHook()`. |
| 177 | + - Unit tests for `OrchestrationDataModel` file operations. |
| 178 | + - Unit tests for `SelectActiveIntentTool` intent loading and context |
| 179 | + generation. |
| 180 | + - "Integration test: Verify Pre-Hook blocks destructive tool without |
| 181 | + intent." |
| 182 | + - "Integration test: Verify Post-Hook logs trace entry after file write." |
| 183 | + - "E2E test: Full workflow from intent selection to trace logging." |
| 184 | + - All tests pass in CI/CD pipeline. |
| 185 | + - Test coverage > 80% for hook and orchestration modules. |
| 186 | + created_at: 2026-02-18T08:56:57.099Z |
| 187 | + updated_at: 2026-02-18T08:56:57.100Z |
| 188 | + spec_hash: sha256:f8343d2839370244e2f1d7b6622494a96438c86b21f42b98b159eb34e33a59c6 |
| 189 | + spec_file: specs/INT-006-testing-validation.md |
| 190 | + - id: INT-007 |
| 191 | + name: INT-007 — Documentation & Knowledge Base |
| 192 | + status: IN_PROGRESS |
| 193 | + owned_scope: |
| 194 | + - ARCHITECTURE_NOTES.md |
| 195 | + - README.md` (Intent-Code Traceability section) |
| 196 | + - .orchestration/AGENT.md |
| 197 | + - docs/intent-traceability/ |
| 198 | + - CHANGELOG.md` (relevant entries) |
| 199 | + constraints: |
| 200 | + - "`ARCHITECTURE_NOTES.md` must document all injection points and hook |
| 201 | + integration." |
| 202 | + - '`AGENT.md` must be append-only knowledge base for "Lessons Learned".' |
| 203 | + - Documentation must be kept in sync with code changes. |
| 204 | + - API documentation must include examples for each public method. |
| 205 | + acceptance_criteria: |
| 206 | + - "`ARCHITECTURE_NOTES.md` includes:" |
| 207 | + - Tool execution flow diagram |
| 208 | + - Hook injection points with line numbers |
| 209 | + - System prompt modification points |
| 210 | + - Data model schemas |
| 211 | + - "`AGENT.md` includes:" |
| 212 | + - Lessons learned from implementation |
| 213 | + - Common pitfalls and solutions |
| 214 | + - Performance optimizations |
| 215 | + - Stylistic rules for intent specifications |
| 216 | + - README includes setup instructions and usage examples. |
| 217 | + - All public APIs are documented with JSDoc comments. |
| 218 | + - Documentation is reviewed and updated with each major change. |
| 219 | + created_at: 2026-02-18T08:56:57.100Z |
| 220 | + updated_at: 2026-02-18T08:56:57.100Z |
| 221 | + spec_hash: sha256:50566c7bdbddce41c4f739cab9631172321f2880e8cb7a35fdf8c0d1a1aa56b4 |
| 222 | + spec_file: specs/INT-007-documentation.md |
0 commit comments