Skip to content

fork-kit/review: one general review skill; tiers, failure table, nit-only check and a drift test - #845

Merged
scuttletoby merged 6 commits into
mainfrom
fork/kit-review-one
Nov 22, 2026
Merged

scuttletoby merged 6 commits into
mainfrom
fork/kit-review-one

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Audit #834, item G6: one review skill in the fork kit; a project keeps only its lens config.

What and why

Two review skills drifted apart: this kit's fork-kit/review and the one a downstream project's agents actually use
(that project's own skill, its order and lens-comment pages, and its eval folder). This PR makes the kit's
SKILL.md the one general skill. Every general rule of the project copy is merged in; the
project copy can then shrink to a thin adapter (a follow-up PR in that project, not here).

No code change to the gate or the kit tools: only the skill text, COMMENTS.md (two new checked examples), REVIEW.md,
the eval lens text and one new test class.

Drift table (section by section)

G = general (now in the kit), P = project fact (stays in the project), C = conflict (pick below).

Section Project skill Kit before Kind Now
Tiers tiers 0-3 by what the change touches, tier per module in a registry file, "unsure: higher tier" weights critical/normal/light from the review block C + P the gate's weight is the tier; table with defaults; a project maps its own tier names onto the three weights in its rules (P)
Tier 1 = CI only, no review owner decision light = CI only G light row
No-CI projects ("light" in other projects' prose: one Opus review) - fallback: normal, one lens C named: no queue config = normal, one lens, by hand
Author: why, root cause, where else, red-to-green yes yes G kept
Failure table (one row per write step: crash, rerun, old/empty start; skips and fallbacks) yes one sentence G added to §2, plus "a lens checks the table; a missing row is a finding"
Size (~400 changed lines, else a stack) yes - G added
Draft until lenses are done yes - P (merge path) "a project may open drafts"
CI side by side, lenses do not wait yes yes G kept
Outside reviewers extra, never required; which ones, when yes - G / P rule in kit; the list stays in the project
Lenses get the problem as reported, no summaries yes yes G kept, plus "no other lens's report"
Batch per area (<= ~1500 lines, one comment per PR) yes - G added
Verify, one push per round yes yes G kept
At most 2 rounds, then the orchestrator / override, then one audit yes yes (lens_rounds) G kept
Nit-only quick check (nit-only: yes/no) yes - G added; COMMENTS.md example checked
Minors into one follow-up issue yes, with the project's labels yes (minors) G / P kept; labels are the project's
Ready twice, auto-merge, push nothing after the project's ready command - P "the queue config's ready_command; push nothing after"
State question "...existing/old/empty state (rerun, half-applied, legacy data, empty history)", answered in checks: default question, answered on state: C state: line; question stays the kit setting state_question
Lens list correctness, design, tests + item/data integrity, exploits, concurrency, performance, game client, domain expert, visual correctness, design, tests, data, security, concurrency G / P added performance, domain expert, visual, forged messages under security; item/game-client lenses stay the project's (domain lenses)
Attacks leave failing tests yes yes G kept
Twin lens names (DI-1, DI-2), focus: runs twice and first yes - G added
covered: rule (not listed = not reviewed; every changed file in some lens's final covered) yes - G added
Model table critical lenses 2x Opus xhigh; others Opus high; Fable audit; Fable never a lens runner Opus high; audit Fable high; low/max forbidden C + P default stays Opus high (the owner's tier rule); xhigh for twin lenses is a project's lens_runners; "audit model never a lens" and "a cheaper model never the only reviewer" added
Comment format finding: <sev> ..., findings: none, no state: line state:, blocker:, major:, minor: C state: + blocker:/major:/minor: (both shapes parse; see picks)
After-post check of the live comment project command review_kit.py check before posting G / P both: kit check before posting, a project's own check right after
Flagged comment handling (not a lens:) yes yes G kept
Gate comment rules page project page COMMENTS.md, tested C COMMENTS.md; the project's lens_format_doc should point there (REVIEW.md)
Risk labels on follow-up issues project labels - P stays in the project
Eval method, prompt, judge prompt /tmp paths, project names general, {workdir}, harness review_eval.py G kit's; merged the concurrency part and the covered: rule into the eval lens
Eval truth set and case briefs project data example config P stay in the project, read by the kit harness through its eval config
Eval process reaper scripts host-specific - P stays with the host, not in the kit

Picks for the conflicts (what the gate parses decides)

  • Tier = the gate's weight. The review block's rules (weight per path glob) are what the gate reads, so a
    separate tier key would be a second source. Defaults: min_lenses 2/1/0 from review.recommended.json, runner
    Opus high. The new test pins the skill's table to the gate's WEIGHTS and those counts.
  • State answer on a state: line, not in checks:. The gate parses state_line (not enforced yet), the kit's
    check requires it, and T3's lens prompt (Review rules T3a: lens_start plan, prompt, refusals and request ids (pure logic) #825) asks for "a line starting state:". COMMENTS.md now shows the
    older shape (state only in checks:) and that check refuses it.
  • Findings as blocker: / major: / minor: lines. Both shapes parse the same in the gate
    (finding: <sev> lines and findings: none count as a findings section), but the gate's release note asks lens
    prompts to write blocker: none and major: none, and Review rules T3a: lens_start plan, prompt, refusals and request ids (pure logic) #825 writes the same. finding: lines stay documented as
    read.
  • Default runner Opus high for critical lenses, not xhigh: the owner's tier rule is two independent Opus high
    lenses; a project that wants xhigh for its twin lenses sets lens_runners.
  • The gate's light (CI only, no lens) keeps its meaning; "light" for projects without CI is named "no queue
    config: normal, one lens".

Config keys (unchanged; now documented as the tier source)

  • Queue config review block (read by the gate, keys in the pr-queue README "Review rules"): rules[].weight is
    the tier per path pattern; min_lenses the per-tier lens count; lenses, rounds, findings,
    override_authors, state_line. Also lens_format_doc (only quoted): point it at the kit's COMMENTS.md.
  • .github/review-kit.json (kit only): runner, lens_runners, audit_runner, forbidden_efforts,
    lens_rounds, minors, state_question, queue_config. REVIEW.md now has a "what stays in the project" table.

Test

fork-kit/review/tests/comments.test.py, new class SkillFormat:

  • every report template the skill (§6), the eval lens and COMMENTS.md ("The shape") tell a lens to write is filled
    in as a clean read and fed through the gate's own parser (lens.py, review_judge.py via review_kit.verdict):
    it must read read, clean, state, and check must exit 0;
  • the same template without its state: or blocker: line reads no state / no findings section;
  • the state question is word for word in SKILL.md, eval/lens.md and REVIEW.md;
  • the skill's tier table rows are the gate's WEIGHTS, with the lens counts of review.recommended.json.

Red checks done by hand: removing the state: line from the skill template, changing the normal tier's count,
dropping the lightest choice from the eval lens's finding: placeholder, and rewording the state question each
turned the class red. vp fmt --check fork-kit/review is clean.

python3 -I -B fork-kit/review/tests/comments.test.py   # 31 tests OK
python3 -I -B fork-kit/review/tests/plan.test.py       # OK
python3 -I -B fork-kit/review/tests/eval.test.py       # OK

State question for this change: the docs and the test hold no state; the test reads files only and gives the same
answer on every run.

General vs project

General: all of it. No project names, paths or machines; examples use made-up lens names and paths. Project facts
(its tier per module mapped to weights, its lens list, its domain lenses such as item duplication attacks, its
commands, labels and outside reviewers) stay in that project's review block, lens prompts, kit settings and a thin
adapter skill, done in a follow-up PR in that project after it moves its fork-ci pin to a release that has the
review rules.

Left

  • The downstream project's adapter PR and its fork-ci pin move (separate PRs there).
  • state_line is parsed but not enforced by the gate; enforcing it is gate work, not part of this PR.

🤖 Generated with Claude Code

…only check and a drift test

The kit's SKILL.md becomes the one general review skill, so a project keeps only its facts (review block, lens
prompts, kit settings) and a thin adapter. Merged in from the project skill: the tier table as the gate's weights,
the author's failure table, nit-only quick check, batch per area, twin lens names, focus lenses, covered rule, the
extra general lenses, and a concurrency part in the eval lens. Conflicts go to what the gate parses: the state answer
on a `state:` line and `blocker:`/`major:`/`minor:` lines.

New test (comments.test.py, SkillFormat): every report shape the skill, the eval lens and COMMENTS.md tell a lens to
write reads as a clean read with a state line through the gate's own parser; the skill's tiers match the gate's
weights and recommended min_lenses; the state question is word for word in the skill, the eval lens and REVIEW.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby

Copy link
Copy Markdown
Owner Author

not a lens: Lens A (#845), review notes for head bb08b8e (a plain note, so the gate does not count it as a lens read)

Verdict: NEEDS FIX (one major, five minors). The skill matches the gate on tiers, lens counts, comment format, overrides, twin-lens names and the reads-nothing rules, but its nit-only quick check runs into a gate rule the skill never mentions.

Major

  1. The nit-only quick check counts as a gate round and makes the approach lens required; the skill never mentions the approach lens. fork-kit/review/SKILL.md:78-80 (and §3 step 7 as a whole).
    The gate counts a round as every lens header that read a different own change (review_judge.review_round, fork-ci/actions/pr-queue/review_judge.py, the review_round function). The quick check is a lens comment on the fix head, so it is a new round. The common case is round 1 on A, round 2 on fix B, then a nit-only fix C with a quick check on C. That is gate round 3, which is the recommended rounds.approach_at (3). In enforce the approach lens then becomes required (fork-ci/actions/head-check/head_check.py:363-364). The orchestrator's override from step 7 does not supply a missing required lens (head_check.py:214,229-232: missing = required key not in reads). It only waives the approach lens when its author is in override_authors (decided), and that list is empty by default. So an agent that follows the skill exactly has its head held for a lens named approach that the skill does not mention.
    Reproduced with the gate's own judge_rounds on review.recommended.json set to enforce, with history code@A, code r2@B, quick-check@C. Result: round 3 of 4, approach lens approach required from round 3.
    Fix: in §3 say that every lens read of a new head is a gate round (the quick check too), and name rounds.approach_at and approach_lens, the lens the gate adds from that round. Allow the quick check only while the next round stays below approach_at; past that, the orchestrator checks the fix itself and posts the override, as the skill already says for "the rest". Or tell the project to keep approach_at above lens_rounds + 1. The plan already prints asks for the lens 'approach' from round 3, but nothing in the skill says what that means.

Minor

  1. focus: <lens> is undefined in the kit and the gate. SKILL.md:116-118. Nothing in fork-kit/ or fork-ci/ reads or defines focus:, and "the owner asked" is one project's own phrasing. Either define it in general terms (a person asks for a lens to run twice: give it two names in the review block) or move it to the project's adapter skill.
  2. The tier table leaves out the built-in protected paths. SKILL.md:28 (light row: "comments, config values with no code path change"). The gate always counts the queue config, every lens prompt file and .github/workflows/** as critical (review_judge.protected_paths / is_protected). The light row reads as if config changes are light. "Comments" is not a path either: a comment-only change under src/ takes its path's tier. Add one line: "the queue config, lens prompts and workflows are always critical".
  3. The not a lens: way out is incomplete. SKILL.md:171-172 says "no line below it to hold lens:". The gate also refuses a not a lens: comment that has an unquoted hex read at on any line (lens.py OPT_OUT_READ, read_problem). So an edit that keeps reviewer: x · read at: <sha> without the word lens: still reads nothing. COMMENTS.md states the full rule, so add "and no read at sha outside a > quote".
  4. check exit 1 for a real finding. SKILL.md:131 and SKILL.md:168. A lens with a real blocker or major always gets exit 1 from check. Nothing says that is expected, and an agent told to "check before posting" may soften the finding to get exit 0. Add: "a report with a blocker or major exits 1 by design: post it when the words read read, blocker|major, state".
  5. Test coverage of the tier table. fork-kit/review/tests/comments.test.py (test_the_skill_tiers_are_the_gates_weights_and_recommended_lens_counts) pins the tier names and lens counts. It does not pin the "Opus 5.5 high" runner text in the same table to review_kit.DEFAULTS['runner'], so a change to the kit default would leave the table stale. Low impact.

Checked and fine

  • Parser: SkillFormat uses review_kit.verdict and check, which import the gate's lens.py, review_judge.py and config.py (asserted by Doc.test_the_parser_is_the_gates), never a copy. Drift is caught both ways. A doc template that stops reading read, clean, state fails, and so does a gate parser change that stops accepting blocker:/major:, finding: or findings: none. Every doc must still show a template (assertTrue(found)). A new or renamed gate weight fails the tier-row test (list(tiers) == list(WEIGHTS)).
  • The skill against the gate: heaviest weight decides, first matching rule takes a path, min_lenses 2/1/0 as config-time floors, overrides cover reads and clear findings only for override_authors, a lens with a blocker or major is held until it reads a fixed head, twin names are distinct lens_keys, an edited or hidden lens comment reads nothing until a new post, and a lens-looking comment that reads nothing keeps blocking until it is deleted or opted out. All match lens.py, review_judge.py and head_check.py.
  • The state question:
    • A config with no review block: the plan falls back to normal with one review lens and says so, and the gate runs no rounds or findings (its required-lenses input decides).
    • Old finding: lines: the gate reads them as a findings section, check refuses them without a state: line, and COMMENTS.md has a checked example of this.
    • A wrong tier name in weight: the gate refuses the config and plan exits 2 (fails closed).
    • A project tier mapped to a lighter weight: silent, but that is the project's config, which the gate decides by.
    • The new test holds no state and gives the same result on every run.
  • Public and general: no names, IPs, VM ids, home paths or game lenses in the diff. Example lens names and paths are made up. The only project leftovers are focus: and "owner" (finding 2).
  • Length: SKILL.md is 172 lines. There is no overlap with docs/fork (only the reviewRules setting is documented there). The report shape now appears in both SKILL §6 and COMMENTS.md "The shape", but the test checks both, so they cannot drift apart.
  • Tests: at the head, run through heavy: comments.test.py 31 OK, plan.test.py 27 OK, eval.test.py 28 OK.

state: docs and a read-only test. Rerun, a stop half-way, and old, empty or missing review state are covered above; the one problem found is round counting (finding 1).

scuttletoby and others added 2 commits November 21, 2026 23:46
…d check exits

- A quick check is a lens read of a new head, so the gate counts it as a
  round; the skill names rounds.approach_at / approach_lens / max, how to run
  the approach lens, and that only an override by a listed override_authors
  login waives it.
- The tier table names the gate's always-critical paths (queue config, lens
  prompts, .github/workflows/**); the light row no longer says config is light.
- focus: removed (nothing reads it); twin lenses described in general terms.
- check exits 1 for a real blocker or major by design; never soften a finding.
- not a lens: also needs no read-at sha outside a quote (COMMENTS.md rule).
- Drift test reads the round keys and recommended approach_at through the
  gate's parser and judge_rounds, the protected paths from review_judge, and
  the runner defaults from review_kit.DEFAULTS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: A r2 · reviewer: lens agent (Opus 5.5 high) · read at: 6f0d833
covered: git diff bb08b8e2 6f0d8330 -- fork-kit/review in full (SKILL.md, COMMENTS.md, tests/comments.test.py); against the gate: review_judge.py (protected_paths, is_protected, judge, round_marker, review_round, judge_rounds), review_config.py (ROUND_KEYS, parse_review), lens.py (lens_key, read_problem, lens_reads, reviewed_head), head-check/head_check.py (verdict, the review-rounds block), lib/review_kit.py (DEFAULTS, check, run)
checks: the kit's three test files through heavy: comments 34 OK, plan 27 OK, eval 28 OK. Six mutations of the skill or the gate against comments.test.py (results below). A repro script that feeds the skill's quick-check flow to the gate's own lens.Review.reviewed_head and review_judge.judge_rounds (recommended rules, set to enforce). The not a lens: rule: five comment variants through the kit's check.
state: docs and a read-only test, so no stored state. Runs again: the tests hold no state and give the same result every run. Stops half-way: nothing is written. Old or empty state: a config with no review block still falls back to one review lens; the new tests read review.recommended.json through the gate's parser, so a broken file fails them instead of passing. The one problem is the quick-check flow below, which leaves a head held.
blocker: none
major: SKILL.md:87-92 now sets the quick check against the override ("or skip the quick check and use the override below, which adds no round"), but a quick check alone never lets the head through, and the skill does not say the override is needed after it. Details below.
minor: tests/comments.test.py:352 checks for a new protected rule only through upper-case names in is_protected's source. Details below.
minor: SKILL.md:83 says "a r3 marker in a lens name counts too". The gate takes the higher of the change count and the marker (review_round), not the sum. COMMENTS.md says it right ("whichever is higher"), so use the same words here.

Result: NOT SAFE to merge as is (one major, two minors). Every round-1 finding is fixed at its root.

Major: a quick check alone holds the head

The gate passes a head only when every lens's newest read names that one head, or a newer override covers it (lens.py reviewed_head, lines 510-517; head_check.verdict). The quick check posts under its own lens name (quick-check in COMMENTS.md:107), so the lenses of the earlier round still name the old head. Reproduced with the gate's own code, history code@A, code r2@B, fix head C:

comments on the pull request reviewed_head rounds
quick-check@C the lenses did not all read one head: code B, quick-check C round 3, approach required
quick-check@C + approach@C (what the skill now says to do) the lenses did not all read one head round 3, approach required
quick-check@C + approach@C + override for C every lens read it round 3, approach required
override for C only every lens read it round 2

So an agent that follows step 7 (quick check, nit-only: yes, and the approach lens at round approach_at) still has its head held. The override is needed on both paths. Skipping the quick check saves a round and the approach lens; it does not replace the override.

The old text was already unclear ("The rest the orchestrator checks itself"). The fix's new "or skip the quick check and use the override" makes the wrong reading explicit. COMMENTS.md:103 ("The nit-only: line is for the orchestrator") does not say what the orchestrator does on yes either.

Fix: in step 7 say that on nit-only: yes the orchestrator still posts the override for the fix head, because that is what covers the lenses that read the old head. The quick check only adds an independent read, at the cost of a round. Then reword the "or skip the quick check" clause so it does not suggest the override is the alternative. Add a test in test_the_skill_counts_rounds_as_the_gate that feeds this history to lens.Review(...).reviewed_head and pins that the quick check alone gives no head and the override gives head C. The current test checks only judge_rounds, which is why it missed this.

Minor: one gate change the protected-paths test does not catch

tests/comments.test.py:352 looks for a new kind of protected path only through upper-case constant names in inspect.getsource(review_judge.is_protected). I changed is_protected to add or path.startswith('.github/actions/'), and the test file still passed (34 OK). A rule written inline, with no new constant, gets past the test while the skill's "Always critical" list goes stale. One fix: compare is_protected's answer with the skill's list on a few probe paths outside that list (such as .github/actions/x.yml and .github/CODEOWNERS), so a new rule fails the test. Low impact.

Round-1 findings: each fixed at its root

  1. Quick check and the approach lens: SKILL.md:82-96 names rounds.approach_at, rounds.max and rounds.approach_lens, says the quick check is a gate round, and says an orchestrator's override never replaces the approach lens. Each statement matches review_round, judge_rounds and head_check.py:363-364. My round-1 repro (code@A, code r2@B, quick-check@C) still gives "round 3 of 4, approach lens approach required from round 3", which the skill now says. The new major above is in the same step but is a different gate rule.
  2. focus: and "owner" are gone from SKILL.md and COMMENTS.md (grep finds nothing). The twin-lens text is now general.
  3. SKILL.md:28-32: the light row no longer says config, and the "Always critical" list matches protected_paths and WORKFLOWS. These paths count for the first critical rule (judge), so calling them critical is right. "A comment-only change takes its path's tier" is right.
  4. SKILL.md:185-188 matches lens.py:398-400 (OPT_OUT_READ, unquoted_lines). Checked with the kit's check on five not a lens: variants: a quoted read-at sha and a quoted lens header give not a lens. An unquoted reviewer: x · read at: <sha>, an unquoted mid-line read at <sha> and one inside a code block give reads nothing.
  5. Exit 1 for a real blocker or major is stated at SKILL.md:144-145 and :181-183, with "never softened". run exits 2 only for a usage error, which prints no words, so "otherwise exit 1" is right for a read comment.
  6. test_the_skill_runner_text_is_the_kits_default reads review_kit.DEFAULTS and checks both the §5 text and every tier row that has lenses.

The new drift tests read the gate's real code and fail when the skill drifts

review_config is the gate's module (fork-kit/review/lib holds no copy). review_judge is review_kit.review_judge. The recommended rules go through review_config.parse_review. Results of the mutations:

mutation result
skill says approach_at is 4 FAIL (rounds test)
skill drops the workflows glob FAIL (protected test)
normal row says Fable 5.2 FAIL (runner test)
skill drops "the gate counts it as a round" FAIL (rounds test)
gate stops counting a quick check as a round FAIL (rounds test)
gate adds an inline protected rule passes (minor above)

All mutations were reverted. My temp checkout was clean afterwards.

scuttletoby and others added 2 commits November 22, 2026 03:03
…ck never does

The gate passes a head only when every lens's newest read names it or a newer
override covers them (lens.Review.reviewed_head). A quick check is one lens on
the fix head while the earlier lenses still name the old head, so it alone
holds the head. SKILL.md step 7 now says which head passes and that on
`nit-only: yes` the orchestrator still posts the override; COMMENTS.md says the
same. The round count says "whichever is higher", as review_round does.

Tests: a history (code at A, code r2 at B, fix C with a quick check) through the
gate's real reviewed_head and judge_rounds, pinned to the skill's words; the
protected-paths test now compares is_protected's answer with the skill's list
on every tracked file and on probe paths, so an inline rule fails it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: A r3 · reviewer: lens agent (Opus 5.5 high) · read at: a8c263c
covered: git diff 6f0d8330 a8c263c7 -- fork-kit/review in full (SKILL.md, COMMENTS.md, tests/comments.test.py); the rest of the head is a merge of main. Against the gate: lens.py (Review.override_sha, lens_reads, reviewed_head), review_judge.py (is_protected, protected_paths, WORKFLOWS, review_round), config.py (override), lib/review_kit.py (reader, the plan's rounds line), REVIEW.md
checks: the kit's three test files through heavy: comments 36 OK, plan 27 OK, eval 28 OK. Seven mutations of the gate or the docs against comments.test.py, each reverted (results below). The checkout was clean afterwards.
state: docs and read-only tests, so no stored state. Runs again: the new tests hold no state; repo_paths reads git ls-files fresh each run and gives the same answer. Stops half-way: nothing is written. Old or empty state: with no git (a tarball), repo_paths returns nothing and the 21 probe paths still run, so the test still fails on a new gate rule. A broken review.recommended.json fails the tests through the gate's parser, it does not pass them.
blocker: none
major: none
minor: SKILL.md:98 and :106 against REVIEW.md:63 and the plan's line (review_kit.py:223). The fix removed "The rest the orchestrator checks itself ... then posts the override". Now the skill does not say what happens to a fix that is not nit-only once lens_rounds is used up. Details below.
minor: SKILL.md:89 says the override "counts only from the account with" override.author_association. That setting is an author association (a kind of account, such as OWNER or COLLABORATOR), not one account. The gate also needs the comment to be never edited and not hidden (lens.py override_sha). COMMENTS.md:63 says it correctly ("the configured author association"). Use the same words, and add "never edited, not hidden".

Result: SAFE TO MERGE (no blocker, no major, two wording minors for the follow-up issue). Every round-2 finding is fixed at its root.

Minor: a fix that is not nit-only, after the last lens round

Before this round, step 7 ended with "The rest the orchestrator checks itself from the fix diff and the lenses' proof tests, then posts the override". REVIEW.md:63 (lens_rounds: "lens rounds before the orchestrator checks fix diffs itself") and the plan ("after that the orchestrator checks each fix diff itself") still say that. The new text gives the orchestrator's own check only to a nit-only fix. On nit-only: no it says "the fix goes to the next round" (SKILL.md:98), and :106 says "No round past the limit". With the default lens_rounds 2, a quick check after round 2 is already gate round 3, so "the next round" goes past lens_rounds. One case shows the gap: minors: same-round, round 2 is clean except for a minor, and the fix touches code. The skill does not say who checks that fix. Fix: add one sentence after the nit-only bullet: "Once lens_rounds is used up, the orchestrator checks any later fix that has no blocker or major left in the same way, and posts the override. A blocker or major left is stuck (below)."

Round-2 findings: each fixed at its root

  1. The quick check does not replace the override. SKILL.md:87-101 has a new "Which head passes" bullet, which states the gate's rule from lens.Review.reviewed_head and lens_reads (every lens's newest read names the head, or a newer override covers it). The "Nit-only fix" bullet now says the override is always needed, and the quick check only adds a read and a round. "skip the quick check" is gone. COMMENTS.md:103-105 says the same about yes. The new test test_the_skill_says_what_passes_a_fix_head_after_a_quick_check (comments.test.py:427) runs my round-2 history through the gate's real lens.Review (review_kit.reader builds lens.Review; no copy). Quick check alone: no head. Quick check with the approach lens: no head. Either one with the override: head C. Override alone: head C at round 2. It also runs judge_rounds for the round count, and it pins the skill's and COMMENTS.md's words.
  2. Protected paths. comments.test.py:379-387 now compares is_protected's answer, not its source, with the skill's list (the exact paths plus WORKFLOWS). It does this on every tracked file, 21 probe paths and the exact paths. My round-2 mutation (or path.startswith('.github/actions/')) now fails.
  3. "Whichever is higher". SKILL.md:82-84 matches review_round (max, not a sum). test_the_skill_says_whichever_is_higher checks the gate's function on one change plus an r3 marker, which gives 3 (a count alone would give 1, a sum 4). It pins the words too.

The new tests read the gate's real code and fail when the docs drift

mutation result
gate: is_protected also takes .github/actions/ (inline prefix) FAIL (7)
gate: is_protected also takes *CODEOWNERS (inline suffix) FAIL (1)
gate: reviewed_head passes the newest-looking sha when the lenses disagree FAIL (2: quick check alone, quick check and approach lens)
gate: review_round adds the marker to the count FAIL (3)
SKILL.md drops "it does not replace the override" FAIL (1)
SKILL.md says "Or skip the quick check and use the override" FAIL (2)
COMMENTS.md drops "on yes it still posts the override" FAIL (1)

No new error: the new bullets match override_sha (one association, never edited, not hidden, apart from the wording minor), lens_reads (an override covers only the reads older than it) and head_check (an orchestrator's override never waives a required approach lens). Every COMMENTS.md example still reads as the doc says (the comments test feeds each one to the gate).

@scuttletoby
scuttletoby merged commit 500289b into main Nov 22, 2026
30 checks passed
scuttletoby added a commit that referenced this pull request Nov 28, 2026
…only check and a drift test (#845)

* fork-kit/review: one general review skill; tiers, failure table, nit-only check and a drift test

The kit's SKILL.md becomes the one general review skill, so a project keeps only its facts (review block, lens
prompts, kit settings) and a thin adapter. Merged in from the project skill: the tier table as the gate's weights,
the author's failure table, nit-only quick check, batch per area, twin lens names, focus lenses, covered rule, the
extra general lenses, and a concurrency part in the eval lens. Conflicts go to what the gate parses: the state answer
on a `state:` line and `blocker:`/`major:`/`minor:` lines.

New test (comments.test.py, SkillFormat): every report shape the skill, the eval lens and COMMENTS.md tell a lens to
write reads as a clean read with a state line through the gate's own parser; the skill's tiers match the gate's
weights and recommended min_lenses; the state question is word for word in the skill, the eval lens and REVIEW.md.

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

* fork-kit/review: skill matches the gate on rounds, protected paths and check exits

- A quick check is a lens read of a new head, so the gate counts it as a
  round; the skill names rounds.approach_at / approach_lens / max, how to run
  the approach lens, and that only an override by a listed override_authors
  login waives it.
- The tier table names the gate's always-critical paths (queue config, lens
  prompts, .github/workflows/**); the light row no longer says config is light.
- focus: removed (nothing reads it); twin lenses described in general terms.
- check exits 1 for a real blocker or major by design; never soften a finding.
- not a lens: also needs no read-at sha outside a quote (COMMENTS.md rule).
- Drift test reads the round keys and recommended approach_at through the
  gate's parser and judge_rounds, the protected paths from review_judge, and
  the runner defaults from review_kit.DEFAULTS.

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

* fork-kit/review: the override passes a nit-only fix head, a quick check never does

The gate passes a head only when every lens's newest read names it or a newer
override covers them (lens.Review.reviewed_head). A quick check is one lens on
the fix head while the earlier lenses still name the old head, so it alone
holds the head. SKILL.md step 7 now says which head passes and that on
`nit-only: yes` the orchestrator still posts the override; COMMENTS.md says the
same. The round count says "whichever is higher", as review_round does.

Tests: a history (code at A, code r2 at B, fix C with a quick check) through the
gate's real reviewed_head and judge_rounds, pinned to the skill's words; the
protected-paths test now compares is_protected's answer with the skill's list
on every tracked file and on probe paths, so an inline rule fails it.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby added a commit that referenced this pull request Nov 28, 2026
…only check and a drift test (#845)

* fork-kit/review: one general review skill; tiers, failure table, nit-only check and a drift test

The kit's SKILL.md becomes the one general review skill, so a project keeps only its facts (review block, lens
prompts, kit settings) and a thin adapter. Merged in from the project skill: the tier table as the gate's weights,
the author's failure table, nit-only quick check, batch per area, twin lens names, focus lenses, covered rule, the
extra general lenses, and a concurrency part in the eval lens. Conflicts go to what the gate parses: the state answer
on a `state:` line and `blocker:`/`major:`/`minor:` lines.

New test (comments.test.py, SkillFormat): every report shape the skill, the eval lens and COMMENTS.md tell a lens to
write reads as a clean read with a state line through the gate's own parser; the skill's tiers match the gate's
weights and recommended min_lenses; the state question is word for word in the skill, the eval lens and REVIEW.md.

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

* fork-kit/review: skill matches the gate on rounds, protected paths and check exits

- A quick check is a lens read of a new head, so the gate counts it as a
  round; the skill names rounds.approach_at / approach_lens / max, how to run
  the approach lens, and that only an override by a listed override_authors
  login waives it.
- The tier table names the gate's always-critical paths (queue config, lens
  prompts, .github/workflows/**); the light row no longer says config is light.
- focus: removed (nothing reads it); twin lenses described in general terms.
- check exits 1 for a real blocker or major by design; never soften a finding.
- not a lens: also needs no read-at sha outside a quote (COMMENTS.md rule).
- Drift test reads the round keys and recommended approach_at through the
  gate's parser and judge_rounds, the protected paths from review_judge, and
  the runner defaults from review_kit.DEFAULTS.

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

* fork-kit/review: the override passes a nit-only fix head, a quick check never does

The gate passes a head only when every lens's newest read names it or a newer
override covers them (lens.Review.reviewed_head). A quick check is one lens on
the fix head while the earlier lenses still name the old head, so it alone
holds the head. SKILL.md step 7 now says which head passes and that on
`nit-only: yes` the orchestrator still posts the override; COMMENTS.md says the
same. The round count says "whichever is higher", as review_round does.

Tests: a history (code at A, code r2 at B, fix C with a quick check) through the
gate's real reviewed_head and judge_rounds, pinned to the skill's words; the
protected-paths test now compares is_protected's answer with the skill's list
on every tracked file and on probe paths, so an inline rule fails it.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby added a commit that referenced this pull request Nov 29, 2026
… ids, pruning, alarm text) (#1238)

* heavy: minors from the #764 reviews (#767) (#770)

- As root, a HOME others can write to (/tmp) or / is not used for the
  state folder; ~/.local must be a real folder of this user's before
  heavy makes ~/.local/state under it (a planted link is never followed).
- The timeout check covers iter(pipe.readline), enumerate/map/zip/
  filter/join over a pipe, `import subprocess as sp`, getoutput,
  os.waitpid/wait4 without WNOHANG and a bound wait/communicate passed
  on; its claim is narrowed to the listed forms. The two os.waitpid
  uses in the tests now go through a timed wait_pid.
- Note cleanup checks labelled/, heavy/ and the base, like heavy's own
  folder rule.
- With nothing sent by hand, a 1 s look instead of none, so processes
  that end anyway are not named as still running.
- README: how to give back a root-owned ~/.local/state.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the changed model policy line for a settings file that fails to load (#768) (#773)

Part of #768, item 1, step 1 of "Adding a seam line" (the list only).
The settings.json-does-not-parse warning goes through Effect.runSync,
the default runtime, so it can miss the server's log. The fix makes
afterLoadFailure return an Effect, which changes the existing seam line
in serverSettings.ts's load fallback to
modelPolicy: yield* ForkPolicy.afterLoadFailure(...). Announced here so
the code change may replace the old line (same line count).

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-ci: update head_check.test.py's weight to ~69s (#776)

#740 grew head_check.test.py without updating its weight (~28s). It now
takes ~45 s on a usual runner and 133 s (~69s at that runner's speed) on
a slow one, where the weight check fails the action job. Set the weight
the check asks for.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the handoff web lines (HO5) (#774)

Announce the upstream web lines the HO5 code PR adds: Hand off now in the
thread menu (logic, its hook, the sidebar's own menu), the waiting handoff
in the composer banners, and the handoff divider on the fresh-session row.
List only; the code lives in apps/web/src/components/fork/handoff/.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Model policy: flag alias rows in Settings, read the sender's catalog reasoning ids on the linked route (#768) (#772)

- Settings flags a policy row whose model is an alias in its driver's
  model lists, as it flags a driver no provider has. The alias lookup
  moves to contracts (modelPolicyAliasTargets) so the server and Settings
  share it.
- A pick sent to a linked machine (delegate_task, a forwarded
  t3_thread_launch/t3_thread_configure) also reads the reasoning control
  this machine's catalog marks for the model, so an ACP model's own id
  counts; a model this machine does not have reads the fixed ids only.
- delegateOwnOptions "claimed ..." names rows that match the claimed
  drivers, so it goes red if pickOfRemote reads driverKind again.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Model policy: log the unparseable-settings warning through the server's logger (#768) (#777)

* fork seams: announce the changed model policy line for a settings file that fails to load (#768)

Part of #768, item 1, step 1 of "Adding a seam line" (the list only).
The settings.json-does-not-parse warning goes through Effect.runSync,
the default runtime, so it can miss the server's log. The fix makes
afterLoadFailure return an Effect, which changes the existing seam line
in serverSettings.ts's load fallback to
modelPolicy: yield* ForkPolicy.afterLoadFailure(...). Announced here so
the code change may replace the old line (same line count).

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

* Model policy: log the settings-file-does-not-parse warning through the server's logger (#768)

Part of #768, item 1, step 2 (after the announce PR merges).
fork/modelPolicyFile.ts logged with Effect.runSync, the default runtime,
so the warning could miss the server's log. afterLoadFailure now returns
an Effect and logs through the load's own logger; the seam line in
serverSettings.ts becomes `modelPolicy: yield* ForkPolicy.afterLoadFailure(...)`
(same line count), moved from announced to added in fork-seams.json.

Test: serverSettings.forkDefaults "the model policy warning for ... reaches
the server's logger", with a file cut off half-way, an empty file (warned
once, also on a second read), a wrong-typed value and an empty object
(not warned).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: record the OrchestratorMcpService.ts line #660 changed (fork-follow refuses the series) (#795)

#660 changed upstream's remote delegate_task target line to go through
delegateChecks.remoteTarget and lowered the file's pending ceiling to 34,
but the series against upstream has 35 fork lines and 5 lost lines (limit
4). The pull request check let it through; fork-follow's check from the
upstream tag refuses it, so the fork cannot follow upstream (#792).
This records what main already has; no code change.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: exclude upstream's new .repos/effect forkRegistration.ts from fork files

Upstream v0.1.12-nightly.20261121.5051 vendors Effect's test helper
.repos/effect/packages/effect/test/utils/forkRegistration.ts. Its name reads
as a fork file, so a pull request's run would take it for the fork's own.
Exclude it with a "!" entry, as the seam check asks. No ceiling changes.

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

* Handoff: the command source writes part 2 (HO3) (#775)

* Handoff: the `command` source writes part 2 (HO3)

With `source: command`, the handoff service runs the program from the
person's handoff settings in the project folder, on the runner wait checks
use (now `makeSettingsProgramRunner` in waits/WaitJudges.ts, shared): no
shell, a 60 s timeout, a 32 KB cap, the thread and project ids in its
environment. Its trimmed output is part 2 of the handoff message.

A non-zero exit, a timeout (partial output unused), empty output, output
over the cap, a program that cannot start or a project that cannot be read
is a failure: at the idle trigger the handoff is skipped; at the size
backstop it hands off with parts 1, 3 and 4 and says the command failed.

It runs after the settle, right before the send; a handoff waiting for a
slot keeps its output. Off by default; the agent source is unchanged.

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

* Handoff command: a missing program reads "could not start" on Linux too

Under `timeout` (Linux) a missing program is exit 127, not a spawn
error, so the reason read "exit code 127". Exit 126/127 now read "its
program could not start (exit code N)" on every platform.

Also from the review of #775:
- stdin is closed (an empty input), so a program that reads it ends
  instead of waiting 60 s. Optional in the shared runner; wait checks
  run as before.
- Part 2 sits between begin and end lines, so the command's output
  cannot pass as another part.
- A test that the command runs once while the handoff waits for a slot.
- Docs: the server's environment is passed, stderr counts toward the
  cap, a cached failure is kept during a slot wait, point the command
  outside the repository.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* pc-agents tests: fake processes get PIDs no real process can have (#783)

update.test.py's fake work process had PID 4002, while T3's main PID in the
fake distro is a real one: the fake systemctl's own ($$). The kit skips T3's
main PID as T3 itself, so when the kernel gave that systemctl PID 4002 (on a
fresh CI machine, where PIDs are still near 4000 when this file's first test
runs), the work read as T3, nothing was busy, and the cut rollback finished
instead of waiting for a quiet point. Not a timing race, and not the kit: real
PIDs are unique.

The fake processes now take PIDs above Linux's PID_MAX_LIMIT (2^22), and
process() refuses any lower PID, so a test cannot bring the collision back.

Fixes #766

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the t3_environment_read facts lines (placement P3, step 1) (#779)

List only (step 1 of "Adding a seam line"). Placement design row P3 (facts out)
makes t3_environment_read return this machine's facts beside upstream's fields:
hostResources (the result field of upstream PR #34293) and the fork's placement
(labels, available and reason, running agents, slots free, memory floor, facts
time). The logic lives in the fork file apps/server/src/fork/environmentFacts.ts;
each of upstream's two environment toolkit files takes its import and one line.

- environment/handlers.ts: the read spreads EnvironmentFacts.read into its result.
- environment/tools.ts: the success schema takes EnvironmentFacts.ResultFields
  (both optional, so an older linked machine that leaves them out still decodes).

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Fork seams: list slotObserve as a fork file (dynamic slots D4, step 1) (#788)

packages/shared/src/slotObserve.ts and its test came with the slot gate's
observe mode; upstream does not have them, but the name does not mark them as
fork files, so a pull request's seam check takes them for upstream files.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(secret-sweep): a reset run's re-run goes on from its own record; gates held by behaviour (#703) (#782)

Follow-ups to the sweep record after #720 (its lens B minors 1-5):
- A re-run of a reset_record run reads its own first attempt's record
  (written after the reset) and no older run's; without one, the empty
  record; a failed read of it keeps nothing, so attempt 1's stays.
- A re-run reads its own run only in a run of fork-secret-sweep.yml
  (GITHUB_WORKFLOW_REF), not in another workflow's run.
- Tests: a failed read, then a failed runs lookup or the time limit,
  keeps no partial record (each gate alone now goes red when removed);
  a contract ties the 20-minute lookup limit to the job's time-out.
- fork-secret-sweep.yml: a sweep that runs during a reset run undoes it.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-kit/review: general review skill, adoption guide, gate comment format and eval harness (#790)

A new kit folder with the general review rules a project adopts instead of keeping its own copy:
- SKILL.md: lenses picked by changed path from the repo's `review` config (the gate's own judge), the state
  question every time, two independent lenses for critical paths and one for normal, at most two lens rounds
  and then the orchestrator checks the fix diff, minors into one follow-up issue, root-cause fixes, attacks
  that leave failing tests.
- REVIEW.md: how a project adopts it (review block in shadow first, lens prompt files, the gate, kit settings).
- COMMENTS.md: the lens comment format, every example stated with how the gate reads it; a test feeds each
  example through the gate's real parser, so the doc cannot drift.
- lib/review_kit.py: `plan` (weight, lenses, runners, rounds from the gate's rules and the kit settings),
  `check` (how the gate reads a comment, plus a state line), `doc` (the doc check).
- lib/review_eval.py and eval/: the model and effort eval, every project fact from one config file.

Runners are kit settings with defaults (.github/review-kit.json), not rules text. No change to fork-ci.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* placement P5: pure rule engine, hard rules H1 to H9 and upstream's rank (#787)

* placement P5: pure rule engine, hard rules H1 to H9 and upstream's rank

A pure function in packages/shared that picks the machine a delegated
task runs on: the nine hard rules of the placement design, each with a
plain reason, then upstream's load-balancing score for the order. No I/O,
no server wiring, no setting: P2, P3 and P6 map into its plain types.

Upstream's score stays in packages/client-runtime/src/load-balancing.ts,
unchanged. Moving it would change upstream lines (and grow the pending
packages/shared/package.json), so the engine calls it instead.

Table tests for every rule (pass and fail with its reason) and for every
row of design section 7 that needs no I/O.

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

* placement P5: fix round from the #787 reviews

- A named machine without facts now meets every rule that needs no facts:
  H1, H3, H7 (the pick-time lookup, not a fact; a lookup that did not run
  fails) and H9 (a placed child no longer places onward through it).
- Facts fail closed on NaN, infinite or negative numbers: cores, total and
  free memory, receipt time (counts as too old), free slots, memory floor,
  free memory, CPU use, and the link's expiry time. Each has a plain reason.
- H3 passes only known modes, so an unknown access value or an unresolved
  task mode is refused.
- Labels, needs and never groups are compared trimmed and lower-cased,
  blanks and repeats dropped (canonicalLabels, for P2 to store the same
  way). A blank need is never met; a blank group member is dropped.
- At the memory floor is available, as the slot gate and P3. A floor of 0
  keeps nothing back.
- Duplicate machine ids give a plain refusal.
- The unranked reason names a weight word this build does not know, and
  says "free memory 5 % or less" only when that is the cause.
- Comments match P3's slot answer; the module header repeats the P6
  follow-up.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Review rules: T3 side of findings, scans and rounds on shared vectors (#781)

* Review rules: T3 side of findings, scans and rounds on shared vectors

A pure TypeScript copy of the CI gate's review rules (path plan, lens
comment headers and scan, findings, rounds) under
apps/server/src/fork/reviewRules, so T3 tools and the gate agree. Both
sides replay review.vectors.json, which gains findings, scans and rounds
sections; each side fails on a section or field it does not run. The
Python findings tables move into the vectors file (one source).

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

* Review rules: port lens_problem, linear-time table rows, fork-owned vectors

- fork-owned-paths: the shared review vectors and the lens corpus are not
  fork-owned, so a change to the gate and its vectors runs the server's
  review-rules test (its Lint check reads them).
- lensComment.ts ports lens_problem: a report whose first line is a valid
  header but which holds a second lens header (quoted, fenced, plain or
  loose) reads nothing, exactly as the gate judges it. 18 new shared scan
  vectors, generated from the gate's answers.
- Gate and TS copy: a table row is plain-folded once per row and the
  "first non-empty cell after j" is one backward pass, so a wide row reads
  in linear time (was quadratic in cells). Same answers; timing tests on
  both sides.
- Gate: a number reference past int's 4,300-digit limit no longer raises
  in html.unescape; it reads as its value (or U+FFFD past Unicode), as the
  TS copy already did. Two shared vectors.
- README: how a vector is made.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-ci: review rules guide "release, pin, then config" and gate caller notes (#778)

* fork-ci: review rules guide "release, pin, then config" and gate caller notes

The pr-queue README gets one section on turning the review rules on: the
release, the pin in every caller, the config in shadow, reading the shadow
rows, enforce, roll back, and what each half-way state does. The gate caller
example names the pull_request_target policy and when the required-lenses
input may be emptied. The release notes list #740 (findings, rounds,
override_authors) for the first release after ci/v20.

review_guide.test.py ties the guide to the code: links resolve, the steps
keep their order, the release names match the tags, the quoted summary rows
are what head_check writes, and the half-way states behave as described.

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

* fork-ci: review rules guide: owner step, the empty input's floor, and tests tied to the guide

Fix round for the two reviews of this pull request:
- the two states only an owner gets out of (input emptied under shadow, a ci/v14
  gate meeting the block) now say so, with the owner step: revert by hand, then
  dispatch the backfill; a gate on ci/v15+ refuses the block pull request itself
- emptying required-lenses drops the one-lens floor: said in step 5 and the
  example caller, with a rule that keeps AGENTS.md/CLAUDE.md at one lens
- the enforce pull request does not need the critical lenses yet; the pin back
  is a review rule; arm nothing between enforce and the backfill
- the pin step names actions/pinned pin configs; step 4 lists unreadable lens
  comments and the findings row's approach and findings: false parts
- tests: releases checked against the ci/vN tags where the clone has them, each
  half-way test reads the guide's words, the never-failing same-inputs test is
  gone, merged-config refusal tested on a throwaway repository

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

* review guide test: declare the two tag-only ReleaseTags tests as may-skip

CI checks out without the ci/vN tags, so these two skip there; fork-ci now
requires every skip to be declared.

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

* fork contracts: pin review_guide's two tag-only ReleaseTags skips (MAY_SKIP)

The review guide test declares two `may skip` lines (ReleaseTags needs the
ci/vN tags, which CI's checkout does not fetch), but the pinned table was not
changed with them, so the record check found a skip set it did not pin.
The LauncherAsRoot entries were already equal on both sides.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Model policy: an effort must be under the id the row's driver reads, on both sides of a link (#780) (#793)

* Model policy: an effort must be under the id the row's driver reads, on both sides of a link (#780)

A pick whose effort sat only under an id the running driver does not read
(an ACP `thought_level` for a Claude row, `reasoning` for Claude, `effort`
for an ACP agent) counted as naming an effort, so the driver ran its own
default level unchecked. Each row with efforts now needs the effort under
its driver's own id: the fixed id of a built-in driver, else the control
the checking machine's own catalog marks for the model on that driver's
instances. A driver whose id is not known there refuses (fail closed).
The receiving machine checks a linked agent's pick with its own catalog;
the sending machine checks every row's driver with its catalog.

Minors: a remote pick reads a catalog's ultracode default both ways and
gets the full-id alias hint; Settings reads each machine's lists apart,
flags names Claude Code resolves by itself, and reads an instance's
catalog effort control for its marks; tests for "an id is never an
alias"; a stale test comment.

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

* Model policy: refuse an option the policy cannot read, keep the guard's driver ids in step (#793 review)

- While a policy is on, a pick may name only options this machine's model list
  describes for the model (the instance's list; any list here for a call sent to
  a linked machine), effort ids the policy reads, or ultracode. A driver can still
  apply any other option after the checked ones: Kiro's effortLevel, Grok's native
  thought_level, an ACP agent's hidden _t3/session-mode, or a model option written
  after the model. Enforce refuses it with the fix; advise reports it.
- The "effort id not known here" refusal now says how to fix it (and drops the
  "a acpRegistry" typo).
- The model guard's sync test compares the server's driver effort ids with the
  guard's DRIVER_EFFORT_IDS entry for entry, both ways.
- Docs: the "a second effort option cannot hide a higher effort" sentence is now
  true, and says how.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the Codex MCP profile lines (MCP profiles part 5, step 1) (#801)

Announces the two lines in CodexAdapterV2.ts that wrap its app-server
client factory with apps/server/src/fork/codexMcpProfile.ts. No code.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the tool_search filter lines (MCP profile design PR 4, step 1) (#806)

Step 1 of "Adding a seam line" in docs/fork/updates.md: the list only,
no code. A new entry for apps/server/src/mcp/McpToolExposure.ts with
"added": [] and two announced lines: the import of searchableT3Tool from
fork/mcpT3ToolFilter.ts, and one .filter(searchableT3Tool) step in
tool_search's ranking chain. The code follows on its own branch.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the unsigned macOS ad-hoc signing line (#822, step 1) (#832)

List only. Announces the one scripts/build-desktop-artifact.ts line that sets identity "-" and the
sign hook scripts/fork-codesign.cjs for macOS builds without signing secrets; the pull request
that closes #822 adds it.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(server): a child that already exited keeps its exit code when its stdin write breaks (#840)

The process runner writes a program's stdin while the program starts. A program that exits at
once (the handoff's missing program under `timeout` exits 127) can close the pipe before that
write, which then fails with EPIPE. The runner reported that as a stdin error ("its output could
not be read") and dropped the exit code, so the handoff test failed in a few CI runs of a hundred.

A broken pipe on stdin is now ignored: the exit code and output say how the program ended. Any
other stdin error is still an error. The check lives in fork/processRunnerFork.ts, with the fork's
output-tail collector moved there too, so processRunner.ts's pending ceiling drops from 35 to 8.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* placement P2: placement and placementNeeds setting contracts (#798)

* fork placement P2: placement and placementNeeds setting contracts

`placement` (mode off/advise/enforce, labels, factsCommand, never groups,
weights per linked machine) and `placementNeeds` (server value, and a
project override), added the way the fork's other settings are: fields,
patch fields, patch rules and pin rows in forkSettings.ts/forkDefaults.ts.

- An old or empty settings file reads as off with no needs.
- A bad placement value reads as off with the reason in `problem`; the
  person's text is kept in `unreadable` and written back until the key
  is saved (as modelPolicy). The rest of the file still loads.
- A save is strict (bad field or unknown key refused); a field left out
  keeps its value; a save over a kept unreadable value starts from off.
- Both keys are person-only (derived); a project's needs are kept when an
  older client's save leaves them out, and only null clears them.
- A managed policy locks placement as a whole value.

Contracts only: nothing reads the settings yet.

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

* fork placement P2: fail closed on bad placementNeeds, whole saves over bad placement

- A bad placementNeeds (server or project) now reads as broken: the work fits
  no machine (readPlacementNeeds gives the plain reason), the problem is kept,
  and the person's text is written back unchanged by other saves until the
  key is saved. A project save may send the kept text back only unchanged.
- Over an unreadable placement, a save that names only some fields is
  refused ("placement is not valid; save the whole setting"); a whole save
  replaces it.
- factsCommand must be a full path on the server's OS (playtest's check):
  a save of another OS's path is refused, and one in the file reads as off,
  kept, with its problem. Control characters are refused.
- Labels are stored trimmed, lower-cased and without repeats (so
  ["GPU", "gpu"] is no never group); weight keys with spaces are refused.
- Tests for each, a policy lock row for placementNeeds, and the docs.

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

* fork placement P2: read factsCommand on this OS where placing reads it

The load and normalize lines added to upstream's serverSettings.ts are
gone (no pinned seam line runs after a save's normalize, so the same
result could not go through one). Placement code now reads placement
through apps/server/src/fork/placementRead.ts (readPlacementForThisOs):
a factsCommand this OS cannot run reads as off, kept as written, with
its problem. The save check that refuses setting one stays.

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

* fork placement P2: manage placement and placementNeeds only as a whole

Main now names the fork settings that read null in one list (WHOLE_ONLY), and
the pin test requires it to match exactly. Both placement settings read a bad
value, null included, as off/unset, so both join the list: a policy locks
placement as a whole, a path inside it is refused, and the manageable-settings
list shows placement as one path instead of its fields.

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

* fork placement P2: type the server's placementNeeds patch as the settings hold it

The web settings code builds a save from part of the settings, so a held
placementNeeds value (a kept bad value included) must fit the patch type.
The patch field was typed as plain labels, which broke the web typecheck.
PlacementNeedsPatch is now typed as PlacementNeeds while its decode stays
strict: only labels are taken, and a save replaces a kept bad value whole.

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

* fork test: read the MCP profile record at once in the scheduled-task tests

A webhook run is forked and reads the record file, and these tests give
forked work a fixed number of event-loop turns. On a loaded machine a read
on Node's thread pool can outlast them ("never: the owner's task ran"), on
main as well as on branches. The service in these tests now reads whole
files synchronously, so a run takes the same number of turns on any machine.
With the thread pool kept busy the test failed before and passes now.

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

* fork placement P2: check only placementNeeds in the patch-type test

Since the merge of main, a whole Partial<ServerSettings> no longer fits a
patch (another field is nullable in settings only). The test checks the
placementNeeds field it is about.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(playtest): the playtest MCP tool (start, push, status, end) (#809)

* feat(playtest): add the playtest MCP tool (start, push, status, end)

One tool in the waits toolkit over the playtest service. The thread is the
caller's own, from its MCP credential; the tool takes no thread and no
setting. Refusals (playtest off, busy, no session) come from the service
with what to do next. Docs: playtest.md gains the tool section.

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

* docs(fork): list the playtest tool in FORK_CHANGES (#809)

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

* fix(playtest): own tool group; start and push need a full-access thread (#809)

- `playtest` is its own MCP tool group (MCP_T3_TOOL_GROUPS gains "playtest";
  MCP_T3_TOOL_OWN_GROUPS pins the tool in the waits toolkit to it), so a
  profile that keeps `waits` does not get it. Test: every T3 tool is in
  exactly one known group, and playtest alone in its own.
- `start` and `push` refuse a thread that is not full-access or is in plan
  mode, by the thread's modes as the server records them at each call.
  `status` and `end` stay open, so a restricted thread can release its target.
- Status tells the agent to call end for a claim cut off by a stop and for a
  release that has not worked yet.
- The waits tools share one calling-thread helper.
- `start` joins the unknown thread-argument test.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork: report a linked child's pending prompts to its parent (#808 row 1) (#815)

* fork: report a linked child's pending prompts to its parent (#808 row 1)

A delegated task on a linked machine always reported
hasPendingQuestion false and pendingApproval null, so its parent never
learned the child was waiting.

- New fork route GET /api/fork/task-prompts on each machine: the open
  questions, approval and secret requests (label and reason only, never
  a value) of one of its threads. Link token only.
- task_status, delegate_task and their waits read it over the existing
  link through the fork seat remotePrompts (one spread line in the
  remote read). An unreachable or older machine reads as unknown in
  next, never as "not waiting".
- A watcher wakes the parent once per prompt, the way a local child's
  question does: it ends a blocking wait if there is one, else it queues
  one wake message, and cancels that message if the prompt is answered
  there first. Wake ids are fixed, so a restart sends no second wake.
- OrchestratorMcpService.ts is a pending file and may not gain a fork
  line: the Effect.scoped comment moves onto the (already fork) line it
  explains, which frees the line the seat takes. Still 35 fork lines.

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

* FORK_CHANGES: link #815

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

* fork: quote a remote child's words; a wait has a prompt only while its run lasts (#815 fix round)

- Text and ids from the linked machine: ids only on a strict pattern (else
  unknown, "refused"), at most 50 prompts, a secret's label and reason
  folded to one line, capped (80/300) and quoted as the child's words.
- A secret never goes to a blocking wait; it is always a queued message.
  A question or approval handed to a wait counts only while the parent's
  run lasts; after it, one message if it is still open there.
- The receipt of a sent wake is read before a slot is taken; a machine
  that does not answer is asked once per round; "older" also names a link
  no longer accepted.
- The remote read's spread line carries its // Fork: marker (no new line).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* host tools: per-OS path layer (real-path resolve, Windows and macOS oddities) (#816)

* host tools: per-OS path layer (real-path resolve, Windows and macOS oddities)

resolveHostPath(input, {platform, fs}) follows every link, junction and
mount point to the real target and returns that path plus the compare key
the policy core will match reach kinds and secret patterns against, or a
plain refusal. Platform and file-system calls are injected, so the Windows,
macOS and Linux cases all run on any CI machine; nodeHostPathFs is the thin
real adapter. Nothing is wired yet.

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

* host tools path layer: fix round for both lenses

- Map macOS firmlinks on the walked path and on the OS answer; full list.
- Refuse /.vol, /dev, Linux /proc, /sys, the document portal, and devices,
  pipes and sockets.
- Add secretKey, always folded (full case map, NFKC, ignorables dropped);
  compareKey stays exact per OS.
- Cross-check the walk with the native realpath and refuse a different answer.
- Win32 collapses typed ".." first; cap the walk at 4096 steps.
- Header states the contract for 1.2 and 1.4.
- Tests: an independent fake file system, a regex case-fold oracle, state
  cases, real-adapter checks, and Windows/macOS tests skipped elsewhere.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(cleaner): one clock for report test stamps, so a mark's line stays the same (#819)

The report's mark names the last counted log line by its exact text. Three
Freed tests wrote the log twice and rebuilt an already-counted line with a
fresh stamp; when the clock crossed a second between the two, that line no
longer matched the mark, the report treated the log as trimmed and counted
the old delete again ("at least 5.0 GB (2 deletes)").

The real log is append-only, so the report code is right; the tests now
build each line once and reuse it, and stamp() reads one clock for the run.
Forcing a second boundary (time.time() moving one second per call) fails
the three old tests every time and passes the new file.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers (#786)

* heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers

Dynamic slots design row D6. The kit gets a Python evaluator of the shared
capacity rule (lib/capacity_rule.py) that passes every vector and format case
the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1
object with per-kind "fits" from a ledger read from the kernel (heavy's live
tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic
tier, unreadable signals as elevated, and per-folder reservations.
bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older
output and exit codes; a facts call that is slow (5 s) or fails is never free.

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

* heavy facts: every ticket is a job, folders match exactly, basic tier and other users fail closed

Fix round for the two D6 reviews.

- A heavy ticket whose kind the rule does not know (tsc, gradle, a project's
  own) is the rule's unknownKinds.job, never an agent; heavy facts --kind
  with an unknown name asks for that job too.
- A reservation folder matches itself and what is below it, with or without
  a trailing '/', never a sibling sharing its first letters; its real path
  matches too. The caller's own folder is its real working folder only.
- Basic tier (no cgroup v2 or no user manager) is never free and fits 0.
  Full tier also counts every other user's heavy jobs and agent scopes
  from their user managers' cgroups; a folder that cannot be listed is
  basic. Without a cache folder every call starts "elevated".
- lib/capacity_readings.py: the shared reader's port. It runs every
  capacity-readings.json case and the "a failed reading never admits more"
  check; memory, PSI, cores and container limits now come from it, a box
  with a live piece but no folder is unreadable, a cut-short memory.stat
  owes in full.
- The cache has version 2 and a key of its settings; t3-capacity takes the
  rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript.

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

* heavy facts: kit tests check out the capacity rule; its JSON names no kit path

The heavy kit's evaluator, its tests and heavy-install read the capacity rule
from its one source, packages/shared/src/capacity, but the sparse checkouts of
the workflows, action_tests and kit_tests jobs left that folder out, so
install.test.py and facts.test.py found no capacity-rule.json. The folder is
now in the three lists (and in the `workflows` comment that says why each app
file is there).

The "//" notes of capacity-rule.json and capacity-readings.json named the
kit's Python files, which the fork-owned-reads lint counts as app code reading
a fork-owned path; they now point to README.md beside them, which names them.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the thread menu's MCP profile lines (MCP profile design PR 3, step 1); also restores the HO5 announcement lost in #777 (#807)

* fork seams: announce the thread menu's MCP profile lines (MCP profile design PR 3, step 1)

List only. The thread menu gets the MCP profile entry: the thread's
effective profile, and the owner's pick or clear for a client that may
change settings. Its logic and runtime are fork files
(apps/web/src/components/fork/mcpProfile/); upstream's menu files need
four lines in threadActionMenu.logic.ts and three each in
useThreadActionMenu.ts and Sidebar.tsx, announced here. The code is on a
branch pushed without a pull request until this merges.

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

* Fork seams: also restore the HO5 announcement lost in #777

The squash merge of #777 dropped every HO5 announced line from
.github/fork-seams.json. Restore them exactly as they were, inside the
same per-file entries as this PR's MCP profile lines (one key per file).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* handoff HO4: source `agent` (write turn, marker, cap, joined check) (#824)

* handoff HO4: source `agent` (write turn, marker, cap, joined check)

The old session gets one normal turn on its own thread with the
setting's instructions; its reply is part 2 of the handoff when the
turn completed, no other message joined it, the reply starts with the
marker line and is within the command source's 32 KB cap. A reply that
does not count falls back like the command source (size: parts 1, 3, 4;
idle: nothing). A stopped, failed, joined or timed-out write turn means
no handoff: the old session carries on. Fixed ids per source run, so a
run never writes or hands off twice; the write run is no turn end and
stays out of the transcript. Default stays off; no migration.

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

* handoff HO4 fix round: write turn never lost, stopped at its timeout, quiet

- A late update of the source run, or a restart, no longer drops part 2:
  any loop that finds a write turn as the latest run carries it on to its
  handoff (fixed ids, so at most once).
- A message steered into a write turn stays in later handoffs' part 3; only
  the write turn's prompt and marked reply are left out.
- A failed or timed-out write turn at the size backstop sends parts 1, 3
  and 4 (idle: nothing), as the command source does.
- Notes lines that could pass for the message's own lines are quoted.
- T3 stops a write turn at its timeout (run.interrupt, its own reason);
  after one such stop the next size handoff uses the fallback at once.
- A completed write turn is marked quiet, as the handoff run is.
- New source `none` is the default, so a saved handoff setting keeps its
  old behaviour; `agent` only when set.
- The last reply that starts with the marker is used.

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

* handoff command test: "could not start" without the stdin race

A missing program under `timeout` can exit before the empty stdin is
written, so the reason sometimes read as an output error. The case now
uses a spawn that fails (its project folder is gone); exit codes 126 and
127 stay covered.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-kit/gh-apps: call forms and GH_REPO check of the older per-user gh-as (#835)

* fork-kit/gh-apps: call forms and GH_REPO check of the older per-user gh-as

gh-as now also takes `gh-as NAME -- gh ...`, `--repo=`/`--app=` and `--help`, and refuses a GH_REPO in the
caller's environment that names another repository instead of silently ignoring it. New parity.test.py covers
these and the state cases: an expired, half-written or empty token cache, a killed run's temp file, config
missing or empty, two gh-mint runs at once (one mint), cache modes, and no token in any message.

Fork audit #834, item G1.

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

* fork-kit/gh-apps: lens nits for the gh-as parity PR

- wrapper: a refused GH_REPO is masked before it is cut, so no start of a
  token is ever quoted; GH_HOST other than github.com is refused too
  (README says which variables are checked and which are only dropped).
- admin add-key: refuses the app name "gh" (gh-as gh -- gh ... reads it as
  the gh command, so it could not be picked by name).
- privileged gh-as: a repeated --app or --repo is a usage error, as in the
  wrapper, not last-wins.
- README: the new key is piped straight into root, never stored where an
  agent can read it.

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

* fork-kit/gh-apps: root test expects the wrapper to refuse a foreign GH_HOST

The wrapper now refuses GH_HOST other than github.com, so the environment
test checks that refusal, sends the rest of the attack environment through
the wrapper, and still sends all of it (GH_HOST too) to a direct sudo call.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork release: SHA256SUMS covers the desktop files; unsigned macOS apps are ad-hoc signed last (#822) (#833)

* fork release: SHA256SUMS covers the desktop files; unsigned macOS apps are ad-hoc signed last (#822)

SHA256SUMS now lists every file a person downloads: the server archives and the desktop apps
(macOS dmg and zip, Windows exe, Linux AppImage), written in assemble after all desktop builds.

Without signing secrets electron-builder found no identity and signed nothing, so the macOS app
kept only the linker signature of Electron's executable and `codesign --verify --deep --strict`
failed on it. Unsigned macOS builds now set identity "-" with the sign hook
scripts/fork-codesign.cjs, which runs `codesign --force --deep --sign -` as electron-builder's last
change to the bundle, before the zip and dmg. A new verify_mac_signature job, which assemble waits
for, unpacks each shipped zip and dmg and runs `codesign --verify --deep --strict`.

The one line in scripts/build-desktop-artifact.ts is recorded in .github/fork-seams.json.

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

* fork release: review fixes for the desktop SHA256SUMS and ad hoc signing (#822)

- SHA256SUMS: `sha256sum --` (bare names kept) and compgen presence checks,
  so actionlint passes; a step before the upload checks every file the
  publish job uploads (less blockmaps and manifests) has a matching line.
- verify_mac_signature: no token, each dmg detached on any exit, the
  signature's Identifier/Signature/Authority in the step summary, and the
  hashes of the four checked files as an output; assemble fails when the
  macOS lines of SHA256SUMS differ from them.
- fork-codesign.cjs refuses any identity but "-" and says why entitlements
  and hardened runtime are ignored; scripts/fork-codesign.test.ts tests the
  hook and createBuildConfig's signed and unsigned macOS config.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* docs/fork/agent-rules.md + fork-ci doc-check: general agent rules, once (#874)

* docs/fork/agent-rules.md + fork-ci doc-check: general agent rules, once

docs/fork/agent-rules.md holds the agent rules that hold in every project
and on every machine, each once with a one-line why. Machine and project
facts stay in their own instruction files and config; review rules link
to the review skill instead of being copied.

fork-ci/actions/doc-check is a general port of a project's doc check:
size budgets and a no-history rule for instruction files, broken relative
links in changed Markdown, and no dated report files added. Budgets and
patterns come from an optional project config read at the base commit,
with defaults; a missing or empty config means the defaults, a broken one
exits 2.

Part of #834

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

* git-clean test: doc-check is an action that runs the git check first

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork seams: announce the settled provider thread lines (#846, step 1) (#907)

List only (step 1 of "Adding a seam line"). Fixes the race behind the
flaky Kiro turn_interrupt replay test (#846): at a turn's end the ACP and
Cursor adapters cache the provider thread as active, and usage or shell
updates that arrive after the turn re-send that snapshot session-scoped,
which the server writes without a run guard. When that write lands after
the run's final idle write, the ended thread stays active.

The fix adds one override line (and a comment) after upstream's status
line in each adapter, so the cached snapshot is idle like the server's
final write, and one check in each adapter's existing test. No upstream
line changes, so no lost-line count is needed.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(acp,cursor): a turn's cached provider thread is settled, so late updates cannot mark it busy (#909)

* fork seams: announce the settled provider thread lines (#846, step 1)

List only (step 1 of "Adding a seam line"). Fixes the race behind the
flaky Kiro turn_interrupt replay test (#846): at a turn's end the ACP and
Cursor adapters cache the provider thread as active, and usage or shell
updates that arrive after the turn re-send that snapshot session-scoped,
which the server writes without a run guard. When that write lands after
the run's final idle write, the ended thread stays active.

The fix adds one override line (and a comment) after upstream's status
line in each adapter, so the cached snapshot is idle like the server's
final write, and one check in each adapter's existing test. No upstream
line changes, so no lost-line count is needed.

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

* fix(acp,cursor): a turn's cached provider thread is settled, so late updates cannot mark it busy

Fixes #846. At a turn's end the ACP adapter (Kiro, Kimi, Grok, fx and the
ACP registry agents) and the Cursor adapter cache the provider thread as
active. Usage or session info that Kiro sends after the cancelled prompt
(and Cursor's background-shell updates) re-send that cached snapshot as a
session-scoped update, which the server writes without a run guard. When
that write lands after the run's final idle write, the ended thread stays
active for good; the turn_interrupt Kiro replay test caught it now and
then.

The cached snapshot is now settled (idle, or error for a broken thread)
like the server's final write. One override line after upstream's status
line in each adapter, announced in .github/fork-seams.json.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork CI: each listed Python test declares its format, judged by it alone (#702) (#784)

- .github/fork-ci-tests.txt: a Python test's line ends in "unittest" or "ok lines". A Python
  line with neither is refused with what to write; either word on a non-Python test is refused.
  All 87 listed Python tests now say theirs (78 unittest, 9 ok lines).
- countTests: a Python test with no declared format counts nothing; it is never read as either.
- fork-contracts.test.py: its record fixtures pass the format the list would give.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* MCP profiles: Settings section and thread pick logic (design PR 3) (#804)

* MCP profiles: Settings section, thread picks and the menu entry's logic (design PR 3)

Settings → Fork gets its MCP profiles section (McpProfileSettings.tsx):
the built-ins all and t3-only read-only; add, edit and delete named
profiles (servers all or a list, t3Tools all or a list of the shared
MCP_T3_TOOL_GROUPS); the default profile and the sub-agent rule with the
usual project-override control; each thread's pick, changed or cleared.

Every patch names only what it changes: one mcpProfiles entry, or one
thread's mcpThreadProfiles key (null clears), and a pick or clear that
changes nothing writes nothing. A built-in name cannot be taken; a
profile something names cannot be deleted (the panel says who, and offers
to clear the thread picks). An entry with fields from a newer build shows
as broken, never as a profile; one with unknown tool groups as from a
newer version; neither is editable. Rows follow ForkRow's lock, so a
client that cannot write settings gets inert controls.

The pure resolver moves to packages/contracts/src/mcpProfileResolve.ts
(re-exported by the server's fork/mcpProfile.ts, unchanged behaviour) so
the app reads entries by readMcpProfileEntry and shows a thread's
effective profile from resolveMcpProfile, a child's cut down to its
parent's. The thread menu entry's logic is in
components/fork/mcpProfile/threadMcpProfile.logic.ts; wiring it into the
upstream thread menu needs seam lines, announced separately.

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

* MCP profiles: read the client's thread shells (delegatedFrom null) and a carried profile

The app's thread shells hold delegatedFrom: null for a thread nobody
delegated; the menu logic now takes that shape. Test: a task another
machine delegated is cut down to the profile it carried, and a shell
with delegatedFrom null is a top-level thread.

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

* MCP profile settings: add a thread pick only with a chosen profile

- "Add thread" opens a form with the thread id and a profile picker next
  to it; one save writes that thread's key with the chosen profile.
  Nothing is written for a typed id alone, on Enter without a profile,
  or on cancel.
- The form and each pick row say what the pick gives the thread, and
  warn when that is more than the parent's cut-down set (a pick is never
  cut down to the parent's).
- The server refuses deleting a profile that the default, the sub-agent
  rule, a project or a thread pick still names, with the same rule and
  wording source as the panel (mcpProfileUses).
- "Clear the thread picks that use it" checks the lock of
  mcpThreadProfiles, the setting it writes.
- A blank pick hand-edited into settings.json shows as broken (it is
  ignored) and can be cleared.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-kit/heavy: machine-file holds for heavy facts / t3-capacity (stacked on #786) (#843)

* heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers

Dynamic slots design row D6. The kit gets a Python evaluator of the shared
capacity rule (lib/capacity_rule.py) that passes every vector and format case
the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1
object with per-kind "fits" from a ledger read from the kernel (heavy's live
tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic
tier, unreadable signals as elevated, and per-folder reservations.
bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older
output and exit codes; a facts call that is slow (5 s) or fails is never free.

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

* heavy facts: every ticket is a job, folders match exactly, basic tier and other users fail closed

Fix round for the two D6 reviews.

- A heavy ticket whose kind the rule does not know (tsc, gradle, a project's
  own) is the rule's unknownKinds.job, never an agent; heavy facts --kind
  with an unknown name asks for that job too.
- A reservation folder matches itself and what is below it, with or without
  a trailing '/', never a sibling sharing its first letters; its real path
  matches too. The caller's own folder is its real working folder only.
- Basic tier (no cgroup v2 or no user manager) is never free and fits 0.
  Full tier also counts every other user's heavy jobs and agent scopes
  from their user managers' cgroups; a folder that cannot be listed is
  basic. Without a cache folder every call starts "elevated".
- lib/capacity_readings.py: the shared reader's port. It runs every
  capacity-readings.json case and the "a failed reading never admits more"
  check; memory, PSI, cores and container limits now come from it, a box
  with a live piece but no folder is unreadable, a cut-short memory.stat
  owes in full.
- The cache has version 2 and a key of its settings; t3-capacity takes the
  rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript.

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

* heavy facts: kit tests check out the capacity rule; its JSON names no kit path

The heavy kit's evaluator, its tests and heavy-install read the capacity rule
from its one source, packages/shared/src/capacity, but the sparse checkouts of
the workflows, action_tests and kit_tests jobs left that folder out, so
install.test.py and facts.test.py found no capacity-rule.json. The folder is
now in the three lists (and in the `workflows` comment that says why each app
file is there).

The "//" notes of capacity-rule.json and capacity-readings.json named the
kit's Python files, which the fork-owned-reads lint counts as app code reading
a fork-owned path; they now point to README.md beside them, which names them.

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

* fork-kit/heavy: machine-file holds for heavy facts (t3-capacity), on top of the kit capacity check

Built on the kit's `heavy facts` and its thin `t3-capacity` caller (#786) instead of a second capacity
evaluator. What the older host check had that the kit's did not:

- heavy.capacity.holds in the machine file: a cgroup outside the user managers (a CI runners' slice) that
  is in use keeps its budget less its use, as a reservation, for every user but its own. Missing file,
  section or key: no holds; a broken one: no answer (t3-capacity NOT OK naming the key); a changed one
  is read again at once (cache key).
- The sweep and the queue accept the new `capacity` key.
- Tests for the state question: holds in use or idle, own users, missing cgroup, unreadable memory.max or
  memory.stat, machine file missing/empty/garbled/writable by others/unknown key, a changed file within
  the cache's 5 s, a reservation file cut short, a reservation whose processes are gone; one red check.

Part of #834 (G2, first half).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fork-kit/review: one general review skill; tiers, failure table, nit-only check and a drift test (#845)

* fork-kit/review: one general review skill; tiers, failure table, nit-only check and a drift test

The kit's SKILL.md becomes the one general review skill, so a project keeps only its facts (review block, lens
prompts, kit settings) and a thin adapter. Merged in from the project skill: the tier table as the gate's weights,
the author's failure table, nit-only quick check, batch per area, twin lens names, focus lenses, covered rule, the
extra general lenses, and a concurrency part in the eval lens. Conflicts go to what the gate parses: the state answer
on a `state:` line and `blocker:`/`major:`/`minor:` lines.

New test (comments.test.py, SkillFormat): every report shape the skill, the eval lens and COMMENTS.md tell a lens to
write reads as a clean read with a state line through the gate's own parser; the skill's tiers match the gate's
weights and recommended min_lenses; the state question is word for word in the skill, the eval lens and REVIEW.md.

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

* fork-kit/review: skill matches the gate on rounds, protected paths and check exits

- A quick check is a lens read of a new head, so the gate counts it as a
  round; the skill names rounds.approach_at / approach_lens / max, how to run
  the approach lens, and that only an override by a listed override_authors
  login waives it.
- The tier table names the gate's always-critical paths (queue config, lens
  prompts, .github/workflows/**); the light row no longer says config is light.
- focus: removed (nothing reads it); twin lenses described in general terms.
- check exits 1 for a real blocker or major by design; never soften a finding.
- not a lens: also needs no read-at sha outside a quote (COMMENTS.md rule).
- Drift test reads the round keys and recommended approach_at through the
  gate's parser and judge_rounds, the protected paths from review_judge, and
  the runner defaults from review_kit.DEFAULTS.

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

* fork-kit/review: the override passes a nit-only fix head, a quick check never does

The gate passes a head only when every lens's newest read names it or a newer
override covers them (lens.Review.reviewed_head). A quick check is one lens on
the fix head while the earlier lenses still name the old head, so it alone
holds the head. SKILL.md step 7 now says which head passes and that on
`nit-only: yes` the orchestrator still posts the override; COMMENTS.md says the
same. The round count says "whichever is higher", as review_round does.

Tests: a history (code at A, code r2 at B, fix C with a quick check) through the
gate's real reviewed_head and judge_rounds, pinned to the skill's words; the
protected-paths test now compares is_protected's answer with the skill's list
on every tracked file and on probe paths, so an inline rule fails it.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Fix #911: a delivery refused for its profile leaves its place in line (#912)

A stored webhook delivery keeps its place in the slot gate's line from its
first, direct ask. When its worker run was refused for its MCP profile as it
started (before it reached its slot wait), the place stayed until the next
sweep, so for up to a sweep a free slot was refused to another run: that
run was stored for the worker instead of starting.

The flaky test hit this path only when the worker's run lagged behind a
fixed three worker rounds, so the widening landed before the slot wait it
meant to test. It now waits for that slot wait itself, and a new test
covers the start-time refusal, which leaves the place at once now.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Review rules T3a: lens_start plan, prompt, refusals and request ids (pure logic) (#825)

* Review rules T3a: lens_start's plan, prompt, refusals and request ids (pure logic)

New fork files next to the review-rules logic of #781. Nothing registers a tool yet.

- planLensStart: per pull request and batch plan. Required lenses come from planReview and
  requiredLenses, the round from judgeRounds (the gate's own rules), so lens_start cannot
  require fewer lenses than the gate. A lens whose newest report already read the head (or the
  same change) is not started again. A batch gives one child per lens that reads every pull
  request needing it and posts one report per pull request, each with that pull request's head.
- Refusals: rules off (unset, empty, off, unreadable), a bad call, an unknown, closed or merged
  pull request, a caller head GitHub does not name, no plan (unreadable change, no rule, a lens
  prompt not read), round past the cap, a person's override already on the head.
- confirmLensStart: just before starting, a child whose pull request moved or closed is refused.
- lensRequestId: same lens and heads = same id, in any order; fits delegate_task's 256 chars.
- The server builds the prompt: read only, the lens text, the state question word for word with
  a `state:` line, finding prefixes, report size, round and earlier reads.
- Tests replay every shared case, round and scan vector (counts checked) and answer the state
  question: same start twice, head moved, old/empty settings, round at the cap, partial batch.

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

* Review rules T3a: lens_start plans what the gate reads (fix round A+B)

- Restart every lens entry that does not name the head once anything must
  start, required or not: the gate needs every lens comment on one head.
  An entry lens_start cannot start (no header, unknown lens) is refused
  with what a person does. A newer override the gate counts is honoured.
- Read the gate's required-lenses input and the review block's mode;
  without a block the input names the lenses (built-in prompt), and an
  empty input outside enforce, a bad name or a bad mode is refused.
- Plan each pull request of a batch with its own base branch's rules.
- Earlier lens children: an ended one restarts as the next attempt
  (replaces + note), a running one is returned, never started twice.
- Repo and heads read lower-case; the approach lens runs on the approach
  runner by its role; lone-surrogate lens keys get a distinct id.
- Tests: both lens-A scenarios, a property test over every shared vector
  state (the gate's verdict, modelled from its code, passes after the plan
  is carried out, or a person must act), and a test per new refusal.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* Slot gate: enforce the capacity rule by default (dynamic slots D4) (#823)

* Slot gate: enforce the capacity rule by default (dynamic slots D4)

The capacity rule now decides agent starts (mode "enforce", the default when
agentSlots has no mode and is switched off):
- owed term: every agent still starting, held slot or waiter ahead owes its
  full cost, so two starts in one second both count;
- kinds from the task role: research, review and design are light, anything
  else or no role is a writer; a light agent that grows past the light cost
  counts as a writer, so a wrong role cannot hide one;
- floors (2 agents, 1 job) and derived ceilings (3 agents per core, at most 64);
- fallback to the fixed ceilings (10 agents, 4 jobs) with start costs raised
  25% per trip after an OOM kill (oom_kill in /proc/vmstat rises) or swap under
  10% free; it lifts after 10 minutes of calm, whole readings. A restart starts
  in the fallback and at "elevated"; unreadable readings are never calm.
Typed limits still apply while enabled; "mode": "fixed" turns the rule off.
The delegate_task route passes its role to the slot gate with the target.

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

* Slot gate: fix round after lenses A and B (D4)

- floor always starts, also with failed, hung or out-of-range readings;
  after 2 minutes unread the fixed 10 counts alone
- a restart lifts on calm for this host: swap counts by trend, the first
  calm needs the margin only; a 30 s timer takes readings
- costs from the rule file (light 384, writer 768); light cost clamped
- only agent-slice OOM kills raise costs; untold kills raise at most 2;
  each calm spell lowers one raise
- basic tier (no scopes or no oom_kill) keeps the fixed 10; unread
  running agents count once as writers
- unreadable settings use the fixed limits; true counts in refusals
- tests for the held slot, the role line, no OOM counter

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

* Slot gate: kit evaluator follows the swap-trend rule; scheduled-run tests build the gate at START

The merge of main brought the heavy kit's Python evaluator of the capacity
rule (#786), written for the rule before this PR. This PR's rule counts swap
by its trend (pressure.swapFillingMb; calm.swapFreeAtLeastPercent gone), so
the kit read a key the shared rule no longer has (KeyError in
capacity_rule.test.py and every heavy facts call).

- lib/capacity_rule.py mirrors capacityPressure.ts and pressureOf: raw_level
  takes the last read's swap free (filling = it fell by more than
  swapFillingMb; nearly full counts only while filling; filling is never
  calm; no previous swap read = trend unknown), next_pressure keeps or starts
  the calm wait on an unknown trend but never ends it, and the kept state
  carries swapFreeMb for the next read (heavy facts' cache carries it).
  The shared capacity-vectors.json swap-trend cases and the facts carry test
  fail when any part is undone.
- capacity_rule.test.py: a kit copy of the rule from before the swap trend is
  refused by name; an empty or missing rule file raises (heavy facts then
  answers "not available", never free).
- agentSlotRoutes.test.ts: the gate's 30 s enforce sampler starts when the
  gate is built. Built at the test clock's 0, the tests' move to START ran
  every sample in the 56 years between (about 59 million): Test Server 5 hung
  until its 20 min cancel. boot now sets the clock to START first.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* MCP profiles part 5: Codex threads apply their profile's outside servers (#826)

* MCP profiles part 5: Codex threads apply their profile's outside servers

Each Codex thread T3 loads on the…
scuttletoby added a commit that referenced this pull request Nov 29, 2026