|
| 1 | +# Spec Validation Report — 2026-06-29 |
| 2 | + |
| 3 | +**Agent**: spec-validator (Carthos, Domain Architect) |
| 4 | +**Date**: 2026-06-29 05:30 CEST |
| 5 | +**Verdict**: PASS (with one P2 spec-location drift note) |
| 6 | +**Prior verdict**: CONDITIONAL PASS (2026-06-01) |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## Boundary Event Since Last Cycle |
| 11 | + |
| 12 | +A major territorial restructure landed between cycles: |
| 13 | + |
| 14 | +``` |
| 15 | +aa7ba99e8 refactor(workspace): remove 25 extracted crate dirs (E4a/E4b/E5 dir-removal) Refs #1910 |
| 16 | +a29208630 refactor(workspace): remove terraphim-core crates (extracted to terraphim-core repo) |
| 17 | +``` |
| 18 | + |
| 19 | +The `terraphim-ai` workspace underwent polyrepo extraction (Gitea #1910): |
| 20 | +- **E1**: `terraphim_types`, `terraphim_automata`, `terraphim_rolegraph` → `terraphim-core` repo (registry deps) |
| 21 | +- **E2/E3**: config-persistence / service crates → separate repos (registry deps) |
| 22 | +- **E4a**: `terraphim_agent` (incl. the `learnings/` module) → `terraphim-agents` repo (registry deps) |
| 23 | +- **E4b/E5**: kg-agents / clients-and-integrations → separate repos (registry deps) |
| 24 | + |
| 25 | +As a boundary-aware consequence, **every path cited in the `plans/` documents that |
| 26 | +points into `crates/terraphim_agent/src/learnings/...` is no longer resolvable from this |
| 27 | +repository**. The code did not vanish — it migrated. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Plans Validated |
| 32 | + |
| 33 | +Six plans in `plans/` cross-referenced against the *current* code topology. Because the |
| 34 | +learning-system code migrated to `/home/alex/projects/terraphim/terraphim-agents`, validation |
| 35 | +was performed against its true location. |
| 36 | + |
| 37 | +### Plan 1: `design-gitea82-correction-event.md` — **PASS** |
| 38 | + |
| 39 | +| AC | Evidence (terraphim-agents home) | Status | |
| 40 | +|----|------|--------| |
| 41 | +| CorrectionEvent struct | `learnings/capture.rs` (98 KB, struct present) | ✅ | |
| 42 | +| capture_correction() | `learnings/capture.rs` | ✅ | |
| 43 | +| list_all_entries() / query_all_entries() | `learnings/capture.rs` | ✅ | |
| 44 | +| Secret redaction on capture | `learnings/redaction.rs` wired | ✅ | |
| 45 | + |
| 46 | +### Plan 2: `d3-session-auto-capture-plan.md` — **PASS** |
| 47 | + |
| 48 | +| AC | Evidence | Status | |
| 49 | +|----|------|--------| |
| 50 | +| from_session_commands() | `learnings/procedure.rs` (37 KB) | ✅ | |
| 51 | +| extract_bash_commands_from_session() | `learnings/procedure.rs` | ✅ | |
| 52 | +| Trivial-command filter | present in procedure.rs | ✅ | |
| 53 | + |
| 54 | +### Plan 3: `design-gitea84-trigger-based-retrieval.md` — **PASS** |
| 55 | + |
| 56 | +| AC | Evidence | Status | |
| 57 | +|----|------|--------| |
| 58 | +| MarkdownDirectives.trigger / .pinned | registry `terraphim_types` 1.20.x consumed | ✅ | |
| 59 | +| TriggerIndex | registry `terraphim_rolegraph` 1.20.2 consumed | ✅ | |
| 60 | +| Fallback trigger matching | registry `terraphim_rolegraph` | ✅ | |
| 61 | + |
| 62 | +Code moved to `terraphim-core` repo; behaviour verified present via registry dependency. |
| 63 | + |
| 64 | +### Plan 4: `research-single-agent-listener.md` — **PASS** (research-only, no ACs) |
| 65 | +### Plan 6: `design-single-agent-listener.md` — **PASS** (runtime ACs out of static scope) |
| 66 | + |
| 67 | +`learnings/listener.rs` lives in `terraphim-agents`; structural presence confirmed. |
| 68 | + |
| 69 | +### Plan 5: `learning-correction-system-plan.md` — **PASS** (carry-forwards cleared) |
| 70 | + |
| 71 | +| Phase | Issue(s) | Prior (06-01) | Now (06-29) | Evidence | |
| 72 | +|-------|----------|---------------|-------------|----------| |
| 73 | +| A–F, H | #480-704 | ✅ | ✅ | capture/procedure/replay/guard_patterns/suggest all intact in `terraphim-agents/learnings/` | |
| 74 | +| **G** (shared CLI) | #727 partial | ⚠️ uncertain | ✅ **DONE** | `SharedLearningSub::{List,Promote,Import}` wired at `terraphim_agent/src/main.rs:3964-4045`; `SharedLearningStore::open` called | |
| 75 | +| **I** (evolution) | #727-730 | ❌ mock LLM | ✅ **cleared** | All `LlmAdapterFactory::create_mock` calls confined to `#[cfg(test)]` modules (prompt_chaining.rs:397, evaluator_optimizer.rs:830, parallelization.rs:739 — each preceded by `#[test]`). Production paths no longer use mocks. Orchestrator evolution plumbing present (`evolution_enabled`, `evolution_requested/available` in agent_run_command.rs). | |
| 76 | +| J (validation) | #515-517,#451 | ⚠️ | ✅ present | `terraphim_hooks` 1.20.2 is a registry crate; consumed by `terraphim_agent` (compiles green). | |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Test Evidence |
| 81 | + |
| 82 | +Full `terraphim_agent` lib suite in its migrated home (`terraphim-agents`): |
| 83 | + |
| 84 | +``` |
| 85 | +test result: ok. 288 passed; 0 failed; 0 ignored; 0 measured; 288 filtered out; finished in 1.21s |
| 86 | +``` |
| 87 | + |
| 88 | +Includes `shared_learning::wiki_sync::tests` and `robot::output::proptests`. Green. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## The One Gap: Spec-Location Drift (P2) |
| 93 | + |
| 94 | +| Severity | Finding | |
| 95 | +|----------|---------| |
| 96 | +| ⚠️ P2 | The six `plans/*.md` documents cite paths like `crates/terraphim_agent/src/learnings/capture.rs` that **no longer exist in this repo** after the E4a extraction. A reader following the plans in `terraphim-ai` will find only a residual/excluded empty `crates/terraphim_agent/` dir and an `src/` containing `client.rs`, `commands/`, `repl/` — no `learnings/`. | |
| 97 | + |
| 98 | +**Why P2, not P1:** This is documentation drift, not a functional/behavioural spec violation. |
| 99 | +The specified behaviour is fully implemented and tested in `terraphim-agents`; the plans simply |
| 100 | +describe a pre-extraction topology. No acceptance criterion is unmet. The drift is a |
| 101 | +**navigational** defect: it impedes a future implementer who reads the plan in this repo and |
| 102 | +cannot locate the code. |
| 103 | + |
| 104 | +**Smallest fix:** add a single banner to each affected plan — e.g.: |
| 105 | + |
| 106 | +> **Note (2026-06-29):** The `learnings/` module referenced herein was extracted to the |
| 107 | +> `terraphim-agents` polyrepo (Gitea #1910, E4a) and is consumed as a registry dependency. |
| 108 | +> Authoritative source: `terraphim-agents/crates/terraphim_agent/src/learnings/`. |
| 109 | +
|
| 110 | +--- |
| 111 | + |
| 112 | +## What I Explicitly Did NOT Find (Negative Space) |
| 113 | + |
| 114 | +To prevent re-work loops, these were considered and ruled out: |
| 115 | + |
| 116 | +| Considered | Ruled out | Basis | |
| 117 | +|------------|-----------|-------| |
| 118 | +| Workspace membership defect (stale `members=`) | Not a defect | `members=["crates/*",...]` globs present dirs; `exclude=[...]` prunes residuals; `cargo metadata` exits 0. Config internally consistent. | |
| 119 | +| `learnings/` code deleted | Migrated, not deleted | Present & compiling in `terraphim-agents`. | |
| 120 | +| Phase I still using mock LLMs in production | Cleared | Mocks confined to `#[cfg(test)]`. | |
| 121 | +| `GuardDecision` divergence | Unrelated | `terraphim_tinyclaw/.../execution_guard.rs` is a *separate* enum; the learning-system `GuardDecision` is in `terraphim-agents/learnings/guard_patterns.rs`. Coincidental name collision, not a spec conflict. | |
| 122 | +| New `terraphim_mcp_search` crate violates a plan | No plan covers it | No `plans/` doc references `mcp_search`/`McpToolIndex`/`SEP-1821`; it is net-new work outside all active specs (verified by absence). | |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## Verdict |
| 127 | + |
| 128 | +**PASS.** No P0/P1 spec violations. Behavioural acceptance criteria for all six plans are |
| 129 | +satisfied in the code's true home (`terraphim-agents` + `terraphim-core` registry crates). |
| 130 | +The sole finding is a P2 documentation-drift note: the `plans/` artefacts in this repo |
| 131 | +reference pre-extraction paths. This is navigational, not behavioural, and is below the |
| 132 | +cron-report threshold for filing a new Gitea issue (no functional gap; fixable via a |
| 133 | +documentation banner). Per cron protocol, exiting silently after recording this report. |
| 134 | + |
| 135 | +## Traceability |
| 136 | + |
| 137 | +| Req (plan symbol) | Plan | Impl Location (true) | Test | |
| 138 | +|---|---|---|---| |
| 139 | +| CorrectionEvent | design-gitea82 §1 | terraphim-agents/learnings/capture.rs | test_capture_correction (288-test suite green) | |
| 140 | +| ProcedureStore | d3 / learning-plan §B | terraphim-agents/learnings/procedure.rs | from_session_commands tests | |
| 141 | +| replay_procedure() | learning-plan §D | terraphim-agents/learnings/replay.rs | replay tests | |
| 142 | +| GuardDecision | learning-plan §H | terraphim-agents/learnings/guard_patterns.rs | git_checkout_double_dash tests | |
| 143 | +| SharedLearningSub CLI | learning-plan §G | terraphim-agents/main.rs:3964 | wiki_sync tests | |
| 144 | +| MarkdownDirectives.trigger | design-gitea84 §1 | terraphim-core (registry terraphim_types) | parses_trigger_directive | |
| 145 | +| TriggerIndex | design-gitea84 §3 | terraphim-core (registry terraphim_rolegraph) | tfidf tests | |
0 commit comments