Skip to content

sync-skill: adopt new lint rules automatically, and make the post-merge ancestry check load-bearing - #83

Merged
zpyoung merged 6 commits into
mainfrom
sync-lessons/v1.4.205
Sep 27, 2026
Merged

zpyoung merged 6 commits into
mainfrom
sync-lessons/v1.4.205

Conversation

@zpyoung

@zpyoung zpyoung commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​141 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​117

What misled the run

The v1.4.205 sync failed its lint gate on eleven anti-slop findings. The reference's
"When upstream tightens the linter" section says to diagnose that with:

git diff "$ORIGIN_MAIN_OLD" HEAD -- .oxlintrc.json     # did the merge add rules?

At 86dc3caa11 against tag v1.4.205 (11aba8bdc5) that prints nothing:

$ git diff v1.4.204 v1.4.205 -- .oxlintrc.json
$

Eight rules had in fact been enabled. They live in a config the check never looks at, added by
11180fa532 (stablyai#20726) and turned on across b79206533e, c9ae17fe3d, 49e5fa597a, 775a932651,
22ce8d69a1, f107499e44, bfdec26352, 231e805b1e:

$ git show v1.4.205:config/oxlint-anti-slop.json | grep '"error"'
    "anti-slop/no-module-mocking": "error",
    "anti-slop/no-object-parameters": "error",
    "anti-slop/no-reduce-accumulator-copy": "error",
    "anti-slop/no-reflect-apply": "error",
    "anti-slop/no-reflect-get": "error",
    "anti-slop/no-shape-in-symbol-names": "error",
    "anti-slop/no-unknown-type-aliases": "error",
    "anti-slop/no-widen-then-assert": "error"

and they run through a new pnpm lint sub-step rather than the root oxlint invocation:

$ git diff v1.4.204 v1.4.205 -- package.json | grep -E '^\+.*audit:anti-slop'
+    "lint": "oxlint && pnpm run audit:anti-slop && ...
+    "audit:anti-slop": "node config/scripts/sync-anti-slop-plugin.mjs && oxlint --config config/oxlint-anti-slop.json src config tests mobile --deny-warnings",

Answering the documented check and stopping there points the next run at -X ours damage for a
failure that is toolchain tightening.

What the edit changes

The diagnosis block now diffs every config/oxlint-*.json and package.json's lint script
alongside .oxlintrc.json. The lint-script diff earns its place twice: package.json is a
whole-file fork exception, so a new sub-step only reaches the fork's tree if the ours.txt audit
three-way-merges it — otherwise the local gate passes while PR CI, which runs the step from its own
workflow, fails.

Two hard limits are also written down, both derived under pressure by this run:

  • A rule family can be entirely un-fixable. oxlint --config config/oxlint-anti-slop.json --fix
    rewrote none of the eleven findings, so "only what --fix rewrites on its own" left no legal
    move. The existing text reads as though --fix is the normal outcome. A rename is tempting to
    call mechanical; the boundary written after v1.4.184 is a human's answer to exactly that.
  • A violation can belong to upstream. src/shared/agent-status-legacy-adapter.ts:95 is
    byte-identical to the tag, as are config/oxlint-anti-slop.json and pnpm-lock.yaml, so
    v1.4.205 fails the rule it shipped. Upstream fixed it on trunk already
    (Reflect.get → Object.getOwnPropertyDescriptor), which the reference forbids backporting, and
    it cannot be pre-fixed on main because the file does not exist there. Unless the escalation
    names it separately, a rerun re-escalates on that one file after the fork-side ones are fixed.

Scope

.claude/skills/sync-upstream/references/file-ownership.md only. No change to SKILL.md's
## Hard safety rules or to the fix policy's never-list; the two additions here tighten the
reference's own Hard limits list rather than relaxing anything.

The v1.4.205 sync itself did not land — origin/main is unchanged at 86dc3caa11, backup at
origin/backup/main-20260917-140138Z. Ledger: bug-137 (upstream's violation), bug-138
(the six fork-side ones), test-gap-139.


Second run, same tag: three more rules (e8ac295d3a)

A second run against v1.4.205 reached the same escalation and hit three further things the skill
did not warn about. Each edit lands in the step that owns it; nothing here changes what a gate checks.

A squashed predecessor moved the merge base back a release — Step 2, Step 11

$ git rev-list --parents -n1 86dc3caa11        # the v1.4.204 sync PR, #82
86dc3caa11f29bda1bf7dd3055fcbc10be09efbd b9b5429f9c3358eeaa3477a1e78a946827a1ee7d
$ git merge-base --is-ancestor v1.4.204 origin/main; echo $?
1
$ git log --oneline -1 $(git merge-base origin/main v1.4.205)
ca2356c194 feat(native-chat): decide a restart-stranded send against provider history (#20139)

One parent, and v1.4.204 is not in the lineage. main still carries that release's content, so
nothing looks wrong — but git merge v1.4.205 resolved its base to a v1.4.203-era commit and
produced 2,536 differing paths and 287 conflicted files for what should have been a one-release
step.

No existing check reports it. Step 11's merge-base --is-ancestor "$UPSTREAM_TARGET" origin/main
passes either way, because a squash carries content forward while dropping the commit — which is why
#82 went unnoticed until the next day's merge. Step 2 now checks $PREV_TAG before merging; Step 11
now counts the merged tip's parents, the only check a squash fails.

allow_merge_commit is true on the repo, so this was a UI choice rather than a settings block and
Step 11's --merge still works.

An escalating run threw away a complete resolution — Step 8

Step 8's abort path resets to $ORIGIN_MAIN_OLD. On a lint-tightening escalation the resolution is
already finished and correct — only a human decision blocks it — so the reset costs hours the rerun
has to redo. The edit tags it first; a tag in the shared .git outlives the run's worktree. This
run's is sync-resolved/v1.4.205-20260917 at 647ab0aac9, carrying the merge, the ownership
resolution, six -X ours repairs, nine ours.txt three-way merges, the tier-2 replay and the
re-baselined residuals.

The worktree arrived dirty with something that was not work — Step 4

$ git status --porcelain
 M pnpm-lock.yaml
$ pnpm -v
10.29.2
$ grep -m1 packageManager package.json
  "packageManager": "pnpm@12.0.0+sha512...

packageManager is not self-enforcing here (orca ledger bug-3), so the worktree setup installed
under ambient pnpm 10 and rewrote the pnpm-12 lockfile in place — that one file, its
packageManagerDependencies block dropped and the rest reflowed. Step 4's empty-porcelain check
reads that as "the workspace holds someone's work" and stops the day.

It is machine noise, and the very next line of Step 4 would discard it anyway. git checkout -- pnpm-lock.yaml plus a corepack pnpm shim on PATH gave a clean pnpm install --frozen-lockfile
and a clean tree, and every later step ran normally. The shim has to be on PATH rather than only
in the run's own calls, because repo scripts invoke bare pnpm internally. Anything else dirty is
still a stop.

Two repairs to the section above

The lint-rule commit left its own section self-contradictory: the "get ahead of the next release"
rehearsal still swapped only .oxlintrc.json — the thing the same section had just finished saying
is not the question. Replaced with the two diffs, plus a note that the rehearsal must then run
whatever they name; for v1.4.205 that meant installing the pinned plugin and running
audit:anti-slop.

And one line on the upstream-side-violation limit: it can be proved deterministic from three
git diff --quiet calls — lint config, plugin pin in package.json, and the violating file all
byte-identical to the tag — rather than by checking the tag out, which the vitest case above it
requires but lint does not.

Not changed

## Hard safety rules and the fix policy's "Never, on either gate" list are untouched. The
escalation both runs took is what those rules are for. The outstanding decision is decision-5 in
the orca ledger, and none of these edits would have changed it.

v1.4.205 left .oxlintrc.json byte-identical and added its eight new
rules in config/oxlint-anti-slop.json, behind a new audit:anti-slop
step in package.json's lint script. The documented diagnostic diffs
only .oxlintrc.json, so it answers "no new rules" when there are
eight, and the run reads the lint failure as merge damage instead.

Diff every config/oxlint-*.json and the lint script too. The lint
script matters twice over: package.json is a whole-file fork
exception, so a new sub-step only reaches the fork's tree if the
ours.txt audit three-way-merges it.

Also record two hard limits the run had to derive under pressure: a
rule family can be entirely un-fixable, so "only what --fix rewrites"
can leave no legal move at all; and a violation in a file identical
to the tag is upstream's release failing its own rule, which is a
different decision from the fork-side ones and has to be named
separately or the rerun re-escalates on it alone.
… resolution

Four rules this run had to derive, each in the step that owns it.

Step 2: check that $PREV_TAG is still an ancestor of main. #82 was
squash-merged, so v1.4.204's content is on main but its commit is not in
the lineage, and `git merge` silently resolved v1.4.205 against a
v1.4.203-era base — 2,536 differing paths and 287 conflicted files for a
one-release step. Nothing else reports it.

Step 11: count the parents of the merged tip. That is the only check a
squash fails; `merge-base --is-ancestor $UPSTREAM_TARGET origin/main`
passes either way, which is why #82 went unnoticed for a day.

Step 8: tag the resolution before the abort reset. An escalating run has
usually produced a complete resolution that only a human decision blocks,
and the tag outlives the worktree, so the rerun starts from it.

Step 4: the ambient-pnpm lockfile rewrite is machine noise, not someone's
work. package.json's packageManager pin is not self-enforcing here, so the
setup install can rewrite the pnpm-12 lockfile with pnpm 10; restore that
one file and run behind a corepack shim rather than stopping the day.

Also repairs a contradiction the lint-rule commit before this one left in
place: that section's own get-ahead rehearsal still swapped only
.oxlintrc.json, the thing it had just finished saying is not the question.
And records that an upstream-side violation can be proved deterministic
from three byte-identical inputs, without checking out the tag.
@zpyoung zpyoung changed the title sync-skill: new lint rules can land outside .oxlintrc.json, and a rule family can be entirely un-fixable sync-skill: find lint rules outside .oxlintrc.json, catch a squashed predecessor, keep an escalated resolution Sep 17, 2026
A stable tag can enable a whole rule family that `oxlint --fix` cannot
rewrite. v1.4.206's anti-slop plugin turned on eight such rules; not one
is auto-fixable, so the previous "only what --fix rewrites on its own"
limit left a run with no legal move and stalled the v1.4.205 sync with
every other check green.

Adopting a new rule in fork-owned files is now in scope and is never an
escalation by itself. The guardrail is upstream's own adoption commit for
that rule, which the run has to read first — it ran the same rule over its
own tree in the same release, so its renames are the reference answer for
what the rule wants. v1.4.206 gave the whole vocabulary that way:
isSkillsCliAgentKeyShaped -> isUsableSkillsCliAgentKey, RootShape ->
RootLayout, and typed property access in place of Reflect.get.

The limits now bound how the fix is written rather than whether it happens:
names and types only, never a branch or a message; no --fix-suggestions or
--fix-dangerously; never a config edit or a suppression entry. Two cases
still need a person, and both are one file rather than the run — a rule
upstream's own release violates in its own file (retarget to a newer stable
tag first, which usually dissolves it), and a violation that cannot be
cleared without changing what the code does.

Also make Step 11's is-ancestor check load-bearing. PR #82 was
squash-merged, so v1.4.204's commit is not in main's ancestry; the fork
ownership guard falls back to the newest tag it can reach and has been
comparing every PR against v1.4.203, reporting ~25 false residual drifts
on PRs that touch nothing.
@zpyoung zpyoung changed the title sync-skill: find lint rules outside .oxlintrc.json, catch a squashed predecessor, keep an escalated resolution sync-skill: adopt new lint rules automatically, and make the post-merge ancestry check load-bearing Sep 18, 2026
…-lessons/v1.4.205

# Conflicts:
#	.claude/skills/sync-upstream/SKILL.md
#	.claude/skills/sync-upstream/references/file-ownership.md
# Conflicts:
#	.claude/skills/sync-upstream/SKILL.md
@zpyoung
zpyoung merged commit 0f47486 into main Sep 27, 2026
28 checks passed
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