Skip to content

Commit f16167e

Browse files
committed
docs: document TRP1 intent-traceability implementation in README
1 parent 2ccde1e commit f16167e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,46 @@ We use [changesets](https://github.com/changesets/changesets) for versioning and
155155

156156
---
157157

158+
## TRP1 Challenge – Intent-Code Traceability Hook System
159+
160+
This fork implements an AI-Native Intent-Code Traceability layer for the TRP1 Week 1 challenge, adding governance and semantic tracking to Roo Code's AI agent workflow.
161+
162+
### Phase 0 – Archaeological Dig
163+
- Documented extension architecture and tool execution flow in [`ARCHITECTURE_NOTES.md`](ARCHITECTURE_NOTES.md)
164+
- Mapped tool routing (`presentAssistantMessage`) and system prompt builder (`SYSTEM_PROMPT`)
165+
- Identified hook injection points for middleware integration
166+
167+
### Phase 1 – Reasoning Loop & Context Loader ✅
168+
- **New Native Tool**: `select_active_intent(intent_id)` enforces two-stage state machine (intent selection → contextualized action)
169+
- **Hook Middleware**: `HookEngine` wraps all destructive tools with pre/post-hooks for governance and traceability
170+
- **Orchestration Sidecar**: `.orchestration/` directory implements AI-native Git layer:
171+
- `active_intents.yaml` – Intent specifications with scope, constraints, acceptance criteria
172+
- `agent_trace.jsonl` – Append-only ledger linking Intent → Code Hash
173+
- `intent_map.md` – Spatial mapping of intents to files
174+
- `AGENT.md` – Shared knowledge base
175+
- **Context Loader**: `select_active_intent` returns `<intent_context>` XML with intent specs + recent history from trace entries
176+
177+
### Phase 2 – Hook Middleware & Security (Partial)
178+
- **Command Classification**: Safe (read) vs Destructive (write/execute) tools
179+
- **UI-Blocking Authorization**: Modal approval required for intent evolution (Human-in-the-Loop)
180+
- **Scope Enforcement**: File paths validated against intent's `owned_scope` patterns
181+
- **Post-Hook Trace Logging**: Automatic logging to `agent_trace.jsonl` with content hashing
182+
183+
### Documentation & Testing
184+
- [`docs/Architecture.md`](docs/Architecture.md) – High-level architecture overview
185+
- [`ARCHITECTURE_NOTES.md`](ARCHITECTURE_NOTES.md) – Detailed codebase mapping and injection points
186+
- [`docs/UI-Blocking-Authorization.md`](docs/UI-Blocking-Authorization.md) – HITL governance design
187+
- [`docs/TESTING-PHASE1.md`](docs/TESTING-PHASE1.md) – Manual testing guide
188+
- [`docs/PHASE1-TEST-RESULTS.md`](docs/PHASE1-TEST-RESULTS.md) – Test execution results (5/5 passing)
189+
190+
### Key Files
191+
- `src/core/hooks/HookEngine.ts` – Hook middleware implementation
192+
- `src/core/orchestration/OrchestrationDataModel.ts` – Data model for `.orchestration/` directory
193+
- `src/core/tools/SelectActiveIntentTool.ts` – Intent selection tool
194+
- `src/core/tools/__tests__/selectActiveIntentTool.spec.ts` – Phase 1 test suite
195+
196+
---
197+
158198
## Disclaimer
159199

160200
**Please note** that Roo Code, Inc does **not** make any representations or warranties regarding any code, models, or other tools provided or made available in connection with Roo Code, any associated third-party tools, or any resulting outputs. You assume **all risks** associated with the use of any such tools or outputs; such tools are provided on an **"AS IS"** and **"AS AVAILABLE"** basis. Such risks may include, without limitation, intellectual property infringement, cyber vulnerabilities or attacks, bias, inaccuracies, errors, defects, viruses, downtime, property loss or damage, and/or personal injury. You are solely responsible for your use of any such tools or outputs (including, without limitation, the legality, appropriateness, and results thereof).

0 commit comments

Comments
 (0)