Repository navigation
feat(m8): Agent 资产 base+overlay 分层与用户级覆盖 (#493) - #494
Merged
Merged
Conversation
模板资产作为 base 层,asset_override 作为 overlay 层分别解析与校验, 控制面按 Skill 目录名、Subagent frontmatter name、Command 运行时路径 合并为 effective 快照;overlay 同名覆盖,层内冲突返回 asset_layer_merge_conflict。 Runner 只物化 effective bundle 到 CLAUDE_CONFIG_DIR (/testbed/.runtime-home/.claude) 并移除项目 .claude,source-mode 的 生成树也迁移到用户级目录。快照 manifest、202/进度、status/results 记录 base/overlay source、commit、validation 与逐资产 provenance;旧快照按 base-only 兼容。 按 (source, commit, install/init, validation_version) 复用 resolve 校验结果,单进程单飞,不因 asset_paths 不同重复 install/init。
两轮独立检视发现并修复: - effective 快照自身 identity 改取 overlay commit/source,base 只留在 asset_layers.base,避免 run 摘要/对比/自进化把候选标成 base。 - 合并 selection digest 纳入两层 source/commands,唯一冲突回退校验层身份。 - 无资产源时也移除项目 .claude;.runtime-home 先删后建防软链。 - 校验缓存加上限并在命中时覆盖当前 ref;base 错误标 asset_layer=base; asset_snapshot_json 统一合成 layers;runtime setup 按 key 合并; source-mode 搬迁检查源目录并返回明确错误;非法路径不再静默跳过。 - 补对应回归断言与检视记录。
This was referenced Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is by an automated agent, not a human.
What
Issue #493 changes
asset_overridefrom a whole-source replacement to a base + overlay asset model:asset_overrideis the overlay.name. Overlay wins on the same identity; a duplicate identity inside one layer returnsasset_layer_merge_conflict.CLAUDE_CONFIG_DIR(/testbed/.runtime-home/.claude). The project.claudeis removed so Claude Code's opposite skill/subagent scope precedence never decides a conflict.source_id,repo_url, andlayers(base/overlay source, commit, validation, and per-asset provenance); older snapshots are exposed as base-only.(source_id, commit, install/init, validation_version)in the API process, so differentasset_pathsover the same commit do not repeat install/init.The runner also moves a source-mode build's generated
.claudetree into the user-level config dir, so artifact-only and source-mode paths converge on one effective tree.Review
A structured review is recorded in
plans/2026-12-05-pr494-review.md. It found and this branch fixes the candidate-identity bug in the effective snapshot, the merge digest/unique-race edge, zero-asset project.clauderemoval, the validation-cache bounds/ref echo, layer error attribution, consistent layer echoes, per-key runtime setup merge, source-mode move failure handling, and unsafe-path handling. Two low-severity follow-ups remain: the per-key validation lock map is not pruned, and a rare unique-constraint merge race can leave an orphan bundle object (same pattern as the existing resolve path). Neither affects the requested result.Scope and limitations
This PR is the P3 slice that #493 describes as an independent PR. It does not add the separate validation worker/queue (P2), and it does not change the
asset_pathsdefault inheritance rules beyond the overlay semantics above. Source-mode layers still run their install/init on the API host during resolve; a source-build install that expects/asset-sourceat evaluation time still needs the P2 validation worker. The validation cache is process-local; the durable snapshot request cache remains the cross-process reuse mechanism.No UI files changed, so there is no Before/After visual comparison for this PR. The API read-model change is additive:
assetgainssource_id,repo_url, andlayers, whileresolved_commit/asset_snapshot_id/requested_refkeep their previous meaning.Verification
a2e9a34: all checks pass — backend (PostgreSQL pytest + migration dry-run), docs, flow-offline, flow-online (including the required Project link), runner, web and deployment contract.pytest tests/backend(SQLite, full suite) — passed.node --test tests/**/*.test.mjs/npm test— 130 passed.npm run lint:docsandnpm run verify:docs— passed (docs and i18n pairing updated).npm run verify:flowand the PR diff flow gate — passed.asset_paths, and runner user-level materialization + project.clauderemoval.Part of #493.
This pull request was produced by dsh-superagent under the ZTGolem account.