Skip to content

refactor(devtools): keep 12 quick gates and run them in parallel - #5650

Merged
Sinity merged 12 commits into
masterfrom
claude/prep-quickgate
Sep 27, 2026
Merged

Sinity merged 12 commits into
masterfrom
claude/prep-quickgate

Conversation

@Sinity

@Sinity Sinity commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

devtools verify --quick keeps 12 gates, down from 23. They now run side by side, so the gate costs roughly its slowest step. Each gate that remains guards an invariant nothing else checks, where a regression would be costly.

  • Deleted, because a live test already asserts the invariant: declaration-bindings, api-parity, schema-provider-identity. devtools verify api-parity stays as a command.
  • Deleted, because no costly regression depends on them: controlled-read, doc-commands, oracle-integrity, testmon-selection, test-packages, root-topology, population-coverage, consumer-reachability. Their modules, census and baseline files, and tests go with them. Net −6,100 lines.
  • Speed-ups:
    • layering parses and walks each module once, via a content-keyed AST cache: about 97 s → 25 s on the same host, with byte-identical output.
    • schema-manifest caches the rendered base-commit schema by commit: about 22 s → 1.5 s warm.
  • Machinery removed:
    • The CircleCI nightly lab-policies job. Its only check, timestamp-doctrine, is in the quick gate.
    • Gate.blocking and the report-only plumbing, now that no report-only gate remains.
    • A periodic tier, drafted earlier on this branch, is gone again: every kept gate fits inside the parallel quick run.

Problem

  • Evidence base: 968 quick-gate receipts from 2026-08-31 to 2026-09-27. Median cost was 228–239 s, with every step run one after another.
  • Gates that catch real defects:
    • mypy: 141
    • format: 99
    • lint: 70
    • layering: 30
    • patterns: 13
    • schema-closure: 9
  • Everything else caught 0–3 real defects in about 650 runs each.
  • The per-gate table and the reasoning for each decision are in polylogue-j325x.

Solution

  • devtools/gate.py: the kept table. Its docstring states the rule: hosted CI runs no pytest, so a live-tested invariant stays a gate only when a regression that merges unnoticed is expensive to undo. That covers committed privacy leaks and durable DDL.
  • devtools/verify.py:
    • A thread-pool step runner reports outcomes and diagnosis in declared order.
    • VerifyRun step bookkeeping is thread-safe.
    • On an interruption, the runner stops the live gates and joins their workers before the verdict. A stopped gate is recorded as verification_interrupted.
  • devtools/ast_cache.py: content-keyed parse and walk cache for the layering censuses.
  • Base-commit schema cache: .cache/verify/schema-state. CircleCI saves it.
  • References repointed: docs, atlas sheets and repair messages that named deleted gates now name the live test.
    • This includes one string in polylogue/core/schema_subjects.py, which is IN the derived schema-identity closure. This PR therefore moves the derived schema identity and must land before a rebuild starts.

Verification

  • devtools test over 21 affected files (devtools, parity, declarations, provider identity, surface boundary, maintenance declarations): 355 passed.
  • devtools verify --quick on the pre-rebase tree: PASSED. The host was at load average about 16, and mypy waited 172 s on the shared mypy lock; perf(devtools): check mypy on per-checkout caches seeded from siblings #5653 removes that lock wait. The 12 other gates finished within 40 s.
  • devtools render all --check: nothing out of sync.

Residuals

  • pytest-json-report in pyproject.toml is now unused. Removing it would change the lockfile and environment, so it is left for a separate change.
  • tests/unit/devtools/test_derived_sweep_census.py::test_render_declaration_round_trips fails on master too: the declaration has fallen behind daemon_ingest.py.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 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-27T23:41:19.225905Z c8c794f New commits
ℹ️ 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: cbeadbca2f

ℹ️ 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 force-pushed the claude/prep-quickgate branch from cbeadbc to aec41aa Compare September 27, 2026 19:34
@Sinity Sinity changed the title perf(devtools): tier and parallelize the quick gate refactor(devtools): keep 12 quick gates and run them in parallel Sep 27, 2026

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

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

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

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

@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: 4e552ddced

ℹ️ 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/sqlite_degradation.py Resolved

@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: 1a25dd1fc6

ℹ️ 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 docs/atlas/doctrine.md Resolved

@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: 1489bdce83

ℹ️ 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/gate.py Resolved
Comment thread devtools/gate.py Resolved

@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: 3a2f776f6d

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

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

ℹ️ 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 enabled auto-merge (squash) September 27, 2026 22:11
@Sinity
Sinity force-pushed the claude/prep-quickgate branch from 04e8621 to 5467b93 Compare September 27, 2026 22:21
Sinity and others added 12 commits September 28, 2026 01:31
The layering gate ran five AST censuses that each read, parsed and walked
the whole package, some several times. A content-keyed parse and walk
cache, binding-node prefilters for the three-pass string resolution and
per-module prefilters cut it from ~97 s to ~25 s on the same host with
byte-identical output.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Rendering the merge base extracted and cold-imported the whole package on
every run (~20 s). A commit cannot change, so its rendering is cached by
commit, renderer and interpreter, and an unchanged package is compared
against itself. Warm runs take ~1.5 s.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Over 968 quick runs, eight gates caught at most one real defect each; they
move to a periodic tier run by verify --periodic (nightly CI, a declared
AgentCTL schedule) and verify --all. consumer-reachability, report-only and
diff-based, becomes manual. Quick gates now run in parallel with ordered
outcomes, locked receipt writes and interruption that stops live gates.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…riants

Keeps 12 quick gates and deletes ten: invariants already asserted by a live
test (declaration-bindings, api-parity, schema-provider-identity) and checks
with no costly regression to prevent (controlled-read, doc-commands,
oracle-integrity, testmon-selection, test-packages, root-topology,
population-coverage, consumer-reachability). With every kept gate inside the
parallel quick run, the periodic tier, --periodic, its AgentCTL operation,
the nightly CircleCI jobs and the report-only plumbing go too. Interrupted
runs now join their gate workers before the verdict (Codex review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
A gate that runs its checker as a child (the mypy gate runs mypy) left that
child holding the output pipes after the wrapper was terminated, so the join
waited for it. Gates now lead their own process groups and the group is
signalled (Codex review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Checking the interruption and registering the gate process are now one step
under the step lock, and queued gates are cancelled before the live-process
snapshot, so no gate launched around an interruption runs to completion
(Codex review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
After the grace period the interruption kills whatever of a gate's process
group survived, even when the leader exited on SIGTERM. The SQLite
degradation census slices handler text from the same read its tree was
parsed from (Codex review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
The declarations doctrine and the marker projection name the live bindings
test, and the production-reachability fixture package, orphaned with its
oracle, is deleted (Codex review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
A second SIGINT or SIGTERM during interruption cleanup no longer escapes
it; the handlers are restored once the gates are stopped and joined (Codex
review).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Master's mypy configuration rejects reaching stdlib modules through
devtools.verify's namespace, which failed the quick gate after rebase.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
@Sinity
Sinity force-pushed the claude/prep-quickgate branch from 5467b93 to c8c794f Compare September 27, 2026 23:37
@Sinity
Sinity merged commit 41b3f83 into master Sep 27, 2026
3 checks passed
@Sinity
Sinity deleted the claude/prep-quickgate branch September 27, 2026 23:43
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