Skip to content

fix(lint): scope the host group's seam register to that feature's own diffs - #484

Merged
nplez1 merged 1 commit into
mainfrom
nplez1/fork-lint-seams-scope
Nov 26, 2026
Merged

nplez1 merged 1 commit into
mainfrom
nplez1/fork-lint-seams-scope

Conversation

@nplez1

@nplez1 nplez1 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Refs #471 — unblocks it, and every other branch that edits an upstream file.

The problem

#466 added local/checks/host-mesh-upstream-seams.mjs to local/gate-lint.mjs, which runs on every pull request
(.github/workflows/fork-pr-gates.yml). The register failed on any upstream-owned file a diff touched, so
from that merge the lint gate was red for every branch that fixes an upstream bug. The first branch to run it was
#471, a workspace empty-tabs fix that touches eight upstream renderer files and no host-group seam at all:

config/main-layout-writer-baseline.txt: an upstream file this feature has no declared seam for (2 line(s)).
src/renderer/src/components/tab-group/workspace-model/useTabGroupWorkspaceModel.ts: … (27 line(s)).
… six more, exit 1

A register of one feature's surface cannot demand a declaration from features it does not describe.

The fix

  • The refusal is scoped to the diff. An upstream file the register does not declare is a failure only when
    the diff also touches this feature's own code — a host-mesh / host-graph / host-group path segment that
    upstream's tree does not have, and that is not under local/ (the ledgers are not shipped code, and the
    measured surface already ignores them). Fork-owned code is what tells the host group's branch apart from a
    branch fixing an upstream bug. Any other feature's upstream edits are reported as notes.
  • The host group's guarantee is unchanged where it matters. A declared seam past its budget still fails
    hard, with or without the flag.
  • A sync never derives that strictness. A sync's diff is upstream's own work and its resolution rewrites
    feature files as a matter of course, so the recorded sync base moving in the diff exempts it. --strict
    forces the red for a diff carrying no feature file of its own (a seam-only change, or a sync judged
    deliberately).
  • Latent crash fixed. The verbose listing read seam.budget for every touched file. No run reached it while
    an undeclared file exited first; with notes it was the next thing to run.

local/gate-lint.mjs keeps running the check without --strict, because the diff now decides.
LOCAL-PATCHES.md § local(hosts) and local/design/host-mesh.md § Upstream sync surface carry the reasoning,
the two limits (per-diff, not cumulative budgets; a seam-only diff needs --strict) and the evidence.

Verification

Check Result
node --test local/checks/host-mesh-upstream-seams.test.mjs 8 passed — including a fixture where a fork-owned src/shared/host-mesh/ commit plus an undeclared upstream file is a problem, and the same diff carrying the sync-base record is not
pnpm check:changed 5 of 5 passed
orca-queue node local/gate-lint.mjs lint gate @f99741e37c8: PASS — 54 green, 1 failing: 3 known red, 0 new; 55 steps; 92.0 s (the three known reds are the host group's max-lines rows, already in local/lint-known-red.json)
node local/checks/host-mesh-upstream-seams.mjs --base origin/main on #471's tree exit 1 before → exit 0 after, 8 notes; --strict still exit 1
Gate 1 not required — this diff is local/** and *.md only

Reviewed by Opus 5.5, high: R1 (1 blocking fixed), delta on R2 (1 blocking fixed)

R2's delta found that the first cut keyed on three directory prefixes, which missed src/shared/host-mesh/,
src/main/ipc/host-graph/, src/cli/specs/host-mesh.ts and the renderer's host-group/. Matching on the path
segment, joined with upstream ownership, is the fix, and the fixture test covers it; that round's two NITs are
in as well. A third round was not run — § PR gate 2 requires sign-off for one, so say the word and it runs
before this merges.

🤖 Generated with Claude Code

…er feature's PR

#466 wired `check-host-mesh-upstream-seams` into the lint gate, where it runs on every pull
request, and it failed on any upstream-owned file a diff touched. The first branch to run it
after that merge was #471, a workspace state fix touching eight upstream renderer files and no
host-group seam at all, so the gate went from green to red for a whole class of work.

A register of one feature's surface cannot demand a declaration from features it does not
describe. The budget of a declared seam still fails hard — that is the guarantee the file
exists to keep — and an undeclared upstream file is reported as a note. `--strict` restores
the red for the host group's own branches, where an undeclared hook is exactly the sprawl the
check was built to catch.

The same change fixes a latent crash the old exit-early path hid: the verbose listing read
`seam.budget` for every touched file.
@nplez1
nplez1 merged commit 1c437ac into main Nov 26, 2026
3 checks passed
@nplez1
nplez1 deleted the nplez1/fork-lint-seams-scope branch November 26, 2026 08:21
nplez1 added a commit that referenced this pull request Nov 26, 2026
main's #484 scoped `check-host-mesh-upstream-seams` to the host group's own
diffs: an undeclared upstream file is a note for any other feature, and only a
declared seam's budget fails hard either way.

This diff carries no hosts path, so the row was not required — and keeping it
would have put a hard budget on a test file that is not hosts work, so the next
branch to grow it would red the lint gate for a reason #484 exists to remove.
The register is main's file again; the entry records why, and its anchors are
the two `it(...)` titles.
nplez1 added a commit that referenced this pull request Nov 26, 2026
main's #484 scoped `check-host-mesh-upstream-seams` to the host group's own
diffs: an undeclared upstream file is a note for any other feature, and only a
declared seam's budget fails hard either way.

This diff carries no hosts path, so the row was not required — and keeping it
would have put a hard budget on a test file that is not hosts work, so the next
branch to grow it would red the lint gate for a reason #484 exists to remove.
The register is main's file again; the entry records why, and its anchors are
the two `it(...)` titles.
lab-agent-np Bot added a commit that referenced this pull request Nov 26, 2026
* local(test): the perf contract Windows reddens on wall clock, not its count

fork-performance-contracts reddened on main at 767c078 (run 45683322849):
the windows-latest leg timed out at 30s on
journal-domain-operation-window.performance.test.ts:377, while the other two
legs passed and the 11-23 run was green only because the file had not reached
main yet.

The contract counts rows returned, not time. Its fixture builds ten chats of up
to 500 turns in tmpdir(), which is 1.6s here and 33,065ms on windows-2022 —
Defender scans every write, so the per-turn cost is ~20x and no product code is
slow.

Two closing }) lines become }, 120_000): the failing test, which upstream fixed
the same way in 7b6c852 (stablyai#47789) after our sync base, and the file's other
fixture-heavy test, which passed by 3.5s on that runner (26,488ms of 30s on
windows-2022, 18,920ms on ubuntu-24.04) and is the slowest test in the lane.

No allowlist widened: both tests still run on all three legs and assert the
same counts. LOCAL-PATCHES.md carries the reason and the anchors.

* local(test): the timeout bumps carry the reason the flaky-test ratchet demands

`pnpm check:changed` refused the two `}, 120_000)` lines: the fork's
`test-timeout-needs-reason` rule requires a reason comment directly above a
per-test timeout, and that rule is right — it is what stops a timeout bump from
hiding a slow test.

Each comment is one line marked `fork-comment-ok:`, so
`check-upstream-file-comments` stays at 4764/4764 rather than growing: the
reason belongs in LOCAL-PATCHES.md, and the marker is the documented way to put
the pointer above upstream's code.

Also corrects the entry from the review: twelve chats, not ten, and the Defender
explanation is stated as the likely cause rather than a measured one.

* local(test): declare the test file's six-line seam, as the seams register requires

`gate-lint`'s `check-host-mesh-upstream-seams` refused the change: an
upstream-owned file the fork touches must be a declared seam with a measured
budget, so the surface a sync pays for stays visible instead of silent.

Budget 6 is what this costs today (two timeouts, two reason comments, two
replaced lines). It only shrinks: the next sync brings upstream's own
`}, 120_000)` and comment, after which our line there is identical.

* local(test): record the green Windows run, and what the sync will collide with

The delta review found the entry claiming the next sync "needs no decision": upstream
7b6c852 inserts its comment at exactly the spot our `fork-comment-ok:` line
occupies, so that hunk collides. The resolution is now written down: keep
upstream's comment, drop ours, keep the timeout.

The run evidence replaces the forward reference: run 45780910456 at 803bad1
is green on all three legs, the test that reddened taking 26,610 ms against
33,065 ms on the red run.

* local(test): name both dispatches, and the tests by title rather than by line

R3's minors: the entry credited only one of the two green dispatches, and the
line numbers are where the tests sat on the red run — they have moved. The
seam paragraph names the test it means instead of "the second".

* local(test): drop the seam row #484 made unnecessary, and wrong to keep

main's #484 scoped `check-host-mesh-upstream-seams` to the host group's own
diffs: an undeclared upstream file is a note for any other feature, and only a
declared seam's budget fails hard either way.

This diff carries no hosts path, so the row was not required — and keeping it
would have put a hard budget on a test file that is not hosts work, so the next
branch to grow it would red the lint gate for a reason #484 exists to remove.
The register is main's file again; the entry records why, and its anchors are
the two `it(...)` titles.

* local(test): record the post-rebase run, and the two anchors without repeating them

R4's minors: the seam paragraph pointed at "the anchors below" when they sit above
it and repeated the allowlist paragraph's sentence; and the Verified paragraph
credited two of the three pre-rebase dispatches while saying three.

The run at 449bc7d — the rebased branch — is green on all three legs, the
test that reddened taking 26,170 ms.

Rebased again onto 8293fd7 (#471), which pruned the comment baseline by one:
the entry's 4764/4764 is now 4763/4763.

---------

Co-authored-by: Nathan Plesnicher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant