Repository navigation
fix(skills): preserve released history across new tags - #9778
Conversation
📝 WalkthroughWalkthroughUpdated release metadata for new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4fb35735-28fb-4d3e-9065-98df4278728b
📒 Files selected for processing (5)
config/scripts/generate-skill-bundle-manifest.mjsconfig/scripts/generate-skill-bundle-manifest.test.mjsresources/skills/current-manifest.jsonresources/skills/release-mapping.jsonresources/skills/snapshot-registry.json
| const minimumReleasedCount = | ||
| committedReleasedCounts?.[name] ?? Math.max(0, committedSnapshots.length - 1) | ||
| if (releasedCount < minimumReleasedCount) { | ||
| throw new Error( | ||
| `Released snapshot history is incomplete for ${name}. ` + | ||
| 'Fetch all release tags before regenerating skill artifacts.' | ||
| ) | ||
| } | ||
| const protectedCount = Math.min(committedSnapshots.length, releasedCount) | ||
| const protectedCount = committedReleasedCounts | ||
| ? (committedReleasedCounts[name] ?? 0) | ||
| : Math.min(committedSnapshots.length, releasedCount) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use the committed mapping consistently for absent skills.
When the mapping is valid but does not contain a skill, minimumReleasedCount falls back to committedSnapshots.length - 1, while protectedCount treats that skill as having zero released revisions. This can reject valid newly added or entirely unreleased skills. Use committedReleasedCounts[name] ?? 0 whenever the mapping is non-null; retain the legacy fallback only when the mapping itself is unavailable or incompatible.
Proposed fix
- const minimumReleasedCount =
- committedReleasedCounts?.[name] ?? Math.max(0, committedSnapshots.length - 1)
+ const minimumReleasedCount = committedReleasedCounts
+ ? (committedReleasedCounts[name] ?? 0)
+ : Math.max(0, committedSnapshots.length - 1)Add a regression case where a valid mapping omits a skill and expect zero protected/released revisions for that skill.
📝 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.
| const minimumReleasedCount = | |
| committedReleasedCounts?.[name] ?? Math.max(0, committedSnapshots.length - 1) | |
| if (releasedCount < minimumReleasedCount) { | |
| throw new Error( | |
| `Released snapshot history is incomplete for ${name}. ` + | |
| 'Fetch all release tags before regenerating skill artifacts.' | |
| ) | |
| } | |
| const protectedCount = Math.min(committedSnapshots.length, releasedCount) | |
| const protectedCount = committedReleasedCounts | |
| ? (committedReleasedCounts[name] ?? 0) | |
| : Math.min(committedSnapshots.length, releasedCount) | |
| const minimumReleasedCount = committedReleasedCounts | |
| ? (committedReleasedCounts[name] ?? 0) | |
| : Math.max(0, committedSnapshots.length - 1) | |
| if (releasedCount < minimumReleasedCount) { | |
| throw new Error( | |
| `Released snapshot history is incomplete for ${name}. ` + | |
| 'Fetch all release tags before regenerating skill artifacts.' | |
| ) | |
| } | |
| const protectedCount = committedReleasedCounts | |
| ? (committedReleasedCounts[name] ?? 0) | |
| : Math.min(committedSnapshots.length, releasedCount) |
…review terminal (#9771) * fix(dashboard-popout): forward macOS IME native-text commits in the preview terminal The preview terminal enables xterm's kitty keyboard protocol (via buildDefaultTerminalOptions), whose encoder can encode and cancel a printable keydown before Chromium commits the real IME/native text — silently dropping macOS input-source commits and synthetic Unicode injection. Main-window panes guard this with the IME native-text forwarder; the pop-out preview never installed it. Install the composition tracker + forwarder (macOS-only, mirroring TerminalPane) and claim native-text key events at the top of the preview's custom key handler so the committed glyph reaches the PTY via terminal.input() and the existing user-input routing. * fix(dashboard-popout): prewarm IME input source * fix(skills): preserve released history across new tags (#9778) Co-authored-by: OrcaWin <[email protected]> * fix(skills): record latest Linear release history (#9777) --------- Co-authored-by: OrcaWin <[email protected]> Co-authored-by: OrcaWin <[email protected]>
…dow (#9765) * fix(dashboard-popout): wire terminal copy/paste in the popped-out window The Edit menu's Paste is a custom item that routes Cmd/Ctrl+V to the focused window as ui:appMenuPaste, and only the main window's React root listens for it — the popout dropped it, so paste silently did nothing. The copy chord similarly resolves in the main window's before-input-event handler, which the popout window never registers; the menu's role:'copy' no-ops on xterm's empty hidden textarea. AgentTerminalPreview now subscribes to onAppMenuPaste (guarded on focus inside the preview) and pastes via terminal.paste(), which xterm flags as user input so the existing preview->PTY routing and main-process input limits apply. A custom key handler honors the terminal.copySelection and terminal.paste keybindings, skipping plain Mod+V since the menu accelerator owns that chord (handling it twice would paste double). The popout bootstrap fetches keybinding overrides so custom bindings apply. * fix(dashboard-popout): harden terminal clipboard routing * fix(dashboard-popout): authorize terminal clipboard text * test(dashboard-popout): harden terminal paste coverage * fix(terminal): normalize streamed paste newlines * fix(dashboard-popout): forward macOS IME native-text commits in the preview terminal (#9771) * fix(dashboard-popout): forward macOS IME native-text commits in the preview terminal The preview terminal enables xterm's kitty keyboard protocol (via buildDefaultTerminalOptions), whose encoder can encode and cancel a printable keydown before Chromium commits the real IME/native text — silently dropping macOS input-source commits and synthetic Unicode injection. Main-window panes guard this with the IME native-text forwarder; the pop-out preview never installed it. Install the composition tracker + forwarder (macOS-only, mirroring TerminalPane) and claim native-text key events at the top of the preview's custom key handler so the committed glyph reaches the PTY via terminal.input() and the existing user-input routing. * fix(dashboard-popout): prewarm IME input source * fix(skills): preserve released history across new tags (#9778) Co-authored-by: OrcaWin <[email protected]> * fix(skills): record latest Linear release history (#9777) --------- Co-authored-by: OrcaWin <[email protected]> Co-authored-by: OrcaWin <[email protected]> --------- Co-authored-by: OrcaWin <[email protected]> Co-authored-by: OrcaWin <[email protected]>
* fix(skills): source released history from the committed ledger, not a tag walk verify:skill-bundle-manifest rebuilt the entire released-skill history by walking every local refs/tags/v* on each run and demanded byte-equality with the committed artifacts. Output was therefore a function of (skill bytes x local tag set x release timing), so any clone holding stray, deleted, or fork tags the committed artifacts predate rebuilt a divergent registry and failed lint. This was the 4th instance of one failure class (#8637 -> #9119 version bumps -> #9778 new tags -> local tag drift), each patched with a new tolerance rather than removing the tag coupling. Fix: the committed snapshot-registry + release-mapping ARE the released history; trust them instead of re-deriving from tags. - releasedHistoryFromCommitted() seeds generation from the committed ledger, dropping the floating unreleased tail (entries beyond what the mapping names). verify and --write are now pure functions of working-tree bytes with zero tag access. The tag walk survives only behind --rebuild-from-tags (disaster recovery), off the everyday path. - --release <version> + appendReleaseRow() perform the O(1) append of one mapping row at release cut (dedupes vs the last row, strips the v-prefix) -- the single authoritative point where working-tree bytes become an immutable released revision. - release-cut.yml runs generate --release "$VERSION" before the release commit (Node built-ins only, no install needed); pr.yml drops fetch-depth: 0 from the lint job since verify no longer needs tag history. Recognition is unaffected: the runtime uses knownSnapshots = registry.skills (all entries, incl. the tail committed at PR-merge time), so a missing mapping row only loses a version label, never recognition or the update nudge. Trade-off: lint no longer cross-checks committed historical snapshots against tags. A hand-edit to an old released entry is still caught by the runtime manifest<->registry consistency check when the current manifest points at it, and can be audited anytime with --rebuild-from-tags. Verified: verify passes committed-sourced; --write is zero-diff (byte parity); a planted stray v-tag no longer changes output; edit-stub -> --write -> --release appends the correct single row; double --release is idempotent; --rebuild-from-tags reproduces the committed artifacts. Generator tests 14 pass/ 1 skip; runtime skill-bundle-artifacts + freshness-inventory 14 pass; bundled skill guides verify passes. * fix(skills): keep one release-mapping row per version on a re-cut A cut that pushed the version bump to main but died before pushing the tag is re-cut at the same version. If skills changed in between, the second --release appended a duplicate row, and the stale one named revisions that tag never ships — which verify-skill-update-roundtrip then pairs with the tag's real bytes. Overwrite the trailing row instead (the tag is absent, so that version was never published). Refuse only when an earlier row claims the version, which the cut workflow already rejects upstream, so this cannot wedge a recovering cut.
Co-authored-by: OrcaWin <[email protected]>
…dow (stablyai#9765) * fix(dashboard-popout): wire terminal copy/paste in the popped-out window The Edit menu's Paste is a custom item that routes Cmd/Ctrl+V to the focused window as ui:appMenuPaste, and only the main window's React root listens for it — the popout dropped it, so paste silently did nothing. The copy chord similarly resolves in the main window's before-input-event handler, which the popout window never registers; the menu's role:'copy' no-ops on xterm's empty hidden textarea. AgentTerminalPreview now subscribes to onAppMenuPaste (guarded on focus inside the preview) and pastes via terminal.paste(), which xterm flags as user input so the existing preview->PTY routing and main-process input limits apply. A custom key handler honors the terminal.copySelection and terminal.paste keybindings, skipping plain Mod+V since the menu accelerator owns that chord (handling it twice would paste double). The popout bootstrap fetches keybinding overrides so custom bindings apply. * fix(dashboard-popout): harden terminal clipboard routing * fix(dashboard-popout): authorize terminal clipboard text * test(dashboard-popout): harden terminal paste coverage * fix(terminal): normalize streamed paste newlines * fix(dashboard-popout): forward macOS IME native-text commits in the preview terminal (stablyai#9771) * fix(dashboard-popout): forward macOS IME native-text commits in the preview terminal The preview terminal enables xterm's kitty keyboard protocol (via buildDefaultTerminalOptions), whose encoder can encode and cancel a printable keydown before Chromium commits the real IME/native text — silently dropping macOS input-source commits and synthetic Unicode injection. Main-window panes guard this with the IME native-text forwarder; the pop-out preview never installed it. Install the composition tracker + forwarder (macOS-only, mirroring TerminalPane) and claim native-text key events at the top of the preview's custom key handler so the committed glyph reaches the PTY via terminal.input() and the existing user-input routing. * fix(dashboard-popout): prewarm IME input source * fix(skills): preserve released history across new tags (stablyai#9778) Co-authored-by: OrcaWin <[email protected]> * fix(skills): record latest Linear release history (stablyai#9777) --------- Co-authored-by: OrcaWin <[email protected]> Co-authored-by: OrcaWin <[email protected]> --------- Co-authored-by: OrcaWin <[email protected]> Co-authored-by: OrcaWin <[email protected]>
…lyai#10340) * fix(skills): source released history from the committed ledger, not a tag walk verify:skill-bundle-manifest rebuilt the entire released-skill history by walking every local refs/tags/v* on each run and demanded byte-equality with the committed artifacts. Output was therefore a function of (skill bytes x local tag set x release timing), so any clone holding stray, deleted, or fork tags the committed artifacts predate rebuilt a divergent registry and failed lint. This was the 4th instance of one failure class (stablyai#8637 -> stablyai#9119 version bumps -> stablyai#9778 new tags -> local tag drift), each patched with a new tolerance rather than removing the tag coupling. Fix: the committed snapshot-registry + release-mapping ARE the released history; trust them instead of re-deriving from tags. - releasedHistoryFromCommitted() seeds generation from the committed ledger, dropping the floating unreleased tail (entries beyond what the mapping names). verify and --write are now pure functions of working-tree bytes with zero tag access. The tag walk survives only behind --rebuild-from-tags (disaster recovery), off the everyday path. - --release <version> + appendReleaseRow() perform the O(1) append of one mapping row at release cut (dedupes vs the last row, strips the v-prefix) -- the single authoritative point where working-tree bytes become an immutable released revision. - release-cut.yml runs generate --release "$VERSION" before the release commit (Node built-ins only, no install needed); pr.yml drops fetch-depth: 0 from the lint job since verify no longer needs tag history. Recognition is unaffected: the runtime uses knownSnapshots = registry.skills (all entries, incl. the tail committed at PR-merge time), so a missing mapping row only loses a version label, never recognition or the update nudge. Trade-off: lint no longer cross-checks committed historical snapshots against tags. A hand-edit to an old released entry is still caught by the runtime manifest<->registry consistency check when the current manifest points at it, and can be audited anytime with --rebuild-from-tags. Verified: verify passes committed-sourced; --write is zero-diff (byte parity); a planted stray v-tag no longer changes output; edit-stub -> --write -> --release appends the correct single row; double --release is idempotent; --rebuild-from-tags reproduces the committed artifacts. Generator tests 14 pass/ 1 skip; runtime skill-bundle-artifacts + freshness-inventory 14 pass; bundled skill guides verify passes. * fix(skills): keep one release-mapping row per version on a re-cut A cut that pushed the version bump to main but died before pushing the tag is re-cut at the same version. If skills changed in between, the second --release appended a duplicate row, and the stale one named revisions that tag never ships — which verify-skill-update-roundtrip then pairs with the tag's real bytes. Overwrite the trailing row instead (the tag is absent, so that version was never published). Refuse only when an earlier row claims the version, which the cut workflow already rejects upstream, so this cannot wedge a recovering cut.
Summary
Root cause
The current manifest guard treats nearly every committed registry entry as released. After tag
v1.4.149-rc.2, the release history identifies different bytes forlinear-ticketsrevision 6 than the previously unreleased tail stored at revision 6, so every PR failsverify:skill-bundle-manifestbefore artifacts can be regenerated.The committed release mapping is the authoritative record of which revisions shipped. Using it keeps actual released history immutable while allowing the unreleased tail to move forward when a new tag claims the next revision.
Verification
pnpm run verify:skill-bundle-manifestpnpm run verify:bundled-skill-guidespnpm exec vitest run --config config/vitest.config.ts config/scripts/generate-skill-bundle-manifest.test.mjs— 11 passed, 1 skippedoxfmt,oxlint, andgit diff --checkpnpm typecheck