feat: v0.5.1 — spec-gap wedge cuts + bicameral.history#36
Conversation
Surface cuts (wedge refactor): - Remove 6 skill dirs: brief, guided, status, search, scan-branch, doctor - Remove 5 MCP tool registrations from server.py (status, search, brief, scan_branch, doctor) - Delete handlers/scan_branch.py and handlers/doctor.py - Absorb brief presentation contract into bicameral-ingest/SKILL.md (step 5) - Absorb guided-mode contract into bicameral-preflight/SKILL.md (step 6+7) - handlers/brief.py, search_decisions.py, detect_drift.py, decision_status.py stay as internal modules (still called by preflight/ingest/history) New: bicameral.history tool (v0.5.1): - HistoryResponse + 5 sub-models in contracts.py (balance-sheet shape) - feature_group field on ingest payload + decision table + adapter write path - agent_session source type added to ingest enum - handlers/history.py — aggregation handler grouping by feature_group → query - bicameral.history registered in server.py (13 tools total) - skills/bicameral-history/SKILL.md - bicameral-ingest/SKILL.md step 1.5: feature group assignment + stop-and-ask - 11 tests in test_v0420_history.py, all passing Test updates (stale post-v0.5.0 rename): - compliance_check schema tests: intent_id → decision_id, compliant → verdict, v3 → v4 - test_v0411_latent_drift: p.intent_id → p.decision_id - test_phase1_l1_wiring: UPDATE/SELECT intent → decision table - test_extract_headless: bump step-1 size cap 8k → 10k (step 1.5 added) - test_v0417_jargon_hygiene: exempt bicameral-ingest from BM25/retrieval terms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (28)
📝 WalkthroughWalkthroughThis PR refactors the MCP tool architecture by removing five tools ( Changes
Sequence DiagramsequenceDiagram
participant Client as Client/Agent
participant Server as Server
participant Ledger as Ledger
participant Handler as history Handler
Client->>Server: call_tool("bicameral.history",<br/>feature_filter?, include_superseded?, as_of?)
Server->>Handler: handle_history(ctx, feature_filter, include_superseded, as_of)
Handler->>Ledger: _fetch_all_decisions_enriched()<br/>(with source_span reconstruction)
Ledger-->>Handler: enriched decisions + sources + fulfillment
Handler->>Handler: _normalize_source_type()<br/>for each decision
Handler->>Handler: _decision_status_for_history()<br/>(map internal→history status)
Handler->>Handler: _row_to_history_decision()<br/>convert to HistoryDecision objects
Handler->>Handler: _feature_key_for_row()<br/>group by feature_group/source_ref/default
Handler->>Handler: aggregate HistoryDecision[]<br/>into HistoryFeature containers
Handler->>Handler: _priority_for_feature()<br/>sort (drifted/ungrounded first)
Handler->>Handler: apply feature_filter<br/>(substring match, case-insensitive)
Handler->>Handler: optionally exclude superseded
Handler->>Handler: truncate to max 50 features<br/>(set truncated flag)
Handler->>Handler: resolve_head(repo_path)→as_of
Handler->>Server: return HistoryResponse<br/>(features[], truncated, total_features, as_of)
Server-->>Client: HistoryResponse JSON
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
First-round PASS audit cycle for the real heuristic+LLM extractor. Plan ships across six phases (Phase 0 cache contract evolution; Phase 1 deterministic Stage 1 classifier; Phase 2 trigger rules schema; Phase 3 real Anthropic SDK Stage 2; Phase 4 pipeline integration; Phase 5 corpus learner option-c). META_LEDGER entries #34-#36 capture: round-1 PASS audit, IMPLEMENT, and SUBSTANTIATION. Three audit advisories (extract() boundary, TeamServerRules typo, corpus learner table-source) all addressed inline during implementation. A proactive QorLogic Fixer code-quality sweep before commit produced 2 MED + 2 LOW findings; both MEDs landed (fail-soft on non-text content blocks; v2->v3 backfill integration test) with one surfacing a real defect (the migration's TYPE string was rejecting reads on pre-v3 rows with NONE classifier_version; corrected to TYPE option<string>). SYSTEM_STATE.md adds the Priority C v1.1 section: schema state (v4), architectural properties achieved (heuristic-first determinism + LLM-only-when-needed + rule-version-driven cache invalidation + all four "dynamic" angles wired), audit cycle outcomes. Merkle seal: SHA256(content_hash + previous_hash) = b37003661820e2ef80591b9d0cfdeac3df092d6d9b4b5d87e3036e7ccf37d95b (content_hash e8b1b6b6..., previous_hash dcb61910... = Priority C v1 SEAL at Entry #33). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three-round audit cycle (VETO → VETO → PASS) for closing v0 release blockers issues #160 (materializer event_type mismatch) and #161 (channel_allowlist not populated). META_LEDGER entries #37-#41 capture: round-1 VETO (infrastructure- mismatch — pull_team_server_events had zero production callers), round-2 VETO (specification-drift — sketch passed wrapped adapter without unwrap; would echo events O(N²) cross-dev), round-3 PASS, IMPLEMENT, SUBSTANTIATION. SHADOW_GENOME #7 heuristic catalog grew 4→6 across this branch: - Heuristic 5 (upstream-consumer) — Entry #37 - Heuristic 6 (wrapper-side-effect) — Entry #38 The catalog is the productive deposit beyond the code; each heuristic is a durable detection pattern reusable in future audits. SYSTEM_STATE.md adds the v0 release-blockers section: end-to-end ingest pipeline now functional (Slack OAuth → workspace row → YAML allowlist sync → channel_allowlist → Slack worker polls → heuristic+ LLM extraction → team_event → /events HTTP → per-dev consumer pulls → bridges to IngestPayload → per-dev local ledger). Merkle seal: SHA256(content_hash + previous_hash) = 7cc405fc8d39f468d502da669982c88321ce3a84bb571d28e0b14be86ab56bdd (content_hash 14e387b1..., previous_hash b3700366... = Priority C v1.1 SEAL at Entry #36). Closes #160, closes #161. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First-round PASS audit cycle for the real heuristic+LLM extractor. Plan ships across six phases (Phase 0 cache contract evolution; Phase 1 deterministic Stage 1 classifier; Phase 2 trigger rules schema; Phase 3 real Anthropic SDK Stage 2; Phase 4 pipeline integration; Phase 5 corpus learner option-c). META_LEDGER entries #34-#36 capture: round-1 PASS audit, IMPLEMENT, and SUBSTANTIATION. Three audit advisories (extract() boundary, TeamServerRules typo, corpus learner table-source) all addressed inline during implementation. A proactive QorLogic Fixer code-quality sweep before commit produced 2 MED + 2 LOW findings; both MEDs landed (fail-soft on non-text content blocks; v2->v3 backfill integration test) with one surfacing a real defect (the migration's TYPE string was rejecting reads on pre-v3 rows with NONE classifier_version; corrected to TYPE option<string>). SYSTEM_STATE.md adds the Priority C v1.1 section: schema state (v4), architectural properties achieved (heuristic-first determinism + LLM-only-when-needed + rule-version-driven cache invalidation + all four "dynamic" angles wired), audit cycle outcomes. Merkle seal: SHA256(content_hash + previous_hash) = b37003661820e2ef80591b9d0cfdeac3df092d6d9b4b5d87e3036e7ccf37d95b (content_hash e8b1b6b6..., previous_hash dcb61910... = Priority C v1 SEAL at Entry #33). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three-round audit cycle (VETO → VETO → PASS) for closing v0 release blockers issues #160 (materializer event_type mismatch) and #161 (channel_allowlist not populated). META_LEDGER entries #37-#41 capture: round-1 VETO (infrastructure- mismatch — pull_team_server_events had zero production callers), round-2 VETO (specification-drift — sketch passed wrapped adapter without unwrap; would echo events O(N²) cross-dev), round-3 PASS, IMPLEMENT, SUBSTANTIATION. SHADOW_GENOME #7 heuristic catalog grew 4→6 across this branch: - Heuristic 5 (upstream-consumer) — Entry #37 - Heuristic 6 (wrapper-side-effect) — Entry #38 The catalog is the productive deposit beyond the code; each heuristic is a durable detection pattern reusable in future audits. SYSTEM_STATE.md adds the v0 release-blockers section: end-to-end ingest pipeline now functional (Slack OAuth → workspace row → YAML allowlist sync → channel_allowlist → Slack worker polls → heuristic+ LLM extraction → team_event → /events HTTP → per-dev consumer pulls → bridges to IngestPayload → per-dev local ledger). Merkle seal: SHA256(content_hash + previous_hash) = 7cc405fc8d39f468d502da669982c88321ce3a84bb571d28e0b14be86ab56bdd (content_hash 14e387b1..., previous_hash b3700366... = Priority C v1.1 SEAL at Entry #36). Closes #160, closes #161. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
bicameral-ingest/SKILL.mdstep 5; guided-mode contract folded intobicameral-preflight/SKILL.mdsteps 6–7.bicameral.history— read-only ledger dump grouped byfeature_group, in the balance-sheet shape (HistoryDecisionwithsources[],fulfillment,drift_evidence). 11 tests, all passing.feature_groupfield added to ingest payload +decisiontable.agent_sessionsource type added. Step 1.5 in ingest SKILL.md covers the stop-and-ask grouping contract.intent_id→decision_id,compliant→verdict, schema v3 → v4,intenttable →decisiontable).Test plan
test_v0420_history.py— 11 tests greentest_phase3_integration.py— 7 tests greentest_v048_ingest_brief_chain.py— 12 tests greentest_resolve_compliance.py— 10 tests greentest_compliance_check_schema.py— all green (updated)test_v0417_jargon_hygiene.py— green (bicameral-ingest exempted from BM25 term)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes v0.5.1
New Features
bicameral.historytool for viewing the complete decision ledger with optional filtering by feature name and historical snapshots via git references.Changes
bicameral.status,bicameral.search,bicameral.brief,bicameral.scan_branch, andbicameral.doctortools.feature_groupfield to organize and track decisions by feature.source_typeto includeagent_sessionfor decision origin tracking.Documentation