Skip to content

Armed PR sweep: judge, one-request sweep, once-per-head wakes, wait_list rows (#880 rows 1-3) - #1117

Open
scuttletoby wants to merge 1483 commits into
mainfrom
fork/armed-pr-sweep-880
Open

scuttletoby wants to merge 1483 commits into
mainfrom
fork/armed-pr-sweep-880

Conversation

@scuttletoby

@scuttletoby scuttletoby commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Part of #880 (rows 1, 2, 3 and the wait_list rows of row 4; the Settings UI and the pressure-note action follow in a stacked PR).

What

A fork setting armedSweep (off by default) and a server add-on under apps/server/src/fork/armedSweep/:

  • Judge (armedJudge.ts, pure): an armed pull request wakes for conflict, red (every check ended, one failed, rerunGraceMinutes = 12 after the last failure so the fork-ci re-run had its one try, owner decision Owner question: armed PR wake: wait for the CI run to finish (and its one rerun) before waking? #160), stalled (not green 30 min on one head), disarmed (auto-merge off 15 min; the queue turns it off briefly itself) and closed. Merged is forgotten silently.
  • One GitHub request per sweep (armedGitHub.ts): aliased searches for the open pull requests of the swept repositories plus nodes(ids:) for the ones already followed, in one gh api graphql call (a second only while a search has another page). No per-PR reads. An answer with an error is refused whole; an unresolved followed id reads as unknown.
  • Sweep (armedSweep.ts): owner = newest linking thread up the parent chain; archived owner or (with scope: "all", owner decision Owner question: armed PR wake: also wake for armed PRs no agent made (armed by hand)? #162) an unlinked PR goes to the project's orchestrator (threadRoles). One joined message per thread per sweep, once per PR + head + reason, at most maxWakesPerHead (3) per head. dry logs and lists, sends nothing, marks nothing sent.
  • State (armedState.ts, fork-armed-sweep.json in the state dir): a wake is written as pending before the send and settled from the engine's command receipt after, so a stop half-way neither loses nor repeats it. Missing/bad/old file starts empty (logged); a newer build's file stops the sweep and is never overwritten. A GitHub error sends nothing and writes nothing.
  • Live layer (ArmedSweepLayer.ts): wired in forkLayers.ts routes; slot-gated queued send like the remote-prompt waker; held server does not sweep.
  • wait_list: armedSweep.pullRequests lists the last sweep's not-green armed PRs (PR, head, reason or failing checks, since when, thread, wake state) — the "one place" asked for in the issue comment.
  • Registered in forkDefaults, forkFeatures/fork report, managed settings, the Settings overview line, its change file docs/fork/changes/app/880-armed-pr-sweep-every-interval-5.md (was a FORK_CHANGES.md row) and docs/fork/README.md (server.armedSweep).

No upstream file gets a new line (seam check: only pinned seams).

Tests and the question each answers

armedJudge.test.ts (26 table rows): for each rule, given the PR now and what the last sweep remembered, does it wake (which reason), wait or drop, and what is remembered? Edges: grace end, stall end, pending re-run, a re-run that passed, missing end time, new head resets since-when, queue's brief disarm.

armedSweep.test.ts (fake world):

  • off: does it read or write anything? (no)
  • run twice: does a second sweep over the same answer send again? (no)
  • one request: is GitHub asked once per sweep, followed ids in the same request?
  • dry: is nothing sent or marked sent, and does on then send it?
  • joined: are two PRs of one thread one message?
  • parent chain: does a delegated child's link wake its top-level thread?
  • hand-over: does an archived owner's PR go to the orchestrator? unlinked PR with linked vs all? no orchestrator → no-thread, sent once one is set?
  • cap: does a head stop at maxWakesPerHead, and a new head wake again?
  • closed / merged / missing from the answer: one closed wake / silent / kept unchanged?
  • GitHub refuses: is the state file untouched and nothing sent?
  • stops half-way: right before the send (same command id next sweep), right after (receipt settles it, no second send), send error (stays pending), no slot (retried).
  • state file: empty, not JSON, no version, old version, newer version (stands still, never overwritten), bad entries dropped alone.

armedGitHub.test.ts: do searches fit GitHub's 256-char limit and send only owner/name? Is an errored answer refused whole, except an unresolved followed id? Are check runs and status contexts read right?

armedRows.test.ts: does wait_list list the caller's rows (scope thread) or its project's, nothing while off, and a failed sweep's error?

Red then green: the new files fail on main (they do not exist). Mutation spot checks, each turned the named test red: removing the pending→receipt settle (stops half-way, right after the send), the dry guard (dry test), the once-per-key check (run twice, stops half-way, bad entry).

Also run: contracts forkDefaults, forkSettings, waitFor; server forkReport (pinned feature lists updated), managedSettings.forkKeys, waits; web forkStatus.logic, forkDefaultText.logic; shared forkDocs; fork-changes-list.test.cjs. On this machine forkReport.test.ts > --activity > exits 0 only when … fails on unchanged main too (local port binding), not from this change.

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

Rebased onto main 106c78f: conflicts in FORK_CHANGES.md, resolved by taking main's realigned table and re-adding this PR's armed PR sweep row.

scuttletoby and others added 22 commits November 28, 2026 22:29
…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]>
…kground job (#1196)

* agent-guards: let poll-loop-guard allow a wait on the agent's own background job

bg-guard refuses to end a turn while a background job runs, and poll-loop-guard
refused every way to wait for it except a blocking `tail --pid`: a foreground
loop over 120 s, and a Monitor until-loop too, because Claude Code runs the
Bash hooks for a Monitor call with tool_name "Bash".

poll-loop-guard now lets a wait through when every check in it reads the
agent's own job: its tasks/<id>.output file in its own session folder, or a
PID in its own claude process tree (kill -0, ps -p, /proc/<pid>, $! after &).
It finds Monitor calls by their tool_use_id in the transcript (tail only,
bounded wait); a Monitor may wait on local files and jobs, one polling CI or
a PR is still refused. bg-guard names the PIDs and gives a wait that
poll-loop-guard allows; a test runs one guard's suggestion through the other.

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

* agent-guards: format the README table

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

* agent-guards: own-job waits only in exact, provable forms

Fix round 1 on #1196. Both lenses found ways for an outside poll to
pass as a wait on the agent's own job. The guard now allows a wait
only when it can prove every check reads only the agent's own job,
and otherwise refuses as before.

- Allow-list of exact forms: kill -0 PIDs, ps -p/-q PIDs, [ / [[ file
  tests on an own output file, and grep/tail/head/cat/wc/ls/stat with
  listed options only. find, rg, jq, pgrep and the rest are refused.
- Every part of [[ a || b ]] and [[ a && b ]] is judged, not only the
  first.
- Only an exact /proc/<own pid> counts as own; /proc/<pid>/cwd, root
  and fd/N no longer reach other files.
- An own output file must be <tmp>/claude-<uid>/<slug>/<sid>/tasks/
  <id>.output with no symlink on the way.
- A variable counts only if it is assigned once, in plain run order,
  and never re-assigned (for, read, +=, declare -n, prefix
  assignments, subshells).
- Refused: input other than < /dev/null, ps with -e/-C/-u/--ppid,
  kill with a negative PID, rg --pre, and readers given - or
  /dev/stdin.
- bg-guard's suggested `while kill -0 A || kill -0 B` still passes
  once one listed job has ended: a PID that has ended counts only in
  a while condition.
- A Monitor curl to anything other than this machine counts as CI.

Each repro is a test that fails on 2b73dd5.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…e scheduled run's refusal text (#876 M4) (#1199)

The model policy backstop (#1129) now checks each agent command on
ThreadManagementService's own server settings and command receipts, so a
call whose context lacks the settings service is still checked and a replay
of an accepted command is answered from its receipt. That changes its one
line in dispatch; this announces the new text in place of the one #1128
announced (not spent yet), with since set to today.

It also announces three lines in ScheduledTaskService.ts: an import of the
backstop, and two lines at the top of dispatchErrorMessage, so a run the
backstop refused records the refusal's text instead of the launch error
that wraps it.

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

* Model policy backstop: check an agent's dispatched thread commands once (#876 M4)

Every thread command passes ThreadManagementService.dispatch. A command an
agent's MCP call dispatches with a model, or a thread fork (on its source
thread's model), is checked against modelPolicy there unless the call's
route already checked its picks; the owner's client and the server's own
work are not read. Adds docs/fork/model-policy.md (who checks each route,
a lock an agent cannot undo, the way back), and a skill refusal now
suggests a copy under another name (#987, point 8).

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

* Model policy backstop: fix round 1 (#876 M4)

- A replay of a command that already has a receipt is not checked again:
  it starts nothing, and an accepted delegate_task/create_threads/
  t3_thread_launch retry is never refused or logged twice after a policy
  change. A receipt that cannot be read counts as none (checked).
- The check reads ThreadManagementService's own settings and receipts,
  passed in on its dispatch line, not the caller's context.
- Every command type that carries a model is read (queued-run.edit and
  delegated_task.remote.request too), through a map keyed by those types,
  so a new one fails the typecheck until it is listed.
- A fork's source thread is read only while the policy is on.
- A refusal fits the 1000 characters a reply keeps: past it the rows are
  shortened, never the fix. The settings place names the page's heading.
- run_scheduled_task_now on a task on an outside model: the refusal says
  the task's own model is the problem, and the run records the refusal's
  text rather than the launch error that wraps it (one seam line pair).

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

---------

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

While the model policy's mode is advise or enforce, a composer turn whose
model has an effort control but names no effort runs at the driver's default
level, which no allow row can match, and the server check never sees picks
made in the composer. A warning banner now says so and points to the model
menu; picking an effort clears it.

The rule (noEffortWarning) reads the pick with modelPolicyPickEfforts and the
same ids as the server's check. The hook (useForkNoEffortItems) feeds the
composer's own selection hook what ChatView feeds it, so it reads the draft's
pick over the thread's, a new draft's project default or fallback model, and
each model of a fan-out. ChatView gets the four seam lines announced earlier.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ons (#887 row 4) (#1121)

* fork-ci: an owner-questions action that lists and labels owner questions (#887 row 4)

Lists a repository's open owner questions (T3's rule, with the cases both copies run in
rule-cases.json) and, in label mode, keeps status:needs-owner-decision on exactly the waiting ones,
so a question asked by title is found by its label. A project's .t3code/issues.json may name the
repositories and rename the rule; a project runs it through a small workflow (README).

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

* fork-owned paths: the owner-questions cases are read by the contracts test

forkOwnerQuestions.test.ts (an app job) reads
fork-ci/actions/owner-questions/rule-cases.json, so the file is a `!` line
of .github/fork-owned-paths.txt, as the pr-queue review vectors are: a pull
request that changes only the shared cases still runs that test. The
test's describe title no longer names the bare fork-ci folder, which
fork-owned-reads.test.py counted as a read of it.

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

* fork-ci owner-questions: fix round 1 (#887): only deciders answer

- A comment answers an owner question only when its author_association
  is OWNER, MEMBER or COLLABORATOR, in both copies of the rule; the
  shared rule-cases.json gets decisionComments cases, stranger included.
- A question asked again (label put back by a person after the last
  decision) keeps its label; a bot's label does not ask again.
- "repositories": [] is refused with a clear message.
- A 404 on the DELETE (label already gone) is no change, not an error.
- README's example workflow runs on the default branch only.

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

* owner-questions: keep the decider list private to the rule (Check unused code)

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby and others added 24 commits November 30, 2026 02:07
…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]>
…uns per merged PR (#871 part 1) (#1419)

* gardener: a ci-cost check reports CI minutes, re-runs and cancelled runs per merged PR (#871 part 1)

A new general check of the gardener kit, report only. For the project's
pull requests merged in the last `days`, it sums the job time of the
Actions runs on each head branch (every attempt, jobs API filter=all),
and counts the runs that were re-run or cancelled with the minutes they
cost. Optional thresholds turn a pull request (maxMinutesPerPr) or a
share of re-run or cancelled runs into a warning in the daily report.

Finished runs and fully read pull requests are cached in the check's
cacheDir, so a day's run reads only what was merged since; maxCalls and
minRemaining bound the REST calls, and a cut-off run reports what it
read and the next run goes on.

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

* gardener-install: copy the new checks/ci-cost check

The installer's CHECKS list did not name checks/ci-cost, so an install left it
out and the kit-install contract test (every kit file is copied) failed.

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

---------

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

Follow-up to the review of the units check:
- a listed name without its suffix ("dbus") or an alias is the unit
  systemctl answers for (its Id or one of its Names), instead of failing
  the whole check with "show said nothing of";
- fix hints quote unit names (systemd-escaped names keep their backslash);
- without `units`, transient run-u<N> units of systemd-run are left out
  (they stay failed until reset-failed); `transient: true` counts them;
- a service manager that does not answer within `timeoutSeconds` (60) is
  the check's one-line failure, not a traceback.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…808 row 5) (#1433)

* Prompt mirror: leave a prompt upstream shows answerable to its card (#808 row 5)

Upstream already shows a delegated task's approval with Approve / Decline in the
parent thread, and opens its question from the parent's "needs you" banner, for
every task whose machine this app is connected to (a linked machine's task
counts, through delegatedFrom). The mirror kept a read-only copy beside it.

- The mirror drops an open question or approval whose task thread is among
  upstream's children asking this parent, matched on the task's own machine.
  Secrets, pairing codes and not-known cards stay: upstream shows none.
- A question or approval of a task on a linked machine this app is not
  connected to says it is answered there, and that connecting the machine to
  this app lets the owner answer it here.

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

* Prompt mirror: drop a card only for a connected machine; keep questions upstream hides

Upstream's child list keeps a machine's last thread list after its
connection drops (and loads a cached one at start-up), so the mirror now
drops a question or approval only when the task's machine is one this app
is connected to; otherwise the card stays and says "not connected".
While the parent itself waits on the owner, or a run stop is unresponsive,
upstream hides its "Subagent waiting" banner, so a child's question stays
on the mirror's card then (approvals still go: upstream's approval cards
show).

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

---------

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

The "Waiting on you" page gains a "Needs you on a machine" list: each
enabled, installed provider that a connected machine reports as signed
out, with the step to sign in and a button to that machine's provider
settings. It reads the provider statuses the app already holds (no
server change); a machine not connected now is named as not read.

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

* slot-filler: place agents by live memory, not fixed counts (#882)

- maxAgents/maxWriters are optional: without them a machine has no count
  cap and its live memory decides.
- Each pass reads this machine's memory in-process (/proc/meminfo, PSI)
  and every linked machine's in one call to the new server route
  GET /api/fork/delegate/memory (t3_environment_read over the link).
  A failed reading skips that machine for the pass only.
- A start costs a cold per-kind default (one constant until learned
  costs land) and counts as pending there until it settles or its task
  ends; a crash-left reservation expires. One floor per machine.
- Each item goes to the machine with the most memory left after it;
  many starts per pass, this machine re-read after each.
- Generated items (fix-red, lens, autostep writer) carry no machine list.
  A writer whose PR touches workflow files needs a machine whose GitHub
  token has the workflow scope (measured and cached, not listed).
- A queue item written during a pass gets another pass at once; the
  install docs add a path unit and a short timer fallback.

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

* slot-filler: test the in-process meminfo and memory PSI reading (#882)

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

* slot-filler: fix format and Effect.fn lint in the memory reader (#882)

CI's lint and typecheck jobs failed: fillerDelegate.ts and the slot-filler
README were not formatted, and readMemory was a function returning
Effect.gen, which the Effect diagnostics want written as Effect.fn.

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

* slot-filler: drop the issue number from the memory path comment

The no-low-value-comments lint rule refuses PR/issue numbers in comments.

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

* slot-filler: a live start reserves its cost until its task ends (#882)

A writer's memory comes minutes after it starts (its tests), so a start
record now counts its whole cost while its task is a live child, not only
for settleSeconds. The reading cannot tell which task uses what, so early
use counts twice (the safe side). A record T3 does not show live still
expires after settleSeconds.

- An older linked T3 whose environment read has no memory is answered
  with noMemory: true and placed by its count cap, if it has one.
- A PR whose files gh cannot list gives its writer needs workflowPush
  (fail closed).
- README: keep t3-capacity on main in the example as the outer guard;
  install the new filler before a config without maxAgents.

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

* slot-filler: old-parent live writers reserve memory; a guessed workflowPush is asked again (#882)

- read_pending counts a record as live through run_live, so a writer that runs on under the old parent
  after a handover keeps its cost pending until its task ends (an old-parent read error counts it live).
- A gh failure while a fix-red/autostep item is written marks its workflowPush need as a guess
  (needsUnsure); lacks asks gh again once a run and rewrites the queue file when gh answers.
- README: a live child counts twice on purpose, so refills after the first fill run at about half the rate.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
… shared reader (#849) (#1437)

fork-kit/heavy's agent-slots hook counted pgrep processes while agent-guards'
read server.agentSlots (#1292). Both now read agent-slots.json through
fork-kit/common/t3_slot_count.py, which both installers copy.

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

* nightly_lock.test.py: a leftover that ends just as it is checked (red)

On a loaded runner the wrapper's leftover can end on SIGTERM after
end_the_rest collected the ended children and before it looked at /proc
again. That look shows only a zombie, so the wrapper lets the lock go
with its zombie uncollected; init gets it. The test's alive() counted
only Z as gone, so a check while init collected it (state X) read the
process as alive: the flake of "what the command leaves running is
stopped before the lock is free [stops on SIGTERM]" on a Fork tests run
of a PR that does not touch the nightly lock.

The new test drives end_the_rest in-process and lets the leftover end
in exactly that window; it fails: the wrapper returns with the zombie
still its own. alive() now counts X as gone too.

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

* nightly_lock.py: look at /proc first, collect after, so none is left a zombie

end_the_rest collected ended children, then looked for live ones: one
that ended between the two was seen only as a zombie and the lock was
let go with it uncollected. Now each round looks first and collects
after (still_running): a look that finds no live process leaves none
waiting as our zombie either, and one that ends after the look is found
gone on the next round.

A 12-way parallel stress of the wrapper (sleep 60 & left behind): the
leftover was still visible after the wrapper exited in 10 of 3600 runs
before, 0 of 3600 after.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Two heads of #1406 that a force push replaced hold a made-up base64 test value
without a gitleaks:allow comment. GitHub still serves them by id, so the pull
request's scan and the daily sweep read them. Allow that exact value, for
generic-api-key, in that one test file only.

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

Copy link
Copy Markdown
Owner Author

Merge conveyor: head 538fb6358f27 does not merge cleanly on main 40cd61834b57 (conflicts in apps/server/src/fork/forkLayers.ts, apps/server/src/golive/forkReport.test.ts, apps/server/src/golive/forkReport.ts, apps/server/src/policy/forkManagedSettings.ts, apps/server/src/provider/forkAgentContextBudget.json): fork:merge-ready swapped for fork:merge-blocked. Merge main into the branch (a writer may already be queued for it), then add fork:merge-ready again.

@scuttletoby scuttletoby added fork:merge-blocked Merge conveyor: did not merge, needs a look (PRs) and removed fork:merge-ready Merge conveyor: lenses done, merge when green (PRs) labels Nov 30, 2026
main moved onto a new upstream tag. Brings main in, keeping only this
branch's own changes on top. The conflicts were all both-sides additions:
armedSweep next to main's accountThreadRules, childPullRequestWatch and
agentSlotsCountFile entries; both kept. forkAgentContextBudget.json is
set to main's 5395 plus this branch's +91 bytes (5486).

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

Copy link
Copy Markdown
Owner Author

Rebase

Merged origin/main (40cd618, the new upstream tag catch-up) into this branch as a merge commit, not a rebase. The new head is d762c1d. It holds main plus only this branch's own changes (58d5f60..538fb63).

Conflicts. Each one came from both sides adding an entry in the same place. Both sides were kept, with main's entry first:

  • packages/contracts/src/forkFeatures.ts: armedSweep goes after main's childPullRequestWatch, in the feature list and in the feature map.
  • packages/contracts/src/forkSettings.ts: export * from "./forkArmedSweep.ts" goes after main's forkAccountThreadRules.ts.
  • apps/server/src/policy/forkManagedSettings.ts: armedSweep goes after main's accountThreadRules in WHOLE_ONLY.
  • apps/server/src/fork/forkLayers.ts: the ArmedSweep import and layer go next to main's AgentSlotsCountFile import and ChildPullRequestWatch.layer.
  • apps/server/src/golive/forkReport.ts and forkReport.test.ts: the armedSweep mode goes after childPullRequestWatch.
  • apps/web/src/components/settings/fork/forkStatus.logic.ts and .logic.test.ts: the armedSweep label and fixture go after childPullRequestWatch.
  • apps/server/src/provider/forkAgentContextBudget.json: this one was recomputed rather than merged. It is main's 5395 plus this branch's +91 bytes, so 5486. ForkAgentContextBudget.test.ts checks the exact value and passes.

Checks run

  • Fork checks: fork-schema-check, fork-upstream-files-check and fork-seam-check, each against main...head, all pass. Their self-tests pass too (201/201).
  • Server tests: src/fork/armedSweep, golive/forkReport.test.ts, src/policy (including managedSettings.forkKeys), mcp/toolkits/waits, childPullRequestWatch, agentSlotsCountFile and both context budget tests. 250 of 251 pass. The one failure is __fork-report --activity, which binds a random local port; that can't work in the sandbox that ran this merge, and the change doesn't touch it. CI runs it.
  • Web unit tests for settings/fork: 116/116 pass.
  • Contracts tests: 723/723 pass.
  • Typecheck passes for server, web and contracts.

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

fork:merge-blocked Merge conveyor: did not merge, needs a look (PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant