Skip to content

fix(devtools): Three unblocked items — candidate checkout, evidence-conflict cover, slot receipt width - #5405

Merged
Sinity merged 3 commits into
masterfrom
fix/unblocked-devtools-batch
Sep 22, 2026
Merged

Sinity merged 3 commits into
masterfrom
fix/unblocked-devtools-batch

Conversation

@Sinity

@Sinity Sinity commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

Three small items unblocked by the operator-decision sweep, batched into one PR. One commit each.

1. p2mbi AC4 — the stale comment was wrong within a day of being written

.agentctl/project.toml carried a comment claiming agentctl's checkout vocabulary is closed to {any, default}. Replaced with checkout = "candidate" on [operations.verify_all].

Verified against the installed build, not just sinnix source — readlink -f $(which agentctl) resolves to the exact store path the bead's notes say the 03:00 timer runs, and CHECKOUT_KINDS there is frozenset({"any", "default", "candidate"}). The edited TOML was then loaded through the installed agentctl's own config loader, confirming it parses and resolves to "candidate".

2. irtix AC6/D — the missing regression test

AssertionEvidenceConflictError had zero hits in tests/, so deleting its raise broke nothing. test_judge_candidate_refuses_moved_evidence mints a candidate, refreshes it in place under the same assertion_id with a new digest plus superseded_evidence_digest — the shape a refreshing detector writes — and asserts the accept refuses unless expected_evidence_digest names the current digest.

Anti-vacuity executed: mutating user_write.py:2072 (raise … → return) produced Failed: DID NOT RAISE AssertionEvidenceConflictError twice, restored, green.

user_write.py is closure IN but untouched — only the test file changed, so the identity does not move.

3. k1o3t AC2a — a narrowing decision that was unauditable

resize_worker_argument returned (argv, None), discarding the budget memory_bounded_worker_cap already computed, whenever the command named no -n flag — which is the default for every devtools test focused run — or when requested <= 1. _slot_receipt writes sizing whenever given a non-None basis, so the fix is entirely in the return.

Measured on a real pre-existing artifact before fixing: …-focused-test-851767-…/run.json's pytest_slot_receipt has exactly the keys the bead cites and no sizing. So a run that narrowed could not say what it was admitted on.

test_a_held_run_with_no_explicit_worker_count_still_receipts_its_admitted_width is red against the pre-fix code by construction. The 51 existing test_corpus_worker_memory_bound.py tests still pass, confirming the multi-worker narrowing path is unchanged.

Verification

devtools test ::test_judge_candidate_refuses_moved_evidence   exit 0
devtools test <slot receipt + 51 worker-memory tests>         exit 0, 51/51
devtools verify --quick                                        exit 0, 25/25
devtools render all --check                     exit 0, 'out of sync' 0

Closure: worker_memory.py and both test files out; .agentctl/project.toml is not Python. No identity movement.

Two self-inflicted bugs worth recording

The lane hit both of the traps this campaign has been cataloguing, in its own new test:

  • a 129-character nodeid, over the silent-rewrite threshold — which made two genuine SIGKILLs look like flakes until the real cause was found (polylogue-5coki);
  • author_ref="detector:…", not in ObjectRefKind's closed vocabulary.

Both fixed. I independently hit the same two while verifying this lane's work during a takeover attempt, which is a fair indication they are easy to hit rather than careless.

Environmental: two attempts died at exit 137 after ~46 minutes with zero collection progress under 15–20 concurrent lanes, host memory.pressure full avg10 ≈ 16%. Retries in a calmer window were clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy

Sinity and others added 3 commits September 22, 2026 09:03
…p2mbi AC4)

The stale comment claimed agentctl's checkout vocabulary was closed to
{any, default}; sinnix 6bf2718f (2026-09-21) added "candidate" and it is
live in the installed build the 03:00 timer runs
(/nix/store/ibfdi72lpdm13pjnfq9fmm4qzbxdjmbr-agentctl-0.1.0). Declaring
checkout = "candidate" makes the scheduled complete-corpus run qualify
the integrated candidate tree instead of whatever branch happens to be
checked out at the project root.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
…polylogue-irtix AC6/D)

AssertionEvidenceConflictError had zero hits in tests/ -- deleting the
raise at archive_tiers/user_write.py:2072 broke nothing. Add a
regression that mints a candidate, refreshes it in place under the same
reused assertion_id with a superseded evidence_digest (the shape
_upsert_or_refresh_judgment_candidate writes), and asserts approval is
refused unless it names the CURRENT digest -- plus that naming the
current digest still succeeds, so the refusal is not a blanket block.

Anti-vacuity executed: disabling the raise at user_write.py:2072 (return
instead of raise) makes the new test fail with "DID NOT RAISE
AssertionEvidenceConflictError"; restoring the raise makes it pass
again. user_write.py is IN the derived schema closure but is untouched
by this commit (test-only change), so the derived schema identity does
not move.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
…o its receipt (polylogue-k1o3t AC2a)

