Skip to content

refactor(devtools): excise self-attesting machinery; testmon as one seed - #4551

Merged
Sinity merged 1 commit into
masterfrom
excise/devtools-merge
Sep 2, 2026
Merged

Sinity merged 1 commit into
masterfrom
excise/devtools-merge

Conversation

@Sinity

@Sinity Sinity commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Squash of the devtools excision wave (net about -17,000 lines). Evidence: the 2026-09-02 read-only audit of devtools (38k LOC, 18-step quick gate, gates with zero failures in 500 runs, testmon delivering 25 selective runs against 61 refusals in a month).

What changed

  • Deleted: reindex_packets, testmon_bootstrap and the environment digest, verification_ledger, the oracle-integrity reachability half, the Pages/VHS family and its workflows, the mutation family, census one-shots, safety-case/falsification framing, self_verify, portfolio_frontier, definition_closure, verify_ci_commands, verify_insight_rigor_honesty.
  • Quick gate is 11 steps (js-tests, schema-roundtrip, schema promotion audit, definition-closure, ci-commands, insight-honesty out).
  • devtools verify always runs testmon against one datafile (.cache/testmon/testmondata) with a pinned environment name and writes back. No datafile seeds (announced). --all is noselect. A corrupt or incompatible datafile is a typed graph_unusable stop naming the remedy. devtools test traces and writes back too. Never partitioned.

Verification

devtools verify --quick on the branch: green apart from one step inherited from being behind master at the time (schema-versioning, cleared by the rebase). Focused devtools test over touched devtools, insights and integration tests: green. The complete corpus runs once on master after this and the lane batch land (operator ruling).

Residuals

GitHub Pages site no longer builds (workflows deleted with the Pages family). js-tests has no automatic runner now. Corpus runs at up to 4 workers in one collection.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

…ersistent seed

Squash of branch excise/devtools (12 commits): net about -17k lines.
Deleted: reindex_packets, testmon_bootstrap and the environment digest,
verification_ledger, oracle-integrity reachability half, the Pages/VHS
family and its workflows, the mutation family, census one-shots,
safety-case/falsification framing, self_verify, portfolio_frontier,
definition_closure, verify_ci_commands, verify_insight_rigor_honesty.
Quick gate is 11 steps. `devtools verify` always runs testmon against
one datafile with a pinned environment name and writes back; no datafile
seeds; `--all` is noselect; a corrupt datafile is a typed graph_unusable
stop. `devtools test` traces and writes back too.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T17:38:12.900142Z 65548b7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 90c2c41d-f1d4-46f7-ae63-d14016376f6d


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit bc34061 into master Sep 2, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the excise/devtools-merge branch September 2, 2026 17:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65548b7b3c

ℹ️ 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".

