Implement U1 instance identity: manifest authority, startup verification and init #415

Merged
weichen merged 10 commits from feature/recovery-u1-instance-identity into main 2026-10-12 03:23:20 +00:00
Owner

Why: 方案 r2(已批准)U1/KTD1-KTD2——持久 manifest 成为启动权威,堵住三类恢复缺口:参数重建漂移数据身份、逐键写无原子性、缺配置/丢身份时新建空系统。

Evidence: 任务卡含三段收据(precheck READY / task-sync / 测试):identity 套件 21/21(T1 裸启停身份稳定、T2 改端口锚点不动、T3 数据根漂移拒绝、T4 残留忽略与损坏阻塞、T5 marker 缺失/外宾/丢 manifest 三事件全阻塞、T6 cwd 无关、原子写崩溃窗口单测;1 skip=真实 PG 专项 NOT_RUN 按设计显式标注);make test-governance 169/169(含既有 svc 绑定回归与自恢复套件,legacy 路径零扰动)。本 PR CI(make test+make build)为正式验收 GATE。

Impact: 新增 scripts/svc_manifest.py(identity 锚点+kv 权威+desired,temp→fsync→rename→dirfsync 原子链,迁移/领养/归属冲突中止);svc.sh 六处接线(set/del/record_state 整份提交、autostart→desired、锁内迁移、agent_do_start 前身份校验、init 动作);tests/test_svc_identity.py;docs/recovery/ 两份设计文档。未迁移实例行为不变。真实 PG 身份表(agent_system_identity)属 I3 后续。

Refs: docs/recovery/u1-identity-manifest.md(已批准);方案 r2 §7 U1(Documents #75);U2 首切片 PR #396/#401。设计文档中提案路径引用将随本 PR 与 Documents #75 同仓生效。

Why: 方案 r2(已批准)U1/KTD1-KTD2——持久 manifest 成为启动权威,堵住三类恢复缺口:参数重建漂移数据身份、逐键写无原子性、缺配置/丢身份时新建空系统。 Evidence: 任务卡含三段收据(precheck READY / task-sync / 测试):identity 套件 21/21(T1 裸启停身份稳定、T2 改端口锚点不动、T3 数据根漂移拒绝、T4 残留忽略与损坏阻塞、T5 marker 缺失/外宾/丢 manifest 三事件全阻塞、T6 cwd 无关、原子写崩溃窗口单测;1 skip=真实 PG 专项 NOT_RUN 按设计显式标注);make test-governance 169/169(含既有 svc 绑定回归与自恢复套件,legacy 路径零扰动)。本 PR CI(make test+make build)为正式验收 GATE。 Impact: 新增 scripts/svc_manifest.py(identity 锚点+kv 权威+desired,temp→fsync→rename→dirfsync 原子链,迁移/领养/归属冲突中止);svc.sh 六处接线(set/del/record_state 整份提交、autostart→desired、锁内迁移、agent_do_start 前身份校验、init 动作);tests/test_svc_identity.py;docs/recovery/ 两份设计文档。未迁移实例行为不变。真实 PG 身份表(agent_system_identity)属 I3 后续。 Refs: docs/recovery/u1-identity-manifest.md(已批准);方案 r2 §7 U1(Documents #75);U2 首切片 PR #396/#401。设计文档中提案路径引用将随本 PR 与 Documents #75 同仓生效。
weichen added 7 commits 2026-10-12 03:01:07 +00:00
Why: establish the authorized task workspace and its initial baseline.

Evidence: preserved precheck receipt in .task/feature-recovery-u1-instance-identity.md; R0=89174a0f5c28ff7f49c794f37ea7e9528f9b526e.

Impact: task metadata only; the feature workspace starts at 89174a0f5c.

Refs: .task/feature-recovery-u1-instance-identity.md
Why: U1 starts per the approved recovery plan r2 - a reviewed design contract must exist before touching scripts/svc.sh, and R3 needs an enumerable data-ownership baseline.

Evidence: SELF - doc-check receipt via make evidence. First run FAILED (exit 1: proposal r2 not present in this worktree because it sits unmerged on feature/service-restart-recovery-plan); references reworded to cite the path with a pending-merge note and the check re-run PASS (exit 0). Both receipts are in the card; grounding facts verified at baseline 89174a0.

Impact: docs/recovery/ additions and task card only; no behavior change; implementation gated on design review.

Refs: modules/documents/docs/proposals/2026-10-12-service-restart-data-recovery.md r2 U1
Why: approved design (2026-10-12) - persistent manifest becomes the startup authority, closing the param-rebuild drift, non-atomic per-key writes, and missing-config-creates-empty-system recovery gaps (plan r2 U1 / KTD1-KTD2).

Evidence: SELF - python3 tests/test_svc_identity.py 21 tests OK (1 skip = real-PG identity NOT_RUN by design); make test-governance 169 OK incl. existing svc db-binding and autorecover suites; receipts appended via make evidence.

Impact: scripts/svc.sh gains manifest-aware set/del/record_state/autostart plus lock-held migrate, pre-launch identity verify and an init action; new scripts/svc_manifest.py (atomic temp-fsync-rename, identity anchors, derived svc.env); unmigrated instances keep the exact legacy path (regressions green).

Refs: docs/recovery/u1-identity-manifest.md; plan r2 section 7 U1
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=501b785e17843fdf0b19184e28952e426c1a198f.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=501b785e17843fdf0b19184e28952e426c1a198f; candidate=a4a68ca74f15e9f80fb9ef5ee7d3cc7e7a1d68fd.

Impact: task metadata only.

Refs: .task/feature-recovery-u1-instance-identity.md
Why: post-sync evidence must be refreshed at the final head before requesting review; stage table now separates local SELF green from the pending PR CI gate and the real-PG NOT_RUN boundary.

Evidence: SELF - identity suite 21/21 and governance 169/169 re-run at the synced head via make evidence (receipts in card).

Impact: task card only.

Refs: docs/recovery/u1-identity-manifest.md section 7
Record the push grant and correct the acceptance-gate wording
ci / test-pg (pull_request) Failing after 1m17s
ci / test (pull_request) Failing after 2m58s
ecbaa84261
Why: user green-lit delivery on 2026-10-12; the gate for formal acceptance is the PR CI itself, so the earlier 'no push before acceptance' cell was self-contradictory.

Evidence: SELF - user grant; three-segment receipts (precheck/task-sync/tests) already in card.

Impact: task card only.

Refs: AGENTS.md 完成声明三段输出
weichen added 1 commit 2026-10-12 03:01:31 +00:00
Record the delivery PR link in the task card
ci / test-pg (pull_request) Failing after 1m18s
ci / test (pull_request) Successful in 3m27s
568afbc5ee
Why: the card is the single master record and must carry PR #415.

Evidence: SELF - PR #415 created via API on head ecbaa84.

Impact: task card only.

Refs: PR #415
weichen added 1 commit 2026-10-12 03:01:40 +00:00
Fix a path typo in the task card master-record line
ci / test-pg (pull_request) Successful in 1m19s
ci / test (pull_request) Failing after 2m51s
cf4bbb423d
Why: correct artifact path for the data-ownership inventory.

Evidence: SELF.

Impact: task card typo only.

Refs: PR #415
weichen added 1 commit 2026-10-12 03:17:36 +00:00
Record the full local make test pass ahead of the CI retry
ci / test-pg (pull_request) Successful in 1m8s
ci / test (pull_request) Successful in 3m6s
6d453ee87e
Why: CI ci/test failed on cf4bbb4 while the identical suite passes locally (exit 0, receipt in card); the sibling head failed the other job instead - runner-side flakiness under five concurrent PRs, so retry via a fresh head.

Evidence: SELF - make test exit 0 via make evidence (full suite, 99 ok lines, no FAIL); prior CI status details fetched via API (cf4bbb4 test-pg=success test=failure; 568afbc test=success test-pg=failure).

Impact: task card evidence row only.

Refs: PR #415
weichen merged commit af9c2de663 into main 2026-10-12 03:23:20 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#415