Repository navigation
Conversation
| refresh_skill(staged, staged, previous=previous) | ||
| for path in previous.rglob("*"): | ||
| destination = staged / path.relative_to(previous) | ||
| if path.is_file() and not destination.exists(): |
There was a problem hiding this comment.
[P1] 这里会把旧安装里任何 staged 缺失的文件复制回新包,无法区分用户新增文件和包本身应该提供的 managed reference。我在当前 Head 的隔离 probe 中删除 staged ZCode 包的 references/work-handoff.md 后调用 preserve_installed_guidance(),结果 after_exists=True(见 probe.missing-reference-preserve.direct2.out),旧文件被恢复且安装路径继续成功。这样 incoming 包缺失或损坏某个 reference 时,会静默使用旧版本内容。请用 manifest/生成资源清单校验 package-owned 文件,缺失时失败;只保留明确属于用户新增的文件。
|
please update & resolve conflicts |
| if target.exists(): | ||
| shutil.copytree(target, staging) | ||
| try: | ||
| refresh_skill(source, staging) | ||
| except GuidanceError as error: | ||
| raise OSError(str(error)) from error | ||
| write_if_changed( | ||
| staging / SKILL_MANIFEST, | ||
| (json.dumps({"schema": 1, "owner": "powercontext", "integration": "opencode"}, indent=2) + "\n").encode( | ||
| "utf-8" | ||
| ), |
There was a problem hiding this comment.
Please validate and stage the Skill before committing installation changes, or roll back the plugin and TUI configuration on failure.
install_opencode_plugin() replaces the plugin bundle and updates tui.json before reaching refresh_skill(). I reproduced this by removing references/work-handoff.md from the incoming package: installation raises SetupError, but both the plugin bundle and TUI configuration have already changed, while the old Skill remains installed. A rejected upgrade should preserve the previous installation instead of leaving mixed versions.
There was a problem hiding this comment.
Reproduced on the current head, d1961b7e225dca697b8822510ab2edf52c8afc5d (P2). I installed a complete package through install_opencode_plugin(), added local Skill notes, then changed the incoming plugin JS and removed references/work-handoff.md. The upgrade raised Cannot run install OpenCode Skill: missing guidance resource: references/work-handoff.md, but plugins/powercontext-opencode.js and tui.json had already changed; the old Skill and its notes remained unchanged. Host executable/version/path discovery was stubbed; filesystem installation and failure handling ran against the actual implementation.
The Skill-level rollback therefore still leaves a mixed installation. Please validate and stage the Skill before committing the plugin/configuration changes, or restore all three on failure. A regression through the public installer should verify that rejecting an incomplete incoming package preserves the previous plugin, TUI configuration, and Skill.
hidb4ai
left a comment
There was a problem hiding this comment.
The incomplete-package upgrade issue is fixed on this head. One P2 remains in Skill recovery failure and subsequent retry; see the inline reproduction.
Which issue or RFC does this PR close?
Closes #1865.
Rationale for this change
Generate shared integration guidance while retaining host differences and local user notes. Refuse incomplete incoming packages without leaving a partially updated installation.
What changes are included in this PR?
20583250a6bdce5bab8716321ee3911844b6de2d, reconcile the Atomic Memory guidance changes in source templates and generated files, and refresh the evaluation pin. Preserve upstream's host-specific API names and restrictions.Are there any user-facing changes?
Managed guidance refresh preserves local notes and rejects incomplete or ambiguous packages. OpenCode no longer leaves a new plugin/configuration with an old Skill when incoming guidance is rejected. If recovery itself fails, it reports retained paths and requires operator recovery/reconciliation before retry; it does not silently treat a missing Skill as a fresh install. Leftovers from unsuccessful backup cleanup also require reconciliation. Its filesystem commit recovery covers caught failures; this is not a process-crash journal or a concurrent-installer guarantee. Credential persistence and native host activation are separate, unchanged operations. Native package-manager behavior in Codex, Claude Code, Pi and OpenClaw remains host-controlled.
The shared conditional embedding-cost note and Claude Code's verified installed-root resolver fallback remain intentional guidance changes. No new model calls or scheduled work are added. Package authenticity and external URL validation are outside this change.
How was this change tested?
29cases. It covers rejected first installs/upgrades, write failures, all four file restoration destinations, Skill restoration failure, simultaneous Skill/plugin recovery failure, failed first-install cleanup, ambiguous backup states and unreadable recovery directories. Retry assertions compare all retained and active bytes; after explicit restoration/reconciliation, setup succeeds with personal files, appended notes and unrelated TUI settings intact. Completed upgrade retries are also checked for idempotence.240tests with4existing skips. Both OpenCode callers of the Skill swap are guarded; the full public installer additionally checks retained file transactions. Other hosts do not call this helper, and their existing recovery implementations are not certified by these OpenCode regressions.tychecks pass. Native Windows pre-commit passes every hook except full-repositoryty, which retains existing Unix-only API diagnostics; no gate was disabled or weakened.28offline evaluation tests pass. Snapshot source:59fc8b3ca217e63fa37a2980fd0c0a04fe5e516a; content SHA-256:f7a906e9db3b705d52f7bfbb46207c99a850d17a20a68ec5b13870ce8fd077ae. Pin and suite validation pass. No authenticated model evaluation was run.10a193d, Ubuntu 24.04 / Python 3.11.15 with lockedpylibseekdb==1.4.0.post1, restricted to two CPUs. The seventh attempt timed out atCREATE TABLE pc_schema_revision(exit 124). Native logs showT1_MaintainDepItaking theRUNTIME id=1exclusive lock in transaction1000002, thenno clients remaining, exiting; reopened processes still wait for that transaction. The bundled engine is 1.4.0.0 /d0cbdf0e9931f46f68fd4ff4aec955c8c3b8efd2; its last-client exit path calls_Exit(0). This matches both previous CI timeouts. The engine's restart-recovery defect remains outside this integration change; repeated standalone maintenance opens can still encounter it.11tests with1existing OceanBase-only skip; the unchanged SeekDB connection/backup/schema selection passed19, including actual close/reopen, cross-process exclusion and fork/DDL/restart/restore. No SQL backend is mocked. Only the runner fixture wraps realaopento retain its extra native lease until teardown; missing-target checks still leave no directory.e798aef9a501d7ca5f7b8dd9f89b9e906a1f40f8:31successful checks,0failures and1existing conditional skip (installed-package, manual-dispatch-only). All six workflows succeeded, including Main, E2E harness and Desktop validation. CI tested merge commit94059a485f6e99decffe229221d0a21ce3776a0eagainst upstream4ae1371cbe61a8911451236e8d38178f1ccee2d4. The Windows managed-guidance and rollback step passed82tests, including the public OpenCode installer suite. Author verification and CI do not replace independent review.AI usage statement
OpenAI Codex assisted with implementation and author-side verification. The current revision awaits independent maintainer re-review; it is not described as release-ready. Review discussions remain open.