Repository navigation
fix: Report a never-derived profile domain as missing, not stale - #5168
Conversation
_session_profile_component collapsed every not-ready shape into STALE. On an archive where no session profile had ever been materialized, nothing was computed, so nothing could have gone out of date -- that is MISSING. The distinction is load-bearing: _status_ok tolerates a never-converged derived family through required_missing but treats stale as unconditionally not-ok. So on one pristine archive, embeddings (missing) and transforms (unknown) were correctly tolerated while session_profiles, equally never-converged, flipped global ok to false and made `polylogue ops status --format json` exit 1. component_from_derived_model in the same module already draws this line; the profile domain was the outlier. The signal is not lost. The component still reports state=missing with "session profiles not derived" and its repair hint, and the claim guard still reports converged=false naming that domain. ok (the archive is usable) and converged (every derived family has run) stay distinct claims. Three CLI snapshots are re-recorded. test_json_status_snapshot already expected ok: true, so the product fix is what makes it green; its remaining diff had also gone stale across several PRs and now carries the seeded archive's real measurements instead of zeros. The other two are purely additive fields from #5146 and #5152 that were never re-recorded. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe change classifies uninitialized session profiles as missing and updates CLI snapshots for readiness claims, archive tiers, SQLite observations, runtime availability, raw replay data, and diagnostics. ChangesStatus and CLI output
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Session profiles that have not yet been derived are reported as missing while convergence remains false. No merge-blocking risk is currently identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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. A rabbit checks the profile rows, Comment |
Summary
Four
test_plain_cli_snapshots.pyfailures. Two were stale snapshots from additive changes that were never re-recorded. One was a product defect indaemon_status.py— a never-derived profile domain reported asstale, which flipped globalokto false on a pristine archive — fixed here, which is what lets its snapshot be re-recorded honestly. The fourth is a genuine read-path parity defect, filed and left red.Evidence
Full-corpus
verify_allon frozenmaster(890a2921e), job 1570, receipt.cache/verify/runs/20260914T200510Z-all-4027943-f8bc83ff, 22,524 selected, 147 failures with zero schema skew. Four of them in this file.Per-failure classification
test_json_analyze_snapshottest_json_read_all_snapshottest_json_status_snapshottest_facets_command_json_matches_analyze_facetspolylogue-mtxl2, left redtest_json_analyze_snapshot— stale, purely additiveTwo fields on
ArchiveStats.to_dict()/query_stats:embedding_coverage_measurable: true,embedding_coverage_unmeasurable_reason: null. Added by e991cfa / #5146 ("Read an unloadable vec0 extension as unmeasurable, not zero"), confirmed withgit log -Sonarchive/stats.pyandcli/query_stats.py.Values verified correct rather than merely current:
embedding_coverage_measurableis defined asembedding_coverage_unmeasurable_reason is None, and the seeded archive's embeddings tier is inspectable — soembedded_sessions: 0is a measured zero, not an unknown. That is consistent with the pre-existingembedding_coverage_percent: 0.0, since an unmeasurable tier rendersnullthere. Nothing removed, nothing changed.test_json_read_all_snapshot— stale, purely additiveoutcome: {state: "ok", reason: null, detail: {}}andsource: "direct". Added by 8d981b8 / #5152 ("Serve every root query through one declared read operation"), which deleted the localArchiveStorebranch of_execute_archive_query_stdoutand routed root queries throughoperations/daemon_reads.py.Values verified: the envelope reports
total: 2, anddecide_outcome(matched=2)isok— notempty, notdegraded— per thesurfaces/outcome.pycontract.source: "direct"is correct because the test environment has no daemon, matchingops status's ownsourceon the same archive.test_json_status_snapshot— product defect, fixedThis one was not merely stale:
polylogue ops status --format jsonexited 1 on the seeded archive, so no re-record could have made it green. Root cause:_session_profile_component(operations/daemon_status.py) collapsed every not-ready shape intoSTALE. On the seeded archive 0 of 2 profiles had ever been materialized — nothing was computed, so nothing could have gone out of date. That isMISSING, notSTALE.The distinction is load-bearing:
_status_oktolerates a never-converged derived family through therequired_missingallowlist, but treatsstaleas unconditionally not-ok. So on one archive,embeddings(missing) andtransforms(unknown) were correctly tolerated as never-converged whilesession_profiles— equally never-converged — flipped globalokto false. Introduced by 14e1d82 / #5027 ("Rewrite convergence around a domain-owned derivation kernel"), which is when this test went red.component_from_derived_model, in the same file, already draws exactly this line (source_rows == 0 and materialized_rows == 0→MISSING; stale rows →STALE). The profile domain was the outlier; it now follows the same rule.The fix is not a green-washing of the signal. The re-recorded snapshot still reports the domain honestly and the claim guard still refuses to certify:
ok: true(the archive is usable) andconverged: false(a derived family has not run) are different claims, and both are now reported correctly. Note the stored snapshot already expected"ok": true— the product fix restores what the test always asserted.The snapshot was also independently stale by several PRs, which the re-record picks up. That diff is strictly an improvement: it replaces zeros with the seeded archive's real measurements (
raw_artifact_count0→2,materialized_raw_artifact_count0→2,archive_session_count0→2,message_indexed_count12) and adds thesearch,session_profilesandsession_summarycomponents that did not exist when it was recorded. Removed fields (raw_records,unidentified_artifacts) and the constantnext_action/config_path: nullare the deliberate shape of the pinned-archive route, which states in its owndiagnostic.reasonthat it excludes CLI first-run diagnostics.test_facets_command_json_matches_analyze_facets— product defect, left redNot a snapshot — a real parity assertion between
polylogue facetsandanalyze --facets, and genuinely broken.operations/daemon_reads.py::_facets_payloadreimplements the facets envelope while its docstring claims it reuses the API's canonicalfacets()(api/archive.py:6053); it reuses only_archive_facet_buckets. Measured divergence on the seeded archive:facets(operation route)analyze --facets(API)family_status{}availabilitynull{projection, state: ready, deadline_s, elapsed_s, …}deadline_s/elapsed_snull/null2.0/ measuredcomplete_families["origins","tags"]["total_counts","origins","tags"]deferred_families"omitted""omitted"The direct
facetscommand loses the family-state reporting its own docstring promises ("reports their state explicitly instead of rendering empty buckets as authoritative facts") — it renders exactly the empty buckets that docstring disclaims. Red since 1d901ec / #4867.Deliberately not fixed here.
facets()isasync, owns its own archive acquisition, and computesavailability/deadline_s/elapsed_sunder a deadline fromanalysis.projection_contracts.facets_availability. Delegating properly means running it over a caller-pinnedArchiveStorewithout changing its cancellation and deadline semantics — a read-path design decision that owes CLI/API/MCP parity, pagination and cancellation evidence per CLAUDE.md, not a patch at the tail of a test-failure sweep. Filed aspolylogue-mtxl2(P1) with the measured table and the introducing commit. The test stays red and the bead names the wanted outcome; its existing parity assertion is its own anti-vacuity condition.Verification
devtools gate format/devtools gate lint— clean.Schema closure
Neither is in the derived-schema identity closure; this PR does not gate the archive rebuild.
Residuals
test_facets_command_json_matches_analyze_facetsremains red, tracked bypolylogue-mtxl2._status_okstill treatsstaleas unconditionally not-ok while gatingmissingandunknownthrough allowlists. This PR fixes the one domain that was mis-stating its state; it does not revisit whether that asymmetry is right in general.session_profilesstate now depends onprofile_row_count == 0 and total_sessions > 0. A partially derived set (some profiles present, some missing) is stillSTALE, which is the intended reading.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
Summary by CodeRabbit
Bug Fixes
CLI Improvements