Repository navigation
refactor: wire or delete dead abstractions from audit (#1322) - #1329
Conversation
Closes #1322, #1248. Per audit #1322, address all seven findings in one coherent PR. F1 (Operations contract — #1247/#1316): wire it. daemon /api/ingest now validates request bodies through ImportRequest and emits ImportAck with the shared OperationFollowUp envelope. Legacy wire keys (path, status, ok) are preserved so the CLI ingest adapter and existing HTTP clients keep working. polylogue/daemon/http.py:1574-1630. F2 (api/cli/mcp read-surface adapters): delete. The Python API, CLI, and MCP do not go through dedicated adapter envelopes — they hand-roll richer envelopes inline (daemon/http.py:_do_list with target_ref/anchor/actions/repo/cwd/flags and mcp/server_tools.py). Wiring inline-handrolled envelopes through the bare adapter envelope would lose information. TUIReadSurface stays — it is used by polylogue/ui/tui/screens/{browser,search}.py. F4 (ContractEvidenceRecorder): delete. No non-test consumer existed. Removed tests/infra/contract_evidence.py + ~17 test call sites + the matching devtools dashboards/loaders that aggregated artifacts from .cache/verification/evidence/. F6 (verify-cross-cuts): delete. Verifier and generator share the same naming convention; the lint was a tautology. Removed from devtools/command_catalog.py, devtools/verify.py chain, and devtools/evidence_dashboard.py static-gate list. cross_cut_tags() in build_topology_projection.py is kept because verify-topology still consumes the generated tags. F7 (insights/provenance helpers): wire. daemon insights browser profile panel (#1018/#1120) now passes the SessionProfileRecord through is_stale() against the conversation updated_at and exposes the typed verdict as a `staleness` field on the panel. F3, F5: out of scope per audit guidance. Verification: - devtools verify --quick → exit 0 (34s) - pytest -q --ignore=tests/integration → 8022 passed, 2 xfailed (117s) - Two pre-existing local-env failures from a live daemon were deselected (tests/unit/cli/test_init.py::test_status_first_run_hint_suggests_init, tests/unit/cli/test_status.py::TestNoArchiveStatus::test_status_subprocess_no_archive); both failed identically against origin/master. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (42)
📝 WalkthroughWalkthroughThis PR removes bounded contract-evidence recording infrastructure, deletes the ChangesRemove Contract-Evidence Infrastructure & Verification Gate
Remove Read-Surface Adapters & Consolidate Tests
Enhance Daemon HTTP Endpoints
Metadata & Documentation Updates
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Suggested Labels
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 |
…pus (#5196) Two independent settled decisions, one commit each. ## A — retire `polylogue/api/contracts/` (polylogue-aq2l5) Ruled and authorized on the bead. The package shipped as a contract spine enforced through shadow adapters; **those adapters were deleted two days later** (#1329), leaving `TUIReadSurface` as the only implementor — and #5182 deleted the TUI. `a7xr.13` had already deleted the mirrored write-surface half, recording the finding that shadow adapters verify copies rather than surfaces, and the plan "execute f94 first, then nothing in read_surface needs keeping". Verified before deleting, not trusted from the brief: every `api.contracts` hit is inside the package; `assert_implements` has 11 hits, all internal, zero call sites; each exported Protocol name searched individually returns zero external hits; `TUIReadSurface` zero hits anywhere. `ArchiveReadCapability` is unaffected — it lives in `api/archive_reads.py:17` and the deleted `contracts/__init__.py:38` was a pass-through re-export. Replacement in place: operation-identity parity (`polylogue/api/parity.py`, gate `api-parity`) plus behavioral differentials — including the one in #5184 that caught the MCP `offset=0` defect no name-based check could. **Correction to the ruling's expectation**: it predicted the layering baseline would shrink. It did not — 226 before, 226 after. `docs/plans/layering-surface-baseline.json` has no entry for any `api/contracts/*` file, and `polylogue/api` → `polylogue/daemon` is not a disallow pair in `layering.yaml`, so the removed `read_surface.py:31` import never counted. The bound held; the number did not move. ## B — declare the corpus schedule (polylogue-yk0zz want 4) `schedule = "*-*-* 03:00"` added to `[operations.verify_all]`. `cache`, `checkout`, `pool` untouched — they are load-bearing for the dedupe property. `verify.yml`'s header comment corrected: it claimed a nightly agentctl `verify_all` schedule that was never declared. `concurrency.cancel-in-progress: true` deliberately unchanged. Key spelling cross-checked against the live precedent (`/realm/project/sinnix/.agentctl/project.toml` `[operations.census]`). `agentctl schedule apply` was **not** run — that mutates live host state and is the coordinator's. ## Verification ``` devtools verify --quick (after each part) → EXIT 0, all 19 gates devtools test tests/unit/api tests/unit/core/test_facade_api.py → EXIT 0 devtools render all --check → EXIT 0, 0 occurrences of "out of sync" ``` All five changed files confirmed **out** of the schema-identity closure. ## Residual `agentctl schedule apply` still needs running after this lands; want 4 closes only once the timer is listed and one scheduled run has a result. `agentctl schedule` exposes only `apply` — no read-only list verb — so the descriptor's acceptance of the value is unproven until then. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
Address all seven findings from the verifiability quality audit in #1322 in one
coherent PR. Wire what has a real consumer, delete what is inert, and land #1248
(daemon
/api/ingestas the first Operations consumer) in the same slice sothe contract introduced in #1316 is no longer a foundation-without-consumer.
Problem
#1322 audited the open + closed issue corpus, codebase, and tests for hollow
abstractions, inert tests, puppeteered scenarios, and naming theatre. Seven
high-confidence findings (F1–F7). F1 specifically called out that PR #1316 had
landed the Operations contract substrate without any production consumer; #1248
(daemon
/api/ingest) was the obvious wiring target but still open.This PR resolves the audit by routing each finding through one of three
disposals: wire, delete, or leave-as-out-of-scope per the audit's own guidance.
Solution
Per-finding actions:
polylogue/daemon/http.py's/api/ingestnow validates request bodies throughImportRequestand emitsImportAckwith the sharedOperationFollowUpenvelope. Legacy wire keys(
path,status,ok) are preserved so the CLI ingest adapter and existingHTTP clients keep working. Closes refactor(daemon): /api/ingest semantics decision and implementation (#861 slice B) #1248.
polylogue/api/contracts/{api,cli,mcp}_surface.pyremoved. The real Python API, CLI, and MCP code paths do not go through these
adapter envelopes — they hand-roll richer envelopes inline (
daemon/http.py:_do_listcarries
target_ref/anchor/actions/repo/cwd/flags;mcp/server_tools.pyhasits own envelope). Wiring inline-handrolled envelopes through the bare
adapter envelope would lose information.
TUIReadSurfacestays — used bypolylogue/ui/tui/screens/{browser,search}.py.ContractEvidenceRecorder→ DELETE. No non-test consumer. Removedtests/infra/contract_evidence.py+ call sites + the matching devtoolsdashboards/loaders that aggregated artifacts from
.cache/verification/evidence/.verify-cross-cuts→ DELETE. Verifier and generator share the samenaming convention; the lint was a tautology. Removed from
devtools/command_catalog.py, thedevtools verifychain, anddevtools/evidence_dashboard.py.cross_cut_tags()inbuild_topology_projection.pyis kept becauseverify-topologystillconsumes the generated tags.
panel (feat: expose bounded session insight products for downstream consumers #1018/feat(reader): insights browser for session profiles, events, phases, threads #1120) now passes the
SessionProfileRecordthroughis_stale()against the conversation
updated_atand exposes the typed verdict as astalenessfield on the panel.Verification
python -m devtools verify --quick→ exit 0 (39s)pytest -q --ignore=tests/integration→ 8062 passed, 2 xfailed (105.75s)Notes
Closes #1322, #1248.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Summary by CodeRabbit
New Features
/api/ingestendpoint with typed request validation and improved acknowledgment responses.Bug Fixes
Chores
verify-cross-cutsdevtools verification command and associated internal contract evidence infrastructure.