Skip to content

Commit 0e96cf0

Browse files
committed
fix: preserve task recovery across workspace relocation
1 parent e4064d0 commit 0e96cf0

30 files changed

Lines changed: 421 additions & 65 deletions

‎changelogs/releases/v1.19.0.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ v1.19.0 修复真实工程任务在会话、Hook、工具调用和恢复过程
4949
- 根 `README.md`、`public-site/**/*.md` 与 `website/**/*.md` 退出 JavaScript 正文、章节、词句、计数和动态 marker 校验;站点代码、配置、组件、数据与显式 release build 仍按工程范围验证。
5050
- 语法级危险命令分类减少只读搜索和文档文本误拦,真实危险 sink 继续失败关闭。
5151

52+
### Profile 路径可迁移
53+
54+
- 新生成 Profile 的直属 README 声明 `portable-v1`;项目内长期路径统一使用 `<workspace-root>`、`<project-root>`、`<active-root>` 或相对路径,不再把当前盘符或用户目录固化为规范事实。
55+
- `ProfilePathPortabilityGate` 只检查显式目标 Profile 的顶层 Markdown。真实本机外部路径必须同一行标注 machine-local marker;URL 与站点根链接不误报,未声明契约的 legacy Profile 保持兼容。
56+
- D 盘迁移已定向收口 DevCodex Profile:12 处旧工作盘符改为语义根,2 处仍真实位于 E 盘的 DevDocs 路径作为 machine-local 事实保留;其他项目没有进入扫描或修改范围。
57+
- 路径迁移不改写历史报告、receipt 或审计证据,也不删除 legacy generation;可重建派生索引在根变化后按新 active-root 失效重建。
58+
59+
### 正式任务跨物理根续接
60+
61+
- `TaskIdentityV2.projectRootIdentityDigest` 明确收窄为首次准入 provenance;正式任务的可移植身份使用 taskId、project、kind 与 active-root-relative task path,不再把原盘符当成永久任务身份。
62+
- Admission、Lifecycle、Stop 与 MCP takeover 共用 `PortableTaskIdentityBindingDecisionV1`。迁移后必须重新取得当前 active-root containment、ProjectTargetLease、admission 与 fenced owner;旧根的 BudgetCard、validation control、mutation lease 和热态不会恢复实时权限。
63+
- 共享决定先验证完整 `TaskIdentityV2` schema、immutable core 与 `identityDigest`;允许物理根 relocation 不会放宽身份完整性,损坏 identity 在 Lifecycle/Stop 也会失败关闭。
64+
- TaskRecoveryStoreV5 在新物理根使用新的 recoveryKey/session mapping;旧根 A/B 槽与历史 receipt 保留证据且不自动删除。
65+
66+
### 宿主 Skill 精确读取
67+
68+
- Host Skill 隐私防护继续禁止列出用户级 skills 根目录,但允许读取调用方已明确指定的单个 `SKILL.md`,避免 Codex system/plugin Skill 和 DevCodex G_RUNTIME Skill 被误判为目录 inventory。
69+
5270
## 兼容性与数据安全
5371

5472
- Node.js 最低版本、CLI 顶层命令和既有公开 JSON 顶层结构保持兼容;新增字段和命令均为向后兼容扩展。

‎changelogs/unreleased.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
66
## 当前未发布实现候选
77

8+
- **正式任务跨根续接与 Skill 精确读取(PI-306~PI-308 / PF-373~PF-375 / GR-096~GR-098)**:TaskIdentity 首次 root digest 仅作 provenance,Admission/Lifecycle/Stop/MCP takeover 共用 portable binding decision;共享决定先验证不可变 V2 identity/digest,损坏身份失败关闭。新根重新取得 live authority,旧 root 热槽和 BudgetCard/owner/lease 不迁移且不删除。宿主 Skill 隐私规则只放行精确 `SKILL.md` 文件,skills 根目录 list/glob/recurse 仍阻断。跨根 admission/Stop/MCP、tampered identity、真实 D 盘 session remap、Codex system Skill 与危险命令分类定向回归均 PASS。
9+
- **ProfilePathPortabilityGate(PI-305 / PF-372 / GR-095)**:新生成 Profile 采用 opt-in `portable-v1`,项目内长期路径使用 `<workspace-root>` / `<project-root>` / `<active-root>` 或相对路径,真实本机外部路径用同一行 machine-local marker 标注。validator 仅检查显式目标 Profile 顶层 Markdown,不枚举其他项目;legacy 未声明契约时兼容读取,历史报告/receipt 不改写。D 盘迁移已把 DevCodex 自身 12 处旧工作盘符改为语义根并保留 2 处真实 E 盘 DevDocs 例外;隔离 Windows/Unix/URL/legacy 回归、active Profile 残留探针、control-content、duplication、CSD 与治理台账均 PASS。
810
- **CP3 v1.6 工作流与任务所有权 P0 候选(发布资格验证中)**:新增 `ActualInstructionEnvelopeV1 → WorkItemSetV1 → WorkflowRouteDecisionV2`,附件、截图/OCR、引用文档、工具输出与 ambient UI 仅作证据,不能反向覆盖用户真实指令。`WorkspaceSessionRouteIndexV1` 只提供 hint,`ProjectTargetLeaseV2` 精确绑定 session/project/root/context/route;正式任务由 server-owned `TaskAdmissionTransactionV1` 一次性写入 task identity、`00-需求概况.md` 与用户原样 `01-产品需求.md`,以 ingress idempotency 和 `FencedTaskWriteOwnerLeaseV2` 阻止重复准入、跨项目/跨任务写入、mtime 选错任务及 terminal 旧绑定复活。Simple task 仅使用 server-issued 两路径/两次租约,漂移立即升级正式流程。
911
- **正式产物、Hook mutation 与恢复单一权威**:`MutationFootprintV2 → LayeredArtifactSlotRegistryV2 → ArtifactSlotDecisionV2 → TaskOwnedMutationLeaseV2 → TaskRecoveryStoreV5 prewrite → MutationObservationReceiptV1` 成为 Hook/MCP/宿主工具的统一写链;unknown writer、未观察实际效果、跨 active-root、重复消费与错误槽位均 fail closed。V5 继续使用 task hot A/B、cold stub、terminal 退出缓存、256/512 MiB 和 8 MiB closeout reserve,不再按每次 Hook/工具状态创建 UUID generation;hot 槽的容量判定、usage ledger 预充与实际写盘共用紧凑 JSON 字节序列,避免格式化空白把合法恢复状态误判为超过 256 KiB。产品提供型 `01-产品需求.md` 保持用户原始真相且 AI 不得改写。
1012
- **验证执行授权、稳定终态与安全消费者**:`VerificationIntentV2`、`ValidationRunIdentityV1`、`VerificationExecutionLeaseV2`、`ManagedValidationRunnerV2` 与固定 run shard 将 plan/budget/actor/candidate/HEAD/dirty identity、deadline/renew、runner-owned process 和 exactly-one terminal 绑定;worker 入口在 fork 前确定性校验,缺失固定为环境 `blocked`,不再由 Windows send/exit 竞争随机变成 `abandoned`。普通 changed edit 不得静默升级 V3/full,CI/release 只有显式角色与同一 BudgetCard 摘要回绑后才能执行。AI 计划现在必须先从当前 host session 取得 server-owned formal task 并绑定 ContextRead epoch;confirm 使用唯一 `PendingBudgetCardBindingV1` 与当前卡确认,Sticky Auto 可为 V0~V2 生成 server-owned `BudgetConfirmationReceiptV1`。失败后的 `ValidationContinuationAuthorizationV1` 始终相对 immutable root,完整 mutation observation 与同 HEAD/无新增 dirty 路径、节点或预算的 same-scope retry 共用最多两次上限;第三次必须 BLOCK,不能自动换根清零。首节点前的 runner/V5 基础设施失败没有业务节点名时,以有界 `terminalReason.code` 作为恢复锚点,仍受同一 immutable root 与重试上限约束。Auto ingress 过期时只可沿用 task/session/context/revocation 一致的既有 root,不能创建或替换根。pause/stop/scope reduction 会撤销全部 live authority。V5 evidence store 回读同一 session/task,缺失或错绑在 BudgetCard/首节点前失败关闭,不再产生“可确认但不可执行”的死卡。PF-342/PF-343、PowerShell 写入别名、wrong-server MCP leaf、宿主中性 Hook fixture、语法级危险命令分类和 `BoundedMaintenancePreviewV2` 同批收敛;只读搜索/文档文本不再误拦,真实危险 sink 继续失败关闭。运行态 MCP closure 默认只做 V2 依赖/隔离布局,npm packlist 与真实 pack/install `pack-clean` 均为显式 release consumer,避免专项验证暗跑打包生命周期。当前 validation manifest 为 115 nodes / 113 full、7 个 V2 边界;R7/R8、commit、push 与版本发布将在当前候选 affected/ECR 收敛后进入已授权发布链。

‎content/duplication-dispositions.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"id": "DP-024",
168-
"candidateIds": ["exact-ee12e8a45a36"],
168+
"candidateIds": ["exact-ee12e8a45a36", "exact-f15eae7cc073"],
169169
"decision": "extract",
170170
"fragment": "shared/profile/profile-read-chain.md",
171171
"reason": "profile instruction 与 Skill 共享同一读取链门禁。"

‎content/duplication-inventory.json‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"schemaVersion": "ControlContentDuplicationInventoryV1",
3-
"sourceBundleDigest": "aa199d8fcaa20407c0c50126e3c2617ed7b41ac6e0aa93f410fc8569d399618f",
3+
"sourceBundleDigest": "3be1b188f032d171b3a82f8d82b356a73534e97ba9ad6b67ad8a2a01e282af34",
44
"thresholds": {
55
"minParagraphChars": 100,
66
"sectionThreshold": 0.94,
77
"minSectionChars": 180,
88
"minSectionLengthRatio": 0.85
99
},
1010
"counts": {
11-
"exactParagraph": 28,
11+
"exactParagraph": 29,
1212
"nearSection": 4,
13-
"total": 32
13+
"total": 33
1414
},
1515
"candidates": [
1616
{
@@ -313,6 +313,17 @@
313313
],
314314
"excerpt": "所有工作流的 Profile 获取都必须执行 `ProfileReadChainGate`;服务 / 框架规范复审、跨服务需求、workspace-namespace 或 Profile 同步任务还必须执行 `ServiceNormCoverageGate`:"
315315
},
316+
{
317+
"id": "exact-f15eae7cc073",
318+
"kind": "exact-paragraph",
319+
"digest": "f15eae7cc07378d624bba165ac4fc002cc4d62370dce70df00539fe174b18978",
320+
"similarity": 1,
321+
"files": [
322+
"instructions/01a-profile-loading.instructions.md",
323+
"skills/load-profile/SKILL.md"
324+
],
325+
"excerpt": "- `ProfilePathPortabilityGate` 只对显式目标 Profile 生效:其直属 `README.md` 声明 `Profile 路径契约:portable-v1` 后,validator 仅检查该 Profile 顶层 Markdown,不得借此枚举或修改其他项目。\n- 项目内稳定路径必须使用 `<workspace-root>`、"
326+
},
316327
{
317328
"id": "exact-f93be1be0dd5",
318329
"kind": "exact-paragraph",

‎content/instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
- HostCapabilityRoutingGate:最终工作流意图确定后,若需要在 `direct / plan_first / auto_authorized` 间选择、解释宿主 variant 能力上限或核验跨轮 instruction authority,按需读取 `host-capability-routing`。该 Skill 只输出 portable `CapabilityIntentDecisionV1`,不得覆盖 `intent/routing`、CP、Auto 或 S01~S07;catalog 缺失、重复、过期、variant 未知或证据不足时 fail closed 到 portable fallback。
121121
- `OriginalInstructionRefV1` 只保存 identity、authority、可回读 locator 与 ≤512 字符受控摘要,不保存完整原文;compat/none 不能单独授权跨轮 mutation。Phase 1 不调用 native lever,也不新增/依赖 MCP Tool/Resource、CLI 或 Hook;宿主 UI、permission/YOLO mode、plan 文件或 approval 均不能冒充 DevCodex CP/Auto/native-applied 证据。
122122
- 工作流入口必须先形成 `ActualInstructionEnvelopeV1 → WorkItemSetV1 → WorkflowRouteDecisionV2`:只有当前实际用户指令段拥有 instruction authority;附件、截图/OCR、引用文档、工具输出、ambient UI 与 project observation 只能作证据。复合消息中的工作项默认串行;Envelope/RouteDecision 本身不授予 mutation、commit、push 或 release authority。
123-
- `WorkspaceSessionRouteIndexV1` 只保存有界、可过期的 route hint;执行前必须取得绑定当前 session/turn、canonical roots、layout/root identity、context epoch 与 route revision 的 `ProjectTargetLeaseV2`。正式任务再由 server-owned `memory_task_admit_v2` 通过 `TaskAdmissionTransactionV1` create-if-absent 并回读 `TaskIdentityV2`、canonical 概况和 CP pending;displayName、mtime、摘要、附件或手工目录不能替代准入。
123+
- `WorkspaceSessionRouteIndexV1` 只保存有界、可过期的 route hint;执行前必须取得绑定当前 session/turn、canonical roots、layout/root identity、context epoch 与 route revision 的 `ProjectTargetLeaseV2`。正式任务再由 server-owned `memory_task_admit_v2` 通过 `TaskAdmissionTransactionV1` create-if-absent 并回读 `TaskIdentityV2`、canonical 概况和 CP pending;displayName、mtime、摘要、附件或手工目录不能替代准入。`TaskIdentityV2.projectRootIdentityDigest` 只保存首次准入 provenance,不是永久盘符绑定;迁移后必须以相同 `taskId + project + taskRootRelative`、当前根 containment 与新 lease/owner 重绑定,旧根热态或验证授权不得继承。
124124
- Context Rehydration Contract:压缩恢复、resume、summary 恢复或用户明确要求“按文件真相重建”时,必须按 `当前用户消息 > 已确认需求/bug产物 > 任务 sessions.md > 当日 tasks > Agent SUMMARY > compaction/summary 摘要 > AI 当前推断` 的优先级重建上下文;摘要只能作导航提示,不得覆盖文件真相源。
125125
- ContextHandoffCard:跨会话、跨 Agent、多批次、summary/compact 前、用户明确要求“传递上下文”或即将中断时,交接方必须在报告或 daily tasks 写入 `source-of-truth`、`confirmed-decisions`、`open-risks`、`next-action`、`blocked-reason`、`must-not-overwrite`、`validation-state`、`artifact-links`;恢复方按 Context Rehydration Contract 消费并重新核对文件真相源,禁止用 handoff 覆盖已确认产物、sessions、tasks 或 SUMMARY。
126126
- Hook Stop/PreCompact 对入口检查块的可见回复验证必须区分 `verified-present` / `verified-missing` / `unverified` 三态;无法解析最终 assistant 内容时只能提示“无法验证最终用户可见回复”并附 payload capture 指引,禁止断言“未输出”。

‎content/instructions/01-common.instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ version: 1.19.0
275275
- 最终工作流意图确定后,若需选择 `direct / plan_first / auto_authorized`、解释精确宿主 variant 上限或核验跨轮 instruction authority,按需触发 `host-capability-routing`。它不重新分类 workflow intent、不拥有 CP/Auto/S01~S07;catalog 缺失、重复、过期、variant 未知或证据不足时只允许 portable fallback。
276276
- `OriginalInstructionRefV1` 只保存 identity/authority/locator/受控摘要;compat/none 不得单独授权跨轮 mutation。Phase 1 不调用 native lever,也不依赖 MCP/CLI/Hook;宿主 UI、permission/YOLO mode、plan 文件或 approval 不得写成 CP、Auto 或 native-applied。
277277
- 工作流执行入口以 `ActualInstructionEnvelopeV1` 为准:只有实际用户指令段拥有 instruction authority;附件、截图/OCR、引用文档、工具输出、ambient UI 和 project observation 只作证据。复合消息形成默认串行 `WorkItemSetV1`,每项只选择一个 registry-bound `WorkflowRouteDecisionV2`;Envelope/RouteDecision 均不直接授 mutation/release。
278-
- `WorkspaceSessionRouteIndexV1` 只提供有界 route hint;项目执行必须持有 session/turn-bound `ProjectTargetLeaseV2`。正式任务随后通过 `TaskAdmissionTransactionV1` 物化 `TaskIdentityV2`、canonical overview 与 CP pending,再以 confirmed CP + finalized admission + active `FencedTaskWriteOwnerLeaseV2` 取得当前写入所有权。
278+
- `WorkspaceSessionRouteIndexV1` 只提供有界 route hint;项目执行必须持有 session/turn-bound `ProjectTargetLeaseV2`。正式任务随后通过 `TaskAdmissionTransactionV1` 物化 `TaskIdentityV2`、canonical overview 与 CP pending,再以 confirmed CP + finalized admission + active `FencedTaskWriteOwnerLeaseV2` 取得当前写入所有权。`TaskIdentityV2.projectRootIdentityDigest` 只记录首次准入根的不可变 provenance,不是永久盘符绑定;工作区迁移后仅可凭相同 `taskId + project + taskRootRelative`、当前 active-root containment 与新 `ProjectTargetLeaseV2` 重绑定,旧根 V5 热态不得继承当前 mutation authority。
279279
- `SimpleTaskFastPath` 不是模型自判授权:必须取得 server-owned `SimpleTaskFastPathLeaseV1`,最多 2 个同一边界 exact 低风险路径和 2 次 create-or-update;正式产物、公共契约、控制面、安全、依赖、发布、跨模块或第 3 个路径在 mutation 前升级正式准入。
280280
- 每次写入由 `MutationFootprintV2 → ArtifactSlotDecisionV2 → TaskOwnedMutationLeaseV2 → TaskRecoveryStoreV5 prewrite → MutationObservationReceiptV1` 单次闭环;0-target、unknown、partial、越界或 required effect 未发生必须 `needs-reconcile`。terminal 四证据 closeout 后立即解绑 route/owner,只有显式 reopen 才可获得新 owner generation。
281281

‎content/instructions/11-fix.instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ActualInstructionEnvelope/RouteDecision → 正式任务 TaskAdmissionTransactio
4747
- **backlog 来源前置真相复核**:若本轮 bug、批次或修复范围直接来源于 `data/*.md` 的 open/partial 项,CP1 前必须先把候选项分类为 `pure-open` / `residual-tail` / `already-fixed` / `misclassified`;非 `pure-open` 项须先回写状态并修正范围口径,再进入修复。
4848
- **执行期 CP3 回退**:若执行过程中实际修改范围扩展到 CP3 门槛(文件数从 <5 增至 ≥5,或新增高风险/控制面联动),必须暂停执行,补做 CP3 后再继续。
4949
- **execution-contract/test-router**:≥5 文件、高风险、控制面或多批次修复时执行,明确允许路径、必需产物和验证路线
50-
- **执行 authority 不变量**:正式修复先通过 `memory_task_admit_v2` 进入 `TaskAdmissionTransactionV1`,create-if-absent 并回读 `TaskIdentityV2`、canonical 问题概况与 CP pending;源码 mutation 前必须 finalized admission、所需 CP confirmation 与 active `FencedTaskWriteOwnerLeaseV2`。route hint、resolver、“继续”、mtime 或旧 owner 不能替代。
50+
- **执行 authority 不变量**:正式修复先通过 `memory_task_admit_v2` 进入 `TaskAdmissionTransactionV1`,create-if-absent 并回读 `TaskIdentityV2`、canonical 问题概况与 CP pending;源码 mutation 前必须 finalized admission、所需 CP confirmation 与 active `FencedTaskWriteOwnerLeaseV2`。route hint、resolver、“继续”、mtime 或旧 owner 不能替代。工作区迁移只允许 portable task identity 在当前根重新准入并取得新 owner,禁止复用旧物理根的 lease / validation authority。
5151
- **RepairPreventionAssessmentGate**:所有 repair task 在 accepted 前执行 active `repair-prevention-assessment` 的 `RepairPreventionAssessmentV1`;current repair closure 与 prospective prevention evidence 必须分列,repeat escape/high risk 升 full,`no-new-control` 必须有标准 reason/evidence;gray `rework-prevention-engineering` 仅在返工指标或长期效果语义下额外触发
5252
- **Intent Expansion 可见性**:dev 模式下,CP1 / 问题确认前默认向用户展示完整 Intent Expansion Card;这会覆盖旧的“意图扩展摘要”默认行为,但当命中控制面或宿主能力差异、跨会话 resume、prod、instruction-fallback 宿主或低风险轻任务时,仍允许退化为 3~5 行意图扩展摘要。
5353
- **OfficialDocsEvidence**:依赖升级、框架/SDK/API 修复、平台行为变更或外部模块替换时,CP2 前必须读取官方使用文档/官方参考资料;缺失证据不得进入执行。

0 commit comments

Comments
 (0)