Skip to content

fix(devtools): make affected verification reachable - #4508

Merged
Sinity merged 2 commits into
masterfrom
fix/affected-verification-reachable
Sep 1, 2026
Merged

Sinity merged 2 commits into
masterfrom
fix/affected-verification-reachable

Conversation

@Sinity

@Sinity Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Affected verification (devtools verify) refused in every lane and every shell; lanes shipped on static gates only. This makes it reachable again and removes the gate that could never pass.

Problem (evidence)

  • latest_eligible_root gated affected runs on an immutable complete graph root. No root was ever published (.cache/verify/graph/roots does not exist; a root needs a green complete run, and the nightly has been red), and lanes could not see the main checkout's roots (POLYLOGUE_VERIFY_GRAPH_PARENT is set nowhere).
  • --all ran untraced and partitioned 3 ways. testmon's sync_db_fs_tests deletes recorded tests a run did not collect, so the graph held exactly one partition: environment 10 has 6719 of 20393 collected tests.
  • --all stopped at the first red pytest step (batch 1 of 3 on 08-31), so neither the report nor the graph completed.
  • The environment digest hashed HYPOTHESIS_PROFILE/POLYLOGUE_CI. Daemon jobs (default) named polylogue-8acc0495…, shells (ci) polylogue-c547d24e…, unset polylogue-d819975c…, for one graph.
  • Provision discarded a stale seed's database but not its -wal/-shm; the lane then refused with "SQLite sidecars exist without the owned database".

Solution

  • Delete devtools/verification_graph.py and the parent-root gate; drop its projection fields from the verification receipt.
  • --all always traces (--testmon --testmon-noselect) as one collection, and runs every step, keeping the first non-zero exit.
  • Digest hashes collection inputs only.
  • Provision removes sidecars with a discarded seed.

Verification

.venv/bin/python -m pytest tests/unit/devtools -q -p no:randomly -n 6

898 passed, 63 failed on the branch; 60 of those fail identically on untouched master (same command), and the 3 branch-only failures require the free-threaded interpreter this scratch worktree's venv lacks (RuntimeContractError: ... the GIL is enabled). ruff and mypy clean on the touched modules.

Residuals

The graph for the daemon's environment is still the partial one until the next complete run publishes a full graph; the nightly verify_all at 03:17 does that once this merges.

Receipt: session-01YGi8wLWGR2HYBh8p8fXFXz

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

@coderabbitai

coderabbitai Bot commented Sep 1, 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: 720bc08a-e6f0-4f55-a685-6cc8dfc37323


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 1, 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-01T21:57:45.698857Z b8bd2f0 Manual request
ℹ️ 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.

@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: 33dfd93fca

ℹ️ 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/testmon_bootstrap.py Resolved
Comment thread devtools/verify.py Resolved
Comment thread devtools/verification_result.py Resolved
Comment thread devtools/testmon_provision.py Resolved
…bility

- The complete corpus forces HYPOTHESIS_PROFILE=default and drops
  POLYLOGUE_CI: it is the only graph producer, and a graph traced under a
  reduced example budget lacks edges every consumer would then inherit.
- The recorded diagnosis is the first failing step's, matching the retained
  exit code.
- The verification result schema is version 2: the graph-root projection
  fields are gone.
- A seed the provisioner cannot remove is a typed error result, not a
  traceback.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
@Sinity
Sinity force-pushed the fix/affected-verification-reachable branch from 33dfd93 to b2670f7 Compare September 1, 2026 21:10
@Sinity

Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: b2670f7fce

ℹ️ 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
Affected runs write graph edges too (testmon replaces the edges of each
executed test), so forcing the default Hypothesis profile only for the
complete corpus still let a shell's reduced profile degrade the shared graph.

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

Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: b8bd2f0dd7

ℹ️ 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
@Sinity

Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: b8bd2f0dd7

ℹ️ 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
@Sinity

Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: b8bd2f0dd7

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

@Sinity
Sinity merged commit 5a43b52 into master Sep 1, 2026
3 checks passed
@Sinity
Sinity deleted the fix/affected-verification-reachable branch September 1, 2026 22:00
Sinity added a commit that referenced this pull request Sep 5, 2026
…4709)

## Summary

Four test-harness defects that slow every lane, fixed at their causes.

## Problem

**Descriptor leak (polylogue-uvx0q).** Eleven tests in one xdist worker
died
with `OSError: [Errno 24]` and `unable to open database file`. None of
them
leaked: `with sqlite3.connect(path) as conn` manages a *transaction*,
not the
connection, so the descriptor survives the block until collection.
Forty-seven
production sites used that form. Measured on
`initialize_active_archive_root`:
3 leaked descriptors per call. The victim is whichever test runs when
the table
fills.

**Slot deadlock (polylogue-9dbqu).** The declared `verify_all` job ran
`devtools verify --all`, whose pytest step enqueued a second
pytest-group task
and waited for it. The group runs one task at a time and the job held
it, so
nothing drained for 30 minutes. The queue runner exports no variable
naming the
job's pool and the pytest slice is not visible from every host
configuration,
so neither the environment nor the cgroup classified the process.

**Gate independence (polylogue-w3at6).** The abort-on-first-red
behaviour was
already fixed by #4508; nothing pinned it, so it could regress silently.

**Corpus killed (polylogue-b054.1.1.2).** Width was fixed at 8
regardless of
free memory; two corpus runs were killed by systemd-oomd at ~6.2 GB
peak.

**Unprovisioned worktree (polylogue-8dfcy).** A checkout with no `.venv`
reported `gate_missing_executable` for an installed ruff, naming neither
cause
nor remedy.

## Solution

- `sqlite_connection` keeps commit-or-rollback semantics and closes; all
47
  sites converted.
- A harness guard fails an outright per-test leak on its own test, and
on
exhaustion names the largest cumulative retainers. A per-test bound
alone
would not have caught this cascade — it retained ~3 descriptors per test
  across hundreds of tests — so the report points past the victim.
- `holds_pytest_slot` reads the pool from the launch document carried by
the
  queue-runner ancestor. Verified against two live queue tasks.
- Corpus width is derived from `MemAvailable` using the workload's
measured
per-process peaks, decided *inside* the slot: a queued run can wait
hours, so
a width chosen when the command was built describes memory that is gone.
- An absent `.venv` is reported as `gate_unprovisioned_environment` with
the
devshell command, and explicitly warns against sharing another
checkout's
  venv (its editable install would run that tree's product).

## Verification

`devtools verify --quick` — green, all 13 gates, `exit_code: 0`:

```
gate format ok / lint ok / mypy ok (75.3s) / generated-surfaces ok /
layering ok / patterns ok / doc-commands ok / schema-manifest ok /
oracle-integrity ok / testmon-selection ok / consumer-reachability ok /
timestamp-doctrine ok / schema-privacy ok
```

`devtools render all --check` — no `out of sync` lines.

Leak fix measured directly: `initialize_active_archive_root` × 10 leaks
30
descriptors before, 0 after. Guard attribution verified in a live pytest
session: a test opening 30 unclosed connections is reported as
`ERROR ...::test_leaks` and the following test passes.

Width sizing measured live: 4707 MiB available yields 3 workers, 5210
MiB
yields 4; eight would need ~6.5 GiB, the peak that was killed.

## Residuals

- The focused pytest run over the new tests was still queued behind
other
lanes' jobs when this PR was opened; the required `verify` check runs
it.
- The corpus-survival criterion (a full run completing under desktop
load)
needs a full corpus run to confirm end to end; that has not been done
here.
- Per-worker memory is dominated by retained objects, not imports: a
worker's
import baseline measures 137 MiB RSS, so import trimming could recover
at
  most ~1 GiB of a 6.2 GB peak and cannot by itself prevent the kill.

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

https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid

---------

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 c0dda6f):

  • P2 devtools/testmon_provision.py:61: Stale: devtools/testmon_provision.py was rewritten around a single checkout-local datafile; remove_invalid_native_testmon_state and NativeTestmonRepairError no longer exist in devtools. (checked at 64a9bd0)
  • P2 devtools/verification_result.py:33: Fixed on master (checked at 64a9bd0): The reduced receipt projection is published as schema version 2 (devtools/verification_result.py:8, emitted at :21), so the version now signals the shape change.
  • P2 devtools/verify.py:771: Fixed on master (checked at 64a9bd0): The diagnosis is now taken from the first failing result, matching the retained exit code (devtools/verify.py:1459-1463).

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

@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 54.F044 / P1: stale at the checked revision: devtools/testmon_bootstrap.py was deleted in bc34061 (refactor(devtools): excise self-attesting machinery; testmon as one seed (refactor(devtools): excise self-attesting machinery; testmon as one seed #4551)); the cited code no longer exists at 5ebcfe5.
  • 54.F085 / P1: fixed-already at the checked revision: The current single-collection implementation releases flushed testmon reports and coverage maps during the run (devtools/pytest_testmon_retention.py:53,63), and the streaming report drops each completed test from its in-memory map (devtools/pytest_stream_report.py:140). Worker count is independently narrowed against the live cgroup budget (devtools/worker_memory.py:695), replacing the former multi-invocation recycling bound.
  • 54.F086 / P1: fixed-already at the checked revision: The complete corpus is constructed as one traced collection (devtools/verify.py:243). The optional second contract-document step is affected-only and uses descriptor mode, which disables testmon, so it cannot prune the first collection from the shared graph (devtools/verify.py:278).
  • 54.F087 / P1: Fix and current-source recheck assigned to polylogue-t5jl2; not claimed fixed. Managed graph writers still accept a caller-selected Hypothesis profile (devtools/verify.py:299,852), while the shared testmon environment is fixed and its compatibility key includes packages/Python rather than that profile (devtools/testmon_provision.py:45,95). Reduced-budget runs can overwrite the same dependency graph used by default-budget selection.

Only the rows listed above are dispositioned. Held findings remain open.

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