Repository navigation
feat(storage): declare hook spool topology and durable carrier identity - #4171
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cefe87b844
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Implements polylogue-awy5: durable acquisition-failure representation — source_generations, source_items, and source_item_reconciliation tables (source migration v37 after rebase over #4171's v36), generation-bound logical-coordinate identities with idempotent transitions, typed dispositions for downstream failure/cancellation/interruption, legacy_unknown batch fallback replaced by typed downstream failure. ## Verification 378 focused source/pipeline/storage/daemon tests green post-rebase; schema-versioning + oracle-integrity + quick gate green (commit 564b683). Migration renumbered 036→037 after the hook-carriers v36 landed; slot-collision defect filed separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
## Summary Round-2 corpus-fix lane (rest cluster): closes out the remaining corpus run `2b00a953` failures — lineage/MCP/storage/daemon — and repairs the MCP alias regression that #4226 introduced. ## Problem (evidence) 31 corpus failures across the rest cluster, classified per-failure: - **Real regressions**: the daemon's `/api/operation` route had no `RouteContract` entry (contract census red); MCP query alias lowering (`_mcp_aliases` mapping every declared name to its dataclass `spec_attr`) broke list pagination, provider/tag filters, cross-adapter query parity, and retrieval readiness; the startup recovery read path opened SQLite outside the controlled interruptible reader. - **Stale expectations**: lineage validation (index v73), model runtime (#4173), blob-GC v33 (schema evolution through v37 — test now pins `target_version=35`, the version its DDL snapshot proves), hook carrier identity (#4171), continuity capability catalogue (#4190), dev-loop worker count (#4222), and others per the lane report. - Additionally, #4226's `normalized = dict(params)` skipped normalization entirely, silently dropping the three genuine MCP-only alias spellings (`has_tool_use`, `has_thinking`, `has_paste_evidence`) — `SessionQuerySpec.from_params` only reads the `filter_has_*` names. Restored `normalize_query_params` with the alias map narrowed to exactly those three. ## Verification - All 40 nodeids from the corpus failure set (`/realm/tmp/work/corpus5-failed.txt`) → **40 passed** on this branch (rebased on master with #4226 + #4227 in). - `devtools test tests/unit/mcp/test_query_request_contracts.py tests/unit/test_cross_surface_agreement.py tests/unit/storage/test_retrieval_readiness_laws.py tests/integration/test_mcp.py` → 26 passed. - `devtools verify --quick` → all 15 gates ok. ## Residuals - One listed failure (`test_submit_failure_cleans_every_admitted_future_and_reservation`) was not reproducible in-lane and is unchanged; if it reappears in the corpus rerun it needs its own investigation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
## Summary Corpus run 4 fix lane (sources/ingest cluster): fixes 6 real ingest regressions and updates 3 genuinely stale expectations from the 18-failure residual set. ## Problem (evidence) Corpus run `7a195ff2` (first run against a frozen master, `34ddfe09d`) failed 9 sources-cluster tests. Root causes traced per-test: - Source v36's immutable hook-event carriers (#4171) broke codex state-db ingest: a stable per-thread `hook_event_id` could not represent repeated A→B→A state observations — re-ingest raised carrier conflicts (4 tests: session-count, title/spawn attach, source-only recovery, latest-observation replay). - `jsonl_complete_prefix` conflated a malformed record with an incomplete tail, so malformed JSONL was clipped and retried forever instead of recording a terminal decode outcome (2 tests). - Runtime artifact classification read the combined multi-segment text, letting a marker inside a THINKING block overwrite the parser's TEXT-only verdict (1 test). - Stale expectations (3): excluded-cursor proof now sees deferred partial evidence for stable truncated tails; backfill tests now pin observation-scoped immutable carrier identities and durable observation order. ## Solution - Hook-event identity for codex state evidence becomes observation-scoped (`:observation-NNN` suffix from raw-revision acquisition order), with explicit `carrier_relative_path`. - `JsonlBoundary` gains `malformed_record`; malformed records surface as terminal decode instead of an eternally-retried frontier clip. - Message-type classification uses the same TEXT-only projection materialization sees. ## Verification - The 9 target tests: 9 passed (each confirmed failing first). - Complete affected files: 277 passed. - `devtools verify --quick` + pre-push quick baseline: green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Codex review threads on this PR whose cited code is gone (checked against master at 23f91a5):
Resolving these threads. |
|
Closing out open Codex review threads on this PR (evidence checked against master at ef10e59):
Resolving the fixed, stale and refuted threads; tracked threads stay open. |
|
Closing out open Codex review threads on this PR (evidence checked against master at 0914f89):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
Implements polylogue-sd2vk.2: typed hook spool topology, a durable physical-carrier relation, and immutable hook-event identity.
Problem
Hook events carried one representative source_path with no durable record of which physical carrier (primary spool vs legacy read-only roots) delivered them, and replay could silently rewrite a logical hook row's semantics.
Solution
036.train.json):hook_event_carriersSTRICT table keyed (source_id, relative_path) with role CHECK ('primary-writable' | 'legacy-read-only') + event/blob index. Historical rows deliberately not backfilled — documented in the migration._insert_hook_eventenforces immutability: identical replay is a no-op; a semantic identity change raises typedHookEventConflictError(source_path excluded — first-observed representative is preserved, new carriers land in the relation).ON CONFLICT DO NOTHING, replacing the old delete-then-replace dance the mutable upsert required.Verification
verify schema-versioning,oracle-integrity,--quick: all passed.Residuals
🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA