Skip to content

fix(skills): trust the updater's lock when a run installs content newer than the bundle - #11220

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/skill-update-verdict-trusts-lock
Jul 28, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/skill-update-verdict-trusts-lock

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

The false-failure loop

npx skills update installs source-repo HEAD, which routinely runs ahead of the revisions a shipped build bundles. After a clean run:

  1. The post-run re-scan hashes the installed content against the bundled snapshot registry, which has never seen it → unrecognized.
  2. skillUpdateFailedNames counts unrecognized as not-landed → run state error → "Some skills could not be updated.", dialog "The update didn't finish / Updated 0 of N skills", yellow "Update failed" status segment.
  3. Retry re-runs the same names, the CLI no-ops (lock already equals source), the re-scan returns the same verdict — the false failure repeats indefinitely.

The newer-known escape hatch built for exactly this case is structurally unreachable: generate-skill-bundle-manifest.mjs always points the current manifest at the registry's newest snapshot, so max(registry revision) == manifest revision in every shipped build and no observed content can classify as a known newer revision. 7 of 8 bundled skills have drifted upstream since v1.4.151 alone, so on any shipped release the loop arms the moment a skill changes on main.

The disk-matches-lock rule

The verdict now computes the git tree sha of the observed bytes and treats an unrecognized convergent placement as landed when that sha equals the lock's skillFolderHash:

  • The lock is the CLI's own record of what it installed. Disk matching lock means the command did its job — the bundled registry simply hasn't seen that revision yet.
  • The tree hashing is a port of the generator's (skill-git-tree-identity.ts), and two tests keep it honest: every shipped skill's folder must hash to the exact gitTreeSha the bundled manifest records, and a synthetic fixture (nested dirs, executable, binary bytes, the z.txt-vs-z/ ordering edge) must match real git write-tree.
  • Hashing is over raw bytes on purpose: a CRLF materialization (Windows checkout) will not match the source tree sha and fails closed to today's behavior.

Nothing else is forgiven — tests pin that a half-written bundle (sha mismatch), a missing lock entry, an unreadable copy, a removed skill, a degraded provider-alias beside a lock-matching canonical copy, and an outdated copy sitting at the lock hash all still fail. An integration test builds the real post-cut state (temp HOME, real bundled artifacts, current bytes + an upstream edit, lock at that tree sha) and asserts an empty failed-names list; it fails on main today.

Only the run verdict changes. Freshness classification (unrecognized status, badges) and update eligibility are untouched.

…er than the bundle

skills update installs source-repo HEAD, which routinely runs ahead of the
revisions a shipped build bundles. The post-run re-scan hashed that content
'unrecognized' (the registry has never seen it) and the verdict counted it as
a failure — so a clean update reported "The update didn't finish / Updated 0
of N", and Retry repeated the false failure forever because the CLI now
no-ops (lock == source). The 'newer-known' escape hatch never fires: the
generator always points the manifest at the registry's newest snapshot, so no
observed content can hash to a revision newer than the bundle.

