GeezerVison is showing github.com — Merge origin/main into fork/review-rules-799-841 · scuttletoby/t3code@e2252e5
File treeExpand file treeCollapse file tree Open diff view settings packages/client-runtime/src/state
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/fork-pr-queue.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 33 | 33 | ".github/fork-owned-paths.txt", | 34 | 34 | ".github/fork-pr-queue.json", | 35 | 35 | ".github/fork-removed-workflows.txt", | | 36 | + ".github/fork-review-kit.json", | 36 | 37 | ".github/fork-secret-sweep-gone-tips.txt", | 37 | 38 | ".github/fork-tests-upstream.json", | 38 | 39 | ".github/fork-upstream.json", | |
Collapse file Copy file name to clipboard +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "version": 1, | | 3 | + "queue_config": ".github/fork-pr-queue.json" | | 4 | +} |
Collapse file Copy file name to clipboardExpand all lines: .github/fork-seams.json +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 25 | 25 | "added": ["...ForkSettings.ForkClientSettingsPatchFields,"] | 26 | 26 | } | 27 | 27 | }, | | 28 | + "packages/client-runtime/package.json": { | | 29 | + "why": "The calm sidebar's shared logic (fork file src/state/threadRoles.ts) is exported for the web and phone lists with one line; it is announced for the sidebar PR that first imports it. One line, since the four-line form's closing brace is a line upstream already has.", | | 30 | + "added": [], | | 31 | + "announced": { | | 32 | + "since": "2026-11-22", | | 33 | + "added": ["\"./state/thread-roles\": \"./src/state/threadRoles.ts\","] | | 34 | + } | | 35 | + }, | 28 | 36 | "packages/shared/src/serverSettings.ts": { | 29 | 37 | "why": "A settings patch's fork fields are applied by forkSettingsPatch.ts, by the rules in forkSettings.ts.", | 30 | 38 | "added": [ | | 549 | 557 | "apps/web/src/clientPersistenceStorage.removedKeys.test.ts", | 550 | 558 | "apps/web/src/components/settings/WaitsAndSlotsSettings*", | 551 | 559 | "apps/web/src/components/settings/waitsAndSlotsSettings*", | | 560 | + "packages/client-runtime/src/state/threadRoles*", | 552 | 561 | "packages/contracts/src/editor.test.ts", | 553 | 562 | "packages/contracts/src/handoff.test.ts", | 554 | 563 | "packages/contracts/src/handoff.ts", | 555 | 564 | "packages/contracts/src/mcpProfile*", | 556 | 565 | "packages/contracts/src/modelPolicy*", | 557 | 566 | "packages/contracts/src/playtest*", | 558 | 567 | "packages/contracts/src/reviewRules*", | | 568 | + "packages/contracts/src/threadRoles*", | 559 | 569 | "packages/contracts/src/usagePacing.ts", | 560 | 570 | "packages/contracts/src/waitFor*", | 561 | 571 | "packages/shared/src/agentSlots*", | |
Collapse file Copy file name to clipboardExpand all lines: .github/scripts/fork-contracts.test.py +121-10Lines changed: 121 additions & 10 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: .github/workflows/fork-secret-scan.yml +18-8Lines changed: 18 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,8 +18,9 @@ name: Fork secret scan | 18 | 18 | # request that check also reads every earlier head of the PR's branch (the scan step), since only | 19 | 19 | # the newest head's check counts. | 20 | 20 | # - workflow_call from fork-secret-sweep.yml (daily, and by hand): the sweep, every ref but pull | 21 | | -# request heads, for what no push run read. Same script and settings; no concurrency group. That | 22 | | -# workflow opens an issue when the sweep fails (a schedule run alerts no one otherwise). | | 21 | +# request heads, for what no push run read. Same script and settings; no concurrency group here | | 22 | +# (that workflow runs its sweeps on one ref one at a time, for the record). That workflow opens | | 23 | +# an issue when the sweep fails (a schedule run alerts no one otherwise). | 23 | 24 | # The scan script always comes from the default branch's tip, never from the checkout: a pull | 24 | 25 | # request or a branch cannot change how it is scanned by editing the script, and an old branch | 25 | 26 | # gets today's scan. The checkout's own copy runs only in the `tests` job, on a runner of its own: | | 72 | 73 | # (on main: a merge after green CI; admins may bypass), and it can only spare tips GitHub's | 73 | 74 | # API calls gone. A run on a tag named like the branch has that name as its head_branch too: | 74 | 75 | # while such a tag exists no record is read (#703); a ruleset that blocks creating it closes | 75 | | - # the case of one created and deleted again. A re-run of a sweep run first takes its own | 76 | | - # earlier attempt's record (#703), a reset run's re-run too. The output `read` says how the | 77 | | - # read ended, for the scan step's partial record. | | 76 | + # the case of one created and deleted again. A re-run of a sweep run is meant to take its own | | 77 | + # newest earlier attempt's record first (#703), a reset run's re-run too; not yet confirmed | | 78 | + # live (#950): when it is not found, a reset run's re-run takes the empty record and any other | | 79 | + # re-run the newest earlier sweep's. Never re-run a finished reset run; start a new reset run | | 80 | + # by hand. The output `read` says how the read ended, for the scan step's partial record. | 78 | 81 | - name: Read the sweep's record | 79 | 82 | id: read | 80 | 83 | if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | | 89 | 92 | mkdir -m 700 -- "$dir" | 90 | 93 | # none STATE WHY: no record. STATE, the output `read`: "none" when no earlier sweep kept one, | 91 | 94 | # "failed" when one may exist but cannot be read or trusted; then a partial record of this | 92 | | - # run must not replace it (#703). | | 95 | + # run must not replace it (#703). A reset run on a branch (its re-run reads its own record) | | 96 | + # takes the empty record instead of "failed": it trusts nothing, so it is always safe, and a | | 97 | + # failed call cannot leave the record from before the reset in use (#791). | 93 | 98 | none() { | 94 | 99 | rm -rf -- "$zip" "$dir/deleted-tips" | | 100 | + if [[ "$1" == failed && "$RESET" == true && "$GITHUB_REF" == refs/heads/* ]]; then | | 101 | + echo "::warning title=Secret scan::$2" >&2 | | 102 | + empty_record | | 103 | + fi | 95 | 104 | echo "read=$1" >> "${GITHUB_OUTPUT:?}" | 96 | 105 | echo "::warning title=Secret scan::$2, so every listed tip is checked as on a first run" >&2 | 97 | 106 | exit 0 | @@ -107,8 +116,9 @@ jobs: | 107 | 116 | fi | 108 | 117 | # reset_record: an empty record (the header only), which the last step keeps even when this | 109 | 118 | # run fails before the scan step writes its own, so no later sweep reads the older one (#703). | 110 | | - # A re-run of a reset run (it keeps the input) first takes its own earlier attempt's record, | 111 | | - # which was written after the reset, and no older run's; without one, the empty record. | | 119 | + # A re-run of a reset run (it keeps the input) first takes its own newest earlier attempt's | | 120 | + # record, which was written after the reset, and no older run's; without one, or when it cannot | | 121 | + # be read, the empty record. | 112 | 122 | empty_record() { | 113 | 123 | echo "fork secret sweep record 2" > "$dir/deleted-tips" | 114 | 124 | echo "read=reset" >> "${GITHUB_OUTPUT:?}" | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/fork-secret-sweep.yml +20-3Lines changed: 20 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,9 +17,20 @@ name: Fork secret sweep | 17 | 17 | # start the record afresh (a tip marked read in error), run this workflow by hand with | 18 | 18 | # reset_record: that run checks every listed tip as on a first run and keeps a new record; if it | 19 | 19 | # fails before the scan writes one, it keeps an empty record (#703), so the old one is not used again. | 20 | | -# A re-run of it goes on from its own first attempt's record. A sweep that starts while the reset | 21 | | -# run is still running reads the old record, and as the newer run its record is the one the next | 22 | | -# sweep reads, so the reset is undone: start the reset when no sweep is running, again if one did. | | 20 | +# A re-run of it is meant to go on from its own newest earlier attempt's record, kept after the | | 21 | +# reset, but that is not yet confirmed live (#950); when that record is not found or cannot be read, | | 22 | +# it starts from the empty record again (#791). | | 23 | +# Sweeps of one ref run one at a time (the concurrency group below, #791): a sweep that starts while | | 24 | +# the reset run is running waits for it, then reads its record, so it cannot undo the reset. GitHub | | 25 | +# keeps one run waiting per group, and a newer run cancels the waiting one (never the running one), | | 26 | +# and the running run always ends, so no run waits for ever. A new sweep cancelled so loses only its | | 27 | +# own run: the newer run (same workflow, same ref) sweeps and alerts the same. A re-run cancelled so | | 28 | +# is not the same: the whole run then shows as cancelled, and the record its earlier attempt kept is | | 29 | +# no longer read (the reader takes only success or failure), so after a reset run the next sweep may | | 30 | +# read the record from before the reset. Never re-run a finished reset run; start a new reset run by | | 31 | +# hand with reset_record. A reset run cancelled so (or by hand) shows as cancelled and is not read: | | 32 | +# start the reset again as a new run by hand with reset_record, not a re-run (a re-run stays the | | 33 | +# older run, and the next sweep reads the newer one's record, from before the reset). | 23 | 34 | # Contract: fork-contracts.test.py (secret-scan). | 24 | 35 | on: | 25 | 36 | schedule: | | 34 | 45 | permissions: | 35 | 46 | contents: read | 36 | 47 |
| | 48 | +# One sweep of a ref at a time, never cancelled by a newer one (see the top): each reads the record | | 49 | +# of the one before it on that branch. Not in fork-secret-scan.yml: a push's scan must not wait. | | 50 | +concurrency: | | 51 | + group: fork-secret-sweep-${{ github.ref }} | | 52 | + cancel-in-progress: false | | 53 | + | 37 | 54 | jobs: | 38 | 55 | sweep: | 39 | 56 | name: Secret sweep | |
Collapse file Copy file name to clipboardExpand all lines: docs/fork/agent-rules.md +2-1Lines changed: 2 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,8 @@ Where a tool enforces a rule, the tool is the authority. | 55 | 55 | - Never update pull request branches by hand when a merge queue does it. _Why: it restarts every CI at once._ | 56 | 56 | - Reports, handoffs and review notes go in the pull request or an issue. _Why: the repository holds current text._ | 57 | 57 | - Reviews follow the [review skill](../../fork-kit/review/SKILL.md) (weights, the state question, round limit); | 58 | | - never restate it. _Why: one source._ | | 58 | + never restate it; its `plan` and `check` take `--settings .github/fork-review-kit.json` here. _Why: one source; | | 59 | + without it the kit reads no queue config and plans one lens._ | 59 | 60 | - No `git stash`; edit tracked files in place. _Why: worktrees share the stash; a move drops `+x`._ | 60 | 61 | - In a fork: build on upstream's mechanisms, check upstream first, never push, comment or open anything upstream. | 61 | 62 | _Why: thin forks rebase cleanly; upstream is the owner's._ | |
Collapse file Copy file name to clipboardExpand all lines: fork-ci/RELEASE-NOTES.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,13 @@ nothing. | 13 | 13 |
| 14 | 14 | ## After ci/v14 | 15 | 15 |
| | 16 | +### pr-queue: what counts as a `state:` line is gate code (#797) | | 17 | + | | 18 | +`review_judge.has_state_line` holds the rule for a lens report's `state:` line (an answer after the colon, outside code | | 19 | +blocks and quotes). The gate still parses `state_line` without enforcing it, so nothing a caller sees changes. The | | 20 | +review kit (fork-kit/review) now imports this rule and the gate's `head_check.changed_paths` instead of its own | | 21 | +copies, so run the kit from a checkout at the release the gate pins (kit README, "Which fork version"). | | 22 | + | 16 | 23 | ### pr-queue and head-check: every rule hit gives its lenses (#82) | 17 | 24 |
| 18 | 25 | With a `review` block in `enforce`, the required lenses are now the lenses of every rule a changed path counted for, | |
Collapse file Copy file name to clipboardExpand all lines: fork-ci/actions/pr-queue/review_judge.py +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 34 | 34 | until a person's override for the head, newer than every lens comment, lets it through (it alone is enough: it | 35 | 35 | also waives the approach lens). Owner decision: issue #100. | 36 | 36 | Pure as judge is: the lens comments come in (lens.Review.lens_scan), the verdict goes out. | | 37 | +
| | 38 | +has_state_line says what counts as a report's `state:` line (the answer to the state question). The `state_line` | | 39 | +setting is parsed but not enforced yet; the review kit (fork-kit/review, `check`) imports this rule, so the gate and | | 40 | +the kit read one rule when the gate starts enforcing it. | 37 | 41 | """ | 38 | 42 | import html | 39 | 43 | import re | @@ -367,6 +371,15 @@ def read_findings(body): | 367 | 371 | return [found[i] for i in sorted(found)], seen >= set(BLOCKING) | 368 | 372 |
| 369 | 373 |
| | 374 | +STATE_RE = re.compile(r'state\s*:\s*\S', re.I) | | 375 | + | | 376 | + | | 377 | +def has_state_line(body): | | 378 | + """A `state:` line with an answer (anything but blanks after the colon), outside fenced and indented code blocks and | | 379 | + quotes, read as a lens header is (folded, markdown and list markers stripped: `**State:** ok`, `- state: ok`).""" | | 380 | + return any(STATE_RE.match(lens.norm_line(fold(raw))) for raw in lens.plain_lines(body)) | | 381 | + | | 382 | + | 370 | 383 | def findings(body): | 371 | 384 | """[(kind, line)] of the report's blocker and major findings (read_findings).""" | 372 | 385 | return read_findings(body)[0] | |
Collapse file Copy file name to clipboardExpand all lines: fork-ci/actions/pr-queue/review_judge.test.py +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -193,6 +193,19 @@ def group(name): | 193 | 193 | return [v for v in FINDINGS if v['group'] == name] | 194 | 194 |
| 195 | 195 |
| | 196 | +class StateLine(unittest.TestCase): | | 197 | + """has_state_line: what counts as a report's `state:` line (the review kit imports it; the gate parses | | 198 | + `state_line` but does not enforce it yet).""" | | 199 | + | | 200 | + def test_an_answered_state_line_outside_code_and_quotes(self): | | 201 | + for body, said in (('state: a second run does nothing', True), ('**State:** fine', True), | | 202 | + ('- state: fine', True), ('STATE : fine', True), ('state:', False), ('state: ', False), | | 203 | + ('the state is fine', False), ('```\nstate: fine\n```', False), ('> state: fine', False), | | 204 | + (' state: fine', False)): | | 205 | + with self.subTest(body=body): | | 206 | + self.assertIs(rj.has_state_line(f'lens: code\n{body}\nblocker: none\n'), said) | | 207 | + | | 208 | + | 196 | 209 | class Findings(unittest.TestCase): | 197 | 210 | def test_every_shared_findings_vector(self): | 198 | 211 | for v in FINDINGS: | |
|