@pm_zhousl/xinyun-ai-init 1.10.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/init/xinyun-ai-init/README.md +3 -1
  2. package/init/xinyun-ai-init/rules/directory-self-completion.md +4 -0
  3. package/init/xinyun-ai-init/rules/init-rules.md +13 -0
  4. package/init/xinyun-ai-init/rules/session-workbench.md +4 -0
  5. package/init/xinyun-ai-init/rules/upgrade-rules.md +4 -0
  6. package/init/xinyun-ai-init/rules/v1.10.2-contract.md +30 -0
  7. package/init/xinyun-ai-init/rules/v1.11.0-acceleration.md +27 -0
  8. package/init/xinyun-ai-init/rules/v1.12.0-recovery.md +34 -0
  9. package/init/xinyun-ai-init/templates/bootstrap-snapshot.template.json +17 -0
  10. package/init/xinyun-ai-init/templates/core-rules.template.md +2 -0
  11. package/init/xinyun-ai-init/templates/fixed-materialization.template.json +12 -0
  12. package/init/xinyun-ai-init/templates/host-capabilities.template.json +2 -0
  13. package/init/xinyun-ai-init/templates/host-preflight.template.json +31 -0
  14. package/init/xinyun-ai-init/templates/init-result.template.json +39 -2
  15. package/init/xinyun-ai-init/templates/initialization-cache.template.json +13 -0
  16. package/init/xinyun-ai-init/templates/initialization-recovery.template.json +29 -0
  17. package/init/xinyun-ai-init/templates/initialization-stages.template.json +18 -0
  18. package/init/xinyun-ai-init/templates/initialization-timing.template.json +16 -0
  19. package/init/xinyun-ai-init/templates/managed-baseline.template.json +2 -2
  20. package/init/xinyun-ai-init/templates/manifest.template.json +36 -2
  21. package/init/xinyun-ai-init/templates/manual-session-binding.template.json +23 -0
  22. package/init/xinyun-ai-init/templates/parallelism.template.json +13 -0
  23. package/init/xinyun-ai-init/templates/project-index.template.json +29 -0
  24. package/init/xinyun-ai-init/templates/requirement-packet.template.json +1 -1
  25. package/init/xinyun-ai-init/templates/role-session-binding.template.json +13 -2
  26. package/init/xinyun-ai-init/templates/shared-project-snapshot.template.json +24 -0
  27. package/init/xinyun-ai-init/templates/task-index.template.json +12 -0
  28. package/init/xinyun-ai-init/templates/technical-impact-packet.template.json +1 -1
  29. package/init/xinyun-ai-init/templates/technical-landscape.template.json +1 -1
  30. package/init/xinyun-ai-init/version.json +1 -1
  31. package/package.json +1 -1
  32. package/scripts/verify-init-package.js +95 -1
  33. package/scripts/verify-rules-package.js +87 -2
  34. package/test-scenarios/README.md +8 -0
  35. package/test-scenarios/v1.10.2-scenarios.md +38 -0
  36. package/test-scenarios/v1.11.0-scenarios.md +30 -0
  37. package/test-scenarios/v1.12.0-behavior-evidence.json +29 -0
  38. package/test-scenarios/v1.12.0-scenarios.md +51 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  本目录是“欣芸技术开发 Agent 流”的初始化包,负责把完整 AI 执行要求下发到目标项目。
4
4
 
5
- 当前规则版本:`1.10.1`。
5
+ 当前规则版本:`1.12.0`。
6
6
 
7
7
  ## Codex 一句话入口
8
8
 
@@ -54,6 +54,8 @@ AI 读取本文件后,必须按以下方式执行:
54
54
  24. 初始化控制面完成后归档初始化登记任务,更新 `xinyun-ai/tasks/task-index.json`;没有可执行任务时 `current-task.md` 使用 `status=idle`、`taskId=null`、`title=暂无待执行任务`。
55
55
  25. 用户一句话初始化授权包含 `.codegraph/` 工具控制目录;首次缺失且命令可用时自动执行一次 `codegraph init -i`,不自动安装 CodeGraph 或修改系统环境。
56
56
  26. 完成后用中文输出初始化或升级结果、项目导读、团队责任状态、任务状态、CodeGraph 状态、待确认问题和后续短指令。
57
+ 27. v1.10.2 必须区分宿主线程、宿主会话、项目会话和主调度会话;真实 sessionId 只能来自宿主返回值,无法验证时保持 blocked。
58
+ 28. v1.11.0 使用固定模板物化、阶段状态、项目快照、24 小时缓存和最多 3 个角色并发;缓存命中不能跳过必要会话、授权或最终门禁。
57
59
 
58
60
  ## 初始化授权边界
59
61
 
@@ -34,6 +34,10 @@
34
34
  - `framework-profile.json` 和 `migration-record.json` 创建后必须确认 JSON 可解析,并同步 `xinyun-ai/index/project-index.json`。
35
35
  - 首次极速初始化不强制创建上述目录;普通咨询也不创建迁移或 profile 记录。
36
36
 
37
+ ## v1.12 接管恢复目录
38
+
39
+ When takeover initialization is authorized, create `host-preflight.json`, `index/initialization-recovery.json`, `sessions/manual-bindings.json`, `index/shared-project-snapshot.json`, and `index/initialization-timing.json` under `xinyun-ai/`. Use atomic writes and preserve blocked state on host or permission failure.
40
+
37
41
  ## v1.7.1 任务树、归档与 CodeGraph 目录
38
42
 
39
43
  - 初始化或升级流程必须补齐 `xinyun-ai/tasks/task-index.json`、`xinyun-ai/tasks/archive/`、`xinyun-ai/tasks/.archive-transactions/`、`xinyun-ai/tasks/.archive-tmp/`。
@@ -56,6 +56,19 @@
56
56
  - CodeGraph 必需任务失败时进入 `blocked`;只有用户明确授权限定范围降级时才允许 `partial`。
57
57
  - 不自动安装 CodeGraph,不修改系统环境、业务代码、数据库、API、配置、依赖或 Git。
58
58
 
59
+ ## v1.12 initialization gate recovery
60
+
61
+ Run the seven-capability host preflight before role sessions. Materialize the main task and five role tasks first; on failure preserve `sessionId=null`, `blockedReason`, and `nextAction`. Explicit `确认执行` or `确认继续初始化` reuses task IDs and increments `attempt` without duplicates.
62
+
63
+ ## v1.10.2 and v1.11.0 gate
64
+
65
+ - Keep `hostThreadId`, `hostSessionId`, `projectSessionId`, and `orchestratorSessionId` separate. Any value without host evidence remains `null`.
66
+ - All five role sessions and the orchestrator must use unique, host-returned session IDs. A host thread, task ID, role ID, title, or random value is never a session ID.
67
+ - Use the v1.9 eight-field RFC8785-JCS-SHA-256 project-isolated reuse key. The legacy four-field index is creation compatibility only.
68
+ - `task.status` is the cross-file source of truth. Illegal task/result/lock combinations become `blocked` and stop further writes.
69
+ - `businessCodeChanged.value=no` requires structured evidence; without evidence it must be `unknown`. Missing real behavior evidence cannot produce `ready`.
70
+ - v1.11 stages are `preflight`, `fixed-materialization`, `control-plane`, `codegraph`, `bootstrap-snapshot`, `role-sessions`, `onboarding`, and `final-gate`. Fixed templates, a bounded project snapshot, a 24-hour cache, and at most three role sessions may reduce repeated work but cannot bypass the final gate.
71
+
59
72
  ## v1.7.2 角色后续任务可见性
60
73
 
61
74
  - 初始化主任务使用 `taskKind=initialization-main`;角色登记使用 `taskKind=initialization-record`;后续执行任务使用 `taskKind=role-execution`。
@@ -285,6 +285,10 @@ HTML 迁移只允许评估和单页面 / 区块试点计划;实际代码迁移
285
285
 
286
286
  任何跨会话冲突、状态源缺失、预算超限、权限失败或敏感信息无法确认时暂停或阻塞,不自动重试、合并、覆盖或释放。
287
287
 
288
+ ## v1.12 host preflight and resumable sessions
289
+
290
+ Record all seven host capabilities before role sessions. `available-with-dependency` is not ready until authorized. Manual binding requires a real host-returned session ID and interaction evidence; host thread IDs cannot substitute for project session IDs.
291
+
288
292
  ## v1.10 接管 preflight 与交接
289
293
 
290
294
  交接必须记录 host capability、真实 sessionId、executionEligible 和阻塞原因;宿主不支持时保持 sessionId=null,不得伪造 sessionId。
@@ -116,6 +116,10 @@
116
116
 
117
117
  升级先校验共享事实、状态源和 coordination transaction;再校验 Skill registry、`assignmentStatus`/`usageStatus` 映射;然后处理前端 audit-only 或已确认的单页面试点;最后才创建临时程序员会话。已有用户修改的控制文件不得静默覆盖,冲突或哈希不一致进入 `blocked`/`recovery-required`。
118
118
 
119
+ ## v1.12 recovery and host preflight
120
+
121
+ Before upgrade role-session work, read `xinyun-ai/index/initialization-recovery.json` and `xinyun-ai/host-preflight.json`. Only explicit `确认执行` or `确认继续初始化` resumes the original task IDs with an incremented attempt; missing host sessions remain `sessionId=null` and blocked.
122
+
119
123
  ## v1.10 接管状态升级与恢复
120
124
 
121
125
  升级前读取 `projectStatus` 和全部 preflight 控制文件;冲突进入 blocked/recovery-required,不覆盖用户修改。
@@ -0,0 +1,30 @@
1
+ # v1.10.2 contract
2
+
3
+ This contract is the implementation boundary for real role-session takeover.
4
+
5
+ ## Identity
6
+
7
+ Keep these identities separate: `hostThreadId`, `hostSessionId`, `projectSessionId`, and `orchestratorSessionId`. A host thread, task ID, role ID, title, or random value is never a project session ID. A value without host evidence remains `null` and the mapping status remains `unbound`, `unknown`, or `failed`.
8
+
9
+ Every role binding records `projectRootHash`, `workspaceScope`, `repositoryScopeHash`, `workstream`, `taskId`, `roleId`, `provider`, and `targetVersion`. The reuse key is `RFC8785-JCS-SHA-256` over these fields. The old four-field index is compatibility-only and never selects or reuses a candidate.
10
+
11
+ ## State source and legal combinations
12
+
13
+ `task.status` is the cross-file source of truth. `current-task.md`, `tasks/<taskId>.md`, `init-result.json`, and `task-lock.json` must reference the same `taskId`, `executionId`, `attempt`, and status evidence.
14
+
15
+ Legal combinations are:
16
+
17
+ - `task/result=completed` with `lock=released`.
18
+ - `task/result=partial` with `lock=released`.
19
+ - `task/result=blocked` with `lock=blocked` or `lock=unknown`.
20
+ - `task/result=cancelled` with `lock=released`.
21
+
22
+ An illegal combination is `blocked`, stops further writes, and creates a recovery record. `partial` means a bounded non-blocking part completed; `blocked` means a required gate, identity, write, lock, or evidence condition prevents continuation.
23
+
24
+ ## Evidence and safety
25
+
26
+ `businessCodeChanged.value=no` requires evidence objects with `evidenceType`, `path`, `beforeHash`, `afterHash`, and `checkedAt`. Without evidence the value is `unknown`. Real session creation, send, receive, status, and recovery evidence must include the real returned `sessionId`, request/response IDs or hashes, snapshots, changed files, forbidden operations, and sensitive-scan status.
27
+
28
+ The project cannot become `ready` until the orchestrator and all five required role sessions have valid identity evidence, authorization, onboarding, and execution eligibility. Missing host capability stays `blocked`; local degradation may document the task but cannot authorize business-code execution or invent a session ID.
29
+
30
+ Database access remains `sql-only`. Without explicit user authorization, output SQL and a plan only; do not connect, install a driver, or execute a statement.
@@ -0,0 +1,27 @@
1
+ # v1.11.0 initialization acceleration contract
2
+
3
+ v1.11.0 accelerates control-plane initialization without weakening the v1.10.2 takeover gate.
4
+
5
+ ## Stages
6
+
7
+ Run stages in this order: `preflight`, `fixed-materialization`, `control-plane`, `codegraph`, `bootstrap-snapshot`, `role-sessions`, `onboarding`, and `final-gate`. Each stage records `stageId`, `status`, `startedAt`, `finishedAt`, `durationMs`, `attempt`, `cacheHit`, `failureReason`, and `nextAction`.
8
+
9
+ Stage states are `pending`, `running`, `completed`, `skipped`, `partial`, `blocked`, and `recovery-required`. Project states are `initializing`, `partial`, `blocked`, and `ready`. A failed required stage cannot be silently skipped or changed to `ready`.
10
+
11
+ ## Fixed materialization
12
+
13
+ The package owns the fixed-file manifest and template hashes. Materialize only registered control files under `AGENTS.md`, `xinyun-ai/`, and `xinyun-ai-init/`. Compare baseline, current, and template hashes before writing. Missing files may be created; user-modified files become `conflict-pending`; unreadable or unverifiable files become `unknown`. Use a temporary file, complete write, and atomic rename.
14
+
15
+ ## Snapshot and cache
16
+
17
+ Create one current-project bootstrap snapshot for the five roles to read. It must contain project identity, repository/workstream summary, detected framework evidence, CodeGraph status, scan budget, evidence, coverage, unverified scope, and a snapshot hash. It must never contain another project, raw secrets, tokens, passwords, private keys, or complete sensitive responses.
18
+
19
+ Reuse requires a cache key over project identity, target version, fixed-template hash, CodeGraph index hash, snapshot hash, and role-binding summary. The default cache lifetime is 24 hours. Cache corruption, expiry, clock rollback, identity change, template change, CodeGraph change, snapshot change, or session evidence expiry exits the fast path and records `unknown` or revalidation.
20
+
21
+ ## Parallel role sessions
22
+
23
+ Role-session creation may run with an effective concurrency of at most 3 by default. If the host cannot parallelize, fall back to serial execution and record `concurrencyFallback`. Each role remains independently bound and evidenced; a successful role never substitutes for a failed role. Same-domain tasks remain queued or blocked by the existing coordination rules.
24
+
25
+ ## Final gate
26
+
27
+ Only a complete final gate may produce `projectStatus=ready`. The output must show completed stages, skipped stages, cache hits, parallelism, unverified scope, blockers, recovery actions, and forbidden operations. No business code, database, API, dependency, configuration, Git write, or npm publish operation is part of this acceleration feature.
@@ -0,0 +1,34 @@
1
+ # v1.12.0 initialization gate recovery contract
2
+
3
+ v1.12 keeps the v1.10 takeover gate and v1.11 acceleration boundary. It adds a bounded host preflight, task-first initialization, resumable role-session binding, CodeGraph reuse, one shared project snapshot, and stage timing. The npm CLI still creates only `xinyun-ai-init/`.
4
+
5
+ ## Host preflight
6
+
7
+ - Before creating or reusing role sessions, check `createRealSession`, `reuseExistingSession`, `sendTask`, `receiveResult`, `recoverSession`, `closeSession`, and `controlFileReadWrite`.
8
+ - Every capability record uses `capabilityId`, `detectionMethod`, `status`, `evidence`, `dependencyStatus`, `fallbackPlan`, `usedTools`, `unusedTools`, `unverifiedScope`, `failureReason`, and `checkedAt`.
9
+ - `available-with-dependency` requires dependency authorization. `unknown`, `unavailable`, `permission-denied`, `failed`, `not-checked`, `not-verified`, and an unauthorized dependency block `ready`.
10
+ - A host thread ID is not a project session ID. Without a real host-returned session ID, keep `sessionId=null`, record the blocker, and do not fabricate an ID.
11
+
12
+ ## Task first and resume
13
+
14
+ - The first initialization write creates one named main task and five role task records before attempting role sessions. The task records remain when host preflight fails.
15
+ - A failed preflight records `sessionId=null`, `blockedReason`, `failureReason`, and `nextAction`; it does not delete tasks or write an idle current task while active tasks exist.
16
+ - Explicit `确认执行` or `确认继续初始化` resumes the same `taskId` and role task IDs from the recorded stage, increments `attempt`, and creates no duplicate tasks.
17
+ - Recovery uses atomic temp-file, fsync, rename, and recovery evidence. Conflicts, user-edited control files, or lock failures pause or block without overwrite or forced unlock.
18
+
19
+ ## Manual binding
20
+
21
+ - A user may bind a real role session through `manual-session-bindings.json`. The record must contain role/task IDs, a host-returned `sessionId`, `boundBy`, `boundAt`, interaction and before/after snapshot evidence, and an audit entry.
22
+ - No evidence means `bindingStatus=blocked` or `pending` and `executionEligible=false`. A bound session becomes eligible only after evidence verification, role onboarding, responsibility confirmation, and all existing gates pass.
23
+
24
+ ## CodeGraph and shared snapshot
25
+
26
+ - Reuse a healthy or initialized CodeGraph index by matching `codeGraphRecordId`, index hash, and source revision. Otherwise run the existing `codegraph init -i` boundary when authorized and available; do not install CodeGraph or repair business code.
27
+ - Record version, index hash, source revision, parse failures, unindexed scope, and failure reason. A required failure cannot claim complete understanding.
28
+ - Build one `shared-project-snapshot.json` for the five roles. Reuse it while business baseline, control-plane hash, CodeGraph index hash, and source revision are unchanged. Rebuild only when a refresh trigger is recorded.
29
+
30
+ ## Timing and safety
31
+
32
+ - Record each stage's attempt, status, start/end, duration, cache hit, failure reason, bottleneck, and recovery action. Stage timing is evidence, not permission to skip a gate.
33
+ - Git none, no test framework, and missing optional toolchains are recorded as limited coverage and do not alone block. Database defaults remain `authorization=not-requested`, `executionStatus=needs-confirmation`, `redactionStatus=verified`; do not connect or execute SQL.
34
+ - Sensitive values never enter tasks, logs, handoffs, JSON, Markdown, stdout, or stderr. No business code, database, API, dependency, system environment, Git write, or npm publish operation is authorized by initialization.
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "snapshotId": "bootstrap-snapshot-template",
4
+ "projectRootHash": null,
5
+ "repositoryScopeHash": null,
6
+ "workstreams": [],
7
+ "detectedFrameworks": [],
8
+ "codeGraph": {"recordId": null, "status": "unknown", "indexHash": null, "checkedAt": null},
9
+ "scanBudget": {"maxDepth": 3, "maxFiles": 60, "maxMatches": 200},
10
+ "evidence": [],
11
+ "coverage": "unknown",
12
+ "unverifiedScope": [],
13
+ "snapshotHash": null,
14
+ "sensitiveScan": {"status": "not-run", "matches": []},
15
+ "createdAt": null,
16
+ "updatedAt": null
17
+ }
@@ -431,6 +431,8 @@ A single-role write failure records `status=blocked` and `blockedReason=write-fa
431
431
  v1.7.3 Codex role session orchestration is host-level only; CLI still only creates `xinyun-ai-init/`.
432
432
  v1.7.3 fixed Codex role session compatibility fields: `provider=codex`, `sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`, and legacy creation index `{taskId,roleId,provider,targetVersion}`. The v1.9 project-isolated role session reuse contract is authoritative.
433
433
 
434
+ v1.12 host preflight and recovery are authoritative for initialization gating: materialize the main task and five role tasks first, preserve `sessionId=null` when the host is unavailable, resume only after `确认执行` or `确认继续初始化`, reuse task IDs while incrementing attempt, and require real evidence for manual session binding. Reuse healthy CodeGraph and one shared project snapshot only when their hashes and source revision remain stable. Record stage duration, cache hit, bottleneck, failure reason, and recovery action.
435
+
434
436
  ## v1.7.3 Codex 角色会话自动创建与绑定
435
437
 
436
438
  - v1.7.3 只在 5 个 `role-execution` 本地任务已经创建或恢复后,才由 Codex 主会话尝试创建 5 个真实角色子会话:`project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer`。
@@ -0,0 +1,12 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "manifestId": "fixed-materialization-template",
4
+ "targetVersion": "1.11.0",
5
+ "sourcePackage": "@pm_zhousl/xinyun-ai-init",
6
+ "hashAlgorithm": "SHA-256",
7
+ "statusEnum": ["pending", "created", "updated", "skipped", "conflict-pending", "unknown", "failed"],
8
+ "files": [],
9
+ "atomicWrite": {"required": true, "tempFile": true, "completeWrite": true, "rename": true},
10
+ "createdAt": null,
11
+ "updatedAt": null
12
+ }
@@ -7,6 +7,8 @@
7
7
  "statusEnum": ["available", "available-with-dependency", "unavailable", "permission-denied", "unknown", "not-checked", "not-verified", "failed"],
8
8
  "dependencyStatusEnum": ["not-required", "required", "authorized", "not-authorized", "unknown"],
9
9
  "capabilityRequiredFields": ["capabilityId", "detectionMethod", "status", "evidence", "dependencyStatus", "fallbackPlan", "usedTools", "unusedTools", "unverifiedScope", "failureReason", "checkedAt"],
10
+ "evidenceRequiredFields": ["evidenceType", "source", "summaryOrHash", "checkedAt"],
11
+ "unknownPolicy": "unknown-means-no-verifiable-evidence; never report verified or unavailable without evidence",
10
12
  "checkedAt": null,
11
13
  "capabilities": {
12
14
  "createRealSession": { "capabilityId": "createRealSession", "detectionMethod": "host-api", "status": "unknown", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "local-degraded-no-fake-session-id", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null },
@@ -0,0 +1,31 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "preflightId": "host-preflight-template",
4
+ "status": "not-checked",
5
+ "statusEnum": ["not-checked", "running", "passed", "partial", "blocked", "failed", "unknown"],
6
+ "requiredCapabilities": [
7
+ "createRealSession",
8
+ "reuseExistingSession",
9
+ "sendTask",
10
+ "receiveResult",
11
+ "recoverSession",
12
+ "closeSession",
13
+ "controlFileReadWrite"
14
+ ],
15
+ "capabilityStatusEnum": ["available", "available-with-dependency", "unavailable", "permission-denied", "unknown", "not-checked", "not-verified", "failed"],
16
+ "dependencyStatusEnum": ["not-required", "required", "authorized", "not-authorized", "unknown"],
17
+ "capabilities": {
18
+ "createRealSession": {"capabilityId": "createRealSession", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "blocked; keep sessionId=null", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
19
+ "reuseExistingSession": {"capabilityId": "reuseExistingSession", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "blocked; query existing binding only", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
20
+ "sendTask": {"capabilityId": "sendTask", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "blocked; preserve task for resume", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
21
+ "receiveResult": {"capabilityId": "receiveResult", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "blocked; preserve task for resume", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
22
+ "recoverSession": {"capabilityId": "recoverSession", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "manual binding with evidence", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
23
+ "closeSession": {"capabilityId": "closeSession", "detectionMethod": "host-api", "status": "not-checked", "evidence": [], "dependencyStatus": "unknown", "fallbackPlan": "manual host close", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null},
24
+ "controlFileReadWrite": {"capabilityId": "controlFileReadWrite", "detectionMethod": "filesystem", "status": "not-checked", "evidence": [], "dependencyStatus": "not-required", "fallbackPlan": "blocked on control-file write failure", "usedTools": [], "unusedTools": [], "unverifiedScope": [], "failureReason": null, "checkedAt": null}
25
+ },
26
+ "realSessionIdEvidence": {"required": true, "sessionIds": [], "source": null, "verified": false},
27
+ "readyGate": {"allRequiredCapabilitiesPassed": false, "dependencyAuthorizationRequired": true, "unknownBlocksReady": true, "fakeSessionIdProhibited": true},
28
+ "nextAction": "Run host capability preflight before starting role sessions.",
29
+ "checkedAt": null,
30
+ "updatedAt": null
31
+ }
@@ -6,8 +6,10 @@
6
6
  "attempt": 1,
7
7
  "mode": "initialization",
8
8
  "status": "pending",
9
+ "statusEnum": ["pending", "initializing", "completed", "partial", "blocked", "unknown", "failed", "cancelled"],
10
+ "statusSource": "xinyun-ai/current-task.md",
9
11
  "currentVersion": null,
10
- "targetVersion": "1.10.1",
12
+ "targetVersion": "1.12.0",
11
13
  "idempotencyKey": null,
12
14
  "createdFiles": [],
13
15
  "updatedFiles": [],
@@ -16,7 +18,8 @@
16
18
  "blockedReason": null,
17
19
  "businessCodeChanged": {
18
20
  "value": "unknown",
19
- "evidence": []
21
+ "evidence": [],
22
+ "evidenceSchema": ["evidenceType", "path", "beforeHash", "afterHash", "checkedAt"]
20
23
  },
21
24
  "upgradeStatus": "not-started",
22
25
  "lockStatus": "released",
@@ -33,6 +36,8 @@
33
36
  },
34
37
  "roleSessions": {
35
38
  "provider": "codex",
39
+ "orchestratorSessionId": null,
40
+ "orchestratorIdentityType": "orchestrator-session",
36
41
  "parentSessionId": null,
37
42
  "requiredRoleCount": 5,
38
43
  "createdCount": 0,
@@ -41,9 +46,36 @@
41
46
  "blockedCount": 0,
42
47
  "localDegradedCount": 0,
43
48
  "bindings": [],
49
+ "identityMapping": {
50
+ "hostThreadId": null,
51
+ "hostSessionId": null,
52
+ "projectSessionId": null,
53
+ "orchestratorSessionId": null,
54
+ "mappingStatus": "pending",
55
+ "identityEvidence": [],
56
+ "creationEvidence": []
57
+ },
58
+ "realAiSessionVerified": false,
44
59
  "hostCapability": "unknown",
45
60
  "degradationReason": null
46
61
  },
62
+ "v112": {
63
+ "hostPreflightPath": "xinyun-ai/host-preflight.json",
64
+ "initializationRecoveryPath": "xinyun-ai/index/initialization-recovery.json",
65
+ "manualSessionBindingsPath": "xinyun-ai/sessions/manual-bindings.json",
66
+ "sharedProjectSnapshotPath": "xinyun-ai/index/shared-project-snapshot.json",
67
+ "initializationTimingPath": "xinyun-ai/index/initialization-timing.json",
68
+ "resumeStatus": "not-started",
69
+ "resumeStatusEnum": ["not-started", "ready-to-resume", "resuming", "completed", "blocked", "failed"],
70
+ "attempt": 1,
71
+ "reusedTaskIds": [],
72
+ "reusedRoleTaskIds": [],
73
+ "duplicateTasksCreated": 0,
74
+ "realSessionIdRequired": true,
75
+ "manualBindingEvidenceRequired": true,
76
+ "projectSnapshotReuse": "not-checked",
77
+ "stageTimingRecorded": false
78
+ },
47
79
  "v19": {
48
80
  "projectIdentityPath": "xinyun-ai/project-identity.json",
49
81
  "technicalLandscapePath": "xinyun-ai/technical-landscape.json",
@@ -60,6 +92,11 @@
60
92
  "connected": false,
61
93
  "evidence": []
62
94
  },
95
+ "sensitiveScan": {
96
+ "status": "not-run",
97
+ "scannedOutputs": [],
98
+ "matches": []
99
+ },
63
100
  "codeGraph": {
64
101
  "codeGraphRecordId": null,
65
102
  "statusSource": "xinyun-ai/manifest.json",
@@ -0,0 +1,13 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "cacheId": "initialization-cache-template",
4
+ "keyAlgorithm": "RFC8785-JCS-SHA-256",
5
+ "keyFields": ["projectRootHash", "targetVersion", "fixedTemplateHash", "codeGraphIndexHash", "snapshotHash", "roleBindingSummaryHash"],
6
+ "ttlHours": 24,
7
+ "statusEnum": ["valid", "expired", "corrupt", "unknown", "revalidate"],
8
+ "cacheKey": null,
9
+ "observedAt": null,
10
+ "expiresAt": null,
11
+ "invalidReason": null,
12
+ "sensitiveScan": {"status": "not-run", "matches": []}
13
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "recoveryId": "initialization-recovery-template",
4
+ "taskId": null,
5
+ "mainTaskId": null,
6
+ "roleTaskIds": [],
7
+ "attempt": 1,
8
+ "status": "not-started",
9
+ "statusEnum": ["not-started", "ready-to-resume", "resuming", "completed", "blocked", "failed"],
10
+ "resumeTriggers": ["确认执行", "确认继续初始化"],
11
+ "resumeFromStage": null,
12
+ "stageIdEnum": ["preflight", "task-materialization", "role-sessions", "codegraph", "snapshot", "onboarding", "final-gate"],
13
+ "reuseContract": {
14
+ "reuseTaskId": true,
15
+ "reuseRoleTaskIds": true,
16
+ "incrementAttempt": true,
17
+ "createDuplicateTasks": false,
18
+ "idempotencyKey": null,
19
+ "keyAlgorithm": "RFC8785-JCS-SHA-256"
20
+ },
21
+ "blockedRoles": [],
22
+ "blockedReason": null,
23
+ "nextAction": "Wait for explicit confirmation or repair the recorded blocker.",
24
+ "lastRecoveryAction": null,
25
+ "recoveryEvidence": [],
26
+ "atomicWrite": {"tempFileRequired": true, "fsyncBeforeRename": true, "rename": true, "recoveryOnFailure": true},
27
+ "createdAt": null,
28
+ "updatedAt": null
29
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "initializationId": "initialization-template",
4
+ "status": "initializing",
5
+ "statusEnum": ["initializing", "partial", "blocked", "ready"],
6
+ "stageStatusEnum": ["pending", "running", "completed", "skipped", "partial", "blocked", "recovery-required"],
7
+ "stages": [
8
+ {"stageId": "preflight", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
9
+ {"stageId": "fixed-materialization", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
10
+ {"stageId": "control-plane", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
11
+ {"stageId": "codegraph", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
12
+ {"stageId": "bootstrap-snapshot", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
13
+ {"stageId": "role-sessions", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
14
+ {"stageId": "onboarding", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null},
15
+ {"stageId": "final-gate", "status": "pending", "attempt": 0, "cacheHit": false, "startedAt": null, "finishedAt": null, "durationMs": null, "failureReason": null, "nextAction": null}
16
+ ],
17
+ "updatedAt": null
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "timingId": "initialization-timing-template",
4
+ "taskId": null,
5
+ "attempt": 1,
6
+ "status": "not-started",
7
+ "stageStatusEnum": ["pending", "running", "completed", "skipped", "partial", "blocked", "failed", "recovery-required"],
8
+ "stages": [],
9
+ "stageRequiredFields": ["stageId", "attempt", "status", "startedAt", "finishedAt", "durationMs", "cacheHit", "failureReason", "bottleneck", "recoveryAction"],
10
+ "cacheSummary": {"hitCount": 0, "missCount": 0, "reusedSnapshot": false, "reusedCodeGraph": false, "reusedSessions": 0},
11
+ "bottlenecks": [],
12
+ "recoveryActions": [],
13
+ "totalDurationMs": null,
14
+ "createdAt": null,
15
+ "updatedAt": null
16
+ }
@@ -3,13 +3,13 @@
3
3
  "hashAlgorithm": "sha256",
4
4
  "contentEncoding": "utf8-normalized",
5
5
  "managedBy": "@pm_zhousl/xinyun-ai-init",
6
- "lastAppliedVersion": "1.10.1",
6
+ "lastAppliedVersion": "1.11.0",
7
7
  "files": [
8
8
  {
9
9
  "path": "xinyun-ai/rules/core-rules.md",
10
10
  "baselineHash": null,
11
11
  "templateHash": null,
12
- "lastAppliedVersion": "1.10.1",
12
+ "lastAppliedVersion": "1.11.0",
13
13
  "managedBy": "@pm_zhousl/xinyun-ai-init",
14
14
  "status": "unknown"
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "projectName": "",
3
- "xinyunAiVersion": "1.10.1",
3
+ "xinyunAiVersion": "1.12.0",
4
4
  "scriptVersion": "2026.07.23",
5
5
  "schemaVersion": "1",
6
6
  "initializationMode": "fast",
@@ -56,6 +56,11 @@
56
56
  ,"technicalLandscapeCoordination": true
57
57
  ,"databaseSqlOnlyAuthorization": true
58
58
  ,"projectAiTakeoverGate": true
59
+ ,"hostPreflightRecovery": true
60
+ ,"manualRoleSessionBinding": true
61
+ ,"codeGraphIncrementalReuse": true
62
+ ,"sharedProjectSnapshot": true
63
+ ,"initializationTiming": true
59
64
  ,"hostCapabilityPreflight": true
60
65
  ,"projectStatusGate": true
61
66
  ,"takeoverBaseline": true
@@ -94,7 +99,7 @@
94
99
  "bindings": "xinyun-ai/sessions/role-session-bindings.json",
95
100
  "bindingTemplate": "xinyun-ai-init/templates/role-session-binding.template.json",
96
101
  "parentSessionId": null,
97
- "targetVersion": "1.10.1",
102
+ "targetVersion": "1.12.0",
98
103
  "requiredRoleCount": 5,
99
104
  "statusEnum": [
100
105
  "pending",
@@ -249,5 +254,34 @@
249
254
  "requiredRoleSessionBlockedReason": "required-role-session-not-created",
250
255
  "databaseDefault": { "authorization": "not-requested", "executionStatus": "needs-confirmation", "redactionStatus": "verified" },
251
256
  "readyRequires": ["projectIdentity", "codeGraph", "baseline", "teamResponsibility", "roleSessions", "taskTree", "localControlPlane", "legacyHandoff", "hostCapabilities", "sensitiveScan", "noHighRiskBlocker"]
257
+ },
258
+ "v112": {
259
+ "status": "implemented-in-package",
260
+ "capability": "initializationGateRecovery",
261
+ "hostPreflight": "xinyun-ai/host-preflight.json",
262
+ "initializationRecovery": "xinyun-ai/index/initialization-recovery.json",
263
+ "manualSessionBindings": "xinyun-ai/sessions/manual-bindings.json",
264
+ "sharedProjectSnapshot": "xinyun-ai/index/shared-project-snapshot.json",
265
+ "initializationTiming": "xinyun-ai/index/initialization-timing.json",
266
+ "hostCapabilityStatusEnum": ["available", "available-with-dependency", "unavailable", "permission-denied", "unknown", "not-checked", "not-verified", "failed"],
267
+ "preflightRequiredCapabilities": ["createRealSession", "reuseExistingSession", "sendTask", "receiveResult", "recoverSession", "closeSession", "controlFileReadWrite"],
268
+ "resumeConfirmationPhrases": ["确认执行", "确认继续初始化"],
269
+ "codeGraphReuseStatuses": ["healthy", "initialized"],
270
+ "projectSnapshotReusePolicy": "reuse-until-business-or-codegraph-hash-changes",
271
+ "stageTimingRequiredFields": ["stageId", "attempt", "status", "startedAt", "finishedAt", "durationMs", "cacheHit", "failureReason", "bottleneck", "recoveryAction"]
272
+ },
273
+ "v111": {
274
+ "status": "implemented-in-package",
275
+ "capability": "initializationAcceleration",
276
+ "fixedMaterialization": "xinyun-ai/fixed-materialization.json",
277
+ "initializationStages": "xinyun-ai/initialization-stages.json",
278
+ "bootstrapSnapshot": "xinyun-ai/bootstrap-snapshot.json",
279
+ "initializationCache": "xinyun-ai/index/initialization-cache.json",
280
+ "parallelism": "xinyun-ai/sessions/parallelism.json",
281
+ "stageStatusEnum": ["pending", "running", "completed", "skipped", "partial", "blocked", "recovery-required"],
282
+ "projectStatusEnum": ["initializing", "partial", "blocked", "ready"],
283
+ "defaultRoleConcurrency": 3,
284
+ "cacheTtlHours": 24,
285
+ "cacheKeyAlgorithm": "RFC8785-JCS-SHA-256"
252
286
  }
253
287
  }
@@ -0,0 +1,23 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "bindingId": "manual-session-binding-template",
4
+ "taskId": null,
5
+ "roleTaskId": null,
6
+ "roleId": null,
7
+ "sessionId": null,
8
+ "sessionIdType": "host-returned-real-session",
9
+ "provider": "codex",
10
+ "boundBy": null,
11
+ "boundAt": null,
12
+ "evidence": [],
13
+ "evidenceRequiredFields": ["evidenceType", "source", "sessionId", "interactionHash", "beforeSnapshotHash", "afterSnapshotHash", "recordedAt"],
14
+ "bindingStatus": "pending",
15
+ "bindingStatusEnum": ["pending", "bound", "rejected", "blocked", "released"],
16
+ "executionEligible": false,
17
+ "eligibilityRule": "bound + real sessionId + evidence verified + role onboarding ready",
18
+ "fakeSessionIdProhibited": true,
19
+ "rejectionReason": null,
20
+ "audit": [],
21
+ "createdAt": null,
22
+ "updatedAt": null
23
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "parallelismId": "parallelism-template",
4
+ "requestedConcurrency": 3,
5
+ "effectiveConcurrency": 0,
6
+ "maxConcurrency": 3,
7
+ "providerCapability": "unknown",
8
+ "concurrencyFallback": null,
9
+ "queueOrder": ["priority", "confirmedAt", "taskId"],
10
+ "roleRuns": [],
11
+ "startedAt": null,
12
+ "finishedAt": null
13
+ }
@@ -273,6 +273,35 @@
273
273
  "databaseDefault": { "authorization": "not-requested", "executionStatus": "needs-confirmation", "redactionStatus": "verified" },
274
274
  "readyRequires": ["projectIdentity", "codeGraph", "baseline", "teamResponsibility", "roleSessions", "taskTree", "localControlPlane", "legacyHandoff", "hostCapabilities", "sensitiveScan", "noHighRiskBlocker"]
275
275
  },
276
+ "v112": {
277
+ "status": "implemented-in-package",
278
+ "capability": "initializationGateRecovery",
279
+ "hostPreflight": "xinyun-ai/host-preflight.json",
280
+ "initializationRecovery": "xinyun-ai/index/initialization-recovery.json",
281
+ "manualSessionBindings": "xinyun-ai/sessions/manual-bindings.json",
282
+ "sharedProjectSnapshot": "xinyun-ai/index/shared-project-snapshot.json",
283
+ "initializationTiming": "xinyun-ai/index/initialization-timing.json",
284
+ "hostCapabilityStatusEnum": ["available", "available-with-dependency", "unavailable", "permission-denied", "unknown", "not-checked", "not-verified", "failed"],
285
+ "preflightRequiredCapabilities": ["createRealSession", "reuseExistingSession", "sendTask", "receiveResult", "recoverSession", "closeSession", "controlFileReadWrite"],
286
+ "resumeConfirmationPhrases": ["确认执行", "确认继续初始化"],
287
+ "codeGraphReuseStatuses": ["healthy", "initialized"],
288
+ "projectSnapshotReusePolicy": "reuse-until-business-or-codegraph-hash-changes",
289
+ "stageTimingRequiredFields": ["stageId", "attempt", "status", "startedAt", "finishedAt", "durationMs", "cacheHit", "failureReason", "bottleneck", "recoveryAction"]
290
+ },
291
+ "v111": {
292
+ "status": "implemented-in-package",
293
+ "capability": "initializationAcceleration",
294
+ "fixedMaterialization": "xinyun-ai/fixed-materialization.json",
295
+ "initializationStages": "xinyun-ai/initialization-stages.json",
296
+ "bootstrapSnapshot": "xinyun-ai/bootstrap-snapshot.json",
297
+ "initializationCache": "xinyun-ai/index/initialization-cache.json",
298
+ "parallelism": "xinyun-ai/sessions/parallelism.json",
299
+ "stageStatusEnum": ["pending", "running", "completed", "skipped", "partial", "blocked", "recovery-required"],
300
+ "projectStatusEnum": ["initializing", "partial", "blocked", "ready"],
301
+ "defaultRoleConcurrency": 3,
302
+ "cacheTtlHours": 24,
303
+ "cacheKeyAlgorithm": "RFC8785-JCS-SHA-256"
304
+ },
276
305
  "requirementParsing": {
277
306
  "enabled": true,
278
307
  "trigger": "ambiguous_or_change_or_high_risk",
@@ -4,7 +4,7 @@
4
4
  "requirementId": null,
5
5
  "taskId": null,
6
6
  "projectRootHash": null,
7
- "version": "1.10.1",
7
+ "version": "1.11.0",
8
8
  "status": "captured",
9
9
  "content": {
10
10
  "userQuote": null,