Skip to content

Add managed updates for bundled agent skills - #8496

Closed
brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/skill-auto-update-research
Closed

brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/skill-auto-update-research

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Status

Open and intentionally unmerged pending final review. CI is green on the pushed head (1df4feb). The consolidated review, manual Electron validation, and the stabilization pass are complete and pushed (5ebd83a). Automatic background updates for managed skills shipped behind a default-on setting (6506f42). All CodeRabbit review threads have been addressed and resolved.

Summary

  • Bundle immutable skill snapshot metadata, current manifests, release mapping, and merge/release gates.
  • Inventory local agent-skill installations as current, outdated, modified, unknown, missing, or inaccessible with deterministic work limits.
  • Offer explicit adopt, update, and replace actions in Settings, plus a dismissible adoption nudge for exact official copies.
  • Automatically update managed skills in the background behind a default-on “Update automatically” setting (managedSkillAutoUpdateEnabled). The batch runs only on the local host, only for destinations the user already manages, and only when the installed content still exactly matches the recorded snapshot. Locally modified, unknown, externally managed, and unmanaged copies are never written. Failures surface as retryable update-failed rows and are never retried automatically, so a broken package cannot loop. One aggregated toast reports each successful batch.
  • Publish changes with journaled physical identity, exact-content checks, rollback, crash recovery, and orphan sweeping.
  • Attribute installer ownership only after an authoritative successful terminal exit.

Adoption stays explicit: auto-update never claims a newly discovered path. WSL reconciliation remains a later phase, and SSH management remains a separate later phase.

Screenshots

Current UI on the pushed head (isolated Electron run with a staged multi-skill inventory).

Adoption nudge Skill states + “Update automatically” toggle
Adoption nudge Skill states and auto-update toggle
Review local changes (replace) Background auto-update (toast + settled state)
Replace review dialog Background auto-update toast

Testing

  • Node, CLI, and renderer typechecks on the pushed head.
  • Focused manifest, persistence, discovery, publication, recovery, adoption, managed-UI, auto-update-batch, and IPC-gating suites (1000+ assertions green locally).
  • Full lint, type-aware lint, reliability-manifest, localization catalog/coverage, max-lines, manifest-generation, and diff checks.
  • settings-skill-detection Electron E2E (3/3 locally): setup-panel labels, adoption/update/conflict/retry/nudge states, and the new background auto-update flow (batch trigger → aggregated toast → settled managed-current state). The spec now pins the management inventory so assertions no longer depend on the developer's real skill homes.
  • Real-filesystem auto-update batch test: adopts a genuine historical release, updates it to the current bundle through the full transaction machinery, refuses modified copies, restores on injected persistence failure, and proves a failed destination is not re-attempted.
  • Manual isolated Electron validation for nudge dismissal/reappearance, adopt, update, replace confirmation/success, failure retention, and installer status (Phase 1 pass).
  • GitHub CI green on the pushed head (1df4feb), including Windows CLI round trips, native smoke, golden E2E, and the verify gate.

AI Review Report

One consolidated correctness, safety, cross-platform, performance, and maintainability review was completed and its findings corrected in 5ebd83a. All CodeRabbit threads are replied to and resolved: durability (frozen persistence writes fail closed), recovery isolation (per-transaction orphan sweep), workflow hardening (persist-credentials: false, env-passed base ref), Git tree-sha subtree ordering, localization/pluralization, and UI busy-state guards. The no-follow/handle-relative traversal finding is documented as deferred (see Security Audit).

Security Audit

  • Managed writes require either an explicit user action or the default-on auto-update setting, and in both cases an exact approved snapshot identity; auto-update never claims new paths and declines silently on unauthorized builds.
  • Publication revalidates topology, directory/file identity, content, modes, extras, and transaction-owned state at each portable Node filesystem boundary.
  • Ambiguous failures retain journal and rollback evidence; recovery fails closed rather than claiming success.
  • Checkout credentials are not persisted in verification workflows, and pull-request base refs are passed through environment data rather than shell template expansion.
  • A native handle-relative syscall boundary against a malicious same-privilege process is not part of Phase 1. The reviewed contract is portable Node revalidation immediately before each mutation.

