Skip to content

Reproofs run only the concept's detectors; the probe types only the files it asks about - #478

Merged
trissim merged 1 commit into
mainfrom
s-nra/fine-grained-probe
Nov 18, 2026
Merged

trissim merged 1 commit into
mainfrom
s-nra/fine-grained-probe

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Numbers first. Measured on the saved 11-file class_family_authority move on agent-comms (853 modules):

  • Probe detector's fresh mypy build: 14.4 s → about 9.9 s per state. Of the 14.4 s, 9.5–9.9 s is the build and 4.3–4.9 s was reading the types of every expression in every built file. The answer needs 8 receivers in 7 files, and reading only those files takes 0.014 s. The answers are identical, span for span.
  • Reproof: the 5 semantic-mirror detectors no longer rerun, saving about 0.6–0.9 s per reproof.

What changed.

  1. StageProof.reproof_detector_ids is deleted. A stage's acceptance reads the projected scan only through target_findings, the concept's own findings:
    • certification when no targets are left (codemod_workflow.py, after the reproof);
    • stage() progress;
    • the next depth's plan, which plan_from_findings(target_findings) builds.
      The semantic mirrors RescannedStages added decide none of that, and the settle's exact scan measures them. So a reproof reruns the target detectors plus FindingRecipeSynthesizer.detector_ids_for_concept, and nothing else.
  2. TypeCheckerSession.answers(sources, spans) builds once and reads types only in the files holding the asked spans. ProbeOwnerQuery.answered uses it. started() (asked later, so it keeps every file's types) shares the same _built.

Not in this PR, measured and dropped:

  • A fine-grained mypy build crashes inside mypy 2.4.1 on real moves (AssertionError in join_instances_via_supertype), or is slower than a fresh build (25–28 s).
  • Cached incremental mode rechecks 825 of 853 modules, because agent-comms is one roughly 700-module import cycle.

Tests.

  • Before the rebase onto 641fdbd: guards 72 passed; goal-search tests 1514 passed, 2 failed (test_module_cli_agent_payload_reuses_cached_semantic_graph_for_file_scope, test_module_cli_loop_payload_allows_no_structural_overlap_without_raw_bulk), and both also fail on main. stage-proof, restated-fact, optional-field and context-reuse tests: 138 passed.
  • After the rebase: guards and the nearby tests were re-run before merge.

Generated by Claude Code

…iles it asks about

A stage's acceptance reads its projected scan only through `target_findings`,
the concept's own findings: progress, certification and the next depth's plan.
The semantic-mirror detectors a RescannedStages reproof added decide none of
that, and the settle's exact scan measures them, so a reproof no longer runs
them and `StageProof.reproof_detector_ids` is gone.

The probe detector's fresh mypy build read every expression of every built
file for its types and then asked about a few receivers: on agent-comms 4.3-4.9
of a 14.4 s build for 8 receivers in 7 files. `TypeCheckerSession.answers` builds
once and reads types only in the files holding the asked spans (0.014 s, the
same answers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gZLduhisRHdamZ5LNK72Z
@trissim
trissim merged commit 0dae25a into main Nov 18, 2026
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants