Skip to content

feat(formal-verification): prove the ci-lanes carry-forward promise - #16886

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/formal-ci-lanes-carry-forward
Nov 17, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/formal-ci-lanes-carry-forward

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Closes #15773
Siblings: #16704

Summary

The dogfood #15773 asks for: a second promise in this repository taken through /formal-verification:specify create, with a seeded break the check catches. The promise is that a contract-only CI Status run never carries an older ci-lanes success while a full run is in flight; a break would let a pull request merge past red lanes. This adds the consumer skill .claude/skills/formal-ci-lanes-carry-forward/ and changes no product code or workflow.

An agent generated the skill by following the specify skill's files in this repository. The installed plugin's /formal-verification:specify was not invoked, because the plugin is not installed in the building session. The owner accepted that for closing #15773 (2026-11-17, "go w/ recommended"); one recorded capture run of the installed skill is owed on #16383.

Fix

  • model/CarryForward.tla models the full runs, the mark-lanes marker, the verdict write and the contract-only run's list, read, verify, hold and decide steps. Each action cites its lines in pr-require-checks.yml and in the pinned aggregate-results action.
  • Three rules: NoStaleCarry (a passing contract-only run carries no success an in-flight full run is about to replace), HeldPassIsNewer (after a hold, only a success newer than the held runs passes) and PassCarriesSuccess (a pass needs a success whose writer was verified).
  • Two shipped configurations: Yield.cfg (the open pull request hold) and YieldNoHold.cfg (the draft setting with no hold).
  • SKILL.md records the tool and why, the bounds, what the model leaves out and the known results. sync.yaml pins both checks and the seeded break to a commit on main.

Known limit, decided by the owner (2026-11-17, "Go with recommendations."): the listing is the moment the run decides. A full run created between the contract-only run's last listing and its pass is not seen. The stricter rule with no such exemption, NoStaleCarryAtPass, is defined in the model, breaks in 10 steps, and is recorded under "Known results" with its trace. It is not shipped as a check.

Verification

  • Yield.cfg: 4,788,560 distinct states, every rule holds (TLC 4 min 6 s). YieldNoHold.cfg: 880,975 distinct states, every rule holds (46 s). Both rerun after main was merged in, with the same counts as before the merge.
  • Seeded break, made in a throwaway worktree: yield-to-full-run: 'false' on the Aggregate lane results step, mirrored as Yield = FALSE. NoStaleCarry breaks after 5,056 distinct states (Yield.cfg) and 7,972 (YieldNoHold.cfg), on an 11-step path.
  • node plugins/formal-verification/scripts/check.mjs --default-ref refs/remotes/origin/main: 2 formal-<area> skill(s), 0 failure(s), 0 warning(s).
  • The model was written at c5bca03 and synced at 2844a8f. Between them the covered workflow changed only in its action pins (v0.74.1 to v0.75.0) and one added path-filter line (scripts/silent-skip-exemptions.txt), and the ci-workflows compare between the two pins lists 19 changed files, none under .github/actions/pr-require-checks/aggregate-results/. So no modelled step changed.
  • Left out: a recorded run of the installed skill (owed on Let the pr-verify capture record a command-running skill's drive run #16383); a re-run of the second full run, marker failure together with a hold, forks and merge-group runs, which SKILL.md lists under "Not covered"; whether GitHub's required check could turn green inside the known-limit window, which was not tested.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 17, 2026 11:14
Add .claude/skills/formal-ci-lanes-carry-forward: a TLA+ model of the
ci-lanes commit status on one pull request head, written by full runs of
PR Require Checks (mark-lanes and ci-status) and read by a contract-only
run through the pinned ci-workflows aggregate-results composite.

Yield.cfg (the open pull request's setting) and YieldNoHold.cfg (the
draft's) hold NoStaleCarry, HeldPassIsNewer and PassCarriesSuccess. With
yield-to-full-run 'false' NoStaleCarry breaks, so the check can fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rent main

Main re-pinned the aggregate-results action (v0.75.0) and changed the
covered workflow after the first sync commit. The model needed no change.
Line citations move by one, both cfgs and the seeded break were rerun
with the same state counts, and the strict-reading result is recorded as
a known limit with its ten steps.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 17:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T17:12:20.299625Z 87406bf Draft marked ready
ℹ️ 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.

@kyle-sexton kyle-sexton added do-not-merge Hard merge gate: do not merge while applied. and removed do-not-merge Hard merge gate: do not merge while applied. labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 87406bf9b42a9bc4c6d3acfdefd4285efef4d415: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16886 (head 87406bf)

I found no security issues. I read every hunk of all 6 changed files.

What the change does. It adds one project skill, .claude/skills/formal-ci-lanes-carry-forward/. The skill holds SKILL.md, a TLA+ model (CarryForward.tla), two TLC configs (Yield.cfg, YieldNoHold.cfg), a trace-rendering module (view.mjs) and sync.yaml. It changes no workflow, action, script, trust control, merge hold or plugin manifest. The files match the **/.claude/** trusted-path glob, so I gave each whole file the extra scrutiny that glob asks for.

What I checked:

  • Who can invoke the skill and what it may do. SKILL.md sets disable-model-invocation: true (SKILL.md:10) and has no allowed-tools key, so it grants no tools. The only command it suggests is a read-only gh api GET of the pinned ci-workflows run.sh (SKILL.md:168), with a <sha> filled in by the operator. That opens no injection surface for untrusted input.
  • Code that runs. view.mjs is the only executable code. It maps state values to display strings and exports pure functions. It does no I/O, spawns no process, reads no environment and has no imports. It runs only when the operator runs /formal-verification:chart on their own machine.
  • sync.yaml. It holds only data: commit pins to a main commit, covered paths, commands that call the in-repo model files, and the seeded-break record. Nothing in it runs automatically in a credentialed lane.
  • Instruction surface. The change only adds a standing instruction; it deletes, narrows or softens none. So the instruction-exception-register lens has no removed rule to check.
  • Trust controls. Nothing under .github/actions/, nothing about the trusted-actor list, lane token scope or kill switch, and none of the merge-hold files or pr-pipeline.yaml is touched. The skill only describes pr-require-checks.yml; it does not edit it.

Known limit (context, not a finding). SKILL.md:141-156 records an existing window in the ci-lanes carry-forward: a full run created after a contract-only run's last listing is not seen before that run passes. This diff does not introduce the behaviour; it documents it, and the PR context says the owner accepted it. Since the change only adds the model and leaves the workflow alone, the window is excluded here as pre-existing.

Embedded text in PR context. None tells the lane to pass the PR, skip a check, drop a finding or post somewhere else.

Spend. None that bills. Running the TLC checks uses local compute on the operator's machine only.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 87406bf9b42a9bc4c6d3acfdefd4285efef4d415: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no blocking findings

This PR adds a TLA+ formal check for one promise: a contract-only CI Status run (one started by a label flip or body edit) never carries an older ci-lanes success forward while a full run is in flight. It lives in .claude/skills/formal-ci-lanes-carry-forward/ and consists of SKILL.md, model/CarryForward.tla, two cfgs, view.mjs and sync.yaml. No product code or workflow changes. I read every hunk of all 6 changed files.

What I checked against the code

  • Workflow line citations. I compared the model's WF: citations with .github/workflows/pr-require-checks.yml at head and they match:
    • the mark-lanes retry loop (WF:948-959);
    • the ci-status needs: mark-lanes (WF:4239-4240);
    • if: ${{ !cancelled() }} (WF:4262);
    • the contract-only predicate (WF:42-56, WF:234);
    • the concurrency group (WF:106-115);
    • the aggregate-results@24067add… pin (WF:7327);
    • yield-to-full-run: 'true' (WF:7348), the yield-wait-seconds expression (WF:7349) and carry-forward-wait-seconds: '0' (WF:7351).
  • ci-workflows citations not checked. The RUN:/ACTION: citations point into melodic-software/ci-workflows, and I had no access to that repository.
  • Known-limit trace. I traced the 10-step NoStaleCarryAtPass path by hand through CList/CRead/CVerify/CDecide. It is consistent with the model: the writer run1 is skipped as Wrote, Superseding = {}, and the pass leaves run2 in liveAtPass with start > listClock. So the shipped NoStaleCarry exemption is exactly that window, as the owner decided on Add the formal-verification specify skill's propose, create and check forms #15773.
  • Shape matches the existing skill. sync.yaml and the frontmatter follow the same layout as .claude/skills/formal-claim-protocol/.

Not independently verified (author-claimed): TLC state counts and timings, the seeded-break results (5,056 / 7,972 states), the check.mjs pass, and whether sync commit 2844a8f4 is an ancestor of HEAD. I had no shell to run them.

Closing issue #15773

Other criteria

  • No path-scoped rule under .claude/rules/ matches .claude/skills/**.
  • No paved-path row was found under docs/standards/.
  • No embedded instructions were found in the PR context.

Spend: none beyond the model-checker runs an operator starts by hand (about 3–4 min of local TLC per cfg). There is no billed resource.

Loosened-check verdict: fail (default; the prompt gave no loosened_check_verdict: line); patterns: 0. No loosening found: this adds a new check and relaxes no existing one.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 4a5923f Nov 17, 2026
148 of 150 checks passed
@kyle-sexton
kyle-sexton deleted the feat/formal-ci-lanes-carry-forward branch November 17, 2026 17:50
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the formal-verification specify skill's propose, create and check forms

1 participant