mode_compare: grounding check + control flag + emoji-tolerant section detection
lakehouse/auditor 1 blocking issue: todo!() macro call in tests/real-world/scrum_master_pipeline.ts
lakehouse/auditor 1 blocking issue: todo!() macro call in tests/real-world/scrum_master_pipeline.ts
Three fixes after the playbook_only confabulation surfaced in 2026-04-26 experiment (8 'findings' on a 333-line file all citing lines 378-945 — fully fabricated from pathway-memory pattern names). (1) Aggregator regex bug — section detection failed on emoji-prefixed markdown headers like `## 🔎 Ranked Findings`. The original regex required word chars right after #{1,3}\s+, so the patches table header `## 🛠️ Concrete Patch Suggestions` was never recognized as a stop boundary, double-counting every finding. Fix: allow non-letter chars (emoji/space) between # and the keyword. (2) Grounding check — for each finding row in the response, extract backtick-quoted symbols + cited line numbers; verify symbols exist in the actual focus file and lines fall within EOF. Computes grounded/total ratio per mode. Surfaces 'OOB' (out-of-bounds) count explicitly so confabulation is visible at a glance. Confirms what hand-grading found: codereview_playbook_only's 8 findings on service.rs were 1/8 grounded with 7 OOB. (3) Control mode tagging — codereview_null and codereview_playbook_only are designed as falsifiers (baseline / lossy ceiling) and their numerical wins should never be read as recommendations. Output marks them with ⚗ glyph + warning footer. Per-mode aggregate is now sorted by groundedness, not raw count. Per-mode-vs-lakehouse comparison uses grounded findings, not raw — so confabulation can no longer score a "win". Updated SCRUM_MASTER_SPEC.md with refactor timeline pointing at the 2026-04-25/26 commits (observer fix, relevance filter, retire wire, mode router, enrichment runner, parameterized experiment). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
# Scrum Master Pipeline — Spec + Current State
|
||||
|
||||
**Status:** Active iteration on branch `scrum/auto-apply-19814` → PR #11 at git.agentview.dev/profit/lakehouse
|
||||
**Last iter:** 9 (2026-04-24)
|
||||
**Branch commit head:** `f4cff66` (ADR-021 Phase D fix)
|
||||
**Branch commit head:** see `git log --oneline -1 scrum/auto-apply-19814` (auto-stale; check it)
|
||||
|
||||
> **2026-04-25 — see also `docs/MATRIX_AGENT_HANDOVER.md`** for the
|
||||
> standalone `matrix-agent-validated` repo split + the Ansible playbook
|
||||
@@ -10,7 +9,45 @@
|
||||
> (partial deploy); the real destination is the `matrix-test` Incus
|
||||
> container at 10.111.129.50.
|
||||
|
||||
This doc is the single handoff artifact for the scrum-master + auto-apply + pathway-memory loop built during 2026-04-24 sessions. A fresh Claude Code session reading this + `docs/DECISIONS.md` (ADR-020 and ADR-021 specifically) + `MEMORY.md` should have the same context as the session that wrote it.
|
||||
This doc is the single handoff artifact for the scrum-master + auto-apply + pathway-memory loop. A fresh Claude Code session reading this + `docs/DECISIONS.md` (ADR-020 and ADR-021) + `docs/MATRIX_AGENT_HANDOVER.md` + `MEMORY.md` should have the same context as the session that wrote it.
|
||||
|
||||
## ▶ Refactor timeline (read in order)
|
||||
|
||||
The pipeline has been refactored substantially since the 2026-04-24
|
||||
baseline below. Read the changes top-down to understand current shape:
|
||||
|
||||
### 2026-04-23 → 24 (foundation, captured in §1-§12 below)
|
||||
- 9-rung cloud ladder + tree-split + adversarial prompt
|
||||
- Pathway memory base + ADR-021 semantic-correctness layer
|
||||
- Hardened auto-applier (5 gates: confidence/size/cargo/warnings/rationale)
|
||||
- Hand-review wire (commit `3f166a5`) — judgment moved out of inner loop
|
||||
- Anchor-grounding post-verifier (commit `9cc0ceb` / `9ecc584`)
|
||||
- Single-model retry with enrichment (commit `d187bcd`) — stop cascading on quality
|
||||
- Unified matrix retriever pulling from ALL KB corpora (commit `a496ced`)
|
||||
- Paid OpenRouter ladder + Kimi K2.6 + Gemini 2.5 (commit `4ac5656`)
|
||||
- Goal-driven autonomous loop harness (commit `e79e51e`)
|
||||
|
||||
### 2026-04-25 → 26 (architectural through-line — read these next)
|
||||
- **Observer health-probe TypeConfusion fix** (`54689d5`) — `r.json()` on text/plain `/health` was crash-looping the observer; sealed in pathway_memory as `TypeConfusion:fetch-health-json`.
|
||||
- **Adjacency-pollution relevance filter** (`0115a60`) — observer `/relevance` endpoint + scrum wiring (`LH_RELEVANCE_FILTER` / `LH_RELEVANCE_THRESHOLD`). Drops chunks about symbols the focus file IMPORTS but doesn't define.
|
||||
- **Audit-consensus → retire wire** (`626f18d`) — when observer rejects a hot-swap-recommended attempt, immediately call `/vectors/pathway/retire` on the trace. `HotSwapCandidate` gained `trace_uid` for single-trace precision. Confidence ≥0.7 gate avoids retiring on heuristic-fallback verdicts.
|
||||
- **`/v1/mode` router phase 1** (`d277efb`) — task_class → mode/model decision endpoint with `config/modes.toml`. Decision-only; doesn't execute.
|
||||
- **Native enrichment runner** (`86f63a0`) — `codereview_lakehouse` mode that COMPOSES every primitive (focus file + bug fingerprints + relevance-filtered matrix + adversarial framing) into ONE prompt for one-shot success. `POST /v1/mode/execute`. Modes-as-prompt-molders, not model-pickers — see ★ Insight from session 2026-04-26.
|
||||
- **Parameterized runner + 5 experiment modes** (`7c47734`) — `codereview_lakehouse|null|isolation|matrix_only|playbook_only`. Each isolates one architectural axis. `scripts/mode_experiment.ts` sweeps files × modes; `scripts/mode_compare.ts` aggregates with grounding check (catches confabulation by comparing cited symbols to real file content).
|
||||
- **Scrum mode-runner fast path** (`7c47734`) — gated by `LH_USE_MODE_RUNNER=1`, scrum tries `/v1/mode/execute` BEFORE the 9-rung ladder. Falls through to ladder if response < `LH_MODE_MIN_CHARS` or anything errors. Off by default until A/B-validated.
|
||||
|
||||
### Verified architectural insights (2026-04-26 experiment)
|
||||
- `codereview_lakehouse` produces 100% grounded findings, beats every challenger.
|
||||
- `codereview_playbook_only` (pathway-only, no file content) confabulates ~50% of findings — keep as control, NEVER as recommendation.
|
||||
- `codereview_null` (no enrichment, generic prompt) produces 0 ranked findings — adversarial framing is load-bearing.
|
||||
- Matrix corpus contributes ~2 grounded findings vs isolation. Small but real.
|
||||
|
||||
### Where to read what
|
||||
- **Loop architecture (this doc, §1-§12):** original 2026-04-24 design.
|
||||
- **Modes-as-enrichment vision:** `crates/gateway/src/v1/mode.rs` doc comment + `config/modes.toml`.
|
||||
- **Mode experiment results:** `data/_kb/mode_experiments.jsonl` + `bun run scripts/mode_compare.ts`.
|
||||
- **Pathway memory mechanics:** `crates/vectord/src/pathway_memory.rs` + ADR-021 in `docs/DECISIONS.md`.
|
||||
- **Handover to fresh box:** `docs/MATRIX_AGENT_HANDOVER.md`.
|
||||
|
||||
## 1. What the loop is
|
||||
|
||||
|
||||
Reference in New Issue
Block a user