The verdict now computes the git tree sha of the observed bytes (a port of
the generator's hashing, verified byte-for-byte against git write-tree and
against every shipped skill's manifest gitTreeSha) and accepts an
unrecognized placement when that sha equals the lock's skillFolderHash: the
lock is the CLI's own record of what it installed, so disk matching lock
means the command did its job — the bundled registry simply has not seen
that revision yet.

Half-written bundles (sha mismatch), unreadable copies, removed skills,
degraded aliases, and outdated copies at the lock hash all still fail.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds Git-compatible tree hashing for observed skill packages, including executable modes, binary contents, nested directories, and Git ordering rules. Observed package and freshness installation records now carry the resulting tree SHA or null when unavailable. Update rescans read global skill locks, and skillUpdateFailedNames treats unrecognized installations as landed only when their observed tree SHA matches the corresponding lock. Tests cover manifest parity, Git parity, lock matching, mismatches, aliases, and real inventory scenarios.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change well, but it does not follow the required template and omits Screenshots, Testing, AI Review Report, Security Audit, and Notes. Rewrite the PR description using the repository template and add the missing sections, especially Testing, AI Review Report, Security Audit, and Notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: using updater lock state to avoid false skill update failures.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 33c42116-f33f-4ec0-839b-fccf0bd01681

📥 Commits

Reviewing files that changed from the base of the PR and between 6d4e335 and eed056d.

📒 Files selected for processing (8)
  • src/main/ipc/skills.ts
  • src/main/skills/skill-freshness-placement-observation.ts
  • src/main/skills/skill-git-tree-identity.test.ts
  • src/main/skills/skill-git-tree-identity.ts
  • src/main/skills/skill-package-identity.ts
  • src/main/skills/skill-update-outcome.test.ts
  • src/main/skills/skill-update-outcome.ts
  • src/shared/skill-freshness.ts

Comment on lines +53 to +59
const env = { ...process.env, GIT_CONFIG_GLOBAL: devNull, GIT_CONFIG_SYSTEM: devNull }
execFileSync('git', ['init', '--quiet', repoShell], { env })
const gitDirArgs = ['--git-dir', join(repoShell, '.git'), '--work-tree', work]
execFileSync('git', [...gitDirArgs, '-c', 'core.autocrlf=false', 'add', '-A'], {
env,
cwd: work
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Windows portability of the git parity fixture.

os.devNull resolves to \\.\nul on Windows; Git's config loader does not reliably accept that as a config path, and the test also assumes a git binary on PATH. Consider NUL on win32 (or GIT_CONFIG_NOSYSTEM=1 plus GIT_CONFIG_GLOBAL pointing at a temp empty file) so the fixture behaves identically across hosts.

As per coding guidelines, "code, commands, and scripts must work on macOS, Linux, and Windows."

🔧 Suggested env hardening
-    const env = { ...process.env, GIT_CONFIG_GLOBAL: devNull, GIT_CONFIG_SYSTEM: devNull }
+    const emptyConfig = join(base, 'empty.gitconfig')
+    await writeFile(emptyConfig, '')
+    const env = {
+      ...process.env,
+      GIT_CONFIG_NOSYSTEM: '1',
+      GIT_CONFIG_GLOBAL: emptyConfig,
+      GIT_CONFIG_SYSTEM: emptyConfig
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const env = { ...process.env, GIT_CONFIG_GLOBAL: devNull, GIT_CONFIG_SYSTEM: devNull }
execFileSync('git', ['init', '--quiet', repoShell], { env })
const gitDirArgs = ['--git-dir', join(repoShell, '.git'), '--work-tree', work]
execFileSync('git', [...gitDirArgs, '-c', 'core.autocrlf=false', 'add', '-A'], {
env,
cwd: work
})
const emptyConfig = join(base, 'empty.gitconfig')
await writeFile(emptyConfig, '')
const env = {
...process.env,
GIT_CONFIG_NOSYSTEM: '1',
GIT_CONFIG_GLOBAL: emptyConfig,
GIT_CONFIG_SYSTEM: emptyConfig
}
execFileSync('git', ['init', '--quiet', repoShell], { env })
const gitDirArgs = ['--git-dir', join(repoShell, '.git'), '--work-tree', work]
execFileSync('git', [...gitDirArgs, '-c', 'core.autocrlf=false', 'add', '-A'], {
env,
cwd: work
})
🧰 Tools
🪛 ast-grep (0.45.0)

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

Source: Coding guidelines

Comment on lines +56 to +60
return (
entry.status === 'unrecognized' &&
lockHash !== undefined &&
entry.observedGitTreeSha === lockHash
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect how skillFolderHash is produced/consumed elsewhere in the repo.
rg -n 'skillFolderHash' -C3 --type=ts --type=js --type=md
fd -t f -e mjs -e ts . config scripts 2>/dev/null | xargs rg -n 'gitTreeSha|toString\(.hex.\)' -C2

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -u

echo "Files matching skill-update-outcome:"
fd -v 'skill-update-outcome' . -t f -e ts -e tsx -e js -e jsx 2>/dev/null || true

file="$(fd 'skill-update-outcome' . -t f -e ts -e tsx -e js -e jsx | head -n 1 || true)"
if [ -n "${file:-}" ]; then
  echo "--- outline ---"
  ast-grep outline "$file" --view compact 2>/dev/null || true
  echo "--- contents ---"
  cat -n "$file"
fi

echo
echo "Relevant symbols/usages:"
rg -n "skillFolderHash|observedGitTreeSha|skillPackageGitTreeSha|readGloballyUpdatableSkillLocks|updateOutcome|is.*Convergent|Convergent|lockHash" . \
  -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx' -g '*.md' || true

echo
echo "Deterministic comparison behavior probe:"
node - <<'JS'
const a = 'abc123';
const b = 'ABC123';
const c = ' abc123 ';
console.log(JSON.stringify({
  a_eq_b: a === b,
  a_trim_eq_c: a === c.trim(),
  a_trim_toLower_eq_c_trim_toLower: a.trim().toLowerCase() === c.trim().toLowerCase(),
  b_trim_toLower_eq_b_trim_toLower: a.trim().toLowerCase() === b.trim().toLowerCase(),
}));
JS

Repository: stablyai/orca

Length of output: 15752


🏁 Script executed:

#!/bin/bash
set -u

for f in src/main/skills/skill-update-outcome.ts src/main/skills/skill-update-registration.ts src/main/skills/skill-git-tree-identity.ts src/main/skills/skill-package-identity.ts src/main/skills/skill-update-convergence.ts; do
  if [ -f "$f" ]; then
    echo "--- $f outline ---"
    ast-grep outline "$f" --view compact 2>/dev/null || true
    echo "--- $f relevant contents ---"
    nl -ba "$f" | sed -n '1,130p'
  fi
done

echo "--- case/whitespace normalization references ---"
rg -n "trim\(\$\)|trim\(\)|toLowerCase\(\$1\)|toLowerCase\(\)|toUpperCase\(\)|hex" src/main/skills src/shared -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx' || true

echo "--- git command usage in skill identity files ---"
rg -n "git object|git hash-object|git ls-tree|git rev-parse|sha1|toString\([^)]*hex[^)]*\)|Buffer|createHash" src/main/skills/skill-git-tree-identity.ts src/main/skills/skill-package-identity.ts src/main/skills/skill-update-registration.ts -C3

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -u

for f in src/main/skills/skill-update-outcome.ts src/main/skills/skill-update-registration.ts src/main/skills/skill-git-tree-identity.ts src/main/skills/skill-package-identity.ts src/main/skills/skill-update-convergence.ts; do
  if [ -f "$f" ]; then
    echo "--- $f lines 1-130 ---"
    awk '{ printf "%3d\t%s\n", NR, $0 }' "$f" | sed -n '1,140p'
  fi
done

echo "--- skill-update-outcome specific lines ---"
awk '{ printf "%3d\t%s\n", NR, $0 }' src/main/skills/skill-update-outcome.ts | sed -n '40,70p'

echo "--- read lock trimming/filtering in registration ---"
awk '{ printf "%3d\t%s\n", NR, $0 }' src/main/skills/skill-update-registration.ts | sed -n '30,85p'

echo "--- git-tree identity hashing implementation ---"
awk '{ printf "%3d\t%s\n", NR, $0 }' src/main/skills/skill-git-tree-identity.ts | sed -n '1,100p'

Repository: stablyai/orca

Length of output: 24298


Normalize the lock hash before comparing it to the computed tree SHA.

skillPackageGitTreeSha emits lowercase hex, while skillFolderHash is read directly from the lock without trimming or normalization. Use the same lowercase form for the comparison so an uppercase lock value does not prevent a valid post-cut update from landing.

Comment on lines +84 to +85
/** Git tree sha of the observed bytes; lets the post-run verdict match disk against the updater's lock. */
observedGitTreeSha?: string | null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Optional field relies on implicit undefined-fails-closed semantics

observedGitTreeSha is typed as ?: string | null, so an object without the field (from deserialized pre-PR data or a construction site that hasn't been updated) carries undefined. The comparison in skillPlacementLanded — entry.observedGitTreeSha === lockHash — correctly evaluates undefined === string as false, so it fails closed. However, this behavior is implicit. A brief note in the comment explaining that absence is treated identically to a non-matching SHA would help the next reader understand why the field is intentionally optional rather than required.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a false-failure loop where npx skills update consistently reported "Updated 0 of N skills" because the CLI installs source-repo HEAD (which runs ahead of the bundled snapshot registry), causing the post-run re-scan to classify installed content as unrecognized and count it as a failure indefinitely.

The fix computes a git tree SHA of the observed on-disk bytes and treats an unrecognized placement as landed when that SHA matches the skillFolderHash the CLI's own lock file recorded — trusting the updater's record of what it installed rather than demanding the bundled registry recognise it.

  • skill-git-tree-identity.ts: New module implementing git object hashing (blob + tree) as a port of the generator script, with the sort rule that treats directory names as name/ to match git's raw-byte ordering.
  • skill-update-outcome.ts: skillPlacementLanded now forgives unrecognized status only when the lock hash is present and exactly matches observedGitTreeSha; outdated, inaccessible, hash mismatches, and missing lock entries all continue to fail.
  • skill-freshness-placement-observation.ts / skill-package-identity.ts: Thread observedGitTreeSha through the observation pipeline, setting it to null in all error/inaccessible paths so the verdict comparison always fails closed when bytes could not be read.

Confidence Score: 4/5

Safe to merge; the verdict change is tightly scoped to a single status×topology×hash-match condition, fails closed in every error path, and is covered by both unit tests and an integration test that reproduces the exact post-cut scenario.

The logic is correct and well-tested. The only noteworthy point is that observedGitTreeSha is typed as optional in the shared SkillFreshnessInstallation type, meaning callers that omit the field silently get fail-closed behavior via undefined === string rather than a compile-time reminder — functionally safe, but the intent is not self-documenting.

Files Needing Attention: The optional observedGitTreeSha field in src/shared/skill-freshness.ts is the one spot worth a second look, to confirm whether the ? is a deliberate backward-compat choice or should eventually become required once all callers are updated.

Important Files Changed

Filename Overview
src/main/skills/skill-git-tree-identity.ts New file implementing git tree SHA computation (port of the generator's algorithm); correctly handles nested dirs, executables, binary blobs, and the z.txt vs z/ sort edge case.
src/main/skills/skill-update-outcome.ts Core verdict change: adds lock-hash comparison in skillPlacementLanded; only forgives 'unrecognized' status when disk SHA exactly matches the lock entry, everything else still fails.
src/shared/skill-freshness.ts Adds observedGitTreeSha as an optional field (?: string
src/main/skills/skill-package-identity.ts Threads gitBlobSha and treeEntries through observeSkillPackage, computing observedGitTreeSha alongside the existing digest without altering the existing traversal logic.
src/main/skills/skill-freshness-placement-observation.ts Passes observedGitTreeSha through all three return paths (inaccessible early-exit, success, and error catch), consistently setting null when bytes are unavailable.
src/main/ipc/skills.ts Fetches globalSkillLocks concurrently with scanInventory and forwards them to skillUpdateFailedNames; comment explains the intentional fresh read after the run rewrites the lock.
src/main/skills/skill-update-outcome.test.ts Adds eight new unit tests pinning the new lock-match logic, plus a full integration test that builds a real post-cut fixture (modified SKILL.md, temp home, real lock) and fails on main today.
src/main/skills/skill-git-tree-identity.test.ts Two tests: one verifies every shipped skill's folder hashes to the bundled manifest's gitTreeSha, another validates the algorithm against real git write-tree output over nesting/executables/binary/sort-edge cases.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[skills update CLI runs] --> B[Post-run: rescanOutdatedNames]
    B --> C[Promise.all: scanInventory + readGloballyUpdatableSkillLocks]
    C --> D[skillUpdateFailedNames]
    D --> E{For each requested name}
    E --> F{Any convergent placements?}
    F -- No --> G[Name FAILED - skill removed]
    F -- Yes --> H{skillPlacementLanded for each entry}
    H --> I{status == current or newer-known?}
    I -- Yes --> J[Landed ✓]
    I -- No --> K{status == unrecognized AND lockHash defined AND disk SHA == lockHash?}
    K -- Yes --> L[Landed ✓ - post-cut source content]
    K -- No --> M[Not landed ✗]
    H --> N{any entry not landed?}
    N -- Yes --> O[Name FAILED]
    N -- No --> P[Name SUCCEEDED]
Loading

Reviews (1): Last reviewed commit: "fix(skills): trust the updater's lock wh..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit a81f17c into main Jul 28, 2026
39 checks passed
zpyoung pushed a commit to zpyoung/orca that referenced this pull request Jul 29, 2026
…er than the bundle (stablyai#11220)

skills update installs source-repo HEAD, which routinely runs ahead of the
revisions a shipped build bundles. The post-run re-scan hashed that content
'unrecognized' (the registry has never seen it) and the verdict counted it as
a failure — so a clean update reported "The update didn't finish / Updated 0
of N", and Retry repeated the false failure forever because the CLI now
no-ops (lock == source). The 'newer-known' escape hatch never fires: the
generator always points the manifest at the registry's newest snapshot, so no
observed content can hash to a revision newer than the bundle.

The verdict now computes the git tree sha of the observed bytes (a port of
the generator's hashing, verified byte-for-byte against git write-tree and
against every shipped skill's manifest gitTreeSha) and accepts an
unrecognized placement when that sha equals the lock's skillFolderHash: the
lock is the CLI's own record of what it installed, so disk matching lock
means the command did its job — the bundled registry simply has not seen
that revision yet.

Half-written bundles (sha mismatch), unreadable copies, removed skills,
degraded aliases, and outdated copies at the lock hash all still fail.
Jinwoo-H added a commit to innocarpe/orca that referenced this pull request Aug 6, 2026
Sidecar tolerance stopped at the snapshot match, leaving three disk-vs-official
comparisons still judging the whole folder.

The lock-comparable hash covered every observed file, so a clean update beside
agents/openai.yaml reported as failed and read 'may be modified'. It is now
carried both whole and scoped to the current bundle's paths, and either may
satisfy the lock: the sidecar case only ever matches scoped, while an upstream
revision that ADDS a file only ever matches whole, so publishing one alone
would trade this bug for stablyai#11220.

Convergence re-derived the disk revision from that same whole-folder digest,
which no revision matches once a sidecar lands, retiring the stuck-lock gate
and arming an update the command provably cannot perform; it now honours the
revision observation already resolved.

Subset matching also let an older revision launder drift on a file the current
bundle lists, since that revision does not list it and so read it as a
neighbour. Identity now keys tolerance on what the current bundle owns.
Jinwoo-H added a commit that referenced this pull request Aug 6, 2026
* fix(skills): match official skill files despite local sidecars

Scope known-snapshot matching to manifest-listed files so agent-written
sidecars (e.g. agents/openai.yaml) no longer mark a package unrecognized
and block updates when official bytes still match.

Preserves fail-closed detection when a listed file's content drifts.

Fixes #12694

* fix(skills): scope lock trust and convergence to official files too

Sidecar tolerance stopped at the snapshot match, leaving three disk-vs-official
comparisons still judging the whole folder.

The lock-comparable hash covered every observed file, so a clean update beside
agents/openai.yaml reported as failed and read 'may be modified'. It is now
carried both whole and scoped to the current bundle's paths, and either may
satisfy the lock: the sidecar case only ever matches scoped, while an upstream
revision that ADDS a file only ever matches whole, so publishing one alone
would trade this bug for #11220.

Convergence re-derived the disk revision from that same whole-folder digest,
which no revision matches once a sidecar lands, retiring the stuck-lock gate
and arming an update the command provably cannot perform; it now honours the
revision observation already resolved.

Subset matching also let an older revision launder drift on a file the current
bundle lists, since that revision does not list it and so read it as a
neighbour. Identity now keys tolerance on what the current bundle owns.

---------

Co-authored-by: Jinwoo-H <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…er than the bundle (stablyai#11220)

skills update installs source-repo HEAD, which routinely runs ahead of the
revisions a shipped build bundles. The post-run re-scan hashed that content
'unrecognized' (the registry has never seen it) and the verdict counted it as
a failure — so a clean update reported "The update didn't finish / Updated 0
of N", and Retry repeated the false failure forever because the CLI now
no-ops (lock == source). The 'newer-known' escape hatch never fires: the
generator always points the manifest at the registry's newest snapshot, so no
observed content can hash to a revision newer than the bundle.

The verdict now computes the git tree sha of the observed bytes (a port of
the generator's hashing, verified byte-for-byte against git write-tree and
against every shipped skill's manifest gitTreeSha) and accepts an
unrecognized placement when that sha equals the lock's skillFolderHash: the
lock is the CLI's own record of what it installed, so disk matching lock
means the command did its job — the bundled registry simply has not seen
that revision yet.

Half-written bundles (sha mismatch), unreadable copies, removed skills,
degraded aliases, and outdated copies at the lock hash all still fail.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…yai#12812)

* fix(skills): match official skill files despite local sidecars

Scope known-snapshot matching to manifest-listed files so agent-written
sidecars (e.g. agents/openai.yaml) no longer mark a package unrecognized
and block updates when official bytes still match.

Preserves fail-closed detection when a listed file's content drifts.

Fixes stablyai#12694

* fix(skills): scope lock trust and convergence to official files too

Sidecar tolerance stopped at the snapshot match, leaving three disk-vs-official
comparisons still judging the whole folder.

The lock-comparable hash covered every observed file, so a clean update beside
agents/openai.yaml reported as failed and read 'may be modified'. It is now
carried both whole and scoped to the current bundle's paths, and either may
satisfy the lock: the sidecar case only ever matches scoped, while an upstream
revision that ADDS a file only ever matches whole, so publishing one alone
would trade this bug for stablyai#11220.

Convergence re-derived the disk revision from that same whole-folder digest,
which no revision matches once a sidecar lands, retiring the stuck-lock gate
and arming an update the command provably cannot perform; it now honours the
revision observation already resolved.

Subset matching also let an older revision launder drift on a file the current
bundle lists, since that revision does not list it and so read it as a
neighbour. Identity now keys tolerance on what the current bundle owns.

---------

Co-authored-by: Jinwoo-H <[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