Repository navigation
fix(cost): report absent prices as null with typed reasons - #4261
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: b0c3434cfc
ℹ️ 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".
#4577) ## Summary Deletes tests that cannot fail for the reason they claim, and replaces three clusters of weak tests with fewer, denser ones. Net **−46 collected tests** in the corpus, no reduction in any protected area. ## Problem The corpus run is ~20,800 tests and ~68 minutes. Sampling the expensive files and the reader suite found four classes of test that cost time without protecting behavior. **Fossils.** `tests/unit/daemon/test_web_reader.py` booted a real HTTP server and then asserted the reader shell's inline JavaScript *source text*: ```python assert "var readiness = s.component_readiness || {};" in body assert "function renderMaterializationChip(" in body assert 'No saved views. Click "Save current view"' in body ``` Renaming a local variable turns these red; serving a broken page does not. 24 such tests across `TestReaderInformability` (all 15), `TestReaderSavedViewsUI` (4 of 5), `TestReaderSelectionOperations` (2), the action-affordance rail, the raw-tab fetch shape, and `test_reader_smoke_lane_is_documented` — which read its own file and asserted two identifiers appear in it. The CLI help snapshots pinned prose that no contract declares: the root `--help` text, the PTY-rendered grid, and the same grid again at 60 and 120 columns (`assert output == snapshot`, four tests plus a `CliRunner` twin). **Tautologies.** `test_maintenance_registration.py` carried eleven assertions of the form `assert isinstance(plan_command, click.Command)`. These pass for any implementation that still applies `@click.command()`, and the same file's `list_commands` tests already assert every command name is registered. **Duplicates.** The dynamic-completer matrix ran 3 shells x 5 completers, twice, for 30 cases. Only `session_id` yields items in the synthetic corpus, so the other 12 seeded cases put an empty list through `format_completion` and asserted `isinstance(items, list)` — true of the empty list. These are the suite's single most expensive parametrization (`cwd_prefix-fish` 121.8s, `cwd_prefix-zsh` 120.1s, `cwd_prefix-bash` 81.7s, `repo-zsh` 66.3s). Two `normalize_role` Hypothesis properties drew 100 examples each from a 4-member role set and a 4x6 grid — ~190 redundant executions. **Benchmarks as unit tests.** `TestPerformanceBudget` seeds a 500-session archive and asserts `elapsed_ms < 500`, in the serial storage-scale phase whose 32 tests take 679s of a 4058s job at zero parallelism. ## Solution | Class | Tests removed | Tests added | File | | --- | --- | --- | --- | | Fossil (inline JS) | 24 | 0 | `test_web_reader.py` | | Fossil (help prose) | 5 | 4 | `test_help_snapshots.py` (deleted), `test_terminal_snapshots.py` | | Tautology | 11 | 0 | `test_maintenance_registration.py` | | Duplicate | 30 | 13 | `test_completion_matrix.py` | | Duplicate (Hypothesis) | 2 | 12 | `test_source_laws.py` | | Benchmark relocation | 3 | 3 (in `tests/benchmarks/`) | `test_scale.py` | | Dropped-column rewrite | 4 | 2 | `test_session_profile_model_usage_consistency.py` | Every kept `test_web_reader.py` test hits a served route through the real daemon and checks a served contract. The dist bundle's mount points, hashed asset transport, cache policy and ETag revalidation were already covered densely by `test_app_serves_semantic_ssr_and_manifest_hashed_assets`, so nothing replaces the deleted assertions. `test_browser_capture_reader_boundary` keeps its XSS contract on the served bytes; only its two trailing inline-JS assertions are gone. `TestReaderPrivacy`'s absolute-path leak checks are contracts on served output and stay. The help snapshots become one parametrized structural check across 60/80/120 columns that also proves no rendered line exceeds the terminal width — a claim the snapshots never made — and the invalid-option snapshot becomes an assertion that the error names the rejected option. The completer matrix becomes three tests with distinct claims: every completer resolves to `[]` on an empty archive (one shell — with no items there is no per-shell formatting to exercise); `session_id` yields archive-derived items that each of the three shells formats; every completer resolves without raising against a seeded archive. `test_session_profile_model_usage_consistency.py` was red at head: #4225 dropped the duplicated `total_*_tokens` columns from `session_profiles`, and the test selected them. It now asserts through the derivation `session_model_usage` feeds — `build_session_profile` fed from the persisted usage rows, hydrated by the materializer's own `load_sync_batch` / `hydrate_sessions` — and keeps its anti-vacuity condition: a Codex session whose only usage evidence is a cumulative `token_count` event must report the disjoint lanes (4,000 fresh input / 96,000 cache read), not the word-count estimate the pre-fix builder produced. The "undercounted before" half is gone; it can no longer be expressed without the dropped columns. ## Product fix (commits 2-3) The rewrite above exposed a live defect. #4225 made `session_model_usage` the single authority and removed all nine cost and token columns from `session_profiles`, but the profile readers still ran `SELECT * FROM session_profiles`. `_row_to_session_profile_record` fell through to its `_row_int(row, ..., 0)` defaults, so every `SessionProfileRecord` reported zero tokens, $0.00, and the record's default provenance. `insights/portfolio.py` sums `profile.total_input_tokens` and `profile.total_cost_usd` across the analyzed set, so portfolio and postmortem read a flat zero on any archive. The read path now recomputes through `compute_session_cost` -- the same function the materializer uses, so the provenance vocabulary (`provider_reported` / `catalog_priced` / `mixed` / `unknown`, the semantics #4261 revised) keeps exactly one implementation. A SQL projection was tried first and rejected: `archive.py`'s expression emits `origin_reported` / `priced` for `SessionSummary`, and the profile mapper computes `cost_is_estimated` as `cost_provenance != "provider_reported"`, so porting that expression would have marked every provider-reported cost as estimated. `session` becomes optional in `compute_session_cost`. Without a hydrated session the message-length fallback is simply unavailable, so usage rows with real token counters price exactly as they would with a session in hand, while identity-only rows (chatgpt-export and claude-ai-export write a real `model_name` with zero counters) keep the `unknown` disposition `_per_model_from_model_usage` already assigns them rather than being upgraded to an estimate. Absent evidence stays `unknown`, never a priced zero (polylogue-9kjtc). That is a loss of richness for those two origins against what the materializer computed when it had messages in hand, and never a fabricated figure. Batched: one `session_model_usage` query per read call, grouped by session, so N profiles cost N dict lookups over one query. **Measured 27 us per profile, 5.4 ms across portfolio's 200-session cap**, pricing catalog loaded once. Applied to the repository route (`get_session_profile`, `get_session_profiles_batch`, `list_session_profiles`), the full-rebuild stream, and the rebuild/refresh record loaders. Read-path only: no DDL, no schema version, no lifecycle delta. Two tests cover it through the repository route: the Codex cumulative-`token_count` fixture reports the lanes and cost `compute_session_cost` derives from the same rows (red if the overlay is removed), and a session with its usage rows deleted reports `unknown` provenance, `0.0` cost, and `cost_is_estimated` true. ## Verification Every touched file, one `devtools test <files> -n 2` invocation at a time, on the free-threaded Nix interpreter the project requires: | Selection | Result | | --- | --- | | `test_web_reader.py` | 150 passed, 1 failed (inherited) | | `test_terminal_snapshots.py` `test_maintenance_registration.py` | 22 passed | | `test_completion_matrix.py` `test_source_laws.py` | 278 passed in 89s | | `test_session_profile_model_usage_consistency.py` `tests/unit/insights/` | 729 passed, 1 failed (basetemp artifact) | | `test_scale.py` | 9 passed | | `tests/benchmarks/test_archive_read_budgets.py` | 3 passed | | `test_cost_compute` `test_pricing` `tests/unit/cost/` profile roundtrip + staleness | 90 passed | | `tests/unit/api/` + insight readiness / summaries / registry | 504 passed, 3 failed (inherited) | **~1,785 passed. Five failures, none caused by this branch**, each classified against the corpus run `be5bcc08` at head `42e501ec7` — this branch's exact base — rather than assumed: - `test_degraded_search_index_returns_route_state_not_zero_results` — red in the corpus run. A degraded FTS index answers 503 where the test expects 200 with a route state. Which is correct is a product question, out of scope for a test cull. - `test_record_context_delivery_requires_initialized_user_tier`, `test_insight_readiness_report_marks_missing_insight_tables`, `test_archive_tiers_api_session_costs_read_index_tier` — all three red in the corpus run (`SchemaSkewError` on the ops tier, `no such column: r.tool_outcome`, and a `priced`/`exact` status-vocabulary drift). - `test_git_commit_adapter_raises_explicitly_for_non_repository` — passed in the corpus run. It asserts git fails outside a repository, but `devtools test` in a worktree puts `tmp_path` under `.cache/verify/` *inside* the worktree, so git resolves a repo and the adapter does not raise. A latent fragility in that test, not a regression here. The reader suite's 6 remaining inherited fossils were repaired in this branch (commit 5) rather than left red, since they are the same class it exists to remove. Cost check on the touched hot file: `test_completion_matrix.py` was 535s / 151 tests on master and is now 134 tests inside an 89s two-file run at `-n 2`. **Not run:** the full corpus. Per-PR CI runs only the quick gate, so a green check here does not mean the suite ran. ## Residual risk `tests/unit/infra/test_workload_artifacts.py` is the largest remaining opportunity and is deliberately untouched: 1,559s across 89 tests, of which six corruption/forgery tests cost 617s. They already use a minimal corpus (2 sessions x 2 messages), so the cost is the archive build machinery itself, not scale — each test calls `build_seeded_archive` twice after clearing the validation memo. Folding the four manifest-tamper tests into one test that builds once and applies each tampering in turn would roughly halve that, at the cost of coupling the cases. This is the seeded-archive cache's integrity contract; rewriting it unverified is how a gate gets silently weakened, so it wants its own change with its own verification. Deleted assertions that could be re-added as real contracts, if desired: the reader shell's chip-quality CSS vocabulary and selection-toolbar region hooks are genuine DOM contracts, but they were asserted as substrings of the inline script rather than against parsed DOM. A DOM-level check belongs with the visual lane (`tests/visual/test_reader_semantic_cards.py`), not as a string search over served JavaScript. Left alone as protected: `tests/unit/security/`, `tests/integration/`, `tests/property/`, `test_parsers_props.py`, `test_null_guard_properties.py`, origin specs and real fixtures, and replay-parity tests. Two candidates were identified inside them and not cut — `tests/unit/cli/test_help_contract.py` pins CLI group-header strings, and `tests/unit/core/test_message_laws.py::test_message_role_is_typed_enum` asserts `isinstance(msg.role, Role)` on a strategy that can only produce `Role` — the first because the header taxonomy is plausibly a declared surface, the second because it sits among the core property tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
…#5785) ## Summary This PR salvages ChatGPT fleet worker 12's Codex-debt batch (beads `polylogue-1tyq5.55`, `.56`, `.60`, `.62`; 72 findings) and turns it into verified changes. Five fixes land with regression tests that fail on master. The worker's sixth fix (a negative completion cache) was dropped, and its health-check fix was replaced with a stricter version. ## Problem - **55.05** `health_check()` raises `SchemaSkew` when a tier is on another version. The tier probe opened the file with schema admission but caught only `sqlite3.Error`, so the probe crashed instead of reporting an error check. - **55.10** `list_assertion_candidate_reviews(limit=10)` computed `total` with a second, unbounded review read. That read ran the per-candidate judgment lookup (N+1) across the whole candidate history. - **60.01** `--stream --limit N` followed continuations with no limit. The final page could therefore fetch rows past N, and the resulting `result_too_large` refusal was re-raised for continuations instead of narrowing the page. - **60.20** `raw-authority-frontier` printed the all-state `plan_count` as `obligations=`, including terminal `superseded` plans. - **62.01** Named `analyze postmortem|portfolio|cost-outlook` computed the inherited root format but rendered from the local `None` format, so they printed text when JSON was requested. ## Solution - `_archive_tier_readiness_check` keeps admission, passes `tier=`, and reports any `SchemaRefusalError` as an ERROR check. The worker's `validate_schema=False` version was replaced because it compared only `user_version`, so a derived tier with a stale identity at the right version was reported OK. `test_health_check_reports_derived_identity_skew` fails on the worker's version. - `_archive_list_assertion_candidate_reviews` returns `(page, count)` from one read transaction. The count comes from `count_assertion_claims`, which now accepts `target_ref` and `statuses=None`. The count includes expired claims, matching the review read model. - `_read_session_windows` sends the remaining bound with every continuation. An oversized resumed page halves in place, and later pages keep the narrowed bound, because `session.read` refuses a continuation that widens its window. - The plain frontier line says `plans=` (the neutral label the finding offered). - `analyze_verb` renders every branch from the effective format: the local format if given, otherwise the root format, normalized with `normalize_output_dialect`. An explicit local `--format` still wins. - **62.16 dropped.** The deleted-candidate case was already fixed on master in 8cb1133 (#5722): each successful answer, empty or not, removes the cached matches for the refreshed prefix. The worker added a cache of empty answers that offline completion would treat as authoritative. Nothing invalidated it except a later contradicting daemon answer or the 24h TTL, and an offline reader cannot tell whether the archive changed without opening it. The cold-cache message on a miss is displayed rather than inserted, and it is accurate. - Two stale tests in `test_archive_query.py` expected `_emit_stats` to exit 0 over a converging archive. #5700 made that outcome degraded with a nonzero exit, so the tests now expect that. They failed on master before this PR. ## Verification - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w12 --wait` → job 2374: `verify: PASSED exit=0` (head 331a204ddd, pre-rebase; the rebase onto 4501f13 touched none of these files). Earlier job 2368 failed on format and mypy in the worker's commit; commit 3561647 fixes both. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w12 --wait -- tests/unit/api/test_archive_health_tier_skew.py tests/unit/api/test_assertion_candidate_review_count.py tests/unit/cli/test_analyze_named_projection_format.py tests/unit/cli/test_raw_authority_frontier_output.py tests/unit/cli/test_session_window_continuation_bounds.py tests/unit/cli/test_analyze_projections.py tests/unit/cli/test_archive_query.py tests/unit/cli/test_completion_daemon_boundary.py tests/unit/api/test_assertion_candidate_queue_health.py` → job 2405 at head 3561647: `devtools test: PASSED exit=0 diagnosis=pytest_passed`, 168 passed. - Anti-vacuity: the new tests were run on an origin/master checkout (job 2351). Every fix test failed there (11 failures, plus the 2 stale stats tests). The one exception is `test_named_analysis_local_format_overrides_inherited_json`, a precedence guard that should pass on both. Job 2355 ran the health tests against the worker's `validate_schema=False` variant, and the derived-identity case failed (status OK instead of ERROR). - Inherited, not addressed here: `tests/unit/api/test_facade_contracts.py::test_archive_facet_buckets_count_unique_sessions_for_duplicate_hits` and `::test_no_undiscovered_async_methods` fail identically on master 4501f13 (job 2401). ## Self-review - **Sibling sites.** The review count had one caller, and `judge.py` consumes the facade's `total`. The daemon health endpoint has its own tier checks and is out of scope. The other `validate_schema=False` opens are reset, paths and export tools, not health reporting. - **Cancellation and loops.** The window retry loop is bounded by halving to 1 and then re-raising. No new loop reads without a bound. - **Unbounded reads.** This PR removes one, the unbounded review read, and adds none. - **Fail-open fallbacks.** The health probe now reports refusals instead of hiding them. The dropped completion change would have turned a cache miss into an authoritative empty answer. - **Compatibility shims.** None. `count_assertion_claims` gained optional parameters, and its existing `annotations/join.py` callers are unchanged. - **Removed symbols.** No production symbol was removed. The `test_codex_debt_w12.py` files were renamed by behaviour. - **Production route.** The API tests go through `Polylogue.health_check` and `list_assertion_candidate_reviews` on bootstrapped archives. The CLI tests go through `cli` or the real command with a mocked transport (`dispatch_read`) and the real `lower_session_read`. ## Derived-identity closure `polylogue/storage/sqlite/archive_tiers/user_write.py` is a member of `docs/plans/schema-closure-baseline.json`, so this PR moves the candidate derived identity. Closure membership does not grow (the `schema-closure` gate passed). No other changed production file is a member. ## Per-finding dispositions Counts: 5 fixed, 60 fixed-already, 2 stale, 1 refuted, 4 not reached. The not-reached findings (55.18, 55.22, 60.12, 62.08) stay open on their beads. | key | disposition | evidence | test | | --- | --- | --- | --- | | 55.01 #4326 `polylogue/api/__init__.py:51` | refuted | `polylogue/api/parity.py:472–491`: The explicit context-pack exclusion includes topic_pack; composed builders do not own a separate operation identity under this contract. | — | | 55.02 #5381 `polylogue/api/archive.py:410` | fixed-already | `polylogue/api/archive.py::_read_session_transcript_page`: The normalized offset is used for both the read and returned page coordinates. | — | | 55.03 #4287 `polylogue/api/archive.py:818` | fixed-already | `polylogue/api/archive.py::_archive_list_summaries_with_post_filters`: Effective specification pagination is restored after content filtering. | — | | 55.04 #4295 `polylogue/api/archive.py:871` | fixed-already | `polylogue/api/archive.py::_archive_aggregate_facet_families / keyed`: Repeated facet bucket counts are added across chunks rather than overwritten. | — | | 55.05 #4871 `polylogue/api/archive.py:1114` | fixed | `_archive_tier_readiness_check` keeps admission and reports `SchemaRefusalError` as ERROR | `api/test_archive_health_tier_skew.py` | | 55.06 #4192 `polylogue/api/archive.py:1152` | fixed-already | `polylogue/api/archive.py::_archive_list_assertion_claims`: Uses _readable_user_tier rather than an index-backed query runner. | — | | 55.07 #4794 `polylogue/api/archive.py:1546` | fixed-already | `polylogue/storage/sqlite/connection_profile.py::_install_progress_handler`: Read frames install an expiry/cancellation-aware SQLite progress handler, including work using the bound connection. | — | | 55.08 #4552 `polylogue/api/archive.py:1691` | fixed-already | `polylogue/api/archive.py::_archive_list_assertion_candidates`: Calls the canonical actionable queue reader rather than the expiry-retaining review reader. | — | | 55.09 #4295 `polylogue/api/archive.py:3066` | fixed-already | `polylogue/api/archive.py::pathology_report`: replace(spec, limit=None, offset=0) removes query pagination from the scope denominator. | — | | 55.10 #4295 `polylogue/api/archive.py:3448` | fixed | one read transaction; scalar `count_assertion_claims` replaces the second unbounded review read | `api/test_assertion_candidate_review_count.py` | | 55.11 #4552 `polylogue/api/archive.py:3453` | fixed-already | `polylogue/api/archive.py::_readable_user_tier`: Missing/non-file and unreadable durable-tier failures retain typed unavailability rather than returning an empty list. | — | | 55.12 #4295 `polylogue/api/archive.py:3503` | fixed-already | `polylogue/cli/commands/judge.py::judge_command`: Preserves authoritative review totals; additional client-side time filtering reads the complete selection before recounting. | — | | 55.13 #5302 `polylogue/api/archive.py:4021` | fixed-already | `polylogue/operations/facade_writers.py::record_manual_continuation_product`: Invokes _resolve_session_graph before committing the manual link, refreshing topology projections. | — | | 55.14 #5302 `polylogue/api/archive.py:4021` | fixed-already | `polylogue/operations/facade_writers.py::record_manual_continuation_product`: Invokes the canonical cycle/quarantine pass instead of leaving the direct insert unchecked. | — | | 55.15 #4180 `polylogue/api/archive.py:5081` | fixed-already | `polylogue/api/archive.py::search_session_hits`: Passes unresolved spec.to_plan() to failure-classifying search_hits_for_plan. | — | | 55.16 #4180 `polylogue/api/archive.py:5512` | fixed-already | `polylogue/api/archive.py::filter`: Constructs SessionFilter without vector-provider initialization. | — | | 55.17 #5362 `polylogue/api/archive.py:5557` | fixed-already | `polylogue/api/archive.py::query_sessions`: Includes title_is_synthesized from display_label_source. | — | | 55.18 #5370 `polylogue/api/archive.py:5561` | not reached | `polylogue/api/archive.py::read_transcript_window`: Anchor lookup and transcript-window reading still have separate read lifetimes. Single-snapshot implementation remains necessary; no fix written. | — | | 55.19 #5370 `polylogue/api/archive.py:5563` | fixed-already | `polylogue/api/archive.py::read_transcript_window`: Explicitly rejects around combined with transcript filters. | — | | 55.20 #4357 `polylogue/api/archive.py:6330` | fixed-already | `polylogue/api/archive.py::get_effective_context`: Canonical ID resolution plus read_summary replaces full transcript hydration for the existence check. | — | | 55.21 #4261 `polylogue/api/insights.py:753` | fixed-already | `polylogue/api/insights.py::cost_outlook`: Restricts the cost query to the selected cycle's since/until rather than the whole archive. | — | | 55.22 #5007 `polylogue/api/insights.py:916` | not reached | `polylogue/api/insights.py::get_ancestors/get_descendants/get_siblings/get_thread/get_logical_session`: Exhaustive relationship helpers still consume the default topology page without exhaustion. No implementation written. | — | | 55.23 #5007 `polylogue/api/insights.py:927` | fixed-already | `polylogue/api/insights.py::_resolve_for_topology`: Uses canonical archive resolve_session_id, preserving native-ID resolution. | — | | 55.24 #4799 `polylogue/api/insights.py:1030` | fixed-already | `polylogue/api/insights.py::compact_lineage`: Both public page defaults use DEFAULT_LINEAGE_PAGE_LIMIT. | — | | 55.25 #4539 `polylogue/api/search_envelope_builder.py:138` | fixed-already | `polylogue/api/search_envelope_builder.py::build_search_envelope_for_spec; polylogue/operations/authority.py::authority_for_config`: The envelope delegates authority resolution to the owner that resolves the active archive root. | — | | 56.01 #4603 `polylogue/api/search_envelope_builder.py:148` | fixed-already | `polylogue/api/search_envelope_builder.py::build_search_envelope_for_spec`: Reports matched=total and analyzed=len(hits). | — | | 60.01 #5337 `polylogue/cli/archive_query.py:360` | fixed | continuations carry the remaining bound; resumed pages halve in place, never widen | `cli/test_session_window_continuation_bounds.py` | | 60.02 #4402 `polylogue/cli/archive_query.py:390` | fixed-already | `polylogue/surfaces/cursor_identity.py::search_cursor_request_identity`: Presentation-only parameters are excluded from cursor identity. | — | | 60.03 #4987 `polylogue/cli/archive_query.py:1913` | fixed-already | `polylogue/cli/render/rows.py::project_payload`: Outcome is preserved independently of selected result fields. | — | | 60.04 #5249 `polylogue/cli/click_app.py:479` | fixed-already | `polylogue/cli/query_contracts.py::QueryOutputSpec.from_params`: Explicit file destination and path retain typed FILE identity even for reserved-looking filenames. | — | | 60.05 #4337 `polylogue/cli/click_app.py:554` | fixed-already | `polylogue/cli/query_group.py::_asks_for_query_workflow_help`: The advertised find help route is handled while respecting option arity. | — | | 60.06 #4340 `polylogue/cli/click_app.py:628` | fixed-already | `polylogue/cli/click_app.py::main`: Runtime checks run inside guarded_entry passed to run_machine_entry. | — | | 60.07 #4651 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py`: The existing root group exposes only Fable, not the entire operational group. No alias is introduced by this batch. | — | | 60.08 #4580 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py`: The existing narrow route preserves the promised Fable-packet command. No alias is introduced by this batch. | — | | 60.09 #4550 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py::_register_fable_packet`: Registers only the intended Fable command rather than the entire operational group. | — | | 60.10 #4698 `polylogue/cli/commands/check.py:41` | fixed-already | `polylogue/scenarios/operational_surfaces.py`: Authored doctor scenarios use current routes without the retired repair flags. | — | | 60.11 #5349 `polylogue/cli/commands/diagnostics.py:992` | fixed-already | `polylogue/cli/commands/diagnostics.py::latency_command`: The empty-bucket branch still renders incomplete-drop accounting. | — | | 60.12 #5639 `polylogue/cli/commands/import_command.py:117` | not reached | `polylogue/cli/commands/import_command.py::_wait_for_demo_ingest`: Owner completion accounting improved, but a degraded receipt still causes immediate failure instead of waiting through the remaining convergence budget. No implementation written. | — | | 60.13 #5314 `polylogue/cli/commands/insights.py:147` | fixed-already | `polylogue/scenarios/insight_surfaces.py; tests/unit/cli/test_stdout_stderr_split.py`: Inventories use current rather than retired commands. | — | | 60.14 #4678 `polylogue/cli/commands/insights.py:224` | fixed-already | `polylogue/cli/commands/insights.py::_render_status_plain`: Plain output includes degraded counts and fallback reasons. | — | | 60.15 #4292 `polylogue/cli/commands/insights.py:450` | fixed-already | `polylogue/cli/commands/insights.py::_packet_json_document`: Dataclass tuples are lowered to JSON-native arrays. | — | | 60.16 #5311 `polylogue/cli/commands/judge.py:417` | fixed-already | `polylogue/cli/commands/judge.py::judge_command`: Interactive approval forwards the evidence digest and checks failed counts before printing success. | — | | 60.17 #4133 `polylogue/cli/commands/maintenance/_blob_gc.py:81` | fixed-already | `polylogue/cli/commands/maintenance/_blob_gc.py::blob_gc_command`: Blocked previews set ok=false and exit nonzero in both formats. | — | | 60.18 #4955 `polylogue/cli/commands/maintenance/_blob_gc.py:211` | stale | `polylogue/cli/commands/maintenance/_blob_gc.py`: gc_recover_command is gone; the remaining command is preview-only. | — | | 60.19 #5345 `polylogue/cli/commands/maintenance/_blob_integrity.py:52` | stale | `polylogue/cli/commands/maintenance/_blob_integrity.py`: _submit_replace_from_source and its cited relative-output forwarding route are gone. | — | | 60.20 #5350 `polylogue/cli/commands/maintenance/_raw_identity.py:47` | fixed | plain line labels the all-state count `plans=` | `cli/test_raw_authority_frontier_output.py` | | 60.21 #5301 `polylogue/cli/commands/maintenance/_raw_identity.py:59` | fixed-already | `polylogue/cli/commands/maintenance/_raw_identity.py::raw_authority_blockers_command`: Paginated public blocker inspection exposes expected/observed evidence. | — | | 60.22 #4955 `polylogue/cli/commands/maintenance/_raw_identity.py:247` | fixed-already | `polylogue/cli/commands/maintenance/_raw_identity.py::raw_authority_blocker_resolve_command`: Checks the affected count rather than presenting no-op resolution as an applied mutation. | — | | 60.23 #4824 `polylogue/cli/commands/maintenance/_verify_archive.py:85` | fixed-already | `polylogue/cli/commands/maintenance/_verify_archive.py::verify_archive_command`: Source-frontier construction is conditional on selected source-conservation work. | — | | 60.24 #5491 `polylogue/cli/commands/paths.py:75` | fixed-already | `polylogue/cli/commands/paths.py::_raw_materialization_readiness`: Propagates the selected index path through archive_debt_list(index_db_path=...). | — | | 60.25 #5353 `polylogue/cli/commands/status.py:342` | fixed-already | `polylogue/operations/daemon_status.py::produce_operation_status`: Merges runtime collection metadata into pinned readiness components. | — | | 62.01 #5422 `polylogue/cli/query_verbs.py:2434` | fixed | `analyze_verb` renders from the effective (normalized, inherited) format | `cli/test_analyze_named_projection_format.py` | | 62.02 #5007 `polylogue/cli/read_views/lineage.py:78` | fixed-already | `polylogue/cli/read_views/lineage.py`: The replacement operation-backed route uses the resolved target; the old _run path is gone. | — | | 62.03 #5407 `polylogue/cli/read_views/messages.py:226` | fixed-already | `polylogue/cli/read_views/messages.py::_write_messages_file`: Resolves symlink output before choosing the staging sibling. | — | | 62.04 #5407 `polylogue/cli/read_views/messages.py:227` | fixed-already | `polylogue/cli/read_views/messages.py::_write_messages_file`: Flushes and fsyncs the staged descriptor before replacement and synchronizes the directory. | — | | 62.05 #4291 `polylogue/cli/read_views/query_set.py:196` | fixed-already | `polylogue/cli/read_views/correlation.py::run_read_correlation`: Renders a string and delivers it through deliver_content instead of an uncaptured console-only renderer. | — | | 62.06 #5374 `polylogue/cli/read_views/session_evidence.py:180` | fixed-already | `polylogue/cli/read_views/session_evidence.py::_read_evidence_window`: Projection body coordinates take precedence before operation lowering. | — | | 62.07 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/query_output.py::deliver_query_output`: File delivery retains secret-candidate scanning. | — | | 62.08 #5520 `polylogue/cli/read_views/standard.py:99` | not reached | `polylogue/cli/read_views/standard.py::run_read_summary_or_transcript; polylogue/cli/archive_query.py::_read_session_windows`: The standard file path still accumulates the transcript and buffers its rendered document. End-to-end operation-backed streaming is not implemented. | — | | 62.09 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/read_views/standard.py::run_read_summary_or_transcript`: Forwards a typed FILE QueryDeliveryTarget, preserving reserved-looking filenames. | — | | 62.10 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/operations/daemon_reads.py::_session_identity_projection; polylogue/cli/archive_query.py::_session_message_text`: The operation preserves tool_input; rendering includes structured tool input and omits reasoning blocks. | — | | 62.11 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/archive_query.py::_read_session_windows`: Initial oversized pages already halve their bound at the inspected base. This batch additionally fixes resumed-page narrowing under 60.01. | — | | 62.12 #5266 `polylogue/cli/session_rows.py:141` | fixed-already | `polylogue/cli/session_rows.py::_query_page_with_authority`: Synthetic missing-session selections explicitly include next_offset=None. | — | | 62.13 #5426 `polylogue/cli/shared/machine_errors.py:233` | fixed-already | `polylogue/cli/shared/machine_errors.py::error_archive_writer_ownership`: Undecidable ownership has a separate remedy that does not assert an observed resident daemon. | — | | 62.14 #5426 `polylogue/cli/shared/machine_errors.py:285` | fixed-already | `polylogue/cli/shared/machine_errors.py::extract_command`: Recognizes --output-format as a value-bearing option. | — | | 62.15 #5545 `polylogue/cli/shell_completion_values.py:117` | fixed-already | `polylogue/cli/shell_completion_values.py::_cached_value_matches`: Session IDs match native-ID and title substrings. | — | | 62.16 #5545 `polylogue/cli/shell_completion_values.py:135` | fixed-already | deleted-candidate case fixed by 8cb1133 (#5722): every successful answer prunes the refreshed prefix; negative-answer cache declined (see Solution) | — | | 62.17 #5545 `polylogue/cli/shell_completion_values.py:145` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: A per-archive map retains more than the most recent archive. | — | | 62.18 #5545 `polylogue/cli/shell_completion_values.py:157` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: Removes an existing value before reinsertion at the retention tail. | — | | 62.19 #5545 `polylogue/cli/shell_completion_values.py:178` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: Global serialized-byte eviction precedes publication. This batch includes new empty observations in that accounting. | — | | 62.20 #5545 `polylogue/cli/shell_completion_values.py:181` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: flock serializes the full cache read-modify-write sequence. | — | | 62.21 #5382 `polylogue/cli/write_authority.py:104` | fixed-already | `polylogue/storage/sqlite/write_lease.py::arm_write_lease_enforcement`: Locked process-wide user/suppressor counts make arming overlap-safe. | — | ## Residuals - The four not-reached findings remain open. - Changing `user_write.py` moves the derived identity, so this PR has to land before a rebuild starts. - The two `test_facade_contracts.py` failures are inherited from master. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
|
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. |
Summary
Fixes polylogue-jfeaz (P0): cost surfaces no longer coerce an absent price to $0.00, and the cycle outlook reads the whole archive instead of a 50-session window.
Problem (evidence)
An unpriceable session surfaced as
$0.00— indistinguishable from free — and outlook rollups silently truncated. A prior attempt (PR #4239) collided with #4225's v75 rework and was rejected; this redispatch was built against current master with the collision guidance on the bead.Solution
total_usd: float | Nonewith the typedprice_not_materializedreason; JSON surfaces preservenull.priced/provider_money/known_zero(origin-reported provider money,reported_cost_usd) remain authoritative, now with explicit test coverage.Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA