Statement coverage to 82% with an enforced floor; resolve the four zero-importer modules (#196) - #229
Merged
Merged
Conversation
…four zero-importer modules resolved (#196) Squash-resolution of feat/coverage-floor-196-v2 onto main after #224: conflicts were the advertised test count only; re-collected on the merged tree (6135) and validated with scripts/check_doc_claims.py. The 18 changed/added test files pass on the merged tree (420 passed). Closes #196. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cdeust
force-pushed
the
feat/coverage-floor-196-v2
branch
from
July 28, 2026 00:50
05c4abe to
c224fc8
Compare
cdeust
added a commit
that referenced
this pull request
Jul 28, 2026
… or silent_failure-observable (#197) Squash-resolution of feat/warnings-strict-197-ble onto main after #229: conflicts were the advertised test count only; resolved to main's side (preserving the #229 test_statement_coverage80 flip), re-collected on the merged tree (6199), doc-claims gate OK. Changed test files 67 passed, invariants 52 passed, ruff check + format clean repo-wide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cdeust
added a commit
that referenced
this pull request
Jul 28, 2026
… or silent_failure-observable (#197) (#230) Squash-resolution of feat/warnings-strict-197-ble onto main after #229: conflicts were the advertised test count only; resolved to main's side (preserving the #229 test_statement_coverage80 flip), re-collected on the merged tree (6199), doc-claims gate OK. Changed test files 67 passed, invariants 52 passed, ruff check + format clean repo-wide. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #196.
What this PR does
condense_assembled_contextaspg_recall.assemble_context's missing truncation-awareness pass — the stage assembler's three phases each enforce only their own sub-budget, so their sum could exceed the caller'stoken_budget; the new pass is a byte-identical no-op when the sections fit and priority-condenses (own > adjacent > summaries) throughdecomposer.assemble_promptwhen they don't. This also givesdecomposer.pyits production call site (partially addresses context_assembly: decomposer + active_retrieval have no call site #201).mcp_serverfrom 74.83% to 82.02% (CI coverage job, run 30316539703, coverage.py 7.15.2) via contract tests for:stage_detector,decomposer,ppr_traversal,active_retrieval,coverage,warning,concept_emerger,wiki_view_executor, thepg_recallwiring,agent_briefing,wiki_rule_engine,wiki_file_doc_skeleton,wiki_coverage_dashboard,session_start(the issue's largest named gap, 36% → 82%),batch_sinks/pooled_sink, andviz_client. Measured locally with the same command on the SQLite backend the tree still clears the bar on its own: 80.14% (29,534 of 36,854) with every PG-only test failing-by-environment.--cov-fail-under=82in the CI coverage job.test_statement_coverage80to Met in.bestpractices.jsonand updatesdocs/ASSURANCE-CASE.md§ "What this assurance case does NOT claim".domain_mapping's dev-root scan in conftest — the transitiveos.walkover real repo trees killed local--covruns at the 300 s per-test timeout; CI isolation was accidental (no dev roots on runners), now it is designed.The four zero-importer modules (criterion 1)
infrastructure/git_diff.pygit_diff_engine.py; its one shared consumer (shared/subprocess_safe.py) docstring names the removalgit log --followshows removal in 1572f61; no importer existedshared/memory_types.pycore/context_assembly/condensers.pycondense_memory_contentintostage_phases; THIS PR completes the wiring withcondense_assembled_contextinsidepg_recall.assemble_contexttests_py/core/test_pg_recall_assemble_context_condensation.py(3 tests),tests_py/core/context_assembly/test_condensers.py(33 tests)hooks/preemptive_context.py.claude-plugin/plugin.json:79; covered bytests_py/hooks/test_preemptive_context.py(22 tests, merged in #204)hooks/agent_briefing.py(SubagentStart) andhooks/session_start.py(SessionStart) share the same entry-point shape — registered inplugin.json, zero importers by design — and are now covered by 29 and 64 tests respectively.Mutation triage on the changed function (§12)
Scoped mutmut run (
only_mutate=condensers.py, 352 mutants) after adding the new tests: 0 non-equivalent survivors incondense_assembled_context— 13 killed by three added contract tests (exact-budget byte-identity; every-section-yields with banner-key labels; adjacent-yields-to-own priority), 1 documented equivalent (summariespriority 3→4: priorities are pure sort keys and the mutation preserves the strict order own < adjacent < summaries — behaviour identical). The 125 survivors in the PRE-existing condenser functions (code this PR does not change) are the sweep-tier backlog, filed as #228. The changed lines inpg_recall.pyare pinned by the three wiring tests (over-budget condenses;token_budget=Nonenever invokes the pass; under-budget output unchanged).Completion Ledger
§13.1 checklist
test_over_budget_result_is_condensed,test_assembled_context_under_budget_matches_stage_assembler_formattest_assembled_context_all_empty_returns_empty_string,test_assembled_context_whitespace_only_input_treated_as_empty), boundary (test_assembled_context_exactly_at_budget_is_byte_identical), oversize (test_assembled_context_over_budget_condenses_every_section), unicode-free blobs + sentence content both exercisedtest_failed_agent_scoped_query_is_logged_and_team_pass_still_runs,test_failed_team_query_is_logged_and_returns_partial_results,test_unreachable_postgres_is_skipped_with_a_signal,test_unreadable_page_is_skipped_not_fatal,test_unwritable_dashboard_is_skipped_and_the_batch_continues,test_unwritable_index_does_not_lose_the_dashboards,test_write_dashboards_registry_failure_writes_nothing,test_invalid_regex_silently_does_not_matchtest_main_ignores_malformed_json,test_main_ignores_empty_stdin,test_main_ignores_an_interactive_terminal; non-string tags:test_tag_match_is_case_insensitivecondense_assembled_contextdocstring states pre/postconditions incl. the banner-length caveat; unreachable-arm proof comment at thecondense_assistant_messagefinal returnwrite_dashboardsre-run overwrites deterministically (test_write_dashboards_emits_one_page_per_domain_plus_index)test_resolved_source_root_reports_file_coverage_and_caps_the_list); keyword extraction caps at 8; briefing capped at_MAX_MEMORIESconn.closeasserted intest_briefing_prints_header_marker_and_one_line_per_memoryandtest_no_relevant_memories_is_skipped_and_connection_closed; temp dirs viatmp_pathtotal <= token_budgetfast path) in the common case, asserted byte-identicalassemble_contextreturn keys unchanged; raw phase fields stay uncondensed (test_over_budget_result_is_condensedasserts this consumer contract)selected_memoriesagainst raw phase fields — pinned by the same testtmp_path-based tests; suite green on Windows leg (CI run 30316539703)test_failed_receipt_degrades_to_marker_less_briefing; "(no source root resolved)" line:test_fresh_domain_renders_all_slots_as_queuedtmp_patheverywhere, no sleeps, no shared state; monkeypatchedPath.home; suite passes under default parallel CI matrixconnect.assert_not_called()in the briefing gates,mock_condense.assert_not_called()intest_none_token_budget_skips_condensation,assert "Related Prior Context" not in result, receipt-marker absence intest_failed_receipt_degrades_to_marker_less_briefingno blocking rule regressed)Code-path ledger (new paths introduced by this diff)
condense_assembled_contextfast path (fits)test_assembled_context_under_budget_matches_stage_assembler_format,test_assembled_context_exactly_at_budget_is_byte_identicaltest_assembled_context_omits_empty_sections,test_assembled_context_whitespace_only_input_treated_as_emptytest_assembled_context_all_empty_returns_empty_stringtest_assembled_context_over_budget_result_fits_within_budget,test_assembled_context_condensation_engages_and_reduces_contenttest_assembled_context_own_stage_survives_more_than_summaries,test_assembled_context_adjacent_yields_budget_to_own_stagetest_assembled_context_emits_truncation_warning_banner,test_assembled_context_over_budget_condenses_every_sectiontest_assembled_context_over_budget_excludes_missing_sectionsassemble_contextwiring: budget set + overtest_over_budget_result_is_condensedtest_under_budget_result_unchangedtoken_budget=Noneskiptest_none_token_budget_skips_condensation# pragma: no coverwith written single-segment proof at the use site (provably unreachable; kept as fallback)New-test files for previously-uncovered modules map one test per behaviour; per-file counts: session_start 64, agent_briefing 29, wiki_view_executor 57, concept_emerger 51, stage_detector 30, ppr_traversal 27, decomposer 23, active_retrieval 18, wiki_file_doc_skeleton 17, coverage 13, wiki_coverage_dashboard 16, wiki_rule_engine 15, viz_client 12, batch_sinks 7, warning 5, pg_recall wiring 3, condensers +13.
Deferrals (each with its issue number)
🤖 Generated with Claude Code