A real receipt (steps[0].pytest_slot_receipt) carried only elapsed_s,
exit_code, kind, log_path, memory, schema_version and status -- no
selected width, no requested width, no budget it was admitted on, so a
narrowing decision was unauditable after the fact. The root cause:
resize_worker_argument() returned no basis at all whenever the command
named no -n/--numprocesses (the common case for `devtools test`'s
default single-process focused runs) or requested <=1, discarding the
budget memory_bounded_worker_cap() already computes. Now it always
computes and returns that basis -- workers, requested_workers, basis
source (cgroup_budget/declared_budget), narrowed -- and only skips
computation for a genuinely malformed -n value. _slot_receipt() already
wrote receipt["sizing"] whenever it was given a non-None basis, so this
change alone closes the gap: a serial run without -n is now read as an
explicit request for one worker and records the budget it was measured
against, without ever mutating argv for that case.

Anti-vacuity: test_a_held_run_with_no_explicit_worker_count_still_receipts_its_admitted_width
runs a plain command with no -n flag through the real slot receipt path
and asserts receipt["sizing"] is present with workers=1,
requested_workers=1, narrowed=False. Reverting resize_worker_argument's
early-return behavior for this case makes it red (receipt.get("sizing")
is None). Existing tests in test_corpus_worker_memory_bound.py (51
passed) confirm width narrowing for explicit multi-worker requests is
unchanged.

Both devtools/worker_memory.py and tests/unit/devtools/test_pytest_slot.py
are OUT of the derived schema closure (devtools schema closure); this
carries no rebuild landing constraint.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
@Sinity
Sinity enabled auto-merge (squash) September 22, 2026 07:04
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e4fb9373-5511-48a4-877f-14c97fd551c0

📥 Commits

Reviewing files that changed from the base of the PR and between df603d9 and 03722c1.

📒 Files selected for processing (4)
  • .agentctl/project.toml
  • devtools/worker_memory.py
  • tests/unit/devtools/test_pytest_slot.py
  • tests/unit/storage/test_archive_tiers_assertions.py

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 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-22T07:08:08.032289Z 03722c1 PR opened
🔒 Security Review ✅ Completed 2026-09-22T07:08:40.301974Z 03722c1 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.

@Sinity
Sinity merged commit 52c2175 into master Sep 22, 2026
3 checks passed
@Sinity
Sinity deleted the fix/unblocked-devtools-batch branch September 22, 2026 07:15
Sinity added a commit that referenced this pull request Sep 22, 2026
…ness

Triage of 35 P1 review findings at 17566b0; these six reproduce at HEAD.

- pytest_slot: a held run signalled at its deadline (the route verify_all
  and verify_affected take inside the pytest pool) wrote no receipt at all.
  The handler stopped the child and re-raised, so sampler.stop() and the
  return value were never reached, and the caller's disposal removed the
  live telemetry sidecar on the way out. The selected width and the measured
  peak were lost on exactly the runs whose sizing evidence is worth most.
- verify_testmon_selection: the gate's declared anti-vacuity mutation
  (CORPUS_MAX_WORKERS = 0) left it green, because the produced argument and
  the expected value both read the same constant. The refusal is now an
  independent claim about the argument list.
- verify_rebuild_routes: a fully qualified `pkg.mod.rebuild_index(...)` call
  was invisible to the census (only attribute chains rooted directly at an
  ast.Name were read), and module-wide merging of every import let one
  function's local import erase another's binding of the same name. Measured
  over polylogue/: +265 edges, -60 wrong ones.
- verify: the blanket `.md` exemption made a change set of only
  tests/data/golden/chatgpt-simple.md select no pytest, though
  TestGoldenMarkdownRendering::test_chatgpt_simple_session compares that
  exact file. The suffix exemption now stops at tests/.
- schema_promote: the post-promotion audit inspected the installed
  polylogue/schemas package, while promotion writes to the registry's
  data_home()/schemas storage root.
- schema_fast_forward: two semicolon-terminated statements on one line were
  handed to execute() in one call, so a valid transition applied or failed
  on newline formatting alone.

Two inherited reds in tests/unit/devtools/test_verify.py are fixed forward:
#5405 added `checkout = "candidate"` to the verify_all operation without
updating the two assertions that require the key to be absent. One of them
is in DESCRIPTOR_CONTRACT_TESTS, so a descriptor-only verify was red.

Verification: devtools gate format/lint/mypy/rebuild-routes green;
devtools test over the six changed test files green
(.cache/verify/runs/20260922T081111Z-focused-test-1504360-2de9d572 and
20260922T080332Z-focused-test-1486718-9cc77d90).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
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 added a commit that referenced this pull request Sep 22, 2026
…scriptor

`.agentctl/project.toml` gained `checkout = "candidate"` on
`[operations.verify_all]` in #5405, which changed no test. Two contracts in
`tests/unit/devtools/test_verify.py` still pinned the previous shape and
fail deterministically at HEAD:

    assert "checkout" not in complete
    "checkout": "any",     # the parser's default for an undeclared key

Separately, `schedule = "*-*-* 03:00"` -- the declaration of the sole nightly
complete-corpus run -- is asserted nowhere in the corpus. A descriptor-only
diff runs these contracts INSTEAD of Testmon
(`_selection_for_changes` -> "descriptor"), so deleting the schedule would
publish green while silently disabling that run. That was the finding raised
on #4677 and it is still open.

Assert the declared value on both the TOML and agentctl-parser sides, and add
the schedule invariant, each with the mutation that makes it red.

    devtools verify --quick     # 22 gates ok; gate atlas inherited-red

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
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