Skip to content

Fork: merge=union for .github/fork-ci-tests.txt (#862) - #1269

Open
scuttletoby wants to merge 821 commits into
mainfrom
fork/862-merge-union
Open

scuttletoby wants to merge 821 commits into
mainfrom
fork/862-merge-union

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Fork issue #862, ranked fix 4 (a).

What. .github/.gitattributes with fork-ci-tests.txt merge=union: two branches that each add a test line at the same spot merge cleanly in local git instead of conflicting. .github/scripts/fork-gitattributes.test.py pins the rule (only union, only for files that exist, other lists unspecified) and shows the clean merge and the conflict without it.

Why only this file. Its line order does not matter and its reader (fork-ci-tests.cjs) refuses a wrong union loudly: a test listed twice, or a line kept for a test one branch deleted, fails the list check, so a bad union never reaches main green. Left out: fork-owned-paths.txt (its ! lines depend on order), fork-secret-sweep-gone-tips.txt (a reviewed security list; a union could bring back a removed line), JSON/YAML (fork-seams.json is regenerated by its script). In the conveyor's conflict stops and rebase briefs, fork-ci-tests.txt was the list file that recurred; the rest of those conflicts came from main being rewritten by fork-follow (handled by the catch-up-rebase PR).

Limit. GitHub's own merge, update-branch and mergeable state ignore .gitattributes: it helps writers' local merges, the merge train's local merge-tree and catch-up-rebase, not GitHub's CONFLICTING label. Details on #862.

Owner gate. "No database schema changes" refuses any .gitattributes change by design ("Only the owner may do that"), so that check stays red here and the owner merges past it, which is why this is split from the catch-up-rebase PR.

🤖 Generated with Claude Code

scuttletoby and others added 30 commits November 28, 2026 22:29
…hell (F7) (#1168)

The host runs a Bash call as `bash -c '<text>'`, so that shell's command
line holds the text; `pkill -f P` (or `kill $(pgrep -f P)`, `pgrep -f P |
xargs kill`) with P in that text kills the shell too (pkill spares only
itself): exit 143/144 and nothing after it runs. 107 such calls in two
weeks of agent history.

poll-loop-guard already reads every Bash call, so the check lives there
(no new hook, no extra process start per call). It reads the pkill/pgrep
options (-f needed; -x, -A, -v, -F, no pattern or a pattern from a
variable pass), turns the ERE into a Python regex (POSIX classes, -i) and
matches it against the shell's command line in both quotings. It checks
background calls too (they self-kill the same way); wait loops there
still pass. A pattern it cannot compile passes (fail open). The refusal
says to bracket one letter or kill by PID.

Tests: the shapes (red on the old guard), the passes and known gaps, and
a contract test that runs each shape in a real `bash -c` with a unique
marker and checks the guard refuses exactly what really kills its shell.
The live self-check gains a case (wiring count 20 -> 21).

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ges merge cleanly (#1130)

* FORK_CHANGES.md: one file per change, so pull requests that edit different changes merge cleanly

The list was one Markdown table that the formatter re-pads: one longer row re-pads every line, so any
two pull requests touching it conflicted. Each change is now its own five-line file under
docs/fork/changes/{app,repo}/; FORK_CHANGES.md is the entry page and may hold no table row.
fork-changes-list.cjs reads the folder (fails closed on any other shape), prints the whole list as a
table (`print`), and moves an open pull request's old-table edits to files (`adopt`).

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

* fork-changes-list adopt: read the replayed side, remove nothing on a page without rows, no second file for one change

adopt reads CHERRY_PICK_HEAD or REBASE_HEAD against its parent during a replay, and the merge's own
sides during a merge. It removes nothing when the pull request's page has no table row, refuses a
base with no table against a whole old list, and refuses a new row a file already holds. It puts
the base's entry page in FORK_CHANGES.md itself, only once every row there is held or was on the
base, so the documented steps have no checkout that could drop a row. readChanges refuses one
change in two files and names a leftover .md.tmp, which adopt removes.

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

* fork-changes-list adopt: a finished rebase's REBASE_HEAD is no rebase, and every refusal changes nothing

A rebase is in progress only while rebase-merge/ or rebase-apply/ exists: git leaves REBASE_HEAD
behind, which made a later merge read the finished rebase's commits. adopt now decides everything
before it writes, so a refusal (a per-row conflict, conflict markers in the entry page's own text,
a whole-page refusal) leaves the tree as it was. An edited row pairs by its Change line before its
first pull request, and rows that share a number ambiguously are for a person. The advice fits the
operation: undo a merge committed with the old table, replay a branch whose merge base has none.
checkEntryPage refuses conflict markers.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
The Usage tab's fleet list needs one fork RPC (fork.fleetUsage) in
upstream's RPC group, its scope and span category, its ws.ts handler,
and one element in the Usage tab's limits list.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…y holds (#1170)

wait_for {kind: pr} refused every wait in a project with no remote, even
when the host was known locally. Now, without a remote, the judge takes
the host from what T3 holds:
- another project of T3 whose remote is the named repository, or
- the host and repository the wait pinned at its first read.
Only when neither gives a host is the wait refused (new) or a failed
read (stored), with a message that says what to do.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ound (#1171)

* fork: Claude orchestrators start long native sub-agents in the background

Upstream's orchestration text tells Claude to start its own Agent with
run_in_background:false and never in the background, so an orchestrator
sits blocked in its turn until each child ends. A background Agent's
completion already wakes the thread, after the turn too, so a fork
UserPromptSubmit hook tells Claude threads with T3's tools to start long
native children in the background and keep working or end the turn.

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

* fork: background-Agent guidance for top-level threads only, once per session

A delegated child's woken run never reports to its parent, so a child
that starts a background Agent and ends its turn hands the parent an
empty result. Children (local subagents and tasks another machine
delegated) now keep upstream's foreground-only Agent rule; only
top-level threads get the guidance.

The guidance is added to a session's first prompt in each Claude
process, and again after a compaction, instead of with every prompt.
The reword guard now anchors on upstream's whole Claude clause.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
The README tells a host with its own plain t3-capacity to run the bootstrap with --replace-t3-capacity, but the
bootstrap's option loop did not know it and stopped with "unknown option". Now every installer option reaches
heavy-install, and a second --sha or --source after the installer options is refused (the installer would have
taken the last one, not the sha the bootstrap checked). A test runs the bootstrap as a normal user for every option
that `heavy-install install -h` lists and fails on the old loop.

Part of #1150

Co-authored-by: Claude Opus 5.5 <[email protected]>
…sk lines (F7) (#1176)

List only: announces the upstream lines that the F7 background-wait change
adds to orchestrator/tools.ts, ThreadManagementService.ts and
ClaudeAdapterV2.ts, so that change can move them to "added".

Part of #1094.

Co-authored-by: Claude Opus 5.5 <[email protected]>
The stub's __fork-report SIGKILLed the server and returned at once. A kill
is only queued: on a busy runner the server was still exiting when
rehearse polled it right after the report, so poll() said "running" and
the test saw no failure ("Failed not raised", seen on main).

The stub now returns only once the server is a zombie or gone, as a
server that died during the checks is. Under single-core contention the
test failed 5 of 20 runs before and 0 of 20 after.

Co-authored-by: Claude Opus 5.5 <[email protected]>
… 1) (#1182)

delegate_task will take a narrower MCP profile for its sub-agent, never
wider than the caller's (owner decision #102). Step 1 of "Adding a seam
line": the list only, no code. Three lines announced:

- orchestratorMcp.ts: one spread of the fork's own delegate_task input
  fields (forkOrchestratorMcp.ts), first `mcpProfile`.
- OrchestratorMcpService.ts: seat 2 of the delegation checks gets the
  command id and input, so the profile is checked and recorded for the
  child (its id follows from the command id) before the dispatch.
- RemoteDelegation.ts: the carry gets the input, so a task sent to
  another machine carries the narrower profile instead of the parent's.

Part of #875

Co-authored-by: Claude Opus 5.5 <[email protected]>
* agent rules: update only the next pull request to merge

The fork's ~265 Update-branch merges (11-14..11-28) came from agents
calling update-branch with the owner's token, not the pr-queue (it has
no runs on the fork). Replace the merge-queue-only rule with one that
holds without a queue: update only the pull request merged next, once,
right before it merges.

Part of #1094

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

* agent rules: one update right before the merge, strict off on purpose

Fix round 1 (code lens): the rule now requires the single update of a
behind PR before its merge and says what to do when it conflicts;
updates.md no longer says main's ruleset requires up-to-date branches.

Part of #1094

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
… (#1189)

Step 1 of "Adding a seam line": the list only. A thread whose next turn
names no effort while the model policy is on will show a warning in the
composer's banners: one hook call and its items spread into both banner
lists, joining the file's announced block (since renewed to 2026-11-28).

Co-authored-by: Claude Opus 5.5 <[email protected]>
* fork(placement): P6 advise says where a worktree child would run

With placement.mode advise (or enforce, not built yet), each new
delegate_task reads this machine's facts and each linked machine's
facts, checkouts and providers (3 s each, in parallel), asks the P5
rule engine, and adds the pick and its reasons to the reply's note.
Nothing is moved. A retry skips it; a failure or a slow read gives a
note that says so and the task goes on.

The seat is not told the task's isolation yet, so the note speaks of a
worktree child and says a shared child stays here. Passing isolation
is left for P7.

Part of #883

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

* fork(placement): list placementAdvice.ts as a client of linked tools

placementAdvice.ts builds Tool.make descriptions of a linked
environment's t3_environment_read and orchestrator_capabilities to call
them there; it advertises no tool. Register it in the person-only test's
NOT_ADVERTISED list, next to remoteMcpProfile.ts.

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

* fork(placement): P6 fix round 2: this machine's labels reach the rules

- EnvironmentFacts.read fills placement.labels from readPlacementForThisOs
  (settings read once, for the slot facts and the labels), so here and every
  linked machine answer with their own labels: H5 never groups and H6 needs
  are checked against real labels.
- Advice text names machines by label in the no-fit reason and in why;
  "This call has no MCP caller" starts a sentence.
- delegateChecks reads placement.mode through readPlacementForThisOs.
- A linked window fits a real facts read (6 s gate read + 2 s): 8 s. This
  machine's read runs beside the linked reads; the link list, repository key
  and link lookup each have their own 2 s bound and drop only their part; a
  linked read that runs out of time is marked slow or unreachable. The
  last-resort bound is 13 s.

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

---------

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

* feat(fork): work panel part 2, the capacity bar and usage left (#1136)

Above the CI part, the work panel shows one bar for the fleet's agent
sessions in use of those allowed, split per machine (hover a part, or
open Per machine), the memory free of the total, CI runners busy, and
each provider account's session and weekly room left.

Each machine the device knows is asked with the same fork.workPanel
read, without a thread: its answer now carries the machine's capacity,
from the same facts placement reads (the slot gate's counts and the
host sampler), so forkLayers builds the work panel over the one slot
gate. Usage comes from the provider status the client already holds.
A machine that is not connected, does not answer or predates the read
is grey and unknown with why; the fleet total never guesses 0 or 100.
Free CI runners are always unknown: GitHub does not report the hosted
cap and the fleet starts a runner per job.

Part of #1136

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

* fix(fork): work panel round 1, no stale numbers shown as current (#1136)

- A machine whose fork.workPanel refresh fails after an answer is
  unknown, not its old answer: AsyncResult.getOrElse handed back the
  previous success. An answer more than three refreshes old (a hung
  read) is unknown with its age, from factsAt (now optional, never 0).
- Usage left: a window whose reset has passed since it was read, and
  limits read more than 30 minutes ago, are unknown; the tightest of
  several weekly windows is shown; accounts by label, no e-mail.
- Agents above a lowered limit read against the gate's own limit
  (EnvironmentFacts.readWithSlotLimit), not used + a clamped slotsFree.
- CI and capacity are two reads, so a slow gate never holds back CI.
- A memory floor reads in GB with a decimal; "CI runners" says it counts
  this thread's repositories.

Part of #1136

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

* fix(fork): work panel, one stale-answer rule for CI and capacity (#1136)

staleReason moves into workPanel.logic.ts, where currentAnswer uses it
too, so the capacity bar and the CI part share one rule and knip finds
no unused export.

Part of #1136

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…runs) (#1169)

* schedule-kick: heads reconciler and keep-on, so every trusted head gets a run (#1157 phase 1)

- heads (in the tick): one GraphQL call a pass lists main's tip and the open
  same-repository pull request heads with their Actions check suites; a head
  with no Fork tests run gets one workflow_dispatch (ref=<sha>, head=true)
  after a grace, at most maxPerPass a pass, recorded as sent before the call.
  Lost dispatches are reported once; a 422 (old workflow file) is not retried.
- keep-on (own 15 s timer): one workflow-list call per entry; turns back on
  only the named workflows from disabled_manually/disabled_inactivity, with an
  ALERT journal line; failures go to the machine alert channel (hourly). The
  client has no call that switches a workflow off.
- fork-checks-ran.py: a head run on a pull request branch is judged as that
  pull request's run (one lookup, inside the cap).

Part of #1157.

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

* Fork tests: head runs, a workflow_dispatch for a trusted head (#1157 phase 1)

A dispatch with head=true runs as a release run but tests the run's own
commit (github.sha, where its checks land), so a branch that moved after the
dispatch gets the result on the commit really tested. fork_checks_ran gets
HEAD_RUN so a head run on a pull request branch is judged as that pull
request's run.

Part of #1157.

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

* schedule-kick: keep kick.test.py's RedCheck texts matching the code

The heads/keep-on change moved three texts RedCheck mutates: the repo check
was written twice (entries now use _repo, so it is once again), the tick loop
calls work() instead of kick_one, and gh-as's rate-limit argument gained a
trailing comma. Each rule's test fails again with the rule broken.

Part of #1157.

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

* Head runs never weaker than the PR run; heads 422/budget/keep-on fixes (#1157 fix round 1)

- fork-tests.yml: a head run on a pull request branch tests the PR's merge
  commit (its head parent must be github.sha), runs the secret scan as that
  PR's run (fork-secret-scan.yml head_ref: pull_request range, earlier heads,
  no sweep record) and the macOS lint. changes and fork_checks_ran get
  pull-requests: read for the PR lookup. Contract: head-run, with mutations
  for each part (the ac72a7c shape fails).
- heads.py: only "Unexpected inputs" / no workflow_dispatch 422s are final;
  a 422 for a switched-off workflow retries with backoff. Every attempt
  counts toward maxPerPass. Marks of heads missing from a snapshot stay 7
  days. lost/refused go to the alert channel once. The GraphQL budget is
  kept apart from the REST one (graphql_remaining).
- keepon.py: a rate limit on enable pauses (retry-after), stops the pass and
  keeps pauseUntil. A refused config writes keep-on-status.json ok: false.
- fork-checks-ran: test for the GITHUB_WORKFLOW_REF clause. README: a run
  in any state counts; every head gets a run, not a result.

Part of #1157.

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

* Callers grant pull-requests: read; heads keeps its backoff, one head's 422 skips only it (#1157 fix round 2)

- fork-release.yml (tests) and fork-follow.yml (release) grant pull-requests:
  read, which fork-tests.yml's changes and fork_checks_ran now ask for (else
  both callers fail at startup). This is also why fork-fleet.test.py was red:
  its Wiring test checks the same grant on fork-release.yml's tests job.
- heads.py: the entry's failures/retryAfter are cleared only after a pass with
  no entry-wide error, so dispatch errors double their wait across passes
  whose GraphQL read works. A 422 about one commit (not "Unexpected inputs",
  not a disabled workflow) gives that head its own wait (5, then 10 min) and
  a refusal after 3 tries, and the heads after it go on in the same pass
  (still within maxPerPass). A REST budget under the minimum stops the
  dispatches of a pass.
- fork_ci_result: secrets may skip only in a release run, never in a head
  run on a pull request's branch (contract head-run, with a mutation).
- pause() never shortens a running pause (keep-on and the tick).
- tick: a ConfigError after the config loaded writes ok: false to status.json.
- TokenApi: GraphQL rate-limit headers go to graphql_remaining/graphql_reset,
  never into the REST budget.

Part of #1157.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
* fork-kit/review: lens-packet, one file per lens (#1094 F6)

A lens spends most of its turns reading: the PR, its issues, the diff, the
files around each change, its prompt and the earlier rounds. lens-packet
writes all of that into one Markdown file, read at the clone's HEAD (which
must be the PR head; line 1 names it), deterministic, with per-file caps.
Earlier rounds are this lens's own reads and the `not a lens:` notes;
other lenses' reports are only counted (SKILL.md, Order, step 4), unless
--all-lenses. Unreadable issues or comments are listed gaps and exit 1.

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

* fork-kit/review: lens-packet reads the lens config at the base, rounds the gate counts, fenced GitHub text (#1094 F6)

Round 1 (merge-path, state):
- the lens list, prompt paths and kit settings come from the base tip with
  git (review_kit.load_settings/other_settings gain base=), as the gate
  reads them; the packet says when the PR changes them
- earlier rounds are the comments lens.Review counts (lens_posts, counts),
  never edited or hidden; `not a lens:` notes are counted, shown only
  with --all-lenses; the left-out counts are named
- every PR body, issue body and comment is fenced under an untrusted label
- a cut new file is never called all of it; a total cap with a
  "Not in this packet" list; exit 2 removes an older --out; temp file
  then rename; a warning on line 2 when the PR changes the builder and
  this copy is not the base's; stdout lists the sections with lines
- SKILL.md: exit 1/2, never --all-lenses, not a replacement for reading

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

* fork-kit/review: lens-packet is built by the base's copy (#1094 F6)

A lens builds the packet with the base's copy of lens-packet from a
worktree of the base, never the head's: the head's copy is the code
under review and could write its own reviewer's instructions. A run of
a changed builder refuses (exit 2) with the command for the base's
copy, or says to review without a packet when the base has none.

Earlier rounds also read reviews and inline review comments (the
gate's review_flags), an unparsed report naming this lens shows as
"unparsed, maybe this lens", titles are fenced, a 5th linked issue is
named as not shown, the lens-config change note compares against the
merge base, and a write failure exits 3 and leaves no old packet.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
* fleet walls: probe fails closed on killed probes

PROBE took any non-zero exit with nothing on stderr as the unit's
IPAddressDeny drop, so a connect killed silently (SIGKILL, the OOM
killer: rc 137) passed. Only timeout's own exit (124) with nothing said
is a drop now; anything else fails. OWN_PROBE also refuses an own-address
list that is only whitespace. LAUNCHER_SHA256 follows the launcher.

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

* fleet walls: closed pairs and PROBE's own list fail closed too

Review round on #1192. PROBE's HOST PORT loop took any non-zero exit as
closed (a killed connect, rc 137, or no timeout, rc 127): a pair is now
closed only on a refusal or timeout's own exit (124) with nothing said.
PROBE refuses an own-address list that is only white space, as OWN_PROBE
does, and a silent failure other than 124 logs its exit code instead of
"no answer in 5 s". LAUNCHER_SHA256 follows the launcher.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
* agent-guards: harness speed env in the managed settings drop-in

With --settings the drop-in now carries an "env" of Claude Code speed
variables (BASH_MAX_OUTPUT_LENGTH 12000, MAX_MCP_OUTPUT_TOKENS 8000,
API_TIMEOUT_MS 180000, DISABLE_AUTOUPDATER 1; auto-compact window and
prompt-cache TTLs known but off). The machine file's
"agent-guards"."harnessEnv" rows override a value or take it out (null).
A variable another managed settings file sets is left to it. A drop-in
of an earlier release (hooks only) is still the kit's and upgrades.

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

* agent-guards: harnessEnv review round 1

- DISABLE_AUTOUPDATER is off by default: the kit ships no update path,
  so it would freeze each machine's Claude Code version. Opt-in per
  machine.
- API_TIMEOUT_MS 300000: it also caps a large request's first-byte
  watchdog and a whole non-streaming fallback answer.
- MAX_MCP_OUTPUT_TOKENS 15000: a t3_thread_read page fits twice.
- Variables T3 sets per session (prompt-cache TTLs, auto-compact
  window, FORCE_PROMPT_CACHING_5M) are refused in harnessEnv: managed
  env would silently override T3's value.
- agent-guards self-check names each variable where the drop-in and
  the machine file differ (an edit without a reinstall).

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

---------

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

* slot-filler: fall back to the next account when the first is full

An item's "account" (and defaults.account) may now be an ordered list.
On each machine the filler starts the item on the first account that
passes the usage rules (full at maxUsedPercent, reading older than
maxAgeMinutes, no reading, no meter mapping on a remote machine;
windows of another model family or with a passed reset do not count).
When none passes, the item waits and the log names each reason.

The intent marker keeps the account it asked with, so a start that
stopped half-way is asked again on the same account under the same
request id; a clear usage refusal lets the next run pick again. A
single string and old markers work as before.

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

* slot-filler: send a machine's projectId; refuse worktree items it cannot run

A linked machine needs target.projectId, or T3 refuses the start: an
optional machine "projectId" is now sent right after environmentId.

An item with isolation "worktree" is refused when it is read (one log
line, kept) if a machine it names cannot give a child a worktree: a
machine's "worktreeIsolation", false by default for a linked machine
(it runs in its project's checkout) and settable to false for a project
that is not a git checkout. An item that names no machines runs only
where worktrees work, and is refused when none can.

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

* slot-filler: a usage refusal holds that account, not the machine

The server's pacing gate (usage_pacing_hold) can hold an account that
is ahead of pace while its meter still reads well under the limit. The
refusal backed off the whole machine, so after the wait the filler
picked the same account again and never used the next one. A usage
refusal now backs off only that (machine, account) pair, kept under
"accounts" in the request file; the next run starts the item on its
next account. Other refusals still back off the machine.

Also: "account": null means the default again, as before; a lens-watch
"account" is checked like an item's; a stale reading's growing age is
no longer logged again every run.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…03) (#1183)

A GitHub release download now and then answers 403 for a moment (PR #1163's
Secret scan run failed so). curl's plain --retry 3 does not retry a 403, so
every pinned release download in the fork's workflows (gitleaks in the scan
and tests jobs, actionlint, shellcheck) now uses one line: --retry 5
--retry-all-errors, curl's growing waits, at most 2 minutes, with connect and
transfer time-outs. The SHA256 pin is still checked before anything is
unpacked; a mismatch fails the step.

No cache of the binary: any job of a branch can write a cache that branch's
runs restore, and actions/cache unpacks it with tar -P anywhere on the runner
before any checksum is checked (#701; fork-contracts.test.py forbids one in
the scan job).

Test: fork-release-downloads.test.py checks the line and the checksum order
in each such step, and runs each step's own run text against a local server
answering 403 then 503 (passes), a wrong archive (fails, nothing unpacked) and
the old line (fails on the first 403; red on main).

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

* fork: account order, so delegated work leaves a spent account (#881)

New server setting accountOrder (a list of provider instance ids, empty by
default). When a delegate_task with no named instance would start on an
account that is spent, it starts on the first account in the order that has
room and can run the same model, options and runtime mode, and the reply says
so in one line.

- Spent: a window whose usage is current is at or over 100 minus the owner's
  usagePacing reserve (as the pacer releases it over the window's last 12 h).
- Stale usage, a reset time that passed with no reading since, or no reading:
  that account takes no work, and an account the task is on is not moved off.
- No account in the order has room: the task starts as asked, with one note
  naming each account and why. Holding stays the pacing gate's call; the gate
  runs after the order, on wherever the order left the task.
- Same provider only, never another instance of the same login, never one the
  project turned off, never an instance the agent named.

Settings -> Fork, Plan usage pacing gets an "Account order" row (add, move up
or down, remove). The fork report and the overview count the feature. A bad
file entry or repeat is dropped on read; a save with either is refused.

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

* fork: name server.accountOrder in FORK_CHANGES.md (#881)

fork-changes-list.test.cjs requires every pinned fork setting to appear
on a FORK_CHANGES.md line.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
A head run on a pull request's branch tests that pull request's merge
commit at depth 2, like the pull request's own run, but skipped the
`Fork lines in upstream files` step (pull_request only). Run it there
too; on main a head run stays a release run of the tip, as a push is.
The head-run contract pins the step's condition, command and its
checkout (merge commit, depth 2), with two mutations that must fail.

Co-authored-by: Claude Opus 5.5 <[email protected]>
* Playtest F5: the thread chip with an End button

A thread whose playtest session is on shows a Playtest chip above its
composer: target, state, last round, the step running now. End ends the
session as the tool's end does (reason person), through a new pair of
routes (GET /api/fork/playtest/state, POST /api/fork/playtest/end). The
chip goes when the session ends any other way. Moves the announced
ChatView lines to added.

Fixes #889

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

* Playtest chip: End only with the operate scope, a slim state answer, a test over the real service

Fix round from the #1099 lens (carry-overs from #1126):
- End is left out for a connection without the operate scope.
- The routes send PlaytestChipSession only: no worktree, step output or
  problem text, and releaseProblem in place of the text.
- playtestRoutes.service.test.ts runs the routes over the real service and
  its fake adapter.
- The chip's tooltip has the agent's note and the rounds count.

Part of #889

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

* Playtest chip: a release's own problem, End without a release, a failed read keeps the chip

Round 2 of the #1099 lens:
- releaseProblem only for a problem that starts with RELEASE_PROBLEM, so a
  renew or claim problem does not show "release has not worked" while the
  first release runs.
- End whose release could not start answers ended-unreleased, and the toast
  says the target was not given back.
- A failed read keeps the chip and keeps polling (up to six in a row); a
  404 from an older server still reads as no chip.

Part of #889

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…eases (#857) (#1096)

* fork-kit/homelab: machine file section, homelab check, test-machine leases (#857)

The small part of #857 (owner decision #1073): the "homelab" section of the
private machine file, `homelab check`, and leases any project can take on a
shared test machine. Real machine names and hosts stay in the machine file;
the public example uses .example names and documentation addresses. The VM
verbs wait for the server design (#900). Used from a checkout for now; the
installer comes in its own pull request.

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

* fork-kit/homelab: fix round 1, lease folder and check hardening (#857)

- refuse a lease folder anyone can write (o+w), in every command and in check
- reach lease files through one open handle on the folder (dir_fd), so a
  folder swapped for a link mid-run is not followed
- open <name>.lock non-blocking and refuse it when it is not a plain file
  (a FIFO made take and release hang)
- homelab check --json
- check --timeout: 1 to 60 s, a usage error otherwise (-1 crashed)
- --note: one printable line of at most 200 characters
- the next take or release of a machine removes its stale temp files of any
  process id, under the machine's lock
- tests pin umask 0o022 (lease.test.py failed under umask 002)

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

---------

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

* seams: announce the thread menu hook's handoff lines for #1088 (HO5)

Upstream's thread menu hook now builds its menu in a synchronous
readMenu (the command palette reads it too), so the announced line
`forkHandoff: await ForkHandoffMenu.readHandoffMenuState(threadRef)` has
no async place left. #1088 reads the handoff state in openMenu instead,
into a small holder readMenu passes on. This list-only change announces
those three lines and withdraws the old one.

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

* seams: announce the handoff read's primary-server check for #1088 (HO5)

Upstream's openMenu shows the native menu before any await, and its
tests check that. #1088 therefore reads the handoff state only for a
thread on the app's own server (the only one with a handoff state), so
the read sits under an if with its own comment line. This announces
those two lines.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
* F7: background wait accepts taskId and reports ended tasks

t3_background_wait takes taskId as an alias of taskIds, and a task that
already ended is answered once under a new ended field (status and
summary) instead of being refused as unmatched. The Claude adapter
records each task_notification in a small bounded memory
(fork/backgroundWait.ts); ThreadManagementService reads it before the
unmatched refusal. Spends the 8 seam lines announced in #1176.

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

* F7: keep the advertised parameters upstream's; ship only the ended field

Advertising a taskId alias grows upstream's tool-list budget
(agentContextBudget.json stays upstream's), and McpHttpServer refuses
an argument it does not advertise, so the alias cannot land through
the announced lines. Its .setParameters line stays announced, unspent.

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

* F7: accept a provider thread whose native id is still null

ProviderThread.nativeThreadRef.nativeId is string | null, so read()
must take that shape; the typecheck failed on the call in
ThreadManagementService and the tests. Also use Effect.succeedSome.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…model list (#876 M6) (#1178)

* Model policy Settings: stale-row marks, add rows from the live model list (#876 M6)

A row whose model no list of its driver holds on a selected machine (by id
or alias) is marked as retired or misspelled. The Edit allowed models dialog
adds a row for any model the selected machines list, with the efforts its
own control offers, read as the policy reads a pick (modelPolicyListedEfforts).

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

* Model policy Settings: no no-effort or ultracode choices in added rows (#876 M6 review)

- Claude's `default` effort choice (a gateway model's: it sends no effort,
  Claude Code picks) is read as no effort by the check and never offered
  as a row's effort, in one per-driver list with OpenCode's no-variant.
- The add-a-model helper drops an old build's `ultracode` effort choice
  itself, and a model that turns ultracode on by default gets a row that
  allows ultracode (its default), so a pick leaving the toggle out passes.
- The stale check drops an always-true guard.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
One commit with this pull request's whole change, so the replay keeps what its merge commits held (old head 93b312f).
) (#1198)

A hand-written Claude row holding `default` still saves, but since #1178 a
pick naming `default` reads as no effort, which the row refuses. The
refusal's row list still named `default` as an allowed effort, so an agent
was told to use the level it was just refused. The list now leaves out the
row's driver's no-effort choice (Claude's `default`, OpenCode's
`t3:default`) and says why; another driver's `default` is listed as before.

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

Each waiting owner question shows its body's Recommendation line and an answer box. Post answer
sends "Owner decision: ..." through upstream's issue comment call, then takes the rule's label off
(only once the comment is posted), as the owner allowed in #829.

Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby and others added 28 commits November 29, 2026 23:48
…882) (#1293)

* Dynamic slots D8 part 2: the work panel shows the host kit's status (#882)

The slot gate keeps the host kit's last answer (free, busy with its
reason, or no answer with why) and reports, with KitFacts.locate (which
runs nothing), whether the kit is installed, unsafe or absent, and
whether the gate asks it now. The work panel's capacity read carries it
as `hostKit`, and its Per machine list shows one line per machine.

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

* Agent slots change file: link #1293

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: scuttletoby <[email protected]>
* review kit: the #960 lens minors (#963)

The plan reads the base config with the gate's safe git and names a base tree git cannot read; cost counts only
Claude Code's agent layout as sub-agents, names agents whose parent is unknown, and costs one transcript per RUN-ID.
REVIEW.md shows --settings on plan and check; the plan fixtures use neutral names.

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

* review kit eval test: the decoy parent session ends last

With a run's transcripts now costed from the one that ended last, the
decoy parent.jsonl (it only mentions a RUN-ID) ended first, so breaking
"only a run's own session counts" no longer changed the cost and the red
check failed. The decoy now ends last, as a session that starts runs does,
and the test asserts no second start of the run is noted.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…y out (#1208) (#1315)

* placement P7: pins aged on read; a refusal there names the new-key way out

The #1248 lens minors (filed on #1208):
- A pin older than 7 days was still sent until the next write; get and pin
  now read only pins within 7 days, so such a retry is checked again.
- A launch refused there keeps its pin, so every retry with that key sent
  the same commit; the refusal there now says so and names a new
  clientRequestId as the way to a newer commit.
- A retry's pin is read before placement on purpose (it replays the task
  already started there); the docs now say so.

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

* placement pins: write get as Effect.fn so lint and typecheck pass

The pins' get was an arrow returning Effect.gen, which the prefer-effect-fn
lint rule and the effectFnOpportunity typecheck diagnostic both refuse.
Same behaviour, now with a PlacedWorktreePins.get span.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…nown (#1321)

* MCP profile menu: mark picks that may be wider when the parent is unknown

When the parent's limit cannot be worked out (facts late or unknown, or the
thread not loaded), threadPickEffect now sets mayBeWiderThanParent for any
pick that keeps something. The sidebar menu labels such a pick
"(may be wider than its parent's)" via one shared threadPickMark, and
Settings shows the same note on the row and counts it in the summary.

A failed facts call cached for the menu is no longer shown again on every
open: an open that finds a failure an earlier open showed asks again
(after subscribing, so an at-once answer is heard), so it or the next open
gets the new answer.

The facts tests now run the real query cache over a fake server, so the
idle TTL, stale check and remount refetch are covered.

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

* Count only pick notes in the may-be-wider settings test

The line above the Advanced fold stays shown once the fold opens and also
says "cannot be told", so the count matched it as well as the pick's note.
Match the note itself ("With this pick ... cannot be told").

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…r tests (#879 item 17) (#1333)

* fork seams: announce the assistant texting look's lines in MessagesTimeline.tsx (#879 item 17)

List only. The timeline's viewport gets data-fork-look="assistant" while
it shows the thread holding threadRoles.assistant and the device's
assistantChatView is on; the look itself is CSS scoped to that attribute
in fork files. The lines are spent by the wiring PR.

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

* wip: assistant texting look prototype (local only)

* Assistant texting look on web: setting, Settings row, docs and browser tests (#879 item 17)

The thread holding the assistant role is drawn as texting: the assistant's replies and its
send_to_user text are left bubbles with a small CSS face; the user's messages keep upstream's
bubbles. A per-device client setting `assistantChatView` (default on) turns it off. The three lines
#1316 announced in MessagesTimeline.tsx move from `announced` to `added`.

The browser test renders the real timeline and reads computed styles, so it fails if upstream's row
markup changes and the CSS selector stops matching.

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

* fork changes: name client.assistantChatView in its change file (#879 item 17)

fork-changes-list.test.cjs requires every fork setting in forkDefaults.ts
to be named by a file of docs/fork/changes/; the new setting had none.

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

---------

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

* model policy: check a slash command that expands a skill (#987 item 7)

A `/name` at the start of a turn's text (which a `$name` mention of a listed skill becomes) makes
Claude Code run the skill, forked on its frontmatter model and effort, without a Skill tool call,
so the PreToolUse hook never read it. The policy hook now also answers UserPromptExpansion: a
slash command is read as the skill of its name, like a Skill call, and a refusal blocks the
expansion before it runs. MCP prompts run inline and are not read.

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

* model policy test: take the hook's abort signal from Effect.promise

The expansion hook test built an AbortController inside the Effect
generator, which the Effect language service rejects
(abortControllerInEffect) and failed the server typecheck. Effect.promise
already hands its callback an AbortSignal; pass that to the hook.

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

---------

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

* fork: a PR a delegated child links is watched for its parent (#851)

With `childPullRequestWatch` on (off by default), a pull request that a
local delegate_task child links itself (link_pull_request, or one it
created) starts upstream's pull request watch on the child's parent,
through upstream's own PullRequestWatchService. Once per child and PR;
the parent's own list wins (a PR it already has, watched or not, is left
alone); links older than 10 minutes are not acted on, so a restart does
not re-watch a PR the parent has since unlinked. Counted as a fork
feature in the fork report and the Fork settings overview.

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

* fork: stop exporting two helpers only used inside childPullRequestWatch (knip)

knip's exports check failed the Lint job: handledKey and childLinksToWatch
were exported but nothing outside the file imports them.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…port) (#1174)

* 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 shared app-server gets
mcp_servers.<name>.enabled = false in its own per-request config for
every server config/read lists for its folder that the profile leaves
out (launch-argument and project servers included; T3's own entries
stay). Each turn first reads the thread's live servers and refuses,
saying why and the fix, when one outside the profile is still on. A
missing or broken profile, a server list T3 cannot read, or a thread T3
cannot match is refused, never started with every server. Logic in
apps/server/src/fork/codexMcpProfile.ts; two seam lines in the Codex
adapter (announced in step 1). Remote delegation stays Claude-only.

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

* MCP profiles part 5, fix round: check Codex-started turns, sub-agents and connectors

- Watch turn/started: a turn Codex starts on its own (a goal's next turn, a
  sub-agent's turn) gets the same check as turn/start; one that fails is
  stopped (goal paused, turn interrupted) and ends failed with the reason.
- Count Codex sub-agents as their parent's T3 thread (they copy the parent's
  loaded config, codex-rs child_config.rs), so their turns are checked too.
- Send features.apps=false when a narrowed profile leaves out codex_apps,
  which config/read never lists.
- A refused resume no longer becomes a fresh Codex session: the fallback
  start is refused once, so the history is kept.
- Tests for each, with Codex's real status words; docs updated.

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

---------

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

* heavy holds: #913 follow-ups and neutral example names (#917)

- A hold cgroup that is there without a memory controller (no memory.stat)
  holds its whole budgetMb with a note, instead of nothing.
- The room a hold keeps is its budget less the RAM it uses: memory.max
  limits RAM only, so swap is left out (in use still counts swap).
- Holds in or the same as another hold's cgroup are refused (the same
  room held twice); a reservation file named like a hold gives a note.
- Tests that fail without the code: at most 8 holds (9 distinct labels),
  memory.max "max" gives no "cannot be read" note, and one mutation check
  per fix.
- Neutral example names in the reservation-folder docs and test.

Fixes #913

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

* MCP profiles: T3 tool groups on T3's MCP server, for every provider (#827)

* MCP profiles: T3 tool groups on T3's MCP server, for every provider

MCP profile design PR 4. A profile's t3Tools now applies: one global
rule on T3's MCP server hides a T3 tool outside the calling thread's
groups from tools/list, refuses it on tools/call with a plain reason and
its fix, and keeps it out of tool_search. The groups are fixed as each
turn starts (Claude: as its query opens; other providers: the turn
check), so a running turn keeps its set and a change applies from the
next turn. A profile that cannot be worked out, or a thread T3 cannot
read, keeps only request_secret, send_to_user and tool_search.

Claude no longer refuses a profile whose t3Tools is a list, and a group
change gives its next turn a fresh process. Off Claude, a turn now
refuses only a profile that leaves out an outside server.

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

* MCP profiles: guard the T3 tool table against drift; a tool in no group is refused as a T3 bug

- personOnlySettings.test.ts: the T3 tool filter's table must hold exactly the toolkit folders'
  tools, each in its folder's group, and every group of MCP_T3_TOOL_GROUPS must have a tool there.
  Dropping a toolkit from the filter's hand list, or adding a group with no toolkit, fails CI.
- A tool in no group is still refused by any profile but all, but its refusal now says it is a T3
  bug to report, not a setting to change.
- docs/fork: profiles are not a sandbox (requests with no thread, such as the t3 thread CLI, are not
  filtered); the sets live per thread, not per credential.

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

* FORK_CHANGES: shorten the MCP profiles row so the table keeps main's widths

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

---------

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

* fork-kit/agent-guards: the machine's agent guard hooks as a kit (#834 G4) (#847)

* fork-kit/agent-guards: the machine's agent guard hooks as a kit (#834 G4)

Five Claude Code hooks that guard every agent on a shared machine, as one kit with one
installer, facts from the machine file and the same messages and exit codes as before:

- actions-disable-guard (PreToolUse Bash): no disabling of workflows, Actions or branch
  protection; fails closed (a missing or failing hook refuses, and says so)
- capacity-pipe-guard (PreToolUse Bash|Monitor): no pipe out of a capacity check
- memory-index-guard (Pre/PostToolUse): the auto-memory index stays inside its budget
- bg-guard (Stop): no stop while a background Bash command still runs
- agent-slots (UserPromptSubmit, Stop): slot and ready-queue context for orchestrators

The others fail open with a visible line. `agent-guards check` runs each wired command
with a case it must refuse and one it must pass; `--settings` writes a managed settings
drop-in. Shared bootstrap and kit_install contract tests cover the new kit.

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

* fork-kit/agent-guards: lens round 1 fixes for G4a

- actions-disable-guard and capacity-pipe-guard match Bash|Monitor; the
  memory-index after-call check matches Monitor too; check reports a
  guard wired for Bash only as missing.
- The owner's approval is a root-owned file with the hash of a one-time
  code (agent-guards approve); the session variable is no longer read,
  since nested sessions inherited it.
- Refuse starting a nested session without this machine's hooks
  (claude --bare/--safe-mode, CLAUDE_CODE_SIMPLE, codex).
- The closed hook sets onFailure block; an empty guard file refuses.
- A ruleset set to evaluate is refused like disabled.
- Each hook reads only its own part of the machine file section; bad
  keys and refuseScripts rows are dropped one by one and named to the
  agent; self-check does the strict check.
- Uninstall refuses while a foreign settings file names a hook or an
  older session runs; rollback is --no-settings.
- check --settings as root reads only a root-owned file; check runs
  hooks under a temporary HOME; self-check checks links, an open
  approval and passwordless ways to root.

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

* fork-kit/agent-guards: GraphQL ruleset update with EVALUATE in a variable is refused (lens B r2 minor 1)

The off word of updateRepositoryRuleset was looked for in canon() text, which blanks text with no cue
word, so `-F e=EVALUATE` (or a JSON variables block) was '' before OFF_WORD saw it. It is now read
without the cue words, as the REST ruleset body already was.

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

* fork-kit/agent-guards: an owner approval passes one command, in one folder, once (lens B r2 major 2)

`sudo agent-guards approve --command '<cmd>' [--cwd DIR]` now stores the hash of the
normalised command and the folder next to the code's hash (approval file version 2).
The guard passes only that command, ending in the marker, run in that folder, and
records the use in its state folder (O_EXCL link; the same tool_use_id passes again),
so the approval is used up. A code seen in a transcript, the app database or ps opens
no other command. A version 1 file counts as no approval.

Co-Au…
…mes, one module loader (#949, #844, #800) (#1101)

* fix(handoff): a completed handoff run does not alert through the relay (#612)

* fix(handoff): a completed handoff run does not alert through the relay

The relay's thread reads are wrapped in the fork's existing agent activity
seam: a completed run whose message is the handoff (its handoff: id, sent by
the server as an agent, no message of the person's in the run) reads as
upstream's stopped run, which the relay never alerts. The mark is stored with
the run, so a restart keeps it. Every other run, a failed handoff run, a
steered one and old or missing state alert as before.

The browser notice is not changed: the browser reads only the thread shell,
which upstream's ProjectionStore.ts builds, and that file may not gain fork
lines (fork-seams.json pending).

Part of #350

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

* fix(handoff): keep the person's turn alert when a handoff follows it

Part of #350. A handoff sent right at the turn end started inside the
relay's 5 s "finished" hold, so the relay dropped the person's alert,
and the quiet handoff run then left their turn with no alert at all.

- The service settles 10 s at a quiet thread before it sends, and reads
  again; anything busy in between restarts the settle. This covers the
  size backstop, a handoff that waited for busy work, and the idle timer.
- A handoff run is quiet only when it was requested at least the relay's
  hold after the person's run finished (stored times, so a restart keeps
  it). One requested sooner alerts as the turn's finish, once.
- The retry after a failed handoff run alerts when it succeeds: the last
  alert said "failed".
- A thread that is not completed costs no read (test kills the mutant).
- Docs: the settle, the quiet rule, the retry, and that the phone's card
  is cleared after a handoff.
- New end-to-end test through upstream's real relay and the real handoff
  service on one test clock.

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

* Handoff: settle on the relay's own view; alert when unsure

The quiet rule guessed that the relay had shown the person's finish
from the run's end time plus 5 s. Upstream's relay holds "finished"
longer while it shows more work: a running T3 child, an awaited PR
watch, a monitor wake, or a child's request answered later.

The settle now reads the thread as the relay shows it
(projectThreadAwarenessV2 on the awareness shell, with a live child's
request): at the start, every second, and on every request or run
event. Only a settle that saw "finished" at every check sends a quiet
handoff. Otherwise, or when a read fails, the handoff message id ends
in ":loud" and the quiet rule lets that run alert. The mark is stored
in the message id, so a restart keeps it.

The 10 s settle is a fixed sleep, not a wall-clock compare. A late
update that takes over a newer run, or busy work, starts it over.

Tests: the reviewer's repro (relay-visible work that comes and goes,
a child approval answered at 3, 7 and 12 s, a PR watch), a running T3
child at the turn end, a monitor wake, a child request between two
events, busy work in the settle, a later turn taken over, a failed or
missing relay view, the ":loud" parse, its quiet rule over the store
and a restart, and its busy check and retry. 13 of them fail on the
old code.

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

---------

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

* Shard the Fork kit tests by weight; stale weights fail; faster slow kit tests (#630)

The Fork kit tests job reached 8 to 9 of its 10 minutes and once timed out.

- kit_tests is a matrix of 3 shards. fork-ci-tests.cjs takes
  FORK_CI_TEST_SHARD=<i>/<n> and splits the part by weight (heaviest first
  onto the lightest shard). The split is the same in every shard, so each
  test runs exactly once. An empty or bad shard fails.
- The root steps (gh-apps as root, heavy with a real systemd user manager)
  move to their own job, kit_root_tests. fork-ci-result needs it.
- A weight far from a test's time now fails the job instead of leaving a
  notice. The time is measured against the run's own speed (the median of
  time/weight), so a slow runner does not fail it. The log and the summary
  give the weight to write. Weights are refreshed from CI times.
- pc-agents setup/update tests: the fleet walls' describe subprocess
  (most of each setup run) runs for real once per test and is reused after
  that. setup is about 220 s -> 150 s and update 167 s -> 73 s locally.
- no_hang waits 5 s, not 20 s. The bodies take under 0.4 s; a blocked FIFO
  mutant waits out the whole limit. kit_install and golive install each
  save about 30 s.

Fixes #623

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

* run records: refuse long estimate tags, accept 2ktokens, fix summary end date (#598) (#615)

- An estimate tag over 80 characters, or with no closing bracket on its
  line, is now refused (kept cut to 80 characters, logged, counted)
  instead of silently ignored. A kind over 80 characters is cut, not
  dropped.
- A token scale written against the word "tokens" (2ktokens, 2Mtokens,
  300ktok) is read; "2 tokens tokens" is now refused.
- The summary header names the last day in the window, not the
  exclusive end.
- Tests pin the reader's split multi-byte letters (all lines compared)
  and the unreadable-file error (chmod 000, skipped as root).

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

* Walls follow-ups: launcher refuses account files, checks applied stop timeouts (#632)

Issue #613: the launcher refuses the account and LAN-host files (passwd-,
group-, subuid/subgid and backups, hosts.allow/deny, networks, ethers,
/var/backups, /var/log, /var/lib/extrausers and their folders) itself; the
walls name where a line is (older launcher: re-run the installer; else
ALLOW_PATHS or the JOB_PATHS file); `mounts` finds a secret entry bound or
hard-linked at another path by device and inode; job_etc refuses a link or
non-file where it writes passwd, group and hosts; the probe wants a line of
its own in passwd and group. Tests for the untested paths, the stray owner
check, the walls-before-agent order, a skipTest wrapper, and the installer's
wording for a file the last release had.

Issue #365 item 1: after systemd-run, start reads the unit's applied
TimeoutStopUSec and TimeoutAbortUSec and kills, stops and refuses a unit whose
stop timeout is endless, over STOP_MAX, missing or unreadable.

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

* Kit installer: walk to the golive state folder trusts no link or folder another user could have placed (#631)

* Kit installer: walk to the golive state folder trusts no link or folder another user could have placed

uninstall's walk to <stateDir> now opens each step as O_PATH with no link followed and checks it:
- a link of root's is followed only from a folder of root's that no one else may write in;
- below the first folder that is not root's, every folder has that same owner;
- no folder may be on FUSE, or on a filesystem whose type /proc/self/mountinfo cannot tell.
An existing lock and journal are opened in the folder the walk reached, never by path. The child that makes
the lock closes root's other open files before it drops rights, has /dev/null as stdio, and is killed and
reaped after CHILD_SECONDS or when root's run ends first. stateDir is normalized as golive normalizes it.
Tests for each point, and RedCheck rules for the mutants that survived the #602 reviews.

Fixes #617

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

* Kit installer: kill the surviving walk mutants; check the lock and journal file itself

From the two reviews of #631 (both SAFE):
- The same-owner test now runs with /, /var and /var/lib shown as root's,
  so carrying the owner down the walk is what refuses (it survived its
  mutant because the fake host's / was the test user's).
- New tests, each with a RedCheck rule: root's check of the folders the
  child made (another user's folder or FUSE swapped in), / on FUSE,
  /dev/null on fds 0 and 2, an fd above the kept ones closed, the journal
  read where no lock is made.
- The lock and journal are looked at as a path only first: a filesystem
  mounted on the file refuses; then that same file is opened through
  /proc/self/fd, O_NONBLOCK (a lease of the T3 user's makes it refuse at
  once, tested).
- The lock child runs in a session of its own (setsid).
- journal.jsonl is read up to 64 MiB; over that it refuses with a message.
- The child-kill test registers its cleanup before each run, so a broken
  guard in RedCheck leaves no process behind.
- README: upgrade note for hosts whose stateDir goes through a link of the
  T3 user's (they now refuse uninstall).

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

* Fork CI: golive install test weight ~168s (it grew with the #617 tests)

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

---------

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

* fix(cleaner): keep when the mount list is old, on layered filesystems; private test temp (#635)

* fix(cleaner): keep when the mount list is old, on layered filesystems; private test temp

compress-cold and dedupe read the folders above a configured folder for a
KEEP file or a git folder, using a mount list read once. Three gaps (#624):

- A mount taken away, put over a folder or moved after the list was read:
  its mount point was read as "no marker". Each folder the walk passes is
  now opened and the kernel's mount id (fdinfo mnt_id) and device must match
  the list's line, before and after its markers are read; a mismatch, a
  changed folder or an unreadable id keeps it.
- overlay, aufs and FUSE union/bind filesystems show folders of other
  filesystems with mount root /, so a marker behind them was missed (fail
  open). A folder on one, or below one, is now kept ("could not read") unless
  its entry says "layered": true (a new key, false by default).
- The engine, report and daily tests failed under a group-writable TMPDIR,
  and the daily example test under a TMPDIR inside the default agent-scratch
  root. The fixture now picks a temp folder that no other user can write in
  or above, and the example test names its own scratch root.

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

* cleaner: allow list of local filesystems, read the mount list again (#624)

The folders above a compress-cold or dedupe folder are now trusted only on a
local filesystem whose mount root tells the whole story (guard.LOCAL); any
other type (overlays, FUSE, network and VM shares, autofs, unknown) keeps the
folder unless its entry says "layered": true. Markers are looked up through
the folder opened for the kernel check (lstat with dir_fd), and at the end of
the walk the process's own mount list is read again: every line used must be
unchanged, so a reused mount id with another root or device keeps it.

Tests for the 'above' case, an own list without ids, each list entry, the
link swap, markers through the fd and the re-read; the reviews' surviving
mutants are in the red check.

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

---------

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

* fix(mcp-profiles): a task delegated to another machine carries its parent's profile (#532) (#611)

* fix(mcp-profiles): a task delegated to another machine carries its parent's profile (#532)

A remote delegate_task now sends the delegating thread's resolved MCP
profile in delegatedFrom.mcpProfile, and the receiving machine cuts the
task's own profile for its role down to it, as a local child is cut to
its parent: t3-only or [] stays, two lists keep only the names both
name, and it never gets more than that machine's own profile. An owner's
pick for the task there stands. A carried profile the receiver cannot
read (a field it does not know, no name) refuses the turn rather than
widening; a sub-agent there of such a task is refused too.

An older receiver drops the field, so a profile narrower than all goes
only to a machine whose descriptor says mcpProfileCarry: otherwise the
call is refused (capability_denied) before anything is sent, and an
unreachable machine refuses it as well. This runs before the
uninterruptible launch, so a stop while asking launches nothing. A
thread with all delegates anywhere, without asking. A task from an older
sender carries nothing: it keeps this machine's profile for its role and
the server log says so.

Upstream-file lines (pinned in .github/fork-seams.json, announced in the
list-only pull request before this one): the optional delegatedFrom
field and descriptor capability, the capability set here, resolve
returning the capabilities it already reads, four lines in
RemoteDelegation.ts and one upstream test expectation. The logic is in
fork/remoteMcpProfile.ts, fork/mcpProfile.ts and fork/claudeMcpProfile.ts.

Fixes #532

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

* fix(mcp-profiles): the person-only setting guard skips only the carried profile a linked machine sends

The carried profile in delegatedFrom is kept only on a linked machine's
stamped call and only narrows, so the guard skips that one path (also in
a nullable schema) and still catches a person-only key beside it.

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

* MCP profile carry: ask the linked machine at its own fork route, not its descriptor

The descriptor capability needed a change to a file the schema check guards. The delegating
machine now asks GET /api/fork/features with the link's token; only a linked machine's token is
answered, everyone else gets the plain 404, and an older T3's app page reads as no features.

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

* fix(mcp-profile): refuse a child of an unreadable parent; one deadline for the features answer

- A parent thread the store cannot give may be a task another machine
  delegated with a narrower profile, so its sub-agents are refused
  whatever the settings, unless the owner picked a profile for that very
  thread. With no thread store wired (the adapter built alone), the old
  rule stays.
- The features request now runs under one deadline that covers the body
  too, so a machine that sends headers and then stalls refuses the task
  instead of holding it open.
- Tests: an unreadable parent and sub-agent are refused (and the owner's
  pick still stands); a stalled body is refused; a redirect to an address
  that answers yes is not followed; a 500, 404 or 201 answer reads as no
  features.
- Docs: an unreadable parent refuses; t3_thread_read shows the carried
  profile; the 404 does show the server is the fork.

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

---------

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

* Handoff: let idle compaction run when the handoff's instance cannot run (#634)

* Handoff: let idle compaction run when the handoff's instance cannot run

A thread is handoff-owned only when its handoff can run: the handoff's
model instance (the chosen modelSelection, else the thread's own) is
enabled for the thread's project and registered. One shared function,
threadHandoff, decides this for both the idle compaction wrapper and
HandoffService, and every step (turn end, idle wake, settle, retry)
checks again, so nothing is remembered between checks.

A disabled instance is still registered and the start-immediately send
path does not check "enabled", so before this a handoff could run on a
provider that was turned off.

The "not remembered" test now builds one wrapper, reports the run twice
and clears the missing state in between, so a remembered set of missing
threads fails it.

Fixes #608

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

* Work gate contract: list the handoff's registry check; sort both sides alike

The handoff now looks up its instance in ProviderAdapterRegistryV2 only to
check that it is registered; the handoff send stays an outbox effect.
The contract sorted found files with localeCompare but expected lists
with code-point sort, so names differing only in case (handoffOwner vs
HandoffService) never matched. Both sides now sort the same way.

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

* Handoff retry: also check the run's own instance (#608)

The retry after a failed handoff run sends on the run's own model, but
only the instance the current setting names was checked. With the setting
moved to another instance and the run's instance turned off before the
run failed, the retry started a run on the turned-off provider. The
retry now also checks the run's instance with the same rule
(handoffInstanceBlocked, split out of threadHandoff); off or not
registered means no retry. No stored state: the run carries its model.

Tests: the retry case (turned off / removed, then back on); two
runnableCases rows with the thread on another instance and no model set
(kills a hard-coded claudeAgent fallback); a short timeout on the test
that hangs without the registry check. Docs list the mirror "neither
acts" gap.

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

---------

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

* model-guard: pin each built-in driver's effort option id; fail closed for unknown drivers (#629) (#638)

* model-guard: pin each built-in driver's effort option id; fail closed for unknown drivers (#629)

- DRIVER_EFFORT_IDS: the id each of T3's built-in drivers reads its effort from
  (codex reasoningEffort, opencode variant, pi thinking, fx effort, grok/kiro/muse
  reasoningEffort, Claude effort). A pick must name its effort there.
- A row with efforts whose driver has no pinned id (cursor, antigravity, acpRegistry,
  custom drivers) and no effortOptionIds refuses every T3 pick; the self-check names it.
- Claude rows: thinking and fastMode only true or false.
- otherOptionIds never holds the driver's own effort id or an OpenCode agent.
- Contract tests read BUILT_IN_DRIVERS, each driver's kind and effort read, and
  Claude's ids from claudeModelOptions.ts; the files join the three sparse lists.
- Tests for each NOT_OTHER word, old policies and old pick shapes; README updated.

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

* model-guard: exact driver kinds, no agent option as an effort id, a stricter driver-list contract (#638 review)

- A row whose driver is a built-in T3 kind in another case or with spaces
  around it ("Codex") makes the policy invalid: a pick with no driver could
  run on that driver's instance, which reads other option ids (lens B 1).
- An opencode row's "agent" and a kiro row's "mode" (Kiro's agent switch)
  are refused in effortOptionIds as well as otherOptionIds (lens A 1, B 3).
- The contract test fails on any BUILT_IN_DRIVERS entry it cannot read, such
  as a spread (lens A 2), and reads Kiro's agent id from T3's code.
- A test pins that the true/false rule is for Claude rows only (lens B 6).
- README: driver-kind and agent-option rules, the slug gap for any driver,
  inherited options on delegate_task, levels a model lacks, the upgrade
  step (self-check before updating), and the three jobs' sparse lists.

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

---------

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

* run records: first closed tag decides, cut whole characters, strict --to (#619) (#639)

* run records: first readable estimate tag wins, cut whole characters, strict --to (#619)

- An earlier mention of [run-estimate: no longer hides a later tag that reads;
  with none that reads, the first is refused as before. An unclosed tag ends at
  the next [, for run-kind too.
- Tag length and cuts count graphemes, so a cut never splits an emoji.
- --to takes only a real YYYY-MM-DD day.
- Tests pin that an empty refused tag is logged and counted.

Fixes #619

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

* run records: first closed tag decides, refuse typos and empty kinds (#619)

Review of #639: "the first tag that reads wins" let a later example
replace a real tag with a typo ([run-estimate: 30-40m] then
[run-estimate: 1h 2M tokens] recorded 1h). Now only unclosed and
too-long openers are passed over; the first closed tag that fits
decides, and is refused (kept, logged, counted) when it is empty or
does not read.

The kind tag follows the same rule: an empty closed kind, or (with no
closed tag) an unclosed one such as [run-kind: lens [x]], is refused,
kept in a new optional kindRefused field, logged and counted in the
summary, instead of being dropped silently.

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

---------

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

* Pacing advice: honour enforce's back-off, exact scan wording (#642)

In advise mode the note said "enforce would first scan this folder" even
while enforce was backing off after a scan with no result, when it would
not scan. The advice now reads the back-off and gives the same reason
enforce would give. The scan note now says "if it lists the model and the
task can run there", since a listed model can still be refused for its
options or runtime mode.

Tests: an advise call with a current list that lacks the model, enforce
then advise within and after a back-off, and the "lets this effort run"
and lower-effort notes in enforce with the scan mark set.

Fixes #628

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

* Fork kit shards: workflow quiet-failure contract, shard slow warning, pinned mutants (#633) (#645)

- fork-contracts: no continue-on-error anywhere in fork-tests.yml, no if: on a step that runs fork tests
- fork-ci-tests.cjs: judge() out of main (tested); a warning when a shard takes over twice its expected time
- weightNote boundary and exact-message tests
- setup.test.py: the killed-upgrade test compares files with a whole run's; same_wsl2_walls docstring says which tests do

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

* head gate: review trigger live check as a setup step, release note, warning on odd run fields (#379) (#650)

Items 1 to 7 of #379 are on main (#392, #406). Item 8, the live check, needs a project that
copies the trigger, so it becomes a written setup step (README step 8) and part of a new
release-notes entry for the trigger, which every ci/v15+ release ships without one. A review
run whose head fields are missing or odd now judges nothing with a ::warning:: instead of a
plain log line, so a live mismatch of GitHub's fields is seen rather than staying green.

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

* Delegated results: remind for linked children a stop lost, and tighten the reminder (#641)

* Delegated results: remind for linked children a stop lost, and tighten the reminder

- At start, read each linked environment's threads made before the start; a parent here
  that one names as delegatedFrom but no task follows gets one queued message (ids from the
  orphans, so a rerun or the next restart never repeats it). Retries while an environment
  does not answer or the parent is busy.
- The startup check also finds parents with unread results but no reserved wake.
- Results with no delivery state count as unread for a day; an open question holds the
  reminder, background work does not.
- task_list: a linked child still running there is read there; one timeout marks the rest
  of that environment unknown; the orphan search says when it read only the newest threads.

Fixes #625
Part of #386

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

* FORK_CHANGES: link the delegated results follow-ups on their row

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

* Delegated orphans: name each orphan once, queue for busy parents, log what is left

- Each orphan gets its own key in the message and command ids; before a send the
  scan reads the parent's sent message ids and accepted receipts, so a grown set
  (late machine, moved one-day window after a restart) sends only the new ones.
  At most 10 orphans per message; the first scan's per-set id still counts.
- A busy parent (also one waiting on a question) is no longer held: the queued
  message is read once its run ends. Orphans are worked out first, so a busy
  parent with none forces no rescan.
- A later page that does not answer is its own state (cut-short): scanned again,
  and named in task_list's next. After the last scan a warning names the
  environments and parents still unchecked. The page-limit line says so.
- Neutral wording (a failed record also leaves an orphan), a minute's clock
  tolerance between machines, a test for the held-start skip, and the upstream
  gap in the docs.

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

---------

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

* MCP profile carry: per-machine refuse, Claude-only docs, no-store rule (#640) (#648)

* MCP profile carry: per-machine refuse, Claude-only docs, no-store rule (#640)

- New setting mcpCarriedProfiles ("apply" default, "refuse"). With refuse,
  GET /api/fork/features answers mcpProfileCarry: false, the sender refuses
  a narrower-profile task before sending, and a task that still arrives
  with a narrower or unreadable carried profile (and its sub-agents) is
  refused at its turn. A carried all, nothing carried, or the owner's pick
  for the task run as before. No value lets a task get more tools.
- Docs say plainly that only Claude threads apply profiles, carried
  tasks included.
- The adapter's no-store exception now applies only when neither a thread
  store nor a settings service is wired (default settings, so nothing can
  narrow). With settings but no store, a thread with a parent is refused.

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

* Docs: settings table row for mcpCarriedProfiles (#640)

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

---------

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

* fork-seams: list packages/contracts/src/reviewRules* as fork files (#652)

reviewRules.ts and its test are fork files (#291 added them), but forkFiles did
not name them, so a pull request that changes them (#647, for #302) is judged as
changing an upstream file. A pull request is judged by its base's list, so this
list-only change goes first.

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

* reviewRules: follow-ups from #291's lens (kept text, null, lens names) (#647)

* reviewRules: follow-ups from #291's lens (kept text, null, lens names)

- A project save takes back kept unreadable reviewRules text only when it
  is the text stored for that project (server save check); other text, text
  for a project that stores none, or a stale client's after a fix elsewhere
  is refused.
- A hand-written project null reads as not set (the server's) for
  reviewRules, playtest and handoff: Schema.Null comes first in the union.
- A lens name may not be an Object.prototype key (constructor);
  effectiveReviewRules builds lensRunners without a prototype, and
  reviewLensRunner looks a lens up with Object.hasOwn.
- Tests for the resolver's unreadable guard and the kept-value key
  whitelist; decidedIn points at #291.

Fixes #302

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

* fix(settings): a project's null for playtest, handoff and reviewRules reads as the server's

A hand-written project null decodes as the key left out, and a client's
clear (null) is dropped from upstream's part of the patch, so the resolver,
PlaytestService and the web panels never see null; they get the server's
value. The kept-text tests now send values through a JSON round trip, as
a real client does. Docs say that old files holding a project null change
from off to the server's value.

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

---------

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

* fleet: launcher reads every kill setting, checks its kill; walls list more account files (#636) (#649)

- start reads RuntimeMaxUSec, RuntimeRandomizedExtraUSec, KillMode, SendSIGKILL,
  FinalKillSignal and LoadState next to the two stop timeouts; each must be printed
  once; a collected unit (LoadState=not-found) has nothing left to check
- "killed" only once ActiveState shows the unit dead; else "could not kill it"
- job_etc refuses a FIFO at passwd, group or hosts instead of hanging on it
- never() and the walls' lists add passwd*/group*/hosts* backups, hosts.equiv,
  /var/mail, /var/spool/mail, /var/lib/sss, dnsmasq.leases, /var/lib/dhcp
- walls: inodes of every /etc/**/private folder; a mixed refusal names both fixes
- tests: hours and longer, kill check, FIFO, two-way list sync; docs name the limits

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

* head gate: review run log tells a skipped branch name from odd fields, counts the listing (#651) (#657)

- A head branch git allows but the gate does not look up (a no-break or
  zero-width space, an emoji joined by a zero-width joiner, longer than 255)
  now gets a plain line that says so, not the warning that blames GitHub's
  fields. The warning stays for missing or malformed sha, repository or
  branch (a branch with a control character git refuses), and names a
  deleted fork as the one known harmless cause.
- "no open pull request has the head" says how many open pull requests
  GitHub listed on that branch, so setup step 8 can tell a wrong filter
  (none listed) from a wrong head sha or repository (some listed).
- Release notes: the trigger's Upgrade needs a pin at ci/v15 or later (not
  "a release that has this entry"); the refused pin is ci/v14 or before; the
  #379 warning is after ci/v20 (that tag does not have it).
- The docs test checks "is refused" too.

Part of #651.

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

* Pacing advice: scan of a folder still loading slash commands (#644) (#659)

advise answered from a current model list even when its slash commands
were still loading, so the note said "enforce" would hold. enforce scans
that folder first (the registry probes any snapshot that is not settled).
advise now answers from the list only where enforce would: during a
back-off, or from a settled list; otherwise it marks the scan.

Tests: the loading case in both modes, advise's own clock-jump case, and
the test helper refuses a settings change combined with unreadable
settings instead of dying on the mock.

Fixes #644

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

* MCP profile carry: Claude-only docs, no empty name, fail closed, required key (#653) (#658)

- docs: the mcpCarriedProfiles section says a refused task is refused on
  Claude only; Codex and other providers still run it with every tool.
- A refusal no longer shows profile "" when the carried value has no name.
- When the settings read fails and settings.json does not decode, the
  fallback reads mcpCarriedProfiles as refuse, so a narrower carried task
  is refused rather than cut.
- mcpCarriedProfiles is required in McpProfileSettings.

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

* Project null settings: file encode drops a null; explain the split and the save step's clear (#654) (#662)

- nullReadsAsUnset: encode drops a null too, so no future path can write
  one back to the settings file. The patch keeps its own schema, so a
  client's clear still sends its null.
- splitForkSettingsPatch: the comment says the left-out key is removed by
  upstream's merge only, and that the fork's server save must get the
  unsplit patch to see the clear.
- keepLeftOutForkProjectKeys: the null half of the clear branch stays, so
  the step is right on its own; a test pins it (it was an equivalent mutant).

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

* Announce the MCP carry call that passes the launch's instance (#668)

The carry call in RemoteDelegation passes the launch's scope, target and
instance, so the sender can refuse a narrower profile to an instance whose
driver does not apply one. Announced here; the pull request for #661 moves
it to "added" and drops the old call line.

Part of #661

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

* Move the slot gate's active-run read out of ProjectionStore (#663)

The slot gate counted running agents with a fork option on upstream's
ProjectionStore.getShellSnapshot (activeRunOnly). That read now lives in
the fork file apps/server/src/slots/ActiveRunShells.ts: one read-only
transaction finds the threads with a run in an active status (index
scan), reads upstream's shells of just those threads, and keeps the ones
whose shell shows an active run. ProjectionStore.ts and
ThreadManagementService.ts are back to upstream, so their pending
ceilings and lost counts leave .github/fork-seams.json in this same
change (the seam check needs a ceiling lowered with its lines).

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

* Announce the quiet handoff run's ProjectionStore seam lines (#665)

* Move the slot gate's active-run read out of ProjectionStore

The slot gate counted running agents with a fork option on upstream's
ProjectionStore.getShellSnapshot (activeRunOnly). That read now lives in
the fork file apps/server/src/slots/ActiveRunShells.ts: one read-only
transaction finds the threads with a run in an active status (index
scan), reads upstream's shells of just those threads, and keeps the ones
whose shell shows an active run. ProjectionStore.ts and
ThreadManagementService.ts are back to upstream, so their pending
ceilings and lost counts leave .github/fork-seams.json in this same
change (the seam check needs a ceiling lowered with its lines).

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

* Announce the quiet handoff run's ProjectionStore seam lines

List-only: names the three lines the next change adds to upstream's ProjectionStore.ts, so the
thread shell reads a completed quiet handoff run as a stopped run in both its reads.

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

---------

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

* Quiet handoff run: no browser notice (#666)

A completed quiet handoff run now shows in the thread shell as upstream's
stopped run (latestRunStopRequested), in both of the shell's reads: the
JavaScript one (threadShellFromProjection) and the SQL one
(selectShellThreadRows, which the shell and awareness snapshots use). So
the browser's ThreadNotificationCoordinator keeps upstream's quiet gate
unchanged and gives no notice, as the relay already did.

The rule lives in the fork file fork/handoff/handoffShell.ts
(isQuietHandoffRun moved there from handoffQuiet.ts, which imports
ProjectionStore and so cannot be imported by it), with its SQL mirror.
ProjectionStore.ts gets three seam lines: the import, a spread after
upstream's latestRunStopRequested, and the SQL fragment before
upstream's stop-request EXISTS.

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

* fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list (#660)

* fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list

A delegate_task or create_threads pick that names its model no longer
inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's
delegation checks drop it on a fresh dispatch (a retry passes untouched),
unless the call names the option itself. The model guard never sees an
inherited option, so it could not refuse it.

The self-check now compares each claudeAgent row's efforts with the
levels T3's model list offers the model (and ultracode when the model has
the ultracode option). A level the model does not offer, a model with no
option list, an unreadable list or no list named is a problem; a model not
in the list is a note. A contract test keeps the server's agent option ids
and the guard's list in step.

Fixes #643

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

* model guard follow-ups: a child keeps only the options its call names

While a model policy is on (server setting modelPolicy, advise or enforce),
a call that names its model keeps from the parent only the options the call
names, on every launch path: local delegate_task (both seats, and the target
the usage pacer moves to), create_threads, and remote delegate_task. One
shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent
option ids. A call that names no model, a retry of an accepted call, and every
call with the policy off keep upstream's inheritance, so upstream's own
inheritance tests stay as they are. An unreadable setting applies the rule.

The tests move out of upstream's OrchestratorMcpService.test.ts into
fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line
(pending ceiling 35 -> 34).

Self-check: T3's model match order (exact slug, then the first alias), an
ultracode choice stands for xhigh, only a select offers levels, and a model
list that names none of the policy's models is reported. README fixes.

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

* model guard follow-ups: keep modelPolicy.ts as on main

Its header comment is not a seam line; the docs say what reads the setting.

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

---------

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

* Refuse a narrower MCP profile to a non-Claude instance; one settings fallback (#669)

* Announce the MCP carry call that passes the launch's instance

The carry call in RemoteDelegation passes the launch's scope, target and
instance, so the sender can refuse a narrower profile to an instance whose
driver does not apply one. Announced here; the pull request for #661 moves
it to "added" and drops the old call line.

Part of #661

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

* Refuse a narrower MCP profile to a non-Claude instance; one settings fallback

A remote delegation with a profile narrower than all now asks the linked
machine's orchestrator_capabilities which driver the launch's instance runs,
and refuses before sending unless it is Claude, the only provider that applies
a profile there. Under either value of the receiver's mcpCarriedProfiles.

Claude turns, a delegation's check of its own profile and the features route
read MCP profile settings the same way: settings.json is checked on each read,
and one that does not decode (also one broken at load, or with legacy keys the
load refuses) reads mcpCarriedProfiles as refuse, the policy's locks on top.
Only "apply" reads as apply; any other value reads as refuse.

Refusals say more: an unreadable carried profile no longer advises apply, and
a sub-agent's refusal names the reason at the top of the chain once.

Fixes #661

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

* Seam list: the carry line is added now, not announced

The merge of main (with #668's announcement) left the line in both
"added" and "announced", which the seam check refuses.

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

---------

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

* Wait on the stored renewedAt, not the renew's finished line (#673)

A renew step logs `finished|renew` before it exits, and the service
stores renewedAt only after the process returned and it got the lock.
The thread-read-hangs test waited for the second finished line and then
read renewedAt, so it could read before the store write (CI flake).

- renewedSince(): waits on the stored renewedAt (set, and past a given
  earlier value); used by every renew test that read the session after
  waiting on the finished line.
- The failing-renew lapse test waits on the stored problem (a different
  exit code per try), not on the finished line.
- runnerControl.holdNextReturn holds a step's answer after its process
  exited; a new test uses it to show the finished line is there while
  renewedAt is not stored, that a sweep meanwhile starts no second
  renew, that a T3 stopped there stores no renew, and that a T3 started
  after the write reads the same renewedAt.

Fixes #671

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

* Fork CI contract: list-driven test steps, hidden exit status, shard warning and file-mode checks (#646) (#655)

* Fork CI contract: list-driven test steps, hidden exit status, shard warning and file-mode checks (#646)

- quiet contract: every test .github/fork-ci-tests.txt lists as run by
  fork-tests.yml must be run by a step's own command (python3, node or bash
  with the test's path as an argument). A fork test step may not have an if:,
  a working-directory, a shell other than bash, cd/pushd, trap, set +e/+o, a
  pipe, ||, a background &, or anything but its own command on the test's line.
- fork-ci-tests.cjs plan(): a runner file's comment lines no longer name a test.
- main() takes a fake runTest and clock; a test pins the ::warning:: line, the
  summary's Slow line and the 60 s boundary.
- pc-agents tests compare files by kind, mode, owner and content
  (same_files()), with a check that a mode change is seen.

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

* Fork CI contract: test steps held to an allowlist, comment-proof plan(), group in same_files()

A step that runs tests is now held to an allowlist instead of a blocklist of
shell tricks: its run is only lines of the allowed test forms, its keys, env
and if: come from a fixed set, its job has no defaults, env or container and
no step that writes GITHUB_ENV or GITHUB_PATH, and the workflow has no
defaults or env. Each listed test must be run whole, with the variable that
switches it on. fork-tests.yml moves its set-up lines into steps of their own.

plan() also drops trailing and block comments, readList spells `run by`
paths one way, same_files() compares the group, and the lint-flagged issue
numbers are gone from the test comments.

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

* Fork CI contract: runner parts from the accepted lines, sudo env only for root tests, string-aware plan()

- The check that each listed or present test is in exactly one runner part moves into the contract and reads the
  runner calls from the same parsed, accepted test lines (YAML parsed, quotes removed), job by job, with the
  runner's own inPart. A call kept in a YAML comment, a step name or a comment line counts for nothing. The
  raw-text reader in fork-ci-tests.test.cjs is gone.
- `sudo env` is accepted only before python3 and only for the tests REQUIRED_VARS marks as testing as root.
- plan() reads a JS/TS runner file with a small tokeniser (strings, template literals with nested ${}, regular
  expressions), so `'**/*'` in upstream's release-smoke.ts starts no comment.
- A step is a test step only by its code lines; a refusal says what made it one; a trailing # comment gets its
  own reason; "names a test but runs none" names the allowed forms; the docstring matches the rules.
- setup.test.py says when the group part of the killed-upgrade self-check is skipped.

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

* Fork CI tests: jsCode's comment within the 4-line limit

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

---------

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

* pr-queue: notify_command runs once per notice on an armed PR it passes over (#129) (#674)

* pr-queue: notify_command runs once per notice on an armed PR it passes over (#129)

An armed PR that goes red, gets stuck or conflicts is told on the PR, but
nobody with GitHub notifications off learns of it. A new optional config key
notify_command (argv, no shell) runs right after the queue posts such a
notice, with repo, PR, head, kind, reason and link. The posted comment is
the record, so later runs, restarts and other runners never run it again
for the same head and reason. A missing, failing or hanging command
(notify_timeout_seconds, default 30, then its session is killed) is a
warning and never holds the queue. The command gets no token.

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

* pr-queue notify: say the command is not a sandbox

The command's own environment holds no token, but it runs as the queue's
user, so it can read the queue's environment through /proc and the
checkout's saved token. Say so in the README and release notes.

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

---------

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

* Slot gate: pre-select can no longer drop a running agent (#676)

The gate's pre-select copied upstream's active run statuses, so a status
upstream adds or starts to count as active would drop those agents from
the count with no test going red. It now leaves out only upstream's
finished statuses (isTerminalRunStatus) and lets upstream's own shell read
decide by activeRunId. A test walks every run status against upstream's
shell read. If upstream renames the run status index, the read logs an
error once and counts without it instead of failing and letting every
delegation through. A file-database test covers the reader path.

Also: drop quietHandoffAwareness (the shell already carries the quiet
handoff mark, one rule in handoffShell.ts), and note under the handoff
Limits that a browser offline across the turn end misses that notice.

Fixes #670

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

* Announce the MCP profile turn check's server.ts seam line (#677)

Lists the one server.ts line that wires fork/mcpProfileTurnCheck.ts
(the next pull request, for #672) under "announced", and says in the
entry's "why" what it changes.

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

* Fleet walls: follow-ups from #649's reviews (#667)

* Fleet walls: follow-ups from #649's reviews

start gives systemd-run until START_BY (80 s after the launcher began)
and checks Type=exec, so a Type= drop-in that keeps systemd-run waiting
is killed and refused instead of outliving the agent's limit unchecked.
kill_unit keeps the kill's exit status and says "killed" only once the
unit is inactive or failed with no cgroup left. The not-found skip also
needs ActiveState=inactive and no cgroup. job_etc refuses any entry
already at the target before the write. The walls' mounts message puts
the way out before the paths. More DHCP lease folders are refused. A
link named private under /etc is not followed. span_ms has one guard,
with a test; the two-way never() list test also checks the die count
and every $1 line's shape.

Fixes #656

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

* Fleet launcher: kill what a failed systemd-run started; shellcheck in CI (#667)

Fix round for #667's two reviews (#656 follow-ups):
- start: a systemd-run that fails (any exit but the deadline) has its unit
  killed and checked like a deadline miss; "nothing started" only once the
  unit is inactive or failed with no cgroup and its runner user has no
  process left (older systemd lets the cgroup go anyway). Exit 137 is the
  deadline too; never `timeout 0`: under START_MIN (10 s) left, nothing
  starts.
- kill_unit: each systemctl call bounded (CALL_MAX 5 s, none past KILL_BY
  92 s); reads with `show --all`; says "gone" when there was nothing to kill.
- walls: a link named private under /etc makes what it leads to secret,
  not the folders above it.
- job_fs: the folders on the way to a view link are 0755 (mkdir -p -m set
  only the last one, under umask 077).
- CI: shellcheck (pinned, checksummed) on the launcher in the workflows job.

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

---------

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

* fork CI: fleet test weight ~136s (it grew with #667's launcher tests) (#685)

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

* Slot gate pre-select: no forced index; one-transaction and fail-fast reader tests (#678) (#683)

- The pre-select names no index. SQLite picks upstream's (thread_id, status)
  index on its own; a renamed, dropped or partial index now only slows the read.
  Before, a partial index under the same name failed the read ("no query
  solution") and the gate stopped counting. The existence lookup, the error
  log and its flag are gone.
- Tests: the query plan uses the index before and after ANALYZE; the count
  holds with the index dropped, renamed or made partial; a write committed
  between the id read and the shell read is not seen (one state); the reader
  test fails in 10 s with a message instead of a 120 s hang.
- Docs: what an index change and a failed upstream read do.

Fixes #678

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

* Refuse a narrowed MCP profile at turn start on a provider that cannot apply it (#679)

* Refuse a narrowed MCP profile at turn start on a provider that cannot apply it

A thread whose MCP profile is narrower than "all" no longer starts (or
resumes) a turn on Codex or any other provider but Claude, which would
give it every MCP server and T3 tool. The check runs on the machine that
runs the turn, as it starts, by wrapping upstream's provider instance
registry (fork/mcpProfileTurnCheck.ts, one server.ts line), so every
route is covered: a provider switch, t3_thread_launch, a local
delegation and a task from an older sender.

Also: a remote delegation that names a driver asks the other machine's
provider list once; doc comments moved above the code they describe;
the README says null reads as apply for mcpCarriedProfiles.

Fixes #672

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

* MCP profile turn check: keep sessions live, look up named remote instances

- Wrap each non-Claude instance, adapter and session runtime in a
  delegating proxy instead of an object spread, so getters such as
  providerSession stay live for every thread, profile all included.
- Check compactThread as well as startTurn and resumeTurn: some
  providers compact by sending a /compact prompt.
- Remote carry asks the remote for its instance list unless no instance
  is named; a named instance the remote does not list is refused again.
- Allow fork/mcpProfileTurnCheck.ts in the startTurn path test.
- Boot test pins the layer's position: the orchestration layer's
  adapter registry and runtime policy read instances through the check.
- Tests: live getters for each runtime shape and driver, servers=all
  with fewer T3 tools refuses, refusal text names no retry, unlisted
  named remote instance refused.

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

---------

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

* pr-queue notify: review follow-ups (#675) (#680)

* pr-queue notify: review follow-ups (#675)

- Both checkouts of the reusable workflow set persist-credentials: false,
  so no job token sits in the workspace the command can read. The README
  says plainly that the command still runs as the queue's user and can read
  the queue's start-up environment through /proc.
- A command that runs too long is stopped with its session and every process
  still linked to it by parent, so a child in its own process group or
  session (coreutils timeout, setsid) goes too. The README names the
  runner's end-of-job cleanup as the backstop for an orphaned daemon.
- The command's output is echoed between ::stop-commands:: and a random
  resume token: the runner reads ##[cmd] anywhere in a line, so the prefix
  alone did not stop that form.
- All notify commands of one run share a 300 s budget; once spent, a notice
  runs nothing (a warning), so slow notices cannot reach the job limit.
- No temp file for the output is a warning, not the end of the run.
- The link is kept only when it is a page of this repository on
  https://github.com/, else the PR page.
- README: a deleted queue comment or a new write-token login runs the
  command once more for every PR passed over, as one burst.

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

* pr-queue notify: drop checkout tokens by step, review minors (#675)

The reusable workflow no longer sets persist-credentials: false (its cleanup
runs git submodule foreach, which exits 128 on a repository with gitlinks and
no .gitmodules; the contract test forbids it). A step after both checkouts
removes what actions/checkout saved and fails unless nothing is left.

notify: without /proc the command's process group is still killed; workflow
commands are turned back on even if printing its output fails; the link must
be printable ASCII with no dot segments or encoded slashes; a spent budget
posts nothing, so the next run tells it; an unreadable output is no longer
called "could not start".

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

* pr-queue README: format the Notify argument table

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

---------

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

* heavy: clean up everything a command started; heavy leftovers names the rest (#687)

heavy now removes its own scope's leftovers on every end:
- a scope guard (a small setsid child that holds no queue ticket) stops the
  scope and removes its containers when heavy itself is killed, even with -9;
- containers a command starts with the heavy owner label are removed when the
  command ends, is stopped or heavy is killed; a kept scope keeps them;
- a command whose parent died is refused at once (double-forked children are
  stopped with the scope).

`heavy leftovers [--older-than AGE] [--json]` looks only: it names processes,
scopes and containers older than a limit, by owner and age, with default rules
when there are no sweep settings. It never stops anything.

Tests cover a killed heavy, a double-forked child, a container started by a
command, a kept scope, missing or stopped Docker, and a rerun after a kill.

Fixes #159

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

* secret sweep: one cat-file for all tips, no lazy fetch (#637) (#686)

* secret sweep: one cat-file for all tips, no lazy fetch (#637)

The sweep of 11-20 hit the scan job's 30-minute limit before the scan
script started. #539 added a loop that ran `git cat-file -e` once per tip
the activity record lists (about 1500), with lazy fetching on. In the
blob-less checkout each tip the clone lacked (about 400) was then lazily
fetched with no negotiation: the whole commit and tree history again,
about 36 MB each time, as a new pack. And every lookup of a missing
commit reads every promisor pack, so each later check got slower. Measured
against this repository: 3 s per tip from a fresh clone, 34 s after 30
packs.

The loop now checks all tips in one `git cat-file --batch-check` with
GIT_NO_LAZY_FETCH=1 (a failed check fails the job), fetches the tips it
lacks in one batch, and goes one by one only when the batch fails (a
gone tip fails the whole batch), as the scan script already does.

The 11-18 and 11-19 failures (four fake test values, 127 gone tips) were
fixed by #539. "Open, update or close the sweep issue" did not break: it
opened or commented on the issue each time, then exits 1 by design so
the run stays red.

Tests: fork-contracts.test.py runs the workflow's own lookup code end to
end in a blob-less clone of a local origin, with a gh stub: a fresh clone,
run again, stopped half-way, no gone tip, no tips, no clone. On main's
workflow the checks fail (5 cat-file processes and 5 lazy fetches for 5
tips); they pass now. The pinned text and two new mutants cover the rest.

Fixes #637

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

* Secret sweep: hand the tip lists to the scan in files (#637)

With the lookup fast, the dispatched sweep got past it and failed at the
next program it started: OLD_HEADS (every before and after of the whole
activity record, 131 KB) was exported as one environment string, over
the kernel's 128 KiB cap per string, so git could not start ("Argument
list too long", exit 126).

The workflow now keeps each id once and writes OLD_HEADS and
SCANNED_GONE to files under RUNNER_TEMP (written afresh each run),
exported as OLD_HEADS_FILE and SCANNED_GONE_FILE. The variables are
still exported while they fit, for a default branch whose script copy
predates the files. The scan script reads the files instead of the
variables when they are set (no longer exporting them), and fails the
job when a file cannot be read.

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

---------

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

* fork seams: announce the MCP profile launch check lines (#681) (#692)

Announces the four lines the #681 fix adds to two upstream files: a thread
whose MCP profile is narrower than "all" cannot start a thread that gets
more than its own profile, here or on another machine.

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

* Remote completion delivery: a task is reminded once; end-to-end tests for #386 (#688)

Upstream's follower already delivers a remote child's end at least once: it follows each open
task until the end is recorded, again at every start, and retries with back-off while the link
is down. Its delivery keeps the first result and reserves one wake per result. The fork's
backstop reminder keyed its message on the whole owed set, so a set that grew sent a second
message naming a task already reminded. Reminder ids now name per-task keys; a check reminds only
tasks not reminded yet, in batches of ten, and reads ids in the first format as sent.

New end-to-end tests on the real orchestrator and follower pin the delivery: the link down
when the child ends, the parent server restarted (also half-way through recording the end, and
again after), the machine there restarted, duplicate reports, and a child that ended before
the parent knew its id.

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

* fork seams: announce the MCP profile launch mark lines in place of the replaced line (#681) (#696)

The announced checkedElsewhere line replaced upstream's remote caller check in
McpToolAccess.startsThreads, which the seam check refuses. Two added lines take
its place (startsHere on the local path, refuseUnlessHere in the modes step), so
upstream's line stays as it is. The import line stays announced.

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

* Seam check: hold a pending file moved to "files" to upstream's lines in CI (#552) (#689)

* Seam check: hold a pending file moved to "files" to upstream's lines in CI (#552)

A pull request that moves a "pending" file to "files" was only held to how
many lines its new entry lists and that the file has them. With --upstream,
fork-checks now fetches upstream's default branch read-only (commits and
trees only, negotiated from the checkout: about a second) and holds the
entry's "added" to exactly the head's fork lines counted from the merge-base
of main and upstream's head. Only such a change fetches. Unreachable, empty
or unrelated upstream: a warning naming why, and the check as before.

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

* Seam check: read upstream's URL from main's fork-upstream.json, not the workflow

fork-checks.yml stays as it is: a token in its pull_request_target job is
refused by the schema check's own test, and any change to that file is the
owner's. The seam check now takes upstream's git URL from
.github/fork-upstream.json at the list's commit (main, never the pull
request's copy) when a change moves a "pending" file to "files"; --upstream
still overrides it by hand. A malformed file refuses only such a move; no file
keeps the old note. Comments no longer name the issue (lint).

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

---------

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

* MCP profiles: a broken settings.json or a launch never widens a thread to all (#681) (#694)

* MCP profiles: a broken settings.json or a launch never widens a thread to all (#681)

A settings.json that did not decode gave every setting its default, so a
thread kept to a narrower MCP profile ran with "all". The MCP profile keys
are now read from the file's text the way a full decode reads them; text
that names a profile key but cannot be read as an object, or a file that
cannot be read from disk, refuses the turn, delegation or launch until it
is fixed. Text that names no profile key sets none, so a typo elsewhere
stops no thread, including the one that fixes the file.

t3_thread_launch from a thread whose profile is narrower than "all" is
refused when the new thread's profile in the target project is not within
the launcher's, and a launch on another machine is refused for such a
thread (that machine would give it its own profile). A launcher whose
profile cannot be worked out is refused, never taken as "all".

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

* docs: a narrowed thread's new schedule_task on another machine is refused too (#681)

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

* fork seams: the announced MCP profile launch lines are now added (#692 merged)

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

* mcp profile launch: keep upstream's remote caller check line as it is (#681)

The seam check refuses a replaced upstream line. startsThreads' own path now
marks its caller (startsHere), and its modes step refuses a narrowed caller
nothing marked (refuseUnlessHere), so the remote check refuses a launch or a
new schedule_task on another machine with upstream's line unchanged, and any
other path to the modes fails closed. Tests: schedule_task there is refused
too (an update still goes), and a launch here does not unlock the next call
there.

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

* MCP profiles: keep the last read keys for a cut-off settings.json; check create_threads

A settings.json that is empty, cut off before its MCP profile keys, or
garbage no longer gives every thread `all`: the server keeps the MCP
profile keys it last read in this run, and a server started on such a file
refuses until it is fixed. A file that decodes now counts for its MCP keys
over the service's cached settings, so a fix counts before the watcher
reloads.

create_threads from a thread narrower than `all` is refused when its new
top-level thread would get more, through the fork's beforeCreateThread
check, from one settings read with the launcher's. A new thread whose
profile cannot be worked out is refused.

Fixes #681

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

* MCP profiles: a missing settings.json keeps the keys read; a whole typo file sets none (#681)

- Once this run has read a file's MCP profile keys, a missing settings.json (an editor's
  rename-then-write gap, or a delete) keeps them, with carried profiles read as refuse and the
  policy's locks over them, instead of resetting to the defaults' all. A server that started
  with no file is still a fresh install.
- A whole file with a JSON syntax typo (braces close back to depth 0 at its last character, a
  `}`) whose text names no MCP profile key sets none, so T3 keeps working after a restart as
  upstream does. Text that may be cut off, or names a key it cannot read, still fails closed.
- Reads are numbered as they start, so a read that ends late never stores older keys last.
- Tests: the narrowed -> removed -> empty -> cut off walk, whole typo files at restart, cut-off
  and unreadable files at restart, every strict prefix of a file is not whole, the kept path's
  carried refuse and policy locks, and two reads at once. README says exactly this.

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

---------

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

* fork seams: announce the schedule_task and fork MCP profile lines (#693) (#697)

* fork seams: announce the schedule_task and fork MCP profile lines (#693)

Lists the five lines the #693 fix adds to two upstream files, both new
entries with "added": [] (step 1 of "Adding a seam line").

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

* fork seams: announce the run-now and forwarded-call MCP profile lines (#693)

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

---------

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

* Secret sweep: stop re-checking deleted tips every run (#691) (#701)

* Secret sweep: stop re-checking deleted tips every run (#691)

The sweep's cost grew with the deleted tips GitHub's activity record still
lists: each was fetched again and its runs looked up again every day (about
231 of 250 API calls), and one deleted tip in the batch fetch sent every
served tip to the one-by-one fetch.

Now the sweep asks GitHub's GraphQL API about every tip the clone lacks
first, fetches the ones it still shows in one batch, and asks git once about
a tip GitHub has no commit for (a network error fails the job). A record of
the deleted tips (restored and saved by actions/cache around the scan step,
sweep runs only) spares the fetch and, for a tip a scan read, the runs
lookup on later runs. The record is trusted only for tips GitHub still has
no commit for; a record that cannot be read is a warning, removed, and every
tip is checked as on a first run. The scan script takes the deleted tips
(DELETED_TIPS_FILE) and does not fetch them a…
…cope.ts (#882 D5) (#1439)

List only (step 1 of "Adding a seam line" in docs/fork/updates.md). The code
change (#1298) adds these 4 + 2 lines; upstream's lines stay as they are.

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

* Known-flake list part 1: the list file and the red-head rule (#848)

.github/fork-known-flakes.json names each known flaky test file with its
open fix issue (empty for now). knownFlakes.ts parses it (a wrong file is
refused as a whole) and judges a red head: it counts as readable for the
lenses only when every failed part names its failed tests and each one is
listed, its issue is open, and the pull request does not change it.
Merging still needs green. Wiring it into lens_start {afterCi} is part 2.

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

* Fork changes: the known-flake list's change file (#848)

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

* Known-flake list: a gate setting, and app jobs run when it changes

The gate rule of fork-pr-queue.json names .github/fork-known-flakes.json (it decides which red heads the lenses
still read), and fork-owned-paths.txt excludes it with `!` (knownFlakes.test.ts reads it, so a pull request
changing only the list still runs that test).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
) (#1305)

* Review rules: a second reviewer whose provider cannot run it waits (#888)

When delegate_task refuses the second-review lens as provider_unavailable
(signed out, disabled, not installed) or usage_pacing_hold (out of usage),
lens_start no longer counts it as a refusal: it lists it under waiting,
never starts it on another runner, and gives the line to tell the owner
once per pull request head, runner and reason. The after-CI wake says the
same.

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

* Review rules: keep lensWaitWhyOf private to lensStartRun

knip flagged it as an unused export; only lensStartRun.ts uses it.

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

* lens_start: the owner line of a waiting lens is never lost to a re-run (#888)

The after-CI wake text now always carries the owner line: the wait's
action runs again after a restart, a timeout or a failed send, and only
the delivered run reaches the thread. A lens_start answer always carries
the line too; the in-memory memory only picks the words, so a repeat
after a lost answer asks the caller to tell the owner unless it already
did, and never says the owner was told. The memory (newest 500) moves a
key it holds to the newest on each touch.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…876) (#1307)

* fork(model-policy): notice an orchestrator turn that names no effort (#876)

When an orchestrator thread's turn starts with no effort named, the server
writes one warning into the thread (upstream's system_notice turn item),
once until a turn names an effort. Read back from the thread, so a restart
does not repeat it. Nothing is refused or changed.

Also reads OpenCode's `variant` (and any driver's own effort select) as an
effort control, so an OpenCode orchestrator with no variant is reported, and
pins the ultracode default and the drivers' no-effort choices in tests.

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

* fork(model-policy): give the archived-shell test a DateTime archivedAt (#876)

The thread shell's archivedAt is a DateTimeUtc, not an ISO string, so the
test fixture failed typecheck (TS2322). Build it with DateTime.makeUnsafe.

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

* Fix format and comment length after the main merge

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ns; owner override; one lens count) (#1320)

* Merge gate: review rules follow the review policy (seam list: code lens; owner override)

The merge conveyor's dry run of `review_kit.py merge` held #1252, #1253,
#1296 and #1304 for the merge-path and state lenses. All four change
.github/fork-seams.json, which #968 put in the critical `gate` rule. The
review policy takes one code lens for a seam-list-only or list-only
change, so the file goes back to the `code` rule (as fork-ci-tests.txt
did). A change that also touches a `gate` path still needs merge-path
and state.

review.override_authors lists the repo owner's login, so an override
comment after reading a last-round fix clears that major. Labels and lens
comments already come from this login, so this adds no new trust.

The lens count is now one function, review_judge.unread_lenses: the head
gate's verdict and the gardener's review-tiers check both call it. Each
required lens needs a read of its own name, and two reads of one lens
(two reviewers, or two rounds) count as one lens.

Part of #1287.

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

* Merge gate: keep override_authors empty until agents have their own identity (#1287 lens fixes)

Agents post as the owner's login (#78; #916 not done), so listing it would turn
override comments agents already posted (vouches for a read, a writer's own
override of a last-round major as on #1270) into owner decisions.

- .github/fork-pr-queue.json: override_authors back to [].
- person_way (Python and TS, shared vectors): with no login listed the held
  line says the owner decides, never asks for an override; the cap line drops
  "a person's override alone is enough" when no one is listed.
- Tests: an unlisted login (the owner's / PR author's too) never clears a
  major or passes the cap, on [] and on a list naming another person; a
  writer's own override after a last-round major holds; a listed person's
  override clears every older report, blockers too (what the docs now say).
- Docs and comments: review_config.py, head_check.py, review_judge.py,
  fork-kit/review SKILL.md (a vouch is only a vouch) and README, docs/fork.

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

* Merge gate: drop the issue number from the override comment in rounds.ts

The fork lint rule no-low-value-comments rejects PR or issue numbers in
comments; the reason stays.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
#885) (#1345)

* host tools 1.4: the reader core for host_read, host_stat and host_list

Part of #885

Resolve, decide, open without following a link at the last part, then
run the opened handle's own final path through resolveHostPath and
decide again, refusing any change. A read needs a file with one name
(no hard links), a listing a folder; 1 MB per read with an offset,
2,000 entries per listing, a secret entry shown by name only. The file
system is injected; the real adapter reads the handle's path on Linux
(/proc/self/fd) and refuses on other systems for now. No tool wiring.

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

* host tools 1.4 fix round 1: no existence leak below secrets, bare handles, split kinds

- A path-layer refusal carries `decideFirst` (the typed path with `..` applied, then each folder walked);
  the reader decides those keys first, so a path below a secret gets the same refusal whatever exists there.
- Linux opens a bare O_PATH handle: no device, pipe or cloud file is opened before the handle is checked,
  a link at the last part is the link itself (`changed`, also for a listing), and a stat needs no read
  permission. Reads go through the handle's own /proc/self/fd link.
- `confirmsHandles` on the file system: macOS, Windows and unknown architectures are refused as
  `unsupported` before any open.
- Kinds `denied` (EACCES, EPERM) and `io` split out of `path`; ENOTDIR on open is `changed`. The second
  decide on equal keys is dropped (decide is pure).
- A read page returns the file's `modifiedMs`, and a file that changed while it was read is refused.

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

* host tools 1.4 fix round 2: decide every name the walk enters

The walk now records the keys of every name it enters, also folders it
leaves again with `..` and each link it follows (by the link's own name).
They come back on success (`entered`) as well as on refusal
(`decideFirst`), and the reader decides them in walk order before any
answer. So a path that walks into a folder inside a secret or ask area
and back out gives the same refusal whether that folder exists or not,
and a link inside a secret folder is refused by its own name.

Also: a `changed` refusal names the typed path, never the place the
handle turned out to be; without /proc the reader refuses as
`unsupported`, not `missing`; the mid-read change check compares ctime
too.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ts account (#881) (#1376)

* Account order: a per-thread rule keeps a pinned or paused thread on its account (#881)

A person-only `accountThreadRules` setting (thread id to follow, pin or
pause; no entry follows the order). The handoff's account plan reads it:
a pinned or paused thread is never moved off its account by the order
and never handed off early because its account is spent, and the
handoff's Account order line says why. A rule the build cannot read
reads as pin, so a typo never moves its thread.

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

* Change file: name its pull request

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

* Account thread rules: register the setting in the whole-only and report lists

accountThreadRules reads null (and any non-map) as no rules, so a policy can
only manage it as a whole: list it in FORK_WHOLE_MANAGED_SETTINGS. The fork
report names it as not a switch (it only narrows accountOrder). Stop
exporting two constants nothing outside the module uses (knip).

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…s default branch (#855) (#1381)

* cleaner: pushedToDefault finishes a worktree whose HEAD is in GitHub's default branch (#855)

A repository whose work lands on its default branch by a direct push has no
pull request, so the worktrees rule kept all of its worktrees as "no merged
PR". With "pushedToDefault": true on the repository (off by default), a branch
no pull request has is finished when GitHub's default branch holds its HEAD
right now (git ls-remote, not the clone's possibly stale origin/main; a commit
this folder does not have keeps it until a fetch). Every other refusal still
holds, "used under 24 h ago" among them.

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

* cleaner: pushedToDefault counts origin's answer only from this repository on GitHub (#855)

`git ls-remote origin` asks the first URL git uses for origin, after
url.<base>.insteadOf, while the folder is matched to the repository by
the last remote.origin.url as written. A mirror on this machine or a
fork could answer for GitHub's default branch and the worktree went on
that answer.

Before ls-remote, pushed_refusal now keeps the worktree as
`origin on this machine` (the clone path's check, now one helper,
origin_here, shared by the clone, merged-branches and pushed paths)
unless every URL git uses for origin is on another machine, and as
`origin not this repository` unless every origin URL as written is this
repository's GitHub URL and every one as used ends in its owner/name.

Tests: an insteadOf to a mirror here, two origin URLs with a mirror
here first, two with a fork first (and a fork reached by insteadOf);
each failed on the old code and has a red-check entry.

README: the `no commits of its own` sentence for pushedToDefault now
says it holds only when the branch's reflog shows it.

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

* cleaner: pushedToDefault trusts only github.com, needs a PR named like the branch

Round 2 lens fixes for #1381:
- Every URL git uses for the fetch (after insteadOf, scp form too) must be on
  github.com itself (https or ssh) with a path of exactly owner/name. Another
  host ending in owner/name, gist.github.com, a proxy path, a remote helper
  such as persistent-https:// or plain http keep the worktree as
  `origin not this repository`. The test fixture's github.invalid root counts
  only through an explicit module hook (TEST_GITHUB_ROOT) that tests set.
- With pushedToDefault on, a branch no pull request names no longer counts
  another pull request's head as its own work, so a worktree only made at a
  merged PR's head stays `no commits of its own` (stale origin/main repro).
- README: the new host rule, and that core.sshCommand, GIT_SSH and ssh Host
  aliases are not checked.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…hat a question lacks (#868) (#1382)

* owner-questions: the owner-question template and its check (#868)

docs/fork/owner-questions.md: an owner question says Recommendation first (with
how sure), Options each with its cost, If no answer and Not checked; a big
decision adds a decision brief (evidence, second opinion). The fork-ci
owner-questions action reports the parts each waiting question lacks (summary
column, log line, `incomplete` output); it never fails or writes for it, and
`template: off` turns it off. Cases in template-cases.json.

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

* owner-questions: link the change file to #1382

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

* owner-questions: keep agent-rules.md within its 6500-byte cap

The owner-question link pushed docs/fork/agent-rules.md to 6567 bytes, past
the AgentRulesPage size cap. Shorten the link line and drop "one issue per
question", which docs/fork/owner-questions.md now states.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…le it can be (#1208) (#1387)

* agent-guards: a shell's script name the guard cannot spell is each file it can be (#1208)

actions-disable-guard passed a shell whose script name it could not spell
out: a glob (`bash o*.sh`, `bash off.s[h]`), text the shell makes
(`bash $((1)).sh`, `bash "$PWD/off.sh"`), a `for f in *.sh` value, and
`bash a=b.sh` (taken as an assignment, though after a shell it is the
script). Now:

- after a shell, a word shaped like NAME=value is the script;
- a `for` over a glob of literal text keeps what the glob shows (*.sh:
  hidden text, then .sh);
- a hidden script name that shows some of the file's name is matched
  against the files of each folder the command may run in (one folder
  down for `*/x.sh`), at most 4000 entries a folder; the first 64 matches
  are read whole as the script, the rest for tokens. The same for a hidden
  path run as a command (`./o*.sh`), executable files only.

A name that shows nothing of itself (`bash "$X"`) reads as before. New
over-refusal, in the docstring: `bash $((2)).sh` while a *.sh here holds a
refused call.

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

* agent-guards: a script name the guard cannot check in full is refused (#1208 round 1)

Fix round 1 of the actions-disable guard's hidden script names, from the
security and code lenses (guards refuse, not trust):

- A limit refuses: past 4000 folder entries, past 64 files a name can be,
  or a glob in a script too deep to read whole, the command is refused
  ("could not check every file it can be"). Before, the rest passed unread.
- A name of only wildcards (`bash *`, `./*`, `*.*`, `[o]*`, `???.??`,
  `source *`) is each file it can be. A word made by a glob is noted as it
  is put together, so `bash "$X"` still reads as a name the guard cannot
  know.
- The path after a hidden part is followed part by part, to any depth and
  through `..` ("$PWD/a/b/x.sh", */*/x.sh, */b/x.sh, "$PWD/../x.sh");
  `**` walks every folder below; `//` is one `/`.
- A shell's flags are read by its own rules: -e/-i/-l are switches,
  -o/-O/+O/--rcfile/--init-file take a word, -s reads stdin, `--`/`-` end
  the flags; a flag it cannot read (`-$X`, an unknown letter) refuses; a
  word that may be flags (`bash $OPTS x.sh`) has the words after it read.
- `bash < o*.sh` and `cat o*.sh | bash` read each file the glob can be.
- Extglob words (`@(x).sh`, `+(x)`) are one word, read as a glob.
- `for` values with a $ part ("$PWD"/o*.sh) keep their glob.
- `eval bash x.sh` reads the text after eval.
- `cd s*` follows each folder the glob can be; after a `cd` the guard
  cannot follow (`cd "$X"`, not one inside $(..)), a script named from the
  folder is refused.
- spells() keeps each word's expression (a long script was 50% slower).

New over-refusals are listed in the guard's docstring.

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

* agent-guards: a glob's words, a shell's start files and a script's own folder are read (#1208 round 2)

Both round-2 lens comments on #1387:
- an extglob word's $(..), `..` and <(..) are read (a regression of round 1)
- --rcfile F / --init-file F (also =F), BASH_ENV=F / ENV=F before a shell: F is read as a
  script the shell runs; a -c that --rcfile takes is no -c flag
- glob marks are never emptied while a command is read; past 200 000 glob words a name of
  only wildcards refuses
- a glob a variable holds (f=*; bash $f), a loop value's copies (g="$f"), select, and a
  glob in $(..) / <(..) (eval "$(cat *)", bash <(cat *), bash $(echo *)) are each file
  they can be
- names match without regard to case (nocaseglob)
- a folder of up to 200 000 entries is listed, each folder once per command, with the
  clock checked while listing; name_files answers once per command
- cp/mv/ln/install/tee/cat > with a glob source: every match's text is read where the
  copy is run
- in a script, `cd "$(dirname "$0")"`, `cd "${0%/*}/.."`, `D="$(cd "$(dirname
  "${BASH_SOURCE[0]}")" && pwd)"` go to the script's own folder; a cd inside ( .. ) ends
  with it, pushd/popd undo theirs; after a cd the guard cannot follow, `bash < x.sh`,
  `cat x.sh | bash` and `eval "$(cat x.sh)"` refuse
- ~+ is $PWD, ~- is $OLDPWD
- a file's text that is sourced or copied keeps its functions' "$@" to their calls
- a 2000-line loop script reads in 1 s (it hit the 5 s budget): var_texts reads each value
  once, and whether a text names codex is asked once per text

tests/repro-1387-r2.sh runs every repro of both comments and prints PASS/REFUSE per line
(114 of 114; 47 at 4df3005). Issue1387Round2Test asserts the same lines, with mutants for
the no-clear cap, extglob insides, rcfile, glob copies, glob values, nocaseglob, the
script's folder, and a test that each folder is listed once.

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

* agent-guards: a glob into a shell is every name it makes; unknown cd, folder writes and no-text files refused (#1208, #1387 round 3)

Composition-round fixes for the #1404 merge (state lens and security lens):

- blocker (both lenses): a glob into a shell (`cat *.sh | bash`) dropped a
  match that is a symlink to another match, so one text was read and the
  "each file ends whole" check was skipped, while cat prints both copies
  joined. glob_file now reads every name the glob makes (name_files
  each=True): both copies are read, joined, and each must end whole.
- major: `cd "$X" && cat *.sh | bash` passed although the named form is
  refused. glob_file now refuses a glob after a cd the guard cannot follow
  (per command, as lost_at() has it), and so do `cd "$X" && bash < *.sh`
  and `cd "$X" && eval "$(cat *.sh)"`.
- major (state) / minor (security): the writer check compared only a
  target's name with the glob's last part. Fed.glob_written also refuses a
  target whose name fits any part of the glob's path (cp -r/mv/ln -s ev dx;
  cat d*/ok.sh | bash) and a write into the folder the glob starts in
  (cp -r src/. .; cat *.sh | bash).
- minor: a file fed to a shell on stdin that holds a NUL byte, or is no
  regular file (a named pipe), was read as empty. fed_file_text refuses
  both, for a glob's matches, a named file (`cat a.bin | bash`) and
  `bash < f` alike; /dev/null and a copier's source (cp app q; ./q) keep
  their old reading.

Tests: 26 round-3 lines in tests/repro_1387_r2.py (19 of them red at
0092d15), and Issue1387Round3Test with one mutant per fix.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…es, as pure logic (#860) (#1388)

* Loop detector, part 1: same failure or no progress over a task's pushes, as pure logic

A task's pushed heads, in push order, give continue or stop: one failure red on
3 judged heads in a row, or 3 pushes after the head with the fewest failures
that bring no fewer. A green head and the parent's go-on start the count again;
a re-run of one head is one push; a head not judged yet is left out; a red head
whose failures are not known never makes a same-failure stop. Each stop says why
and what lets the task go on, keyed per task, head and reason.

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

* Loop detector: keep DEFAULT_LOOP_LIMITS module-private (knip unused export)

Only loopDetector.ts reads it, so knip in the Lint job flagged the export.

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

---------

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

* fork-kit/toolfit: the project tool-fit report, its checker and skill (#859)

A new no-installer kit. SKILL.md is how an agent audits a project's
feedback loops (build, test, run, see, measure, reach), rates each with
evidence, checks existing tools first and proposes custom ones with cost
and benefit. toolfit.py checks the report format (version 1), renders the
owner's read and drafts issues for approved proposals.

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

* review_judge test: sort the new toolfit kit as a normal kit (#859)

The kit-sorting test fails on any fork-kit folder it does not know. toolfit
holds a report format, its checker and a skill; it neither decides what the
gate checks nor holds its keys, so it goes in OTHER_KITS.

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

* fork-kit/toolfit: a later run keeps its decided proposals, no second copy of a filed tool (#859)

- check: the "loop already rated good" rule applies only to proposals not
  decided yet, so a re-run from the kept report still holds once a filed
  or turned-down tool's loop turned good.
- check refuses two proposals with the same title (case and spacing
  aside), and issues skips a title already filed or already drafted.
- check refuses a considered tool checked for none of the proposal's loops.
- SKILL.md: look for an issue with that title before filing, so a run
  that stopped before writing the number back does not file it twice.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…annel (#854) (#1402)

* fork-follow: one config file names the upstream, series branch and channel (#854)

.github/fork-follow.json (version 1: upstream, seriesBranch, channel) is
read at HEAD by the plan (fork-follow.sh) and by release resolve
(fork-release.sh) through fork-follow-config.sh, checked whole by
fork-follow-config.cjs. A set variable wins over the file, the file over
the default; no file keeps today's behaviour; a file it cannot use stops
the plan and resolve before anything is fetched. `fork-follow-config.sh
print` gives the values that apply, for the workflow wiring that follows.

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

* knip: list fork-follow-config.cjs as an entry

fork-follow-config.sh runs the checker by path (node <file>), which knip
does not trace, so knip:check reported it as an unused file and the Lint
job failed. List it beside the other path-run .github/scripts/*.cjs entries.

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

* fork-follow: reach the config checker from a test, not a knip.jsonc line

The knip.jsonc entry for fork-follow-config.cjs was a fork line in an
upstream file with no seam, so the seam check and the fork-owned-reads
check failed. Drop it. The checker now exports check() and reads stdin
only when run by path, and fork-follow-config.test.cjs requires it, so
knip reaches it through the .github/**/*.test.cjs entries like the other
fork scripts. The new test covers check() and the by-path run.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
* Fork CI: skip main run for an already-tested tree (#1390 tier 2)

A push to main whose git tree a green full-suite Fork tests run already
tested (a merge train, a release-mode run or a pull request run, within
24 hours, with the same workflow files) skips its test jobs. The secret
scan and the fork-checks check still run, and fork-ci-result names the
run in its summary. Fork tests daily runs the full suite on main once a
day.

- fork_ci_result's new `Full suite` step decides whether a run was a full
  suite: every gate on, every package, every test job green, and not
  itself a skip. If so, the job's last step is named `Tested tree <tree>
  full suite`, which the jobs API shows.
- The `changes` job's `Tree already tested` step runs on push to the
  default branch only. It calls fork-tested-tree.py find, which looks for
  that mark among the newest green runs.
- Fail closed: a re-run, an API or git error, other workflow files, a
  missing macOS lint, an unknown changes output, or no match all run
  every job.
- Release, workflow_dispatch and pull request runs never skip.

Tests: fork-tested-tree.test.py (the tree match, each fail-closed case,
the matched run re-run or deleted, two quick merges, a force-push, the
Full suite step, the pass rule, the wiring). The contract tests now pin
the tested_by clause on the test jobs and the record steps.

Part of #1390

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

* Fork CI: fleet wiring tests expect the route step's tested-tree skip

The route step now also skips when the `already` step found a green
full-suite run of this tree (every other job skips, so there is nothing
to route). fork-fleet.test.py still pinned the old condition, which
failed the workflow lint job. A release run (inputs.ref set) still
never routes.

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

* Fork CI: a tested tree never skips a push that changes a cache input (#1399 fix round 1)

Only a push to main whose jobs run saves the node_modules, Vitest, task
and Cargo caches. A push that changes a file a cache key hashes (against
github.event.before) now runs every job, so the new entries get saved.
A test checks every hashed file is such an input.

A pull_request run used as proof now needs this push's workflow files at
its head too. The summaries now say "Re-run all jobs" tests again and
"Re-run failed jobs" skips again.

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

* Fork CI: compare cache inputs with the newest full push, let the daily run save caches (#1399 fix round 2)

- The merge conveyor cancels the push runs of a train's earlier members, so `before` is often a commit whose run
  saved nothing. The lookup now compares cache inputs with the commit of the newest green push run that ran every
  job (it has a passed full-suite mark; a skip run has none), fetching it trees-only when it is not in the shallow
  checkout. None among the newest MAX_BASE_READS push runs: every job runs. Job-list reads are shared.
- Fork tests daily (a schedule run, on main) now saves the per-commit Vitest module caches and, on a miss, the
  Cargo cache, which only a push saved before; pushes mostly skip now.
- Tests: a train whose first member changes the lockfile (fails on the round-1 head), no base push run, a base
  fetched trees-only, the daily run's save steps.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…dle.folders) (#1409)

* cleaner: an idle rule for folders whose entries nothing changed in (idle.folders)

The biggest class of the disk audit was test servers a project leaves
beside its code, untouched for weeks, then an updater's dated backups and
a CI runner's diagnostic logs. No rule could take them: tmp is for the
temp folder, worktrees takes whole clones only.

`idle.folders[]` names folders (root, * and ? within one part) whose
direct entries go when nothing in them changed for `days` (7 or more).
`names` picks the entries (never a hidden one), `holds`/`depth` says what
an entry must be a folder holding (a test server, not the source beside
it), `keepNewest` keeps the newest; an entry that cannot be read counts
as the oldest and never pushes another out. Every guard refusal holds; a
KEEP file in or above the root keeps all; inside a git work tree an entry
goes only when git tracks, changed and does not ignore nothing in it.
above_refusal collects git folders above for this rule instead of
refusing. The config refuses roots that are home or above, hold or sit in
a must-keep path, hold another rule's root, or nest with another idle
root. Everything is read again before the delete.

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

* cleaner: format the README

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

* cleaner: the installer self-tests the idle module and CI lists its test

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

* cleaner: list the idle rule in the example machine file and the kit table

The daily tests require every rule in rules.RULES to be on in
machine.example.json and named in the fork-kit README row; the idle rule
was in neither, so Fork kit tests 3 failed.

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

* cleaner idle: half-deleted or chmod-bumped entries take no newest slot; never take a clone

- keepNewest ranks entries by content (the mtime of the newest file in each),
  not folder or inode times, which a stopped delete, chmod/chown or a move out
  and back change. A folder with no file ranks below those with files.
- An entry the journal names (a delete started and did not end; the journal is
  written before each delete, so it holds across a crash or restart) takes no
  newest slot; one that holds such a path is kept as half deleted.
- An entry that is or holds a git clone, worktree or bare repository is never
  taken: clones are the worktrees rule's (their ignored files stay).
- The last check before each delete reads only that entry, the folders above,
  the journal, and that the newest kept at the plan are still there (same
  inode, not half deleted), not the whole folder.

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

* cleaner idle: rank keepNewest by each entry's birth time; unknown keeps all

A copy keeps its source's file times (cp -a, rsync -a, tar x), so ranking by
the newest file inside an entry could delete the newest backup and keep an
older one, and copies of unchanged data tied and fell back to reverse name
order. The newest are now ranked by the birth time of the entry itself
(st_birthtime where Python has it, else statx through `stat -c %W`). When
one entry's birth time cannot be read (0, stat missing or failing, or the
path is no longer that entry), no entry of that folder entry is taken and
each old enough is kept with the reason. An entry born at the same time as
the last that stays stays too. A folder with no file still ranks below.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
A plan over a temp folder of 55,000 entries a pattern takes spent about
2.6 ms per entry running the in-use expression over every command line
(about 500 here), so a daily compare ran past 15 minutes. The
expression needs the path itself in the text, so a plain `in` test first
changes no answer; the quoted-space form of each text is made once.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…tep (#888) (#1415)

* Review rounds by code, part 2: a lens report takes the round's next step (#888)

After lens_report posts (or finds) a report, the server runs the round step
for that pull request, from lens_arm's own reads plus the head check's runs
on the head:
- fix: the one open thread that links the pull request (not the
  orchestrator, not a lens child) gets the combined fix message; with none,
  several, or one that is gone, stopped or refuses, the orchestrator gets it
  to relay.
- owner: the orchestrator is woken with the reason.
- arm: the orchestrator is told to call lens_arm for that head.
- wait, ci, refused: nothing is sent.
Message and command ids come from the step key, and the waits' delivery
sends each at most once (a send that waits for a slot is tried again).

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

* Pin the wait worker's shared slot-gated delivery in its source test

The wait worker now builds one slot-gated WaitDelivery and hands it to
both the wait service and the lens round step. The #711 source test
still looked for the old inline `delivery: yield* WaitDelivery.make(...)`
line, so it failed. It now checks the shared delivery is made through
the slot gate, that the wait service uses it, and that the lens start
server sends through it; it still requires exactly one WaitDelivery.make.

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

* Review rounds part 2: per-PR turns, one record per send, resume on start (#1415 round 1)

- No server-wide lock across a send's retries: one pull request's steps take
  turns only for a read and one try, never across the 5 s pause. Each retry
  reads the head again and drops the send when it moved.
- Each step that sends is one record (review-round-sends.json, roundSends.ts)
  with one receiver: a fix relayed by the orchestrator never also reaches the
  writer (one record per head and finding set). A writer send that gives up
  after its tries goes to the orchestrator. Records still pending are sent on
  start, with no further report.
- Writer pick: only the orchestrator's open direct children that link the PR
  and are no lens child; the writer an earlier step reached wins among them.
- CI: an empty head_check is "CI unknown": the orchestrator is told to arm.
  A red head with clean lenses tells the orchestrator once per head.
- Tests: two reports racing, a step queued behind a retry loop, PR A's loop
  not delaying PR B, a head change mid-retry, restart resume, store file.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
It changes how git merges fork files (merge=union), which the merge train's
local merge-tree and catch-up-rebase read, so a change to it gets the gate
lenses like the other .github settings. review_judge.test.py requires every
top-level .github file to be in the gate rule or in NOT_GATE.

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

Copy link
Copy Markdown
Owner Author

Rebase

Merged origin/main into the branch (plain merge, 156 commits, no conflicts: .github/fork-ci-tests.txt merged cleanly with this PR's line kept) and pushed as a fast-forward.

What was red, and why

  • Fork action and fleet walls tests: fork-ci/actions/pr-queue/review_judge.test.py → test_every_github_file_is_critical_but_the_bookkeeping_list: .github/.gitattributes is not in the gate rule. Every top-level .github file has to be in the gate rule of .github/fork-pr-queue.json or in NOT_GATE. This PR adds the first .github/.gitattributes, so it fell through to the code rule (normal). This still failed after the merge.
  • Fork checks ran / fork-ci-result: these roll up the other two checks. They follow them.
  • No database schema changes: .github/.gitattributes: changes how git treats files, which can hide changes from review. Only the owner may do that. This is the owner gate, as the PR body says. It stays red until the owner merges past it, so I left it as it is.

Change (ced5c3a): I added .github/.gitattributes to the gate rule paths in .github/fork-pr-queue.json. The file changes how git merges fork files, and the merge train's local merge-tree and catch-up-rebase read it. That makes it a gate setting, not a bookkeeping list. The existing test was red before this change and passes after it.

What I ran

  • review_judge.test.py: 65 tests, OK.
  • fork-gitattributes.test.py: OK.
  • node .github/scripts/fork-ci-tests.cjs fork-ci/ .github/scripts/fork-fleet-walls: the only failures were from this machine.
    • gradle_cache.test.py test_the_token_is_never_sent_on_a_redirect timed out. It serves on a local socket, and TCP to localhost is blocked on this machine.
    • The pr_queue*.test.py timing-weight notices came from a slow shared machine.
    • CI runs both.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant