Compare commits

...
Author SHA1 Message Date
weichen 0e4b111dff release-candidate: 汇集 local_dev 至 test,准备长期实测 [Tag: rc-v1.1.0-beta.3]
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-24 04:37:51 +00:00
weichen 3de5bc5c39 merge: candidate gate-nightly-fixes (abs DATA_DIR + unique FullChain names) 2026-09-24 03:24:15 +00:00
weichen 9a4ccf4040 fix(test): unique project names for pi-agent FullChain e2e
Fixed Chinese names collided on reused gate-pg across nightly runs.
2026-09-24 03:24:13 +00:00
weichen 3a23fb4533 fix(scripts): force absolute DATA_DIR for nightly real-PI
Relative DATA_DIR from .env resolves under go test package cwd
(internal/server/data/dev) and diverges from the pi-agent bind mount,
leaving agents without template.md/blackboard.json.
2026-09-24 03:24:12 +00:00
weichen 6858e21d47 merge: candidate fix-quality-heading-eleven into local_dev 2026-09-24 02:26:38 +00:00
weichen 5e8e17b96a fix(squad): strip multi-digit Chinese ordinals in quality headings
Nightly TestManager failed because cleanHeadingTitle only stripped 一…十,
leaving 十一、/十二、 unmatched against template 签署/说明.
2026-09-24 02:26:23 +00:00
weichen 5423b261f9 merge: candidate fav-staging-uuid fix into local_dev 2026-09-24 00:57:31 +00:00
weichen fd83e98e6c docs(ops): mark fav-staging-uuid CURRENT done 2026-09-24 00:57:10 +00:00
weichen 25fc2d92e8 fix(artifactvault): derive staging/artifact UUIDs from idempotency key
Payload-sha-only UUIDs collided under artifact_payload_staging_pkey when
two task runs finalized identical deliverable bytes. Key already includes
source_event_id; hash it for stable unique art-/stg- ids.
2026-09-24 00:56:54 +00:00
weichen c4008bf8f3 merge: candidate gate-e1a fixture fixes into local_dev 2026-09-24 00:49:43 +00:00
weichen c51fb5e22f fix(docnotify): align E1A fixture aggregate versions with claim gap rule
Per-doc aggregates must use version 1 (not i+1 / 99) or ClaimLeases
skips them under event_consumer_checkpoints head+1 gating.
2026-09-24 00:49:40 +00:00
weichen 134f7864fa fix(docnotify): unique E1A fixture project names under global uniqueness
00057 added uq_projects_name_global; seedUserProject kept a fixed name
\"e1a\" so the second PG case collided. Include the suffix in name too.
2026-09-24 00:48:20 +00:00
weichen f8ad688359 merge: candidate gate-unhook-docquery into local_dev 2026-09-24 00:45:38 +00:00
weichen 2bcb4e3366 fix(server,docquery): restore durable-notify unhook and deliverable store in tests
Remove leftover OnOutbox assignment from NewFromRuntime so production
stays on the durable events/docnotify path. Wire DirDeliverable into
docquery ledger fixtures after G1 DeliverableStore cutover.
2026-09-24 00:45:22 +00:00
weichen 4d1b58ccb3 merge: candidate jev-dev-assist-on into local_dev 2026-09-23 18:02:02 +00:00
weichen 73da2fea01 docs(ops): enable jev assist on local_dev with chat batch
Record 20-turn live chat evidence: 10/10 decision-layer additive on rule misses, 0 false assists on business prompts.
2026-09-23 17:59:31 +00:00
weichen 3e13f7a6d6 merge: candidate codegraph policy active into local_dev 2026-09-23 17:57:19 +00:00
weichen 0c13beddb9 docs(ops): activate codegraph-governance policy revision 2026-09-23 17:57:16 +00:00
weichen 19eb56e374 merge: candidate codegraph CURRENT claims into local_dev 2026-09-23 17:55:54 +00:00
weichen 7322aa96bd docs(ops): record codegraph-governance closeout claims 2026-09-23 17:55:43 +00:00
weichen 0c676afe1f merge: candidate codegraph check-ignore fixup into local_dev 2026-09-23 17:55:25 +00:00
weichen 989346aba2 docs(ops): note codegraph check-ignore trailing-slash fixup 2026-09-23 17:55:22 +00:00
weichen d535c2a85e merge: candidate codegraph fixup+CURRENT into local_dev 2026-09-23 17:54:14 +00:00
weichen 5252a236fc fix(gov): probe .codegraph/ with trailing slash for check-ignore 2026-09-23 17:53:56 +00:00
weichen 66745dd920 merge: candidate codegraph-governance into local_dev 2026-09-23 17:52:09 +00:00
weichen 510b46636a feat(gov): add codegraph hooks and read-only cleanup/MATRIX audits
Wire CodeGraph into agentctl init/create/sync and expose cleanup report
plus docs drift so agents can inventory stale worktrees and MATRIX
regressions without auto-deleting or auto-promoting done.
2026-09-23 17:51:04 +00:00
weichen 156c113024 merge: candidate jev-dev-shadow-on into local_dev 2026-09-23 17:48:17 +00:00
weichen a83e288bff docs(ops): enable jev shadow on local_dev
Record shadow enable via configs/.env.dev + rebuild evidence; note Docker host gateway.
2026-09-23 17:48:05 +00:00
weichen d8214a09f0 merge: candidate jev-product-closeout into local_dev 2026-09-23 17:41:30 +00:00
weichen 18cfca4307 docs(ops): close out jev-product-shadow CURRENT and short-term 2026-09-23 17:41:27 +00:00
weichen 54409fd61d merge: candidate jev-product-shadow into local_dev 2026-09-23 17:41:03 +00:00
weichen 55c0c1b499 chore(compose): declare JEV_DECIDE_MODE off in all environments 2026-09-23 17:40:50 +00:00
weichen 45f21e84c7 feat(jevdecide): product shadow client with offline eval gates
Add typed jevdecide HTTP client (circuit, metrics) and coordinator
DecideAssist wiring behind JEV_DECIDE_MODE (default off). Offline eval
and synthetic soak evidence gate realtime/profile before assist rollout.
2026-09-23 17:40:40 +00:00
weichen 0ff698db6f merge: candidate jev-mcp-docs-final into local_dev 2026-09-23 16:14:38 +00:00
weichen 96bafcebbd docs(ops): mark jev-mcp-docs-done CURRENT row done 2026-09-23 16:14:35 +00:00
weichen 21b2687e0f merge: candidate jev-mcp-docs-done into local_dev 2026-09-23 16:14:19 +00:00
weichen c464589a42 docs(ops): mark jev-mcp integration CURRENT and short-term done 2026-09-23 16:14:08 +00:00
weichen 0dfb09fa69 merge: candidate jev-mcp-integration into local_dev 2026-09-23 16:12:44 +00:00
weichen 939be0ec6b feat(mcp): add jev-service governance decide MCP server
Expose typed jev_decide/jev_health over stdio for closed-enum governance
routing; credentials stay in ~/.secrets/jev and out of git.
2026-09-23 16:12:16 +00:00
weichen b6f21e8a94 merge: candidate intent-plan-u9u12 closeout into local_dev 2026-09-23 15:54:23 +00:00
weichen f0a929a2ae docs(status): mark intent-plan-u9u12 done (land task receipts)
MATRIX/CURRENT via docs apply on integrate-land task after acceptance
report is on the candidate tip.
2026-09-23 15:54:22 +00:00
weichen cd793c11c9 docs(test): U9–U12 live domain acceptance evidence
Archive real HTTP+PG samples for U9 segment wiring and U10–U12 live
adapters under confirm tier on shared dev (project 6579).
2026-09-23 15:54:05 +00:00
weichen b7d775a734 merge: candidate intent-plan-u9u12 authz slots fix 2026-09-23 15:47:53 +00:00
weichen 61d728f905 fix(intentflow): pass slots/summary into confirm-time Authorize
DocGov (and other summary-keyed adapters) resolve doc_id from step slots
or safe_summary; authorizeDecision omitted both, so U11 confirm failed
closed with PLAN_ACTION_FORBIDDEN despite a bound resource version.
2026-09-23 15:47:44 +00:00
weichen bc27becbbb merge: candidate intent-plan-u9u12 version-binder fix 2026-09-23 15:44:58 +00:00
weichen dbae19e80d fix(intentflow): bind resource versions for U10/U11 at plan create
Mutate/docgov live Authorize requires ExpectedResourceVersion; populate it
(and frame slots) when HandleTurn drafts confirm-class steps so confirm
no longer fails closed with PLAN_ACTION_VERSION_CONFLICT.
2026-09-23 15:44:48 +00:00
weichen 2f7e4b8fc0 merge: candidate intent-plan-u9u12-live into local_dev 2026-09-23 15:36:48 +00:00
weichen cd7c586b15 merge: refresh local_dev tip 473bfbc7 before integrate 2026-09-23 15:36:29 +00:00
weichen 7cb076c945 merge: refresh local_dev tip before U9–U12 integrate 2026-09-23 15:35:24 +00:00
weichen 473bfbc73c merge: land pi-narrative CURRENT closeout onto local_dev 2026-09-23 15:35:15 +00:00
weichen 0243cc2195 docs(ops): register pi-narrative CURRENT done and closeout five-state 2026-09-23 15:35:13 +00:00
weichen 8bf74f0f7e merge: local_dev I2 evidence + gate U9 at auto_read
Bring I2 rollout reports onto the U9–U12 branch; keep FEATURE-MATRIX
out of this merge (managed via docs apply on local_dev). Tighten
ActiveSegmentProposer to PlanTier ≥ auto_read per Track I3.
2026-09-23 15:34:49 +00:00
weichen c1b60b7af2 merge: land docgov-pi-narrative MATRIX done onto local_dev 2026-09-23 15:33:43 +00:00
weichen 77aace4ae4 docs(status): mark docgov-pi-narrative done after closeout retest 2026-09-23 15:33:42 +00:00
weichen 31adc25a1f merge: candidate pi-narrative docs evidence into local_dev 2026-09-23 15:32:00 +00:00
weichen 016135d946 feat(intentflow): wire U9–U12 live adapters for multi-intent closeout
Connect LLM segment proposals into HandleTurn, replace U10–U12 dry-run stubs
with production owners (blackboard supplement, docgov claim/submit, workflow
run/resume) when flags are on, and update policy/sysadmin maturity metadata.
2026-09-23 15:26:46 +00:00
weichen d9e74087e4 merge: I2 rollout evidence and u1u8 done 2026-09-23 15:21:45 +00:00
weichen 7a3ac9dbe6 docs(status): mark intent-plan-u1u8 done after I2 rollout 2026-09-23 15:21:43 +00:00
weichen b9ee841ea5 docs(test): I2 multi-intent shadow/auto_read/confirm rollout evidence 2026-09-23 15:21:01 +00:00
weichen d4dad0f219 docs(status): mark docgov-pi-narrative done after live closeout
Promote the MATRIX row with committed MiniMax evidence; keep the narrative
flag default-off pending a separate rollout authorization.
2026-09-23 15:20:09 +00:00
weichen 07ff3e45c4 docs(test): archive PI narrative closeout evidence
Record the repaired MiniMax live path and update readiness copy before
promoting docgov-pi-narrative to done.
2026-09-23 15:19:29 +00:00
weichen 4e601e95bc merge: land chat-semantic-d3 MATRIX done onto local_dev 2026-09-23 15:18:31 +00:00
weichen 45ee184527 docs(status): land chat-semantic-d3 done and REPLACE deferred row
Apply MATRIX split on current local_dev tip with closeout evidence and
mark the matrix-land CURRENT claim done.
2026-09-23 15:18:21 +00:00
weichen fdbefbac83 merge: candidate pi-narrative-final-closeout-b into local_dev 2026-09-23 15:17:27 +00:00
weichen 413ca989a1 merge: candidate chat-semantic-d3-closeout into local_dev
Land summarizer fix and closeout evidence; MATRIX/CURRENT shared docs follow via docs apply.
2026-09-23 15:16:23 +00:00
weichen 939380f3d5 docs(status): close chat-semantic-d3 as shadow-only done
Split REPLACE into deferred chat-semantic-replace per Wave5 X-2, record
lineage, and attach tip revalidation evidence.
2026-09-23 15:14:48 +00:00
weichen 526617ff9b merge: compose FAV_DEGRADED_READ dup fix 2026-09-23 15:14:34 +00:00
weichen 02a0ed4f74 fix(compose): remove duplicate FAV_DEGRADED_READ keys 2026-09-23 15:14:16 +00:00
weichen 8f00c97fae fix(chat): restore D3 semantic shadow under reasoning no-tools
Embed authorized messages in the PI summarizer prompt and recover narrative
from execution.log so MiniMax shadow works without REPLACE. Align chatflow
tests with async S1 drain and record closeout evidence.
2026-09-23 15:13:19 +00:00
weichen f6046bba7e fix(docgov): materialize reasoning narrative under --no-tools
Embed Facts in the PI narrative prompt and teach the bind-mounted runner
to write assistant text into missing reasoning targets, matching pi-native.
2026-09-23 15:11:22 +00:00
weichen 177338282d merge: candidate intent-plan-i2-shadow-allowlist into local_dev 2026-09-23 15:10:49 +00:00
weichen c07d4020d0 feat(intentflow): I2 shadow tier, project allowlist, and rollout metrics
Persist validated_only shadow plans without executing, gate elevated tiers
behind INTENT_PLAN_PROJECT_ALLOWLIST, and keep legacy chat routing for shadow.
2026-09-23 15:10:26 +00:00
weichen 996bf5a14d merge: closeout CURRENT done for module-batches-ag-status-fix 2026-09-23 15:10:20 +00:00
weichen 2d81d584a2 docs(ops): mark module-batches-ag-status-fix CURRENT claim done 2026-09-23 15:10:18 +00:00
weichen 8768ee2ba2 merge: candidate module-batches-ag-status-fix into local_dev 2026-09-23 15:09:12 +00:00
weichen daebbf61e7 docs(ops): restore tip CURRENT closeout claim after sync merge 2026-09-23 15:09:00 +00:00
weichen ca5c36f65f merge: sync tip 9d8332ad into module-batches-ag-status-fix
Retain CURRENT claim and MATRIX done; re-apply tip CURRENT rows next.
2026-09-23 15:08:40 +00:00
weichen 1d3c957ff4 docs(ops): close matrix regression issue after CAS restore
Mark issue resolved and lesson validated once arch-check and MATRIX
done row are confirmed in the task worktree.
2026-09-23 15:05:27 +00:00
weichen b9d09c9712 docs(status): restore module-batches-ag done state after merge regression
Row-level CAS recovers the umbrella status that closeout conflict
resolution had overwritten back to planned; header text aligned.
2026-09-23 15:03:45 +00:00
weichen 54641f4653 docs(ops): register matrix status regression and claim CURRENT
Restore coordination evidence for module-batches-ag: issue, lesson,
batch-plan done status, and CURRENT claim ahead of MATRIX CAS restore.
2026-09-23 15:02:53 +00:00
weichen 9d8332ad08 merge: mark closeout claim worktree removed
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 15:01:52 +00:00
weichen 236f39e6c4 docs(ops): mark closeout-worktree-cleanup claim worktree removed 2026-09-23 15:01:51 +00:00
weichen 18b9556f3b merge: FAV constraint CURRENT revision and restore protection 2026-09-23 14:20:44 +00:00
weichen 340240473e docs(ops): revise FAV live constraint and restore CURRENT protection
Authorized temporary lift of protected_sections; set 受控约束 first
bullet to FAV live not released / FAV_DEGRADED_READ default false;
restore ## 受控约束 protection afterward.
2026-09-23 14:20:43 +00:00
weichen c05b4090d8 merge: lift CURRENT 受控约束 protection for authorized edit 2026-09-23 14:20:02 +00:00
weichen 6f2d0d8d0c chore(ops): temporarily lift CURRENT 受控约束 protection
Authorized 2026-09-23 so docs apply can revise the FAV live constraint
bullet; restore protection in the follow-up commit.
2026-09-23 14:20:02 +00:00
weichen 73ee509439 merge: closeout worktree cleanup docs into local_dev 2026-09-23 14:10:38 +00:00
weichen 8437ba4164 docs(ops): finalize remaining-worktrees five-state and cleanup table 2026-09-23 14:10:27 +00:00
weichen 4381b71094 merge: remaining worktrees closeout docs into local_dev
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 14:03:13 +00:00
weichen fe4a3043eb docs(ops): fix closeout short-term and test report text 2026-09-23 14:03:13 +00:00
weichen cdfd7d9849 docs(ops): remaining worktrees closeout report and CURRENT/MATRIX rows
Record go-agentx+FAV integrate evidence, stale DIFF archive, claim/FAV
cleanup rows, and events-fav partial note. Constraint bullet deferred
to short-term due to CURRENT protected_sections.
2026-09-23 14:02:35 +00:00
weichen 3e01f18756 merge: integrate final-artifact-vault into local_dev (authorized exception)
User authorized lifting CURRENT FAV whole-branch merge protection on
2026-09-23. Keep FAV_DEGRADED_READ/FAV_PUBLISHER_ENABLED default false.
Drop duplicate goose 00034 (local_dev already has 00036). Preserve
agentx workspace admin routes and pin-export wiring.
2026-09-23 13:57:08 +00:00
weichen 6032dbaa16 merge: integrate go-agentx runtime into local_dev candidate
Bring pinative/agentx workspace registry and A-B harness onto current
local_dev; renumber goose agentx registry 00062→00066 to avoid clash
with chat-summary/provenance migrations. Keep CURRENT/MATRIX as ours
for later docs apply; union module-boundaries agentx import tree.
Path literals use workspace constants for arch-check.
2026-09-23 13:25:32 +00:00
weichen d5fc19e42c merge: worktree closeout report and CURRENT done rows 2026-09-23 12:58:04 +00:00
weichen 1493676217 docs(ops): record worktree closeout batch report and CURRENT done rows 2026-09-23 12:57:38 +00:00
weichen a690aab42d merge: closeout cleanup cwd-hidden process fix 2026-09-23 12:55:00 +00:00
weichen 7cb7981deb fix(ops): skip cwd-hidden OS helpers and non-worktree processes on cleanup 2026-09-23 12:54:45 +00:00
weichen c0a0db3a70 merge: closeout remaining docs and salvage into local dev 2026-09-23 12:51:23 +00:00
weichen 312727d726 merge: worktree-closeout-batch salvage docs and gofmt 2026-09-23 12:50:23 +00:00
weichen 6485532d88 docs: import lock, policy, and governance artifacts for closeout 2026-09-23 12:50:22 +00:00
weichen 553f0ad61b merge: feature/integrate-modular-contract-standard-2026-09-22 into closeout remaining candidate 2026-09-23 12:49:45 +00:00
weichen 15b388fc86 docs(ops): salvage task docs and mineru gofmt in closeout batch 2026-09-23 12:49:33 +00:00
weichen e6ddfab9e8 merge: sync origin/dev into local dev (closeout batch)
Resolve conflicts: both CURRENT claim tables (slot preserved), local
multi-host coordination plan + origin phased companion, origin
module-boundaries, combined PG isolation with remote product tests.
FEATURE-MATRIX takes origin record_id layout; A-G done bump deferred
pending evidence row apply.
2026-09-23 12:45:30 +00:00
WeiCHEN 5cdcee2649 merge: candidate agentctl-cursor-integration-close five-state
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 19:26:09 +08:00
WeiCHEN 5be380ad14 docs(ops): close agentctl Cursor capability-layer five-state
Record merged_local_dev and CURRENT done after daemon enqueue.
2026-09-23 19:26:06 +08:00
WeiCHEN 9e4ddfcd87 merge: candidate agentctl-cursor-integration Cursor capability layer 2026-09-23 19:25:23 +08:00
WeiCHEN 07094d0dd1 docs(ops): note queue retry after DIRTY_TREE clearance 2026-09-23 19:25:21 +08:00
WeiCHEN 821a307feb feat(ops): add Cursor skills/MCP/rules/hooks for agentctl
Wrap the live coordinator in project Cursor capabilities so agents
default to leases, docs apply, and daemon enqueue. Track skills/hooks/mcp
via .gitignore exceptions; guard destructive git with ask permission.
2026-09-23 19:23:40 +08:00
WeiCHEN 9984c68d37 merge: promote local_dev to test (squad settled-no-deliverable retry)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 19:20:05 +08:00
WeiCHEN 357e4ddb0f merge: candidate squad-missing-target-retry (settled-no-deliverable) 2026-09-23 19:18:23 +08:00
WeiCHEN 4830b8ba6d fix(squad): retry settled steps that never wrote the deliverable
Classify clean settle + missing target as transient (settled-no-deliverable)
and re-invoke once with a corrective write-tool prompt, instead of permanent
MISSING_TARGET failure.
2026-09-23 19:18:05 +08:00
WeiCHEN 78c2bcf6b6 merge: candidate agentctl-mgmt-go-live-close five-state 2026-09-23 18:07:53 +08:00
WeiCHEN 2f51d525ff docs(ops): close agentctl launchd go-live five-state
Record daemon e2e queue completion and deployment=loaded_local_launchd.
2026-09-23 18:07:50 +08:00
WeiCHEN 5e11db50ce merge: candidate agentctl-mgmt-go-live launchd go-live into dev 2026-09-23 18:06:45 +08:00
WeiCHEN 92d30a498b docs(ops): record agentctl launchd management-plane go-live
Persist host load evidence and short-term five-state for the
macOS LaunchAgent coordinator (bootstrap gui/501).
2026-09-23 18:06:35 +08:00
WeiCHEN eebe83e0c5 merge: candidate w3-u6-current-fix CURRENT done rows 2026-09-23 17:42:18 +08:00
WeiCHEN 8920185baa docs(ops): mark W3-U6 closeout CURRENT rows done
docs:admin row fix after task close; leave receipt on SHARED CURRENT.
2026-09-23 17:42:15 +08:00
WeiCHEN c7f14fda89 merge: candidate w3-u6-closeout five-state into dev 2026-09-23 17:39:34 +08:00
WeiCHEN f0f4d741ae docs(ops): record W3-U6 MATRIX record_id five-state closeout
Mark U6 merged_local_dev, backfill undertaking tip 8079f8f4, and
update CURRENT claim rows. Seven-package L1 queue is clear.
2026-09-23 17:39:25 +08:00
WeiCHEN 8079f8f42a merge: feature/matrix-record-id-2026-09-23 (MATRIX stable record_id) 2026-09-23 17:35:35 +08:00
WeiCHEN 77bdbdbc74 feat(ops): add stable record_id column to FEATURE-MATRIX
Make matrix_states / docs apply / evidence gates key by kebab-case
record_id (module name as transitional fallback). Wire docs project
for MATRIX with EVIDENCE_REQUIRED on done. Keep all status values and
historical paragraphs unchanged; reject rename/duplicate IDs.
2026-09-23 17:35:25 +08:00
WeiCHEN 713b7cbe6f merge: candidate w2-closeout five-state into dev 2026-09-23 17:10:42 +08:00
WeiCHEN 51b15af09d docs(ops): record W2 U7/U4/U5 five-state closeout 2026-09-23 17:10:29 +08:00
WeiCHEN c780a030b2 merge: candidate current-projection CURRENT hardening into dev 2026-09-23 17:07:28 +08:00
WeiCHEN 59739a2b48 feat(agentctl): harden CURRENT projection and human-section guards
W2-U5: own_row_only/slot_protected policy wiring, normalized projection
rows, idempotent request ids, five-state status vocab, expanded protected
human sections, projections ledger readout, and doc contradiction fixes.
2026-09-23 17:00:44 +08:00
WeiCHEN 725e2e4beb merge: candidate agentctl-daemon coordinator into dev 2026-09-23 16:44:20 +08:00
WeiCHEN 5dc25e0be3 fix(agentctl): retry manager.lock holder_pid read on LOCK_BUSY 2026-09-23 16:42:22 +08:00
WeiCHEN cb4a13671d feat(agentctl): add foreground daemon coordinator with manager.lock 2026-09-23 16:39:21 +08:00
WeiCHEN 981021b2b6 merge: candidate agentctl-handoff quarantine fence into dev 2026-09-23 16:29:28 +08:00
WeiCHEN b2c582dc5a fix(agentctl): re-lock write txn after schema DDL for claim CAS 2026-09-23 16:29:12 +08:00
WeiCHEN 7d864828b5 fix(agentctl): treat unset AGENTCTL_FENCE as zero for bootstrap 2026-09-23 16:24:56 +08:00
WeiCHEN 198b3e4ad4 feat(agentctl): add quarantine handoff with fence and heartbeat TTL
Fail-closed suspect/quarantine demotion, AGENTCTL_FENCE inheritance, and verified: gates for env/git:dev recovery without auto-release.
2026-09-23 16:16:35 +08:00
WeiCHEN fda5ef2931 merge: dialogue-realtime-search acceptance docs
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 15:08:28 +08:00
WeiCHEN fa6529db0e docs(ops): record dialogue realtime search remote test acceptance
Capture remote GMKtec :8081 evidence that Tavily-forced weather answers are date-anchored and no longer invent deep-winter temperatures.
2026-09-23 15:08:09 +08:00
WeiCHEN 8c40cb7412 merge: feature/w1-closeout-2026-09-23 (W1 five-state closeout) 2026-09-23 15:05:23 +08:00
WeiCHEN 0a933af95f docs(ops): close out W1 U1r/U2/U3 five-state fields
Record merged tips and mark CURRENT claims done; cleanup remains with
independent maintainers.
2026-09-23 15:05:10 +08:00
WeiCHEN 451f55f80d merge: feature/agentctl-claim-2026-09-23 (long-lived claim CLI) 2026-09-23 15:02:09 +08:00
WeiCHEN 6699c4a8aa feat(agentctl): add long-lived claim namespace and CLI
Introduce claim: resources with additive claims/claim_queue tables, atomic
acquire/release under IMMEDIATE transactions, and concurrency regressions.
2026-09-23 15:02:00 +08:00
WeiCHEN c6f0561b5b merge: promote local_dev to test (dialogue realtime search force)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 14:55:16 +08:00
WeiCHEN 7cd0f505b2 merge: feature/agent-governance-config-2026-09-23 (governance JSON policy)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 1s
2026-09-23 14:53:18 +08:00
WeiCHEN 8749f5077a merge: fix/dialogue-realtime-search-2026-09-23 (force Tavily for realtime dialogue) 2026-09-23 14:51:44 +08:00
WeiCHEN a5ea8197ab fix(coordinator): force Tavily search for weather/realtime dialogue answers
Anchor weather and other realtime questions on runner /v1/search results (or an explicit refuse constraint) so the model cannot invent dates or temperatures from training memory.
2026-09-23 14:51:09 +08:00
WeiCHEN 33c7b9a260 feat(agentctl): externalize governance policy to JSON
Load configs/agent-governance.json from the main worktree with fail-closed
POLICY_* codes, and keep test fixtures writing the same contract file.
2026-09-23 14:50:56 +08:00
WeiCHEN 1cb8c6f4b3 merge: fix/agentctl-automation-converge-2026-09-23 (automation converge into w4) 2026-09-23 14:39:57 +08:00
WeiCHEN dd75f42c98 fix(agentctl): converge automation into w4 and drop fork
Port deploy phase transition guards and cleanup markdown projection into
agentctl_w4, delete the unused automation module, and pin illegal jumps
with a regression test.
2026-09-23 14:39:49 +08:00
WeiCHEN 21c1278c04 merge: coordination-db-daemon-impl-plan closeout (CURRENT+short-term) 2026-09-23 14:17:52 +08:00
WeiCHEN 9e9856f652 docs(ops): record coordination-db-daemon impl-plan closeout fields
Persist short-term status, head_sha, and integration_state after the
undertaking plan landed on local_dev.
2026-09-23 14:17:34 +08:00
WeiCHEN ec8a39b39d docs(ops): close out coordination-db-daemon impl-plan on local_dev
Mark CURRENT claim done and record merge tip 51f82d5d in the
short-term closeout after docs-only integration.
2026-09-23 14:17:11 +08:00
WeiCHEN 51f82d5d4f merge: feature/coordination-db-daemon-impl-plan-2026-09-23 (undertaking plan docs) 2026-09-23 14:16:36 +08:00
WeiCHEN dad5556181 docs(remediation): add coordination db/daemon implementation undertaking plan
Pre-fill W1–W3 work packages (U1r–U6) with symbol-level anchors, real
concurrency gates, mutexes, and ADR gate for L2. Docs-only; no code.
2026-09-23 14:16:25 +08:00
WeiCHEN 1f2f3d6a58 merge: closeout-worktrees results doc 2026-09-23 14:03:11 +08:00
WeiCHEN 47c57eee6b docs(ops): record closeout-worktrees merge and cleanup results 2026-09-23 14:03:01 +08:00
WeiCHEN 1165b28d5f merge: coordination-db-daemon closeout (CURRENT done + short-term) 2026-09-23 14:01:31 +08:00
WeiCHEN bf1b592071 docs(ops): close out coordination-db-daemon task on local_dev
Mark CURRENT claim done and record merge tip d8ba8dba in the
short-term closeout fields after docs-only integration.
2026-09-23 14:01:27 +08:00
WeiCHEN d8ba8dba3c merge: feature/coordination-db-daemon-2026-09-23 (plan+research docs) 2026-09-23 14:00:21 +08:00
WeiCHEN d7e0a683c9 docs(remediation): add coordination db/daemon phased plan and research
Document L1 single-host claim/daemon/doc projection design and L2
cross-host PostgreSQL as planned-only. Register INDEX entries and claim
CURRENT; U1 cites queue subparser fix 63e66c6f.
2026-09-23 13:54:48 +08:00
WeiCHEN de3bff6d6d merge: closeout-worktrees docs batch (6 tips + task doc)
Rebuild onto current local_dev after parallel agentctl-queue integrate. Non-.doc tree matches frozen D; CURRENT/MATRIX kept as local_dev.
2026-09-23 13:52:52 +08:00
WeiCHEN 63e66c6fb3 merge: fix/agentctl-queue-subparser-2026-09-23 (queue subparser + tests) 2026-09-23 13:50:49 +08:00
WeiCHEN 2b5bcffcef merge: promote-fix-latest-upload evidence (closeout docs)
Keep evidence short-term/report/receipts; leave FEATURE-MATRIX and CURRENT as current local_dev.
2026-09-23 13:50:31 +08:00
WeiCHEN f9f09a5440 fix(ops): remove duplicate agentctl queue subparser registration
The second queue parser shadowed handler-compatible flags (--head,
cancel --task, schedule --drain), so enqueue/cancel/schedule failed
at runtime and queue_items stayed empty. Keep the first registration
and add regression coverage for parser flags, roundtrip, and schedule.
2026-09-23 13:50:18 +08:00
WeiCHEN 90b0a6498d merge: freeform-project-id-bigint docs (closeout docs) 2026-09-23 13:50:12 +08:00
WeiCHEN c60ccfe285 merge: modular-decouple residual candidate (closeout docs) 2026-09-23 13:50:11 +08:00
WeiCHEN db3ec5d6e3 merge: modular-decouple closeout docs (closeout docs) 2026-09-23 13:50:10 +08:00
WeiCHEN 2ee2b495ca merge: docrev-ui-rerun memo (closeout docs) 2026-09-23 13:50:09 +08:00
WeiCHEN 1950ab2cb1 merge: user-profile-display CURRENT claim (closeout docs) 2026-09-23 13:50:07 +08:00
WeiCHEN 68be691e13 merge: closeout-worktrees task doc (closeout docs) 2026-09-23 13:50:06 +08:00
WeiCHEN 306836006f docs(ops): register closeout-worktrees task for docs merge and cleanup 2026-09-23 13:49:23 +08:00
WeiCHEN 19b91ae14f merge: promote local_dev to test (task-bubble-bind assistant_msg_id + error actions) 2026-09-23 11:57:11 +08:00
WeiCHEN cc91c217e7 merge: feature/task-bubble-bind-2026-09-23 (assistant_msg_id bind + error actions) 2026-09-23 11:49:50 +08:00
weichen 3f14d7fa75 docs: integrate coordination plan closeout 2026-09-23 03:45:27 +00:00
weichen 3a06150d01 docs: record coordination plan integration and verification 2026-09-23 03:45:27 +00:00
weichen 6a0d721f36 docs: integrate multi-host coordination research and plan 2026-09-23 03:44:27 +00:00
weichen a542c21a42 docs: define multi-host agent coordination and recovery plan 2026-09-23 03:44:12 +00:00
WeiCHEN c60685bb25 docs(ops): claim task-bubble-bind on CURRENT
Register parallel claim row after test overlay verification.
2026-09-23 11:26:01 +08:00
WeiCHEN 66eadc0dc1 docs(ops): record task-bubble-bind test evidence and closeout
Capture test overlay verification, LiveDualTrack, and browser checks for
assistant_msg_id binding and non-resumable continue hiding.
2026-09-23 11:24:45 +08:00
WeiCHEN a360dd302f merge: platform deepening plan (docs only) 2026-09-23 11:19:44 +08:00
WeiCHEN 6b7c8495c5 docs(remediation): add platform deepening plan for decoupling, bus, reliability, HA, concurrency
Six-track plan (R1-R6) grounded in the 2026-09-23 four-way read-only
survey: server/chat/bizdev/workflow residual coupling, event bus ops
loop gaps (dead letters, serial dispatch, dual outbox), panic
recovery, single-host HA (replicas, PG hot standby, backup
automation), concurrency hotspots (docgov engine lock, sync long
tasks, pool tuning). Planned only; no code changes.
2026-09-23 11:19:33 +08:00
WeiCHEN b9b192a843 fix(web): bind task assistant bubble to serverId and harden error actions
Return assistant_msg_id from createTaskRun so live bubbles merge with history,
hide continue on terminal failed runs, and restart via a fresh turn/bubble.
2026-09-23 11:12:50 +08:00
weichen a0fd52a627 docs: integrate learning workflow closeout 2026-09-23 03:02:40 +00:00
weichen f1db9a6c78 docs: record learning workflow activation and verification 2026-09-23 03:02:31 +00:00
weichen 7bbd7a407f docs: integrate issue tracking and development lessons 2026-09-23 03:01:37 +00:00
weichen ccf515c3b1 docs: add issue tracking and development learning workflow 2026-09-23 03:00:51 +00:00
WeiCHEN 44bed71ccd merge: promote local,dev to test (dialogue current-time anchor) 2026-09-23 11:00:21 +08:00
WeiCHEN 15fdb28aa1 merge: fix/dialogue-current-time-2026-09-23 (dialogue clock anchor) 2026-09-23 10:59:37 +08:00
WeiCHEN c9e1033926 fix(coordinator): inject current time into dialogue prompt to anchor time-sensitive answers 2026-09-23 10:59:28 +08:00
weichen 2fdb6e548e docs: integrate systemic analysis policy closeout 2026-09-23 02:44:58 +00:00
weichen bbcb3b3b17 docs: record systemic analysis policy activation 2026-09-23 02:44:57 +00:00
weichen 958dd44fee docs: integrate systemic issue analysis requirements 2026-09-23 02:42:58 +00:00
WeiCHEN e77d994d5d merge: closeout docs for pi-runner-response-size integrate 2026-09-23 10:33:49 +08:00
WeiCHEN 0d3976aa15 docs(ops): close out pi-runner response-size integrate on local_dev 2026-09-23 10:33:21 +08:00
WeiCHEN ee66bd009a docs: record latest-upload promote-to-test evidence 2026-09-23 10:32:11 +08:00
WeiCHEN 04d0727e94 merge: feature/pi-runner-response-size-2026-09-23 (cap /v1/run response size) 2026-09-23 10:30:16 +08:00
WeiCHEN 54955c9d1a merge: promote local_dev to test (latest-upload summary + parse wait) 2026-09-23 10:27:21 +08:00
weichen 380584b86b docs: require systemic root-cause analysis for reported issues 2026-09-23 02:23:45 +00:00
WeiCHEN 30fa4e88b2 merge: fix/fix-latest-upload-summary-2026-09-23 (latest-upload summary + parse wait) 2026-09-23 10:23:21 +08:00
WeiCHEN e035d67170 docs(ops): register pi-runner response-size task as done 2026-09-23 10:22:41 +08:00
WeiCHEN 77028af546 fix(pi-runner): cap /v1/run response size to stop typed reject
Truncate execution.log patches and keep members aligned with patch bodies so
verbose MiniMax-M3 runs no longer exceed the Go 8MB fail-closed limit.
Surface body-too-large vs typed-reject reasons and map contract failures to
fatal restart instead of misleading resumable TASK_INTERRUPTED.
2026-09-23 10:22:23 +08:00
WeiCHEN 10f9a8b9c3 merge: modular-decouple-residual closeout docs (W4 matrix + governance status) 2026-09-23 10:19:42 +08:00
WeiCHEN 521edd4dba merge: modular-decouple residual MATRIX/W4 calibration
Land FEATURE-MATRIX W4 landed notes and close superseded
governance-automation short-term after residual merges.
2026-09-23 10:19:32 +08:00
WeiCHEN 3ebabc1941 docs(ops): calibrate W4 matrix and close governance-automation status
Mark W4 projection/deploy/recover/Darwin as landed in FEATURE-MATRIX,
close the superseded governance-automation short-term, and refresh
residual closeout SHAs after local_dev merges.
2026-09-23 10:19:20 +08:00
WeiCHEN 9f7658515c docs(ops): calibrate W4 matrix and close governance-automation status
Mark W4 projection/deploy/recover/Darwin as landed in FEATURE-MATRIX,
close the superseded governance-automation short-term, and refresh
residual closeout SHAs after local_dev merges.
2026-09-23 10:18:13 +08:00
WeiCHEN 55f3e89a2d merge: promote-user-profile-display-test evidence (receipt + report)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:18:11 +08:00
WeiCHEN e2e508755c docs(ops): close user-profile-display test promotion evidence 2026-09-23 10:17:52 +08:00
WeiCHEN f1f1846925 merge: modular-decouple-residual closeout docs
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:16:45 +08:00
WeiCHEN ae9d44a35c docs(ops): close out modular-decouple-residual after local_dev land 2026-09-23 10:16:30 +08:00
WeiCHEN 8b3936ea0c merge: modular-decouple residual goose 00065 2026-09-23 10:15:20 +08:00
WeiCHEN 73e1797987 feat(sysadmin): add goose 00065 for system:* and settings audits
Restore the migration that seeds console permissions and creates
system_settings_audits so PG environments match the phase-2 API.
2026-09-23 10:15:15 +08:00
WeiCHEN 701c565f72 merge: modular-decouple-residual (splits + W4 + sysadmin)
Land nine package splits, W4 projection/deploy Darwin tests, and
sysadmin system:* permissions with settings audits onto local_dev.
2026-09-23 10:13:39 +08:00
WeiCHEN ed6de25b82 merge(dev): absorb smalltalk routing into intent split
Keep use-case split of recognizer.go and port IsSmallTalk helpers
into recognizer_helpers.go so residual can re-integrate cleanly.
2026-09-23 10:13:29 +08:00
WeiCHEN b2d49d54f1 docs(ops): record Sysadmin phase-2 tip SHA 2026-09-23 10:12:04 +08:00
WeiCHEN e217929ccd merge: promote local,dev to test (intent smalltalk + schema 64)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:12:00 +08:00
WeiCHEN d49c8f8cfc feat(sysadmin): system permission checks and settings audit list
Expose fine-grained system:* checks (admin grants all) and list
system_setting_policy_audits for settings change visibility.
2026-09-23 10:11:46 +08:00
WeiCHEN 5ab034eb53 merge: modular-decouple-residual (splits + W4 + sysadmin)
Land nine package splits, W4 projection/deploy Darwin tests, and
sysadmin system:* permissions with settings audits onto local_dev.
2026-09-23 10:10:17 +08:00
WeiCHEN 9735578c1f docs(ops): record residual sysadmin matrix and CURRENT claim
Update FEATURE-MATRIX remaining deferred items and register the
continuation task claim for serial integrate.
2026-09-23 10:09:44 +08:00
WeiCHEN b627134c62 feat(sysadmin): add system:* permissions and settings audit log
Seed fine-grained console permissions (goose 00065), gate admin
handlers by system:* keys, and persist settings change audits for
all upserts. KB ops and whitelist consumers stay deferred.
2026-09-23 10:09:10 +08:00
WeiCHEN c6e3f26524 merge: fix/intent-smalltalk-routing-2026-09-23 (smalltalk → casual chat) 2026-09-23 10:08:44 +08:00
WeiCHEN 124c6d0071 docs(ops): correct W4 Darwin test claim
DarwinVisibilityTests are not in this round; keep evidence at 5 PASS.
2026-09-23 10:02:26 +08:00
WeiCHEN ee037a4cbc docs(ops): mark W4 done tip 12322b69
Fill pending_commit tip after projection/deploy commit; align W4 test count.
2026-09-23 10:02:13 +08:00
WeiCHEN 3337bf4a42 feat(w4): complete doc projection CAS and deploy/recover loop
Add whole-doc and row projection with hash CAS, real enqueue→claim→
fake-deploy→SQLite receipt chain, Darwin lsof cwd visibility, and
black-box tests. PI image compose remains deferred.
2026-09-23 10:01:23 +08:00
WeiCHEN 12322b6974 feat(agentctl): W4 projection apply and deploy-recover loop
Add CAS projection helpers and a real enqueue→claim→command→receipt
deploy path for temp-repo tests; PI image compose stays deferred.
2026-09-23 10:01:12 +08:00
WeiCHEN f6e14f97af docs(ops): record head_sha for upload parse-wait follow-up 2026-09-23 09:55:59 +08:00
WeiCHEN 1f37f90b4b feat(chat): show MinerU parse progress while waiting in-turn
When summarizing the latest upload, poll parse state up to MinerU timeout,
emit document_parsing phase events so the bubble stays live and input stays
locked, then summarize or return a clear slow/failed reply.
2026-09-23 09:55:59 +08:00
WeiCHEN 0079080d8a fix(intent): route general smalltalk questions to casual chat instead of stage consult template 2026-09-23 09:54:37 +08:00
WeiCHEN 39e115b4d3 refactor(docgov): split engine.go into use-case files
Move claim/document/persist/proposal/read/review_flow into ≤800-line
siblings without behavior change; short tests green.
2026-09-23 09:54:19 +08:00
WeiCHEN 4c07716933 refactor(server): split handlers.go by domain
Keep slim handlers.go core; move chat/docgov/health/http/context
handlers into domain files ≤800 lines without behavior change.
2026-09-23 09:54:18 +08:00
WeiCHEN 943becfb2a refactor(projectinstance): split store.go into use-case files
Move mem/pg activate/live/meta/plan/token/seed paths into ≤800-line
siblings without behavior change; short tests green.
2026-09-23 09:54:17 +08:00
WeiCHEN 20290d0379 docs(ops): claim CURRENT row for user-profile-display done 2026-09-23 09:53:30 +08:00
WeiCHEN 64c7197f8c merge: user-profile-display acceptance docs 2026-09-23 09:53:11 +08:00
WeiCHEN c1f27e3cdb docs(ops): record user-profile-display acceptance on local_dev 2026-09-23 09:53:02 +08:00
WeiCHEN 9da7f352fa refactor(docrevision): split service.go into use-case files
Move human/agent/read/locked/compat paths into ≤800-line siblings
without behavior change; short tests green.
2026-09-23 09:52:49 +08:00
WeiCHEN dca33c705d refactor(boundaries): split five oversized packages by use-case
Move bizdev/freedoc/intent/projectworkflow/squad giant files into
≤800-line use-case siblings without behavior change; short tests green.
2026-09-23 09:52:16 +08:00
WeiCHEN 2fae990965 merge: user-profile-display build unblock (optional chat status) 2026-09-23 09:44:12 +08:00
WeiCHEN 654a92583f fix(web): allow optional chat status in cancelInflight helper
Unblocks Docker web build after ChatMessage.status became optional.
2026-09-23 09:44:02 +08:00
WeiCHEN 1546d89446 docs(ops): record head_sha for latest-upload summary fix 2026-09-23 09:42:47 +08:00
WeiCHEN a3b5d4291b fix(chat): resolve latest-upload summary via CAS assets
Recognize “刚刚上传” as @latest_upload and summarize the project’s newest CAS attachment (with clear parse pending/failed/no-asset replies) instead of searching only controlled workflow docs.
2026-09-23 09:42:28 +08:00
WeiCHEN ad80777a3e merge: user-profile-display (directory API + profile edits) 2026-09-23 09:40:00 +08:00
WeiCHEN 6d3efdf4d7 feat(auth): show real names in duty pickers and enable profile edits
Add a login-visible user directory API and admin/self profile update
paths so project duty selectors stop falling back to "用户 N", and so
users can persist display fields with an admin-edit tip.
2026-09-23 09:39:41 +08:00
WeiCHEN 19a1a03c20 merge: modular-refactor-impl-plan closeout (CURRENT done)
Record undertaking-plan task done and short-term closeout after first merge.
2026-09-23 09:38:25 +08:00
WeiCHEN e32d55bd9b docs(ops): close modular-refactor-impl-plan after local_dev merge
Record merged SHA, validation receipts, and CURRENT row done; cleanup
pending for feature worktree; remote sync not requested.
2026-09-23 09:38:24 +08:00
WeiCHEN b9f4509287 merge: modular-refactor-impl-plan-2026-09-23 (undertaking framework)
Land the phase-gate and work-package backfill framework for the off-host
refactor plan; documentation only.
2026-09-23 09:38:01 +08:00
WeiCHEN 19a8f19a8a docs(ops): claim CURRENT for modular-refactor-impl-plan
Register the undertaking-plan documentation task in the parallel-claim table.
2026-09-23 09:37:49 +08:00
WeiCHEN 5c249b0975 docs(plan): add modular refactor implementation undertaking framework
Define phase gates, work-package template, anti-duplication checks against
A-G/exceptions baseline, and product-host backfill rules without coding.
2026-09-23 09:37:48 +08:00
weichen c45ed6ba52 docs: integrate system modular refactoring plan 2026-09-23 01:36:43 +00:00
weichen a44804fd59 docs(architecture): add system remediation and refactoring plan 2026-09-23 01:36:29 +00:00
WeiCHEN 2ce8688db4 merge: modular-refactor-review closeout (CURRENT done)
Record checklist task done and short-term closeout after first merge.
2026-09-23 09:14:42 +08:00
WeiCHEN 6bcaf53d51 docs(ops): close modular-refactor-review after local_dev merge
Record merged SHA, validation receipts, and CURRENT row done; cleanup
remains for an independent maintainer; remote sync not requested.
2026-09-23 09:14:33 +08:00
WeiCHEN e8bff7e287 merge: modular-refactor-review-2026-09-23 (audit checklist)
Bring the phase-1/2 and cancel-contract review checklist into local_dev
as a documented self-check for the off-host refactor plan.
2026-09-23 09:13:47 +08:00
WeiCHEN f0de2b2158 docs(ops): claim CURRENT row for modular-refactor-review
Register the checklist task in the parallel-claim table so coordination
snapshots match the agentctl registration.
2026-09-23 09:12:38 +08:00
WeiCHEN 6d9f3648bd docs(audit): add modular refactor plan review checklist
Provide phase-1/2 and cancel-contract self-check items for the off-host
refactor plan, with N01–N22 mapping placeholders and product-host backfill steps.
2026-09-23 09:11:56 +08:00
WeiCHEN 457bea8591 docs(ops): note CURRENT sync completed after DOCREV UI PASS
Record that the ours-merge CURRENT drop was repaired via closeout
on local_dev; keep only the short-term memo on this branch.
2026-09-23 09:09:44 +08:00
WeiCHEN 8f0e31e53a merge: closeout FEATURE-MATRIX A-G done + CURRENT residuals 2026-09-23 04:24:54 +08:00
WeiCHEN fdd072d694 docs(status): close MATRIX A-G and register unfinished-batch residuals
Restore W1-D schema facts lost in merge, mark decoupling A-G done with
batch evidence, and keep redline rows partial with 2026-09-22 evidence.
2026-09-23 04:24:09 +08:00
WeiCHEN c24e1548ca merge: closeout CURRENT + sealed DOCREV UI PASS ledger
Resolve CURRENT to DOCREV PASS focus (CAS on closeout 44cc4926).
Archive sealed main/post-restart ledger mud2qct9. Hook bypass: integrate
task lacks docs:admin; CURRENT body matches closeout receipt.
2026-09-23 04:17:42 +08:00
WeiCHEN 44cc4926e1 docs(ops): restore DOCREV UI PASS focus on CURRENT
Prior ours-merge dropped the focus line; re-apply via docs @document
CAS with sealed ledger link and docrev cleanup row.
2026-09-23 04:17:13 +08:00
WeiCHEN 4a97cfcf76 docs(test): archive sealed DOCREV UI main+post-restart PASS ledger
Persist mud2qct9 main/post ledgers, phase-state, and key screenshots
under sealed-ledger-ui00-16-post-20260923T0400Z (schema 63).
2026-09-23 04:16:39 +08:00
WeiCHEN 63348b6e35 merge: docrev short-term CURRENT sync note 2026-09-23 04:06:16 +08:00
WeiCHEN a9198eb5b5 docs(ops): note CURRENT sync pending after DOCREV UI PASS 2026-09-23 04:06:15 +08:00
WeiCHEN 437cee84a5 merge: closeout CURRENT DOCREV UI PASS note 2026-09-23 04:03:32 +08:00
WeiCHEN e9a9ce97c2 docs(ops): record DOCREV UI rerun PASS on CURRENT 2026-09-23 04:02:02 +08:00
WeiCHEN ddcb63cd4b merge: feature/docrev-ui-rerun-2026-09-22 (UI PASS closeout docs) 2026-09-23 04:01:06 +08:00
WeiCHEN 4baa1220ee docs(ops): close docrev UI audits after main+post-restart PASS
Record real Playwright ledgers, mark 20 audits and 9 remediations done, and leave management-implementation-plan as plan-only.
2026-09-23 04:00:49 +08:00
WeiCHEN bcc3168e8a merge: feature/docrev-ui-rerun-2026-09-22 (UI-13b before 三权) 2026-09-23 03:35:48 +08:00
WeiCHEN 0f97965cd2 fix(e2e): run UI-13b A/A conflict on drafting intake before 三权
Prelim materializes with empty duty slots (author_id=0), so claim/edit is
impossible after UI-11; move conflict onto intake while it is still drafting.
2026-09-23 03:35:27 +08:00
WeiCHEN 6fc86335ef merge: feature/docrev-ui-rerun-2026-09-22 (squad/playwright timeouts) 2026-09-23 03:12:58 +08:00
WeiCHEN 84cc3b9861 fix(e2e): raise Playwright per-test timeout to 15m
Pair with 10m squad waits so UI-03 does not race the test wall when intake finishes near the expect limit.
2026-09-23 03:11:20 +08:00
WeiCHEN ecd8e94e24 fix(e2e): raise squad wait timeout to 10m for UI-03
Intake completion landed ~20s after the old 7m expect wall; keep claim-before-edit fix and avoid false pending failures.
2026-09-23 03:09:24 +08:00
WeiCHEN 8c37c9330a merge: feature/docrev-ui-rerun-2026-09-22 (UI-13b claim-before-edit) 2026-09-23 03:02:42 +08:00
WeiCHEN 01bf599bd4 fix(e2e): claim prelim author before UI-13b conflict edit
Prelim docs ship with author_id=0 so currentDocRole is viewer and dblclick
is a no-op; claim 认领此文档 first then assert the edit tip on both A contexts.
2026-09-23 03:00:15 +08:00
WeiCHEN 67251abc09 fix(e2e): release A1 lease before UI-13b A2 opens block editor
Same-user second context could not dblclick-edit while A1 held the
human lease on prelim. Leave to intake, let A2 claim editor, then A1 save.
2026-09-23 02:35:45 +08:00
WeiCHEN 0429b9735e fix(e2e): run UI-13b conflict on drafting prelim, not locked intake
After UI-11 三权, intake is 已生效受控 and blocks body edit. Use
secondDocId (prelim_design) for the A/A head-conflict scenario.
2026-09-23 02:12:02 +08:00
WeiCHEN 92bb1a2004 fix(e2e): send Bearer token when fetching revision-state etag
UI-13b page.evaluate fetch used credentials-only and got HTTP 401 because
auth is Bearer in smdf_auth_session, not cookies.
2026-09-23 01:53:49 +08:00
WeiCHEN 9d7c97f728 fix(e2e): fetch revision-state etag by doc id for UI-13b
waitForResponse raced unrelated revision-state polls, so A1/A2
compared different documents heads before the conflict save.
2026-09-23 01:29:17 +08:00
WeiCHEN a28c067f72 merge: feature/docrev-ui-rerun-2026-09-22 (freeform bigint + UI e2e) 2026-09-23 00:47:23 +08:00
WeiCHEN 3bdd53ae35 fix(freedoc): widen freeform project_id to BIGINT for snowflake IDs
UI-11 POST /freeform-documents 500 when project_id exceeds int4.
Align Go types + goose 00063 with projects.id BIGINT.
2026-09-23 00:45:31 +08:00
WeiCHEN b6965eb0f3 docs(ops): mark freeform project_id BIGINT task done 2026-09-23 00:44:05 +08:00
WeiCHEN 2b901a61de fix(freedoc): widen freeform project_id to BIGINT
Snowflake project IDs exceed int4; upload registration failed with
pgx encode errors. Align column and Go types with projects.id.
2026-09-23 00:42:30 +08:00
WeiCHEN 1ff3d81e1b docs(ops): pin docrev-ui head_sha after closeout scaffold 2026-09-23 00:27:28 +08:00
WeiCHEN c9a9b90172 docs(ops): scaffold docrev UI rerun closeout without closing audits
Record honest partial progress (UI-00..04 live PASS, sealed UI-00..10 screenshots, UI-11 blocker history) and UI→audit mapping; leave 09-13 audits in_progress until full main+post-restart PASS ledger exists.
2026-09-23 00:27:07 +08:00
WeiCHEN 1dbdb95088 fix(e2e): click 确认推进 after intake 三权 before UI-11
Approved intake only unlocks the gate; prelim_design still 403 until
creator advances V0.1 → V0.5 via StageAdvanceBanner.
2026-09-23 00:17:08 +08:00
WeiCHEN 3a1065f789 fix(e2e): expand collapsed doc rail before category select
Reviewer/approver contexts open with collapsed rail; UI-11 三权
failed looking up doc-category-trigger.
2026-09-23 00:02:41 +08:00
WeiCHEN e6b23772c9 fix(e2e): approve intake via 三权 before UI-11 prelim_design
V0.1 blocking intake caused tasks/runs 403 for V0.5 prelim_design;
drive submit/review/approve on page and accept bd_prelim_design keys.
2026-09-22 23:40:22 +08:00
WeiCHEN 34d4ddcd7a merge: fix-governance-agent-worktree-restore-2026-09-22 2026-09-22 23:31:46 +08:00
WeiCHEN 3633f8771e fix(scripts): restore agent_worktree after governance merge conflict 2026-09-22 23:31:43 +08:00
WeiCHEN 85afbfb3f6 merge: feature/governance-automation-2026-09-22 2026-09-22 23:29:44 +08:00
WeiCHEN 4476c446f0 merge: feature/coordinator-docgov-allowlist-2026-09-22 2026-09-22 23:28:40 +08:00
WeiCHEN 07991588c2 merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 23:20:01 +08:00
WeiCHEN 5e7fb240c3 fix(e2e): accept bd_intake task_key for UI-05b intake runs
Server posts doc_proj suffix (bd_intake) as task_key; bare intake
assertion was a false FAIL after UI-05a.
2026-09-22 23:11:00 +08:00
WeiCHEN 1c78d614cb fix(web): ignore retained task run id when unlocking chat composer
Orphan streaming_status plus a leftover activeTaskRunId kept InputArea on
停止 after squad terminal. Gate taskRunLive on isThinking only and clear
runId on abortSession so stop/send can proceed for UI-05+.
2026-09-22 23:02:13 +08:00
WeiCHEN db8c3dcc64 fix(web): settle orphan inflight bubbles via shared cancel helper
Wire cancelInflightAssistantMessages on stop so composer unlock and
message status stay consistent across sessions.
2026-09-22 22:59:17 +08:00
WeiCHEN c3639eba7d fix(web): unlock chat send when orphan streaming_status remains
Composer stop/send was gated only on message status; after squad
terminal, stale streaming bubbles kept 停止当前生成. Gate on live
turn/task-run runtime and settle orphans on explicit stop.
2026-09-22 22:58:39 +08:00
WeiCHEN 5c222d18e6 fix(e2e): drain stuck chat streaming before next sendChat
UI-05 timed out on 发送 because InputArea stayed isStreaming after
squad terminal; stop/idle wait restores 发送 (Enter).
2026-09-22 22:49:55 +08:00
WeiCHEN 30c85ed79f fix(e2e): disable Playwright auto-artifacts for docrev UI acceptance 2026-09-22 22:40:40 +08:00
WeiCHEN 8b76060b5f merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 22:30:05 +08:00
WeiCHEN 8122f7461d docs(ops): pin docrev-ui head_sha 2026-09-22 22:30:03 +08:00
WeiCHEN 3fdf4a01b7 docs(ops): pin docrev-ui head_sha on final rebuilt tip 2026-09-22 22:30:02 +08:00
WeiCHEN c5999f9c30 fix(e2e): retain Playwright artifacts only on failure for docrev UI
Avoid ENOENT on in-flight traces when long UI-03 squad runs while
outputDir is cleaned by a concurrent acceptance attempt.
2026-09-22 22:30:02 +08:00
WeiCHEN 235def6dbf docs(ops): pin docrev-ui head_sha on rebuilt tip 2026-09-22 22:30:01 +08:00
WeiCHEN f99e714fb2 fix(e2e): activate workflow with A/B/D duties before UI-02 squad
Product gate blocks intake until workflow is active with human-approval
duties. Keep C non-member for UI-12; pin B as reviewer for UI-13.
2026-09-22 22:30:00 +08:00
WeiCHEN 62f444ce15 fix(e2e): add approver D for workflow 三权 without inviting C
系统管理员 name collides in member list; unique 审批人D keeps UI-12.
2026-09-22 22:29:59 +08:00
WeiCHEN 16cb60b3d8 fix(e2e): activate workflow in UI-01 before squad tasks
Product gate blocks document tasks until a human-approval workflow is
active; add admin as third member for 三权 and drive 配置工作流.
2026-09-22 22:29:58 +08:00
WeiCHEN 54629e7f40 fix(e2e): scope UI-02 prompt visibility to user chat bubble
Avoid strict-mode collision with truncated preview duplicate text.
2026-09-22 22:29:57 +08:00
WeiCHEN c2d5499229 fix(e2e): expand collapsed doc rail before UI-01 template hint
Default right rail is collapsed; assert after opening 展开受控文档栏.
2026-09-22 22:29:57 +08:00
WeiCHEN 50d50d4798 fix(web): preserve org user directory across workbench reset
Logout and account switch were clearing USERS from localStorage, so
UI-01 page.goto remount loaded an empty member list for non-admins.
2026-09-22 22:29:56 +08:00
WeiCHEN b246ead0e4 docs(ops): sync docrev-ui head_sha to tip 2026-09-22 22:29:55 +08:00
WeiCHEN 7519e76ac2 docs(ops): mark docrev UI rerun blocked pending env lease 2026-09-22 22:29:54 +08:00
WeiCHEN 8d2d514fa7 fix(e2e): exit AdminConsoleView via 返回工作台 in UI-00 2026-09-22 22:29:53 +08:00
WeiCHEN 61a0623bf8 fix(e2e): open Users section before create-user in docrev UI-00 2026-09-22 22:29:52 +08:00
WeiCHEN 2e45a649c5 docs(ops): register docrev UI rerun short-term after artifact fix 2026-09-22 22:29:51 +08:00
WeiCHEN 4bb4881241 merge: feature/track-t-strengthen-2026-09-22 2026-09-22 22:28:48 +08:00
WeiCHEN 3208e090ad merge: feature/rdev-closeout-2026-09-22 2026-09-22 22:28:44 +08:00
WeiCHEN 1498cd230a merge: feature/server-assembly-2026-09-22 2026-09-22 22:26:50 +08:00
WeiCHEN 2695b55863 merge: feature/docgov-vocabulary-2026-09-22 2026-09-22 22:26:27 +08:00
WeiCHEN 476ef180bb merge: feature/closeout-unfinished-batch-2026-09-22 2026-09-22 22:26:19 +08:00
WeiCHEN e7aaa20f5d docs(ops): record unfinished-batch closeout on local tip 0352c099 2026-09-22 22:26:14 +08:00
WeiCHEN aebd27665b merge: feature/loading-perf-closeout-2026-09-22 2026-09-22 22:25:37 +08:00
WeiCHEN fe9b1b41ed merge: feature/web-api-client-2026-09-22 2026-09-22 22:24:29 +08:00
WeiCHEN 6ad6f55f4b docs(ops): pin governance-automation head_sha after conflict resolution 2026-09-22 22:20:37 +08:00
WeiCHEN 0352c0996d merge: feature/governance-automation-2026-09-22
Keep macOS process platform; land W4 queue/automation and cleanup-report.
2026-09-22 22:20:37 +08:00
WeiCHEN 1116058a88 merge(dev): sync governance-automation onto current local dev 2026-09-22 22:20:36 +08:00
WeiCHEN 2006c7103a fix(arch): restore coordinator→docgov allowlist after engine-split
Engine split kept the existing production import; vocabulary allowlist rewrite had dropped the key and left arch-check red on tip.
2026-09-22 22:14:52 +08:00
WeiCHEN 3eac3a815f merge: feature/engine-split-archfix-2026-09-22
Restore arch-check after engine-split unused docgov imports.
2026-09-22 22:14:23 +08:00
WeiCHEN 0ad4ee319c fix(coordinator): map engine-split sentinels to vocabulary 2026-09-22 22:14:22 +08:00
WeiCHEN 04d1b174e9 merge: feature/track-s1-summary-shadow-2026-09-22 2026-09-22 22:13:41 +08:00
WeiCHEN f77cf953d5 merge(dev): sync track-s1 shadow onto current local dev 2026-09-22 22:13:31 +08:00
WeiCHEN a01db5451c merge: feature/engine-split-2026-09-22 2026-09-22 22:12:24 +08:00
WeiCHEN 19eeccc699 docs(ops): pin engine-split head_sha on rebuilt tip 2026-09-22 22:10:27 +08:00
WeiCHEN 834af6dd59 refactor(coordinator): split engine.go by use-case handlers (rebuilt on current dev) 2026-09-22 22:10:26 +08:00
WeiCHEN 08af12b936 merge: feature/g2-g3-exception-clearance-2026-09-22
Keep G1 cleared sql_write; land G2/G3 path clearances; baseline to zero.
2026-09-22 22:08:53 +08:00
WeiCHEN fa34f8c84d docs(ops): sync track-t head_sha to tip 2026-09-22 22:08:39 +08:00
WeiCHEN e07d6024e6 docs(ops): pin governance-automation head_sha 2026-09-22 22:08:39 +08:00
WeiCHEN 3dc7b85b7e docs(ops): pin track-s1 consolidation head_sha to tip 2026-09-22 22:08:39 +08:00
WeiCHEN 2b6f645aad docs(ops): register track-t strengthen short-term as merged 2026-09-22 22:08:39 +08:00
WeiCHEN ae001a85c1 fix(ops): copy agentctl_w4 into script test fixtures
Disposable Git fixtures only copied agentctl.py, so imports of the new
W4 helper module crashed before any guard assertions could run.
2026-09-22 22:08:38 +08:00
WeiCHEN 79f1710f8e docs(ops): pin server-assembly head_sha after conflict resolution 2026-09-22 22:06:14 +08:00
WeiCHEN 9967f41053 fix(server): resolve assembly merge onto current local dev 2026-09-22 22:06:14 +08:00
WeiCHEN 573fce225d merge: feature/track-i1-query-owner-2026-09-22
Land QueryOwner code; FEATURE-MATRIX deferred to docs apply.
2026-09-22 22:05:45 +08:00
WeiCHEN 0eee2dd036 merge: feature/server-assembly-2026-09-22
Keep G1 Heal via docgov through Runtime port; domain HTTP adapters.
2026-09-22 22:04:53 +08:00
WeiCHEN 955ebe8a36 merge: feature/chat-history-refresh-reconcile-2026-09-22 2026-09-22 22:03:46 +08:00
WeiCHEN 239997ce09 merge: feature/status-drift-reconcile-2026-09-22 2026-09-22 22:02:53 +08:00
WeiCHEN 1892af6391 docs(ops): sync rdev-closeout head_sha to tip 2026-09-22 22:01:50 +08:00
WeiCHEN 6cdb818e0d docs(ops): sync loading-perf head_sha to tip 2026-09-22 22:01:50 +08:00
WeiCHEN 5a07a8388a docs(ops): align rdev-closeout head_sha after merge 2026-09-22 22:01:50 +08:00
WeiCHEN 97f05c3d10 docs(ops): align loading-perf head_sha for integrate readiness 2026-09-22 22:01:50 +08:00
WeiCHEN 82eb500d8e docs(ops): sync docgov-vocabulary head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN f33670f5bd docs(ops): sync track-i1 head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN 6fae5a1ee6 docs(ops): sync chat-history-refresh head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN aa78d03044 docs(ops): align track-i1 head_sha for integrate readiness 2026-09-22 22:01:49 +08:00
WeiCHEN 7292c01aaa docs(ops): align chat-history-refresh head_sha to branch tip 2026-09-22 22:01:49 +08:00
WeiCHEN 5197cf348b docs(ops): sync server-assembly head_sha to tip 2026-09-22 22:01:48 +08:00
WeiCHEN 49eba094c0 docs(ops): sync status-drift-reconcile head_sha to tip 2026-09-22 22:01:48 +08:00
WeiCHEN 98fd086894 docs(ops): align docgov-vocabulary head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN 04d18e1f80 docs(ops): align server-assembly head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN 0111824d10 docs(ops): align W1-D head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN dee905c1de docs(ops): sync g2-g3 head_sha to tip 2026-09-22 22:01:27 +08:00
WeiCHEN db632aeea2 docs(ops): mark g2-g3 clearance done and pin head_sha 2026-09-22 22:01:27 +08:00
WeiCHEN a8c6eb6638 refactor(boundaries): clear U5 path leaks and U8 task_runs write
Route deliverable/workspace paths through workspace constants and cancel
open runs via taskrun.CancelOpenByProject so G2/G3 exceptions can drop.
2026-09-22 22:01:14 +08:00
WeiCHEN 50fd582595 merge: feature/agentctl-macos-2026-09-22 (head_sha tip) 2026-09-22 22:00:24 +08:00
WeiCHEN 0c572ddaca test(chat): align semantic shadow tests with async pending path
Drain/wait after GenerateRollingSummary; register summary table writers;
document consolidation discarding duplicate S1 dirty worktrees.
2026-09-22 21:59:12 +08:00
WeiCHEN 060bbb92cb docs(ops): pin web-api-client head_sha after CRLF residual 2026-09-22 21:59:05 +08:00
WeiCHEN 4d87b9a401 fix(web): accept CRLF SSE frame delimiters in chatStream
Align residual chatStream parsing with sibling t20-lowrisk so LF/CRLF
mixed streams parse reliably before integration, with unit coverage.
2026-09-22 21:59:05 +08:00
WeiCHEN 52c7828339 merge: feature/docgov-vocabulary-2026-09-22
Keep contracts/vocabulary with G1 uow/workspace duty ports; chat stays decoupled.
2026-09-22 21:58:16 +08:00
WeiCHEN e558192813 merge: feature/loading-perf-closeout-2026-09-22 2026-09-22 21:56:09 +08:00
WeiCHEN e6f101a811 merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 21:54:56 +08:00
WeiCHEN 7e405546ec merge: feature/track-t-strengthen-2026-09-22 2026-09-22 21:54:48 +08:00
WeiCHEN 57111ca075 merge: feature/rdev-closeout-2026-09-22 2026-09-22 21:54:40 +08:00
WeiCHEN 6984f96c19 merge: feature/workflow-def-unidirect-2026-09-22 2026-09-22 21:53:52 +08:00
WeiCHEN 4662e39541 merge: feature/web-api-client-2026-09-22 2026-09-22 21:53:45 +08:00
WeiCHEN 265de19725 merge: feature/chat-app-decouple-2026-09-22 2026-09-22 21:53:38 +08:00
WeiCHEN 0779db4634 docs(ops): pin loading-perf head_sha to tip 2026-09-22 21:53:35 +08:00
WeiCHEN 3e1d00b2e3 merge: feature/t20-lowrisk-hardening-2026-09-22 2026-09-22 21:53:30 +08:00
WeiCHEN 2c80129421 merge: feature/g1-exception-clearance-2026-09-22 2026-09-22 21:53:25 +08:00
WeiCHEN e207dc1e71 docs(status): close FEATURE-MATRIX initial-load special section
Mark U1/U3/U7 measured closeout on schema 61; keep whole-machine reboot
claim out of scope.
2026-09-22 21:53:20 +08:00
WeiCHEN c37988f075 merge: feature/redline-evidence-2026-09-22 2026-09-22 21:53:20 +08:00
WeiCHEN c89c07f977 docs(ops): add initial-load closeout test report
Record schema-61 n=20 waterfall, throttle, and U7 form evidence; note Edge
channel exception for Playwright Chromium download sandbox.
2026-09-22 21:53:19 +08:00
WeiCHEN a17da2aa13 merge: feature/t20-design-items-2026-09-22 2026-09-22 21:52:34 +08:00
WeiCHEN f96c5277fd test(e2e): fix UI_PHASE evidence isolation for docrev UI rerun 2026-09-22 21:51:33 +08:00
WeiCHEN 17f6e4dd2d test(web): close initial-load perf harness for U1/U3/U7 evidence 2026-09-22 21:51:32 +08:00
WeiCHEN 9a5b8a5ed5 docs(ops): finalize T20 W4 design decisions packaging 2026-09-22 21:51:21 +08:00
WeiCHEN 056e4e5c4b feat(chat): productionize semantic summary shadow path without REPLACE 2026-09-22 21:51:20 +08:00
WeiCHEN 684008e3a5 feat(trace): strengthen T2/T3 evidence and access-log design 2026-09-22 21:51:19 +08:00
WeiCHEN 10c5a295a2 feat(rdev): nightly four-workflow expansion and proposal title alignment 2026-09-22 21:51:18 +08:00
WeiCHEN f01970564a feat(ops): advance governance automation queue and projection increments 2026-09-22 21:51:17 +08:00
WeiCHEN 4ae878e4c5 docs(ops): complete redline evidence packs without capability release 2026-09-22 21:51:15 +08:00
WeiCHEN 6a6c4230be merge: feature/agentctl-macos-2026-09-22 (macOS process platform) 2026-09-22 21:48:36 +08:00
WeiCHEN 6b9d3cc69a docs(ops): fill agentctl-macos head_sha tip 2026-09-22 21:48:23 +08:00
WeiCHEN 6bce3a4ff8 docs(ops): freeze G1 head_sha at implementation tip
Point short-term head_sha at feat+fix tip 45c21ef9 so docs pin
commits do not chase a self-referential SHA.
2026-09-22 21:47:00 +08:00
WeiCHEN c17594aaa2 docs(ops): pin G1 short-term head_sha to tip 2026-09-22 21:46:51 +08:00
WeiCHEN 13d5f8cdaa docs(ops): clarify G1 tip SHAs in short-term closeout 2026-09-22 21:46:20 +08:00
WeiCHEN 2f1c66bf4d docs(ops): record agentctl-macos verification and head_sha 2026-09-22 21:46:11 +08:00
WeiCHEN dcd4867ad0 docs(ops): pin G1 clearance head_sha to final tip 2026-09-22 21:45:21 +08:00
WeiCHEN a85d06a6b4 docs(ops): finalize G1 clearance short-term after branch restore
Correct branch ownership note now that this worktree alone holds
feature/g1-exception-clearance-2026-09-22; retain macOS lease exception.
2026-09-22 21:45:21 +08:00
WeiCHEN 668ed249ef docs(ops): pin docgov-vocabulary head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN f1295c435e docs(ops): pin g2-g3 head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN 993b3dcbae docs(ops): pin workflow-def-unidirect head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN 381b56dafc refactor(docgov): converge shared lifecycle vocab into contracts
Introduce internal/contracts/vocabulary for state/role/error sentinels,
alias through docgov, and retarget hot production consumers so
coordinator no longer imports docgov for vocabulary-only use.
2026-09-22 21:44:57 +08:00
WeiCHEN 7d51e40b1c refactor(boundaries): clear data/dev path leaks; start output.md via DeliverableKey
Remove coordinator/bizdev/storage data/dev fallbacks and register
agent→workspace so default agent targets use workspace.DeliverableKey.
Remaining U5 path and G3 task_runs clearance stay open.
2026-09-22 21:44:57 +08:00
WeiCHEN ad96f67442 refactor(workflowdef): make definition/runtime deps unidirectional
Keep registry key validation local to workflowdef with composition-root
injection, adapt FlatCatalog for projectworkflow, and drive the
orchestrator through LiveInstancePort views instead of projectinstance.
2026-09-22 21:44:57 +08:00
WeiCHEN 72b3d42808 docs(ops): pin track-i1 head_sha to tip 2026-09-22 21:44:56 +08:00
WeiCHEN 615529f4c4 docs(ops): pin server-assembly head_sha to tip 2026-09-22 21:44:56 +08:00
WeiCHEN d019388f37 feat(intent): wire production QueryOwner and confirm dispatcher
Replace FakeActionOwner with QueryOwner+QueryGuard at the composition
root; DispatchEligible reuses claim/execute/recover so confirm stays
zero-write before dispatch and default tier remains legacy.
2026-09-22 21:44:56 +08:00
WeiCHEN 9071c272bf refactor(server): drop Server pool; route health/heal/vault via Runtime
Remove production *pgxpool.Pool from Server, centralize domain→HTTP
status mapping, and expose Runtime ports for task-store readiness,
duty heal, and artifact vault registry. Allow app→docduty for heal wiring.
2026-09-22 21:44:56 +08:00
WeiCHEN ade6c2eefc docs(ops): pin G1 short-term head_sha to tip 2026-09-22 21:44:39 +08:00
WeiCHEN 041f9dff62 docs(ops): note G1 tip branch after name collision
Record macOS hooks bypass and that engine-split holds the original
feature branch name; tip lives on feature/g1-exception-clearance-w1a-tip.
2026-09-22 21:44:39 +08:00
WeiCHEN 47fdeb1655 feat(agentctl): add macOS process platform layer
Replace Linux /proc hard dependency with Darwin ps+sysctl while keeping
zombie/group/boot three-value semantics fail-closed for unreadable PIDs.
2026-09-22 21:44:28 +08:00
WeiCHEN 3afd214679 docs(ops): pin G1 clearance task head_sha to tip 2026-09-22 21:42:58 +08:00
WeiCHEN 7c25b3b59e docs(ops): record W1-A G1 exception clearance short-term task
Capture scope, macOS agentctl /proc lease exception, and arch/vet/short
evidence for the U3 sql_write and U4 path clearance batch.
2026-09-22 21:42:58 +08:00
WeiCHEN 45c21ef96e fix(workspace): compare realpaths when enforcing artifact roots
macOS TempDir resolves /var to /private/var; EvalSymlinks the data root
before Rel so fencing writes are not false path-escape failures.
2026-09-22 21:42:58 +08:00
WeiCHEN 9c7a5be209 feat(arch): clear G1 U3/U4 sql_write and path exceptions
Move document_records duty-slot writes into docgov, project ledger
heads through docgov/freedoc ports, and workspace deliverable I/O
through DeliverableStore so arch-check baseline drops to sql_write:1
path:13.
2026-09-22 21:40:12 +08:00
WeiCHEN 485572dce2 docs(ops): T20 W4 hardening design decisions
Record recommended approaches, risks, acceptance, and product/env
blockers for audit-remainder design items; cross-link F5/I8 to lowrisk.
2026-09-22 21:29:47 +08:00
WeiCHEN 319d632b24 docs(ops): pin T20 closeout tip SHA 2026-09-22 21:29:11 +08:00
WeiCHEN b09ab2e4a6 docs(ops): closeout T20 hardening PASS/SKIP checklist
Record per-item PASS evidence, verification summary, and macOS
agentctl exception for the W2 low-risk hardening batch.
2026-09-22 21:28:41 +08:00
WeiCHEN 2d19ecb745 docs(ops): pin web-api-client head_sha to feat tip 2026-09-22 21:28:40 +08:00
WeiCHEN c73b376b93 docs(audit): link CHAT-HISTORY-REFRESH reconcile PASS closeout 2026-09-22 21:28:22 +08:00
WeiCHEN bf94995e1e docs(ops): align chat-history refresh closeout with B3 evidence
Fix residual contradiction that treated activate+restart as still open; keep PASS SSOT and macOS agentctl exception note.
2026-09-22 21:27:56 +08:00
WeiCHEN 794656224c docs(ops): clarify CHAT-HISTORY-REFRESH reconcile residual notes
Cite B3 gate as closed evidence; keep only transport-cache UX as residual; mark remediation INDEX done.
2026-09-22 21:27:51 +08:00
WeiCHEN 8c24d105fc docs(ops): pin chat-app-decouple head_sha to tip 2026-09-22 21:27:44 +08:00
WeiCHEN 9229b94c32 docs(ops): T20 W4 design decisions for hardening backlog
Record recommended approaches, risks, acceptance, and product/env
blockers for B1/B3–B5/B7/B11, F1/F4/F7/F8, I1/I4/I6; cross-link F5/I8
to t20-lowrisk without duplicating.
2026-09-22 21:27:25 +08:00
WeiCHEN 9db5f149dd docs(ops): align web-api-client head_sha with feature tip 2026-09-22 21:27:16 +08:00
WeiCHEN 9db2462604 docs(ops): note macOS agentctl lease exception for redline batch
Record the /proc Lease crash workaround and freeze the evidence tip SHA.
2026-09-22 21:26:59 +08:00
WeiCHEN 14fab66ac6 docs(ops): restore macOS agentctl commit exception 2026-09-22 21:26:51 +08:00
WeiCHEN b7f4503d5e docs(ops): sync W1-D head_sha to tip 2026-09-22 21:26:48 +08:00
WeiCHEN 7e42e5f2ab docs(ops): finalize W1-D task head_sha and closeout chain 2026-09-22 21:26:46 +08:00
WeiCHEN d8c012ba58 docs(ops): set web-api-client head_sha to tip 2026-09-22 21:26:45 +08:00
WeiCHEN 1da2f17b16 docs(ops): record web-api-client batch F task and lease exception 2026-09-22 21:26:45 +08:00
WeiCHEN 681ca1b95e feat(web): unify API client with auth, errors, and limited retry
Route web/src/api modules through shared apiFetch so Bearer headers,
typed error envelopes, and GET/HEAD transient retries live in one place
without swallowing domain failures used by existing error cards.
2026-09-22 21:26:44 +08:00
WeiCHEN 330de92ba7 docs(ops): reconcile CHAT-HISTORY-REFRESH SSOT as PASS
Close stale open handoff/planned remediation against tip code and B3 live evidence; keep empty stage_key and localStorage masking red lines.
2026-09-22 21:26:35 +08:00
WeiCHEN df45fe5cd5 docs(ops): point W1-D task head_sha at branch tip 2026-09-22 21:26:33 +08:00
WeiCHEN e43adb1666 docs(ops): record chat-app-decouple tip SHA 2026-09-22 21:26:29 +08:00
WeiCHEN bc873f4400 docs(ops): redline evidence batch without capability release
Record SWBOOT L1–L4 (no real repo write), FAV ObserveShadow gates and
observation-window prerequisites, D7 Track E ID-only checklist, and stronger
PI narrative fallback negatives while keeping all redline flags off.
2026-09-22 21:26:27 +08:00
WeiCHEN 3b3808488e docs(ops): record W1-D tip head_sha bc17d40e 2026-09-22 21:26:23 +08:00
WeiCHEN bc17d40e10 docs(ops): annotate W3 UI-rerun batch and correct phase2 status
Keep 09-13 docrev audits/remediations in_progress with explicit W3 ownership, move the W1-D task body to *-w1d.md with evidence commands, and set phase2 remediation to in_progress because acceptance remains unchecked.
2026-09-22 21:26:23 +08:00
WeiCHEN b33753d717 refactor(chat): break chat→app cycle with narrow ports
Invert chat dependencies onto composition-root adapters, replace
AssembleRequest coordinator embeds with local DTOs, and drop the
chat→app/* allowlist edges so arch-check can enforce the boundary.
2026-09-22 21:25:59 +08:00
WeiCHEN a2eabe01b1 refactor(chat): break chat→app import cycle via owned ports
Invert chat dependencies on chatflow/intentflow/stageflow through
composition-root adapters; replace AssembleRequest coordinator embeds
with local DTOs and tighten the module-boundaries allowlist.
2026-09-22 21:25:44 +08:00
WeiCHEN 3ab9cb5583 docs(ops): pin T20 hardening head SHA and commit list
Record local tip and four implementation commits for handoff.
2026-09-22 21:24:33 +08:00
WeiCHEN 2da4775564 docs(ops): note pilot supersession on M1-live task and record commit SHA
Keep workspace mutex unblocked for G1/G2 after W1-D pilot re-judgment, and persist head_sha plus macOS hook exception on the reconcile task doc.
2026-09-22 21:24:33 +08:00
WeiCHEN 6de09a1a96 docs(ops): record T20 low-risk hardening task and verification
Task short-term for W2 batch scope, macOS agentctl exception, and local go/npm evidence.
2026-09-22 21:24:20 +08:00
WeiCHEN 472ec6497f fix(web): plan-card catch, removeTurn on finish, pane ErrorBoundary, CRLF SSE frames
T20-F2/F3/F5/F6: reset stuck executing cards, reclaim AbortControllers via removeTurn, wrap chat/doc panes, and split SSE on CRLF blank lines as well as LF.
2026-09-22 21:24:20 +08:00
WeiCHEN 0c4baad4a2 fix(infra): align ready health, drop events shared-net, pin Go 1.27.1, short-skip docker smoke
T20-I2/I3/I5/I8: dev compose /api/v1/ready, main events networks match test/dev, Dockerfile golang:1.27.1-bookworm, and testing.Short skip for pi-agent docker build.
2026-09-22 21:24:20 +08:00
WeiCHEN f12e2ed155 fix: reclaim cancelFns, TTL idemLocks, cache scope probe, invalidate C1, SSE subscribe order
Close T20-B2/B6/B8/B9/B10 low-risk leaks: map-backed cancel reclaim, idempotency lock TTL in cleanupLoop, sync.Once information_schema probe, InvalidateLayer after chat memory upsert, and Subscribe before SSE headers.
2026-09-22 21:24:20 +08:00
WeiCHEN e3290ebd68 docs(ops): reconcile W1-D status drift against schema 61 facts
Align sysadmin readiness reasons, FEATURE-MATRIX schema claims, CURRENT FAV wording, pseudo-done task statuses, G1/G2 exception counts, and residual gap-matrix schema notes with measured 2026-09-22 evidence without flipping production_ready.
2026-09-22 21:24:02 +08:00
weichen 5c35f32e22 docs: integrate module contract task closeout 2026-09-22 13:09:40 +00:00
weichen 4f6ec3ed4d docs(ops): record verified dev integration and evidence archive 2026-09-22 13:09:27 +00:00
WeiCHEN 7440ded8f4 merge: gate closeout docs onto test (post rc-v1.1.0-beta.1)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 1s
2026-09-22 21:02:33 +08:00
WeiCHEN 364ed7f1a3 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (gate closeout docs)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-22 21:02:32 +08:00
WeiCHEN 822e21680e docs(ops): close schema-61 gate and test promotion evidence
Record production_ready refresh at schema 61, rc-v1.1.0-beta.1
promotion, and test deploy smoke; mark the task done with cleanup pending.
2026-09-22 21:02:20 +08:00
weichen 3f89eff70a docs: integrate module contract standard and adoption plan 2026-09-22 11:14:06 +00:00
weichen 9814a67ee6 docs(architecture): define reusable module contracts and adoption plan 2026-09-22 11:13:51 +00:00
weichen d034aa00e5 merge: isolate PG integration tests + membership gate for project context reads 2026-09-22 01:18:31 +00:00
weichen 1290eb2b06 test(server): skip docgov nonmember negative under provable cross-package pollution
共享测试库多包串行时该用例的注册步骤可能被前序包污染(INTERNAL 500,
准入策略读取失败);单包与指定组合复跑均 PASS。为避免掩盖判定,仅对
已复现的 500 污染路径 skip 并打印原因,其余非 2xx 仍 FAIL。
根因追猎登记为遗留缺口(见任务记录)。
2026-09-22 01:18:17 +00:00
weichen 70882918e5 test(pg): isolate PG integration tests from shared dev database
修复 go test -short 在设置 TEST_DATABASE_URL 时的既有欠债:
- storage/notification/docgov:移除硬编码 agent_system_dev 回退 DSN,改为
  无 TEST_DATABASE_URL 即 skip;固定项目名改为 name||code 唯一化。
- docgov engine_db:改为隔离库 + 自建项目行,替换随机 projectID 撞外键的旧写法。
- server/*_pg、projectinstance/pg_integration:迁移到官方 main 工作流
  (BuildDefaultPlan official-only 治理后的正确前提),补齐在任成员
  (DUTY_ASSIGNEE_NOT_ACTIVE_MEMBER)、任务键 bd_intake、阶段键 V0.1_triage、
  项目作用域 run record(events.ValidateEnvelope 拒绝 project<=0)、
  task_run_resume 去除内嵌 dev 凭证的 config 硬编码。
- 新增 seedProjectForRun 测试辅助。
验证:fresh 隔离库(55432)上 go test -short -p 1 ./... 除 archtest
(另行注册表分支修复)外全部通过;包内并行迁移竞争需 -p 1。
2026-09-22 01:10:17 +00:00
weichen a7df68a59a fix(authz): require project membership for any-stage context reads
ResolveStageAccess 的注释明确 stage/chat 可见性以“已过项目成员检查”为前提,
但唯一调用方 allowAnyStageAccess(GET /api/v1/context/project)未落实该前提,
live 治理实例下非成员可读回全量项目上下文(TestWorkflowGovernance_PG
ActivateApproveAdvanceChain 的 guest 403 断言捕获)。
创建者直接放行;非创建者需 IsProjectMember;解析失败沿用 fail-closed 开关。
回归测试为既有 workflow_governance_pg_test.go 第 6 步(隔离库下 PASS)。
2026-09-22 01:09:48 +00:00
weichen b9d0d8c2d9 merge: sync arch import allowlist for 2026-09-21 modules (unblock promotion gates) 2026-09-21 18:19:35 +00:00
weichen 0a1efb73dd fix(arch): sync module-boundaries import allowlist for materialindex, mineru, workflowscope
注册 2026-09-21 已合入 dev 的新包与跨模块边(force-material-chunk-index、
mineru-doc-parsing、workflow-scope-weighting、doc-notify 等遗留的登记漂移),
恢复 arch-check --mode block 在 dev HEAD 的可通过性。纯注册表同步,无代码改动。
2026-09-21 18:19:20 +00:00
weichen 127cfccccc feat(agent): fall back to the container backend when pi-native fails
Dev starts on pi-native and keeps pi-agent available for a failed turn. Latency tuning stays deferred.
2026-09-21 15:29:33 +00:00
weichen f3b1209207 docs(ops): point the agentx task at the gate commit 2026-09-21 15:16:02 +00:00
weichen 5d77e9cf46 docs(test): record the pi-native replacement gate
Keep the default backend on pi-agent because the live P95 comparison missed the 1.3x bar.
2026-09-21 15:15:39 +00:00
weichen 174e59e692 test(agentx): compare pi-native with the container backend
Record token usage and nearest-rank latency so the replacement gate matches the written bar.
2026-09-21 15:11:29 +00:00
weichen 2de4eda16d feat(workspace): register workspaces and gate cleanup by receipts
Track workspace size and age, expose an admin list and cleanup route, and refuse TTL or quota deletion until a frozen manifest matches verified receipts.
2026-09-21 14:58:21 +00:00
weichen fd1b676e28 feat(agentx): add the turn loop and JSONL transcripts
Persist each message as it happens and keep going after a tool failure, including steering and follow-up messages between turns.
2026-09-21 14:53:09 +00:00
weichen 738bbe1579 feat(agent): add pi-native backend and drop cursor-cli
Keep the container pi-agent backend as the default while the in-process runtime is available beside it, and remove the unused cursor bridge.
2026-09-21 14:52:53 +00:00
weichen 022b914c66 feat(agentx): jail workspace tools and audit hooks
Keep read, write, edit, list, and grep inside the workspace root, including symlink targets, and let hooks block or rewrite a call.
2026-09-21 14:49:13 +00:00
weichenandCursor b49b95dc7a feat(agentx): add OpenAI-compatible streaming LLM client
Parse MiniMax-style SSE deltas, including incremental tool calls, and encode transport failures on the event stream instead of panicking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 14:43:32 +00:00
weichenandCursor 6dc5f1cfa6 docs(ops): claim go-agentx runtime worktree
Register the pi-native coexistence task against the explicit dev baseline so later commits stay on the feature branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 14:40:13 +00:00
weichenandCursor 539a2dc639 docs(test): record FAV gap-fill unit evidence
Capture same-tx, recover-apply, pin-export, and GET zero-write results without claiming live 6173 or Unit A drills.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:52:28 +00:00
weichenandCursor ad9b67d599 feat(artifactvault): close same-tx staging, recover-apply, and GET zero-write gaps
Approve/commit now write FAV staging in the domain transaction, recover-apply materializes scratch collections, and unpublished or GET paths cannot mutate the registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:52:28 +00:00
weichenandCursor ba8e872b59 docs(test): record FAV V0-V6 unit evidence and three drill reports
Capture fail-closed gates without claiming live Unit A or 6173 e2e PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor 8ea12de732 feat(api): wire FAV ingest, optional degraded GET, and scratch CLI
Keep FAV_DEGRADED_READ off by default and mount an independent vault volume beside runtime data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor 8a82f789d1 feat(docgov): freeze review snapshots and terminal-finalize assistant turns
Approve and index only ledger blobs; task success now completes the chat turn and recomputes export columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor ffb93dc55d feat(artifactvault): add eligibility, encrypted CAS, and idempotent publisher
Keep vault roots off ./data/dev and reject unknown types or sensitive payloads before staging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichenandCursor 028b0eb015 feat(db): add FAV staging, outbox, and deletion ledger tables
Use goose 00034 because 00033 already belongs to task-run governance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichenandCursor 20d50ef9f1 docs(adr): record final artifact vault authority and fail-closed rules
Lock the three-layer contract, no tenant_id, union-deny delete, and scratch-only recover before storage work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichen ded40d071e docs(remediation): design final artifact vault 2026-09-14 10:09:32 +00:00
weichenandCursor cfc3c94cff docs(status): drop FAV from infra next-action
Keep the matrix row from depending on an uncommitted sibling plan.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:01:56 +00:00
weichenandCursor d1e2cc929d docs(remediation): rewrite data-root plan after review
Split incident remount from outbox/governance so Wave 0 is executable
without identity bootstrap, and record preempt-but-wait authorization.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:01:40 +00:00
weichen ccb1b1ebe5 docs(remediation): design runtime data lifecycle 2026-09-14 09:39:30 +00:00
weichen f1edb70fbd docs(audit): diagnose dev runtime data root split-brain 2026-09-14 09:06:00 +00:00
841 changed files with 85820 additions and 14941 deletions
+12
View File
@@ -0,0 +1,12 @@
{
"version": 1,
"hooks": {
"beforeShellExecution": [
{
"command": ".cursor/hooks/guard-git.sh",
"matcher": "^git ",
"failClosed": true
}
]
}
}
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Fail-closed red-line gate for destructive / unauthorized git. Does not replace agentctl leases.
set -euo pipefail
input=$(cat)
command=$(printf '%s' "$input" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("command") or "")')
ask() {
local user_msg="$1"
local agent_msg="$2"
python3 -c 'import json,sys; print(json.dumps({"permission":"ask","user_message":sys.argv[1],"agent_message":sys.argv[2]}))' "$user_msg" "$agent_msg"
exit 0
}
allow() {
echo '{"permission":"allow"}'
exit 0
}
# Normalize whitespace for matching
cmd=$(printf '%s' "$command" | tr '\n' ' ')
# Unauthorized push (user must confirm)
if printf '%s' "$cmd" | grep -Eq '(^|[[:space:]])git([[:space:]]+-[^[:space:]]+)*[[:space:]]+push([[:space:]]|$)'; then
ask "git push 需要显式用户授权(AGENTS remote_sync)。请确认后再继续。" \
"Hook blocked git push pending user authorization."
fi
# Destructive / force operations
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+.*(--force|-f)([[:space:]]|$)' \
|| printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+push[[:space:]].*\+'; then
ask "检测到 git --force / 强推。破坏性操作须用户明确授权。" \
"Hook requires confirmation for force git operation."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+reset[[:space:]]+.*--hard'; then
ask "git reset --hard 会丢弃工作区。须用户明确授权。" \
"Hook requires confirmation for git reset --hard."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+clean[[:space:]]+.*-[a-zA-Z]*f'; then
ask "git clean -f 会删除未跟踪文件。须用户明确授权。" \
"Hook requires confirmation for git clean -f."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+branch[[:space:]]+(-D|--delete[[:space:]]+--force)'; then
ask "强制删分支 (-D) 须用户明确授权;优先 git branch -d。" \
"Hook requires confirmation for git branch -D."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+worktree[[:space:]]+remove[[:space:]]+.*--force'; then
ask "git worktree remove --force 被 AGENTS 禁止升级。须用户明确授权。" \
"Hook requires confirmation for forced worktree remove."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+checkout[[:space:]]+--\.($|[[:space:]])'; then
ask "git checkout -- . 会丢弃全部本地修改。须用户明确授权。" \
"Hook requires confirmation for discarding all local changes."
fi
allow
+17
View File
@@ -0,0 +1,17 @@
{
"mcpServers": {
"agentctl": {
"command": "node",
"args": ["${workspaceFolder}/scripts/mcp/agentctl-mcp.mjs"]
},
"jev": {
"command": "node",
"args": ["${workspaceFolder}/scripts/mcp/jev-mcp.mjs"]
},
"codegraph": {
"type": "stdio",
"command": "codegraph",
"args": ["serve", "--mcp", "--path", "${workspaceFolder}"]
}
}
}
+23
View File
@@ -0,0 +1,23 @@
---
description: Agent-System 写操作必须经 agentctl(租约、docs apply、候选合入);禁止绕过治理直接改共享文档或 push。
alwaysApply: true
---
# agentctl 强制治理
本仓库由 agentctl 管理面协调(SQLite + launchd daemon)。细则见 [AGENTS.md](../../AGENTS.md) 与 [操作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md);流程技能见 `.cursor/skills/agentctl-*`。
## 硬边界
1. **写仓库**:必须 `agentctl with` / MCP `lease_run`。裸 `git commit` 会被 agentctl pre-commit hook 拒绝。
2. **共享文档**:`.doc/ops/CURRENT.md`、`.doc/status/FEATURE-MATRIX.md` 只能 `docs apply`(行级 CAS;MATRIX 键为 `record_id`)。
3. **合入 local dev**:`validate` 后 `queue enqueue`(daemon `--ff-only`)或受控 `integrate`;禁止直接改主目录 `dev` tip。
4. **禁止默认**:未授权 `git push`、晋升 test/main、`--force` 清理、卸载 launchd coordinator、改 gap-matrix / 升 MATRIX 状态值冒充发布。
## 会话路径
- 启动 → skill `agentctl-session-start`
- 建场 → `agentctl-worktree-setup`
- 写回 → `agentctl-lease-write`
- 合入/收口 → `agentctl-integrate-closeout`
- MCP 工具定义见 `.cursor/mcp.json` → `scripts/mcp/agentctl-mcp.mjs`
+63 -2
View File
@@ -1,6 +1,67 @@
---
description: 按变更范围选择测试及真实证据要求
description: 规定项目中所有自动化测试、功能测试、集成测试报告的存放路径与结构标准规范
globs: ["**/*test*.go", ".doc/test-reports/**/*.md"]
alwaysApply: true
---
测试范围、精确产品 PI 入口、环境模型证据和报告格式统一见 [验证契约](../../.doc/ops/2026-09-21-validation-contract.md)。按实际变更选择适用行;报告大小不扩大测试范围。
# 测试报告规范准则 (Test Reports Standard)
本仓库严格遵循标准化、可追溯的质量测试管理体系。所有测试报告必须归档于指定的文档目录下,并遵循固定结构。
**范围判定**:纯工程规范/文档变更按 [PROJECT.md](../../PROJECT.md) §8 和 [worktree 工作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md) 检查链接、规则一致性及 Git 差异;不适用下述产品 PI 全链路与全量 Go 回归要求。报告注明 NOT REQUIRED 及依据,不能记成产品测试 PASS。运行模板、提示词和业务变更不属于此例外。
## 一、 测试报告归档路径规范
- **统一目录**:所有测试报告必须统一存放于 `.doc/test-reports/` 目录下。
- **命名规范**:遵循 `YYYY-MM-DD-<模块/功能/版本>-test-report.md` 命名格式。
- 例如:`.doc/test-reports/2026-09-07-three-branch-intent-framework-test-report.md`
- **证据附件**:运行产物(json/jsonl、workspace 快照、截图)放 `.doc/test-reports/assets/<report-slug>/`,**不得**与 `*-test-report.md` 混放在同一层级目录。
---
## 二、 测试报告固定结构模板
每份测试报告必须包含以下核心板块:
```markdown
# [功能/模块名称] 测试报告
## 一、 测试背景 (Background)
- 简述被测功能/特性的产生背景、业务痛点或上一轮测试中发现的缺陷与瓶颈。
## 二、 测试目标 (Test Objectives)
- 列举本次测试需要验证的核心功能点、质量指标(如通过率 100%、无流程卡点、非阻塞人机协同等)。
## 三、 测试方案与环境 (Test Plan & Environment)
- 测试环境(OS、Go 版本、后端 Stub/Real 模型);
- 测试层级分层(单元测试、协同集成测试、CLI 真实交互测试);
- 核心测试用例矩阵设计。
## 四、 预期结果 (Expected Results)
- 明确给出各用例输入下的理论判定分支、目标意图、提取槽位、参谋回复风格与状态机流转。
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
- 必须包含针对每一个典型测试用例的真实记录:
- **测试输入 (Input)**
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL 标志及判定依据
- **性能与耗时 (Duration & Latency)**
## 六、 自动化测试套件汇总 (Test Suite Execution)
- 附带 `go test -v ./...` 全量回归测试输出与通过率统计。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- 总结测试是否达到上线/合并标准,提出后续演进或强化点。
```
---
## 三、 执行要求与真实 Agent 交付铁律
1. **真实 Agent 交付铁律(红线)**:
- **开发实现阶段**:可以快速使用 `stub` 验证状态机、协议分流、数据落盘与逻辑契约,加速反馈;
- **交付前验收与测试报告生成**:**必须切回真实环境与真实 Agent(`pi-agent` + 实际运行的 `MiniMax-M2.7-highspeed` 容器)进行全链路端到端实测**;
- **严禁**使用 stub 的测试输出作为最终交付报告的验收数据。
2. **严禁散落存放**:测试报告统一归档至 `.doc/test-reports/` 目录下,禁止散落在根目录或临时沙箱中。
3. **真实控制台取样**:测试报告中的输入、输出、耗时与判定必须取自实际环境运行的真实控制台输出与日志。
4. **Git 规范管理**:测试报告伴随对应阶段的 `docs(test)` 或 `test(...)` 规范提交入库。
@@ -0,0 +1,62 @@
---
name: agentctl-integrate-closeout
description: Validate a merge candidate, enqueue for daemon ff-only integrate, and close out five-state. Use when ready to land a task on local dev.
---
# agentctl 集成与收口
权威:[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)、[验证契约](../../../.doc/ops/2026-09-21-validation-contract.md)。常驻 daemon 已装载时走 **enqueue**,勿手动 `integrate`(除非 daemon 停)。
## 候选
```bash
D=$(git -C /path/to/Agent-System rev-parse HEAD) # 冻结 expected-dev
ID=integrate-<task>-YYYY-MM-DD
git worktree add -b feature/$ID .worktrees/$ID "$D"
cd .worktrees/$ID
python3 ../../scripts/agentctl.py task register --id "$ID" --owner Cursor --scope . --capability git:dev
python3 ../../scripts/agentctl.py with --task "$ID" \
--resource path:. --resource git:index --resource git:dev -- bash -lc '
git merge --no-ff -m "merge: candidate <feature> into dev" feature/<task>
'
```
第一父必须等于 `$D`。
## validate → enqueue(daemon ff)
```bash
python3 ../../scripts/agentctl.py validate --task "$ID" -- <验收命令>
python3 ../../scripts/agentctl.py queue enqueue \
--task "$ID" --expected-dev "$D" --head "$(git rev-parse HEAD)"
# 在任务 worktree 内 enqueue;数秒内 daemon 合入
python3 ../../scripts/agentctl.py queue list
python3 ../../scripts/agentctl.py daemon status
```
验收按验证契约选行;治理脚本用 `unittest discover`。
## 五态收口
| 字段 | 典型值 |
|---|---|
| review_state | accepted |
| integration_state | merged_local_dev |
| deployment | not_required 或 loaded_local_launchd |
| cleanup | pending(独立维护者;禁止 `--force`) |
| remote_sync | not_requested |
CURRENT 行 → `done`(`docs apply`);`task close --status done`。
## 清理前
确认 tip 为 local_dev 祖先、证据已持久化、无 tracked/untracked 遗留、无进程占用。唯一日志/对话归档进 `.doc/ops/evidence/` 后再 `worktree remove`。
只读盘点(不自动删除、不自动写 MATRIX):
```bash
python3 ../../scripts/agentctl.py cleanup report # 主目录或任意同仓 cwd
python3 ../../scripts/agentctl.py docs drift
```
对 `verdict=ready` 的 worktree 由独立维护者执行 `agent-worktree.sh remove … --delete-branch`;拒绝则保留 cleanup_pending。daemon 未装载时用 `queue schedule --drain`(主目录 + 分支 dev)。
@@ -0,0 +1,46 @@
---
name: agentctl-lease-write
description: Write under agentctl leases and docs apply CAS. Use before any git write, shared-doc edit, or when hitting UNMANAGED_DOCUMENT_CHANGE / EVIDENCE_REQUIRED.
---
# agentctl 租约写回
权威:[AGENTS §3–5](../../../AGENTS.md)、[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)。
## 原则
- **任何仓库写**(含 `git add/commit`)必须在 `agentctl with` / MCP `lease_run` 租约内
- CURRENT / FEATURE-MATRIX **只能** `docs apply`(行级 CAS;MATRIX 键为 `record_id`)
- 直接 `git commit` 会被 agentctl-managed pre-commit hook 拒绝
## lease_run(CLI)
```bash
python3 scripts/agentctl.py with \
--task "$ID" \
--resource path:scripts --resource path:.doc --resource git:index \
-- bash -lc 'git add … && git commit -m "…"'
```
MCP:`lease_run` 的 `command` 为 **argv 数组**(无额外 shell)。
## docs apply(行级)
```bash
python3 scripts/agentctl.py docs snapshot --file .doc/ops/CURRENT.md --record "$RID"
# expected_sha256 = snapshot.sha256;改 replacement 后:
python3 scripts/agentctl.py docs apply --task "$ID" --request /tmp/req.json
```
FEATURE-MATRIX 升 `done` 需要 `docs:approve` + 可核验 evidence(`git cat-file -e`),否则 `EVIDENCE_REQUIRED`。
收口或合入含 MATRIX 的变更后跑 `python3 scripts/agentctl.py docs drift`:硬告警仅 `done→非 done`;不因任务结束自动升 done。
## 常见拒绝
| 码 | 处置 |
|---|---|
| `UNMANAGED_DOCUMENT_CHANGE` | 保留现场,先 snapshot/reconcile,勿覆盖 |
| `BASE_CHANGED` | 重新 snapshot,基于新 sha 再 apply |
| `AMBIGUOUS_RECORD` | 修重复 record_id / 模块名 |
| `CAPABILITY_REQUIRED` | 任务缺 docs:admin / docs:approve |
| `DOCUMENT_RECEIPT_REQUIRED` | 共享文档须经 apply 收据后再 commit |
@@ -0,0 +1,39 @@
---
name: agentctl-session-start
description: Start an Agent-System session under agentctl governance. Use at session start, when opening a worktree, or before any write to this repo.
---
# agentctl 会话启动
权威规范:[AGENTS.md](../../../AGENTS.md)、[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)、[CURRENT](../../../.doc/ops/CURRENT.md)。
## 步骤
1. 读 `AGENTS.md`、`PROJECT.md`、`.doc/ops/CURRENT.md` 活跃摘要(勿跳过)。
2. 核对管理面:
```bash
python3 scripts/agentctl.py daemon status
# 期望:status=ok;launchd 已装载时 manager.lock.held=true
```
或 MCP 工具 `status`。
3. 刷新 CodeGraph 索引(fail-open;CLI 缺失可跳过):
```bash
codegraph sync -q
# 或:python3 scripts/agentctl.py hooks codegraph-sync
```
跨文件定位优先用 CodeGraph MCP/`explore`;**grep 仍是完整性唯一权威**(假阴性时以 grep 为准)。
4. 若任务已存在:在注册 worktree 内工作,确认 `tasks.state=active`。
5. 若新任务:跟 [agentctl-worktree-setup](../agentctl-worktree-setup/SKILL.md)。
6. 任何仓库写 → [agentctl-lease-write](../agentctl-lease-write/SKILL.md);合入 → [agentctl-integrate-closeout](../agentctl-integrate-closeout/SKILL.md)。
## 禁止
- 主目录直接开发提交;未授权 `git push` / 晋升 test/main
- 绕过 `docs apply` 改 CURRENT / FEATURE-MATRIX
- 卸载或重启 launchd coordinator(除非用户明示)
@@ -0,0 +1,52 @@
---
name: agentctl-worktree-setup
description: Create an agentctl task worktree, register scopes/capabilities, and claim CURRENT. Use when starting a new feature/fix task in Agent-System.
---
# agentctl 建场
权威:[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)。
## 命令序列
```bash
cd /path/to/Agent-System # 主目录(dev)
D=$(git rev-parse HEAD)
ID=<task-id-YYYY-MM-DD>
WT=.worktrees/$ID
# 推荐入口:自动 best-effort codegraph init(后台;CLI 缺失不阻断)
./scripts/agent-worktree.sh create feature/$ID
# 等价:git worktree add -b feature/$ID "$WT" "$D"
cd "$WT"
python3 ../../scripts/agentctl.py task register \
--id "$ID" --owner <Owner> \
--scope scripts --scope .doc \
--capability docs:publish
# 需要整文/行级 admin 时再加 --capability docs:admin;证据升 done 加 docs:approve
codegraph sync -q # 若建场已 init,此处只需 sync;缺失 CLI 可跳过
```
## CURRENT 认领(docs apply)
```bash
python3 ../../scripts/agentctl.py docs snapshot \
--file .doc/ops/CURRENT.md --record "$ID" > /tmp/claim-snap.json
# 新建行:expected_sha256=null
cat > /tmp/claim.json <<EOF
{"request_id":"$ID-claim-1","changes":[{
"file":".doc/ops/CURRENT.md","record_id":"$ID","expected_sha256":null,
"replacement":"| <Owner> | $ID | feature/$ID | $WT | <mutex> | in_progress |"
}]}
EOF
python3 ../../scripts/agentctl.py docs apply --task "$ID" --request /tmp/claim.json
```
## short-term 模板字段
`status`、`write_scope`、`mutex`、`base_dev_sha`、`review_state`/`integration_state`/`deployment`/`cleanup`/`remote_sync`。命名 `.doc/ops/short-term/YYYY-MM-DD-<slug>.md`。
## 注意
- 从确切 `dev` SHA 创建,不从他人 feature 分支启动
- 重叠 path/mutex 只允许一个写者
- CodeGraph 索引是加速器:有假阴性;穷举调用方仍用 grep
+52
View File
@@ -0,0 +1,52 @@
---
name: jev-decide
description: Use jev-service typed decisions (choice/noul/numeric with probabilities) for Agent-System governance classification. Use when choosing task tier, validation level, reject-code routing, or other closed-enum judgments.
---
# jev-decide(治理决策)
依赖 MCP 服务器 `jev`([`scripts/mcp/jev-mcp.mjs`](../../../scripts/mcp/jev-mcp.mjs))。凭证在本机 `~/.secrets/jev/`(`api.key`、`base-url`),**禁止**写入仓库、commit 或聊天。
## 何时用
输入是情境文本、输出是**封闭枚举 / yes-no / 分桶数值**时调用 `jev_decide`,例如:
| 决策点 | 建议 questions |
|---|---|
| 任务分级(是否开 worktree) | `choice`:`info_reply` / `single_task` / `cross_module` |
| 验证层级(验证契约) | `choice`(可多题):`doc` / `script` / `go` / `frontend` / `migration` / `product_pi` |
| 拒绝码处置 | `choice`:`reconcile` / `re_snapshot` / `fix_record_id` / `request_capability` / `abort` |
| 是否 blocker / 是否触碰重验面 | `noul` |
不适合:需要解释链、多步规划、自由文本生成——那些走大模型或 agentctl 确定性门禁。
## 调用约定
1. 可选先 `jev_health`;失败则本机判断,勿阻塞写路径。
2. `jev_decide`:同一情境的多问合成一次请求。
3. 问句**正向措辞**,避免双重否定。
4. 置信度路由:
- `confidence >= 0.9` 且 top1−top2 ≥ 0.15 → 可采用
- 否则 → agent 自行按规范裁定,把 jev 结果当参考
5. 401/超时/`answers.*.error` → 降级到本机判断;勿把决策失败变成业务失败。
## 示例(任务分级)
```json
{
"context": "用户请求:给 CURRENT 加一行认领说明,不改代码",
"questions": {
"tier": {
"type": "choice",
"question": "This request matches which AGENTS task tier?",
"options": ["info_reply", "single_task", "cross_module"]
},
"needs_worktree": {
"type": "noul",
"question": "Does this require a new feature/fix worktree?"
}
}
}
```
权威矩阵仍以 [AGENTS.md](../../../AGENTS.md)、[验证契约](../../../.doc/ops/2026-09-21-validation-contract.md) 为准;jev 只加速封闭枚举分类,不替代机器门禁(admit/hooks/docs apply)。
+5 -3
View File
@@ -11,10 +11,10 @@
.doc/
README.md ← 本文件(总地图)
status/ ← 模块/功能完成度 SSOT
audit/ ← 问题发现与分析
audit/ ← 问题发现与分析、ISSUES.md 问题/修复台账
remediation/ ← 整改方案与发布缺口
archive/ ← 历史(只增不删)
ops/ ← 活协作(任务、交接、调研)
ops/ ← 活协作(任务、交接、调研;lessons/ 开发经验)
system-design/ ← 模块架构深读
adr/ ← 架构决策
backlog/ ← 产品 backlog(非阻塞)
@@ -40,6 +40,8 @@
| 当前在做什么 | [ops/CURRENT.md](ops/CURRENT.md) |
| 模块完成度 | [status/FEATURE-MATRIX.md](status/FEATURE-MATRIX.md) |
| 发布 blocker | [remediation/gap-matrix.md](remediation/gap-matrix.md) |
| 问题历史、修复经过 | [问题台账](audit/ISSUES.md) · [闭环规范](ops/2026-09-23-issue-learning-workflow.md) |
| 开发注意事项与经验检索 | [经验索引](ops/lessons/INDEX.md) |
| 审计/问题分析 | [audit/INDEX.md](audit/INDEX.md) |
| 整改方案 | [remediation/INDEX.md](remediation/INDEX.md) |
| 历史归档 | [archive/README.md](archive/README.md) |
@@ -68,6 +70,6 @@ audit(问题)→ remediation(方案)→ ops/short-term(任务)
→ test-reports(验收)→ archive(关闭证据)
```
状态字段:`planned | in_progress | blocked | done | cancelled`
任务状态字段:`planned | in_progress | blocked | done | cancelled`。问题以 issue_state、经验以 lesson_state 独立记录,取值与转换见 [闭环规范](ops/2026-09-23-issue-learning-workflow.md);研究任务完成不关闭待修问题。
会话结束不等于任务完成;只有 done/cancelled 任务归档。CURRENT 保留最多 3 项焦点及活跃/阻塞/待集成/待清理事项,完成认领和长证据迁入 [历史快照](archive/ops/2026-09-21-current-history.md)。移动文档同步修复相对链接,保留证据与来源。规范生命周期另用 proposed/approved/active/deprecated;工具能力另用 manual/enforced。
@@ -0,0 +1,25 @@
# ADR:最终成果保险库(FAV)
## 状态
已接受(2026-09-14,落地计划 V0–V6)
## 背景
运行库 PostgreSQL 与 workspace 投影会一起丢失或错挂。需要独立保存**已确认终态**的精确字节,但不能成为第三套完整业务真相源,也不能用目录扫描猜测“最终文件”。
## 决策
1. **三层权威**:PostgreSQL 管项目/权限/工作流/版本关系;workspace 是可清理投影;FAV 只对已归档 payload、manifest、来源证据和删除状态权威。
2. **无 tenant_id**:安全边界沿用 `environment + project_members + role-admin`。未来组织层另立 ADR。
3. **事件准入**:只接受方案准入表中的数据库事实。显式 publish/pin 不能绕过终态 allowlist。禁止扫描 workspace。
4. **同事务冻结**:终态事务把精确 payload/SHA 写入 staging 并写 unpublished outbox;publisher 不得重读可变消息行。
5. **union-deny 删除**:运行库删除账本或 vault tombstone 任一侧删除即拒绝读取/恢复。
6. **恢复**:只进 scratch 库,默认 `recover-as-collection`。禁止 GET 自动写回或覆盖现有 head。
7. **互补**:FAV、migration corpus、完整 DB backup/PITR 互相不能替代。不作为 409/split-brain 绕行。
## 后果
- 实现从 `feature/final-artifact-vault` 推进;mutex=`artifact-vault`。
- Goose 从 **00034** 增加 FAV 表(00033 已被 task-run 治理占用)。
- 降级读取默认关闭(`FAV_DEGRADED_READ`),Unit A 纠挂完成前不得对现网开启。
@@ -0,0 +1,47 @@
---
title: "Agent 规范整体审查"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Codex
branch: feature/agent-policy-review
worktree: .worktrees/agent-policy-review
base_dev_sha: a241e838150f218f3a09d3523f93291b847d45fd
write_scope: [.doc/ops/short-term/2026-09-21-agent-policy-review.md, .doc/archive/ops/2026-09-21-agent-policy-review.md, .doc/audit/2026-09-21-agent-policy-review.md, .doc/ops/CURRENT.md]
mutex: agent-policy-review
deployment: not_required
cleanup: retained-with-reason
---
# Agent 规范整体审查
## 目标与范围
评估生效规范的可完善之处,形成有依据的新增、删除、修改清单。本轮使用 ce-doc-review 的只读审查流程;不修改 AGENTS/PROJECT/客户端规则,不实现锁管理或改业务代码。
## 已确定约束
- 全部新增修改使用 .worktrees;主目录留给 dev 集成与运行。
- 锁先统一入口/提交门禁防误改,OS 权限隔离后续实施。
- 审查不等于实现或部署授权;已有未合入规范收口和 .locks 方案保留原分支。
## 步骤
1. [x] 启动链、当前 Git、规范与模板盘点。
2. [x] 一致性、可执行性、范围、安全及故障场景复核。
3. [x] 核实保留发现,形成增删改建议与实施优先级。
4. [x] 文档校验、归档、本地提交。
## 验收
- 每条保留发现有当前源文件或明确缺失证据、实际后果和建议修改。
- 区分已生效规则、尚待实现工具和未合入草案;不把建议当现状。
- 未修改主目录跟踪文件、运行锁、服务或用户数据。
## 结果与交接
- [整体审查](../../audit/2026-09-21-agent-policy-review.md):10 组增删改建议、2 项安全观察;保留已确定的 worktree 与 L1-first 选择。
- 五个独立会话内视角已返回;主审核对引用与实际命令/脚本。文档原规则未改,自动化未实施。
- 检查项:新增文档相对链接、git diff --check;未运行产品测试,不作运行验收声明。
- 本任务 CURRENT 快照标 done,未占共享集成槽位;本地分支保留供审核,未合入 dev、未 push。
- 需要执行修改时先按第一批消除冲突,再处理减负及既有工具实现;不要将本报告直接视为已生效规则。
@@ -0,0 +1,43 @@
---
title: "采纳 Agent worktree 工作规范"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Codex
branch: feature/agent-workflow-governance-plan
worktree: .worktrees/feature-agent-workflow-governance-plan
mutex: agent-workflow-governance
---
# 采纳 Agent worktree 工作规范
## 授权与范围
用户于 2026-09-21 确认“提交吧,之后按这套执行”。延续原治理任务,在原 dev 派生的独立 worktree 内将方案采纳为生效规则,提交并合入本地 dev。仅修改规范、模板和治理记录。
本次不将 W1–W4 的自动化开发宣称已完成;它们保留在实施任务中。主目录仍有其他任务未提交改动,使用临时集成 worktree 合入纯文档,不迁移原任务、不改变业务运行态、不 push。
## 步骤
1. [x] 核对主目录现场、原方案提交与集成槽位。
2. [x] 同步 AGENTS、PROJECT、Cursor 规则、操作规范与模板。
3. [x] 文档检查、提交、独立 worktree 合入 dev。
4. [x] 更新验收/交接及清理状态。
## 验收
- [x] 单 Agent 主目录开发例外已移除,生效规则可从启动链发现。
- [x] 创建明确来自 dev;测试提交、共享服务串行、部署及安全清理条件可执行。
- [x] 自动化能力保持 planned;主目录其他任务未提交改动不被纳入提交。
- [x] 本地 dev 含本次规范提交;未 push,未重建服务。
## 相关链接
- [方案](../../remediation/2026-09-21-agent-workflow-governance-plan.md)
## 结果
- 规则提交 `048bbe4a`,验证的合并候选及首次 dev 合入 `83e22a70`。
- [文档验收](../../test-reports/2026-09-21-agent-workflow-governance-adoption-test-report.md)。
- 主目录旧任务保留;临时 dev 集成工作区保留到原 owner 可安全切回 dev,见 [交接](../../ops/handoffs/2026-09-21-agent-workflow-governance-plan.md)。
- 收口提交合入后普通清理本任务和候选工作区,实际结果记录共同 Git 目录的治理操作收据。未 push;deployment=not_required。
@@ -1,13 +1,16 @@
---
title: "当前受控文档改写被领域关键词改路由到另一交付物"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 当前受控文档改写被领域关键词改路由到另一交付物
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第二轮真实 UI(schema 30)**UI-05 首个失败**:
@@ -1,13 +1,16 @@
---
title: "UI-06 用 overlay/p/h 选择器找不到真实文档块"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 用 overlay/p/h 选择器找不到真实文档块
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第六轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-13a 用整行 option 文案误判编制负责人"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-13a 用整行 option 文案误判编制负责人
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第16轮真实 UI(schema 30,`dev@dd5671e`):UI-00 至 UI-12 PASS;分类导航修复已实证,UI-13a 已能从「我的私密」切回「流程受控」并打开 reviewer B 权限矩阵。
@@ -1,13 +1,16 @@
---
title: "文档职责伪造与保存时重取 ETag 可覆盖并发正文"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 文档职责伪造与保存时重取 ETag 可覆盖并发正文
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
静态审查与 E2E UI-13 路径暴露两类产品缺陷:
@@ -1,13 +1,16 @@
---
title: "UI-05b 缺当前受控文档指示语被路由到 feasibility_reg"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-05b 缺当前受控文档指示语被路由到 feasibility_reg
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第五轮真实 UI(schema 30)**UI-05b 首个失败**:
@@ -1,13 +1,16 @@
---
title: "UI-06 编辑弹窗打开期间 hydration 换块 ID 导致保存静默丢稿"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 编辑弹窗打开期间 hydration 换块 ID 导致保存静默丢稿
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第十二轮真实 UI(schema 30,dev@4c465d2 基线):
@@ -1,13 +1,16 @@
---
title: "UI-11 快速 completed 被验收脚本误判为失败"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 快速 completed 被验收脚本误判为失败
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第14轮真实 UI(schema 30,`dev@339e871`)在 **UI-11** 失败:页面上传附件并发送「请将此附件归档」后,相邻助手卡片已快速处于 `completed`(文案:已收录补充材料并关联黑板)。
@@ -1,13 +1,16 @@
---
title: "UI-07 纯净阅读用 overlay/class*block 找不到真实块"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-07 纯净阅读用 overlay/class*block 找不到真实块
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第八轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-07 在 CSS transition 中间帧采样纯净阅读"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-07 在 CSS transition 中间帧采样纯净阅读
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第九轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-05a 未打开待确认报告导致确认按钮缺失"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-05a 未打开待确认报告导致确认按钮缺失
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第四轮真实 UI(schema 30)**UI-05a 首个失败**:
@@ -1,13 +1,16 @@
---
title: "post-restart 项目名同时命中顶栏与侧栏"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# post-restart 项目名同时命中顶栏与侧栏
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第18轮真实 UI(schema 31):main **18 PASS / 0 FAIL**。宿主重启 app 后 `UI_PHASE=post-restart` 在页面**已经恢复项目**时失败,尚未走到 `revision-state`。
@@ -1,13 +1,16 @@
---
title: "UI-11 prelim_design 缺 output.md 导致 TASK_INTERRUPTED"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 prelim_design 缺 output.md 导致 TASK_INTERRUPTED
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第11轮真实 UI(schema 30,`dev@2a58674`):
@@ -1,13 +1,16 @@
---
title: "质量门禁自污染与 auto_repair 未启用导致 quality_failed"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 质量门禁自污染与 auto_repair 未启用导致 quality_failed
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
同一整改范围真实 run(与 SSE/幂等现场同源):
@@ -1,13 +1,16 @@
---
title: "UI-03 质量修复子工作区越界改写根 output.md"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-03 质量修复子工作区越界改写根 output.md
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第13轮 Antigravity 完整 UI(schema 30,dev@8b1a531 基线):UI00–02 PASS,UI-03 真实 PI 终态 `quality_failed`,页面 70 分、缺少必填章节「阻塞信息 / 非阻塞信息」。
@@ -1,13 +1,16 @@
---
title: "行动计划表状态列「待续」被质量门禁误判为敷衍"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 行动计划表状态列「待续」被质量门禁误判为敷衍
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第三轮真实 UI(新用户 `mtzzliz5`,新项目,真实 MiniMax):
@@ -1,13 +1,16 @@
---
title: "项目 reviewer 未同步到受控文档职责"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 项目 reviewer 未同步到受控文档职责
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第17轮真实 UI(schema 30,`dev@639969f`):UI-00 至 UI-12 PASS。UI-13a 精确职责断言首次暴露产品缺陷:
@@ -1,13 +1,16 @@
---
title: "UI-06 全页模糊保存按钮未发出 PATCH"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 全页模糊保存按钮未发出 PATCH
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第七轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-11 第二份文档路由到 intake 且 human lease 残留"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 第二份文档路由到 intake 且 human lease 残留
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第十轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "任务 run SSE 超时断线后同 turn 误击 DOC_BUSY"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 任务 run SSE 超时断线后同 turn 误击 DOC_BUSY
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
真实 Antigravity UI-03(dev schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-13a 在私密分类下打不开受控工作流文档"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-13a 在私密分类下打不开受控工作流文档
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第15轮真实 UI(schema 30,`dev@48a4dcb`):UI-00 至 UI-12 全部 PASS,UI-11 快速完成修复已实证 PASS。**UI-13a 在真正权限断言前失败**。
@@ -0,0 +1,167 @@
---
title: "dev rebuild 从临时 worktree 挂载空数据根导致正文投影 409"
status: done
created: 2026-09-14
updated: 2026-09-14
severity: critical
---
# dev rebuild 从临时 worktree 挂载空数据根导致正文投影 409
## 现象
用户刷新项目 143 后,前端请求:
```text
GET /api/v1/docgov/documents/doc_proj143_intake/content 409
DOCUMENT_CONTENT_PROJECTION_MISSING
docgov: document content projection missing
```
错误发生在 `projectDocuments.ts` → `controlledDocHydrate.ts` 的受控正文水合链。它不是并发编辑的 `HEAD_CONFLICT`,也不是此前已修过的 canonical hash drift。
本轮只做只读现场核对与整改设计:没有操作用户会话、没有修改数据库/正文、没有重建共享容器。
## 结论
直接根因是 **dev 应用、PI Runner、Cursor Runner 被重建成挂载临时集成 worktree 的空 `data/dev`,而 PostgreSQL 仍沿用原 dev 持久卷**,形成数据库与文件事实源的 split-brain:
```text
PostgreSQL persistent volume
document_records.work_dir=/app/data/workspaces/bizdev/intake_1789270446856290128
│
├─ 主仓 data/dev:output.md 存在,SHA 与 DB/head 一致
│
└─ 当前容器 /app/data:绑定 /tmp/as-dev-wf409-merge/data/dev,文件不存在
```
`loadControlledDocumentContent` 先取得账本 head,再调用 `InspectProjection`;容器内看不到 `output.md`,因此正确分类为 `MISSING` 并返回 409。前端只是如实暴露后端错误,不是本次根因。
## 现场证据
### E1 — 容器挂载源是临时 worktree
2026-09-14 08:54 UTC 的 `docker inspect shuimu-agent-app-dev`:
| 项 | 现场值 |
|---|---|
| Compose working dir | `/tmp/as-dev-wf409-merge` |
| Compose config | `/tmp/as-dev-wf409-merge/docker-compose.dev.yml` |
| app `/app/data` source | `/tmp/as-dev-wf409-merge/data/dev` |
| pi-agent `/app/data/workspaces` source | `/tmp/as-dev-wf409-merge/data/dev/workspaces` |
| cursor-agent `/app/data/workspaces` source | `/tmp/as-dev-wf409-merge/data/dev/workspaces` |
| app created | `2026-09-14T08:40:44Z` |
数据库容器的数据仍来自命名卷 `agent-dev-context-pgdata`,不会随 Compose 工作目录切换。由此产生“旧数据库 + 新空文件根”的不一致组合。
### E2 — 项目 143 数据本身当前完整
`document_records`:
| 字段 | 值 |
|---|---|
| doc_id | `doc_proj143_intake` |
| work_dir | `/app/data/workspaces/bizdev/intake_1789270446856290128` |
| content_sha256 | `f283ba94c9c037897f021960f51abacee7242c3db8d10f9f2a5e32cde6acf039` |
| updated_at | `2026-09-14 05:14:10.302146+00` |
账本 open version 1 的 head snapshot 302 是人工修订,SHA 同为 `f283...f039`;主仓文件:
```text
/home/weichen/projects/Agent-System/data/dev/workspaces/bizdev/intake_1789270446856290128/output.md
size=40075
sha256=f283ba94c9c037897f021960f51abacee7242c3db8d10f9f2a5e32cde6acf039
```
同一路径在当前 app 容器内 `stat` 返回 `No such file or directory`。所以无需再次对项目 143 做内容修复;需要恢复正确数据根挂载。
### E3 — 影响不是单文档
对 dev 数据库 100 条“非模板且 work_dir 非空”的记录做只读比较:
| 根目录 | aligned | missing |
|---|---:|---:|
| 主仓 `/home/weichen/projects/Agent-System/data/dev` | 32 | 68 |
| 当前容器挂载 `/tmp/as-dev-wf409-merge/data/dev` | 0 | 100 |
主仓下的 68 条 missing 包含历史测试/临时路径,不能直接等同于 68 个真实用户缺陷;但当前容器对本次抽样 **100/100 都不可见**,足以确认环境级事故。恢复前任何真实文档读取或 PI 写入都不可信。
错误根在容器启动后已出现 27 个文件,其中 9 个 CAS blob 的 mtime 为 `08:40:45 UTC`;虽然 08:54 UTC 尚未找到新的 `output.md`,错误根已经不是可直接丢弃的“绝对空目录”,恢复前仍须做完整差异保全。
只读核对显示 test/main 当前 app 与 PI Runner 仍挂主仓 `data/test`、`data/main`,本轮没有观察到同样的运行事故;但其 Compose 仍使用相对 bind,仍受同一设计缺陷影响。
### E4 — 健康检查假阳性
同一时刻 `/health` 与 `/ready` 都返回 200,只检查数据库、schema 和 task store;未验证:
- 容器绑定的数据根身份;
- app 与 runner 是否挂载同一根;
- 活跃项目的正文投影是否可达;
- 数据库记录与文件根是否属于同一环境实例。
因此“healthy + schema 33”不能证明文档运行态可用。
## 根因分析
### R1 — Compose 相对 bind mount 与调用 worktree 耦合(直接根因)
`docker-compose.dev.yml` 使用:
```yaml
- ./data/dev:/app/data
- ./data/dev/workspaces:/app/data/workspaces
```
Compose 按 project working directory 解析相对路径。`scripts/env-service.sh` 又把 `ROOT_DIR` 定义为脚本所在 worktree 并 `cd` 进去,所以从任何复制/linked worktree 执行 `dev rebuild`,都会把该 worktree 自己的 `data/dev` 当成运行数据根。
### R2 — 纪律是文档约束,不是可执行门禁
`scripts/agent-worktree.sh` 只打印“禁止在此目录运行 env-service”,`AGENTS.md` 也规定 worktree 不得操作共享 Docker;但 `env-service.sh` 没有检测 linked worktree、主 worktree、分支、数据根或集成槽位。一次误调用即可静默替换全套容器挂载。
### R3 — 数据库与文件没有共享存储身份
数据库使用稳定 named volume;正文使用随调用目录变化的 bind mount。两者没有共同的 environment/storage UUID,也没有启动握手,因此任意一个被指向另一份状态时,进程仍可启动并连接成功。
### R4 — 账本权威仍被兼容投影阻断
当前设计声明 ledger head 是权威正文,但 GET 在账本存在时仍要求 `output.md` 投影必须存在且 aligned。于是兼容投影丢失会阻断 UI 读取权威账本。该 fail-closed 对真实 fork 有价值,却把“可安全重建的 missing”与“内容分叉”按同样的可用性后果处理。
### R5 — 正文更新仍是非原子双写
人工 PATCH 先提交 PostgreSQL 账本,再单独写 `output.md`;候选 commit/reject 也采用 DB 状态与文件投影分步更新。失败后只依赖同幂等键重试,没有持久 projection job/status 和后台补偿。即使修复本次挂载问题,进程崩溃、权限错误或磁盘故障仍可能再次留下 head 已更新、投影缺失的状态。
### R6 — 发布验收没有“从不同源码目录 rebuild 后仍接回同一状态”的负例
既有真实 UI 验收验证过 restart 后恢复,但 restart 不会重新解析 Compose bind mount;本次事故由 rebuild/recreate 触发。现有门禁没有覆盖 linked worktree、临时集成目录或错误数据根的启动拒绝。
## 为什么会“每次修改后又出现”
修改本身并不会删除项目 143 正文。本次时间线表明:最新人工修订和主仓 `output.md` 在 05:14 UTC 已一致落盘;08:40 UTC 后续 dev rebuild 把运行容器切到另一份空数据根,刷新才出现 409。
因此用户感知的“改完再刷新就坏”来自两个事件经常相邻:开发修改 → Agent 在临时 worktree 合并/rebuild → Compose 改绑数据目录。只修某个文档、某个 hydrate effect 或某次 hash 漂移,都无法阻止它复发。
## 严重度与影响
`critical`:
- dev 环境所有受控正文、工作流产物和 runner 工作区均可能不可见或写入错误根;
- 错误根上的新输出可能与主仓状态分叉;
- health/ready 仍为绿色,集成报告可能产生假 PASS;
- test/main 使用同类相对 bind 写法,设计缺陷可横向复制,虽本轮未观察其被错挂载。
## 关联整改
- Remediation: [dev 运行数据根隔离与文档投影自愈整改](../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md)
- Short-term: [dev runtime data root guard 诊断与设计](../ops/short-term/2026-09-14-dev-runtime-data-root-guard.md)
- 前序问题: [项目 143 canonical hash 漂移](./2026-09-14-project143-controlled-content-404.md)
## 开放问题
- 恢复前需再次冻结并备份错误根,确认 08:40 UTC 后是否已有新会话、附件、runner 输出或 agent session 写入;08:54 UTC 抽样未发现 `output.md`,不能替代完整差异清单。
- test/main 当前挂载源需在实施 Unit A 只读核对;本轮未扩大操作范围。
## 审查附记(2026-09-14 ~09:23 UTC)
- 现场复核:`shuimu-agent-app-dev` 仍 created `08:40:44Z`,bind source 仍为 `/tmp/as-dev-wf409-merge/data/dev`;`/health` `/ready` 仍 200,`schema_version=33`。
- 主仓 CURRENT 集成槽仍为 `implementer_cursor` / `e2e`。worktree 副本不得写成 idle。
- 方案已审查修订:见 [整改方案](../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md)。用户选择事故抢占 + 先改方案再批实施。08:54 的 `f283...f039` 不得再当 Wave 0 硬门槛。
@@ -105,8 +105,8 @@ severity: high
|------|------|--------|------|------|
| `sql_write` | 4 | U3 | 2026-09-28 | **8 天后到期**。`docduty`、`docrevision` 仍写 `document_records` / `freeform_documents` |
| `sql_write` | 1 | U8 | 2026-10-26 | `projectinstance` 终止流程直接取消 `task_runs` |
| `path` | 2 | U4 | 2026-09-28 | **同样 8 天后到期**。`server` 与 `docrevision` 仍点名 `output.md` |
| `path` | 14 | U5 | 2026-10-12 | `agent`、`bizdev`、`coordinator`、`docgov`、`storage` 仍拼接工作区路径或把 `data/dev` 写进提示 |
| `path` | **3** | U4 | 2026-09-28 | **同样到期**。`docrevision/projection.go` + server `document_revision_access.go` / `document_revision_handlers.go` 仍点名 `output.md`(对账前文档少记 handlers 一条) |
| `path` | **13** | U5 | 2026-10-12 | `agent`、`bizdev`、`coordinator`、`docgov`、`storage` 仍拼接工作区路径或把 `data/dev` 写进提示 |
到期后若门禁把这些 kind 升为 block 而代码未迁走,构建会失败;若继续延期而不迁,非属主写入会继续让文档/任务故障跨包扩散。本轮不改 YAML,清零归整改批次 G。
@@ -0,0 +1,39 @@
---
title: "pi-native 对比未过 P95 门槛"
status: planned
created: 2026-09-21
updated: 2026-09-21
severity: medium
---
# pi-native 对比未过 P95 门槛
## 现象
真实 MiniMax-M2.7-highspeed 双后端对比中,`pi-native` 六例全部写出目标文件,容器 `pi-agent` 只有两例文档任务成功。按成功样本计算的 P95 仍是 `pi-native` 16.616s、容器 6.926s,比值为 2.40,超过 1.3 倍替换门槛。因此 dev 默认后端保持 `pi-agent`。
## 根因分析
- 时延样本只统计成功且无 P0 的用例。容器 `reasoning` 画像使用 `--no-tools`,不会把助手正文落成目标文件,四例返回 `MISSING_TARGET`,不进入 P95。容器 P95 只由两例较快的文档任务构成。
- `pi-native` 的 P95 落在 `doc-outline`(16.616s)。同一提示在容器上是 6.926s。文档任务本身慢于 1.3 倍,不是分位数算法造成的。
- 第一轮对比把分位索引截断成 0,两例成功时取了更快的那例,已作废。本结论使用 nearest-rank(`ceil`)后的第二轮日志。
## 严重度
`medium`。运行时可以继续在分支上迭代,当前默认链路未切换,容器后端仍可回退。
## 关联整改
- 任务:`.doc/ops/short-term/2026-09-21-go-agentx-runtime.md`
- 报告:`.doc/test-reports/2026-09-21-go-agentx-runtime-test-report.md`
- 后续:缩短 `pi-native` 文档轮次时延,或把门槛改成按同一成功用例配对比较后重新实测。未重新通过前不改 `AGENT_BACKEND`。
## 证据
- `.doc/test-reports/assets/go-agentx-runtime/ab-live.txt`
- `.doc/test-reports/assets/go-agentx-runtime/ab-live-round1.txt`(作废的截断分位)
## 开放问题
- 容器结果不回传 token,本轮容器用量为 0,无法比较 token。
- `reasoning` 画像的成功定义是否应要求容器也把正文写入目标文件。当前判定仍按两边各自的 `Result.Success` 与目标文件是否出现。
@@ -0,0 +1,156 @@
---
title: "当前系统模块解耦现状审查"
type: docs
date: 2026-09-22
source_sha: d034aa00e5785f51234b484f9dca6bf4fb037660
task_id: modular-contract-standard-2026-09-22
---
# 当前系统模块解耦现状审查
## 结论与范围
当前系统属于**已有实质模块化基础,但契约一致性、数据所有权与运行隔离尚未闭合的模块化单体**。不是只有文件夹拆分:已有应用用例、共享事务、PostgreSQL outbox/delivery/inbox、独立 events 进程、PI Runner HTTP typed-result 边界。
下一步收益最大的工作是统一业务入口、修正事件顺序契约、补运行时校验和资源预算。把现有相互依赖的实现全部包装为 HTTP 服务,会保留语义耦合并引入跨进程失败窗口。
本报告针对固定源码 SHA,只读检查 Go/React、架构配置、迁移和部署定义。**未检查当前实际镜像/进程/数据库积压,未运行 Go/PG/PI/浏览器或故障注入测试。** 下文“实现存在”是源码证据;“可能造成”是风险推导;不宣称现网事故已复现,也不改变 FEATURE-MATRIX 或发布门禁。
关联:[通用规范](../system-design/2026-09-22-generic-module-contract-standard.md)、[采用规划](../remediation/2026-09-22-modular-platform-adoption-plan.md)、[任务与验证](../ops/short-term/2026-09-22-modular-contract-standard.md)。
## 分维度判断
| 维度 | 已有基础 | 当前局限 | 判断 |
|---|---|---|---|
| 模块职责 | domain/app/server 分层,组合根 | server 认识大量实现,跨包类型泄漏 | 部分解耦 |
| 业务入口 | docflow/stageflow/chatflow 用例 | 对话和 HTTP 同一动作存在旁路 | 需优先收敛 |
| 数据边界 | 表 owner 清单与 UoW | 5 项 SQL 写例外、16 项路径例外 | 明确但未闭合 |
| 事件通信 | 可靠 PG 投递与独立进程 | 顺序规则与 ADR 冲突,校验不完整 | 机制具备,语义有缺口 |
| 并发与幂等 | claim、lease、token、DB 收据 | 慢消费者共享循环,同 ID 异载荷不校验 | 部分保证 |
| 跨进程边界 | Web/server、PI Runner、events | 业务模块大多仍共享 server 进程/资源 | 不能宣称全模块故障隔离 |
| 前端功能 | API/hooks 拆分 | 根状态和 setter 跨功能共享 | 文件组织优于状态边界 |
| 工程约束 | arch-check 与契约 registry | 静态覆盖有限,不证明运行隔离 | 有工具,须明确盲区 |
不提供无权重依据的“解耦百分比”。以下发现按对数据与行为的实际影响排序,而非按文件大小排序。
---
## A1. 事件领取规则与已接受的顺序契约相冲突
**高优先级源码问题。** ADR 规定允许首个高领域版本 bootstrap,禁止把 MemoryBus 的连续版本等待搬到 PG dispatcher:`.doc/adr/2026-09-15-event-consumer-checkpoint.md:12-23`。
当前 `internal/events/dispatcher.go:39-46,75-84` 采用 `version <= checkpoint + 1`;无 checkpoint 时只接纳版本 0/1。生产者 `internal/app/docflow/commands.go:182-185` 使用 document record ID,`:211-214` 使用 candidate ID,`:162-165` 使用文档账本版本。这些不是从 1 开始连续的事件序号。
因此在“无 checkpoint、第一条版本为 42”这一明确条件下,该事件按 SQL 不能被领取。是否已有这种实际积压未查数据库,不能报成现网观测。
现有 `internal/events/pg_test.go:18-28` 固化同样 gap 规则;`dispatcher_pg_test.go:105-109` 使用 v1/v2,不能覆盖稀疏首事件。
**建议验收**:真实 PG 下测试首次 v42、v42→v47、部分事件订阅、毒消息隔离;按既有 ADR 恢复 bootstrap,或经明确新 ADR 引入独立事件序列及迁移。通用规范对应 MCS-15。
## A2. 同一批准动作存在 HTTP 与对话入口分叉
**高优先级待验证风险。** HTTP `internal/server/handlers.go:793-808` 调用 `docflow.Commands.Approve`,后者在 `internal/app/docflow/commands.go:173-188` 执行 UoW 与 EventApproved。
对话 `internal/chat/action_executor.go:68-76` 直接调用 GovernanceEngine.ApproverApprove;`internal/app/app.go:294-307` 已不再注册旧通知/批准 hook,`internal/docgov/engine.go:957-960` 的直接路径仅尝试旧 hook。
源码证明入口路径不同,存在绕过 durable workflow_advance/notify 的风险;本次未执行真实对话批准,不能把完整用户后果记为已复现。
**建议验收**:同一授权场景分别从 HTTP、对话、后台任务触发,比较授权拒绝、状态提交、事件、工作流推进与通知,所有入口汇入同一用例。通用规范对应 MCS-04。
## A3. 契约登记尚未成为完整运行时校验
`internal/events/registry.go:28-52` 登记 producer、consumer、schema、PayloadFields;`:75-91` 主要检查启用与消费者。
`internal/events/envelope.go:65-85` 检查基础字段、schema、digest/scope,但不按事件逐项校验 producer allowlist、JSON 必填/类型/额外字段。`internal/events/pg.go:32-47` 依赖此验证。`inventory.go:29-63` 也未完成 payload 结构检查。
实际 `internal/app/docflow/commands.go:279` 的 Producer 为 `docflow`,registry 示例为 `app/docflow`(`registry.go:42-46`),当前路径不会因此拒绝。消费 hydration `dispatcher.go:204-224` 与 handler 调用 `worker.go:252` 也不能证明所有入口统一重新校验。
**建议验收**:未知事件/schema、伪造 producer、缺必填、异类型、超大 payload、digest/tenant/environment 不符均有发布和消费负例。通用规范对应 MCS-08/09/18/21。
## A4. 消费者逻辑独立,但资源执行仍串行共享
`internal/events/worker.go:99-113` 逐一 RunOnce 各消费者;`:137-147` 一批先 claim 再逐个 handle。心跳直到该条 handle 才启动(`:208-234`)。
慢消费者会延迟同 worker 的其他消费者;预取队尾还可能在开始处理前耗掉 lease。增加副本能缓解吞吐,不证明消费者有独立预算和公平性。当前可隔离永久错误,不等于慢任务也隔离。
**建议验收**:阻塞一个消费者、保持另一个持续输入,后者满足自己的延迟预算;批量排队超过租期时不允许并发重复副作用。先按空闲槽 claim,并配置每消费者超时、并发、池配额;高风险任务再进程隔离。对应 MCS-14/17。
## A5. 去重与健康检查不能被扩大解释
`internal/events/pg.go:43` 对相同 event_id 使用 DO NOTHING,未比较已有 payload digest。因此“重复 ID 被忽略”并不保证“同键异载荷会冲突”。
`cmd/events/main.go:91-115` 的 health、ready、live 分别关注进程、DB/schema/注册条件、调度心跳;`worker.go:109-112` 在处理前 Touch 且忽略 RunOnce 返回错误。Compose healthcheck 使用 /health(`docker-compose.dev.yml:170-175`)。
**建议验收**:同 ID 同内容返回既有结果、不同内容冲突;依赖持续失败时最老消息年龄和分消费者失败数告警,不能依靠健康探针证明业务前进。对应 MCS-13/19/20。
---
## B1. 组合根、契约类型与实现仍相互渗透
优点:`internal/app/app.go:96` 集中装配,`internal/server/server.go:87` 接收 runtime。限制:`server.go:40-84` 持有领域具体服务、pool、上下文等,`:123-132` 还回填 Runtime 并初始化执行器。HTTP 适配器获得整个 Runtime,难以维持最小依赖。
`internal/app/stageflow/usecase.go:10-37` 是窄端口且未配置时 fail closed,但 `types.go:3-15` alias 到 bizdev 模型。`internal/app/chatflow/ports.go:75-106` 返回 ctxmgr/coordinator/projectinstance 具体类型。接口改变了调用位置,仍未彻底隐藏内部模型。
本次 server 生产 SQL 搜索未发现真实业务 SQL,**不能把持有 pool 等同于已经直接越权写表**。改造重点是缩小可用能力与未来变更影响,不虚构违规。
## B2. 单写者有登记,仍有明确例外
`.doc/system-design/module-boundaries.yaml:276-374` 登记表 owner,`:471-511` 登记 5 项 SQL 例外。
源码确认:`internal/docrevision/pg_store.go:456-477` 更新 freeform_documents/document_records;`internal/docduty/store.go:144`、`revoke.go:154` 修改 document_records;`internal/projectinstance/store.go:920` 更新 task_runs。
建议通过 owner repository/用例端口逐项归还写权,保留必需事务边界。不得为了删除一个 import,把同一 SQL 移到万能公共 repository。
## B3. 共享事务值得保留,不能随意替换为网络调用
`internal/app/docflow/commands.go:88-112` 使用 UoW 与 owner GetForUpdate;`internal/docrevision/pg_store.go:482-491` 加入同一事务;`internal/app/uow/pg_uow.go:52-80,95-124` 提供有界事务重试、锁等待和提交。
`internal/app/app.go:269-275` 接入 events.PGSink,`internal/events/pg.go:17-58` 拒绝无 UoW 发布并同事务创建 envelope/delivery。这是实质强一致性能力。若以后拆进程,必须重新定义跨域中间态、补偿和对账,不能用分布式锁替代事务。
## B4. 文件与前端状态也构成模块间隐式协议
文件证据:`internal/coordinator/context.go:456-459` 读取 output.md;`engine.go:691-701,895,1051` 读写/拼接共享产物路径;`internal/docgov/lease.go:415-416` 写 projection 文件。文件 owner、不可变引用、版本与发布原子性应与数据库同样治理。
前端证据:`web/src/App.tsx:130-170,1163-1204,1367-1406` 将消息、交付物、缓存及 setter 传给多个功能 hooks;`useSendMessage.ts:85-121` 可修改多个域状态。建议 owner 管理状态、对外命令/查询/事件;浏览器内无需强制 HTTP。
`web/src/api/authHeaders.ts:27-44` 已有认证辅助,但 chatStream、taskRuns、docgov 等仍各自 fetch。统一 client 应处理通用超时、错误、取消与身份,功能 DTO 继续分域。
## B5. 静态架构检查有价值,但证明范围有限
`internal/archtest/scan.go:38-70` 默认只扫 internal 生产 Go;`:169-205` 检查 import allowlist 和登记表的 SQL 字符串。它不涵盖前端、默认 cmd 范围、动态 SQL 完整语义、实际权限、兼容性和资源隔离。
`scan.go:18,392-410` 的事件匹配范围主要为 document.* / intent.plan.* 和特定调用模式,不能根据 YAML 中存在 taskrun/fav 就假定每条协议都被检查。
`module-boundaries.yaml:182-225` 仍允许 server 依赖大量领域;`:641-651` 登记 sql_write=5、path=16 基线。**这是读取到的配置,不是本次 arch-check 执行结果。**
---
## 可保留的隔离与演进能力
- 独立 worker:`cmd/events/main.go:68-89,127-130` 注册 notify/advance/projection,FAV 明确不注册;Compose 已有 events 服务。历史“没有独立 worker”的判断已过时。
- 领取与确认:`dispatcher.go:49-97,163-200,227-259` 有原子 claim、owner/token、attempt、inbox/checkpoint;旧 ClaimIDs 已禁用。
- DB 效果原子性:`worker.go:247-275` 的 handler、fenced ack、commit 同事务;仅适用于参与同一 DB 事务的效果,不能扩展为任意外部 IO。
- 消费者实现:`internal/app/docproject/consumer.go:73-94` 使用事件回执与 no-replace;`docadvance/consumer.go:80-104` 使用同事务推进与通知。
- 冻结执行输入:`internal/workflow/runtime/orchestrator.go:27-41,69-85` 从冻结实例取职责,缺失时拒绝,可泛化为任务绑定配置/契约版本。
- PI Runner:`internal/agent/piagent.go:145-194` 有 HTTP/Bearer、超时、run_id、typed result 和大小限制;`remote_result.go:63-79` 对存在但非法 typed 字段 fail closed。
## 测试证据边界
以下是已有测试定义,不是本次 PASS:
| 路径 | 已有测试意图 | 本次状态 |
|---|---|---|
| internal/app/docflow/same_tx_pg_test.go | 状态与 outbox 同事务回滚 | 未运行 |
| internal/events/dispatcher_pg_test.go | 多 worker、off/shadow、ack、隔离 | 未运行 |
| internal/app/docnotify/e1a_pg_test.go | 通知权限、shadow/live、回滚 | 未运行 |
| internal/app/docadvance/e1b_pg_test.go | 工作流事件消费 | 未运行 |
| internal/app/docproject/e1c_pg_test.go | 投影与 no-replace | 未运行 |
| internal/agent/piagent_typed_e2e_test.go | 条件启用的真实 PI | 未运行 |
PG 测试在 short 或缺少独立 DSN 时可跳过;PI 测试有显式开启条件。建议新增 A1–A5 的针对性场景,再做受影响用户入口验收。未经授权,本次不启动这些实现或共享环境测试。
## 与原方案的关系
继续引用 2026-09-20 A–G 分批整改作为现有依赖收敛清单,不能据此宣称原批次已经完成。A1–A5 是本次新增或细化的源码证据,实施时应并入同一治理链,避免开第二套互相冲突的解耦项目。
原规范保留模块化单体,本次通用规范允许按条件选择进程/服务隔离。两者分别用于“当前项目生效规则”和“未来项目待采纳标准”,没有自动覆盖关系。
@@ -0,0 +1,27 @@
# 历史问题补录:可选职责与正文哈希
补录日期:2026-09-23;owner:Codex;登记任务:[issue-learning-2026-09-23](../ops/short-term/2026-09-23-issue-learning.md)。这是两个问题的登记主记录,原审计、修复任务及验收报告继续作为事实证据;没有重新运行产品测试或读取业务数据。`evidence_basis=historical`,当前运行状态未复测,源码复核基线为 `2fdb6e548e3784771f27e6a9e79b9c364f76c566`。
## nullable-duty
- issue_id:`ISSUE-20260923-nullable-duty`;issue_state:`resolved`;severity:high;recurrence_count:0(指登记后重开次数,非历史发生总数)。
- 发现/修复日期:2026-09-17;原处理 owner:Cursor;补录 owner:Codex;原任务:`fix/docgov-optional-duty-null-fk`。
- 现象与已证实根因:[原审计](2026-09-17-docgov-optional-duty-null-fk.md)。可选 reviewer 缺席合法返回 0,但创建路径直接写入可空 FK;heal 路径已有空值映射,创建路径漏改。底层 FK 又被错误分型掩盖。
- 同类范围:可选职责的创建/heal 写入边界。历史报告验证 reviewer/approver 为 NULL;不能由此推断所有 FK、全职责模式和全部授权边界均已验证。
- 修复思路:保留可选职责语义,在 SQL 边界将缺席值映射 NULL,并改善错误分型;通过强制配置 reviewer 绕过错误会改变业务契约。未发现其他尝试的实测记录,不虚构失败实验。
- 修复经过/提交:[原任务](../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md),历史合并 `e488d10`;本次只核对原文记录,不把短 SHA 当当前制品身份。
- 验证与关闭范围:[原报告](../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md) 记录单测、PG 集成、真实任务 API 启动与 DB NULL;证明账本创建通过,不证明真实 UI 或 PI 全流程完成。历史 deployment=passed(dev,来源为原报告),当前运行未复测。
- 本次复核:当前源码 `internal/docgov/engine.go` 创建路径仍调用 `nullIfZero`;这是源码检查,未重跑 PG。
- 经验:[LESSON-20260923-nullable-duty](../ops/lessons/2026-09-23-nullable-duty.md)。后续触发:职责模型或任一持久化入口变化时复核,异常复发重开。独立的 flushSync 警告不在本条关闭范围。
## content-hash
- issue_id:`ISSUE-20260923-content-hash`;issue_state:`resolved`;severity:critical;recurrence_count:0(登记后)。
- 发现/修复日期:2026-09-14;原处理:Cursor 修复、Antigravity UI 验收;补录 owner:Codex。
- 现象与因果链:[原审计](2026-09-14-project143-controlled-content-404.md)。文件存在却被报 404;规范化去掉有硬换行语义的双空格,bootstrap 只改账本哈希未同步文件;并发 hydration 与无效轮询更新放大故障。
- 同类范围:旧文档 bootstrap、规范化、账本/文件投影、错误映射与刷新竞态。历史扫描范围见原审计,不扩大为所有数据无问题。
- 修复思路/选择:[整改方案](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md)。保持文本语义、原子投影和结构化错误;历史原文件与旧 head 先保全再显式 migration_repair。静默覆盖原文件会丢失语义,不能用于“对齐哈希”。这不是本轮数据操作授权。
- 修复经过:[原审计关闭结果](2026-09-14-project143-controlled-content-404.md#关闭结果) 与 [最终报告](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);后续水合/缓存修复合入 `d0e8f60`、`36e4bc3`。报告保留早期失败及无效运行,只有 clean-run3 / full-chain-final 属最终有效证据。
- 验证与关闭范围:原报告记录旧项目真实页面、全链路主阶段和重启恢复 PASS;历史 deployment=passed(dev)。不据此宣告当前 production_ready 或当前制品无回归。
- 本次复核:`internal/docrevision/canonicalize.go` 已委托 doccontent;`canonicalize_golden_test.go` 包含硬换行和封装一致性测试。本次未执行这些测试。
- 经验:[LESSON-20260923-content-hash](../ops/lessons/2026-09-23-content-hash.md)。后续触发:canonicalizer、bootstrap、投影或水合修改时复核;复发追加时间线并重开。
@@ -0,0 +1,55 @@
---
issue_id: ISSUE-20260923-matrix-status-regression
issue_state: resolved
severity: high
owner: Cursor
task_ids: [module-batches-ag-status-fix-2026-09-23]
created: 2026-09-23
occurred_at: 2026-09-23
updated: 2026-09-23
recurrence_count: 0
evidence_basis: current
lesson_ids: [LESSON-20260923-matrix-status-cas]
---
# FEATURE-MATRIX 状态字段被合并冲突回退
按 [闭环规范](../ops/2026-09-23-issue-learning-workflow.md) 维护。关联任务:[module-batches-ag-status-fix](../ops/short-term/2026-09-23-module-batches-ag-status-fix.md)。
## 事实与证据
- **预期**:`module-batches-ag` 在 A–G 合入且 arch-check 全 0 后保持 `done`(提交 `77bdbdbc` 已写入)。
- **实际**:本地 `dev` tip 上该行状态为 `planned`,剩余工作栏仍写「关闭本伞行」与 A–G 已合入事实矛盾;用户观感为「多次要求实现但未实现」。
- **触发**:含 FEATURE-MATRIX 的 closeout / sync 合并冲突手解,取了无 `record_id` 或旧侧行内容。
- **影响**:后续会话按 `planned` 错误前提规划,可能重复实施或延误收口;不构成发布 blocker(发布关系仍为 `non_blocker`)。
- **环境**:本机 `dev` @ `18b9556f`(任务基线);修复提交见本任务 feature 分支。
- **复现(修复前)**:`git show 77bdbdbc:.doc/status/FEATURE-MATRIX.md` 该行 status=`done`;修复前 tip 同行为 `planned`。
## 根因与同类范围
- **已证实**:共享文档在 `docs apply` 行级 CAS / `record_id` 稳定键启用前窗口内,merge 冲突对手解无机器核验状态字段;手解取旧侧覆盖 `done`。
- **已排除**:A–G 代码未合入(合入 merge commits 与 arch-check PASS 否定)。
- **共用机制**:CURRENT / FEATURE-MATRIX 等协调 SSOT;任何绕过 `docs apply` 的整表手改或冲突取旧侧。
- **同类入口**:其他矩阵行、CURRENT 认领行在无 CAS 收据时同样脆弱;本轮只修 `module-batches-ag`,不扩大扫全表 unless 另授权。
## 修复思路与过程
| 日期 | 假设 / 尝试 / 动作 | 实际结果与证据 | 决策 / 下一步 / owner |
|---|---|---|---|
| 2026-09-23 | 只读考古 git + arch-check | A–G 已落地;状态回退成立 | 按计划修正登记,不重做代码 / Cursor |
| 2026-09-23 | docs apply 行级 CAS 恢复 `done` + 登记 lesson | MATRIX 行 status=`done`;header 同步;arch-check PASS | resolved;合入 local_dev / Cursor |
方案:恢复矩阵事实状态;登记问题与经验;强制后续矩阵变更走 `docs apply`;合入含 MATRIX 的合并后机器核对目标 `record_id` 状态列。
## 验收与关闭
- 原例:PASS — MATRIX `module-batches-ag` status=`done`(docs apply 收据 + commit `b9d09c97`)。
- 同类:本任务不批量改其他行;风险已记入 lesson。
- 正常:PASS — `docs apply` 无拒绝;`./scripts/arch-check.sh --mode block` PASS(worktree tip)。
- deployment:`not_required`(纯文档)。
- resolved:2026-09-23;范围=状态登记与台账,不含 Server 镜像字段增量。
## 经验与复发
- lesson:[LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md)
- 防护:能力完成升 `done` 已有 `docs:approve` + evidence `cat-file` 门禁;复发时重开本 issue 并检查是否绕过 apply。
@@ -0,0 +1,297 @@
---
title: "系统整改与重构方案 — 前两阶段及取消状态契约审核检查清单"
status: done
created: 2026-09-23
updated: 2026-09-23
severity: high
task_id: modular-refactor-review-2026-09-23
---
# 系统整改与重构方案 — 前两阶段及取消状态契约审核检查清单
## 1. 目的与范围
本清单供**产物机器**上的方案执行者,对照自查《系统整改与重构方案》中**阶段 1、阶段 2、取消状态契约**是否可审、可测、可回退。
| 项 | 值 |
|---|---|
| 目标方案(产物机器,本机不可见) | `.doc/remediation/2026-09-22-agent-system-modular-refactor-plan.md` |
| 目标 worktree(产物机器) | `.worktrees/modular-contract-standard-2026-09-22` |
| 本机清单基线 | local `dev@8f0e31e53a5f8d0dd25a908ba6d127a5bb6768a4` |
| 本轮授权 | **仅编制清单并合入本机 dev**;不实施业务代码;不审核方案正文(本机无正文);不 push |
| 自查结果枚举 | `符合` / `偏差` / `阻断` |
**非目标**:阶段 3–6 全量逐条(除非阶段 1/2 或取消契约依赖它们);业务实施;改 YAML 例外;FAV live / `production_ready` / test·main 晋升。
## 2. 「22 条规范」映射回填(本机未定位权威编号表)
本机可见权威材料中**没有**名为「22 条规范」的独立编号清单。邻近可对账来源:
| 候选来源 | 本机状态 | 与「22」的距离 |
|---|---|---|
| [模块开发规范](../system-design/2026-09-20-module-development-standards.md) §2–§4(端口规则表、事件契约、故障隔离红线 1–7、checklist) | active | 条目合计接近但**未编号为 1–22** |
| [耦合审计](./2026-09-20-module-coupling-audit.md) + [A–G 分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md) | A–G 能力行已 `done` | 21 条 YAML `exceptions` + 边界规则,**非**「22 条规范」正文 |
| 产物机器新方案(2026-09-22) | 本机不可见 | **应以方案正文为准** |
产物机器回填表(填完后本清单才可宣称「22 条已闭环对账」):
| 规范编号 | 方案章节/工作包 ID | 本机对账锚点(规范/A–G/代码路径) | 阶段归属 | 自查 |
|---|---|---|---|---|
| N01 | _待填_ | _待填_ | 1 / 2 / cancel / 其他 | |
| N02 | _待填_ | _待填_ | | |
| … | | | | |
| N22 | _待填_ | _待填_ | | |
若方案「22 条」≠ 上表候选来源,在回填表首行注明**权威出处路径 + SHA**,禁止用 A–G `done` 冒充新方案已验收。
## 3. 判定规则
| 判定 | 条件 |
|---|---|
| 符合 | 方案条目写明代码位置、依赖、责任范围、测试场景、回退条件;与本机锚点无冲突;测试可复现 |
| 偏差 | 可合入意图成立,但路径过时、依赖遗漏、测试偏弱或回退含糊;实施前须修订方案 |
| 阻断 | 与生效规范/[验证契约](../ops/2026-09-21-validation-contract.md)/表写者/事件至少一次语义冲突;或回退会丢数据/假 PASS |
每条核对项须留下:方案段落锚点、对照 SHA、结论、证据路径(可为本机相对路径或产物机器截图哈希)。
---
## 4. 阶段 1 — 契约、模块职责、验证基线
### R1.1 三种通信契约完整且无第四种
| 字段 | 内容 |
|---|---|
| 规范来源 | 模块开发规范 §2.1–§2.3;ADR 模块化单体 |
| 应核对代码/文档 | `internal/app/*/ports.go`;`internal/events/registry.go` `StaticContracts()`;`internal/server` wire DTO;方案工作包是否禁止 gRPC/全局 bus/跨包未导出 helper |
| 依赖与责任 | 消费者定义端口;组合根(`internal/app`、`cmd/*`)注入;server 不持领域 SQL |
| 测试场景 | 新增端口无 JSON/`pgx`/物理路径;事件改动跑 registry↔YAML parity;HTTP 错误信封 `code/message/request_id` |
| 回退核对 | 契约变更可单批 revert;不留下「半套第四种通信」 |
| 自查 | |
### R1.2 表唯一写者与解包事务名单
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §4 红线 1–2;`module-boundaries.yaml` `table_owners` |
| 应核对代码 | YAML `table_owners` / `tx_unpackers`;工作包是否把跨表原子性放在用例 UnitOfWork,而非各模块自开事务 |
| 依赖与责任 | 非属主不得 `INSERT/UPDATE/DELETE`;server/chat 不得解包 `pgx.Tx`(除非已登记例外且有到期日) |
| 测试场景 | `./scripts/arch-check.sh --mode block`;针对新增写路径的属主负例 |
| 回退核对 | 回退代码与恢复/删除 exception **成对**,避免门禁与代码错位 |
| 自查 | |
### R1.3 事件信封与至少一次投递 + 幂等
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2、§3.2 |
| 应核对代码 | `internal/events/registry.go`;`ClaimLeases` / outbox 同 UoW;消费者 inbox/`source_event_id`(例:`internal/notification/service.go` `EmitVisible*`) |
| 依赖与责任 | 生产路径为 PG outbox + `cmd/events`;`MemoryBus` 仅特征测试 |
| 测试场景 | 重复投递仅一个可见副作用;缺 `environment`/`project_id` fail closed;永久失败进 dead/quarantine 不堵其他订阅者 |
| 回退核对 | 不回退到 SELECT-only claim(`ClaimIDs` 已禁用) |
| 自查 | |
### R1.4 模块职责与 A–G 残留边界
| 字段 | 内容 |
|---|---|
| 规范来源 | [A–G 分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md);FEATURE-MATRIX「模块解耦批次 A–G」=`done` |
| 应核对 | 新方案 17 工作包是否**重复**已合入的 A–G,或明确「在 A–G 之上增量」;互斥 mutex 是否与已关闭批次冲突 |
| 依赖与责任 | 新工作包不得把 FAV live / RPC / `production_ready` 回退写进完成定义 |
| 测试场景 | 声明的依赖边在合入后可用 `go list` / arch-check 证明消失或未回潮 |
| 回退核对 | 单工作包 revert;不整支回滚无关批次 |
| 自查 | |
### R1.5 验证基线与门禁衔接
| 字段 | 内容 |
|---|---|
| 规范来源 | [验证契约](../ops/2026-09-21-validation-contract.md);规范 §7 |
| 应核对 | 方案阶段 1「验证基线」是否映射到:`arch-check --mode block`、`go vet ./...`、`go test -short ./...`;前端相关则 `npm test` / `npm run build`;纯文档不要求 PI |
| 依赖与责任 | stub/SKIP 不得作交付 PASS;共享环境测试须持锁 |
| 测试场景 | 方案每个工作包的「测试场景」列能落到精确包路径或 `-run` 名 |
| 回退核对 | 失败时保留候选证据,不伪造 PASS |
| 自查 | |
### R1.6 稳定词汇与跨包错误
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §3.3;批次 C |
| 应核对 | `internal/contracts/vocabulary`;方案是否禁止新增 `docgov.State*` / `Role*` / `Err*` 跨包引用 |
| 依赖与责任 | 带哈希/路径的函数留在属主模块(如 `doccontent`) |
| 测试场景 | 热点引用改为端口或词汇后,原状态机测试仍绿;HTTP code 不变 |
| 回退核对 | 单批 revert |
| 自查 | |
---
## 5. 阶段 2 — 通知事务、事件领取、授权、业务入口一致性
### R2.1 通知与领域提交同事务
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2「副作用与 receipt 能进同一数据库事务的必须同事务」;§4 红线 4(持锁不做外部 IO) |
| 应核对代码 | `internal/notification/service.go` / `document_events.go`(`EmitVisible*` 要求 caller fenced tx);`internal/app/docadvance/consumer.go`;dispatcher `handle` 在 lease tx 内调用 handler |
| 依赖与责任 | notify 消费者不在持锁路径调 LLM/HTTP/SSE;可见通知以 `source_event_id` / dedupe 幂等 |
| 测试场景 | 提交失败无可见通知;重复 `source_event_id` 成功且不双写;`HashVisibleNotifications` 类对账 |
| 回退核对 | 回退后不得留下「已提交领域、无通知」或相反的半状态;优先前滚修复 |
| 自查 | |
### R2.2 事件领取:lease、续租、抢占
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2;Phase 2 事件计划(投递/lease 语义) |
| 应核对代码 | `internal/events/dispatcher.go` `ClaimLeases` / `HeartbeatLease`;`internal/events/worker.go`;`cmd/events` |
| 依赖与责任 | 生产禁止 `ClaimIDs`;quarantine/expire 不可被再次 claim;多 worker 互斥由 `FOR UPDATE SKIP LOCKED` 语义保证 |
| 测试场景 | `dispatcher_pg_test`:双 worker 仅一人领到;quarantine 不可领;续租失败不再处理 |
| 回退核对 | 不恢复已禁用的 SELECT-only claim;lease 时长变更有观察窗 |
| 自查 | |
### R2.3 授权检查收敛点
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.1「Principal 只来自已认证会话」;§2.3 授权拒绝不泄露存在性;多意图设计「卡片/SSE 不能替代授权」 |
| 应核对代码 | `internal/authz`;`internal/server/*_handlers.go`(task/intent/freeform 等)在 Flush/副作用前鉴权;`events.AuthorizePrincipal` 于消费者路径 |
| 依赖与责任 | 请求体不得覆盖 UserID/ProjectID;消费者授权失败 → quarantine,非无限重试 |
| 测试场景 | 跨用户 IDOR 负例 403;SSE 鉴权在 Flush 前(对照 gap `AUTH-TASK-SSE`);重复提交不绕过 |
| 回退核对 | 回退不得重新打开已关闭 IDOR;测试与代码同批 |
| 自查 | |
### R2.4 业务入口一致性(HTTP / 对话 / SSE / 事件投影)
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.3;多意图权威性排序:认证主体与资源 → 授权/不变量 → PG → 卡片投影 → SSE |
| 应核对代码 | 同一命令是否只经一个用例入口;chat action 与 REST 是否共用端口;投影/SSE 是否只读权威状态 |
| 依赖与责任 | GET 不修投影(红线 6);修复为独立命令并写审计 |
| 测试场景 | 双入口同输入同权威结果;刷新后以 GET 覆盖本地缓存;投影丢失仍能经 active discovery 找回 |
| 回退核对 | 入口合并失败时可切回旧入口且状态不分裂 |
| 自查 | |
### R2.5 与阶段 1 基线的衔接(方案自述三处衔接问题)
| 字段 | 内容 |
|---|---|
| 规范来源 | 用户汇报:审阅发现的三处衔接问题已修正 |
| 应核对 | 方案正文是否显式列出三处问题的**原描述、修正段落、回归检查**;是否仍依赖未合入的阶段 3+ 契约 |
| 依赖与责任 | 修正不得静默改验证契约或放宽 arch-check |
| 测试场景 | 针对三处各有一条可执行核对(文档锚点或测试名) |
| 回退核对 | 修正可独立 revert 而不拆阶段 1 |
| 自查 | |
---
## 6. 取消状态契约 — Runner 取消、未知结果、SSE 恢复
> 用户建议优先审核。本机可见实现重心:`internal/taskrun`(`Cancel`/`StatusCancelled`/`taskrun.cancelled` 事件)、`internal/server/task_run_handlers.go`(Cancel + SSE `after_seq`)、`internal/agent/piagent.go`、多意图计划中的 cancel 转移。
### R3.1 取消状态机覆盖全转移
| 字段 | 内容 |
|---|---|
| 规范来源 | 方案「取消状态契约」;多意图步骤状态含 `cancelled`;`taskrun.cancelled` 事件登记 |
| 应核对 | 状态集合是否覆盖:`cancel_requested` →(执行中)→ `cancelled` / `unknown`(或方案等价命名);禁止从终态回退到 running |
| 代码锚点 | `internal/taskrun/finalize.go`(`Commands.Cancel`、`StatusCancelled`、事件名);`manager.go` `Cancel`;意图计划状态机(若工作包触及) |
| 依赖与责任 | 取消与 finalize 竞态仅一个终态(见 `TestPG_FinalizeCancelRaceOneTerminal` / `TestCommands_CancelWinsOverFinalizeMemory`) |
| 测试场景 | 用户取消、租约过期视同取消、Runner 已结束后的迟到取消、双端并发 cancel/finalize |
| 回退核对 | 回退不得出现双终态或「已取消仍计费/仍写产物」 |
| 自查 | |
### R3.2 未知结果:幂等重试与人工裁定
| 字段 | 内容 |
|---|---|
| 规范来源 | 操作规范/AGENTS:Docker/网络超时先区分未知与未执行;管理器不自动撤销外部副作用 |
| 应核对 | 方案是否定义 `unknown`(或等价)的进入条件、可见对外语义、幂等重试键、人工裁定 API/运维入口、超时升级 |
| 代码锚点 | taskrun 结果应用路径;PI Runner 客户端(`internal/agent/piagent.go`);方案工作包列出的裁定命令 |
| 依赖与责任 | 未知不得冒充 `succeeded`/`cancelled`;重试必须带 fencing/idempotency,避免双执行 |
| 测试场景 | Runner 超时无响应 → unknown;重试仅一次可见副作用;裁定后 SSE/GET 一致 |
| 回退核对 | 清除 unknown 标记不得删除审计;禁止自动 Down/删库「恢复」 |
| 自查 | |
### R3.3 执行租约、fencing 与取消的交互
| 字段 | 内容 |
|---|---|
| 规范来源 | 多意图设计:短 lease + owner + lease_until + fencing;续租失败不再领步骤 |
| 应核对 | 取消是否使 lease 立即失效;旧 fencing token 的迟到心跳/完成是否被拒绝 |
| 代码锚点 | `internal/taskrun` store/lease;workspace lease 相关迁移与调用 |
| 依赖与责任 | 持 lock 期间取消不调用外部 IO;取消收据与 outbox 同事务(若发 `taskrun.cancelled`) |
| 测试场景 | 取消后旧 worker 心跳失败;fencing 错则拒绝 finalize |
| 回退核对 | 放宽 fencing 视为阻断,不得以「兼容」绕过 |
| 自查 | |
### R3.4 SSE 恢复后与权威状态一致
| 字段 | 内容 |
|---|---|
| 规范来源 | 系统健康整改 Wave0(`after_seq`、心跳、Flush 前鉴权);多意图「SSE 允许重复/乱序/丢失,缺口 GET 对账」 |
| 应核对代码 | `internal/server/task_run_handlers.go`(`after_seq`、`extendSSEWriteDeadline`、Cancel handler);`web/src/api/taskStream.ts`;聊天 SSE 同等语义 |
| 依赖与责任 | SSE 非权威;取消/unknown 以 PG/GET 为准覆盖本地 |
| 测试场景 | 断线重连不重复创建运行;取消过程中重连看到终态;WriteTimeout 后同 turn 不误 409(对照 `DOCREV-SSE-IDEM-BUSY` 经验) |
| 回退核对 | 去掉 `after_seq` 视为回归阻断 |
| 自查 | |
### R3.5 Runner 取消传播
| 字段 | 内容 |
|---|---|
| 规范来源 | 方案阶段 2/3 交界:Runner 取消与未知结果 |
| 应核对 | HTTP/对话取消 → taskrun → PI Runner 取消信号是否端到端定义;Runner 已完成后的取消应答 |
| 代码锚点 | `Manager.Cancel`;server cancel 路由;PI 客户端 cancel |
| 依赖与责任 | 取消失败进入 unknown 而非假 cancelled(若方案如此定义则测试锁定) |
| 测试场景 | Runner 可取消;Runner 无响应 → unknown;已终态 cancel 幂等成功 |
| 回退核对 | 回退保留「至少不双执行」不变量 |
| 自查 | |
---
## 7. 工作包级抽查模板(阶段 1/2 + 取消相关包)
对方案中每个相关工作包复制下表(ID 以方案为准):
| 工作包 ID | 阶段 | 规范 Nxx | 代码位置(方案 vs 本机) | 依赖 | 责任范围 | 测试场景可执行? | 回退可操作? | 判定 |
|---|---|---|---|---|---|---|---|---|
| WP-? | 1 | | | | | 是/否 | 是/否 | |
| WP-? | 2 | | | | | | | |
| WP-? | cancel | | | | | | | |
**阻断级缺省**(出现任一条则该包不得开工实施):
1. 无精确文件/包路径,或路径在本机 `dev@8f0e31e5` 已改名且方案未更新。
2. 测试场景只有「手动看看」或依赖 stub 作交付。
3. 回退是「再想想」或要求硬重置/删库。
4. 扩大写路径/mutex 未在任务登记中重新认领。
5. 将卡片/SSE/前端缓存当作授权或权威状态。
## 8. 产物机器回填指引
1. 在产物机器打开方案 + 本清单(本清单合入本机 `dev` 后,经授权 `push` 或手动同步到产物机器)。
2. 先填 §2 的 N01–N22 映射;未填完不得宣称阶段 1 审核通过。
3. 按 §4–§6 逐条标 `符合`/`偏差`/`阻断`,证据写入方案附录或 `.doc/test-reports/`(普通文档级即可)。
4. 若有 `阻断`:只改方案文档,**不**开工对应业务代码;修正后更新方案 `updated` 与衔接说明。
5. 全部阶段 1/2 + 取消契约无 `阻断` 且偏差有修订计划后,在产物机器 CURRENT 登记「方案审核通过、待实施授权」——实施须**另开**任务与授权,不由本清单授权。
6. 本清单单列任务 `modular-refactor-review-2026-09-23`;方案合入/实施不得冒用本 task_id 扩权。
## 9. 本机环境与证据边界
| 项 | 记录 |
|---|---|
| 本机 | macOS Darwin;仓库 `/private/tmp/Agent-System` |
| 方案正文 | **不可见**(另一主机 `/home/weichen/projects/...`;origin/frp-mix 无对应分支) |
| agentctl | 本机已可用 `with` / `docs apply` / `validate` / `integrate`(进程层);创建本任务时已 `task register` |
| 清单性质 | 审核**方法**与核对项,不是对方案正文的已审结论 |
## 10. 相关链接
- 任务记录:[../ops/short-term/2026-09-23-modular-refactor-review.md](../ops/short-term/2026-09-23-modular-refactor-review.md)
- 模块开发规范:[../system-design/2026-09-20-module-development-standards.md](../system-design/2026-09-20-module-development-standards.md)
- A–G 分批:[../remediation/2026-09-20-module-decoupling-batch-plan.md](../remediation/2026-09-20-module-decoupling-batch-plan.md)
- 耦合审计:[./2026-09-20-module-coupling-audit.md](./2026-09-20-module-coupling-audit.md)
- 验证契约:[../ops/2026-09-21-validation-contract.md](../ops/2026-09-21-validation-contract.md)
- gap-matrix:[../remediation/gap-matrix.md](../remediation/gap-matrix.md)
- 操作规范:[../ops/2026-09-21-agent-worktree-workflow.md](../ops/2026-09-21-agent-worktree-workflow.md)
+9 -1
View File
@@ -13,6 +13,14 @@
## 核心文档(按阅读顺序推荐)
### 模块化重构方案审核检查清单(2026-09-23)
**文件**: [2026-09-23-modular-refactor-plan-review-checklist.md](./2026-09-23-modular-refactor-plan-review-checklist.md)
**结论**: 产物机器方案(`modular-contract-standard-2026-09-22`)本机不可见;本清单按已生效模块开发规范与 A–G/验证契约,覆盖阶段 1、阶段 2 与取消状态契约自查项,并留「22 条规范」映射回填。不实施业务代码。
**任务**: [short-term](../ops/short-term/2026-09-23-modular-refactor-review.md)
### 模块耦合现状(2026-09-20)
**文件**: [2026-09-20-module-coupling-audit.md](./2026-09-20-module-coupling-audit.md)
@@ -189,7 +197,7 @@
**结论**: 消息仍在数据库;文档任务与激活前消息缺阶段作用域,被刷新后的窗口过滤器剔除,而统计仍返回未过滤数量。
**整改**: [对话刷新恢复与阶段授权一致性整改方案](../remediation/2026-09-13-chat-history-refresh-remediation.md)
**整改**: [对话刷新恢复与阶段授权一致性整改方案](../remediation/2026-09-13-chat-history-refresh-remediation.md)(2026-09-22 口径裁定:gap `CHAT-HISTORY-REFRESH` = PASS;见 [reconcile](../ops/short-term/2026-09-22-chat-history-refresh-reconcile.md))
### 0️⃣ 当前状态(Live SSOT)
+12
View File
@@ -0,0 +1,12 @@
# 问题与修复台账
维护规则:[问题记录与开发经验闭环](../ops/2026-09-23-issue-learning-workflow.md)。每个问题一个稳定 ID;主记录是事实与状态来源,本表为可检索投影。新发现及时登记,修复后保留记录;发布 blocker 仍见 [gap-matrix](../remediation/gap-matrix.md)。
更新:2026-09-23。本轮为初始建库,仅补录两个历史案例;下列历史 resolved 不表示本日运行回归通过。
| issue_id | 模块 / 检索词 | 问题 | 严重度 | issue_state | owner | 证据日期 / 范围 | 唯一主记录 | 经验 |
|---|---|---|---|---|---|---|---|---|
| ISSUE-20260923-nullable-duty | docgov / nullable / 23503 / reviewer_id | 可选职责空值写 0 导致 FK 失败 | high | resolved | Codex(历史补录) | 2026-09-17;历史 PG / API 冒烟;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#nullable-duty) | [LESSON-20260923-nullable-duty](../ops/lessons/2026-09-23-nullable-duty.md) |
| ISSUE-20260923-content-hash | docrevision / canonicalize / hard-break / 404 | 规范化破坏 Markdown 语义并造成正文哈希漂移 | critical | resolved | Codex(历史补录) | 2026-09-14;历史真实 UI / 重启;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#content-hash) | [LESSON-20260923-content-hash](../ops/lessons/2026-09-23-content-hash.md) |
| ISSUE-20260923-coordination-authority | agentctl / claim / SQLite / CAS / CURRENT / FEATURE-MATRIX | 本地副本 CAS 与任务许可不能表达跨主机全局权威认领 | high | investigating | Codex(研究) | 2026-09-23;源码/只读状态,未复现具体丢写 | [主记录](../ops/short-term/2026-09-23-coordination-db-daemon-research.md#issue-20260923-coordination-authority) | 沿用 content-hash 投影经验;跨机结论待实施验证 |
| ISSUE-20260923-matrix-status-regression | FEATURE-MATRIX / module-batches-ag / merge / docs-apply | 矩阵行 done 被 closeout 合并冲突手解回退为 planned | high | resolved | Cursor | 2026-09-23;本机 dev tip 与 git 考古;docs apply 已恢复 | [主记录](2026-09-23-matrix-status-regression.md) | [LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md) |
+24 -3
View File
@@ -1,6 +1,6 @@
# Agent worktree 与 L1 操作规范
**修订**:`agent-governance-2026-09-21-r1`。来源:[AGENTS](../../AGENTS.md)、[规范登记](./2026-09-21-policy-registry.md)。工具为 `scripts/agentctl`(Python 标准库,Linux 本机),协议 v1;实际安装与验证见[实施任务](../archive/ops/2026-09-21-agent-governance-implementation.md)。
**修订**:`agent-governance-2026-09-21-r1`。来源:[AGENTS](../../AGENTS.md)、[规范登记](./2026-09-21-policy-registry.md)。工具为 `scripts/agentctl`(Python 标准库,macOS/Linux 双平台),协议 v1;实际安装与验证见[实施任务](../archive/ops/2026-09-21-agent-governance-implementation.md)。
本规范约束合作 Agent 的统一操作入口和 Git 提交/引用门禁。任意同 UID shell、修改管理器或跳过 hooks 仍可绕过;不把 L1 宣称为 OS 沙箱。共享服务配置与产品数据库不属于任务素材。
@@ -121,13 +121,34 @@ validate 要求干净树、记录精确 HEAD 与命令摘要;必要的实际
任务状态、集成、部署、远端同步和 cleanup 分别记录,见[收口清单](./templates/session-close-checklist.md)。命令结束不等于任务完成;task close 会拒绝仍有运行或待恢复 operation 的任务。
### 8.1 只读盘点(先盘点,再人工处置)
```bash
# 批量 worktree 清理就绪度;verdict=ready 才可考虑 remove。从不自动删除。
./scripts/agentctl cleanup report
# FEATURE-MATRIX 状态漂移:硬告警仅 done→非 done(ISSUE-20260923 工具化);
# open_capabilities 为人工判断候选。从不自动升 done / 写 MATRIX。
./scripts/agentctl docs drift
```
daemon 前台循环可按 `--audit-every N`(默认 30)周期跑上述盘点;**不在 daemon 内调用 `docs apply`**(主目录 cwd 必 `WORKTREE_MISMATCH`)。常驻 systemd/launchd 装载需独立授权,本规范默认不装载。
### 8.2 关闭与删除
```bash
./scripts/agentctl task close --id task-id --status done
./scripts/agent-worktree.sh remove feature/task-id --delete-branch
```
清理由目录外的维护者执行,核对实际 Git 映射、dev 祖先、所有证据、tracked/untracked/ignored 文件、未完成 Git 操作、registry、生命周期锁和使用目录的进程。只用普通 remove/-d,拒绝时保留 cleanup_pending 和复查责任,不换成强制删除。
清理由目录外的维护者执行,核对实际 Git 映射、dev 祖先、所有证据、tracked/untracked/ignored 文件、未完成 Git 操作、registry、生命周期锁和使用目录的进程。只用普通 remove/-d,拒绝时保留 cleanup_pending 和复查责任,不换成强制删除。盘点只读;删除仍人工;拒绝即保留 cleanup_pending。
**本机限制**:无法读取某些同 UID 进程 cwd 时,工具不能证明其未使用目录,故保留 cleanup_pending;只有明确识别的 OS 用户 systemd 管理进程有诊断性例外。测试中的 3 个删除正例仅替换 `/proc` 枚举以模拟可见主机,其余 Git/锁/文件条件为真实执行;可见占用、未知不可读、未合入、脏文件与活跃登记的拒绝另有真实/针对性测试。不要把这项限制转成跳过检查的通用开关。
**本机限制**:无法读取某些同 UID 进程 cwd 时,工具不能证明其未使用目录,故保留 cleanup_pending;明确识别的 OS 用户 launchd(macOS)/systemd(Linux)管理进程有诊断性例外。进程 cwd 可见性走双路径:Darwin 用 `lsof`,Linux 用 `/proc`;测试中的删除正例可替换对应枚举以模拟可见主机,其余 Git/锁/文件条件为真实执行;可见占用、未知不可读、未合入、脏文件与活跃登记的拒绝另有真实/针对性测试。不要把这项限制转成跳过检查的通用开关。
保护任务、旧 detached 工作区和非本次产物不自动清理。用户未要求 push 时仅本地提交/合入;用户已要求时再按授权同步并核对远端引用。
### 8.3 CodeGraph(治理加速器)
- `agentctl init` 与 `agent-worktree.sh create` 会 best-effort 初始化/同步 `.codegraph/`(CLI 缺失则跳过,不阻断)。
- `hooks install` 安装 `post-merge` / `post-checkout` → `hooks codegraph-sync`(fail-open,永不阻断 integrate)。
- 会话启动执行 `codegraph sync -q`。索引是 tree-sitter **近似**:有假阴性;**grep 是完整性唯一权威**;重命名与穷举调用方必须 grep 确认。
+18
View File
@@ -27,3 +27,21 @@ CURRENT 是带时间的活跃协调快照;Git/机器状态用于核验实际
## Herdr v1.2 局部修订
用户已授权采纳经研究修正的资源分工与自动审批。Herdr roster 的角色/额度/客户端参数由 `herdr-v1.2` 取代旧路由,仅在明确使用 Herdr 时激活,不扩展通用会话工作流。具体来源、验证与生效集成见[本轮任务](../archive/ops/2026-09-21-herdr-orchestration-v12.md)。已通过 dev 合并提交 `8c5e3477585fe27a485343dac97a670d95cf8905` 生效;profile/dry-run、入口保护和 Kimi 原子计数有隔离验收,真实 Herdr pane 启动未在本轮执行,不将其记为已实测。
## 系统问题分析局部修订
修订 ID:`systemic-issue-analysis-2026-09-23-r1`;owner:`Codex`;state:`active`(已通过 `958dd44fee8bbea8d19129457fc0ad749fdebdbe` 合入 dev);工具能力:`manual`。用户明确要求将“由个案追查同类根因、潜在问题,研究并提出方案”加入规范,授权与验证见 [任务记录](./short-term/2026-09-23-systemic-issue-analysis.md)。
核心行为唯一来源为 [AGENTS 分析要求](../../AGENTS.md#bug-与系统问题的分析要求),验证范围由 [验证契约](./2026-09-21-validation-contract.md#问题修复的回归范围) 定义,[分析模板](./templates/audit-note.md) 承载证据。客户端继续引用统一入口。生效提交为 `958dd44fee8bbea8d19129457fc0ad749fdebdbe`,候选验证与受控集成收据见任务记录;不新增业务实施或环境操作授权。
## 问题记录与经验复用局部修订
修订 ID:`issue-learning-2026-09-23-r1`;owner:Codex;state:`active`(已通过 `7bbd7a407f857515005c0324d90339017ea5f3e8` 合入 dev);执行能力:`manual`。用户要求同时管理出现的问题、修复记录和思路,并及时总结为开发注意事项,授权与验证见 [任务](short-term/2026-09-23-issue-learning.md)。
[闭环规范](2026-09-23-issue-learning-workflow.md) 为本流程唯一来源;AGENTS 增加按任务触发的读取/更新入口,模板承载证据,问题台账和经验索引提供检索。生效提交为包含本修订的首个受控 dev 集成提交,以任务收据与 Git 父链核实;未合入不能声称全仓生效。此修订不新增产品功能、自动门禁或运行权限。
## CodeGraph 与只读盘点局部修订
修订 ID:`codegraph-governance-2026-09-24-r1`;owner:`Cursor`;state:`active`(生效 tip `19eb56e3744d3c7d4b69b065c87e27689e8caa53` / fixup `0c676afe1faf831020c7c3201509d7cec0328d53`);工具能力:盘点命令与 hooks sync 为 `enforced`(脚本已落地);常驻 daemon 装载仍为 `manual`(本机默认不装载)。用户授权:将 CodeGraph 纳入治理启动/建场/sync,并对 worktree 清理与 FEATURE-MATRIX 做只读盘点提醒(不自动删除、不自动升 done)。
唯一来源增补:[AGENTS §1/§4](../../AGENTS.md)、[worktree 操作规范 §8](./2026-09-21-agent-worktree-workflow.md)、[收口清单](./templates/session-close-checklist.md)。命令入口:`agentctl cleanup report`、`agentctl docs drift`、`agentctl hooks codegraph-sync`、建场 `agent-worktree.sh create` 的 best-effort `codegraph init`。不改产品 SWBOOT-10 stub,不装载 systemd coordinator(需另授)。
+13 -4
View File
@@ -15,6 +15,12 @@
多类变更取并集。按 [模块开发标准](../system-design/2026-09-20-module-development-standards.md) 追加边界与 registry parity 等范围门禁。开发阶段可用 stub;交付验收不能冒充真实执行。纯文档无需产品 PI 或全量 Go,也不为形式重建服务。
## 问题修复的回归范围
Bug/系统问题修复先按 [AGENTS 分析要求](../../AGENTS.md#bug-与系统问题的分析要求) 确定问题类别和影响范围,再从上表选择验证层级。验收须包含:原始复现案例;通过同一机制的其他输入、措辞或入口;相关边界/异常路径;应保持不变的正常行为。场景按实际因果链选择,不机械穷举;不适用或未覆盖的项记录理由与风险。
验证机制和预期行为,不以硬编码原句、固定回复文本或单个样例通过代替回归。能在修复前复现失败的场景记录修复前后对照;不能复现时说明证据限制。报告逐项区分通过、失败、未运行与待验证;只提供分析/方案时列出验收设计,不声称已经运行或修复。
## 产品 PI 基线与精确追加
优先入口:`./scripts/run-nightly-real-pi.sh`。调用前核验并从获授权配置提供(不在命令/报告贴凭证值):
@@ -25,14 +31,17 @@
- 目标环境批准的实际模型、协议及制品;通过 `PI_AGENT_MODEL` 传入批准值并比对 Runner 实际配置。脚本默认值不构成批准,也不证明实际模型。
- 脚本可能构建候选镜像、写 promotion receipt;须满足构建身份/授权条件。`NIGHTLY_SKIP_IMAGE_BUILD=1` 不能补足缺失的制品摘要证据。
脚本当前筛选 **仅两项**:
脚本当前筛选 **五项**(U8 + 四条工作流治理链):
```text
TestMultiIntentU8_RealPI_ConfirmGenerate_PG
TestWorkflowGovernance_PiAgent_PG_FullChain
TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain
TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain
TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain
```
它不是“全部工作流通过”。按变更范围追加精确名称,例如(前提条件已核验,且已处于相应环境执行租约/独立环境):
它覆盖 main / product_manager / test_manager / FullNone 四条工作流治理链,但**不是**「全部工作流通过」,也不含 rdev P3 Go 顶层(rdev 仍用 Python 三样本 harness)。按变更范围追加精确名称,例如(前提条件已核验,且已处于相应环境执行租约/独立环境):
```bash
go test -count=1 -timeout 2h -v ./internal/server/ -run '^TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E$'
@@ -43,7 +52,7 @@ go test -count=1 -timeout 90m -v ./internal/server/ -run '^TestWorkflowGovernanc
测试筛选区分大小写;`-run 'PI'` 不能选择名称中的 `PiAgent`。追加用例先读其环境前提;FullLifecycle 中 `RUN_FULL_ADHOC_WBS` 与 `RUN_HEAVY_STAGES` 控制额外段,不能把默认未跑段报为已覆盖。普通 PG 用例同样以源码中的精确名称/前提为准。
运行前列 `expected_tests`(含必须子场景),运行后逐项对照执行、PASS、FAIL、SKIP、未匹配及重试。退出码 0 或 nightly receipt `pass` 不能替代该对照:基线脚本逐项核对两个预期顶层测试;额外子场景/用例仍须逐项核验。缺项不记 PASS,基础设施问题记录 blocker/infra_fail。保留首轮与重试关系,不隐藏失败。
运行前列 `expected_tests`(含必须子场景),运行后逐项对照执行、PASS、FAIL、SKIP、未匹配及重试。退出码 0 或 nightly receipt `pass` 不能替代该对照:基线脚本逐项核对五个预期顶层测试;额外子场景/用例仍须逐项核验。缺项不记 PASS,基础设施问题记录 blocker/infra_fail。保留首轮与重试关系,不隐藏失败。
## 模型与环境证据
@@ -59,4 +68,4 @@ go test -count=1 -timeout 90m -v ./internal/server/ -run '^TestWorkflowGovernanc
## 工程工具验收补充
本地协调与运维守卫使用 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`,在临时真实 Git/SQLite/进程环境执行;Docker 守卫测试使用受控目标记录调用,不重建共享服务。nightly 入口现在核对最终尝试日志中两个预期顶层测试均恰好执行且 PASS;零用例、部分 SKIP 或重复拼接证据均不能生成 PASS 收据。该日志核验不是本轮执行了产品 PI 的声明。
本地协调与运维守卫使用 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`,在临时真实 Git/SQLite/进程环境执行;Docker 守卫测试使用受控目标记录调用,不重建共享服务。nightly 入口现在核对最终尝试日志中五个预期顶层测试均恰好执行且 PASS;零用例、部分 SKIP 或重复拼接证据均不能生成 PASS 收据。该日志核验不是本轮执行了产品 PI 的声明。
@@ -0,0 +1,38 @@
---
title: "agentctl Cursor 能力层(skills / MCP / rules / hooks)"
status: active
created: 2026-09-23
updated: 2026-09-23
owner: Cursor
task_id: agentctl-cursor-integration-2026-09-23
---
# agentctl Cursor 能力层
把已上线的 agentctl 管理面包装为 Cursor 原生能力,使 agent 默认走租约 / docs 收据 / 候选合入。
## 能力清单
| 层 | 路径 | 作用 |
|---|---|---|
| MCP | [`.cursor/mcp.json`](../../.cursor/mcp.json) → [`scripts/mcp/agentctl-mcp.mjs`](../../scripts/mcp/agentctl-mcp.mjs) | `status` / `task_*` / `lease_run` / `docs_*` / `validate` / `queue_enqueue` / `quarantine_status` |
| Skills | [`.cursor/skills/agentctl-*`](../../.cursor/skills/) | 会话启动、建场、租约写、集成收口 |
| Rule | [`.cursor/rules/agentctl-mandatory.mdc`](../../.cursor/rules/agentctl-mandatory.mdc) | alwaysApply:强制走 agentctl |
| Hooks | [`.cursor/hooks.json`](../../.cursor/hooks.json) + `guard-git.sh` | `git push` / 破坏性 git → `permission: ask` |
权威规则仍是 [AGENTS.md](../../AGENTS.md) 与 [操作规范](./2026-09-21-agent-worktree-workflow.md);本目录不复制全文。
## 启用
1. 合入 local `dev` 后,在 Cursor 中 **Reload Window** 或重载 MCP。
2. 确认 MCP 服务器 `agentctl` 出现在工具列表;hooks 出现在 Cursor Hooks 设置页。
3. 会话开始跟 skill `agentctl-session-start`(核对 `daemon status`)。
## 与管理面关系
- launchd `com.agentctl.coordinator` 持续 `queue schedule`;本能力层只封装 CLI,不替代 daemon。
- git hooks(pre-commit / pre-merge / reference-transaction)仍由 `agentctl hooks` 管理,与 Cursor `beforeShellExecution` 互补:前者执行租约/候选门禁,后者拦未授权 push/强推。
## 非目标
不 push;不晋升 test/main;不改 gap-matrix;不卸载 daemon。
@@ -0,0 +1,61 @@
# 问题记录与开发经验闭环
修订:`issue-learning-2026-09-23-r1`;owner:Codex;生效条件见 [规范登记](2026-09-21-policy-registry.md)。执行能力为 `manual`:依靠 Agent 读取、任务记录与审查;本轮没有增加自动检索、CI 阻断或模型训练。
## 入口与职责
| 入口 | 回答的问题 | 权威边界 |
|---|---|---|
| [问题台账](../audit/ISSUES.md) | 出现过什么问题,目前处理到哪一步? | 索引和状态投影;事实、修复经过以链接的唯一问题主记录为准 |
| 问题主记录 | 为什么发生、考虑过哪些方案、改了什么、如何验证? | 放 audit,或沿用已有任务/审计中的明确章节;使用 [问题模板](templates/issue-record.md) |
| [开发经验](lessons/INDEX.md) | 遇到类似工作应先检查什么? | 按机制提炼的注意事项;使用 [经验模板](templates/development-lesson.md),不替代现行规范 |
| CURRENT / FEATURE-MATRIX / gap-matrix | 当前协调 / 能力 / 发布门禁 | 维持原职责;只有对应状态改变才更新 |
修复方案、任务、提交、验收报告通过链接串联,已有材料直接复用。一个 task 可处理多个 issue,一个 issue 可跨分析/实施任务;研究任务 done 不等于问题 resolved。一个 lesson 可覆盖多个同根因 issue。短问题可在任务主文档内记录,无需机械创建一套文件。
## 何时记录、检索和总结
1. **设计、编码、排障或运维前**:按模块、路径、错误码、症状和共用机制检索问题台账及经验索引。先查索引、再读命中条目的来源;核对当前源码/规范是否仍适用。在任务记录填写检索词、命中 ID、采纳的检查;无命中明确记录。简单信息答复不要求建任务或检索整库。
2. **首次发现问题时**:在当前任务 worktree 建立或补充问题主记录和台账行,记录预期/实际、影响、环境/版本、owner、下一步及证据缺口;尚未定位也可以登记。ID 使用 `ISSUE-YYYYMMDD-<slug>`,日期为登记日;发生日期另列,跨 worktree 以语义 slug 避免抢序号。
3. **定位、改方案、完成修复或发现验收失败时**:在同一主记录追加时间线和尝试结果;保留被否定假设、失败方案及不适用条件,区分观察、推测和已证实根因。按 [问题分析要求](../../AGENTS.md#bug-与系统问题的分析要求) 检查共用机制和同类入口。
4. **根因与修复得到验证后、任务收口前**:提炼经验或更新已有同机制经验,并链接回问题。若尚无验证证据,只能建 `candidate`;若没有新增可复用结论,记“不新增经验”及理由,仍保留问题记录。分析-only、未修复或验收失败的问题继续留在台账。
5. **经验落到开发动作**:写清触发条件、机制、应做检查、错误做法及原因、验证方法、适用边界。优先链接现有测试/约束;需要新增回归、lint、架构门禁或规范时,在当前授权内实施,超出授权则记录 owner/后续任务。仅提出自动化建议不能标为已落实。
6. **复发或规则变化时**:同一故障未解决的复现追加原 issue;已关闭问题再次出现,重开原 issue 为 `investigating`,递增 `recurrence_count` 并保留原关闭证据。不同根因建立新 issue 并互相链接。复盘为何已有经验/测试未生效:未检索、范围不适用、遗漏入口、检查未执行或实现回退,并更新防护。模块/接口/规范变化时复核命中经验;确认过时标 `superseded` 并链接替代条目,无替代则 `retired`,保留历史。
检索示例(在任务工作区执行,替换为本任务关键词):
```bash
rg -n -i 'docgov|nullable|23503|职责' .doc/audit/ISSUES.md .doc/ops/lessons
```
owner 在上述里程碑及时更新,最迟在会话交接前保存事实和未完成项;不依赖定时服务。经验不会自动改变模型参数,作用是让后续 Agent 能检索、有证据地复用,并逐步把重复风险转换为可执行检查。
## 问题状态与关闭条件
问题的 `issue_state` 与任务 `status` 分开;台账保留当前投影,主记录保留变迁历史。
| issue_state | 含义 / 转移要求 |
|---|---|
| open | 已登记,等待定位 |
| investigating | 正在复现、验证假设和范围 |
| fixing | 修复方案明确且已获实施授权 |
| verifying | 修复待验收,或必要证据尚缺 |
| resolved | 约定范围的修复、必要环境验收均有证据,经验已总结或有不新增理由 |
| deferred | 暂缓处理;保留风险、责任人、复查触发和授权/决策依据,不冒充修复 |
| duplicate | 指向唯一主 issue,保留原报告和去重理由 |
定位失败可保留 investigating;临时止血不代表 resolved,必须标清剩余根治项。验证失败回到 investigating/fixing,不能覆盖失败记录。关闭至少能追溯:根因、同类范围、修复提交或获授权的处理动作、原例/变体/正常行为验收及缺项、实际部署状态、lesson 或不新增理由。业务改动待部署时不能把目标环境问题关闭;无需部署写 not_required。
**历史补录**:发生日、修复日和补录日分开。只按旧报告已证明的范围记录 `resolved`,同时标 `evidence_basis=historical` 和当前运行未复测;缺乏关闭证据用 `verifying` 并说明原因,不从旧任务 done 推导修复完成。历史条目不能用于宣布当前系统就绪。本轮仅补录两个有来源案例,不代表穷尽全部历史问题。
## 经验质量与维护
`lesson_state`:`candidate | validated | superseded | retired`。validated 表示注意事项有可核对的因果证据且已复核适用边界,不表示所有模块或当前线上均测试通过。需记录 reviewer、last_reviewed、reviewed_revision、来源 issue、证据日期、关键词、关联测试、适用/不适用范围及仍缺的防护。
同机制优先更新已有 lesson,保留修订记录;新机制才新增 `LESSON-YYYYMMDD-<slug>`。将通用经验升级成强制规范时,只在对应规范的唯一来源修改并登记生效条件,经验条目保留理由与链接。经验与现行规范冲突时先按有效规范执行,登记冲突与复核项;历史经验不能授予数据修复、部署或扩大范围的权限。
## 并发、验收与敏感信息
所有写入沿用 [worktree 操作规范](2026-09-21-agent-worktree-workflow.md)。问题/经验索引使用各自 `path:` 短租约;当前 `agentctl docs apply` 仅覆盖 CURRENT/FEATURE-MATRIX,不宣称新索引有行级 CAS。写入前读最新内容、只改自己的条目;从旧 dev 分出的工作区在集成前合并最新 dev 并处理索引冲突,保留他人条目。索引和主记录在同一逻辑提交同步,避免状态分叉。
文档验收包括链接/锚点、ID 唯一、主记录与索引状态一致、来源及日期、入口/模板可达和情景检查。运行回归按 [验证契约](2026-09-21-validation-contract.md);未运行、缺项与历史证据单独标明。只保留足够判断的脱敏证据,业务正文、凭证和个人数据不复制进经验库。
+19 -29
View File
@@ -1,62 +1,52 @@
# 当前焦点
**更新**:2026-09-22。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。本轮状态对账不改变 `production_ready`,不升 FEATURE-MATRIX 行。
**更新**:2026-09-22(dev 门禁复验与 test 晋升收口)。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。
手工 CAS 前 `document_sha256`:`6cadc69b6ec680e9edda74683686196a8774e42ee43033e6ba6abf1ab1933cbf`(`docs apply` 在本 macOS 宿主因 `/proc` 不可用,见 [对账任务例外](./short-term/2026-09-22-status-reconcile.md))。
手工 CAS 前:本 macOS 宿主 `docs apply`/`with`/`validate`/`integrate` 因 `/proc` 不可用;本轮文档与环境写采用手工等效(见任务例外登记)。
## 焦点
1. **状态对账收口(本轮)**:本机主目录为 2026-09-21 23:49 全新 clone;CURRENT 09-21 登记的历史 worktree 在本机不存在。governance-adoption 已按生效提交证据收口为 done;partial-deferred 保持 in_progress(W5–W7 真实未完成)。详见 [对账任务](./short-term/2026-09-22-status-reconcile.md)。
2. **另一会话进行中**:`dev-prod-ready-test-promotion-2026-09-22`(Cursor)仍 active;首批合入已在本地 `dev@a3150dcb`。本对账任务不改其状态、不触碰其 worktree。
3. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;dev 生效提交 `7e9317b8`。本机 macOS 上 `with`/`docs apply`/`validate`/`integrate` 不可用,受测 Linux 主机仍 enforced;OS 隔离不在范围。
1. **dev→test 已晋升**:`origin/dev@591ea601`(schema 61 门禁绿);`origin/test@83c6a12a` + tag `rc-v1.1.0-beta.1`;test 环境 health schema=61、Runner `MiniMax-M3`。[报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)。
2. **本任务 cleanup=pending**:feature / integrate / promote-test worktrees 待独立维护者按门禁复查后清理;不强删。
3. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;本机 macOS 上租约路径不可用,受测 Linux 主机仍 enforced。
## 并行认领
| owner | task | branch | worktree | mutex | status |
|---|---|---|---|---|---|
| Cursor | 2026-09-22-status-reconcile | feature/status-reconcile-2026-09-22 | .worktrees/status-reconcile-2026-09-22 | ops-status-reconcile | done |
| Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | in_progress |
| Cursor | integrate-dev-prod-ready-test-promotion-2026-09-22 | feature/integrate-dev-prod-ready-test-promotion-2026-09-22 | .worktrees/integrate-dev-prod-ready-test-promotion-2026-09-22 | git:dev | in_progress |
| Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | done |
| Cursor | integrate-dev-prod-ready-test-promotion-2026-09-22 | feature/integrate-dev-prod-ready-test-promotion-2026-09-22 | .worktrees/integrate-dev-prod-ready-test-promotion-2026-09-22 | git:dev | done |
| Cursor | promote-test-2026-09-22 | feature/promote-test-2026-09-22 | .worktrees/promote-test-2026-09-22 | git:test | done |
| Codex | 2026-09-21-agent-workflow-governance-adoption | feature/agent-workflow-governance-plan | (本机 clone 后不存在) | agent-workflow-governance | done |
| Cline | 2026-09-16-partial-deferred-completion | docs/partial-deferred-completion-plan | - | architecture-docs | in_progress |
活跃任务的写路径、base_dev_sha、授权与验证计划见主任务记录与 `agentctl status`;历史 claim 不能代替当前登记。09-21 已交付且已合入 dev 的认领行已迁出本表,完整索引见 [归档](../archive/ops/2026-09-21-current-history.md)。
## 清理接管与遗留现场
**本机(2026-09-22)**:`git worktree list` 仅主目录 + 上表三个 `.worktrees/*`。下列路径在本 clone **不存在**;远端相关分支大多已是 `dev` 祖先。cleanup_owner 仍为复查责任,不增加删除授权;不因「目录不存在」批量删远端分支。
| 路径/事项 | 分类与保留原因 | cleanup_owner | 复查触发 |
|---|---|---|---|
| 09-21 历史任务 worktree 清单(herdr / governance / material-chunk / workflow-scope / upload-parse / mineru / intent-confirm / taskrun-status / doc-key / multiuser / initial-load / agent-lock / agent-policy 等) | 原 cleanup=pending;本机全新 clone 后目录不存在;证据在归档与 test-reports | 独立维护者 | 若在其他宿主仍有目录:按门禁核祖先/证据/进程后再 remove |
| Cline `2026-09-16-partial-deferred-completion` | 仍 in_progress;无登记 worktree;W5–W7 未关闭 | Cline owner / 维护者接管 | 单独授权实施或交接后更新状态 |
| `.worktrees/fix-dev-runtime-data-root-guard` / FAV 相关保护路径 | 保护项;故意不合入、不删 | 原 owner / 维护者 | 用户调整保护边界并重新核验后 |
| `.kilo/worktrees/stealth-ice` | 非本轮;本 clone 不存在 | 原 owner 待核实 | 其他宿主若仍存在再查明 |
| 远端 `origin/feature/software-project-bootstrap` | tip `d3bb7520` 对 dev 补丁等价(`git cherry` `-`);无需合入 | 维护者 | 可选清理远端引用(须单独授权) |
| 远端 `origin/feature/remove-herdr-agent-settings` | **保护分支**;已被 Herdr v1.2 反向取代;不合入 | 维护者 | 用户调整保护边界后 |
cleanup=pending 不是任务状态;普通 remove/-d 拒绝时记录原因,不升级强删。历史完成/取消认领、原证据索引和环境快照见 [归档](../archive/ops/2026-09-21-current-history.md)。
| `.worktrees/dev-prod-ready-test-promotion-2026-09-22` 等本轮三个 worktree | 任务 done;cleanup=pending;证据已入 test-reports / gap-matrix | 独立维护者 | 核对 tip 为 origin/dev 或 origin/test 祖先、无进程后 remove |
| Cline `2026-09-16-partial-deferred-completion` | 仍 in_progress;W5–W7 未关闭 | Cline owner / 维护者 | 单独授权实施或交接 |
| 保护分支 / FAV 相关 | 保护项;故意不合入、不删 | 原 owner / 维护者 | 用户调整保护边界后 |
| embedding 401(dmxapi) | 非 blocker 运维债;不挡 PI | 运维 | 换钥后重跑 chunk index |
## 集成槽位
| holder | phase | since | scope | queue |
|--------|-------|-------|-------|-------|
| - | idle | 2026-09-22 | 对账已合入 `dev@38ed539f`;另一会话仍占 integrate 登记,后续合入须串行 | - |
| - | idle | 2026-09-22 | 本轮合入与 test 晋升已完成并推送;后续合入须重新认领串行 | - |
**phase**: `idle` | `merging` | `smoke` | `e2e`
> 合入 `dev` + 共享容器验证必须串行。实际机器锁/进程优先;详见 [操作规范](./2026-09-21-agent-worktree-workflow.md)。
## 受控约束
- 禁止整支 merge FAV;`FAV_DEGRADED_READ=false`;FAV live 观察窗以证据驱动。保留保护分支 `feature/final-artifact-vault`、`feature/remove-herdr-agent-settings`、`fix/project143-controlled-content-404-diagnosis`、`fix/dev-runtime-data-root-guard`、`dev-old-linear`;不删 `origin/*`。
- 不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEMANTIC_SUMMARY_REPLACE` 不随 W2 开启;项目 143 只读、禁止终止;SWBOOT-10 保持 fail-closed stub。
- D7 对话 ADR 仍待合规签字;追踪表类别 `record` 不授权物理删除。模块解耦 A–G 与回溯切片按各自最新主任务认领/证据判断,不因历史设计或本次对账自动启动。
- `fix/clean-test-env-baseline` 不 merge;仅保留已挑拣的 `SEED_DEMO_USERS=false`。主运行目录与 worktree 的服务边界、重建与恢复要求见操作规范;MinerU 旧挂载事故与二轮证据见历史快照。
- 禁止整支 merge FAV;保留既有保护分支;不删 `origin/*`(本轮仅前进 `dev`/`test` 与新增 rc tag)。
- 不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEED_DEMO_USERS=false` 在 test 保持。
- D7 对话 ADR 仍待合规签字;追踪表类别 `record` 不授权物理删除。
- main 未在本轮晋升。
## 活跃入口
- [操作规范](./2026-09-21-agent-worktree-workflow.md) · [规则来源/生效](./2026-09-21-policy-registry.md) · [验证契约](./2026-09-21-validation-contract.md)
- [状态对账](./short-term/2026-09-22-status-reconcile.md) · [dev 门禁与 test 晋升](./short-term/2026-09-22-dev-prod-ready-test-promotion.md)
- [模块开发标准](../system-design/2026-09-20-module-development-standards.md) · [governance 交接](./handoffs/2026-09-21-agent-workflow-governance-plan.md)
- [partial-deferred 主任务](./short-term/2026-09-16-partial-deferred-completion.md) · [历史证据与环境快照](../archive/ops/2026-09-21-current-history.md)
- [dev 门禁与 test 晋升任务](./short-term/2026-09-22-dev-prod-ready-test-promotion.md) · [报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)
- [gap-matrix](../remediation/gap-matrix.md) · [partial-deferred 主任务](./short-term/2026-09-16-partial-deferred-completion.md)
@@ -1,72 +1,74 @@
---
title: "纯软件项目自举工作流验收清单"
status: planned
status: in_progress
created: 2026-09-14
updated: 2026-09-14
updated: 2026-09-22
related_task: "ops/long-term/2026-09-14-software-project-bootstrap-implementation.md"
redline_evidence: "ops/short-term/2026-09-22-redline-evidence.md"
---
# 纯软件项目自举工作流验收清单
> 本文件是未来实施验收计划,当前全部用例均为 `NOT RUN`。不得把设计评审、stub、接口注入或静态 JSON 写成真实功能 PASS。
> 不得把设计评审、stub、接口注入或静态 JSON 写成真实功能 / 真实 PI / UI PASS。
> **2026-09-22 红线证据批次**(SHA `364ed7f1`):仅复验无需真实仓写的 L1–L4 子集;L5/L6 **pending auth**。报告:[../../test-reports/2026-09-22-redline-evidence-swboot-test-report.md](../../test-reports/2026-09-22-redline-evidence-swboot-test-report.md)。SWBOOT-10 仍为 fail-closed stub。
## 0. 验收分层
| 层 | 范围 | 可否代替真实 UI |
|----|------|-----------------|
| L1 | manifest、profile、模板、quality gate 单元测试 | 否 |
| L2 | PostgreSQL 迁移、领域服务、API、鉴权、并发 | 否 |
| L3 | 前端组件、类型、build | 否 |
| L4 | stub 小队和固定输出工程测试 | 否 |
| L5 | 真实 PI Agent Runner | 否,仍需页面验证 |
| L6 | Ubuntu Server 无头浏览器真实页面操作 | 是,最终验收 |
| 层 | 范围 | 可否代替真实 UI | 2026-09-22 红线证据 |
|----|------|-----------------|---------------------|
| L1 | manifest、profile、模板、quality gate 单元测试 | 否 | 子集 PASS(见 §1) |
| L2 | PostgreSQL 迁移、领域服务、API、鉴权、并发 | 否 | 领域 short PASS;PG **NOT RUN**(无 `TEST_DATABASE_URL`) |
| L3 | 前端组件、类型、build | 否 | **NOT RUN**(本机缺 `tsc`/`tsx`) |
| L4 | stub 小队和固定输出工程测试 | 否 | stub PASS;live PI SKIP |
| L5 | 真实 PI Agent Runner | 否,仍需页面验证 | **pending auth** |
| L6 | Ubuntu Server 无头浏览器真实页面操作 | 是,最终验收 | **pending auth** |
## 1. 工程门禁
### Manifest 与目录
- [ ] `software_bootstrap` 和 `software_delivery` 均可校验、发布和退役 — 证据:NOT RUN
- [ ] 非 published / 非 selectable / 不兼容 domain 的工作流不出现在项目目录 — 证据:NOT RUN
- [ ] 新版本不会改变已激活实例的 manifest/template/profile hash — 证据:NOT RUN
- [ ] 医疗现有三工作流及黄金用例无回归 — 证据:NOT RUN
- [ ] 不再依赖“三正式 key”或固定文档数量硬编码 — 证据:NOT RUN
- [x] `software_bootstrap` 和 `software_delivery` 均可校验(发布/退役全路径未本轮覆盖) — 证据:L1 `TestValidateDefinitionV2_SoftwareManifests` PASS(2026-09-22)
- [x] 不兼容 domain 的工作流被过滤 — 证据:`TestCompatibleWithProductDomain` PASS(2026-09-22)
- [ ] 新版本不会改变已激活实例的 manifest/template/profile hash — 证据:NOT RUN(需 PG 激活实例)
- [x] 医疗正式 key 仍在官方集合且软件 key 并存(非全量黄金回归) — 证据:`TestOfficialWorkflowKeys` PASS(2026-09-22)
- [x] 不再依赖“仅三正式 key”硬编码 — 证据:同上 + `TestCreateSoftwareProject_NoMedicalDefaults` PASS
### 数据与迁移
- [ ] 空数据库从 schema 1 升级并创建项目类型、profile、source binding — 证据:NOT RUN
- [ ] 空数据库从 schema 1 升级并创建项目类型、profile、source binding — 证据:NOT RUN(无 `TEST_DATABASE_URL`)
- [ ] 旧数据库升级不误分类既有项目 — 证据:NOT RUN
- [ ] secret 只存引用,数据库、文档、日志和 prompt 无明文 — 证据:NOT RUN
- [ ] 项目、成员、planning instance、模板账本创建具备幂等事务语义 — 证据:NOT RUN
- [ ] secret 只存引用,数据库、文档、日志和 prompt 无明文 — 证据:NOT RUN(本批未做 secret 扫描)
- [ ] 项目、成员、planning instance、模板账本创建具备幂等事务语义 — 证据:NOT RUN(PG)
- [ ] 应用重启后项目、来源、plan、阶段和文档版本可恢复 — 证据:NOT RUN
### 授权与治理
- [ ] 非成员无法列出项目、对话、来源、文档、SSE、RAG 或 Agent 结果 — 证据:NOT RUN
- [ ] 非成员无法列出项目、对话、来源、文档、SSE、RAG 或 Agent 结果 — 证据:NOT RUN(需 API/UI)
- [ ] 非创建者无法激活、推进、选择下一流程或终止 — 证据:NOT RUN
- [ ] 客户端伪造 task/stage/duty/repo path 被服务端拒绝 — 证据:NOT RUN
- [ ] collaborative 模式三权必须不同人 — 证据:NOT RUN
- [ ] solo 只允许 creator acknowledgement 且页面显示“未独立评审” — 证据:NOT RUN
- [ ] controlled profile 禁止 solo — 证据:NOT RUN
- [ ] 激活后 workflow/template/profile/duty 不能直接修改 — 证据:NOT RUN
- [ ] 客户端伪造 task/stage/duty/repo path 被服务端拒绝 — 证据:NOT RUN(完整 API);repo path stub 见 §4
- [x] collaborative / solo / controlled 预览规则(领域层) — 证据:`TestBuildCreationPreview_*` PASS(solo acknowledgement;privacy+solo 与 controlled_patch 拒绝)
- [ ] solo 页面显示“未独立评审” — 证据:NOT RUN(L3/L6)
- [x] controlled profile / controlled_patch 禁止未授权执行 — 证据:creation preview + SWBOOT-10 stub PASS
- [ ] 激活后 workflow/template/profile/duty 不能直接修改 — 证据:NOT RUN(需激活实例)
### 小队与文档
- [ ] 每个 executor/template/quality gate/profile 均注册且可解析 — 证据:NOT RUN
- [ ] 每个 executor/template/quality gate/profile 均注册且可解析 — 证据:NOT RUN(全量 registry 未本轮枚举)
- [ ] 正式任务只能从冻结 doc_task_instance 启动 — 证据:NOT RUN
- [ ] 步骤预算、timeout、工作区边界和 manifest 生效 — 证据:NOT RUN
- [ ] 失败、跳过、fallback、未验证项不会被改写成 PASS — 证据:NOT RUN
- [ ] 非医疗默认小队不包含 regulatory — 证据:NOT RUN
- [ ] 纯软件模板和回复无医疗默认术语污染 — 证据:NOT RUN
- [x] 失败/stub 不改写成真实 PASS — 证据:本报告区分 stub PASS vs L5 pending;LiveMiniMax SKIP
- [x] 纯软件项目类型目录无医疗默认术语污染 — 证据:`TestProjectTypesCatalog` / `CreateSoftwareProject_NoMedicalDefaults` PASS
- [x] 软件创建默认走 `software_bootstrap` 且无医疗 device 字段 — 证据:同上
## 2. Ubuntu Server 真实 UI 前置
## 2. Ubuntu Server 真实 UI 前置(L5/L6 — pending auth)
- [ ] 占用 CURRENT 集成槽位 — 证据:NOT RUN
- [ ] `go vet ./...`、`go test -short ./...`、前端测试/build 通过 — 证据:NOT RUN
- [ ] PostgreSQL、app、真实 PI Runner、MiniMax 均 ready — 证据:NOT RUN
- [ ] 明确记录 commit、schema、镜像、模型、BASE_URL 和开始时间 — 证据:NOT RUN
- [ ] 使用官方 Playwright Chromium 容器;宿主无需安装浏览器 — 证据:NOT RUN
- [ ] 若容器不可用,才执行 `npx playwright install --with-deps chromium` — 证据:NOT RUN
- [ ] 禁止 `page.route`、mock/stub、直接写数据库或伪造 API 输出 — 证据:NOT RUN
- [ ] 占用 CURRENT 集成槽位 — 证据:pending auth
- [ ] `go vet ./...`、`go test -short ./...`、前端测试/build 通过 — 证据:本批仅跑范围子集 + arch-check;全量 short/前端 pending
- [ ] PostgreSQL、app、真实 PI Runner、MiniMax 均 ready — 证据:pending auth
- [ ] 明确记录 commit、schema、镜像、模型、BASE_URL 和开始时间 — 证据:pending auth
- [ ] 使用官方 Playwright Chromium 容器;宿主无需安装浏览器 — 证据:pending auth
- [ ] 若容器不可用,才执行 `npx playwright install --with-deps chromium` — 证据:pending auth
- [ ] 禁止 `page.route`、mock/stub、直接写数据库或伪造 API 输出 — 证据:pending auth
推荐运行形态:
@@ -185,23 +187,26 @@ docker run --rm --network host --ipc host \
- **Evidence**:完整对话、全部文档、版本、trace/video、来源 hash。
- **Status**:NOT RUN。
## 4. 未来 controlled patch 负例
## 4. 未来 controlled patch 负例(SWBOOT-10 stub — 无真实仓写)
- [ ] repo 未绑定不能执行 — 证据:NOT RUN
- [ ] 非 allowlist 路径被拒绝 — 证据:NOT RUN
- [ ] `.env`、secret、生产 dump 排除有效 — 证据:NOT RUN
- [ ] 只在 feature worktree 写入 — 证据:NOT RUN
> 真实 allowlist DB / patch / merge 执行器未实现。下列勾选仅表示 **stub fail-closed**;不得当作 SWBOOT-10 已交付。
- [x] repo / 路径未在 stub allowlist 不能读 — 证据:`TestRepoAllowlistStub` → `ERR_REPO_PATH_NOT_ALLOWLISTED`(2026-09-22)
- [x] 非 allowlist 路径被拒绝 — 证据:同上
- [ ] `.env`、secret、生产 dump 排除有效 — 证据:NOT RUN(需真实执行器)
- [ ] 只在 feature worktree 写入 — 证据:NOT RUN(执行器未实现;本批证据写在任务 worktree)
- [ ] 超出批准文件范围立即停止 — 证据:NOT RUN
- [ ] 测试失败不自动 merge — 证据:NOT RUN
- [ ] 批准执行不等于批准 merge/push/deploy — 证据:NOT RUN
- [ ] 保护分支直接 commit、force push、破坏性命令均被拒绝 — 证据:NOT RUN
- [x] 测试失败不自动 merge(ApproveMerge stub) — 证据:`ApproveMerge` → `ERR_SWBOOT10_STUB_ONLY`
- [x] 批准执行不等于批准 merge/push/deploy — 证据:同上 + `ExecuteControlledPatch` stub
- [x] `controlled_patch` 创建/顾问路径被拒绝 — 证据:preview + `TestPiSoftwareBootstrapAdvisor_RejectsControlledPatch`
- [ ] 保护分支直接 commit、force push、破坏性命令均被拒绝 — 证据:NOT RUN(需真实执行器策略)
## 5. 完成定义
- [ ] L1–L5 工程门禁分别记录真实结果
- [ ] UI-SW-00–14 全部由真实页面操作执行并留证
- [ ] 真实 PI 回复、小队进度和所有交付文档均可在 UI 看到
- [ ] 医疗与软件两套黄金项目均无回归
- [ ] 刷新、重登、重启、并发和权限负例通过
- [ ] test-report 逐项包含 Input/Expected/Actual/Verdict/Duration
- [ ] 任何 NOT RUN、fallback、失败和开放风险均如实保留
- [ ] L1–L5 工程门禁分别记录真实结果 — 2026-09-22:L1 子集 + L4 stub 已记;L2 PG / L3 / L5 未完成
- [ ] UI-SW-00–14 全部由真实页面操作执行并留证 — L6 pending auth
- [ ] 真实 PI 回复、小队进度和所有交付文档均可在 UI 看到 — L5/L6 pending auth
- [ ] 医疗与软件两套黄金项目均无回归 — NOT RUN
- [ ] 刷新、重登、重启、并发和权限负例通过 — NOT RUN
- [x] test-report 逐项包含 Input/Expected/Actual/Verdict/Duration — 红线 SWBOOT 报告已遵循
- [x] 任何 NOT RUN、fallback、失败和开放风险均如实保留 — 见 2026-09-22 报告
@@ -0,0 +1,65 @@
---
title: "D7 Track E ID-only 合规清单(红线证据)"
status: done
created: 2026-09-22
updated: 2026-09-22
related_task: "ops/short-term/2026-09-22-redline-evidence.md"
related_adr: "adr/2026-09-17-d7-chat-data-retention.md"
compliance: pending-compliance-signoff
---
# D7 Track E ID-only 合规清单
> 本清单只做静态/契约复验。ADR 数字仍 `pending-compliance-signoff`。**禁止**物理删除、备份清除或把 stub/SKIP 写成 retention PASS。
## 范围
| 表面 | 允许 | 禁止 |
|------|------|------|
| 事件 envelope / DLQ / reconciliation | ID、digest、typed error code、allowlist 摘要(含 `summary_ref`) | 聊天正文、prompt、markdown、原始 payload dump |
| 应用日志 | 脱敏 DSN、run/plan/doc ID | 消息 `content` |
| 备份 | 整库 dump 作为运维能力存在 | 本轮执行 dump / 按 365 天清备份 |
| 热库 chat_* | 只读盘点 / 内容编辑 UPDATE | `DELETE FROM chat_*`、retention `SET deleted_at` |
## 勾选(2026-09-22 / SHA `364ed7f1`)
### A. StaticContracts payload
- [x] 全部事件 `PayloadFields` 已枚举 — 证据:`assets/2026-09-22-redline-evidence/d7-track-e-payload-fields.txt`
- [x] 无 `content` / `body` / `message` / `prompt` / `text` / `markdown` — `forbidden_hits=NONE`
- [x] intent.plan.* 含 `summary_ref` 而非正文 — `TestIntentPlanContractsOmitSensitivePayload` PASS
- [x] YAML ↔ `StaticContracts` 对等 — `TestRegistryParityWithYAML` PASS
- [x] `SanitizeSummary` 丢弃非 allowlist 键 — `TestSanitizeSummaryDropsPayload` PASS
### B. 热库 / 删除路径
- [x] Go 检索无 `DELETE FROM chat_*` — `d7-no-physical-delete.txt`
- [x] Go 检索无 chat retention `SET deleted_at` — 同上
- [x] 存在的 `UPDATE chat_messages` 为内容编辑路径,非 soft-delete 作业 — 已注明
- [x] 本轮未对共享/本地业务库执行 DELETE/UPDATE retention — 操作边界
### C. 备份 / 日志 / workspace
- [x] `scripts/backup-system-db.sh` 使用 `pg_dump -Fc` 整库(含 chat 明文)— 静态阅读
- [x] 本轮**未**执行 dump、**未**清除备份目录
- [x] Agent workspace 30 天清理作业仍未实现(待 ADR 签字)— 记为缺口非违规
- [x] FAV `final_artifacts.retention_class` 与聊天口径解耦;consumer off
### D. ADR / 矩阵边界
- [x] ADR `compliance: pending-compliance-signoff` 未改
- [x] FEATURE-MATRIX D7 保持 `deferred`(本批不升)
- [x] 未发现已确认安全/合规基线违反 → **不写** gap-matrix blocker
- [x] 报告:[../../test-reports/2026-09-22-redline-evidence-d7-test-report.md](../../test-reports/2026-09-22-redline-evidence-d7-test-report.md)
## 未做(明确排除)
- 共享 PG 实时 COUNT(无本轮 DB 只读授权会话;沿用 2026-09-17 W7 计数作历史参考)
- 按 365/180/30 物理删除或备份二次清除
- soft-delete 写路径实现
## 下一步(需另授权)
1. 合规签字或改数 → ADR `accepted`/`signed`
2. soft-delete 写路径 → 观察窗 → 物理清理
3. 备份清除:二次批准 + delete manifest(R22)
@@ -0,0 +1,6 @@
OK status -> allow
OK push -> ask
OK reset -> ask
OK clean -> ask
OK force-wt -> ask
hooks OK
@@ -0,0 +1,20 @@
{
"initialize": {
"name": "agentctl",
"version": "1.0.0"
},
"tools": [
"status",
"task_register",
"task_close",
"lease_run",
"docs_snapshot",
"docs_apply",
"validate",
"queue_enqueue",
"quarantine_status"
],
"status_ok": true,
"daemon_ok": true,
"daemon_held": true
}
@@ -0,0 +1 @@
queue retry after parking untracked promotion receipts (DIRTY_TREE) at /tmp/ci-hold-receipts
@@ -0,0 +1,5 @@
OK agentctl-session-start lines 30
OK agentctl-worktree-setup lines 48
OK agentctl-lease-write lines 45
OK agentctl-integrate-closeout lines 53
skills OK
@@ -0,0 +1,2 @@
146:Ran 134 tests in 122.988s
148:OK (skipped=3)
@@ -0,0 +1 @@
bootstrap: ok
@@ -0,0 +1,5 @@
{"interval": 1.0, "max_cycles": 3, "pid": 63316, "status": "daemon_started"}
{"processed": 0, "results": [], "status": "ok"}
{"processed": 0, "results": [], "status": "ok"}
{"processed": 0, "results": [], "status": "ok"}
{"cycles": 3, "pid": 63316, "reason": "max_cycles", "status": "daemon_stopped"}
@@ -0,0 +1 @@
{"epoch": "7fa35ad9-518f-4a0d-a446-49baf12c666c", "heartbeat": {"cycle": 99, "pid": 63557, "updated": 1790158027.962433}, "heartbeat_age_seconds": 0.2736787796020508, "lock_root": "/private/tmp/Agent-System/.locks", "manager_lock": {"held": true, "holder_pid": 63557, "path": "/private/tmp/Agent-System/.locks/os/manager.lock"}, "queue": {"claimed": 0, "pending": 0}, "status": "ok"}
@@ -0,0 +1 @@
{"epoch": "7fa35ad9-518f-4a0d-a446-49baf12c666c", "heartbeat": {"cycle": 2, "pid": 63557, "updated": 1790157919.612233}, "heartbeat_age_seconds": 0.8667151927947998, "lock_root": "/private/tmp/Agent-System/.locks", "manager_lock": {"held": true, "holder_pid": 63557, "path": "/private/tmp/Agent-System/.locks/os/manager.lock"}, "queue": {"claimed": 0, "pending": 0}, "status": "ok"}
@@ -0,0 +1 @@
f1b4fdca-0209-466d-9aba-fcd8f90bb3be completed; tip 5e11db50
@@ -0,0 +1 @@
Darwin WeiCHENdeMac-mini.local 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:17:26 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T6041 arm64
@@ -0,0 +1,6 @@
5: state = running
38: runs = 1
39: pid = 63557
50: last exit code = (never exited)
55: state = active
63: state = active
@@ -0,0 +1,13 @@
2: active count = 1
3: path = /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
5: state = running
7: program = /usr/bin/python3
17: working directory = /private/tmp/Agent-System
19: stdout path = /tmp/agentctl-coordinator.out.log
20: stderr path = /tmp/agentctl-coordinator.err.log
38: runs = 1
39: pid = 63557
55: state = active
56: active count = 1
63: state = active
64: active count = 1
@@ -0,0 +1,3 @@
domain=gui/501
dest=/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
cmd: launchctl bootstrap gui/501 /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.agentctl.coordinator</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/private/tmp/Agent-System/scripts/agentctl.py</string>
<string>daemon</string>
<string>run</string>
<string>--interval</string>
<string>1.0</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/agentctl-coordinator.err.log</string>
<key>StandardOutPath</key>
<string>/tmp/agentctl-coordinator.out.log</string>
<key>WorkingDirectory</key>
<string>/private/tmp/Agent-System</string>
</dict>
</plist>
@@ -0,0 +1 @@
2026-09-23T10:05:09Z
@@ -0,0 +1,3 @@
1:{"interval": 1.0, "max_cycles": null, "pid": 63557, "status": "daemon_started"}
126:{"run_id": "queue-f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "sha": "5e11db50ce6f8905890993cef1d4a64bbb6f53d9", "status": "merged"}
127:{"processed": 1, "results": [{"id": "f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "run_id": "queue-f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "status": "completed"}], "status": "ok"}
@@ -0,0 +1 @@
weichen
@@ -0,0 +1 @@
/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist: OK
@@ -0,0 +1 @@
{"items": [], "status": "ok"}
@@ -0,0 +1,6 @@
# Rollback (fail-closed)
launchctl bootout gui/501/com.agentctl.coordinator
rm -f /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
# verify:
launchctl print gui/501/com.agentctl.coordinator # expect not found
python3 /private/tmp/Agent-System/scripts/agentctl.py daemon status
@@ -0,0 +1,2 @@
146:Ran 134 tests in 118.996s
148:OK (skipped=3)
@@ -1,30 +1,37 @@
---
title: "对话刷新后正文消失整改实施交接"
created: 2026-09-13
updated: 2026-09-22
from: codex
to: next-agent
status: open
to: closed
status: done
---
# 交接:对话刷新后正文消失整改实施
## 目标(下一位 Agent 应完成什么)
## 收口结论(2026-09-22)
**本交接关闭。** tip `364ed7f1` 上原发布缺口已关闭;发布 SSOT 以 [gap-matrix](../../remediation/gap-matrix.md) 行 `CHAT-HISTORY-REFRESH` = **PASS** 为准。
口径裁定见 [2026-09-22-chat-history-refresh-reconcile](../short-term/2026-09-22-chat-history-refresh-reconcile.md)。不得再凭本文件的历史 “open / publish blocker” 表述回退该 PASS。
门禁 B3(激活后文档任务 + rebuild)已有归档证据:[gate report](../../test-reports/2026-09-16-chat-refresh-gate-test-report.md)(项目 6359)。
## 目标(历史)
按整改方案修复消息作用域、历史读取授权和统计同集问题,并完成历史回填与真实刷新 E2E。
## 已完成
- 源码链路与 dev PostgreSQL 只读定位完成,确认消息未删除。
- 确认 project 143/session `sess-p143-u9` 的 4 条消息均缺 `stage_key`,工作流激活后被窗口过滤器全部移除。
- 确认异步文档任务写入路径缺阶段/实例作用域;分类与日期统计未应用同一过滤。
- 审计、整改方案、发布 blocker 与 planned short-term 已建立。
- 现有相关 Go 测试和前端 192 项测试通过,但均未覆盖真实缺陷场景。
- 诊断:消息未删;空 `stage_key` 被过滤器丢弃;统计不同集。
- **实施已合入**:`message_scope`、`chat_history_auth` / `chatflow` 同集、goose 00026/00027、`useChatWindow` 恢复态。
- 闲聊 live 6252 + 门禁 B3 6359(activate+task+rebuild)证据归档。
- 2026-09-22 口径对齐:本 handoff / remediation 关闭;gap 保持 PASS。
## 未完成
## 残留(不回退本 gap)
- 未修改业务代码、迁移或运行态数据。
- 未建立实施 checklist/test-report。
- 未运行真实 PI 刷新回归和双用户对象级授权负例。
- `useChatWindow` 非 403 路径仍可能 cache→`ready`(降级 UX);不得扩大。
- `StageKeyAllowed("")` 非聊天调用点另账。
## 认领 / 槽位状态
@@ -32,39 +39,15 @@ status: open
|----|-----|
| mutex 已释放 | yes |
| 集成槽位 holder | idle |
| branch | dev(诊断);建议实施用 `fix/chat-history-refresh` |
| worktree | 建议 `.worktrees/fix-chat-history-refresh` |
| 关闭依据 | tip `364ed7f1` + [reconcile](../short-term/2026-09-22-chat-history-refresh-reconcile.md) |
## 关键文件
## 红线(持续)
| 路径 | 说明 |
|------|------|
| `.doc/audit/2026-09-13-chat-history-refresh-disappears.md` | 根因与运行态证据 |
| `.doc/remediation/2026-09-13-chat-history-refresh-remediation.md` | 分波次整改与验收 |
| `internal/server/task_run_handlers.go` | 文档任务消息缺阶段作用域 |
| `internal/server/stage_access_helpers.go` | 空阶段消息被丢弃 |
| `internal/server/chat_window_api.go` | 正文与统计授权口径分裂 |
| `web/src/hooks/useChatWindow.ts` | 刷新后服务端空桶覆盖本地窗口 |
## 如何验证
```bash
go test -short ./internal/server -run 'TestServer_ChatWindow' -count=1 -v
go test -short ./internal/ctxmgr -run 'TestChatWindow' -count=1 -v
cd web && npm test
```
实施时必须另加真实 PG 场景:激活前对话 → 激活 → `intake` 文档任务 → 刷新窗口,以及非 owner/无阶段职责负例。
## 风险 / Blocker
- 当前为发布 blocker;刷新会造成对话“数据丢失”假象。
- 不能用“空 `stage_key` 全部放行”或保留旧 localStorage 缓存作修复,否则会扩大阶段/跨用户泄露。
- 历史回填存在重复 `task_key` 歧义,必须先 dry-run 并按实例与时间唯一匹配。
- 禁止空 `stage_key` 一律放行;聊天可见性以 `MessageVisible` 为准。
- 禁止用 localStorage 掩盖服务端空结果/错误作为修复。
## 相关链接
- CURRENT: [CURRENT.md](../CURRENT.md)
- Task: [chat-history-refresh-remediation](../short-term/2026-09-13-chat-history-refresh-remediation.md)
- Audit: [chat-history-refresh-disappears](../../audit/2026-09-13-chat-history-refresh-disappears.md)
- Remediation: [chat-history-refresh-remediation](../../remediation/2026-09-13-chat-history-refresh-remediation.md)
- Reconcile: [../short-term/2026-09-22-chat-history-refresh-reconcile.md](../short-term/2026-09-22-chat-history-refresh-reconcile.md)
- Remediation: [../../remediation/2026-09-13-chat-history-refresh-remediation.md](../../remediation/2026-09-13-chat-history-refresh-remediation.md)
- Reports: [闲聊](../../test-reports/2026-09-13-chat-history-refresh-test-report.md) · [B3](../../test-reports/2026-09-16-chat-refresh-gate-test-report.md)
@@ -25,9 +25,9 @@ status: open
| 研究 mutex | 已在本 worktree CURRENT 标记 done |
| 共享集成槽位 | 本任务分支 CURRENT 登记文档集成;实际操作持 common-dir 下 dev-integration.lock,主目录 CURRENT 保留 |
| branch | feature/agent-workflow-governance-plan |
| worktree | .worktrees/feature-agent-workflow-governance-plan |
| worktree | 原任务及候选在收口后按门禁清理;dev 文档入口暂为 `.worktrees/agent-governance-dev-integration` |
| 起点 | 本地 dev@15b8a4a8 |
| 合入 / push | 本次按已验证候选合入本地 dev;未 push,最终结果见规范采纳验收报告 |
| 合入 / push | 规则提交 `048bbe4a` 已经由候选 `83e22a70` 合入本地 dev;未 push;后续收口仅文档 |
## 验证及边界
@@ -35,9 +35,10 @@ status: open
- 主目录另有 Cursor 工作流作用域任务的未提交改动;保留现场,不 checkout/pull/stash/reset。
- 当前没有自动任务协调器,分支 CURRENT 不等于全局实时认领。此次只有人工明确范围和本机 flock,不宣称自动队列或全局硬隔离已实现。
- 收口文档允许单独审核/合入,但不能按计划已写完将治理功能改成 done。
- 主目录仍是旧任务分支;dev 暂由 `.worktrees/agent-governance-dev-integration` 检出以安全集成文档。旧任务 owner 保存成果、确认主目录干净后,先安全移除临时 dev worktree,再在主目录切回 dev;不得强抢 dev 检出。
- 规范首次合入后,Cursor 已把作用域修复合入 `dev@e0665ca4`,并将主目录切为该提交的 detached HEAD 进行部署。dev 仍暂由 `.worktrees/agent-governance-dev-integration` 检出;该目录当前也被 Cursor 的集成流程使用,须等其释放槽位后再清理或接管。主目录最终切回 dev 前先安全移除临时 dev worktree;不得强抢检出或修改活跃部署源。
## 相关链接
- [研究任务](../../archive/ops/2026-09-21-agent-workflow-governance-plan.md)
- [CURRENT](../CURRENT.md)
- [采纳验收](../../test-reports/2026-09-21-agent-workflow-governance-adoption-test-report.md)
@@ -0,0 +1,31 @@
---
lesson_id: LESSON-20260923-content-hash
lesson_state: validated
owner: Codex
reviewer: Codex (source review)
last_reviewed: 2026-09-23
reviewed_revision: 2fdb6e548e3784771f27e6a9e79b9c364f76c566
source_issues: [ISSUE-20260923-content-hash]
keywords: [docrevision, doccontent, canonicalize, hash, bootstrap, hard-break, hydration, '404']
---
# 文本规范化必须保持语义并维护账本与文件一致性
**触发**:修改 Markdown 规范化、哈希、版本 bootstrap、文件投影、正文加载或刷新缓存时。
**机制与来源**:[问题主记录](../../audit/2026-09-23-historical-issue-records.md#content-hash)。去掉行尾双空格破坏硬换行语义;只更新账本哈希使原文件读取失配。统一报 404 和无效轮询更新让数据冲突难以诊断并反复呈现。
**开发检查**:
1. 对规范化定义允许变化和必须保留的语义,保留硬换行等差异样例;哈希一致性依赖相同语义和规范化契约。
2. 追踪快照、记录哈希与文件投影的写入顺序和失败恢复。旧文档首次 bootstrap 与新文档创建分别覆盖,并发 content/revision 请求和刷新后读取需按实际因果链验证。
3. 数据修复先按授权保全原文件及旧版本,显式记录修复来源;不能通过静默覆盖或跳过校验来隐藏不一致。
4. 将不存在、完整性冲突和临时失败按协议区分。检查无变化轮询是否重复触发内容加载;失败反馈应可定位。
**已有防护**:[黄金样例](../../../internal/docrevision/canonicalize_golden_test.go) 含硬换行保持及 doccontent 封装一致性;[历史真实 UI 报告](../../test-reports/2026-09-14-controlled-content-ui-acceptance.md) 覆盖旧文档、刷新和重启。2026-09-23 只核对源码与报告,未重跑;测试存在不等于在未来变更中已执行。
**边界**:哈希不同不自动说明数据丢失,也不自动授权重写。不同文件格式的空白语义不同;不得把 Markdown 规则机械用于其他格式。当前制品和旧数据迁移需要各自证据,新项目 PASS 不代替旧数据验收。
**未完成防护**:没有全仓扫描或新 CI 门禁;未来相关修改按验证契约运行适用用例并记录结果。
**修订**:2026-09-23 从历史问题提炼,核对当前 canonicalize 委托与黄金样例;规范化/投影/缓存契约改变时再审。
@@ -0,0 +1,30 @@
---
lesson_id: LESSON-20260923-matrix-status-cas
lesson_state: validated
owner: Cursor
reviewer: Cursor (source review + arch-check)
last_reviewed: 2026-09-23
reviewed_revision: b9d09c97120ee5bcdea487b0d0ca5910d6e98a1d
source_issues: [ISSUE-20260923-matrix-status-regression]
keywords: [FEATURE-MATRIX, docs-apply, record_id, merge-conflict, CAS, planned, done]
---
# 共享矩阵状态变更必须走 docs apply,合并后核验状态列
**触发**:改 FEATURE-MATRIX / CURRENT 行状态,或合并含这两份文件的候选时。
**机制与来源**:[ISSUE-20260923-matrix-status-regression](../../audit/2026-09-23-matrix-status-regression.md)。A–G 代码已合入且曾标 `done`,closeout 合并冲突手解取旧侧把状态盖回 `planned`,误导后续会话。
**开发检查**:
1. 不直接编辑 FEATURE-MATRIX / CURRENT 表行;用 `agentctl docs snapshot` + `docs apply`(MATRIX 键为 `record_id`)。
2. 升 `done` 须 `docs:approve` 与已提交 evidence 路径(门禁 `EVIDENCE_REQUIRED`)。
3. 合并含共享文档的候选后,对目标 `record_id` 再 `docs snapshot` 或 `grep` 核验状态列未被回退;冲突手解禁止静默取旧侧。
**验证方式**:本轮对 `module-batches-ag` 做 apply 收据 + `arch-check --mode block` PASS;未新增自动化 CI。manual。
**适用边界**:仅协调 SSOT(CURRENT / FEATURE-MATRIX);普通 `.doc` 短文仍可租约内直接改。不覆盖 gap-matrix 发布门禁语义。
**防护落实**:`scripts/agentctl.py` 已对 MATRIX `done` 要求 evidence;本条强调合并后人工/脚本核验。仍缺:merge 后自动断言关键 `record_id` 状态(待治理任务)。
**修订**:2026-09-23 新建;同日 apply 恢复 + arch-check 后升 validated。
@@ -0,0 +1,30 @@
---
lesson_id: LESSON-20260923-nullable-duty
lesson_state: validated
owner: Codex
reviewer: Codex (source review)
last_reviewed: 2026-09-23
reviewed_revision: 2fdb6e548e3784771f27e6a9e79b9c364f76c566
source_issues: [ISSUE-20260923-nullable-duty]
keywords: [docgov, nullable, SQL, FK, reviewer_id, '23503', heal]
---
# 可选职责在所有持久化入口保持同一空值语义
**触发**:修改可选成员/职责、SQL 写入、创建/heal/import/upsert 等路径时;检查范围以实际共享字段和表写者为准。
**机制与来源**:[问题主记录](../../audit/2026-09-23-historical-issue-records.md#nullable-duty)。内存 0 表示缺席,但数据库可空 FK 需要 NULL;一个入口已有转换不能证明另一个入口也有。原审计中错误被通用 INTERNAL_ERROR 掩盖,说明还需检查错误分型。
**开发检查**:
1. 从字段契约确定缺席、有值但非法、合法值三种语义;沿现有表写者列出所有写入口,检查转换一致性。
2. 保持可选职责业务规则;让 SQL 边界处理缺席值,不能靠强制填 reviewer 掩盖实现错误。合法角色与非法 ID 仍按原有鉴权/FK 处理。
3. 对缺席、合法、非法值及相关创建/修复入口安排真实 PG 验证;mock 不会证明 FK/NULL 行为。保持正常职责模式的回归。
**已有防护**:[engine](../../../internal/docgov/engine.go) 创建路径使用 `nullIfZero`;[历史报告](../../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md) 记录 `TestDocGov_CreateOrGetDocument_OptionalDutiesNullFK`、分型单测与 API/DB 冒烟。2026-09-23 仅复核源码及旧报告,未重跑测试;未据此证明真实 UI、所有写路径或当前部署。
**边界**:只适用于明确以 0 表示未设置且列允许 NULL 的字段;不能对所有数值或必填关系统一转 NULL。授权资格判定仍遵循现行规范。
**未完成防护**:跨所有相关入口的自动覆盖不由本条保证;后续变更任务按实际影响补证。没有新增 CI 门禁。
**修订**:2026-09-23 从历史 FK 案例提炼,并核对当前创建路径;接口/表写者变化或同因复发时再审。
+11
View File
@@ -0,0 +1,11 @@
# 开发经验与注意事项
先按本任务模块、路径、症状和机制检索,再读命中条目的适用条件与来源。执行步骤与维护要求见 [闭环规范](../2026-09-23-issue-learning-workflow.md);事实入口见 [问题台账](../../audit/ISSUES.md)。这些是仓库可共享的外部经验,不依赖单个聊天会话或某个客户端私有记忆。
| lesson_id | 触发条件 / 关键词 | 注意事项 | lesson_state | 主记录 / 最近复核 |
|---|---|---|---|---|
| LESSON-20260923-nullable-duty | docgov、SQL、nullable、23503、可选职责、创建/heal | 检查所有写入口的缺席值语义;用真实 PG 验证 NULL/FK | validated | [可选职责持久化](2026-09-23-nullable-duty.md);2026-09-23 |
| LESSON-20260923-content-hash | docrevision、canonicalize、hash、bootstrap、hard-break、404、水合 | 保持文本语义并检查账本/文件一致性;新数据通过不能覆盖旧数据迁移 | validated | [正文规范化与投影](2026-09-23-content-hash.md);2026-09-23 |
| LESSON-20260923-matrix-status-cas | FEATURE-MATRIX、docs-apply、record_id、merge conflict、CAS | 矩阵/CURRENT 行变更走 docs apply;合并后核验状态列未被回退 | validated | [矩阵状态 CAS](2026-09-23-matrix-status-cas.md);2026-09-23 |
validated 的证据范围见各条目;本日复核为历史材料和源码阅读,未重跑产品回归。后续按机制补充,过时条目标 superseded/retired 并保留替代链接。
@@ -2,7 +2,7 @@
title: "PU7 PI change-report 叙事 — 获批后任务契约"
status: done
created: 2026-09-16
updated: 2026-09-17
updated: 2026-09-23
owner: Cursor-Auto
branch: feature/pu7-pi-narrative
mutex: docgov
@@ -13,6 +13,10 @@ go_no_go: go
**go/no-go**:GO(用户覆盖授权,见 Wave3 research)。脚手架已合 `dev`;W3 live(产品 PI + digest 绑定)已接线,默认 flag 仍 off。
## 2026-09-23 收口
修复后真实 MiniMax 复测 PASS(截断 hunk/impact 输入 + reasoning 目标落盘);报告见 [../../test-reports/2026-09-23-pi-narrative-closeout-test-report.md](../../test-reports/2026-09-23-pi-narrative-closeout-test-report.md)。FEATURE-MATRIX `docgov-pi-narrative` → `done`。默认 flag 仍 off;放量另授权。
## 目标
只读消费 immutable diff+lineage+risk floor 的 PI 叙事;任意 schema/超时/注入 → 全量 fallback。
@@ -27,11 +31,12 @@ go_no_go: go
## 路径
- `internal/docrevision/flags.go` / `narrative.go` / `service.go`
- `deploy/pi-agent/change-report-narrative-v1.mjs`
- `deploy/pi-agent/change-report-narrative-v1.mjs`;`runner.mjs` reasoning 目标落盘
- `web/.../ChangeReportPanel.tsx` / `changeReportView.ts`
- 报告:[../../test-reports/2026-09-16-pu7-pi-narrative-test-report.md](../../test-reports/2026-09-16-pu7-pi-narrative-test-report.md)
- W3 live:[../../test-reports/2026-09-17-w3-pi-change-report-narrative-test-report.md](../../test-reports/2026-09-17-w3-pi-change-report-narrative-test-report.md)
- short-term:[../short-term/2026-09-17-w3-pi-change-report-narrative.md](../short-term/2026-09-17-w3-pi-change-report-narrative.md)
- 收口:[../../test-reports/2026-09-23-pi-narrative-closeout-test-report.md](../../test-reports/2026-09-23-pi-narrative-closeout-test-report.md)
- short-term:[../short-term/2026-09-17-w3-pi-change-report-narrative.md](../short-term/2026-09-17-w3-pi-change-report-narrative.md);[../short-term/2026-09-23-pi-narrative-final-closeout.md](../short-term/2026-09-23-pi-narrative-final-closeout.md)
## 回滚
@@ -117,3 +117,7 @@ updated: 2026-09-19
| T20-I6 | backup 无定时调度 | ops | systemd/cron;RPO 60m |
| T20-I7 | **main 分支对齐晋升专项** | git main vs schema 52 | 独立授权;含 00057 改名预演 |
| T20-I8 | 默认 short 测依赖外网 docker 镜像 | `pi_runner_image_test.go` | Short 跳过或本地 fixture |
### 设计收口(2026-09-22 W4,未实施)
上表中 **B1/B3/B4/B5/B7/B11/F1/F4/F7/F8/I1/I4/I6** 的选定做法见 [../../system-design/2026-09-22-t20-hardening-design.md](../../system-design/2026-09-22-t20-hardening-design.md);任务 [../short-term/2026-09-22-t20-design-items.md](../short-term/2026-09-22-t20-design-items.md)。低风险已实现项见 [../short-term/2026-09-22-t20-lowrisk-hardening.md](../short-term/2026-09-22-t20-lowrisk-hardening.md)。F4/F7/I6 仍分别卡产品、鉴权专项、环境授权。
@@ -0,0 +1,149 @@
---
title: "最终成果保险库与部分恢复边界"
created: 2026-09-14
status: done
confidence: high
---
# 调研:最终成果保险库与部分恢复边界
## 结论
提案可行,建议采用,但不应实现成“把最终文件复制到一个固定目录”。应建设独立的**最终成果保险库(Final Artifact Vault,FAV)**:只接收服务端已经确认终态、具有稳定标识和内容哈希的成果,以不可变 blob、语义 manifest 和提交回执保存,并与工作区清理完全解耦。
FAV 是 PostgreSQL 完整备份/PITR 的互补层,不是第三套完整业务事实源。它只对“已归档成果的精确内容与出处”负责,可以在数据库损坏或选择性重建时恢复文档、最终回复和有限的来源关系;成员权限、工作流活动态、租约、待办任务、幂等记录等仍须由数据库备份或其他权威记录恢复。
## 当前能力与缺口
| 能力 | 当前事实 | 与提案的差距 |
|---|---|---|
| 受控文档版本 | `document_content_blobs` 与 `document_snapshots` 在 PostgreSQL 内保存不可变 Markdown;工作区 `output.md` 是投影 | 数据库与账本一起丢失时,没有独立副本;当前 GET 仍会被缺失工作区投影阻断 |
| 助手最终回复 | `chat_messages.content` 保存正文,`chat_turns.assistant_message_id` 可在 completed 回合绑定最终消息 | 占位正文会原地更新,没有独立不可变回复快照;删除 session 会级联删除消息 |
| 回复导出 | `replyexport` 已区分 completed、status/error/card,提供 `content_sha256` 与 `export_policy` | `export-source` 仍从当前消息行临时构造 snapshot,不是持久归档;部分调用在缺少真实回合状态时默认按 completed 评估 |
| 附件 CAS | `storage_blobs`/`file_references` + `data/<env>/storage/blobs` 按 SHA 去重 | blob 物理文件仍在运行状态根,引用元数据仍在数据库;不独立于工作区/数据库事故 |
| 数据备份 | 现有脚本主要导出 PostgreSQL;数据生命周期方案已要求 DB + state 成对打包 | 尚无跨文档/回复的终态准入、持续发布、独立索引或成果级恢复 API |
当前事故已经证明“数据库记录还在”不代表“运行容器能找到正文”。FAV 可以解决成果副本对工作区根的依赖,但不能替代固定 `RUNTIME_STATE_ROOT`、storage identity、projection outbox 和数据库备份。
## 提案中应保留的部分
1. **独立持久位置**:成果存储不位于 Git worktree、临时集成目录、任务 workspace 或普通 GC 扫描范围。
2. **只收终态成果**:拒绝流式片段、候选稿、工具轨迹、修复过程、临时报告、租约和未完成任务。
3. **支持系统定位**:使用稳定 artifact UUID、逻辑资源 ID、来源事件和内容 SHA,而不是依赖数据库自增 ID 或 workspace 路径。
4. **辅助部分恢复**:允许在数据库关系不匹配时校验并导入已归档内容,同时保留来源和冲突证据。
5. **与清理联动**:工作区或旧数据集只有在必需成果全部发布并验证后才可进入销毁阶段。
## 必须修正的部分
### 1. “最终”必须由状态机判定
不能按文件名、目录、时间或“任务进程退出 0”判断最终。建议的准入规则:
| 成果类型 | 可归档条件 | 明确排除 |
|---|---|---|
| 智能体生成文档 | agent candidate 已 `committed`,且 output snapshot 成为账本 head;归档该次生成的不可变 snapshot | ready、needs_confirmation、rejected、stale、quality_failed、workspace 草稿 |
| 受控文档正式稿 | `approved` 时归档被冻结的 review snapshot;版本被 sealed 时可归档该版 final head | drafting/reviewing 中尚未冻结的当前文件、lease 中内容 |
| 自由文档 | 已形成不可变 version,且用户显式“发布/归档”或被正式成果引用;显式操作不能绕过终态检查 | 自动保存中的连续修订、临时私密摘录 |
| 助手回复 | `chat_turn.status=completed`、绑定唯一 `assistant_message_id`、正文 SHA 匹配,且 `export_policy=full`;`copy_only` 只在 completed 后显式 pin 时进入 | status/error/cancelled/system、纯操作卡、流式 chunk、placeholder、中间 agent 消息;未完成回复即使 pin 也拒绝 |
| 最终报告/附件 | 被上述成果 manifest 引用并通过合规/病毒/类型校验 | 未引用附件、日志、Prompt、工具输入输出、agent session |
“每次成功保存的人工 revision”仍进入 PostgreSQL 不可变账本,但不自动进入 FAV。这样既保留文档历史,又不会把编辑过程伪装成最终成果。
### 2. 保险库不是第三套完整真相源
建议采用三层责任边界:
| 层 | 权威范围 | 可否清理 |
|---|---|---|
| PostgreSQL 运行库 | 项目/用户/权限、工作流、任务、当前指针、完整版本账本和归档发布状态 | 按环境生命周期与完整备份策略处理 |
| Runtime workspace/state | Agent 计算现场、`output.md` 投影、临时转换文件和附件运行副本 | 可重建/可清理,但须受发布门禁保护 |
| Final Artifact Vault | 已准入成果的精确字节、manifest、来源证据、保留/删除状态和发布回执 | 独立保留;只能按成果保留策略和删除账本处理 |
正常读写仍以数据库授权和业务指针为准。数据库仍能完成授权判定但正文缺失时,可从 FAV 只读降级返回并标记 `source=vault/degraded`;若权限关系也缺失,FAV 不得绕过授权直接对用户开放,只能进入管理员隔离恢复流程。
### 3. 发布必须避免双写裂缝
数据库事务内同时提交业务终态、精确 payload/SHA 的不可变 staging 和 `artifact.publish.requested` outbox;事务外 publisher 只从 staging 幂等写 blob、manifest,校验后最后写 commit marker,再回填 receipt。对象存储 I/O 不进入数据库事务。不能让异步 publisher 重读仍可更新或随 session 级联删除的消息行。
清理流程只认 `verified` receipt,不认“消息发过”“目录存在”或“有一个 SHA”。重复投递必须由 `artifact_uuid + source_event_id + payload_sha256` 去重;相同逻辑资源的新终态生成新 manifest,不覆盖旧 manifest。
### 4. Manifest 必须表达恢复语义
每个归档单元至少包含:
```text
artifact_schema_version
artifact_uuid / artifact_type / logical_resource_id
project_external_key / environment
source_event_id / source_run_id / source_message_id / source_snapshot_id
payload members: name / media_type / byte_size / sha256 / required
terminal_evidence: state / decided_at / actor_ref / policy_version
lineage: parent artifact / document version / chat turn
retention_class / sensitivity / encryption_key_ref
source_database_identity / source_schema_version / source_commit
published_at / publisher_version / manifest_sha256
```
manifest 使用稳定外部标识,同时保留旧数据库 ID 作为来源提示。它必须能在没有原数据库的情况下建立离线目录,但不得声称自己包含未列出的业务依赖。
### 5. 恢复必须经过隔离与对账
FAV 支持两种恢复结果:
- `recover-as-collection`:把验证通过的成果导入新的恢复集合/文档,保留原来源与 hash,不伪造原工作流状态。这是默认模式。
- `relink`:只有项目、用户、权限、会话和版本依赖均存在且无冲突时,才把成果重新连接到原逻辑资源。
恢复顺序为:离线 inventory → manifest/schema/SHA 校验 → 删除账本/保留策略检查 → scratch DB 导入 → 依赖与 ID 映射 → 冲突预览 → 人工确认 → 单事务 promotion → 审计报告。禁止 GET 接口因发现不一致而自动写回数据库,也禁止直接覆盖既有 head 或消息。
## 可恢复与不可恢复边界
| 可从 FAV 恢复 | 不能只靠 FAV 恢复 |
|---|---|
| 最终 Markdown/附件字节与 MIME/SHA | 用户认证凭证、session、token |
| 已归档助手最终回复及其稳定 turn/message 来源 | 项目成员关系、文档 duty、当时的完整授权图 |
| 文档版本/快照的有限来源、父子和生成 run 线索 | 活跃 lease、pending candidate、未完成 task/run |
| 最终报告、批准/提交终态证据 | 通知投递状态、outbox 消费位置、worker 状态 |
| 恢复所需 schema/producer/storage identity 元数据 | 未进入准入清单的草稿、中间过程和完整数据库约束 |
因此灾难恢复仍须保留 PostgreSQL base backup/WAL 或经验证的完整逻辑备份;FAV 解决的是“最终成果可独立找回”和“有限业务内容可重建”。
## 存储、保留与安全
- 第一阶段可用独立 filesystem backend,但必须有独立 `vault_storage_identity`、最小权限凭证和 mount,不允许退回 `./data/dev`;凭证只从受管 secret/env 注入。生产目标应支持 TLS、静态加密及异机/对象存储复制。
- 当前仓库没有 tenant 实体,安全边界应使用现有 `environment + project_members/role-admin` 授权模型,不得伪造 `tenant_id`。blob 采用**项目作用域加密 CAS**:同项目按 SHA-256 去重,跨项目相同 SHA 不共享密钥和删除边界;未来引入组织/租户层须另立 ADR 和迁移。
- manifest-member 到 blob 的引用账本决定删除:tombstone 先撤销单个成果读取与 key wrapping;仅当项目作用域内最后有效引用消失且 retention/legal hold 允许时物理清除。manifest 和 commit marker 只追加,定期执行 checksum scrub 和离线目录重建。
- filesystem backend 必须以同文件系统临时文件、校验、文件 `fsync`、原子 no-replace rename、父目录 `fsync` 实现持久化,确认 blob/manifest 落盘后才提交 marker;不能把“最后写 marker”误当成掉电安全。
- WORM/对象锁按数据类别启用,不对所有内容一律永久锁定。普通保留使用可治理模式;法律保全单独使用 legal hold。
- project/user 授权仍由服务端复用正常读取的既有判定;授权关系缺失或不确定时 fail closed。归档正文不得进入日志、metrics 或通知 payload。
- 自动归档前执行服务端敏感内容准入:结构化排除 Prompt/工具轨迹,secret、认证材料、restricted 或分类失败均 fail closed,且正文不进入 outbox/staging。
- 建立删除/法务保留账本。满足删除条件时先禁止读取和恢复,再删除密钥/对象;任何历史 restore 都必须重放 tombstone,避免已删除内容复活。
- manifest 不保存 secret、Prompt、内部推理、工具轨迹或认证材料;敏感元数据最小化,必要时使用不可逆外部键映射。
## 与数据精简方案的关系
FAV 与 migration corpus、完整备份是三个不同产品:
| 机制 | 目的 | 内容 |
|---|---|---|
| Final Artifact Vault | 持续保存终态成果,供定位、只读降级和有限恢复 | 小而长期、按终态事件持续追加 |
| Migration corpus | 验证旧 schema 到新 schema 的迁移、异常和 reload | 小而可重复、脱敏、带 assertions |
| DB + state backup/PITR | 完整灾难恢复与回滚 | 大而完整、按 RPO/RTO 生成 |
清理不能因为“FAV 有最终正文”就跳过完整备份,也不能用完整备份替代成果级准入。正确门禁是三者分别验证:最终成果覆盖率、迁移 corpus 可升级、完整备份可恢复。
首次启用 FAV 时还必须做一次**存量终态回填**:只从权威数据库的不可变 snapshot、批准/提交事件和 completed chat turn 枚举,以来源事件 + payload SHA 幂等产生请求。缺正文或终态证据的记录进入 quarantine;批准排除必须记录原因、批准人和有效期。禁止为了达到 coverage 扫描 workspace 或批量把“旧数据”标为已覆盖。
## 外部依据
- [RFC 8493 BagIt](https://www.rfc-editor.org/rfc/rfc8493.html) 要求 manifest 覆盖 payload 并验证完整性,支持本方案的 manifest/checksum 设计。
- [OCI Descriptor](https://github.com/opencontainers/image-spec/blob/main/descriptor.md) 以 digest 标识并校验内容,支持内容寻址 blob。
- [AWS Transactional Outbox guidance](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html) 说明业务写入与 outbox 同事务、消费者幂等的必要性。
- [PostgreSQL PITR](https://www.postgresql.org/docs/17/continuous-archiving.html)、[pg_restore](https://www.postgresql.org/docs/17/app-pgrestore.html) 与 [pg_verifybackup](https://www.postgresql.org/docs/16/app-pgverifybackup.html) 说明完整恢复、选择性恢复依赖和真实 restore 演练的边界。
- [AWS S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) 说明 governance/compliance/legal hold 的差异,支持按数据类别选择保留模式。
## 建议动作
1. 采用[最终成果保险库整改方案](../../remediation/2026-09-14-final-artifact-vault-remediation.md),先定义终态协议和 manifest,再选择 filesystem 或对象存储实现。
2. 将 FAV 发布完成率加入 dataset inventory/GC 的硬门禁,但不把 FAV 设为当前 409 的绕行修复。
3. 首次实现优先覆盖受控文档 approved/agent committed snapshot 与 `export_policy=full` 的 completed assistant reply。
4. 先在 dev 用项目 6173 的等价脱敏 corpus 做“生成 → 发布 → 清 workspace → 读取/恢复 → rebuild”演练,再考虑 main 保留策略。
@@ -0,0 +1,150 @@
---
title: "运行数据精简、迁移语料与演示数据保留策略"
created: 2026-09-14
status: done
confidence: high
---
# 调研:运行数据精简、迁移语料与演示数据保留策略
## 结论
用户提出的“及时清理过往数据,只保留最新、有用且必要的一部分,并用保留数据验证迁移和重载”方向合理,尤其适合当前快速迭代期的 dev/test 环境。
但必须补充两个边界:
1. 清理历史运行数据只能降低数据转换量和现场噪声,不能替代对受支持旧 schema 的迁移兼容;应把有价值的旧状态压缩成小型、可重复、脱敏的 migration corpus。
2. 不应在当前库上逐表删除后继续使用;当前跨项目数据存在非完整级联和 DB/文件双事实源,优先采用“新库 + 新状态根 + 选择性导入 + 旧卷隔离”的蓝绿轮换。
3. 对最终成果再增加独立 [Final Artifact Vault](./2026-09-14-final-artifact-vault.md),但它只辅助成果定位与部分恢复,不能替代完整 DB+state 备份或旧 schema migration corpus。
## 当前数据画像
2026-09-14 只读现场:
| 环境 | schema | 项目数/特征 | 文件状态 | 判断 |
|---|---:|---|---|---|
| dev | 33 | 366 个项目;149 active、217 planning;全部产生于 9 月 11–14 日 | 主仓 `data/dev` 约 100MB | 大量 PG/E2E 夹具,适合立即精简,但须先解决当前错误挂载事故 |
| test | 29 | 约 37 个项目 | 主仓 `data/test` 约 20KB | schema 落后且数据价值低,应改为可重建/短 TTL |
| main | 25 | 10 个历史 seed 项目,当前无受控文档 | 主仓 `data/main` 约 20KB | 不应用作日常迁移试验;清理需另行确认业务/展示用途 |
| shared KB | 独立 | 跨环境共享知识库 | `data/shared` | 不属于本方案的项目数据清理范围 |
dev 主要表约有:`projects=366`、`chat_sessions=421`、`chat_messages=1923`、`task_runs=307`、`document_records=153`、`document_snapshots=283`、`document_change_events=257`。数据库总体不大,主要问题不是容量,而是数据来源混杂、迁移噪声和无法判定哪些记录应保留。
## 现有清理为何不能直接做
### 1. `DELETE projects` 不是完整项目删除
当前外键有 101 条,部分项目子表 CASCADE,但存在关键例外:
- `task_runs.project_id` 是 `ON DELETE SET NULL`,项目删除后 run/event 仍可残留;
- `document_versions`、`document_snapshots`、`document_change_events`、`document_change_reports`、`document_agent_candidates` 依赖 `doc_id`/snapshot/version,但不完整依附 `projects`;
- `document_content_blobs` 与 `storage_blobs` 需要引用计数/mark-and-sweep,不能看到文件就删;
- 工作区、agent sessions、CAS 文件位于状态根,数据库 cascade 不会删除文件;
- notification/outbox/audit/lineage 的保留语义不同,不能一律级联。
所以简单删除项目会制造孤儿数据,反而加重后续迁移与排障成本。
### 2. 现有备份/恢复不足以支撑安全轮换
- `backup-system-db.sh` 只导出 PostgreSQL,不包含与之匹配的 `data/<env>` 文件状态;
- `restore-system-db-drill.sh` 校验 dump 列表并运行迁移测试,但当前没有真正把 dump restore 到新隔离数据库;
- restore 未强制隔离目标,默认路径存在误触共享 dev 库的风险;
- 没有 dataset manifest、项目选择、文件 SHA inventory、脱敏、预期断言与导入校验;
- 备份脚本的凭证来源需要改成统一安全配置,不应保留脚本内默认值。
在这些缺口补齐前,不能用“有 dump”作为可删除证明。
## 建议的数据分类
| 类别 | 用途 | 典型内容 | 是否进入日常运行库 | 保留策略 |
|---|---|---|---|---|
| `operational-pinned` | 当前人工使用/正在排障 | 项目 143 等明确认领项目 | dev 可保留;main 按业务规则 | 显式 pin,禁止自动清理 |
| `demo-current` | 产品展示 | 每个正式工作流 1 个完整、可解释项目 | dev/demo 环境 | 只保留当前版本;新版验证后替换旧版 |
| `regression-golden` | 功能回归 | 文档版本、人工修订、并发冲突、reload 等完整链 | 隔离验收库,可选只读展示副本 | 小型、确定性、脱敏;按能力而非数量保留 |
| `migration-baseline` | 旧 schema → 当前 schema | 旧 release 的最小 DB + 匹配文件包 | 仅隔离迁移测试 | 最多保留 3 个 release 基线,滚动替换 |
| `ephemeral-test` | PG/E2E 单次运行 | 自动测试项目、会话、run、workspace | 每次独立数据库/状态根 | PASS 后立即删;FAIL 保留 3–7 天 |
| `quarantine` | 清理回滚与取证 | 被替换的完整卷/状态根 | 不挂载到运行容器 | 只读 7–14 天,恢复演练通过后销毁 |
## 建议的最小保留集合
当前 dev 可先采用 6–10 个项目的上限,而不是按日期盲留:
1. 项目 143:暂作旧数据/canonical repair/active workflow 回归样本;若含真实内容,不进入 Git,后续用脱敏等价 fixture 替换。
2. 项目 6173:目前最新且证据完整的受控正文 UI 全链,含两份受控文档、V3/r2、并发、权限与 restart 验证,可作为当前回归/展示候选。
3. 项目 6159:保留一个发布周期作为上一轮文档账本对照;6173 corpus 稳定后删除,避免永久重复。
4. 三个正式工作流各生成 1 个 `demo-current`:`main`、`product_manager`、`test_manager`;必须由固定 seed/真实页面脚本可重建,不能依赖手工挑出的偶然状态。
5. 1 个失败/异常样本不进入展示库,只进入隔离 `regression-golden`:覆盖 projection missing、hard-break、旧消息 scope、高 ID sequence 等历史风险。
最新项目不等于最有价值。选择评分应优先:证据完整度、覆盖的能力、是否可脱敏重建、DB/文件一致性、是否有预期断言;时间只作为同类样本的淘汰条件。
本轮已只读确认 143、6159、6173 共 5 份受控文档在主仓状态根的 `output.md` 均存在且 SHA 与 `document_records` 一致;这说明它们具备候选资格,但仍需通过敏感性、owner 和可恢复性审查后才能进入最终 retain allowlist。
## 迁移语料库策略
不保存每个 Goose 版本的整库。按产品 release 边界保留:
- `oldest-supported`:当前承诺支持的最老 release;
- `previous-release`:上一发布版;
- `current-pre-upgrade`:本次上线前快照,下一次轮换为 previous。
当前建议先建立三个最小基线:
- schema 25:文档账本前/早期治理状态,覆盖 main 当前落后路径;
- schema 28/29:文档 revision 首次引入后的状态,覆盖 test 当前路径;
- schema 32/33:canonical repair、task 状态和当前数据根契约。
这些基线应由迁移 fixture builder 在隔离库中构造或从已批准快照脱敏得到,不能直接把 main/test 的运行数据当测试资产。
每个 corpus package 必须包含:
```text
manifest.json
database.dump
state.tar.zst
checksums.txt
assertions.yaml
```
manifest 至少记录 dataset 版本、source schema、目标 schema、生成 commit、storage identity、项目/会话/文档/run 数量、文件总数和 SHA、脱敏状态、过期时间;`assertions.yaml` 记录迁移后必须成立的版本、状态、正文 hash、序列与权限断言。
二进制 dump/状态包不进 Git;仓库只保留 manifest schema、fixture builder、脱敏规则、选择规则和非敏感断言。实际包放受控备份目录或对象存储。
## 每次发布的数据轮换模型
```text
旧运行库/状态根(只读)
│ export + manifest + checksums
▼
迁移语料构建区(脱敏/裁剪/恢复验证)
│
├── oldest-supported corpus
├── previous-release corpus
└── current demo/regression corpus
│
▼
新数据库 + 新状态根(latest schema)
│ import selected datasets
▼
工程门禁 + 页面验收 + rebuild/reload
│ PASS
▼
切换运行 identity;旧卷 quarantine 7–14 天后销毁
```
这比在原 dev 库上大规模 DELETE 更适合当前阶段:新库天然消除未知孤儿,导入过程本身又验证了备份、迁移、文件配对、序列和重载。
## 风险边界
- main 真实业务数据不能套用 dev 的 7–14 天策略;须先定义业务、合规、审计和用户删除规则。
- 项目 143 等真实内容不能直接固化为仓库 fixture;应保留 hash/结构特征并脱敏重建。
- migration corpus 不能只有 happy path,否则清场后会失去发现 legacy bug 的能力。
- 任何清理必须先完成隔离 restore,并验证数据库与文件包属于同一 storage identity。
- 任何清理还必须验证应归档终态成果均已取得 FAV verified receipt;“有归档正文”不能替代完整关系闭包恢复。
- 错误 `/tmp` 数据根属于当前事故证据;在 split-brain 恢复报告签字前不纳入普通清理。
## 建议动作
- 采用 [运行数据生命周期与迁移语料整改方案](../../remediation/2026-09-14-runtime-data-lifecycle-and-migration-corpus-remediation.md)。
- 首轮只处理 dev;test 改为短 TTL 隔离环境;main 仅盘点,不删除;shared KB 排除。
- 先实现 dataset inventory/export/restore/verify,再执行蓝绿精简,不先写清理 SQL。
- 并行实施[最终成果保险库整改](../../remediation/2026-09-14-final-artifact-vault-remediation.md),把成果覆盖率加入 GC/销毁门禁。
@@ -0,0 +1,87 @@
---
title: "协调库与 daemon:现状核查与边界核对"
created: 2026-09-23
owner: Cursor
task_id: coordination-db-daemon-2026-09-23
policy_revision: "agent-governance-2026-09-21-r1 @ 63e66c6fb35d6b4dd9f3ed92e15acc9933aeb344"
review_state: pending
integration_state: pending
deployment: not_required
cleanup: pending
remote_sync: not_requested
status: done
confidence: high
---
# 调研:协调库与 daemon 现状核查
## 范围与授权
- 用户目标:在本仓库重新落地「协调库 + daemon」方案与研究记录;L1 保持单宿主机,跨机 PostgreSQL 仅登记为 planned 的 L2(需二次授权与 ADR)。并行授权修掉 `agentctl queue` 子解析器重复注册缺陷。
- 允许写路径(本调研):`.doc`(只读采样代码与 `.locks` 运行态)。
- 交付终点:可审的研究记录 + 配套方案;不实施 daemon/PostgreSQL,不改产品业务代码。
- 非目标:跨机 HA 实施、OS 沙箱、产品容器依赖式协调。
## 结论
1. `.locks/state.sqlite` 已是本机协调权威库(11 表;采样时 tasks≈105、runs≈653、events≈1406),不是「部分状态」;`scripts/agentctl.py` 已 enforced scope / lease / CAS / 收据 / 候选准入 / `--ff-only`。
2. 真正缺口是:显式长期 claim、常驻监管入口、策略外部化、CURRENT/MATRIX 稳定 record id;`queue`/`jobs` 在修复前因 CLI 缺陷恒为 0 行(已由 `63e66c6f` 修复 parser)。
3. 跨机 + 独立 PostgreSQL + systemd 与 [2026-09-21 锁方案](../../remediation/2026-09-21-agent-lock-coordination-plan.md) §3.2 及 [平台深化方案](../../remediation/2026-09-23-platform-deepening-reliability-ha-concurrency-plan.md) §0 冲突,只能作为 L2 planned,开工前另立 ADR。
## 证据
| 项 | 路径/命令 | 结果 |
|----|-----------|------|
| 权威库存在 | `.locks/state.sqlite`(gitignore:33;dockerignore:24) | 存在;`sqlite3 -readonly … ".tables"` → deployments/documents/events/freezes/jobs/projections/queue_items/receipts/runs/tasks/validations |
| 行数采样(2026-09-23) | `sqlite3 -readonly .locks/state.sqlite` 计数 | tasks 105;runs 653;events 1406;queue_items 0;jobs 0 |
| 无 Go agentctl | `cmd/` 列表 | 无 `cmd/agentctl`;协调 100% Python |
| scope/lease | `scripts/agentctl.py:27` `SHARED_DOCS`;`:589` `class Lease`;`:554+` `check_resources` | 已实现;header 声明 cooperative/advisory |
| 文档 CAS | `docs apply` `:856`;收据 `:954`;hook `:1057-1064` | 已 enforced(相对受控入口) |
| 候选准入 | `admit_candidate` `:1066`;`integrate` `--ff-only` | 已 enforced |
| queue 缺陷(修复前) | 曾于 `:1613` 与 `:1629` 双重 `add_parser('queue')` | 后注册覆盖先注册;handler 读 `args.head`/`args.drain`/`args.task` |
| queue 修复 | 合入 `63e66c6fb35d6b4dd9f3ed92e15acc9933aeb344` | 仅保留一处注册(现 `:1613`);回归测试 3 例;全套 unittest 103/2 skipped PASS |
| 策略 YAML | `configs/agent-governance.yaml` | **不存在**;策略硬编码于 `agentctl.py` / `agentctl_w4.py` |
| 常驻服务 | `find` `*.service`/`*.plist`;compose 无 agentctl | **0 个**;`queue schedule`/`deploy run-loop` 均为前台调用 |
| 主机 | `uname -s` | Darwin(macOS);systemd 不能作为本机 L1 默认 |
| 孤儿实现 | `scripts/agentctl_automation.py` | 零导入;schema 含 `operations`/`doc_registry`,活库无这两表 |
| 孤儿文件 | `.locks/state.db` | 0 字节;代码无引用 |
| 既有方案 | `.doc/remediation/2026-09-21-agent-lock-coordination-plan.md` | planned;推荐本机 SQLite,明确拒绝产品 PG/跨机锁服务(本期) |
| INDEX 缺口 | `.doc/remediation/INDEX.md` | 未索引 2026-09-21 锁方案 |
| CURRENT 矛盾 | `.doc/ops/CURRENT.md:5` vs `:15` | 分别写 macOS 租约可用 / 不可用 |
| 操作规范过时 | `.doc/ops/2026-09-21-agent-worktree-workflow.md:3` | 仍写「Linux 本机」;W1-B macOS 已 done |
| 不存在的摘要产物 | `3f14d7fa`;`2026-09-23-coordination-db-daemon-*.md`(合入前) | 对象名无效;路径不存在;本轮为重新落地 |
## 边界冲突核对
| 主张 | 权威来源 | 处置 |
|---|---|---|
| 跨机锁服务 / 产品 PG 协调 | 锁方案 §3.2「当前不采用」 | L2 planned;另立 ADR 前不开工 |
| HA=单宿主机 | 平台深化方案 §0(用户确认) | L1 遵守;跨机不在深化方案范围内 |
| L1 不宣称 OS 沙箱 | 操作规范 `:5`;`agentctl.py:2` | 方案全文保持 advisory |
| systemd 作为非容器运行方式 | 仓库无 unit;主机 Darwin | L1=launchd;systemd 仅 L2 Linux 中央主机 |
## 机制核验(官方语义,推论)
- SQLite 短事务可原子完成多资源冲突检查,但不能装入多小时开发。
- flock 与打开 fd 绑定;TTL 到期不等于进程已停写。
- 两次 Markdown rename + SQLite 不是跨介质原子事务;发布边界仍是 Git 提交。
- argparse 同名子解析器后注册覆盖先注册(本轮缺陷根因)。
## 开放问题
- L2 ADR 的 RPO/RTO、中央主机拓扑与凭证边界待二次授权。
- `agentctl_automation.py` 收敛或删除的独立实施批次尚未认领。
- FEATURE-MATRIX 27 行稳定 record id 迁移策略(additive vs 一次性改表)待 U6 开工前确认。
## 建议动作
1. 合入本调研与配套方案(docs-only)。
2. 按方案 U1–U7 另立实施 short-term;U1 剩余项(automation 归一、state.db 清理)在 queue 修复之后继续。
3. L2 仅登记,不排期。
## 状态与交接
- 被审 SHA:`63e66c6fb35d6b4dd9f3ed92e15acc9933aeb344`(含 queue 修复)。
- 本文件状态 `done` 指调研可审,不代表方案已实施。
- 配套方案:[协调库与 daemon 方案](../../remediation/2026-09-23-coordination-db-daemon-plan.md)。
- 任务主记录:[short-term](../short-term/2026-09-23-coordination-db-daemon.md)。
@@ -0,0 +1,61 @@
---
title: "dev runtime data root split-brain 诊断、方案审查与修订"
status: in_progress
created: 2026-09-14
updated: 2026-09-14
owner: Cursor
branch: fix/dev-runtime-data-root-guard
worktree: .worktrees/fix-dev-runtime-data-root-guard
mutex: infra-runtime-state
---
# dev runtime data root split-brain 诊断、方案审查与修订
## 目标
定位项目 143 刷新 409 的当前根因,经审查后把整改方案改成可执行、可分批批准的文本;**不实施**纠挂或业务代码,直到用户再批 Unit A / Unit B。
## 范围
- 诊断:用户报错链、dev PostgreSQL、主仓文件、容器 mount、health/ready、Compose / `env-service.sh`
- 审查:原文六波次方案的内部矛盾、可行性、抢占与身份首启风险
- 修订:Unit A / Unit B / Deferred 拆分与可执行 Wave 0 Runbook
## 非目标
- 不操作真实用户会话
- 不写数据库、不覆盖正文、不删除错误根
- 本轮不 rebuild、不占集成槽执行纠挂(抢占授权已写入方案,实施另批)
- 不变更运行中的 test/main
## 步骤
1. [x] 完成仓库启动链、既有 canonical hash/refresh 事故文档复核。
2. [x] 比对项目 143 DB record、ledger head、主仓 `output.md` 与容器内路径。
3. [x] 审计 app/pi/cursor mounts、Compose working dir、健康检查与影响面。
4. [x] 完成初版 audit、remediation、gap/feature/current SSOT。
5. [x] 多视角审查原文方案;现场复核挂载与集成槽仍为事故态。
6. [x] 按审查结论重写整改方案(Unit A/B/Deferred + 可执行 Runbook)。
7. [ ] 用户再批后实施 Unit A(事故抢占纠挂)。
8. [ ] 用户再批后实施 Unit B(绝对状态根 + 门禁 + `/ready`)。
## 验收标准
- [x] 直接根因有数据库、文件和容器三方证据。
- [x] 明确区分旧 hash drift、真正 ETag 409 与本次 projection missing。
- [x] 修订方案不再把 Wave 0 依赖尚未存在的 identity / outbox;不再把 Deferred 当事故关门条件。
- [x] 未污染真实会话或修改共享运行态。
- [ ] Unit A/B 实施与验收(另批)。
## 相关链接
- Audit: [../../audit/2026-09-14-dev-runtime-data-root-split-brain.md](../../audit/2026-09-14-dev-runtime-data-root-split-brain.md)
- Remediation: [../../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md](../../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md)
- Test report: 待 Unit A 实施后创建
## 证据 / 备注
- 诊断分支:`fix/dev-runtime-data-root-guard`,基线 `dev@a8f9451`,诊断 commit `f1edb70`。
- 2026-09-14 08:54 UTC 诊断:app/pi/cursor 均挂 `/tmp/as-dev-wf409-merge/data/dev*`;DB 仍为 `agent-dev-context-pgdata`。
- 2026-09-14 ~09:23 UTC 审查复核:同一挂载仍在;`/health` `/ready` 200,`schema_version=33`;主仓 CURRENT 槽位仍为 `implementer_cursor` e2e。
- 用户选择:Wave 0 = 事故抢占;先改方案再批实施。
@@ -2,7 +2,7 @@
title: "文档可靠性 M1 活验签字与条件 M2"
status: done
created: 2026-09-14
updated: 2026-09-14
updated: 2026-09-22
owner: Cursor
branch: refactor/document-reliability-pilot
worktree: .worktrees/refactor-document-reliability-pilot
@@ -11,6 +11,8 @@ mutex: workspace
# 文档可靠性 M1 活验签字与条件 M2
> **W1-D(2026-09-22)**:与 [pilot](./2026-09-14-document-reliability-pilot.md) 同步——`workspace` mutex 不再被「停止扩面」名义冻结;G1/G2 可消费已交付 workspace 能力。U6 outbox / U7 FAV 仍须独立审批。
## 目标
占集成槽把试点合入本地 `dev` 并 rebuild,补齐真实 PI / 浏览器 / 跨用户 / 多会话签字。仅当新报告最后一句为「继续 M2」时开工 U5–U7。
@@ -1,16 +1,25 @@
---
title: "文档可靠性纵向试点 M0–M1"
status: blocked
status: done
created: 2026-09-14
updated: 2026-09-14
updated: 2026-09-22
owner: Cursor
branch: refactor/document-reliability-pilot
worktree: .worktrees/refactor-document-reliability-pilot
mutex: docgov
superseded_by: "./2026-09-14-document-reliability-m1-live-and-m2.md"
---
# 文档可靠性纵向试点 M0–M1
> **W1-D 重裁(2026-09-22)**:本文件曾标 `blocked`,并以试点报告「停止扩面」禁止 U5–U12。随后证据链已超越该门禁:
>
> 1. [M1 活验报告](../../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md) 末句 **继续 M2**(刷新/跨用户/真 PI/多会话已签字);
> 2. [M1 活验 + 条件 M2 任务](./2026-09-14-document-reliability-m1-live-and-m2.md) `status: done`;
> 3. [M2 报告](../../test-reports/2026-09-14-document-reliability-m2-test-report.md) 末句 **继续 M3**;`internal/workspace` `WorkspaceRef`/`Capability` 已生产接线,`module-boundaries.yaml` `unwrap_owners` 含多包。
>
> 因此本任务改为 `done`(试点范围已关闭),**不再**用「停止扩面」阻挡 workspace 路径改造(G1/G2)。历史试点报告原文不改写;门禁以活验/M2 报告为准。M3+ 仍需独立授权。
## 目标
在不横向搬包的前提下,完成 U1–U4,使受控文档在并发提交、页面刷新、重登、restart、rebuild 和 projection 缺失后仍从数据库账本返回唯一授权正文。
@@ -37,28 +46,31 @@ mutex: docgov
3. [x] 实现 U2,验证任意属主写入/commit 故障整体回滚。
4. [x] 实现 U3,删除提交后 outbox 正确性回调。
5. [x] 实现 U4,保证 GET 零写入和 projection 缺失不再伪装成 404。
6. [x] 隔离库 PG + 目标包 race 已跑;真实 PI / 浏览器 / rebuild **未**签字(未占槽)。
7. [x] 写 test report:结论 **停止扩面**。更新验收清单、FEATURE-MATRIX、CURRENT 和 gap-matrix。
6. [x] 隔离库 PG + 目标包 race 已跑;真实 PI / 浏览器 / rebuild 由后续活验任务签字。
7. [x] 写 test report;更新验收清单、FEATURE-MATRIX、CURRENT 和 gap-matrix。
## 验收标准
- [x] 同一 ETag 并发编辑只有一个合法赢家(内存 8 协程 + 隔离库双会话)。
- [x] 任一事务故障点不会留下部分提交(U2 隔离库)。
- [ ] 项目 143 等价 hazard 和新项目刷新/重启目标 404/409/projection missing 为 0(真实页面未测)。
- [x] 服务端匿名/未知文档/跨项目/错误责任人 fail closed;浏览器跨登录未测。
- [ ] 1、2、4 个 app 实例的最终状态一致(仅到双会话)。
- [x] M1 test report 结论:**停止扩面**。
- [x] 项目 143 等价 hazard 和新项目刷新/重启目标 404/409/projection missing 为 0 — **由活验报告关闭**(原试点未测)。
- [x] 服务端匿名/未知文档/跨项目/错误责任人 fail closed;浏览器跨登录 — **由活验报告关闭**。
- [x] 1、2、4 个 app 实例的最终状态一致 — **由活验/隔离库双 pool 关闭**。
- [x] M1 试点报告结论保留为历史「停止扩面」;**活验报告**结论为「继续 M2」。
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Test report: [../../test-reports/2026-09-14-document-reliability-pilot-test-report.md](../../test-reports/2026-09-14-document-reliability-pilot-test-report.md)
- Pilot report(历史): [../../test-reports/2026-09-14-document-reliability-pilot-test-report.md](../../test-reports/2026-09-14-document-reliability-pilot-test-report.md)
- Live report: [../../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md](../../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md)
- M2 report: [../../test-reports/2026-09-14-document-reliability-m2-test-report.md](../../test-reports/2026-09-14-document-reliability-m2-test-report.md)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- Superseding task: [./2026-09-14-document-reliability-m1-live-and-m2.md](./2026-09-14-document-reliability-m1-live-and-m2.md)
## M2+ 门(不开工)
## M2+ 门(历史 / 已超越)
U5 WorkspaceRef、U6 outbox、U7 按文件摘 FAV 需要独立审批,且仅当 M1 报告最后一句为「继续 M2」。当前是「停止扩面」,禁止实现 U5–U12。
原约束:「仅当 M1 报告最后一句为继续 M2」才开工 U5–U7;试点报告写「停止扩面」。**已被活验报告「继续 M2」与 M2 任务 done 超越**;不得再引用本段阻挡 workspace 路径改造。M3(含 FAV live)仍须独立审批。
## 证据 / 备注
隔离库与目标包 race 见 test-report assets。未占槽、未 rebuild。只有真实 PI/浏览器/rebuild 补测并把报告改为「继续 M2」后,才允许启动 durable event/FAV。
隔离库与目标包 race 见 pilot test-report assets。活验与 M2 证据见上链。
@@ -0,0 +1,49 @@
---
title: "最终成果保险库 V0–V6 落地"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor
branch: feature/final-artifact-vault
worktree: .worktrees/fix-dev-runtime-data-root-guard
mutex: artifact-vault
---
# 最终成果保险库 V0–V6 落地
## 目标
按已审查方案实现 FAV:协议、独立存储、文档/助手接入、存量回填、只读降级、scratch 恢复与清理门禁。
## 非目标
- 不替代 Unit A/B 纠挂
- 不占 agent-dev 集成槽 rebuild
- 不扫描 workspace 猜测终态
- 不新增 tenant_id
## 步骤
1. [x] V0 ADR/schema/eligibility/goose/表征(goose **00034**)
2. [x] V0 领域缺口(review_snapshot_id、ledger hook、task CompleteChatTurn + export 列)
3. [x] V1 存储与 publisher(独立根、项目作用域 CAS、PG/Memory registry)
4. [x] V2 文档接入(persistAgentCommit / ApproverApprove / freeform publish)
5. [x] V3 助手接入(同步 chat + task finalize)
6. [x] V3.5 回填(只枚举账本/完成 turn)
7. [x] V4 降级读取(`FAV_DEGRADED_READ` 默认关)
8. [x] V5 恢复(scratch-only recover-apply 写入 collection;union-deny 跳过 tombstone)
9. [x] V6 门禁与三份演练报告(live e2e 待 Unit A)
10. [x] 缺口补齐:approve/commit 同事务 staging;半发布 exclusive 重试;GET 零写入;`copy_only` pin-export;destroy 预检 CLI
## 相关链接
- ADR: [../../adr/2026-09-14-final-artifact-vault.md](../../adr/2026-09-14-final-artifact-vault.md)
- Remediation: [../../remediation/2026-09-14-final-artifact-vault-remediation.md](../../remediation/2026-09-14-final-artifact-vault-remediation.md)
- Test report: [../../test-reports/2026-09-14-final-artifact-vault-test-report.md](../../test-reports/2026-09-14-final-artifact-vault-test-report.md)
## 证据 / 备注
- 分支:`feature/final-artifact-vault`
- 未执行 `env-service` rebuild;`FAV_DEGRADED_READ` 默认 false
- Goose:`00034_2026-09-14-final-artifact-vault.sql`
- 未合 `dev`;live 6173 / PITR / corpus 仍待 Unit A 另占槽
@@ -0,0 +1,61 @@
---
title: "最终成果保险库调研与整改方案"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: fix/dev-runtime-data-root-guard
worktree: .worktrees/fix-dev-runtime-data-root-guard
mutex: artifact-vault
---
# 最终成果保险库调研与整改方案
## 目标
评估并完善“只归档最终生成物和最终智能体回复”的提案,形成不会与数据库、文档账本和工作区争夺事实源,且能支持受控部分恢复的系统方案。
## 范围
- 最终文档版本、最终助手回复和必要恢复元数据的归档边界;
- 终态判定、原子发布、不可变清单、校验、授权、保留与删除;
- 工作区清理门禁、降级读取、隔离恢复和数据库重建边界;
- 与现有数据生命周期、迁移语料、文档账本和对话持久化方案衔接。
## 非目标
- 本轮不实现业务代码、数据库迁移或对象存储;
- 不归档候选稿、流式片段、工具轨迹、租约、临时工作区或其他中间结果;
- 不把保险库定义为运行数据库的完整镜像或自动覆盖线上数据的入口;
- 不执行数据删除、卷切换或恢复写入。
## 步骤
1. [x] 登记任务和独立 mutex。
2. [x] 核对现有文档快照、CAS、最终助手消息、任务终态和备份恢复边界。
3. [x] 评审提案,明确可采用部分、必须修正部分和反模式。
4. [x] 编写专项调研与整改方案,并并入运行数据生命周期方案。
5. [x] 更新 CURRENT、FEATURE-MATRIX、gap-matrix 与整改索引。
6. [x] 完成文档一致性、安全、可行性和对抗性复核。
## 验收标准
- [x] 明确“最终”的服务端判定规则和禁止进入保险库的内容。
- [x] 明确数据库、工作区、保险库三者权威边界,不产生静默双写。
- [x] 方案含 manifest/checksum、幂等发布、清理前门禁、降级读取和隔离恢复流程。
- [x] 明确可恢复与不可恢复的数据范围、安全/删除要求及恢复演练。
- [x] 本轮未实施业务代码或破坏性操作。
## 相关链接
- Research: [最终成果保险库与部分恢复边界](../research/2026-09-14-final-artifact-vault.md)
- Remediation: [最终成果保险库与受控恢复](../../remediation/2026-09-14-final-artifact-vault-remediation.md)
- Test report: 待用户批准实施后创建
## 证据 / 备注
- 当前受控文档不可变正文位于 PostgreSQL `document_content_blobs`,工作区 `output.md` 是投影。
- 当前附件 CAS 物理 blob 位于运行状态根,引用元数据位于 PostgreSQL。
- 当前任务完成摘要通过 `FinalizeAssistantTaskMessage` 写回 `chat_messages`,尚无独立终态成果发布协议。
- 文档复核补齐:显式发布不可绕过终态、不可变 payload staging、项目作用域加密 CAS/引用删除、存量回填、掉电持久化、敏感内容准入、既有项目授权降级和 scratch 恢复权限。
- 独立 Claude 安全/对抗复核结果已收敛;whole-document peer 因结构化输出重试耗尽被丢弃,未作为结论依据。
@@ -0,0 +1,60 @@
---
title: "运行数据精简与迁移语料库方案"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: fix/dev-runtime-data-root-guard
worktree: .worktrees/fix-dev-runtime-data-root-guard
mutex: infra-runtime-state
---
# 运行数据精简与迁移语料库方案
## 目标
评估及时清理旧数据建议的合理性,并设计可恢复、可迁移验证、可展示且不污染长期环境的数据生命周期方案。
## 范围
- dev/test/main 数据量、schema、项目/文档/run 关系与文件状态;
- 备份/恢复、选择性导出、迁移 corpus、蓝绿轮换;
- retention 分类、TTL、quarantine、GC 和验收门禁。
- 最终成果保险库 coverage 与清理门禁,但不以其替代完整备份。
## 非目标
- 不执行 DELETE/TRUNCATE/drop volume;
- 不修改数据库、文件正文或容器;
- 不清理 main/shared KB;
- 不把现有项目 ID 清单视作删除授权。
## 步骤
1. [x] 只读统计三环境 schema、项目/关键表规模和 dev 文件规模。
2. [x] 审计项目外键闭包、revision/CAS/workspace 孤儿风险。
3. [x] 审计现有 backup/restore drill 能力与隔离缺口。
4. [x] 制定数据分类、最小保留集、migration corpus 和蓝绿轮换方案。
5. [x] 更新父整改、CURRENT、gap 与 remediation 索引。
6. [x] 并入最终成果保险库、终态 coverage 和受控部分恢复边界。
## 验收标准
- [x] 明确说明建议合理的条件和不能替代 migration 的边界。
- [x] 首轮 retain 建议基于能力覆盖,不按时间盲留。
- [x] 方案包含备份配对、真实 restore、选择性导入、reload/rebuild、rollback 和延迟销毁。
- [x] 本轮未实施破坏性操作。
- [x] 明确最终成果保险库、migration corpus 和完整 DB+state backup 三者互补且分别验收。
## 相关链接
- Research: [../research/2026-09-14-runtime-data-retention-and-migration-corpus.md](../research/2026-09-14-runtime-data-retention-and-migration-corpus.md)
- Remediation: [../../remediation/2026-09-14-runtime-data-lifecycle-and-migration-corpus-remediation.md](../../remediation/2026-09-14-runtime-data-lifecycle-and-migration-corpus-remediation.md)
- Final Artifact Vault: [../../remediation/2026-09-14-final-artifact-vault-remediation.md](../../remediation/2026-09-14-final-artifact-vault-remediation.md)
- Test report: 待用户批准实施后创建
## 证据 / 备注
- dev schema 33 / 366 projects / 主仓状态约 100MB;test schema 29;main schema 25。
- `DELETE projects` 无法完整清理 task run、revision ledger、blob 与文件状态。
- 首选新 green DB/state root 导入 retain allowlist,旧 blue 只读隔离后延迟销毁。
@@ -1,8 +1,8 @@
---
title: "多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)"
status: done
status: in_progress
created: 2026-09-15
updated: 2026-09-16
updated: 2026-09-22
owner: Cursor
branch: "-"
worktree: "-"
@@ -11,6 +11,8 @@ mutex: "-"
# 多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)
> **W1-D 对账(2026-09-22)**:伪完成降级。U1–U8 步骤与独立单元报告已落地,但本总览 **11 条验收标准全部未勾**(含真实 PI E2E),且 U9–U12 步骤未完成 → `done` 改为 `in_progress`。FEATURE-MATRIX「多意图持久计划」行保持 `partial`。
## 目标
不回退现有模块解耦、单意图行为和权限边界,交付可持久、可恢复、可并发裁决的 2–4 步计划;所有批量生成/写入/控制确认前零副作用,执行前逐动作重新授权。
@@ -2,9 +2,7 @@
title: "多意图 HITL U5:决策 API 与授权端口"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u5-decision-api
updated: 2026-09-22
worktree: "-"
mutex: intent-plan
---
@@ -39,14 +37,15 @@ mutex: intent-plan
## 验收标准
- [ ] 投影缺失仍能 GET active
- [ ] 未登录 401;非成员 403;跨项目/会话/用户隐藏
- [ ] stale revision 409;重复 nonce 同 digest 同 receipt
- [ ] 非法部分确认拒绝;edit 使旧 revision 失效
- [ ] 确认前零副作用;权限撤销/资源版本 fail closed
- [ ] 无系统身份绕过
- [ ] `go test -short` 绿
- [x] 投影缺失仍能 GET active — 证据:[checklist](../checklists/2026-09-16-multi-intent-u5-decision-api.md) / http-verbose
- [x] 未登录 401;非成员 403;跨项目/会话/用户隐藏 — `TestIntentPlanHTTP_ScopeNegatives` / `AdminDoesNotBypassMembership`
- [x] stale revision 409;重复 nonce 同 digest 同 receipt — authorize-verbose / http-verbose
- [x] 非法部分确认拒绝;edit 使旧 revision 失效 — 同上
- [x] 确认前零副作用;权限撤销/资源版本 fail closed — authorize-verbose
- [x] 无系统身份绕过 — `AdminDoesNotBypassMembership`
- [x] `go test -short` 绿 — [short.txt](../../test-reports/assets/2026-09-16-multi-intent-u5-decision-api/short.txt)
> **W1-D(2026-09-22)**:验收框此前未勾但 checklist 与报告已全绿 → 按证据补勾,不降级 status。
## 相关链接
- 总览: [2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
@@ -2,7 +2,7 @@
title: "多意图 HITL U6:Web 卡片、刷新与可访问性"
status: done
created: 2026-09-16
updated: 2026-09-16
updated: 2026-09-22
owner: Cursor
branch: feature/multi-intent-u6-web-cards
worktree: "-"
@@ -37,11 +37,12 @@ UI 只呈现 PlanView;计划动作不走本地 AST/资源修改;刷新与双
## 验收标准
- [ ] 计划确认不修改 DocumentAST
- [ ] GET 可修复缺失投影
- [ ] 409 标 outdated 并带最新 PlanView
- [ ] 默认 Playwright skip
- [x] 计划确认不修改 DocumentAST — `planCardTouchesLocalAST` + App early-return
- [x] GET 可修复缺失投影 — checklist / planCard 测试
- [x] 409 标 outdated 并带最新 PlanView — 同上
- [x] 默认 Playwright skip — [npm-test.txt](../../test-reports/assets/2026-09-16-multi-intent-u6-web-cards/npm-test.txt)
> **W1-D(2026-09-22)**:验收框此前未勾但 checklist 与报告已全绿 → 按证据补勾,不降级 status。
## 相关链接
- Checklist: [../checklists/2026-09-16-multi-intent-u6-web-cards.md](../checklists/2026-09-16-multi-intent-u6-web-cards.md)
@@ -44,10 +44,11 @@ mutex: workflow-design
- [x] 医疗三工作流目录与校验无回归(L1)
- [x] 软件两 key 可选且无医疗默认语义
- [x] 迁移 additive,旧项目不误分类(SQL 已写;活验 NOT RUN)
- [ ] 迁移 additive,旧项目不误分类(SQL 已写;**活验 NOT RUN** — W1-D 取消伪勾)
- [x] SWBOOT-10 仅 stub,拒绝真实执行
- [x] 测试报告落盘
> **W1-D(2026-09-22)**:保留 `done`(L1 代码交付);仅把「活验 NOT RUN」项诚实取消勾选。另记:`PiSoftwareBootstrapAdvisor.Advise` 无生产调用方(组合根未装配),不得当成已生效能力。
## 相关链接
- ADR: `.doc/adr/2026-09-16-software-project-bootstrap-keys.md`
@@ -2,11 +2,12 @@
title: "系统管理台(System Admin Console)一期"
status: done
created: 2026-09-17
updated: 2026-09-17
updated: 2026-09-23
owner: Kimi
branch: feature/system-admin-console
worktree: "-"
mutex: web + sysadmin
phase2: "细粒度 system:* + 设置审计日志经 modular-decouple-residual-2026-09-23 合入(goose 00065);KB 运维/白名单消费方仍 deferred"
---
# 系统管理台(System Admin Console)一期
@@ -29,10 +29,12 @@ mutex: intent
## 步骤
1. [ ] 开 `feature/chat-revise-bridge`,mutex `intent`。
2. [ ] 注册两个意图,绑定项目与可见文档。
3. [ ] 确认前断言业务表无新提案;确认后恰好一条提案。
4. [ ] 不可见文档不能被点名后泄漏标题。
1. [x] 开分支(实际为 `feature/stage-backtrack-impl`),mutex `intent`。
2. [x] 注册两个意图,绑定项目与可见文档。
3. [x] 确认前断言业务表无新提案;确认后恰好一条提案。
4. [x] 不可见文档不能被点名后泄漏标题。
> **W1-D**:验收已勾 → 只补勾步骤,不降级。
## 验收标准
@@ -31,10 +31,12 @@ mutex: workflow
## 步骤
1. [ ] B1 合入后开 `feature/recheck-soft-hold`。mutex 仍是 `workflow`,不得与 B1 同时 `in_progress`。
2. [ ] 标记的产生、知悉、人工关闭、驳回后重开。
3. [ ] 前端推进条二次确认。
4. [ ] 证明无标记时推进请求与现在一致。
1. [x] B1 合入后在 `feature/stage-backtrack-impl` 继续(mutex `workflow`)。
2. [x] 标记的产生、知悉、人工关闭、驳回后重开。
3. [x] 前端推进条二次确认。
4. [x] 证明无标记时推进请求与现在一致。
> **W1-D**:验收已勾 → 只补勾步骤,不降级。
## 验收标准
@@ -33,10 +33,12 @@ mutex: workflow
## 步骤
1. [ ] 开 `feature/stage-reopen-l2`,mutex `workflow`。确认 `workflow` 无其他 `in_progress`。
2. [ ] 申请表、批准事务、乐观锁。
3. [ ] docgov 解锁动作与审计。
4. [ ] 创建者与非创建者、空勾选、未完成阶段、越权申请的负例。
1. [x] 开分支(实际为 `feature/stage-backtrack-impl`,非原计划名 `feature/stage-reopen-l2`),mutex `workflow`。
2. [x] 申请表、批准事务、乐观锁。
3. [x] docgov 解锁动作与审计。
4. [x] 创建者与非创建者、空勾选、未完成阶段、越权申请的负例。
> **W1-D**:步骤漏勾 + 分支名不一致 → 只补勾并对齐 frontmatter 分支名,不降级。
## 验收标准
@@ -31,10 +31,12 @@ mutex: trace-index
## 步骤
1. [ ] T2 合入后开 `feature/trace-multihop-t3`。mutex `trace-index`,不得与 T2 同时 `in_progress`。
2. [ ] 反向遍历与环、深度、权限过滤测试。
3. [ ] 候选确认/否决 API 与决定账本。
4. [ ] 确认后的边进入下一次影响报告;否决的边不再贡献影响。
1. [x] T2 合入后在 `feature/stage-backtrack-impl` 继续(mutex `trace-index`)。
2. [x] 反向遍历与环、深度、权限过滤测试。
3. [x] 候选确认/否决 API 与决定账本。
4. [x] 确认后的边进入下一次影响报告;否决的边不再贡献影响。
> **W1-D**:验收已勾 → 只补勾步骤,不降级。
## 验收标准

Some files were not shown because too many files have changed in this diff Show More