Comment thread devtools/verify.py Resolved
Comment thread devtools/run_tests.py Resolved
Comment thread devtools/run_tests.py Resolved
Comment thread devtools/schema_promote.py Resolved
Comment thread devtools/schema_promote.py Resolved
Comment thread devtools/testmon_provision.py Resolved
Comment thread devtools/verify.py Resolved
Sinity added a commit that referenced this pull request Sep 2, 2026
## Summary
Removes two dev dependencies nothing uses: `pre-commit` (the hooks under
`.githooks` are plain shell) and `mutmut` (its mutation-campaign family
was deleted in #4551), plus the `[tool.mutmut]` block and
`tests/infra/mutmut.py` (no importers). Lockfile relocked: 4 packages
fewer.

## Context
This is the outcome of a review of which devtools machinery could be
delegated to standard tooling (import-linter/tach, semgrep/ast-grep,
vulture/deptry, gitleaks, pytest-reportlog, pre-commit, nox). Findings:
`verify patterns` already runs on ast-grep; the layering gate is mostly
a custom SQL-writer doctrine no tool covers and its import half is 45
lines against the shared YAML; consumer-reachability is diff-scoped
table/tool logic vulture is not a superset of; the secret scanner is
product code; the progress plugin also produces the selection and
summary ledgers that anti-vacuity depends on, which pytest-reportlog
does not. No genuine superset was found beyond removing dead
dependencies.

## Verification
`devtools verify --quick`: 12 steps green, ~119 s cold (mypy 52 s cold).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sinity added a commit that referenced this pull request Sep 22, 2026
…ains (#5412)

## Summary

Nine live P1 review findings closed in the verification harness, from a
triage of all 35 anchored devtools findings, plus the first measurement
that actually constrains the pytest worker-memory ceiling.

## Triage

**14 STALE, 6 WONTFIX, 15 LIVE** — of the live, 9 fixed, 3 declined or
out of scope, 3 duplicate rows.

Stale + wontfix is **20/35 (57%)**, well above the ~33% measured in
storage and sources. The devtools area has been rewritten more recently,
so anchored lines survive while the code around them is gone — three
findings pointed at a coverage-reuse mechanism
(`_corpus_already_verified`, `_packages_drift`,
`_reuse_inputs_still_hold`) **deleted wholesale in #4551**. The filter's
accuracy is area-dependent, not a single rate.

Two findings were declined with the reasoning stated rather than
implemented:

- **Trace flaky reruns before publishing the graph** — the condition
reproduces, but the remedy is wrong: enabling testmon on a ≤300-node
rerun collection is exactly the graph-truncation hazard of a *different*
finding in the same brief. Focused runs now deliberately never load
testmon.
- **Shared mypy cache** — LIVE in structure
(`_git_common_dir(root)/polylogue-mypy`, nothing keys it by checkout)
and **unfixed**. It needs a byte-length + whole-second-mtime collision
that could not be produced without fabricating it, and `gate mypy` is
green in every worktree on this host. Reported, not fixed on a story.

## What is fixed

| Finding | Defect |
|---|---|
| `schema_promote.py` | promotion writes through `schema_registry()` →
`data_home()/schemas`, but the audit read `polylogue.schemas.__path__` —
it audited a tree promotion does not write |
| `verify.py` selection | a change set of only
`tests/data/golden/chatgpt-simple.md` returned `"none"`, though that
file is compared byte-for-byte by `test_ui_visual.py:528` |
| `verify_testmon_selection.py` | both sides of the assertion read
`CORPUS_MAX_WORKERS`, so the gate's own declared mutation left it green
— a denominator derived from the thing it checks |
| `pytest_slot.py` receipts | `_on_exit` re-signalled before
`sampler.stop()` and `dispose()` unlinked the telemetry sidecar, so a
deadline kill left **nothing** |
| `schema_fast_forward.py` | line-at-a-time accumulation handed `A; B;`
to `execute()` in one call |
| `verify.py` admission | tests the testmon graph never recorded were
not counted before the cap. **Measured on this checkout: 1,353 declared
test files, 1,343 with a recorded execution; the 10 missing hold 68
tests**, none of which appeared in the admitted count |
| `verify_population_coverage.py` | a retained blob with NULL
`detected_provider` returned `None` and was marked COVERED with witness
"retained blob unavailable" |
| `verify_rebuild_routes.py` aliases | one function's local import
leaked module-wide. **Measured −60 wrong edges** |
| `verify_rebuild_routes.py` qualified | `isinstance(node.value,
ast.Name)` skipped every chain of depth ≥ 2. **Measured +265 edges** |

`gate rebuild-routes` is green on the branch **and** the graph change is
real: base 59,226 edges → head 59,431, measured by running both module
versions against `polylogue/`.

## The worker-memory ceiling: two levers ruled out

An opt-in heap-retention census was added to the suite-cost plugin
(`POLYLOGUE_SUITE_COST_HEAP`): at each RSS trajectory point it forces a
full `gc.collect()`, records resident pages **on both sides of it**, and
censuses live objects by type. Then it was run for real —
`tests/unit/storage`, 3,357 tests, single process, 1,775 s.

**1. A full collection releases nothing.** At 12 of 14 sample points RSS
went *up* after `gc.collect()` (the collector's own allocation); the two
that freed anything freed 0.4 and 2 MB.

```
n=250   rss=372468  after_gc=376304  d=+3836  objs=490884
n=1500  rss=542952  after_gc=542952  d=   +0  objs=741559
n=3357  rss=553772  after_gc=559184  d=+5412  objs=722578
```

The plateau is **not uncollected cycles**, so a collection-policy change
is not the lever.

**2. Live object count plateaus while RSS keeps climbing.** 490,884
objects at n=250 → ~741k by n=1500 → 722,578 at n=3357 (flat/declining),
while RSS rose ~20 MiB over that same span and ~58 KiB/test overall.
Past n≈1500 the growth is **not reachable Python objects** — it is
C-side (SQLite page caches, allocator fragmentation). Object-graph
pruning is not the lever either.

**3. Two named monotonic Python retainers**, not previously named:

- `_pytest.reports.TestReport`: 0 → **10,071** (≈3/test — pytest retains
every report for the session). At a 15,416-test worker that is ~46k
reports.
-
`polylogue.schemas.synthetic.relation_solver_runtime._MutualExclusionAnnotation`:
0 → **17,425** (≈5/test), plus `_StringLengthAnnotation` 0 → 2,506.
`_PARSED_ANNOTATIONS` in that module is bounded at 8 entries, so **the
holder is downstream of that cache, not the cache**.

**Honest limit, stated rather than smoothed:** this directory does
**not** reproduce the 4.7 GiB plateau. It peaked at 547 MiB from an 88
MiB start; linear extrapolation to 15,416 tests gives ~1.3 GiB against
the declared `WORKER_PEAK_ANON_MIB = 4750`. So either retention is
superlinear beyond this range, or concentrated in directories not run,
or xdist workers differ from a single process. **`CORPUS_MAX_WORKERS`
was not moved — nothing here justifies it yet.**

Second ceiling-relevant result: with the receipt fix above, a corpus run
killed at its deadline now leaves `pytest-slot-held-<pid>.result.json`
carrying its chosen width and measured peak, where the retained-artifact
globs collect it. Previously those runs left nothing — **the sizing
evidence was being destroyed precisely on the runs that most needed
it.** A final sampler reading is now taken in the signal handler, so the
receipt records the live peak rather than "no sample observed the
process group".

## Anti-vacuity, executed

A combined run with all six of the first commit's edits reverted at once
produced **exactly 8 failures and no collateral**:

```
test_two_statements_on_one_line_both_apply      SchemaFastForwardError: You can only execute one statement at a time.
test_a_markdown_test_fixture_still_selects_tests  assert 'none' == 'affected'
test_schema_promotion_audits_the_tree_it_writes_to  .../polylogue/schemas == .../xdg-data/polylogue/schemas
test_a_fully_qualified_call_is_reported         'pkg.maintenance.qualified.run_qualified_rebuild' not in frozenset(...)
test_a_local_import_does_not_erase_another_route 'pkg.shadow.real_rebuild' not in frozenset(...)
test_the_width_gate_catches_a_zero_default      assert (... '0 workers' in '...')
test_an_interrupted_held_run_preserves_its_receipt  FileNotFoundError: .../held-run.result.json
test_promotion_audits_the_tree_promotion_writes  .../polylogue/schemas == .../share/polylogue/schemas
```

Plus separately for the admission estimator — `assert (2, 68, None) ==
(70, 68, None)`, `KeyError: 'unrecorded_tests'` ×2 — and for population
coverage, `assert 'covered' == 'uncovered'`.

Each fix also pins the opposite direction so a blanket refusal cannot
pass: `test_a_completed_held_run_writes_no_interrupted_receipt`,
`test_the_heap_census_is_off_unless_asked_for`,
`test_an_unasked_unrecorded_term_stays_unknown`,
`test_stale_missing_drive_export_uses_only_its_narrow_path_declaration`,
and `pkg.shadow.harmless not in direct_callers`.

## Verification

Rebased onto `d8a52f5ff`.

- `devtools verify --quick` → **exit 0, 25/25 gates green** (at the
lane's original base this was 21 + the then-known `gate atlas` red,
identical at base and branch; #5408 has since fixed it on master).
- `devtools render all --check` → exit 0, `grep -c 'out of sync'` =
**0**.
- `devtools gate schema-closure` → 0, `observed_count 558 ==
baseline_count 558`, added/removed empty.
- `devtools schema closure` → **out** for every changed production file.
Derived identity does not move.
- Inherited-red baseline: same 6-file selection detached at base → **2**
non-passing; on the branch → **PASSED**, both gone, none added.

## Inherited reds fixed forward

`test_verify_quick_descriptor_accepts_the_declared_json_projection` and
`test_agentctl_parser_preserves_distinct_verification_pools` both assert
`"checkout" not in complete`, but `52c2175db` (#5405, the commit
immediately before this lane's base) added `checkout = "candidate"` to
`[operations.verify_all]`. Both were red at base. Fixed rather than
left, because the first is in `DESCRIPTOR_CONTRACT_TESTS` — a
descriptor-only `devtools verify` was red on master.

## Collisions and residuals

- **`durable_write_census` statement identity** — measured at HEAD: **12
keys hold >1 distinct statement, hiding 13 durable rewrites** (worst:
`raw_writes.py::execute_raw_admission_plan_async::raw_sessions::update`
at lines 125/176/189). Declined here: a stable discriminator re-keys all
142 entries of `docs/plans/durable-write-census.yaml`, and the 12
collided keys need new per-statement adjudications requiring
storage-domain judgement. Exact key list is in the lane report.
- **CI queueing headroom** — `.github/workflows/verify.yml`
`timeout-minutes: 120` vs `verify_affected timeout_seconds = 7200`.
Severity reduced since the workflow is now `workflow_dispatch:` only.
Fix site outside this write scope.
- `_MutualExclusionAnnotation` retention lives in
`polylogue/schemas/synthetic/` and is adjacent to another lane's file.
Not touched; reported with numbers.
- `verify_runs.py:1058` still reads `covered_by_run`, which no code can
write since #4551 — vestigial, kept because old on-disk receipts may
carry it.
- `agent_env.agent_worker_cap` has no production caller; only tests
reference it.
- The population-coverage fix is proven on synthetic fixtures only —
this checkout reports "Inventory: not evaluated (no source.db)". Against
the real archive it may newly report an uncovered construct; that would
be a true finding the rule was hiding, not a regression.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 64a9bd0):

  • P1 devtools/run_tests.py:320: Fixed on master (checked at 64a9bd0): Focused runs no longer load testmon: the command uses devtools_plugin_args(testmon=False) and managed_plugin_args(testmon=False, ...) (devtools/run_tests.py:934-937), and the environment drops TESTMON_DATAFILE (devtools/run_tests.py:958-964).
  • P1 devtools/run_tests.py:320: Fixed on master (checked at 64a9bd0): Focused runs do not write the testmon graph at all (devtools/run_tests.py:934, 961-964), so a reduced Hypothesis profile in a focused run cannot record coverage into the shared graph.
  • P1 devtools/schema_promote.py:61: Fixed on master (checked at 64a9bd0): The post-promotion audit now runs against _schema_registry_root(), the storage_root of the same SchemaRegistry construction promotion uses (devtools/schema_promote.py:34-48, 80).
  • P1 devtools/verify.py:203: Stale: The marker contract was rewritten: load_sensitive now documents that the corpus runs as one collection sharing the pool, with contention absorbed by the alone-rerun before a failure counts (pyproject.toml:210). The isolated-lane contract this finding relies on no longer exists. (checked at 64a9bd0)

Resolving every thread listed; confirmed defects are fixed under the named bead.

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.

1 participant