Notes

  • The local design scratch note is intentionally excluded from this PR.
  • Live Windows filesystem behavior is exercised by CI; this manual pass ran on macOS.
  • Current shipped skill packages are single-file. The CLI oracle also creates a nested, binary, executable fixture so multi-file semantics remain covered.
  • Korean and Chinese catalogs carry English placeholders for the newest keys (matching the existing pattern in this PR); a follow-up translation pass can localize them.
  • This PR must remain open and unmerged until the final pushed checks are stable.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ca5d0bdb-10e9-4f79-9490-d3fa38b3ccaa

📥 Commits

Reviewing files that changed from the base of the PR and between e881060 and 1fd1af5.

📒 Files selected for processing (5)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json

📝 Walkthrough

Walkthrough

This change adds bundled skill manifests and release mappings, packages skill resources, and validates them in CI and release workflows. It introduces skill inventory, adoption, replacement, update, persistence, transaction recovery, filesystem identity, and mutation-authorization logic. IPC, preload, shared types, WSL host handling, renderer hooks, setup panels, settings management UI, adoption prompts, auto-update behavior, terminal exit handling, localization, and end-to-end coverage are added or updated.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: managed updates for bundled agent skills.
Description check ✅ Passed The description matches the required template and is mostly complete, with summary, screenshots, testing, review, security, and notes sections.
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.

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: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/skills/discovery.ts (1)

74-100: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Also exclude symlink aliases to .orca-skill-transactions. The raw entry.name check blocks only the direct directory entry; a differently named symlink that resolves to the reserved transaction root still gets traversed because symlinked directories are followed later in visit(). Check the resolved basename before descending.

🧹 Nitpick comments (5)
src/shared/execution-host.ts (1)

86-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the shared prefix-decode logic.

The ssh:, runtime:, and now wsl: branches in parseExecutionHostId repeat the same "slice prefix → check empty → decodeURIComponent in try/catch → check empty-after-decode" pattern. A small helper would remove the triplication and make future host kinds cheaper to add.

♻️ Proposed refactor
+function decodePrefixedHostPart(normalized: string, prefix: string): string | null {
+  const encoded = normalized.slice(prefix.length)
+  if (!encoded) {
+    return null
+  }
+  try {
+    const decoded = decodeURIComponent(encoded)
+    return decoded ? decoded : null
+  } catch {
+    return null
+  }
+}
+
 export function parseExecutionHostId(value: string | null | undefined): ParsedExecutionHost | null {
   const normalized = normalizeHostPart(value)
   if (!normalized) {
     return null
   }
   if (normalized === LOCAL_EXECUTION_HOST_ID) {
     return { kind: 'local', id: LOCAL_EXECUTION_HOST_ID }
   }
   if (normalized.startsWith('ssh:')) {
-    const encoded = normalized.slice('ssh:'.length)
-    if (!encoded) {
-      return null
-    }
-    try {
-      const targetId = decodeURIComponent(encoded)
-      return targetId ? { kind: 'ssh', id: `ssh:${encoded}`, targetId } : null
-    } catch {
-      return null
-    }
+    const targetId = decodePrefixedHostPart(normalized, 'ssh:')
+    return targetId ? { kind: 'ssh', id: `ssh:${normalized.slice('ssh:'.length)}`, targetId } : null
   }
   if (normalized.startsWith('runtime:')) {
-    const encoded = normalized.slice('runtime:'.length)
-    if (!encoded) {
-      return null
-    }
-    try {
-      const environmentId = decodeURIComponent(encoded)
-      return environmentId ? { kind: 'runtime', id: `runtime:${encoded}`, environmentId } : null
-    } catch {
-      return null
-    }
+    const environmentId = decodePrefixedHostPart(normalized, 'runtime:')
+    return environmentId
+      ? { kind: 'runtime', id: `runtime:${normalized.slice('runtime:'.length)}`, environmentId }
+      : null
   }
   if (normalized.startsWith('wsl:')) {
-    const encoded = normalized.slice('wsl:'.length)
-    if (!encoded) {
-      return null
-    }
-    try {
-      const distro = decodeURIComponent(encoded)
-      return distro ? { kind: 'wsl', id: `wsl:${encoded}`, distro } : null
-    } catch {
-      return null
-    }
+    const distro = decodePrefixedHostPart(normalized, 'wsl:')
+    return distro ? { kind: 'wsl', id: `wsl:${normalized.slice('wsl:'.length)}`, distro } : null
   }
   return null
 }
src/main/skills/skill-package-publication.ts (1)

161-169: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate sharing-violation detection logic.

isSharingViolation here duplicates the retryable check already implemented in retrySkillRename (src/main/skills/skill-transaction-rename.ts). Both independently test error.code === 'EPERM' || error.code === 'EBUSY'. Extracting a single shared predicate (e.g. exported from skill-transaction-rename.ts) would avoid the two implementations silently drifting if error-code handling ever needs to change (e.g. adding EACCES).

♻️ Proposed refactor
-function isSharingViolation(error: unknown, enabled: boolean): boolean {
-  return Boolean(
-    enabled &&
-    error &&
-    typeof error === 'object' &&
-    'code' in error &&
-    (error.code === 'EPERM' || error.code === 'EBUSY')
-  )
-}
+import { isSkillRenameSharingViolationCode } from './skill-transaction-rename'
+
+function isSharingViolation(error: unknown, enabled: boolean): boolean {
+  return Boolean(enabled && isSkillRenameSharingViolationCode(error))
+}

(Extract the equivalent retryable check in skill-transaction-rename.ts into an exported isSkillRenameSharingViolationCode helper and reuse it in retrySkillRename.)

src/main/skills/skill-owned-temp-publication.ts (1)

42-56: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Close the handle if handle.stat() fails before the try block.

open(...) succeeds at Line 42, but await handle.stat() on Line 47 runs while building creating outside the try/finally. If stat() rejects, the freshly created temp FileHandle is never closed, leaking a file descriptor (and leaving the exclusively-created temp inode). It's a low-probability path, but easily hardened by acquiring the stat inside the guarded region while keeping creating/ready in the outer scope.

♻️ One way to guard the stat
   const handle = await open(temporaryPath, 'wx', mode)
-  const creating = {
-    ...applying,
-    temporary: {
-      path: temporaryRelativePath,
-      physicalIdentity: skillPhysicalIdentity(temporaryPath, await handle.stat()),
-      expectedFile: args.expectedFile,
-      state: 'creating'
-    }
-  } as const
+  let creating: {
+    kind: 'in-place'
+    direction: 'forward' | 'rollback'
+    physicalIdentity: string
+    temporary: {
+      path: string
+      physicalIdentity: string
+      expectedFile: SkillBundleFileIdentity
+      state: 'creating'
+    }
+    operationIndex: number
+    operationState: 'applying'
+  }
   try {
+    creating = {
+      ...applying,
+      temporary: {
+        path: temporaryRelativePath,
+        physicalIdentity: skillPhysicalIdentity(temporaryPath, await handle.stat()),
+        expectedFile: args.expectedFile,
+        state: 'creating'
+      }
+    }
     // Why: partial bytes are recoverable only after the exclusively created
     // inode is durably recorded as transaction-owned.
     await args.callbacks.journal(creating)

(The ready block on Lines 93-96 then reads creating from the outer scope as before.)

config/reliability-gates.jsonc (1)

3604-3604: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Placeholder motivatingLinks on both new gates.

Both new gates link only to the bare repo root (https://github.com/stablyai/orca) instead of a specific PR/issue, unlike every other gate in this file. This weakens traceability for future maintainers auditing gate history.

✏️ Suggested fix
-      "motivatingLinks": ["https://github.com/stablyai/orca"],
+      "motivatingLinks": ["https://github.com/stablyai/orca/pull/8496"],

(repeat for both entries, or reference whatever issue/PR actually motivated each gate)

Also applies to: 3685-3685

src/main/skills/skill-transaction-package-build.ts (1)

274-276: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Guard handle.close() so it can't mask the original failure.

If close() throws inside finally, it replaces whatever error was propagating from the try block (e.g., an injected write/chmod/sync failure), which would break callers relying on the original error message for recovery/journaling decisions.

🛡️ Proposed fix to avoid masking the original error
     } finally {
-      await handle.close()
+      await handle.close().catch(() => undefined)
     }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c69ef47a-fd96-4e62-809a-a9da7a3c03d6

📥 Commits

Reviewing files that changed from the base of the PR and between ec7cc2d and f4a12bc.

📒 Files selected for processing (125)
  • .github/workflows/pr.yml
  • .github/workflows/release-cut.yml
  • .github/workflows/skill-cli-roundtrip.yml
  • .github/workflows/skill-manifest-merge-gate.yml
  • config/electron-builder.config.cjs
  • config/reliability-gates.jsonc
  • config/scripts/electron-builder-config.test.mjs
  • config/scripts/generate-skill-bundle-manifest.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • config/scripts/verify-skill-cli-roundtrip.mjs
  • package.json
  • resources/skills/current-manifest.json
  • resources/skills/release-mapping.json
  • resources/skills/snapshot-registry.json
  • src/main/ipc/skills.test.ts
  • src/main/ipc/skills.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/skills/discovery.test.ts
  • src/main/skills/discovery.ts
  • src/main/skills/skill-adoption-dismissal.ts
  • src/main/skills/skill-adoption.test.ts
  • src/main/skills/skill-adoption.ts
  • src/main/skills/skill-bundle-artifacts.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/main/skills/skill-explicit-replacement.test.ts
  • src/main/skills/skill-explicit-replacement.ts
  • src/main/skills/skill-installation-topology.ts
  • src/main/skills/skill-managed-update.ts
  • src/main/skills/skill-management-inaccessible-candidate.ts
  • src/main/skills/skill-management-inventory.test.ts
  • src/main/skills/skill-management-inventory.ts
  • src/main/skills/skill-management-ledger.test.ts
  • src/main/skills/skill-management-ledger.ts
  • src/main/skills/skill-mutation-authority.test.ts
  • src/main/skills/skill-mutation-authority.ts
  • src/main/skills/skill-orphan-transaction-sweep.ts
  • src/main/skills/skill-owned-temp-publication.ts
  • src/main/skills/skill-package-identity.ts
  • src/main/skills/skill-package-observation-limits.test.ts
  • src/main/skills/skill-package-publication.test.ts
  • src/main/skills/skill-package-publication.ts
  • src/main/skills/skill-package-publish.test.ts
  • src/main/skills/skill-package-publish.ts
  • src/main/skills/skill-package-rollback.ts
  • src/main/skills/skill-package-swap-authority.test.ts
  • src/main/skills/skill-package-transaction-context.ts
  • src/main/skills/skill-published-destination-authority.ts
  • src/main/skills/skill-transaction-marker.test.ts
  • src/main/skills/skill-transaction-marker.ts
  • src/main/skills/skill-transaction-owned-state.ts
  • src/main/skills/skill-transaction-package-build.test.ts
  • src/main/skills/skill-transaction-package-build.ts
  • src/main/skills/skill-transaction-paths.ts
  • src/main/skills/skill-transaction-publication-state.test.ts
  • src/main/skills/skill-transaction-publication-state.ts
  • src/main/skills/skill-transaction-recovery.test.ts
  • src/main/skills/skill-transaction-recovery.ts
  • src/main/skills/skill-transaction-rename.ts
  • src/main/skills/skill-transaction-restore.ts
  • src/main/skills/skill-transaction-snapshot-validation.ts
  • src/main/skills/skill-transaction-workspace.test.ts
  • src/main/skills/skill-transaction-workspace.ts
  • src/main/skills/skills-cli-lock-provenance.test.ts
  • src/main/skills/skills-cli-lock-provenance.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx
  • src/renderer/src/components/feature-tips/CliSkillSetupTerminal.tsx
  • src/renderer/src/components/feature-wall/BrowserUseSkillSetupCard.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalOrchestrationDialog.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAdoptionNudge.test.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAdoptionNudge.tsx
  • src/renderer/src/components/onboarding/FeatureSetupInlineTerminal.tsx
  • src/renderer/src/components/onboarding/OnboardingInlineCommandTerminal.tsx
  • src/renderer/src/components/onboarding/onboarding-feature-setup.ts
  • src/renderer/src/components/right-sidebar/file-explorer-operation-owner.ts
  • src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx
  • src/renderer/src/components/settings/AgentSkillSetupPanel.tsx
  • src/renderer/src/components/settings/AgentsPane.tsx
  • src/renderer/src/components/settings/BrowserUsePane.tsx
  • src/renderer/src/components/settings/BrowserUseSkillStep.tsx
  • src/renderer/src/components/settings/CliSection.tsx
  • src/renderer/src/components/settings/ComputerUseSkillSetupPanel.tsx
  • src/renderer/src/components/settings/EphemeralVmsPane.tsx
  • src/renderer/src/components/settings/ManagedOrcaSkillsSection.tsx
  • src/renderer/src/components/settings/MobileEmulatorAgentControlRow.tsx
  • src/renderer/src/components/settings/OrchestrationPane.tsx
  • src/renderer/src/components/settings/OrchestrationSetupCard.tsx
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.tsx
  • src/renderer/src/components/settings/managed-skill-status-copy.ts
  • src/renderer/src/components/settings/skill-install-terminal-exit.test.ts
  • src/renderer/src/components/settings/skill-install-terminal-exit.ts
  • src/renderer/src/components/settings/use-agent-skill-management-actions.ts
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupDialog.tsx
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.tsx
  • src/renderer/src/components/sidebar/host-header-menu-items.ts
  • src/renderer/src/components/sidebar/sidebar-host-options.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/hooks/useManagedAgentSkills.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/ai-vault-resume-target.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/constants.ts
  • src/shared/execution-host.test.ts
  • src/shared/execution-host.ts
  • src/shared/skill-management.ts
  • src/shared/skills.ts
  • src/shared/types.ts
  • tests/e2e/settings-skill-detection.spec.ts
  • tests/e2e/settings-skill-management-production.spec.ts

Comment thread .github/workflows/pr.yml Resolved
Comment thread .github/workflows/pr.yml Resolved
Comment thread src/renderer/src/i18n/locales/en.json Resolved

@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: 3

♻️ Duplicate comments (3)
src/renderer/src/components/settings/managed-skill-status-copy.ts (1)

30-31: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

"Unknown copy" fallback text still unresolved.

Every other case returns a clean label ('Modified', 'Inaccessible', 'Update failed'); 'Unknown copy' reads like leftover phrasing rather than a status badge label.

✏️ Proposed fix
-      return translate('auto.components.settings.ManagedOrcaSkills.unknown', 'Unknown copy')
+      return translate('auto.components.settings.ManagedOrcaSkills.unknown', 'Unknown')
src/renderer/src/components/settings/ManagedOrcaSkillsSection.tsx (2)

44-59: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Visibility copy still omits agent-skills.

Only codex/claude are checked here; managed installations can also surface via agent-skills, so the "not visible in …" message can be inaccurate/incomplete for that provider.


91-96: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

file.change still isn't localized.

{file.change} renders the raw literal ('added'/'removed'/'modified') rather than going through translate() like every other user-facing string in this component.

🧹 Nitpick comments (2)
src/renderer/src/components/settings/managed-skill-status-copy.test.ts (1)

1-24: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression test for revision 0.

The implementation correctly uses === null (not a truthy check) so a verified revision 0 won't be misreported as "unverified" — a bug previously flagged on an earlier truthy-check version of this logic. Pinning this with an explicit test would guard against regressing back to a truthy check.

✅ Suggested additional test
   it('shows release provenance only for a mapped snapshot', () => {
     expect(
       managedSkillDiagnosticCopy({
         installedReleaseRevision: 7,
         installedAppVersion: '1.2.3',
         installedPackageDigest: 'abcdef0123456789'
       })
     ).toBe('r7 · Orca 1.2.3 · abcdef01')
   })
+
+  it('does not misreport a verified revision 0 as unverified', () => {
+    expect(
+      managedSkillDiagnosticCopy({
+        installedReleaseRevision: 0,
+        installedAppVersion: '1.0.0',
+        installedPackageDigest: 'abcdef0123456789'
+      })
+    ).toBe('r0 · Orca 1.0.0 · abcdef01')
+  })
 })
src/main/skills/skill-management-inventory.ts (1)

148-158: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting the nested ternary for readability.

The status computation nests three conditional branches inline. A small helper (e.g., resolveInstallationStatus(match, managed, managedRecord, ...)) would make the branches easier to scan, though the current logic is correct.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4317fbe-ed42-4540-a314-c85c5216a48e

📥 Commits

Reviewing files that changed from the base of the PR and between f4a12bc and 54dede8.

📒 Files selected for processing (41)
  • .github/workflows/release-cut.yml
  • config/reliability-gates.jsonc
  • config/scripts/generate-skill-bundle-manifest.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • package.json
  • resources/skills/current-manifest.json
  • resources/skills/release-mapping.json
  • resources/skills/snapshot-registry.json
  • src/main/ipc/filesystem-watcher-wsl.test.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/skills/skill-candidate-concurrency.ts
  • src/main/skills/skill-management-inventory.test.ts
  • src/main/skills/skill-management-inventory.ts
  • src/main/skills/skill-management-status.ts
  • src/main/skills/skill-orphan-transaction-sweep.ts
  • src/main/skills/skill-package-publish.ts
  • src/main/skills/skill-package-transaction-context.ts
  • src/main/skills/skill-transaction-marker-write.ts
  • src/main/skills/skill-transaction-marker.ts
  • src/main/skills/skill-transaction-recovery.test.ts
  • src/main/skills/skill-transaction-recovery.ts
  • src/main/skills/skill-transaction-restore.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/settings/ManagedOrcaSkillsSection.tsx
  • src/renderer/src/components/settings/managed-skill-status-copy.test.ts
  • src/renderer/src/components/settings/managed-skill-status-copy.ts
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.tsx
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (28)
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.tsx
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • resources/skills/release-mapping.json
  • src/preload/index.ts
  • src/preload/api-types.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/main/skills/skill-orphan-transaction-sweep.ts
  • resources/skills/current-manifest.json
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/main/skills/skill-package-publish.ts
  • src/renderer/src/i18n/locales/es.json
  • .github/workflows/release-cut.yml
  • package.json
  • src/main/skills/skill-transaction-recovery.ts
  • src/main/skills/skill-management-inventory.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/main/persistence.test.ts
  • src/renderer/src/i18n/locales/zh.json
  • config/scripts/generate-skill-bundle-manifest.mjs
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/main/skills/skill-transaction-restore.ts
  • src/main/persistence.ts
  • src/main/skills/skill-package-transaction-context.ts
  • src/main/skills/skill-transaction-recovery.test.ts

Comment thread config/reliability-gates.jsonc Resolved
Address automated review findings: workflow checkout credential
persistence and base-ref template expansion, Git subtree tree-sha
ordering, fail-closed frozen persistence writes, per-transaction orphan
sweep isolation, reserved-transaction symlink exclusion in discovery,
temp-handle close error masking, and busy/dismiss guards in the managed
skills UI. Rewrite settings and nudge copy to describe user decisions
instead of release diagnostics, and split the replacement dialog into
ManagedSkillReplacementDialog with labeled before/after columns.
Add managedSkillAutoUpdateEnabled (default on) and a background batch
that updates only already-managed, unmodified destinations on the local
host. The main-process handler gates on the persisted setting and build
authority, declines silently, coalesces duplicate triggers, and records
failures durably; a failed destination surfaces as update-failed and is
never retried automatically. An always-mounted renderer runner reuses
the shared inventory cache, requests one batch per bundled release, and
shows one aggregated success toast. Settings gains an "Update
automatically" switch, and copy across the section, setup panels, and
adoption nudge now describes automatic updates. Skill IPC host-context
and write-authorization plumbing moves into named modules, and the
skill-detection E2E pins the management inventory instead of reading
the developer's real skill homes.
The web client has no local skill filesystem, so the background batch
resolves to the same empty declined result the desktop returns when
auto-update is unavailable.
…pr-8496-conflicts

# Conflicts:
#	config/reliability-gates.jsonc
#	src/main/skills/discovery.test.ts

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/ipc/skills.ts (1)

207-240: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

One failed adoption aborts attribution for the rest of the batch.

The per-skillName loop has no isolation: if stat/adoptExactSkillSnapshot throws for one skill, the whole handler rejects and the remaining, otherwise-successful skill names in the same terminal-exit install never get attributed/adopted. autoUpdateManagedSkills isolates failures per-candidate; this loop should do the same.

♻️ Proposed fix
       for (const skillName of new Set(args.skillNames)) {
         const installation = inventory.installations.find(...)
         if (!installation) {
           continue
         }
-        const modifiedAt = await stat(join(installation.unresolvedPath, 'SKILL.md'))
-          .then((file) => file.mtimeMs)
-          .catch(() => 0)
-        if (modifiedAt + 2_000 < args.startedAt || modifiedAt > completedAt + 2_000) {
-          continue
-        }
-        await adoptExactSkillSnapshot({...})
-        inventory = await inventoryManagedSkills({...})
+        try {
+          const modifiedAt = await stat(join(installation.unresolvedPath, 'SKILL.md'))
+            .then((file) => file.mtimeMs)
+            .catch(() => 0)
+          if (modifiedAt + 2_000 < args.startedAt || modifiedAt > completedAt + 2_000) {
+            continue
+          }
+          await adoptExactSkillSnapshot({...})
+          inventory = await inventoryManagedSkills({...})
+        } catch (error) {
+          console.error(`[skills] Failed to attribute Orca install for ${skillName}:`, error)
+        }
       }
🧹 Nitpick comments (1)
src/renderer/src/App.tsx (1)

62-63: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider gating the new overlays behind startup readiness, matching sibling overlays.

ManagedSkillAdoptionNudge/ManagedSkillAutoUpdate mount unconditionally at App root, unlike most other overlays here (shouldMountSetupGuideTelemetryObserver, shouldMountDictationController, shouldMountUpdateCard, etc., all gated on persistedUIReady/workspaceSessionReady). Both rely on useManagedAgentSkills(), whose effect fires an inventory IPC call as soon as it mounts — this file's own extensive startup comments (e.g. around fetch-settings, ui-get, session-get) go out of their way to avoid extra IPC calls competing with the critical startup chain. Gating these two behind an existing readiness flag would keep that pattern consistent and avoid an extra unconditional IPC round-trip on every launch.

Also applies to: 2832-2833


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 873afd93-9d3a-452e-b8f7-9dc59cd06bb0

📥 Commits

Reviewing files that changed from the base of the PR and between 54dede8 and e881060.

📒 Files selected for processing (39)
  • .github/workflows/pr.yml
  • .github/workflows/skill-cli-roundtrip.yml
  • .github/workflows/skill-manifest-merge-gate.yml
  • config/reliability-gates.jsonc
  • config/scripts/generate-skill-bundle-manifest.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • config/scripts/verify-skill-cli-roundtrip.mjs
  • package.json
  • resources/skills/current-manifest.json
  • src/main/ipc/skill-management-host-context.ts
  • src/main/ipc/skill-write-authorization.ts
  • src/main/ipc/skills.test.ts
  • src/main/ipc/skills.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/skills/discovery.test.ts
  • src/main/skills/discovery.ts
  • src/main/skills/skill-auto-update.test.ts
  • src/main/skills/skill-auto-update.ts
  • src/main/skills/skill-bundle-artifacts.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/main/skills/skill-orphan-transaction-sweep.ts
  • src/main/skills/skill-owned-temp-publication.ts
  • src/main/skills/skill-package-publication.test.ts
  • src/main/skills/skill-transaction-package-build.ts
  • src/main/skills/skill-transaction-recovery.test.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAdoptionNudge.test.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAdoptionNudge.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAutoUpdate.test.tsx
  • src/renderer/src/components/managed-skills/ManagedSkillAutoUpdate.tsx
  • src/renderer/src/components/settings/AgentsPane.tsx
  • src/renderer/src/components/settings/ManagedOrcaSkillsSection.tsx
  • src/renderer/src/components/settings/ManagedSkillReplacementDialog.tsx
  • src/renderer/src/components/settings/managed-skill-status-copy.test.ts
  • src/renderer/src/components/settings/managed-skill-status-copy.ts
  • src/renderer/src/components/settings/use-agent-skill-management-actions.ts
🚧 Files skipped from review as they are similar to previous changes (19)
  • src/main/skills/skill-discovery-sources.ts
  • .github/workflows/skill-cli-roundtrip.yml
  • src/main/skills/discovery.test.ts
  • .github/workflows/skill-manifest-merge-gate.yml
  • src/preload/api-types.ts
  • resources/skills/current-manifest.json
  • .github/workflows/pr.yml
  • src/preload/index.ts
  • src/main/skills/discovery.ts
  • src/main/skills/skill-bundle-artifacts.ts
  • src/renderer/src/components/managed-skills/ManagedSkillAdoptionNudge.tsx
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • config/scripts/generate-skill-bundle-manifest.mjs
  • src/main/skills/skill-transaction-package-build.ts
  • src/renderer/src/components/settings/use-agent-skill-management-actions.ts
  • src/main/skills/skill-owned-temp-publication.ts
  • config/scripts/verify-skill-cli-roundtrip.mjs
  • package.json
  • src/main/skills/skill-package-publication.test.ts

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing without merge because this implementation has been superseded by the staged skill-freshness rollout: #8624 provides the version-matched guide-serving CLI, and #8637 provides read-only freshness detection plus the targeted ecosystem update rail. The ownership ledger, adoption flow, background updater, transactional writer, and automatic mutation implemented here are intentionally not part of the replacement design.

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