Compare commits

..
Author SHA1 Message Date
weichen d73d2e8633 release-candidate: promote optional-duty null FK fix to test [Tag: rc-v1.0.0-beta.4] 2026-09-17 06:19:57 +00:00
weichen 7f0f8a1ca2 merge: feature/promote-null-fk-to-test 2026-09-17 06:19:57 +00:00
weichenandCursor fa8598e89b docs(ops): occupy slot to promote optional-duty null FK into test
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:19:57 +00:00
weichen e78b6c1470 merge: docs/docgov-optional-duty-null-fk-report 2026-09-17 06:12:56 +00:00
weichenandCursor c9fd8a4d7f docs(test): archive optional-duty null FK fix report and close task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:12:56 +00:00
weichen e488d10840 merge: fix/docgov-optional-duty-null-fk 2026-09-17 06:08:52 +00:00
weichenandCursor 4606119581 docs(ops): occupy integration slot for optional-duty null FK smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:52 +00:00
weichenandCursor 149dec8993 docs(ops): claim and audit docgov optional-duty null FK fix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichenandCursor fa2407f92c fix(stream): classify document ledger FK failures as DOC_LEDGER_ERROR
Avoid masking persist document ledger / 23503 errors as INTERNAL_ERROR.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichenandCursor c2efcdbacd fix(docgov): map zero duty ids to NULL on CreateOrGetDocument
Optional reviewer/approver duties leave UserID=0; writing 0 into
document_records FK columns failed with SQLSTATE 23503. Align create
path with docduty nullIfZero and surface ensureUser failures in logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichen 111f25c9a8 docs: sync test promotion closeout onto test 2026-09-17 05:05:26 +00:00
weichen feefc322a7 merge: feature/promote-dev-to-test-closeout
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 1s
CI / web (push) Failing after 0s
2026-09-17 05:05:26 +00:00
weichenandCursor 3978e6b461 docs(ops): record test promotion to rc-v1.0.0-beta.3
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 05:05:26 +00:00
weichen e5e09560c7 release-candidate: 汇集 dev 功能至 test 分支,准备长期实测 [Tag: rc-v1.0.0-beta.3] 2026-09-17 05:03:13 +00:00
weichen 4fce16c91b merge: feature/promote-dev-to-test-2026-09-17 2026-09-17 05:03:04 +00:00
weichenandCursor 151953a520 docs(ops): occupy slot to promote local dev into test
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 05:03:04 +00:00
weichen 46a0fb2d5a merge: feature/w7-d7-data-inventory 2026-09-17 04:58:52 +00:00
weichenandCursor dbc9b73278 docs(ops): record W7 D7 chat data inventory without deletion
Keep the D7 matrix row deferred until compliance signoff; no gap-matrix blocker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:58:52 +00:00
weichen cb4fbb69a6 merge: feature/w6-fav-subscriber-shadow 2026-09-17 04:26:18 +00:00
weichenandCursor 58c04ff6c5 docs(ops): close W6 FAV shadow and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:26:18 +00:00
weichenandCursor 9c0954ba6e docs(ops): record W6 FAV subscriber shadow evidence
Keep the FAV matrix row partial because live staging was not opened.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:25:17 +00:00
weichenandCursor 2c1d040ccf feat(events): add FAV subscriber shadow without live writes
ObserveShadow computes intended outcome only and refuses FAV_DEGRADED_READ; HandleLease and Register(fav) stay fail-closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:25:17 +00:00
weichen 49d901e964 merge: feature/w5a-software-bootstrap-ui-pi 2026-09-17 04:12:38 +00:00
weichenandCursor 7c1ae7ec38 docs(ops): close W5a and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:12:38 +00:00
weichenandCursor eee42d1d16 feat(workflow-design): catalog-driven software create wizard and docs_only PI
Software projects mount only bootstrap/delivery keys and skip the medical
seven-template clone. SWBOOT-10 stays a fail-closed stub.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:11:03 +00:00
weichen f5a80fd653 merge: feature/w4-u9-segment-live 2026-09-17 03:15:35 +00:00
weichenandCursor 1c1a4bb683 docs(ops): close W4 U9–U12 and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:15:35 +00:00
weichenandCursor 43555e5d08 feat(intent-plan): wire U9 PI segment proposer and per-flag U10–U12 evidence
Rules that already split skip the LLM. Independent flags stay off by
default and do not raise MULTI_INTENT_PLAN_TIER.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:14:57 +00:00
weichen 9ac1eb178e merge: feature/w3-pi-change-report-narrative-live 2026-09-17 03:03:20 +00:00
weichenandCursor 2ba6b3ec74 docs(ops): close W3 narrative live and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:03:20 +00:00
weichenandCursor 47a740a9c4 feat(docgov): wire no-tool PI change-report narrative
Flag-on CreateAgentCandidate asks the product PI runner for
change_report_narrative_v1 after the real digest is known; timeout
and malformed payloads stay full fallback. Default flag remains off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:02:11 +00:00
weichen 0bc98c6da4 merge: feature/w2-semantic-summary-shadow-live 2026-09-17 02:51:55 +00:00
weichenandCursor 886449958f feat(chat): wire no-tool PI semantic summary shadow
Enable SEMANTIC_SUMMARY_SHADOW to call the product PI runner on authorized messages only, keep REPLACE unwired, and record MiniMax evidence for the D3 matrix close.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:51:55 +00:00
weichen 982dc48345 merge: chore/leftover-hygiene-2026-09-17 2026-09-17 02:43:44 +00:00
weichenandCursor 4b509efefc docs(ops): align leftover branches and contracts with local dev
Prune merged worktrees/refs and correct SWBOOT/PU scaffolding docs so W2–W7 start from git truth, without merging frozen FAV/herdr/project143 branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:43:44 +00:00
weichen 80ef2f61a0 merge: docs/archive-kb-host-auth-short-term 2026-09-17 02:06:19 +00:00
weichenandCursor f2c2e34f0b docs(ops): archive completed kb-host-auth short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:06:19 +00:00
weichen 392b3bc1c9 merge: docs close kb-host-auth 2026-09-17 02:06:09 +00:00
weichenandCursor 6f52896dad docs(ops): close kb-host-auth task and release integration slot
Record rebuild smoke: kb_ready=true and redacted online DSN in container.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:06:09 +00:00
weichen 5182da20ed merge: fix/kb-host-auth-layered-load (no Fatalf) 2026-09-17 02:04:51 +00:00
weichenandCursor 6fa933ac27 fix(kb): return offline client instead of Fatalf under require-online
Library must not abort the process; E2E callers use EnsureOnline/t.Fatal
so ambient RUN_PI_E2E no longer kills short server tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:04:51 +00:00
weichen cdd3f8c559 merge: fix/kb-host-auth-layered-load 2026-09-17 02:03:21 +00:00
weichenandCursor abbb461780 docs(ops): claim integration slot for kb-host-auth merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:21 +00:00
weichenandCursor c977e8247a docs(test): record KB host-auth layered load fix and acceptance
Short-term task, CURRENT claim, and unit/live boolean test report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor e782400736 fix(api): expose kb_ready and gate E2E/nightly on shared KB
Health reports kb_ready; PI E2E uses layered Load + require-online;
nightly preflights SELECT 1 before product suite.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor f3ed57c41f fix(kb): redact DSN logs and fail closed when KB must be online
Add Online(), honor KB_REQUIRE_ONLINE/RUN_PI_E2E unless KB_ALLOW_OFFLINE,
and refuse empty/wrong credentials without leaking secrets in logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor cdbf9cab63 fix(config): layer root .env over configs/.env.{ENV} for KB auth
Stop using a fake default KB password; merge Compose-style env files and
rewrite compose DNS to localhost on the host so go test/E2E authenticate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichen e694408851 merge: docs/w1-release-integration-slot 2026-09-17 01:48:19 +00:00
weichenandCursor cacbf755b6 docs(ops): release integration slot after W1 merge smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:48:19 +00:00
weichen 1d075aa4c3 merge: fix/w1-archtest-app-fav-allowlist 2026-09-17 01:47:52 +00:00
weichenandCursor 86a4c9af63 fix(arch): allowlist app/fav imports for archtest baseline
FAV U7 stub package was missing from module-boundaries imports map,
breaking go test -short smoke after W1 merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:47:52 +00:00
weichen 4d6b95dea4 merge: feature/w1-ci-e2e-green-nightly 2026-09-17 01:44:02 +00:00
weichenandCursor 8d3fd089f2 docs(ops): mark W1 step complete on partial-deferred controller
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:44:02 +00:00
weichenandCursor 6981223087 docs(test): close W1 CI/E2E with FullNone nightly pass receipt
Archive green receipt 6e2476f0, raise FEATURE-MATRIX CI/E2E to done,
and mark short-term/CURRENT W1 complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:43:54 +00:00
weichenandCursor 6e2476f0f2 fix(ci): retry nightly suite on MISSING_TARGET flakes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:12:37 +00:00
weichenandCursor 11e030db30 fix(squad): stop requiring fields.json as hard PI runner target
Organizer still prompts for fields.json, but missing it must not fail
closed as MISSING_TARGET when output.md is present (FullNone flake).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:55:11 +00:00
weichenandCursor 0f52ab89db fix(ci): load real KB password for host-side PI E2E
configs/.env.dev omits KB_DB_PASSWORD so Load kept the default
shared_kb_secret_pass; fall back to root .env so research can use KB.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:52:01 +00:00
weichenandCursor a02c67db82 fix(ci): stabilize FullNone PI E2E timeouts and host KB DNS
Raise HTTP client timeout above AgentTimeout, rewrite compose KB host
to localhost for host-side tests, and retry nightly on deadline flakes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:28:38 +00:00
weichenandCursor 4f2e5f013f fix(db): remove duplicate goose 00048 software-project-type migration
Two 00048 files made goose panic on CollectMigrations, blocking all
TEST_DATABASE_URL PG suites including FullNone and nightly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 23:37:04 +00:00
weichen 4bda6484a2 merge: docs/partial-deferred-completion-plan 2026-09-16 23:34:16 +00:00
weichenandCursor 251b5f9c3d docs(ops): claim integration slot for docs closeout merge and W1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 23:34:16 +00:00
weichenandCursor c649067d19 docs(remediation): freeze §7 open decisions for partial/deferred closeout
Confirm D7 retention draft ADR, confirm-tier gate, REPLACE default-off,
and FAV live order with observation windows; sync CURRENT and short-term.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 16:13:17 +00:00
weichen bb8d921e7c docs(remediation): add partial/deferred completion plan (W1-W7) and short-term controller 2026-09-16 16:03:50 +00:00
weichenandCursor 83f9004f9e docs(ops): close SWBOOT short-term after remote push
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:49:21 +00:00
weichenandCursor 92e0ae7ec4 merge: origin/feature/intent-plan-cards-playwright
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:49:21 +00:00
weichenandCursor 49db87ebe5 docs(ops): release integration slot after agent-delta merge
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:48:24 +00:00
weichenandCursor 51c8ec1e8a docs(ops): mark P0–P7 agent-delta merge complete on SSOT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:48:07 +00:00
weichenandCursor 768729d85e fix(swboot): drop thin allowlist stub after agent SWBOOT merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:57 +00:00
weichenandCursor f0029dffed merge: origin/feature/software-project-bootstrap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:45 +00:00
weichenandCursor 00cc5b6645 merge: origin/feature/fav-u7-publisher
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:29 +00:00
weichenandCursor 131380e858 merge: origin/feature/pu8-u9-u12-flags
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:23 +00:00
weichenandCursor b92e226497 fix(docgov): drop thin pi_narrative stub after agent PU7 merge
Use ResolveChangeReport from feature/pu7-pi-narrative.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:16 +00:00
weichenandCursor a380c218bb merge: origin/feature/pu7-pi-narrative
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:06 +00:00
weichenandCursor f3351ce750 fix(chat): drop thin semantic_shadow stub after agent PU6 merge
Keep applySemanticShadow path from feature/pu6-semantic-summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:01 +00:00
weichenandCursor f55887e2a2 docs(test): archive intent-plan Playwright dual-tab report
Record RUN_UI_ACCEPTANCE live PASS evidence and close the dual-tab short-term.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor b74b9ab1d0 test(web): add intent-plan dual-tab Playwright acceptance
Gate on RUN_UI_ACCEPTANCE=1; seed awaiting PG plan via SQL without raising
MULTI_INTENT_PLAN_TIER; assert one confirm wins and reload/relogin match PG.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor cc8557b8c6 feat(web): hydrate PLAN_CONFIRM from active intent plan
Load GET /intent-plans/active into a live card on session restore, use a
unique decision nonce per confirm click, and keep an empty-docAST fallback
so login still renders when demo seeds are off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor 003bc7a5b9 merge: origin/feature/pu6-semantic-summary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:45 +00:00
weichenandCursor b5ce947e77 docs(ops): mark SWBOOT-00..09 feature slice done after push
Record remote branch tip and release workflow-design mutex; still not
merged to dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:34 +00:00
weichenandCursor 01a783b8d5 test(swboot): SWBOOT-09 L1 suite and acceptance report
Update catalog size expectations to five workflows and archive the
unit-test report; sync FEATURE-MATRIX and task docs without merging to
dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:08 +00:00
weichenandCursor 6aea8784c2 docs(test): record nightly run#30 U8 PASS after DATA_DIR rw fix
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 1s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:44:56 +00:00
weichenandCursor f6034fad37 feat(api): SWBOOT-05..08 wizard hooks and SWBOOT-10 allowlist stub
Add project-types/compliance catalogs, creation-preview, software create
fields, and fail-closed repo allowlist stub without real patch/merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:43:13 +00:00
weichenandCursor 6087d0bdef docs(test): archive PU8 U9–U12 flags scaffolding report
Record default-off flag gates, unit evidence, and FEATURE-MATRIX partial status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:42:49 +00:00
weichenandCursor 0611b1f24f feat(intentflow): wire U9–U12 ports and gated OwnerMux
Register dry-run adapters via BuildOwnerMux when independent flags are on;
U9 stub fail-closes on malformed/timeout/out-of-bounds without raising PlanTier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:42:49 +00:00
weichenandCursor d860c6430e docs(ops): close full-backlog override checklist P1–P7
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:41:30 +00:00
weichenandCursor b015f8723f fix(docgov): keep invalid ReportJSON path when narrative flag off
Preserve prior ValidateChangeReportJSON error semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:41:30 +00:00
weichenandCursor 2b3302ece4 feat(workflow-design): SWBOOT ADR, project_type migration, patch deny stub
SWBOOT-10 remains stub-only pending secondary approval.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:56 +00:00
weichen f1d8f49df7 merge: feature/fav-u7-publisher-impl 2026-09-16 15:40:56 +00:00
weichen 0409e399d8 merge: feature/intent-plan-cards-playwright-impl 2026-09-16 15:40:56 +00:00
weichen 975af54fd6 merge: feature/pu8-u9-u12-flags-impl 2026-09-16 15:40:56 +00:00
weichen 5596ead7fd merge: feature/pu7-pi-narrative-impl 2026-09-16 15:40:55 +00:00
weichen 7583f109a1 merge: feature/pu6-semantic-summary-impl 2026-09-16 15:40:55 +00:00
weichenandCursor 6356fb5a8c docs(ops): mark FAV U7 incremental push complete
Feature branch pushed; still not merged to dev; fav subscriber remains OFF.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:38 +00:00
weichenandCursor 1cd1cddf64 feat(intent-plan): independent PU8 U9–U12 flags default off
Dry-run/fail-closed adapters; does not raise plan tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor 47376aeb84 feat(events): FAV publisher cmd stub gated off by default
Incremental U7; degraded read still approval-gated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor d45a1eef75 test(web): intent-plan dual-tab Playwright acceptance gate
RUN_UI_ACCEPTANCE=1 required; no tier upgrade.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor e7e981356c feat(docgov): PI_CHANGE_REPORT_NARRATIVE gate with full fallback
Default off; malformed or risk downgrade forces deterministic report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:25 +00:00
weichenandCursor 8fdf50ab2a feat(chat): SEMANTIC_SUMMARY_SHADOW optional deterministic annotate
Default off; unauthorized views skipped; facts preserved.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:25 +00:00
weichenandCursor de65cee96c docs(test): record FAV U7 incremental go/no-go evidence
Subscriber remains OFF until separate approval; document remaining FAV
port inventory and claim feature/fav-u7-publisher.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 5392238354 chore(compose): pin FAV_DEGRADED_READ and publisher off
Document false defaults in all envs; main hardcodes both flags to false.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 47a173e7bb feat(events): add fav subscriber and artifact-vault CLI stubs
Keep durable fav unregistered and fail-closed; CLI only prints status and
remaining-port inventory without destructive backfill/recover commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 92d7a3d117 feat(api): add FAV vault status stub with gated publisher
Expose GET /api/v1/vault/status and only wire in-process Drain when
FAV_PUBLISHER_ENABLED is explicitly true; degraded read stays off by default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 3478a5a05a feat(config): add FAV vault flags defaulting off
Gate FAV_DEGRADED_READ and FAV_PUBLISHER_ENABLED behind explicit opt-in,
and refuse VAULT_STATE_ROOT colliding with runtime data/{env}.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 56f6a66f2e docs(test): archive PU7 PI narrative acceptance report
Record flag-off and full-fallback evidence; sync CURRENT, matrix, and contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 51568ea080 feat(web): distinguish change-report narrative vs factual fields
Panel and view-model label server risk/lineage separately from PI narrative;
add change_report_narrative_v1 helper aligned with typed-result patterns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 18f2729472 feat(docrevision): add PI change-report narrative with flag-gated fallback
Introduce PI_CHANGE_REPORT_NARRATIVE (default off). When on, consume typed
narrative bound to input digest only; malformed/timeout paths fully fall back
without mixing fields or lowering server risk.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 909384c335 feat(workflow): SWBOOT-02..04 software manifests and catalog allowlist
Add software_bootstrap/delivery v2 manifests, expand selectable keys to
five, keep medical doc-count gates, and filter catalog by product_domain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:01 +00:00
weichenandCursor 5493bf6108 docs(test): archive PU6 shadow report and mark matrix partial
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor d86528b45b test(chat): characterize semantic summary shadow and auth negatives
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor b7b880a316 feat(chatflow): authorize rolling summary and surface digest freshness
GenerateRollingSummary filters to authorized-visible messages; digest API
exposes shadow/freshness without enabling REPLACE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor 209c997b22 feat(ctxmgr): add SEMANTIC_SUMMARY_SHADOW with deterministic fallback
Shadow evaluates a no-tool summarizer on caller-supplied messages; served
narrative stays deterministic and REPLACE remains unwired.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor 884e5dbf44 docs(ops): claim PU6 semantic summary shadow on chat mutex
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor d661af71d5 feat(db): SWBOOT-01 additive project type and compliance schema
Add project domain/governance fields, catalog tables, source bindings,
and repo allowlist stub table without backfilling legacy classification.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:36:13 +00:00
weichenandCursor a30931349a docs(adr): SWBOOT-00 software_bootstrap/delivery keys and domain boundary
Freeze selectable workflow keys, domain/compliance separation, solo policy,
and SWBOOT-10 fail-closed stub contract without touching medical three.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:36:08 +00:00
weichen 776b2b5cae merge: fix/nightly-datadir-rw
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-16 15:34:50 +00:00
weichenandCursor 81f6378233 fix(ci): treat DATA_DIR read-only mkdir as infra_fail
Host agent-data mount must be writable for nightly workspace create.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:34:49 +00:00
weichen ebe177eec8 merge: feature/iam-route-inventory-p2
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-16 15:34:19 +00:00
weichenandCursor 025ffe0ab3 feat(authz): full route inventory, session interrupt test, 410/R13 freeze
Close FEATURE-MATRIX IAM partial with v3 inventory and policy docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:33:18 +00:00
weichen 89ce3cc143 merge: fix/nightly-datadir-dev-align
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-16 15:30:39 +00:00
weichenandCursor a27f2cc7fb fix(ci): align nightly DATA_DIR with dev PI on :18865
Host-agent-data/test mismatched shuimu-pi-agent-dev workspace mounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:30:38 +00:00
weichen 247ddcd306 merge: docs/override-nogo-full-backlog
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-16 15:30:01 +00:00
weichenandCursor 05ae1b3ffd docs(ops): override Wave3 no-go; authorize full backlog P0–P7
User scope-3 authorization; capabilities remain flag-off by default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:30:01 +00:00
weichen 90ad756ce2 merge: docs/gitea-nightly-run21-status
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-16 15:18:49 +00:00
weichenandCursor 950ce66ed8 docs(ops): record Gitea nightly run#21 product_fail after infra green
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:18:49 +00:00
weichen a47cb84313 merge: fix/gitea-nightly-docker-datadir
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-16 15:17:16 +00:00
weichenandCursor 91d21ea632 docs(ops): mark nightly docker-datadir task done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:17:16 +00:00
weichenandCursor 7df43f419e fix(ci): mount DATA_DIR and docker for Gitea nightly host jobs
Avoid all-SKIP false PASS and exit-127 without receipt when image build lacks docker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:17:16 +00:00
weichen 212f0974d8 merge: fix/gitea-nightly-host-tools
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 1s
CI / web (push) Failing after 0s
2026-09-16 15:12:22 +00:00
weichenandCursor db85c7cab9 docs(ops): mark gitea nightly host-tools task done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:12:21 +00:00
weichenandCursor b2bcea3cd8 ci(nightly): archive receipts without upload-artifact@v4
Gitea act_runner rejects artifact v4; host runner now has curl/node via brew+host net.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:12:03 +00:00
weichen d48b36046d merge: docs/gitea-nightly-runner-label-note
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-16 15:02:39 +00:00
weichenandCursor d07244c980 docs(ops): note Gitea runner .runner label patch for nightly:host
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:02:39 +00:00
weichen fb73d404f4 merge: chore/nightly-gitea-host-runner
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-16 14:59:38 +00:00
weichenandCursor 74d87b9e5d ci(nightly): use local Gitea host runner label for real PI
Point Nightly Real PI at runs-on: nightly (host network) so the local
act_runner can reach host PI :18865 and isolated PG :5434.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:59:38 +00:00
weichen f1f24dca5b merge: docs/phase3-remediation-dod 2026-09-16 14:47:49 +00:00
weichenandCursor 29da12d036 docs(remediation): check remaining Wave DoD after Phase 3 closeout
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:47:49 +00:00
weichen e843c3c7dc merge: fix/wave-leftovers-n7-playwright-dod 2026-09-16 14:47:44 +00:00
weichenandCursor f54abcab82 fix(ci): Phase 3 leftovers — nightly quality_failed retry and gated docs
Retry U8 product quality flakes once in nightly; formalize Playwright
dual-tab as long-term gated; closeout handoff and DoD notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:47:32 +00:00
weichen 84363b9180 merge: feature/wave3-pu6-pu8-go-no-go 2026-09-16 14:46:05 +00:00
weichenandCursor d1a019b9d7 docs(ops): archive Wave 3 go/no-go short-term
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:46:05 +00:00
weichenandCursor 6264965267 docs(ops): Wave 3 PU6–PU8 go/no-go — all deferred with contracts
Record no-go decisions and independent long-term task contracts; do not
implement or raise MULTI_INTENT tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:46:05 +00:00
weichen 5d7ac1a8f9 merge: feature/wave2c-same-image-digest
Wave 2C: same-image digest pin for test/main promotion.
2026-09-16 14:44:45 +00:00
weichenandCursor f0acbb10ad docs(ops): archive Wave 2C short-term and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:44:45 +00:00
weichenandCursor da15eb91b6 feat(infra): Wave 2C same-image digest pin for test/main promote
Build/apply candidate images once, require digests on promote, and keep
pinned env-service from rebuilding divergent images.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:44:26 +00:00
weichen 7c808bdcfc merge: docs/wave2b-n7-receipt 2026-09-16 14:34:19 +00:00
weichenandCursor dcab3aec83 docs(test): archive Wave 2B N7 product_fail promotion receipt
Record classified nightly outcome for 67d7335 with image digests and
gate rejection evidence; does not claim product suite green.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:34:19 +00:00
weichen 49ca6cd6dc merge: docs/wave2b-slot-release 2026-09-16 14:32:10 +00:00
weichenandCursor 4187bcfc9e docs(ops): release Wave 2B integration slot and archive short-term
Smoke passed on merge; record N7 product-fail classification evidence
from the in-flight nightly suite without claiming same-image promotion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:32:10 +00:00
weichen 2498bd2a13 merge: feature/wave2b-nightly-promotion-receipt
Wave 2B PU5B: nightly real-PI entry, promotion receipts, promote/release gates.
2026-09-16 14:05:59 +00:00
weichenandCursor c75842f945 docs(ops): mark Wave 2B short-term done ahead of merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:05:59 +00:00
weichenandCursor 67d73359fd docs(test): Wave 2B nightly promotion-receipt report and matrix sync
Record gate fixtures and infra negative evidence; mark Artifact row
partial for same-commit/digest traceability without same-image claim.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichenandCursor fda159c995 feat(ci): nightly real-PI workflow and promote/release receipt gates
Add schedule/dispatch nightly entry that classifies infra vs product
failures, and require a valid receipt (or waiver) before promote/release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichenandCursor a84778f21b feat(ci): add immutable promotion receipt write/check with waiver
Nightly and promote gates need auditable pass/product_fail/infra_fail
receipts under test-reports assets, plus timed owner waivers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichen 8278022237 merge: docs/wave2-slot-release 2026-09-16 10:57:11 +00:00
weichenandCursor 879f6fadef docs(ops): release integration slot after Wave 2 merge
Smoke: go vet, go test -short (clean env), env-service rebuild, health/ready ok.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:57:11 +00:00
weichen c360a928de merge: feature/wave2-real-pi-evidence 2026-09-16 10:55:54 +00:00
weichenandCursor 7461138412 docs(ops): claim integration slot for Wave 2 merge
Also mark PU4 DoD complete after U8/full-none real-PI evidence archive.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:55:51 +00:00
weichenandCursor 422f98012e docs(ops): mark Wave 2 short-term done in archive
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:43 +00:00
weichenandCursor 574758a71f docs(test): archive Wave 2 U8 and full/none real-PI evidence
Close FEATURE-MATRIX evidence gaps for multi-intent U8 and workflow
full/none; release the integration slot after live PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichenandCursor f1e87fb2e7 test(server): add Wave 2 real-PI evidence for U8 and full/none
Replace the U8 stop-gate with a PG+PI confirm/generate harness and add a
mixed-duty governance long chain covering cross-user approve and none
non-blocking advance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichenandCursor aac42936bc fix(intentflow): keep plan step receipts durable under PG events
Normalize empty TEXT[] binds, isolate step-changed aggregates from plan
revision uniqueness, propagate AdvanceEligible errors, and emit
taskrun.completed to the registered notify consumer so finalize no longer
rolls back live receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichen ad42f83e5b merge: docs/wave1-pu3-slot-release 2026-09-16 09:42:34 +00:00
weichenandCursor 3a3b31996a docs(ops): release integration slot after PU3 merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:34 +00:00
weichen c5d10aebcc merge: fix/iam-store-fail-closed
Wave 1 PU3: IAM NewStores fail-closed unless explicit dev/test opt-in.
2026-09-16 09:42:27 +00:00
weichenandCursor a5bc317492 docs(ops): mark PU3 done and claim merge slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:27 +00:00
weichenandCursor 299530bf42 docs(test): archive Wave 1 PU3 IAM fail-closed evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichenandCursor 7fdbee6c0c test(server): adapt fixtures to IAM dual-gate fail-closed
Boot memory IAM only via explicit test env opt-in; strict auth cases
disable AllowInMemory after startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichenandCursor 514db3a086 feat(auth): fail-closed IAM store unless dev/test opt-in
Refuse MemoryStore fallback for main/empty/unknown env or missing
ALLOW_IN_MEMORY so production cannot silently use in-memory authority.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichen 16d1ba1d54 merge: docs/wave1-pu5a-slot-release 2026-09-16 09:34:05 +00:00
weichen 0353841a4a merge: fix/race-tempdir-cleanup
Wave 1 PU5A: drain taskrun workers before TempDir cleanup under -race.
2026-09-16 09:34:05 +00:00
weichenandCursor 24e716e661 docs(ops): release integration slot after PU5A merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:34:05 +00:00
weichenandCursor 3400f0a7ac docs(ops): mark PU5A done and claim merge slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:34:05 +00:00
weichenandCursor a453b290a7 docs(test): archive PU5A TempDir race cleanup evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichenandCursor 73ae4b8f5b fix(server): drain taskrun workers before TempDir cleanup
Register newTestServer cleanup and Shutdown WaitIdle so race detector
no longer hits RemoveAll on a live DataDir.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichenandCursor ea2b9f121e feat(taskrun): add WaitRunDone and WaitIdle for async workers
Allow tests and shutdown to drain in-memory workers before TempDir cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichen 9d929f0175 merge: docs/wave0-matrix-merge-closeout 2026-09-16 08:33:27 +00:00
weichenandCursor 99504b628e docs(ops): release integration slot after Wave 0 matrix merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:33:27 +00:00
weichen a88a7e3b0a merge: feature/feature-matrix-production-readiness-plan
Wave 0 FEATURE-MATRIX calibration and IAM readonly verification docs.
2026-09-16 08:32:43 +00:00
weichenandCursor 8afd37da65 docs(ops): claim integration slot for Wave 0 FEATURE-MATRIX merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:43 +00:00
weichenandCursor 2fe58ca9d7 docs(remediation): mark Wave 0 DoD items complete
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:29 +00:00
weichenandCursor c4a7479572 docs(status): Wave 0 calibrate FEATURE-MATRIX and verify IAM deploy facts
Align capability maturity with frozen boundaries, record IAM readonly PASS
without flipping production_ready, and leave Wave 1+ for fail-closed code.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:29 +00:00
weichen b67816a898 merge: sync detailed matrix deep-test report onto test 2026-09-16 05:37:16 +00:00
weichen 1ff55033f4 merge: docs/matrix-deep-test-detailed-report 2026-09-16 05:37:16 +00:00
weichenandCursor 68455faa94 docs(test): expand matrix deep-test report with I/O analysis verdicts
Rewrite the promote report so each Wave case records input, system
output, analysis, and evaluation against FEATURE-MATRIX evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:37:16 +00:00
weichen 56eb0ed4fe merge: sync matrix deep-test closeout docs onto test 2026-09-16 05:25:31 +00:00
weichen 794b1f43b7 merge: docs/matrix-deep-test-closeout 2026-09-16 05:25:31 +00:00
weichenandCursor 9363121071 docs(test): archive matrix deep-test promote report and release slot
Record Wave 1–4 evidence, fix FEATURE-MATRIX schema-47 note, harden
promote-to-test against origin rebase, and mark infra task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:25:31 +00:00
weichen 8c9a12d996 release-candidate: 汇集 dev 功能至 test 分支,准备长期实测 [Tag: rc-v1.0.0-beta.2] 2026-09-16 05:19:59 +00:00
weichen 50f800a409 merge: feature/matrix-deep-test-promote-test
Matrix deep-test evidence and CURRENT slot claim prior to test promote.
2026-09-16 05:18:52 +00:00
weichenandCursor 0743fb90ec docs(ops): advance integration slot to merging for test promote
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:18:52 +00:00
weichenandCursor 895d5f002a test(ops): capture matrix deep-test Wave 1–3 evidence artifacts
Automated short/module/governance-PG outputs plus live :8080 smoke and
PI typed-result sample for promote gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:18:52 +00:00
weichenandCursor 4f997a9438 docs(ops): register matrix deep-test claim on CURRENT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:14:00 +00:00
weichenandCursor ef84d1d8f7 docs(ops): claim infra slot for matrix deep test and test promote
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:13:38 +00:00
weichen 4298701b2a merge: docs/archive-production-ready-gates 2026-09-16 04:16:03 +00:00
weichenandCursor 28d1512e6e docs(ops): archive completed production-ready gates short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:16:03 +00:00
weichen 4d048cc4a3 merge: docs/production-ready-flip
Flip SSOT production_ready=yes after release gates and main schema align.
2026-09-16 04:15:55 +00:00
weichenandCursor 1027026e7a docs(ops): flip production_ready=yes after B1–B4 gates and schema 47
Align FEATURE-MATRIX, gap-matrix, and CURRENT; main rebuilt to schema 47
with dev/test. Release blockers closed; backlog items remain partial/planned.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:15:55 +00:00
weichen 8dae227f8c merge: feature/pi-three-workflow-e2e
Release gates B2–B4 evidence, PI E2E harness fixes, and settings conflict recovery.
2026-09-16 04:14:07 +00:00
weichenandCursor 05a84e6677 fix(web): include nested error field in VERSION_CONFLICT unwrap typing
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:13:35 +00:00
weichenandCursor 23a5f6f589 docs(ops): claim integration slot for production-ready gate merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:12:09 +00:00
weichenandCursor 1f35593dcd docs(test): archive B2–B4 release-gate evidence and check gap boxes
PI three-workflow E2E, chat refresh+restart, and frontend conflict/
termination-preview reports; mark corresponding gap-matrix gates done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 736857a292 fix(web): unwrap nested VERSION_CONFLICT business codes for settings recovery
HTTP envelope wraps PLAN_FROZEN/ERR_CONCURRENT_SWITCH; reload settings on
conflict so operators refresh instead of blind retry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 64ac437a90 fix(test): upsert project members before SavePlan in chat-refresh live
Duty assignees must be active members or activation path returns 400.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 3b80582123 fix(pi-agent): stabilize real PI three-workflow E2E harness
Use shared DATA_DIR permissions (umask/chmod) and drop obsolete sync
notify asserts so governance PG PI chains can complete on MiniMax runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichen 3b56816f4e merge: fix/ci-governance-pg-members 2026-09-16 03:20:32 +00:00
weichenandCursor 56c85bba11 fix(ci): green governance PG on isolated TEST_DATABASE_URL
Add duty holders as project members, drop sync notification assert
after outbox cutover, and add an explicit CI governance PG step.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:20:32 +00:00
weichen eaffe3eb31 merge: docs/demo-seed-merge-closeout 2026-09-16 03:17:37 +00:00
weichenandCursor c8052c8882 docs(ops): close DEMO-DB-SEED after schema 47 migrate and smoke
Record npm/go gates, empty project 6357 docs=0, and release the
integration slot; gap-matrix DEMO-DB-SEED → PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:17:37 +00:00
weichen 511012cede merge: fix/demo-chat-sessions-retire-00047 2026-09-16 03:14:59 +00:00
weichenandCursor c741d26eeb fix(db): add goose 00047 to retire demo project chat sessions
Dev already applied 00046 (projects only) before session retirement
was folded into that file; 00047 closes the gap idempotently.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:14:59 +00:00
weichen 0917f39f80 merge: fix/demo-data-pollution-web
Gate demo seeds, retire goose demo projects/sessions, reject stub in
main/prod, and respect SEED_DEMO_USERS=false.
2026-09-16 03:13:51 +00:00
weichenandCursor 765a418df1 docs(ops): claim integration slot for demo-data-pollution merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:13:51 +00:00
weichenandCursor 66c56324ad docs(ops): backlink 2026-09-15 audit and record review P0/P1 evidence
Cherry-picked SEED_DEMO_USERS separately; document npm test gate,
session retire in 00046, and P2 follow-ups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:13:25 +00:00
weichen 53bb71adae fix(auth): respect SEED_DEMO_USERS=false to prevent re-seeding demo users 2026-09-16 03:12:31 +00:00
weichenandCursor fbda195b7f fix(db): retire demo chat sessions with projects in 00046
Extend unapplied migration to mark 6001–6010 sessions demo_retired
and filter them (and retired projects) out of ListChatSessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:12:25 +00:00
weichenandCursor a44df9280c fix(web): rewrite demoSeedIds tests for node:test npm gate
Vitest-style suite was caught by tsx --test and broke npm test.
Align with storage.test.ts and narrow vitest include to chat suites.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:11:36 +00:00
weichenandCursor 1e19f5c52f docs(test): archive demo seed pollution remediation evidence
Record systemic audit, wave plan status, gap-matrix blockers, and unit/
bundle scan results for the demo-data pollution fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor 8a8197a4f2 fix(taskrun): reject stub backend in main/prod
Require ResolveBackendInEnv to deny stub (and empty stub fallback) when
env is main/prod so production cannot request simulated agent output.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor bdc6415944 fix(db): retire goose-seeded demo projects from lists
Mark projects 6001–6010 as demo_retired and exclude them from default
project list queries so demo seeds no longer pollute real workspaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor 855363fd60 fix(web): gate demo seeds and reclaim mock deliverables
Stop shipping hard-coded demo docs/projects into production builds,
drop local mock items on authoritative empty server lists, and purge
stale demo seed residue from localStorage on boot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichen 2005a4ca0c merge: chore/release-multi-intent-u8-slot 2026-09-16 02:26:03 +00:00
weichenandCursor 8b228e2101 chore(ops): release the U8 integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:26:03 +00:00
weichen 50cf271b53 merge: feature/multi-intent-u8-task-generate 2026-09-16 02:24:39 +00:00
weichenandCursor bf55278740 docs(test): record U8 task generate adapter report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:24:23 +00:00
weichenandCursor 2e99ee3661 feat(intentflow): route confirmed generate steps through a task adapter
Persist ComboNeedsConfirm plans at confirm tier without executing writes, then run task.run via OwnerMux and a stable idempotency key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:24:23 +00:00
weichen aec374c5dc merge: chore/release-multi-intent-u7-slot 2026-09-16 01:42:42 +00:00
weichenandCursor ad3d10b72d chore(ops): release the U7 integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:42:42 +00:00
weichen 276ceb42b3 merge: feature/multi-intent-u7-auto-read 2026-09-16 01:40:07 +00:00
weichenandCursor fb19b63baf docs(test): record U7 auto_read query execution report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:40:07 +00:00
weichenandCursor 702cf6f949 feat(intentflow): execute auto_read query plans from HandleTurn
Default legacy stays a no-op; QueryGuard refuses generate keys until U8.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:40:07 +00:00
weichen 5c4caa375e merge: chore/release-multi-intent-u6-slot 2026-09-16 01:11:28 +00:00
weichenandCursor c7677b09f6 chore(ops): release the U6 integration slot
Restore the U5 SSOT rows dropped during the U6 docs commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:11:28 +00:00
weichen b94873ab18 merge: feature/multi-intent-u6-web-cards 2026-09-16 01:09:05 +00:00
weichenandCursor ba713c266b docs(test): record U6 plan card web report
Keep Playwright dual-tab behind RUN_UI_ACCEPTANCE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:09:05 +00:00
weichenandCursor 29bb63f766 feat(web): render PLAN_CONFIRM from PlanView without local AST writes
Plan actions post to the decision API and reconcile on 409 instead of mutating documents.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:09:05 +00:00
weichen 4044b68c9e merge: chore/release-multi-intent-u5-slot 2026-09-16 01:02:19 +00:00
weichenandCursor 0dd7a412c2 chore(ops): release the U5 integration slot
Drop accidental pycache from the docs commit and ignore Python bytecode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:02:19 +00:00
weichen 741089eca3 merge: feature/multi-intent-u5-decision-api 2026-09-16 01:01:39 +00:00
weichenandCursor e16fb7eff2 docs(test): record U5 decision API and authorization report
Close the U5 checklist with HTTP scope negatives and same-nonce receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichenandCursor 3d444fa5e4 feat(api): mount authenticated intent plan decision routes
Principal comes from the session and query scope; body identifiers are ignored and admins cannot skip membership.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichenandCursor 08aa56b16c feat(intentflow): re-authorize steps before confirm and execute
Confirmation stays a command receipt; FakeActionOwner now fail-closes on revoke and resource version drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichen f35d265721 merge: chore/release-multi-intent-u4-slot 2026-09-16 00:52:59 +00:00
weichenandCursor 131c86a919 chore(ops): release the U4 integration slot
U4 smoke (go vet + go test -short) passed; no shared-env rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:52:59 +00:00
weichen 839368198a merge: feature/multi-intent-u4-outbox-projection 2026-09-16 00:50:32 +00:00
weichenandCursor 46ee9fe647 chore(ops): occupy the U4 integration slot
Remove accidental promote-dev and pycache files from the U4 docs commit and hold the merge slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:50:26 +00:00
weichenandCursor 2755d916f4 docs(test): record U4 outbox projection report
Close the U4 checklist with golden payload and only-forward projection evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor c36d891b05 feat(intentflow): emit plan facts onto Track E outbox
Append awaiting/step/completed envelopes in the command UoW and project them without changing dispatcher leases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor cf063f5727 feat(db): add intent plan projection shadow tables
Store idempotent event outcomes and an only-forward shadow without replacing plan SSOT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor 1afd39c9e8 docs(ops): claim U4 intent plan outbox projection
Register the events mutex before appending intent.plan facts onto Track E.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:40:57 +00:00
weichen 0f656638eb merge: chore/release-multi-intent-u3-slot 2026-09-15 23:47:19 +00:00
weichenandCursor 223b2841d7 chore(ops): release the U3 integration slot
Smoke already passed on the feature branch; shared env stays on schema 43 until a planned rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:47:19 +00:00
weichen 26f1632a21 merge: feature/multi-intent-u3-intentflow-pg 2026-09-15 23:46:55 +00:00
weichenandCursor 4cfe6ff59d chore(ops): occupy the U3 integration slot
Hold the shared merge slot for the no-ff merge of the intentflow PG owner.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:46:55 +00:00
weichenandCursor b6956003d5 docs(test): record U3 intentflow PG CAS lease report
Close the U3 checklist with CAS/lease/fencing evidence while leaving chat routing on legacy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:46:34 +00:00
weichenandCursor 1385002350 feat(app): assemble intentflow plan owner
Wire the composition root without letting chat or coordinator call CreatePlan yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:46 +00:00
weichenandCursor da0b3d812b feat(intentflow): persist plans with CAS lease and fencing
Own plan/step/decision writes behind UoW so two workers cannot both execute the same step.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:46 +00:00
weichenandCursor 7dfd6d6f33 feat(db): add intent plan tables in goose 00044
Persist plans, steps, and append-only decisions with typed CAS, lease, and nonce columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:37 +00:00
weichenandCursor a75aa45129 docs(ops): claim U3 intentflow PG CAS lease
Register the intent-plan mutex and freeze U3 scope before schema or repository work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:33:15 +00:00
weichen 53c0722925 merge: chore/release-multi-intent-u2-slot 2026-09-15 23:18:37 +00:00
weichenandCursor 86f25b26c4 chore(ops): release the U2 integration slot
Smoke already passed on the feature branch; U2 has no schema or container change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:18:37 +00:00
weichen 53d4077f06 merge: feature/multi-intent-u2-segmenter 2026-09-15 23:18:10 +00:00
weichenandCursor 91edeccb26 chore(ops): occupy the U2 integration slot
Hold the shared merge slot for the no-ff merge of the rule-segmenter shadow proposal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:18:10 +00:00
weichenandCursor c2e79c8a1d docs(test): record U2 rule segmenter shadow proposal report
Close the U2 checklist with golden/hard-negative evidence while keeping production routing unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:17:45 +00:00
weichenandCursor 932ba87daf feat(intent): add rule segmenter and shadow PlanProposal
Generate 2–4 step L1 proposals with stable digests while leaving TopIntent and the legacy IntentPlan router unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:14:29 +00:00
weichenandCursor 9005766b62 test(intent): lock legacy multi-intent plan routing
Keep write combos and internal-chain summaries on the current TopIntent path so U2 shadow proposals cannot silently change production.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:07:46 +00:00
weichenandCursor 475134802b docs(ops): claim U2 multi-intent rule segmenter
Register the independent U2 short-term on the intent mutex so shadow proposals can land without touching production routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:06:29 +00:00
weichen 8ac3d3fbc6 merge: chore/release-multi-intent-u1-slot 2026-09-15 16:28:07 +00:00
weichenandCursor 3171e4f0e5 chore(ops): release the U1 integration slot
Smoke already passed on the feature branch; U1 has no schema or container rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:28:07 +00:00
weichen 29d9c65603 merge: feature/multi-intent-u1-contracts 2026-09-15 16:27:29 +00:00
weichenandCursor 42c8ae2ccd chore(ops): occupy the integration slot for U1 merge
Serialize the local --no-ff merge of multi-intent U1 contracts onto dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:27:29 +00:00
weichenandCursor 3d326ad81e docs(status): record U1 multi-intent contract freeze
Archive the arch/parity/short evidence and mark the U1 claim done so U2 can take the intent mutex next.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:27:03 +00:00
weichenandCursor 9364da4974 feat(intentflow): freeze plan lifecycle contracts and batch policy
Add the app/intentflow skeleton so HITL state, error codes, REST shapes, and BatchActionPolicy live outside intent and default to the legacy tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:22:52 +00:00
weichenandCursor aefb1e45a6 feat(events): register intent.plan contracts and table owners
Freeze the three fact events, intentflow allowlist, and plan table ownership so later units cannot invent producers or write paths outside app/intentflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:20:19 +00:00
weichenandCursor bdccb4dbfe docs(ops): claim U1 multi-intent HITL contract freeze
Register the independent U1 short-term, checklist, and CURRENT mutex so architecture-docs and events stay serial while contracts land.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:19:12 +00:00
weichen dd30e061d8 merge: sync test promotion notes from local dev 2026-09-15 16:04:59 +00:00
weichen 987423794f merge: feature/test-env-smoke-notes 2026-09-15 16:04:59 +00:00
weichenandCursor 8919ca9842 docs(ops): record the test promotion smoke and release the slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:04:59 +00:00
weichen 2e826e7f58 merge: promote local dev to test for Phase 2 actual testing 2026-09-15 16:02:46 +00:00
weichen 5a79752ebe merge: feature/promote-dev-to-test-2026-09-15 2026-09-15 16:02:38 +00:00
weichenandCursor 68755862f1 docs(ops): occupy the integration slot for the test promotion
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:02:38 +00:00
weichen 067cf8be18 merge: feature/phase2-session-close 2026-09-15 15:58:47 +00:00
weichenandCursor 035d8594a6 docs: sync multi-intent review index with the parked plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:58:47 +00:00
weichenandCursor fa5955be07 docs(design): tighten multi-intent confirm UI and accessibility gates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:58:26 +00:00
weichenandCursor 69d1203593 docs(ops): close Phase 2 session and park multi-intent HITL plan
Archive the shared-live short-term, refresh CURRENT foci, and check in the reviewed multi-intent design so it no longer sits uncommitted on dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:57:40 +00:00
weichen c1a2bcc26b merge: feature/current-env-snapshot 2026-09-15 15:27:50 +00:00
weichenandCursor 05550f3558 docs(ops): record typed-result and live consumer modes in CURRENT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:27:50 +00:00
weichen 3d39ee0589 merge: feature/pi-typed-result 2026-09-15 15:27:16 +00:00
weichenandCursor ecba6f3b14 chore: release the pi-typed-result integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:27:16 +00:00
weichenandCursor a3fa7c137b docs(test): record PI typed-result-v1 dual-track evidence
Archive Track P tasks and point FEATURE-MATRIX at the live MiniMax runner report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:25:34 +00:00
weichenandCursor 0a61cfbe90 feat(agent): add typed-result-v1 and fail-closed remote parser
Remote /v1/run now emits additive result_v1; Go validates run_id, digest, and paths before materializing, and only accepts missing typed payloads with an explicit legacy handshake.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:25:18 +00:00
weichen 4dbe6a431c merge: feature/http-error-envelope 2026-09-15 14:41:09 +00:00
weichenandCursor f6813cc272 feat(api): add additive HTTP/SSE error envelopes
Public errors now emit code, safe message, and request_id while keeping the legacy error field. Raw SQL, paths, tokens, and XSS payloads are stripped; the frontend branches on code instead of substring matching.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:40:56 +00:00
weichen 39dc68d15c merge: feature/event-shared-live-cutover 2026-09-15 14:24:17 +00:00
weichenandCursor 7a9d0d850d chore: ignore pycache and release the live-cutover integration slot
Shared live rebuild passed health/ready; keep Python bytecode out of test-report assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:24:17 +00:00
weichenandCursor ad9027fe8f docs(test): record shared event live cutover and close the reliability pilot
Notify, workflow_advance, and projection completed shadow/live/rollback on agent-dev; authorized 6275 digest matches; project 143 stays non-leaking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:23:07 +00:00
weichenandCursor 9b1a94c5bc feat(app): drop production outbox and approval hook registration
Durable notify/advance/projection are live on shared dev, so composition roots must not assign OnOutbox or AddOnApprovedHook. Bind helpers remain for tests and a rollback window.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:23:07 +00:00
weichenandCursor 4a662ec2d3 feat(events): gate shared-dev consumer mode changes
Add ValidateOpsCutover, eventmode CLI, and a host script that pin agent_system_dev and refuse FAV plus test/main before any cluster mode write.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:11:44 +00:00
weichen a20760953a merge: feature/phase2-closeout-inventories 2026-09-15 13:26:50 +00:00
weichenandCursor 8400427c24 docs: close Phase 2 isolation tracks and file H0/P0 inventories
Archive completed Track E/S short-terms, record HTTP/PI compatibility matrices, and defer shared live plus protocol implementation to long-term tasks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:26:20 +00:00
weichenandCursor 1c04f17c8c test(events): reject replay apply without approval ref
ReplayPlan two-person apply already required digest match; this pins the missing ApprovalRef negative so dry-run tickets cannot skip the ticket field.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:26:20 +00:00
weichen 3a6d4f45dd merge: fix/chatflow-orchestration-boundary 2026-09-15 13:15:57 +00:00
weichenandCursor 9811ae3841 docs(test): record D7b chatflow orchestration boundary
S4b report and archive; chat production allowlist no longer includes bizdev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:15:48 +00:00
weichenandCursor 425c8ba776 feat(chat): drop production bizdev import from action executor
Pending-action task runs now use stageflow request aliases and Server ports, so chat no longer reaches through the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:15:48 +00:00
weichen 20fc82c485 merge: fix/bizdev-locator-removal 2026-09-15 13:11:10 +00:00
weichenandCursor 6a9e3fb51a docs(test): record D4 bizdev locator removal
S1 report, archive the short-term task, and mark the getter contract closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:10:47 +00:00
weichenandCursor 2a75abb39e refactor(bizdev): delete eight locator getters
Composition roots already hold Snapshot ports; the interface and archtest now forbid putting Pool/DocGov/DocRevision/ContextManager/CAS/ProjectWorkflow/FreeformDoc/KB back on Service.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:08:25 +00:00
weichenandCursor 3f42149457 feat(bizdev): snapshot collaborators onto Runtime and Server ports
Composition roots copy Parts once so HTTP/CLI handlers stop calling locator getters on every request.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:00:33 +00:00
weichen 92a9c6783d merge: fix/stageflow-type-ownership 2026-09-15 11:13:17 +00:00
weichenandCursor acb443e949 docs(test): record D5 stageflow type ownership and chatflow first batch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 11:13:17 +00:00
weichenandCursor 110c2e810c feat(stageflow): own task/stage types so coordinator drops bizdev
Coordinator now takes a StageTaskRunner and injected context/KB ports.
Chatflow assembler reads maturity tokens instead of the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 11:13:17 +00:00
weichen 6f541feac0 merge: fix/intent-bizdev-boundary 2026-09-15 10:29:38 +00:00
weichenandCursor 23d0cfb10f docs(test): record D7a intent-bizdev boundary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:29:38 +00:00
weichenandCursor 525047b841 feat(intent): depend on maturity vocabulary instead of bizdev
Intent only needed the three official stage tokens. Moving them to a
leaf package lets the recognizer compile without the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:29:38 +00:00
weichen 0a2ea2477d merge: fix/doccontent-canonical-boundary 2026-09-15 10:24:24 +00:00
weichenandCursor 7728339d08 docs(test): record D6 doccontent canonical boundary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:24:24 +00:00
weichenandCursor 9ddc673eb8 feat(doccontent): extract shared markdown canonicalization and SHA
docgov saves content hashes through the new leaf module so it no longer
imports docrevision. Existing docrevision exports stay as thin wrappers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:24:24 +00:00
weichen 2771a1ed04 merge: fix/event-e2-hook-guard 2026-09-15 10:17:47 +00:00
weichenandCursor 71502c7ce0 docs(test): record E2 hook live-guard and Track E retrospective
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:26 +00:00
weichenandCursor a1316e39cb test(events): prove WriterLive off/shadow/live hook matrix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:26 +00:00
weichenandCursor 97028c33b5 feat(events): skip in-process writers when a consumer is live
Keep OnOutbox and approval hooks registered while dispatcher mode is
off, but no-op them as soon as the matching durable consumer owns the
visible write so a later switch cannot dual-write.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:09 +00:00
weichen 51bf791ef0 merge: fix/event-projection-cutover 2026-09-15 10:00:38 +00:00
weichenandCursor dab3e1a355 docs(test): record E1C projection no-replace and worker restart evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:00:11 +00:00
weichenandCursor d645eaa1f7 docs(test): record E1C projection no-replace and worker restart evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor aa2f31dc0f test(docproject): prove projection shadow, uniqueness, and no-replace
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor 92f31ffa6a feat(events): apply version-committed projections only forward
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor 21d7692c94 feat(db): record unique projection outcomes per envelope version
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:54 +00:00
weichen 1b1d0a1cba merge: fix/event-workflow-advance 2026-09-15 09:43:09 +00:00
weichenandCursor 7d1b7e736b docs(test): record E1B workflow-advance shadow/live/rollback evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 0ebaaaed87 test(docadvance): prove workflow advance shadow, uniqueness, and rollback
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 965e288d36 feat(events): apply approved events onto workflow advance in one fenced transaction
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 28bb0b8356 feat(db): correlate stage-ready requests to envelope event_id
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichen ebf16aa094 merge: fix/event-notify-cutover 2026-09-15 09:26:45 +00:00
weichenandCursor ff713ff790 docs(test): record E1A notify shadow/live/rollback evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor a5e46eeb5f test(docnotify): prove notify shadow, live uniqueness, and rollback on isolated PG
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor 16a31f8aa5 feat(events): run notify side effects and ack on one fenced transaction
Shadow dry-runs the same handler then rolls back, writing only the intended digest.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor 6702b16249 feat(db): correlate notifications to envelope event_id for unique visible outcomes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichen 06b824ad7c merge: feature/events-dispatcher-pg 2026-09-15 09:08:25 +00:00
weichenandCursor d926f64c2e docs(test): record E0B dispatcher PG, race, and default-off evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor 6bee7630bd feat(service): run the event dispatcher as an independent cmd/events process
HTTP Runtime does not start the worker. Each compose environment gets its own events service, health port, and bounded pool.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor d5968ad4ba feat(events): replace SELECT-only claim with fenced atomic leases
Workers claim with SKIP LOCKED, heartbeat by token, and ack/fail only when the fencing token still matches. Shadow scans without acking live deliveries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor 5fd5588a3f feat(db): add dispatcher attempts, consumer modes, and checkpoints
E0B needs an additive lease audit trail and a cluster-level off/shadow/live table before any worker can claim. FAV remains constrained to off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichen 5f3b117c00 merge: fix/event-production-scope-contract 2026-09-15 08:53:10 +00:00
weichenandCursor 0f2f8d30e5 docs(test): record E0A producer-contract gate and checkpoint ADR
Archive isolated-PG evidence, 7-day read-only inventory, and the decision to bootstrap consumers from the first safe event instead of gap-waiting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:59 +00:00
weichenandCursor 0f2057765a test(docflow): prove three production chains share one Postgres transaction
Isolated-library coverage checks approved/candidate/impact envelopes, empty-env rollback, and zero FAV staging rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:48 +00:00
weichenandCursor 504058debf feat(app): inject unique docflow Commands and isolate FAV from production events
HTTP adapters now reuse the composition-root instance. Candidate-ready, downstream impact, and approved envelopes share the domain unit of work, and missing env/project fail closed without defaulting to dev/0.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:40 +00:00
weichenandCursor bcb122ac53 feat(events): fail-closed scope, static registry, inventory, and replay digest
Reject empty environment/project, disable FAV consumers at register time, and keep historical classification/repair/replay as audited application use cases with no raw SQL entrypoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:30 +00:00
weichenandCursor 97305d699e feat(db): add event inventory, repair audit, replay plans, and service principals
E0A needs additive tables for classification and per-consumer identities before any dispatcher can claim work. FAV principals are rejected at the schema check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:19 +00:00
weichen 3d2a1defd8 merge: feature/module-decoupling-phase2-docs 2026-09-15 08:12:47 +00:00
weichenandCursor 15af018734 docs(ops): close architecture-docs mutex after Phase 2 plans land
The next claim is Track E E0A; dispatcher stays off until that gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:12:21 +00:00
weichenandCursor 7647215513 docs(ops): land Phase 2 Track E/S/P plans onto a legal feature branch
Move the reviewed durable-event, HTTP envelope, and PI typed-result
designs off the docs/ prefix so Track E can start from latest dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:11:29 +00:00
weichen 5cef85670a docs(remediation): add module decoupling phase-2 remediation plan and index gap-matrix rows 2026-09-15 07:03:39 +00:00
weichen a3392e3e06 docs(research): add module decoupling and IPC/RPC interaction assessment 2026-09-15 06:57:08 +00:00
weichen 9edd6c8190 merge: chore/leftover-branch-cleanup 2026-09-15 06:44:46 +00:00
weichenandCursor edb7411474 docs(ops): record leftover branch cleanup and short smoke evidence
Local merged side branches and their worktrees are gone; FAV/herdr/diagnosis/old-linear stay unmerged on purpose.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 06:44:39 +00:00
weichen 347c5f54a6 merge: docs/conversation-intent-dual-tab 2026-09-15 06:22:58 +00:00
weichenandCursor 8a8f64a931 docs(test): close intent dual-tab busy gate and release the mutex
Record project 6275 PI 409 DOC_BUSY plus Docker screenshots, mark CHAT-INTENT-STATE PASS, and archive the short-term so CURRENT has no in_progress rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 06:22:58 +00:00
weichen f5d32cddd1 merge: docs/u11-u12-slot-close 2026-09-15 05:55:34 +00:00
weichenandCursor 111ab6786e docs(test): close U11–U12 after dev rebuild and archive the app mutex
Record schema 38 health/ready plus the new agent-dev-app digest, then mark the composition-root slice done so intent dual-tab can take the idle slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:55:25 +00:00
weichen bf59cceef2 merge: feature/app-composition-u11-u12 2026-09-15 05:51:32 +00:00
weichenandCursor 934c0596ea docs(ops): occupy the integration slot for U11–U12 merge
Serial slot is required before --no-ff into local dev and agent-dev rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:51:32 +00:00
weichenandCursor 717162e701 docs(test): record U11–U12 composition root and transport gate evidence
Contract tests, target-package race, and arch-check --mode block passed; merge to dev still needs the integration slot rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:15 +00:00
weichenandCursor 84c0841acb feat(app): add composition root, stageflow, ContextUpdate, and SSE transport
Move construction and document OnOutbox out of server, give HTTP/CLI a shared task use case, and block already-cleared import/event arch rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:15 +00:00
weichenandCursor 652cea1605 docs(ops): claim M5/M6 U11–U12 composition and transport gate
User authorized continuing past U10 stop-ship; register app mutex on feature/app-composition-u11-u12.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:00 +00:00
weichen ef9a162314 merge: feature/chatlog-contextasm-u10
M4 U10 ChatLog/ContextAssembler 原地端口化。停止扩面,禁止 U11–U12。
2026-09-15 05:05:27 +00:00
weichenandCursor 6601583cbe docs(test): record U10 occupy-slot rebuild into agent-dev
health/ready schema 38;镜像已含 ChatLog 端口。停走结论仍是停止扩面。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:05:27 +00:00
weichenandCursor 3c9e6d214d docs(ops): occupy the integration slot for M4 U10 merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:04:15 +00:00
weichenandCursor 6e744d3717 docs(test): record U10 ChatLog ports and live chat refresh evidence
Archive the finished chat mutex tasks, attach PI idle-chat refresh same-set evidence for project 6252, and stop expansion after in-place ports without a package split.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:40 +00:00
weichenandCursor 65bdda8aae feat(api): route chat history reads through ChatLog
Ignore request user_id as identity, authorize from the session Principal, and hydrate restore/memory from the same visible set so HTTP, SSE, and prompt assembly cannot amplify hidden messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:27 +00:00
weichenandCursor 18d40fa8a9 feat(chatflow): add ChatLog and ContextAssembler ports
Keep ctxmgr as table owner and filter the authorized visible set in-process so window, stats, restore, digest, and prompt assembly share one Principal-scoped collection without a package move.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:16 +00:00
weichen 3944856b0a merge: feature/dataset-lifecycle-u9
M3 U9 存量回填、migration corpus 与数据生命周期。
2026-09-15 03:01:49 +00:00
weichenandCursor af51e74076 docs(test): M3 U9 dataset lifecycle 验收报告
隔离库 SKIP LOCKED、八轨、arch-check、web 与 rebuild 证据齐全;真实 PI 未测。最后一句:继续 U10。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 03:01:49 +00:00
weichenandCursor 42f356ccd7 docs(ops): occupy the integration slot for M3 U9 rebuild
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:41:06 +00:00
weichenandCursor be0c1e843f feat(dataset): registry, pause/resume backfill, destroy gates, eight tracks
批准 dataset 分类入库;SKIP LOCKED 分批;销毁默认 fail closed。restore 演练拒绝共享 env DSN。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:40:12 +00:00
weichenandCursor b5337d5c77 feat(artifactvault): checkpoint backfill without scanning workspace
只枚举 snapshot、agent_commit、approved 与 completed chat turn;hazard 进 quarantine,禁止工作区路径。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:40:12 +00:00
weichenandCursor 5ac14d649b feat(db): add goose 00038 dataset lifecycle tables
Registry、checkpoint queue 与 destroy 请求表属主 dataset;必须可 Down,不改历史 Goose。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:31:34 +00:00
weichenandCursor e81e7a1bcc docs(ops): claim M3 U9 dataset lifecycle mutex
U8 已签继续 U9。本轮 mutex=dataset,禁止 U10–U12 与共享库销毁。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:30:45 +00:00
weichen 367473730b merge: feature/taskrun-runmanifest
M3 U8 TaskRun 终态与 RunManifest。
2026-09-15 02:17:37 +00:00
weichenandCursor f4dfada9ae docs(test): M3 U8 TaskRun RunManifest 验收报告
隔离库双 pool、目标包 race、arch-check、web 与 rebuild 证据齐全;真实 PI 未测。最后一句:继续 U9。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:17:37 +00:00
weichenandCursor ac302fb78f docs(ops): occupy the integration slot for M3 U8 merge
Serialize merge and container rebuild so other agents wait while RunManifest lands on dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:07:42 +00:00
weichenandCursor 3997a04bdb test(taskrun): cover duplicate finalize, cancel race, and SSE
Use an isolated dual-pool database so idempotent finalize, cancel CAS, commit-fail SSE, and receipt-gated cleanup are proven without a process mutex.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:06:21 +00:00
weichenandCursor 2ddaf769ca feat(workspace): gate cleanup on verified receipts
Hash deliverables through Capability.ReadArtifact, resolve backends on the server, and refuse workspace removal until frozen members match FAV receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:06:10 +00:00
weichenandCursor 7be873073c feat(taskrun): finalize RunManifest in one unit of work
CAS the unique terminal status with the assistant turn, frozen manifest, envelope and FAV staging, and join ctxmgr writes through the same UoW instead of a process mutex.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:05:58 +00:00
weichenandCursor eb75f855a5 feat(db): add goose 00037 task_run_manifests
Persist typed RunManifest bytes and SHA per run, and allow a finalizing status so U8 can freeze a unique terminal without sharing env databases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:05:33 +00:00
weichenandCursor 2234af476a docs(ops): claim M3 U8 TaskRun RunManifest mutex
Register feature/taskrun-runmanifest on the taskrun mutex so U8 can start without occupying chat/intent or writing U9–U12.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 01:04:32 +00:00
weichen b8f33b5c55 merge: refactor/document-reliability-pilot
M2 test report and integration-slot release.
2026-09-14 16:07:37 +00:00
weichenandCursor da21911e30 docs(ops): restore the original M1 stop-the-line report link
CURRENT SSOT must keep the unmodified 停止扩面 report alongside the live and M2 reports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:07:37 +00:00
weichenandCursor b1ce9b5c41 docs(test): record document reliability M2 go-no-go
U5–U7 passed isolation-db, race, goose Down, and schema-36 rebuild. The report last sentence is 继续 M3; the integration slot is idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:07:05 +00:00
weichen 0872d8fbb3 merge: refactor/document-reliability-pilot
M2 WorkspaceRef, durable events, and audited FAV (goose 00034–00036).
2026-09-14 16:00:57 +00:00
weichenandCursor 425338be9e docs(ops): occupy the integration slot for M2 merge
U5–U7 need a main-repo rebuild so schema 00034–00036 is not validated from a worktree docker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:00:42 +00:00
weichenandCursor c7e3e99303 feat(artifactvault): extract audited FAV with union-deny reads
Goose 00036 is a renumbered copy of the vault tables. Degraded read stays off by default and only runs after authorization; tombstones and unpublished artifacts fail closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:36 +00:00
weichenandCursor f27059b453 feat(events): add durable envelope delivery and drop commit OnOutbox
Agent commits append a validated envelope inside the command unit of work. SKIP LOCKED is only used to claim, and stale fencing plus integrity failures go to quarantine or dead-letter.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:24 +00:00
weichenandCursor 18ddd0f862 feat(workspace): add WorkspaceRef fencing and hide physical paths
Cross-module callers get an opaque ref plus rotating lease tokens so stale writers fail closed, and file I/O is refused inside a unit of work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:14 +00:00
weichenandCursor b0d9153e52 docs(test): record document reliability M1 live sign-off
Rebuild, real PI, browser reload, and two-pool sessions all passed, so
the live report's last sentence is 继续 M2 and the integration slot is idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:46:53 +00:00
weichenandCursor 88b37b60da test(e2e): refresh admin directory before new-project member pick
Create-project candidates come from the in-session user directory, so a
fresh admin page never saw B/C unless the console refresh ran first.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:38:50 +00:00
weichenandCursor 3e4abc51cd test(e2e): cover 143 reload, fail-closed GET, and new-project compile
Live M1 sign-off needs browser proof that missing projection is not 404,
outsiders share DOCUMENT_NOT_FOUND, and a real PI compile survives reload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:34:37 +00:00
weichenandCursor f34bec40f5 test(docgov): replay same-digest across two pools and four sessions
Cross-pool idempotency is same key plus same digest; a stale in-memory
head from the seeder hid the one-winner four-session lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:34:30 +00:00
weichen cb8eacac61 merge: refactor/document-reliability-pilot
Occupy the integration slot to rebuild dev for M1 live sign-off of document reliability U1–U4.
2026-09-14 14:24:56 +00:00
weichenandCursor 7f8ad76d12 test(docgov): add two-pool races and ledger-first live spec
Occupy the integration slot for M1 live sign-off, cover two pgx pools plus four sessions, and add a Playwright spec that treats projection consistency as 200 rather than 404.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:24:46 +00:00
weichenandCursor 3772193747 docs(test): attach M1 suite transcripts
Keep the short and isolated PostgreSQL/race outputs next to the stop-the-line report so the unsigned PI/browser/rebuild columns stay auditable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:52 +00:00
weichenandCursor 9d6594a31c docs(test): record document reliability M1 stop-the-line
Unit, isolated PostgreSQL, and target-package race passed, but real PI, browser, and rebuild were not signed, so the report concludes 停止扩面 and keeps U5–U12 closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:26 +00:00
weichenandCursor f0f57a0755 fix(docflow): avoid mutating shared Commands.Auth
Concurrent HumanEdit/Approve used to assign the default authorizer on the shared Commands value, which raced under -race. Read a local authorizer instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:26 +00:00
weichenandCursor c754f7743d feat(docquery): serve ledger when projection is missing
Authorize first, then return immutable ledger markdown with typed consistency so a missing or drifted projection is no longer a 404/409. GET stays read-only and FAV degraded read stays off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:07:05 +00:00
weichenandCursor ade618b854 feat(docflow): own document commands in one UnitOfWork
Lock the document row and re-authorize duty before edit, agent commit, approve, or reject share a single transaction. Characterization tests pin ETag races, one legal approve/reject terminal, and same-key digest conflicts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:02:21 +00:00
weichenandCursor ec22843297 docs(ops): mark U2 UnitOfWork complete on the pilot task
Record that cross-owner rollback is implemented so U3 can take document commands next.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:54:33 +00:00
weichenandCursor f8b21ecd7c feat(app): add UnitOfWork and owner-bound repositories
Give each document command one postgres transaction and only let table owners unwrap the scope, so cross-owner writes can roll back together.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:54:27 +00:00
weichenandCursor 158ce2586d docs(audit): record U1 architecture baseline
Capture the replayable import/sql/path/event counts and the owned exceptions that later milestones must shrink.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:49:54 +00:00
weichenandCursor 312578ccd1 chore(arch): classify production writers and path rules
Replace whole-repo grep with four production-only gates so Goose and tests stop looking like writer debt, and so new SQL, path, or event crossings fail immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:49:54 +00:00
weichenandCursor 2269cabf43 docs(arch): archive document reliability pilot plan and claim docgov
Land the revised modular-monolith scheme on the implementation branch so U1–U4 can proceed against a frozen design, and register the docgov mutex without occupying the integration slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:43:54 +00:00
weichen a8f9451410 merge: fix/governance-action-level-authz (G5 acceptance docs) 2026-09-14 08:46:57 +00:00
weichenandCursor 05d2154d66 docs(test): archive governance action-level authz acceptance
Record the real-page and API matrix, release the workflow mutex, and point FEATURE-MATRIX / gap-matrix at the report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:46:45 +00:00
weichen 68640e4de1 merge: fix/governance-action-level-authz (blocked status + canonical duty check) 2026-09-14 08:40:01 +00:00
weichenandCursor 1d366fd38e test(web): stabilize governance authz page matrix locators
Avoid matching the blocked-run hint when opening settings, and close leftover modals before project 143.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichenandCursor aec166ea41 feat(api): duty-check canonical docs before they are persisted
Template doc_proj ids were skipping CheckDocTaskAccess and returning 400 not-found.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichenandCursor 68fee06da4 feat(db): allow blocked_pending_governance task run status
Pre-activation 202 runs must persist without hitting chk_task_run_status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichen 1dcffb7d11 merge: fix/governance-action-level-authz
G1–G4 duty-action authz, blocked pre-activation runs, and create-time
planning stay; G5 smoke follows on the shared dev stack.
2026-09-14 08:06:37 +00:00
weichenandCursor 5ee898e2e4 docs(ops): occupy integration slot for governance authz
G5 starts merging and smoke on the shared dev stack; Playwright matrix
is ready for the real page pass after rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:04:34 +00:00
weichenandCursor c048060bae docs(audit): classify planning projects with leftover workflow keys
Read-only dev query shows 83 planning rows with a leftover key; all are
paired PROJ_MGR/TEST_PROJ fixtures, none are live business projects.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:01:46 +00:00
weichenandCursor ab9fccded4 feat(web): disable unmanaged approval actions
Hide submit/review/approve on none docs, surface the blocked-run hint in
chat, and warn that unmanaged duties cannot be added after activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:00:21 +00:00
weichenandCursor 9baf3c83f8 test(web): cover duty-gated actions and blocked-run copy
Pin unmanaged-doc button visibility and treat blocked_pending_governance
as a governance hint, not a successful generation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:00:21 +00:00
weichenandCursor 22f65e5f24 feat(projectworkflow): keep create in planning when key provided
Validate the catalog key only and stop writing lifecycle=active so
activation stays on the settings DutyMode path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:55:51 +00:00
weichenandCursor 2e586c99b8 test(projectworkflow): reject create-time active bypass
Creating with initial_workflow_key must stay in planning with an empty
active key while the catalog still mounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:55:51 +00:00
weichenandCursor 295ad89860 feat(api): block pre-activation runs without starting squads
Keep 202 for unactivated document runs, persist blocked_pending_governance,
and refuse submit/review/approve/edit until a live workflow exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor 8384136989 feat(projectinstance): map document actions to duties
Route run/edit/submit/review/approve to a single duty, drop full-doc
creator bypass, and keep view listing independent of stage narrowing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor 66d2a1837f test(projectinstance): pin action-level duty checks
Lock the full/none/pre-activation matrix so creator no longer implies
document-task privilege and unactivated runs stay WORKFLOW_NOT_ACTIVATED.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor b4699e9cbe docs(ops): start governance action-level authz
Wave 5 is on local dev@19f6df5; claim the workflow mutex and
register the implementation worktree for G1–G5.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:42:48 +00:00
weichen 19f6df58dd merge: fix/workflow-plan-409-frozen-and-optional-duties Wave 5 acceptance 2026-09-14 07:29:27 +00:00
weichenandCursor ed4a3e53de docs(test): archive workflow-plan 409 settings page acceptance
Record the real UI matrix, release the integration slot, and leave
the unrun PI generation/approval path as an explicit residual.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:29:16 +00:00
weichenandCursor bb1927f23b test(web): harden Wave 5 frozen-duties page matrix
Wait for the workflow select step before clicking next, scope duty
dropdowns by role, and finish first-login reset so dual-tab and
member checks reach the real frozen UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:28:56 +00:00
weichen 840b5be94f merge: fix/workflow-plan-409-frozen-and-optional-duties e2e tidy 2026-09-14 07:08:15 +00:00
weichenandCursor 5d40f5938a test(web): drop unused Wave 5 e2e password binding
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:08:06 +00:00
weichen 354e573f37 merge: fix/workflow-plan-409-frozen-and-optional-duties 2026-09-14 07:07:51 +00:00
weichenandCursor f86a44acd4 docs(ops): occupy integration slot for workflow-plan 409 Wave 5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:07:39 +00:00
weichenandCursor e1ed561917 feat(web): add optional human-approval switch for configurable docs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:02:11 +00:00
weichenandCursor a0904fdd69 test(web): cover per-document approval toggle
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:02:11 +00:00
weichenandCursor 708b735eea feat(projectinstance): apply duty mode to readiness access and snapshots
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:58:06 +00:00
weichenandCursor 1dd1cc039e test(projectinstance): unify gate access and preview for duty modes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:58:06 +00:00
weichenandCursor ea97a658c6 feat(projectinstance): classify optional duties without lowering required gates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:53:21 +00:00
weichenandCursor de66558736 test(projectinstance): pin duty mode and activation governance
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:53:21 +00:00
weichenandCursor 0689ac77c3 feat(web): show frozen read-only project settings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:48:14 +00:00
weichenandCursor 1b0f99a455 test(web): add typed project settings errors and frozen mode
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:48:14 +00:00
weichenandCursor 94065976a5 docs(ops): start workflow-plan 409 frozen and optional duties
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:43:53 +00:00
weichen b01af96045 docs(workflow): register reviewed remediation worktree 2026-09-14 06:28:02 +00:00
weichen 15f52cb14e docs(workflow): review frozen plan and optional duty design 2026-09-14 06:26:36 +00:00
1032 changed files with 65444 additions and 4576 deletions
+1
View File
@@ -42,6 +42,7 @@
| 架构设计 | [system-design/README.md](system-design/README.md) |
| 测试报告 | [test-reports/](test-reports/) |
| 历史功能设计 | [archive/design/superpowers/](archive/design/superpowers/) |
| Herdr 角色、审批与备援 | [ops/2026-09-13-herdr-agent-roster.md](ops/2026-09-13-herdr-agent-roster.md) |
---
@@ -1,29 +1,62 @@
# ADR:模块化单体解耦——契约通信、单一写者、编排下沉
# ADR:以纵向绞杀方式实施模块化单体解耦
## 状态
已接受(2026-09-14;Wave 0 契约骨架与 arch-check warn 基线已落地,未占集成槽)
提议(2026-09-14;架构与实施计划已修订,等待用户确认后进入首个实现里程碑)
## 背景
多轮审计与实测表明:一处修改波及多处的根因不是模块数量不足,而是——
`internal/server`(17k 行)同时是组合根、跨模块闭包事件总线、编排载体与文件系统/SSE 细节持有者;`internal/bizdev` 是第二组合根(依赖 16 个内部包);`UserProjectContext` 被 chat/coordinator 双向直改;`document_records` 有 5 个写者;工作区路径与 squad 文件 schema 是无版本化的隐性公共契约;`intent→bizdev` 反向依赖。
证据与完整诊断见 [../system-design/2026-09-14-module-decoupling-architecture.md](../system-design/2026-09-14-module-decoupling-architecture.md) §1。
`internal/server`、`internal/bizdev`、共享 `UserProjectContext`、工作区路径和多表写入形成隐式耦合。
历史受控正文 404/409、刷新后投影缺失和任务终态不完整说明,单纯搬包不会修复事实源、事务与恢复边界。
## 决策
1. **架构形态**:维持模块化单体(不做微服务拆分),新增 `internal/contracts` 作为跨模块接口/DTO/事件/共享枚举的唯一 SSOT;模块间仅允许「调 contracts 接口」与「发布/订阅 contracts 事件」两种通信。
2. **单一写者**:每张表、每类文件唯一属主(docgov 独占 `document_records`;chatlog 独占 chat_* 表;workspace 独占工作区路径);跨模块写走属主端口方法。
3. **编排下沉**:跨模块流程收敛到应用编排层(chatflow/stageflow/docflow,拆自 bizdev/coordinator/chat);HTTP handler 只做参数→服务→DTO 三行式。
4. **组合根唯一**:wiring 迁 `internal/app`;`server.NewServer` 只剩 HTTP 装配;SSE 帧协议下沉 `internal/stream/transport`。
5. **squadrun 契约**:系统备好工作区与 `InputBundle`,小队按 `OutputContract` 交货并写 `RunManifest`(SchemaVer=1);外部禁止直读/覆写工作区内部文件。
6. **机器门禁**:`scripts/arch-check.sh` + `module-boundaries.yaml`(import allowlist / 表属主 / 路径字面量属主),warn 两周后 block 进 CI 与集成槽位冒烟。
7. **兼容承诺**:HTTP URL 与响应结构在 Wave 1–5 不变;**零表结构迁移**;旧路径设一版兼容期后删除。
8. **实施顺序**:Wave 0 立规矩 → 1 止血 → 2 读路径 API 化 → 3 小队契约化 → 4 单写者 → 5 编排事件化(可拆 5a/5b)→ 6 传输收口;每 Wave 独立分支、独立回滚,遵守 AGENTS.md §6 mutex/槽位纪律,避开在途认领。
1. **保持模块化单体**:不拆微服务;进程内调用使用窄端口,跨进程可靠性只用于持久事件和 FAV。
2. **纵向绞杀**:先在现有包边界插入端口和适配器,迁完一条业务链并验证后再移动或重命名包;禁止“先全量搬包、以后再接口化”。
3. **契约分层**:外部 API DTO 归 `server/api`;持久 schema、公共事件和稳定共享词汇进入按领域划分的 contracts;一对一内部接口由消费者拥有。
4. **命令与事务同属一个应用用例**:一个业务命令只有一个事务 owner;跨表属主通过同一不透明事务作用域协作,业务状态、账本、当前指针、staging 和 outbox 原子提交。
5. **单一写者不等于单独事务**:表属主控制 SQL 和不变量;应用 UnitOfWork 控制跨属主提交边界。属主端口不得私自嵌套提交。
6. **并发正确性以数据库为准**:用户编辑使用乐观版本/ETag;状态转换使用行锁和条件更新;项目级不变量可使用事务级 advisory lock;进程内 mutex 只能优化,不能作为多副本正确性依据。
7. **锁顺序固定**:同一事务按 project/workflow instance → document record → document version/snapshot → task run → outbox/staging 的顺序取锁;事务内禁止 LLM、对象存储、网络调用和长文件 I/O。
8. **可靠事件采用 transactional outbox**:事件按至少一次投递设计,具有稳定 ID、schema version、环境/项目范围、聚合序号、因果链和幂等键;逐消费者记录 delivery、重试、租约和死信。
9. **工作区是可清理投影**:跨模块只传不可伪造 Workspace ID 和受限 artifact key;物理路径只在 workspace/squadrun 适配器内解析和校验。
10. **最终成果进入 FAV**:PostgreSQL 保存业务关系和授权,FAV 只保存已确认终态的精确 payload、manifest、回执和删除状态,workspace 不承担最终成果事实源。
11. **授权逐动作校验**:认证适配器构造不可由请求覆盖的 Principal;HTTP、CLI、后台订阅者和恢复流程都按 action/resource/current state fail closed。
12. **先完成文档可靠性试点**:只有受控正文刷新、重启、并发提交、投影缺失降级和授权负例通过后,才批准 chat、squad、编排层和传输层扩展。
13. **迁移采用 expand/migrate/contract**:允许新增 Goose migration;不得修改已发布迁移;回滚只保证回到最近的兼容阶段,不能任意独立 revert 早期依赖。
14. **协议改造独立立项**:统一错误信封和 PI Runner `result.json` 不作为核心模块解耦前置条件;它们使用独立兼容与 E2E 验收。
## 并发与失败语义
- 普通聚合状态转换默认 `READ COMMITTED` + 明确行锁/条件更新;涉及跨聚合唯一不变量时才使用 Serializable,并对 `40001`/`40P01` 重跑完整事务。
- outbox worker 使用小批次 `FOR UPDATE SKIP LOCKED` 认领,处理发生在事务外;完成、续租和失败回填使用 fencing token 防止过期 worker 覆盖新 owner。
- 每个写命令必须同时有 idempotency key、expected version 或两者;相同 key 不同 payload 返回 typed conflict。
- 锁等待、事务时长、重试次数、队列积压和死信必须可观测;超过预算时失败返回,不无限等待。
## 授权与恢复语义
- Principal 至少携带 actor、环境、认证来源和请求关联 ID;项目、会话、文档、阶段与 duty 从数据库权威关系重新解析。
- 持久事件中的 actor 只用于审计,不能替代订阅者对当前资源状态的授权检查。
- FAV 降级读取要求运行库授权图完整;授权图缺失时禁止面向用户返回内容。
- 恢复只允许进入 scratch identity;promotion 需要系统管理员与数据责任人确认,并通过各属主端口提交,禁止恢复 CLI 直写运行表。
## 后果
- 新增包:contracts / app / chatlog / contextasm / docquery / squadrun(squad 换壳);
- `internal/bizdev` 与 `internal/ctxmgr` 将被拆解退役(知识迁移到 use case 与两个子包);
- 所有后续新能力(含软件项目自举)必须基于新边界实现,禁止再挂 bizdev 门面;
- 任何契约(contracts 中已发布的 DTO/事件/文件 schema)变更须走 ADR。
- 首个实现里程碑的改动面小于原 Wave 1–6,但会先增加 UnitOfWork、事件投递和授权基础设施。
- “单表唯一写者”检查改为生产 SQL 写权限检查,并允许 migration、测试和经批准运维脚本存在表名。
- `feature/final-artifact-vault` 是候选依赖,不直接假定可合入;必须先按当前 dev 重放测试、迁移和权限审计。
- 包物理移动、错误信封、SSE 和 PI Runner 协议可延后,不阻塞文档一致性整改。
## 替代方案
- **一次性横向搬包**:拒绝。冲突面大,不能先证明用户故障减少。
- **仅增加 arch-check**:拒绝。门禁不能替代事务、锁和授权契约。
- **拆微服务**:拒绝。当前问题是模块边界和数据一致性,不需要引入分布式事务与跨服务部署成本。
- **继续把 workspace 作为恢复来源**:拒绝。工作区属于可清理计算现场,不能成为最终事实源。
## 相关文档
- [模块解耦架构](../system-design/2026-09-14-module-decoupling-architecture.md)
- [模块解耦整改与重构计划](../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- [方案复核](../audit/2026-09-14-module-decoupling-plan-review.md)
- [文档版本边界 ADR](./2026-09-13-document-version-boundary.md)
@@ -0,0 +1,30 @@
---
title: "事件连续性采用 consumer checkpoint + 首事件 bootstrap"
status: accepted
created: 2026-09-15
updated: 2026-09-15
---
# ADR:事件连续性采用 consumer checkpoint + 首事件 bootstrap
## 状态
接受(E0A)。在独立 FAV 审计或明确的无缺口 event sequence 迁移完成前不得改为 gap blocking。
## 背景
`event_envelopes` 已有 `UNIQUE (aggregate_type, aggregate_id, aggregate_version)`。受控文档的首次持久事件常常从较高 `aggregate_version`(账本 version_no)开始,中间版本从未发事件。若把领域版本号当成无缺口事件序号并在缺号时等待,会永久阻塞 delivery。MemoryBus 的 `TestGapDoesNotSkipVersion` 只是 characterization,不得搬到 PostgreSQL dispatcher。
## 决策
1. Track E 选择 **consumer checkpoint + 首事件 bootstrap**。
2. 每个 `(consumer, aggregate_type, aggregate_id)` 记录已成功处理的 `event_id` 与可选 `aggregate_version`。该 aggregate 上的第一件 **safe** 事件即为 bootstrap,不要求 version=1。
3. 同一版本多个不同类型事件:当前唯一约束禁止。E0A 审计后保持该约束;需要同版本多事件时另立 additive 迁移,把序号改到独立 `event_seq`,不在本 ADR 启用。
4. **禁止** 在 dispatcher 启用 gap wait / `ErrGapWait` 阻塞,直到另有 ADR 选择独立无缺口 event sequence 且完成回填。
5. 未知 schema、project 0、错误 environment、未知 consumer 的记录进入 inventory,不得 live claim。
## 后果
- E0B checkpoint 表随 dispatcher migration 增加。
- Projection 以 `document_id + source_snapshot_id + digest` no-replace,不依赖连续 version。
- poison 事件 quarantine 后不静默跳号;其他 aggregate 继续。
@@ -0,0 +1,85 @@
# ADR:纯软件工作流 key 与领域边界(SWBOOT-00)
## 状态
已接受(2026-09-16)
## 背景
工作流引擎已声明 `non_medical_software` 产品域,但正式目录、创建入口与模板仍以医疗器械三工作流(`main` / `product_manager` / `test_manager`)为硬编码白名单。继续复用医疗 manifest 会造成临床/注册/CDO 语义污染;直接改写既有三 key 会破坏已激活医疗实例。
详细设计见 [software-project-bootstrap-workflow](../system-design/2026-09-14-software-project-bootstrap-workflow.md)。
## 决策
### 1. 新增正式可选工作流 key
| key | 定位 | 默认产品域 | 可重复实例 |
|-----|------|------------|------------|
| `software_bootstrap` | 一次性建立项目事实、需求、架构、风险、路线与验证基线 | `non_medical_software` | 否(默认一次;终止后可重建并保留旧证据) |
| `software_delivery` | 按里程碑/发布重复交付,承接 change brief → 证据 → 验证 → 发布 → 复盘 | `non_medical_software` | 是 |
医疗三 key **保持不变**,仍为正式可选;不得在其 published hash 上替换为软件语义。
### 2. 目录策略:published + selectable,而非“仅三 key”
项目可选工作流 = 已发布 (`latest_published_version > 0`) ∩ `project_selectable=true` ∩ 策略白名单。
白名单扩展为:
```text
main | product_manager | test_manager | software_bootstrap | software_delivery
```
固定文档数量校验 **仅** 继续约束医疗三 key;软件工作流按 manifest 自身完整性校验,不强制医疗文档数。
### 3. 领域与合规分离
- `product_domain=non_medical_software` 只说明非医疗器械,不关闭鉴权/审计/安全基线。
- `compliance_profile` / `governance_profile` / `execution_mode` / `team_mode` 为项目级独立字段。
- 首期默认:`governance=standard`,`compliance=internal_control+security_baseline`,`execution_mode=docs_only`。
- `controlled_patch` 在 SWBOOT-10 受控执行器就绪前 **不可真正启用**;仅保留 allowlist stub。
### 4. 串联而非回环
```text
software_bootstrap(完成 + 创建者确认)
→ 仅建议 software_delivery
→ 创建者确认后新建 planning/激活实例
```
bootstrap 完成不得自动创建或激活 delivery。
### 5. Solo 审批策略(契约)
- `collaborative`:独立三权(author/reviewer/approver 不同人)。
- `solo`:`creator_acknowledgement`;页面与审计持续标注“未独立评审”。
- `controlled` 或要求独立审查的 compliance profile:**禁止 solo**。
### 6. 错误码(首期)
| code | 含义 |
|------|------|
| `ERR_WORKFLOW_NOT_SELECTABLE` | key 不在正式可选白名单或未 published |
| `ERR_DOMAIN_INCOMPATIBLE` | 工作流与项目 `product_domain` / `project_type` 不兼容 |
| `ERR_COMPLIANCE_PROFILE` | 合规配置非法或与治理冲突(如 controlled+solo) |
| `ERR_EXECUTION_MODE_DISABLED` | 请求 `controlled_patch` 但受控执行器未启用 |
| `ERR_REPO_PATH_NOT_ALLOWLISTED` | 仓库路径不在管理员 allowlist(SWBOOT-10 stub) |
| `ERR_CREATION_PREVIEW_STALE` | creation token / plan_hash 过期或不匹配(409) |
### 7. 运行时权威不变
继续遵守 [workflow-runtime-authority](./2026-09-12-workflow-runtime-authority.md):任务只能从冻结 `doc_task_instance` 启动;禁止客户端 `task_key`/duty/stage 旁路。
## 后果
- Bootstrap seed 与 catalog API 必须同时暴露软件两 key,且按 `product_domain` 过滤时不把医疗默认话术塞进软件项目。
- 项目表 additive 增加 `project_type_key` / `compliance_profile_key` 等字段;旧项目不自动分类为医疗或软件。
- SWBOOT-10 仅落地 allowlist stub:任何真实 patch/merge/push 必须 fail closed,直到独立 Epic 验收。
- 医疗三工作流黄金用例与固定文档数门禁保持回归基线。
## 关联
- 实施任务:`.doc/ops/short-term/2026-09-16-software-project-bootstrap.md`
- Backlog:`.doc/ops/long-term/2026-09-14-software-project-bootstrap-implementation.md`
- 验收清单:`.doc/ops/checklists/2026-09-14-software-project-bootstrap-acceptance.md`
@@ -0,0 +1,63 @@
---
title: "D7 对话数据留存与删除口径(草案)"
status: proposed
created: 2026-09-17
updated: 2026-09-17
compliance: pending-compliance-signoff
owner: Cline
related:
- ../remediation/2026-09-16-partial-deferred-completion-plan.md
- ../ops/short-term/2026-09-16-partial-deferred-completion.md
- ../status/FEATURE-MATRIX.md
---
# ADR:D7 对话数据留存与删除口径
## 状态
**提议 / 工程草案**(2026-09-17)。数字与删除口径标 `pending-compliance-signoff`:合规签字或改数前,W7 仅允许数据分类盘点与现状审计,不得按未签字数字执行物理删除或备份清除。接受后状态改为 `accepted`。
## 背景
FEATURE-MATRIX「对话数据治理(D7)」为 `deferred`。收口计划 W7 要求:数据分类盘点 → 留存/删除口径落 ADR → 库/备份/日志控制 → 敏感字段加密边界。工程不能单方面定合规数字,但必须提供可审草案,避免无限期停在 deferred。Track E / R13 / R18 / R22 已对日志脱敏与销毁门禁有硬约束,本 ADR 将其固化为 D7 口径。
## 决策(建议默认;待合规确认)
### 1. 数据分类与留存
| 数据类 | 留存 | 说明 |
|--------|------|------|
| 会话正文(chat sessions/messages) | 热库 **365 天**(可配置) | 超期 soft-delete → 观察窗 → 物理清理 |
| 派生文档 / 私密文档 | 与聊天**独立周期**;回收站 **30 天**后物理清理 | 删除 UI 须说明影响范围(只删聊天 / 只删文档 / 两者) |
| 审计元数据(导出/治理审计) | **180 天** | 不可被普通用户删除覆盖 |
| Agent trace / workspace 非终态 | 任务结束后 **30 天**;nightly 仅合成数据 | 禁止当长期事实源 |
| 日志 / dead-letter / reconciliation | 不按正文留存;**只存 ID、digest、typed error code、allowlist 摘要** | Track E 红线 |
| FAV 终态制品 | `retention_class` + legal hold + delete ledger | 与聊天口径解耦 |
### 2. 删除路径
1. **用户删除**:soft-delete / tombstone → 观察窗 → 物理清理。
2. **备份清除**:须二次批准 + 精确 delete manifest;对齐销毁门禁 R22(完整备份恢复演练、migration corpus、FAV coverage、manifest、用户批准)。
3. **删除界面**:必须说明聊天源消息与派生文档的独立保留周期及本次操作影响范围。
### 3. 加密边界(首期)
- 首期范围:敏感字段**盘点** + 传输与备份访问控制。
- **不默认**上字段级加密;选型待合规确认与威胁模型后再立实现任务。
### 4. 违规升级
盘点确认当前基线违反已确认的安全或合规要求 → **立即**写入 [`gap-matrix.md`](../remediation/gap-matrix.md),不得继续当普通 backlog;本行 `done` 让位于整改。
## 后果
- W7 可按本草案启动盘点;物理删除与备份清除在 `pending-compliance-signoff` 解除前禁止按建议数字自动执行。
- 2026-09-17 只读盘点:[../audit/2026-09-17-d7-data-inventory.md](../audit/2026-09-17-d7-data-inventory.md)(未删数据、未升矩阵 done、未写 gap-matrix blocker)。
- 日志/DLQ/reconciliation 实现与审计须持续满足 Track E ID-only 红线。
- 合规改数后:更新本 ADR 数字表、`updated` 日期,并将 `compliance` 改为 `signed` / `accepted`;再开 W7 整改实现。
## 相关链接
- 收口计划 §7.1:[../remediation/2026-09-16-partial-deferred-completion-plan.md](../remediation/2026-09-16-partial-deferred-completion-plan.md)
- FEATURE-MATRIX D7 行:[../status/FEATURE-MATRIX.md](../status/FEATURE-MATRIX.md)
- Track E Phase 2:[../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
@@ -1,8 +1,8 @@
---
title: "修复对话刷新恢复与授权统计不一致"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-15
owner: Cursor
branch: fix/chat-history-refresh
worktree: ".worktrees/fix-chat-history-refresh"
@@ -37,7 +37,7 @@ mutex: chat
3. [x] 实现统一会话/消息授权查询及统计同集
4. [x] 实现历史 dry-run/backfill 与对账
5. [x] 完善前端恢复状态及用户隔离缓存
6. [ ] 执行全量门禁、真实 PI 刷新 E2E 和双用户负例(PG/单测已完成;PI 待 dev 容器)
6. [x] 执行全量门禁、真实 PI 闲聊刷新 E2E 和双用户负例(编制任务激活链 save 400 未纳入本轮)
## 验收标准
@@ -55,3 +55,4 @@ mutex: chat
- Audit: [../../audit/2026-09-13-chat-history-refresh-disappears.md](../../audit/2026-09-13-chat-history-refresh-disappears.md)
- Remediation: [../../remediation/2026-09-13-chat-history-refresh-remediation.md](../../remediation/2026-09-13-chat-history-refresh-remediation.md)
- Live: [../../test-reports/assets/2026-09-15-chat-history-refresh-live/live.json](../../test-reports/assets/2026-09-15-chat-history-refresh-live/live.json)(项目 6252,window=categories=2,guest 403)
@@ -1,11 +1,11 @@
---
title: "修复查询误触发写任务与任务状态刷新退化"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
owner: Codex
branch: fix/conversation-intent-state
worktree: ".worktrees/fix-conversation-intent-state"
updated: 2026-09-15
owner: Cursor
branch: docs/conversation-intent-dual-tab
worktree: "-"
mutex: intent
---
@@ -34,24 +34,26 @@ mutex: intent
3. [x] 收紧写任务动作识别并修复 busy 错误分型
4. [x] 实现任务/租约状态刷新恢复与统一提示
5. [x] 实现命名文档的服务端鉴权只读总结(“总结”不止是不写入)
6. [ ] 执行前端、Go、PG 与真实 PI 双标签页验收
6. [x] 执行前端、Go、PG 与真实 PI 双标签页验收
- [x] Go、前端、构建、dev 重建与真实 PI 只读总结
- [x] 服务端 busy 预检不创建 run,并持久化无重试状态卡
- [ ] 浏览器刷新恢复与双标签页 busy 可见性
- [x] 浏览器刷新恢复与双标签页 busy 可见性(项目 6275;禁止项目 143)
## 验收标准
- [ ] [整改方案](../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md) 全部验收项有证据
- [ ] `CHAT-INTENT-STATE` 由 FAIL 更新为 PASS
- [ ] test-report 归档并回链
- [x] [整改方案](../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md) 全部验收项有证据
- [x] `CHAT-INTENT-STATE` 由 FAIL 更新为 PASS
- [x] test-report 归档并回链
## 相关链接
- Checklist: 本任务验收标准
- Handoff: 与 `fix/chat-history-refresh` 合并前复核 `App.tsx/chatWindow.ts`
- Handoff: [../../ops/handoffs/2026-09-15-conversation-intent-dual-tab.md](../../ops/handoffs/2026-09-15-conversation-intent-dual-tab.md)
- Test report: [../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md](../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md)
## 证据 / 备注
- Audit: [../../audit/2026-09-13-conversation-intent-runtime-state.md](../../audit/2026-09-13-conversation-intent-runtime-state.md)
- Remediation: [../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md](../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md)
- 双标签活验:项目 **6275** / `sess-p6275-u10` / `run_1789452602295343365`;产物 `.doc/test-reports/assets/2026-09-15-conversation-intent-dual-tab/`
- 未改写项目 143,未删除 `sess-p143-u9` 探针
@@ -2,7 +2,7 @@
title: "Herdr Agent 角色、备援与自动审批治理"
status: done
created: 2026-09-13
updated: 2026-09-14
updated: 2026-09-13
owner: Codex
branch: feature/herdr-agent-governance
worktree: .worktrees/feature-herdr-agent-governance
@@ -11,8 +11,6 @@ mutex: ops-governance
# Herdr Agent 角色、备援与自动审批治理
> **superseded 2026-09-14**:活文档与 `scripts/herdr-agent-*.sh` 已移除;本文件仅作历史证据。见 [2026-09-14-remove-herdr-agent-settings.md](./2026-09-14-remove-herdr-agent-settings.md)。
## 目标
建立可审计的 Herdr Agent 能力分工、额度保护、故障接管和免人工工具审批入口,并明确 Herdr PI 与产品容器 PI Agent Runner 不是同一执行体。
@@ -49,10 +47,9 @@ mutex: ops-governance
## 相关链接
- Agent roster: [2026-09-13-herdr-agent-roster.md](./2026-09-13-herdr-agent-roster.md)
- Handoff: [handoffs/2026-09-13-herdr-agent-governance.md](./handoffs/2026-09-13-herdr-agent-governance.md)
- Agent roster: [../../ops/2026-09-13-herdr-agent-roster.md](../../ops/2026-09-13-herdr-agent-roster.md)
- Handoff: [../../ops/handoffs/2026-09-13-herdr-agent-governance.md](../../ops/handoffs/2026-09-13-herdr-agent-governance.md)
- Test report: 本任务文“证据 / 备注”
- 移除设定任务: [./2026-09-14-remove-herdr-agent-settings.md](./2026-09-14-remove-herdr-agent-settings.md)
## 证据 / 备注
@@ -0,0 +1,61 @@
---
title: "可靠事件与 FAV 集成 M2–M3"
status: cancelled
created: 2026-09-14
updated: 2026-09-15
owner: TBD
branch: refactor/durable-event-fav-integration
worktree: "-"
mutex: event-delivery
---
# 可靠事件与 FAV 集成 M2–M3
> 2026-09-15:本任务把 durable event 与未审计 FAV 绑成同一关闭条件,且步骤状态已与 U8/U9 后续交付漂移。任务停止使用;持久事件由 [Track E](../../ops/short-term/2026-09-15-durable-event-track-e.md) 接续,FAV subscriber 继续走独立审计,不把本条已勾选步骤视为生产 dispatcher 验收。
## 目标
完成 U5–U9,使投影、通知、RunManifest 和最终成果在多 worker、崩溃、重放和 workspace 清理后仍可恢复且不越权。
## 范围
- opaque workspace capability、lease 和 fencing。
- durable outbox、逐消费者 delivery/inbox、重试和 dead letter。
- 审计并集成 `feature/final-artifact-vault` 的适用实现。
- taskrun finalize、RunManifest 持久化、FAV coverage 和迁移 corpus。
## 非目标
- 不盲目整分支 cherry-pick FAV。
- 不启用跨授权图的 vault 读取。
- 不自动销毁 dev/main 数据。
- 不执行 U10–U12。
## 步骤
1. [x] 读取 M1 test report,确认继续 M2 的 go/no-go 已通过。
2. [x] 重新分配 Goose 序号并审计 U6/FAV schema 组合。
3. [x] 实现 U5–U6,多 app/worker 和 crash matrix 先通过。
4. [x] 逐文件审计 FAV 分支,按 U7 边界迁移合格实现。
5. [ ] 实现 U8,收敛 taskrun terminal finalize 与 RunManifest。
6. [ ] 实现 U9 的 checkpoint backfill、corpus、quarantine 和 cleanup gates。
7. [ ] 完成真实 PI、浏览器、workspace 清理、scratch recovery 和 rebuild 演练。
## 验收标准
- [ ] 多订阅者有独立 delivery,失败者不阻塞其他订阅者。
- [ ] worker crash/retry/replay 不造成重复可见副作用。
- [ ] workspace 清空后,verified 最终文档/回复仍可定位并校验。
- [ ] 授权图缺失、跨项目、tombstone、坏 digest 和 stale fencing 全部拒绝。
- [ ] clean/oldest/previous/hazard/import/reload/rollback/artifact recovery 八轨有独立证据。
- [ ] 任何数据销毁仍需完整备份、corpus、FAV coverage 和用户批准。
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Handoff: 实施时创建
- Test report: 实施后按 M2、M3 分开创建
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
## 证据 / 备注
本任务依赖 M1,不得与 M1 同时修改 docgov/docrevision 的事务主链。
@@ -1,11 +1,11 @@
---
title: "治理鉴权升级:职责-动作严格对应 + 未激活拦截 + 关闭创建直通"
status: blocked
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cline
owner: implementer_cursor
branch: fix/governance-action-level-authz
worktree: "-"
worktree: ".worktrees/fix-governance-action-level-authz"
mutex: workflow
---
@@ -52,29 +52,30 @@ mutex: workflow
## 步骤
1. [x] 评审落盘 + 决策 A–D 收敛 + 本任务登记(blocked 等待 Wave 5 收敛、mutex `workflow` 空闲)
2. [ ] G1 后端:`CheckDocTaskAccess` 动作-职责映射 + creator 例外移除(保留 none 生成触发)+ gov==nil 未激活拦截(202 契约保留);重写受影响单测
3. [ ] G2 关闭 `initial_workflow_key` 直通 + 前后端字段废弃 + E2E legacy 用例更新
4. [ ] G3 前端:chat 治理拦截自然语言提示、按钮级职责禁用、激活确认页冻结提示补强
5. [ ] G4 dev 库 81 个 planning+with_wf 异态审计分类(只读报告)
6. [ ] G5 集成验证 + 测试报告归档(新项目全链路:零治理创建→对话→配置→激活→职责动作负例)
1. [x] 评审落盘 + 决策 A–D 收敛 + 本任务登记(Wave 5 已合入本地 `dev@19f6df5`,G0 已开工)
2. [x] G1 后端:`CheckDocTaskAccess` 动作-职责映射 + creator 例外移除(保留 none 生成触发)+ gov==nil 未激活拦截(202 契约保留);重写受影响单测
3. [x] G2 关闭 `initial_workflow_key` 直通 + 前后端字段废弃 + E2E legacy 用例更新
4. [x] G3 前端:chat 治理拦截自然语言提示、按钮级职责禁用、激活确认页冻结提示补强
5. [x] G4 dev 库 planning+with_wf 异态审计分类(只读报告,现测 83 条均为测试夹具)
6. [x] G5 集成验证 + 测试报告归档(新项目全链路:零治理创建→对话→配置→激活→职责动作负例)
## 验收标准
- [ ] full 文档 API 负例:author 不可 review/approve;reviewer 不可 run/edit/submit;approver 不可 run/edit/review;creator 不可任一审批动作(view 除外)
- [ ] none 文档:创建者可触发生成;submit/review/approve 全拒
- [ ] 未激活项目 chat 输入「帮我生成立项文档」:消息正常显示、run 202 且 blocked、无小队/租约、chat 内明确治理提示文案
- [ ] `POST /projects` 带 `initial_workflow_key`:不再置 active,工作流目录仍自动挂载
- [ ] `go vet ./...`、`go test -short ./...`、`cd web && npm test && npm run build` 全绿
- [ ] 异态审计报告与测试报告归档并回链
- [x] full 文档 API 负例:author 不可 review/approve;reviewer 不可 run/edit/submit;approver 不可 run/edit/review;creator 不可任一审批动作(view 除外)
- [x] none 文档:创建者可触发生成;submit/review/approve 全拒
- [x] 未激活项目编制类输入:消息正常显示、run 202 且 blocked、无小队/租约、chat 内明确治理提示文案(页面用「请编制用户初始需求收集表」命中任务 API)
- [x] `POST /projects` 带 `initial_workflow_key`:不再置 active,工作流目录仍自动挂载
- [x] `go vet ./...`、`go test -short ./...`、`cd web && npm test && npm run build` 全绿
- [x] 异态审计报告与测试报告归档并回链
## 相关链接
- Research(评审与决策记录): [2026-09-14-mvp-governance-rules-review.md](../research/2026-09-14-mvp-governance-rules-review.md)
- Research(评审与决策记录): [2026-09-14-mvp-governance-rules-review.md](../../ops/research/2026-09-14-mvp-governance-rules-review.md)
- 前序 Remediation(已实施 Wave 1–4): [2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md](../../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md)
- 202 契约来源: [2026-09-13-workflow-access-chat-members-ui01-02.md](../../audit/2026-09-13-workflow-access-chat-members-ui01-02.md)
## 证据 / 备注
- Wave 5 占槽现状(2026-09-14 实测):`implementer_cursor` phase=e2e,worktree 存在未提交 e2e 产物;本任务排在集成槽位 queue。
- dev 库:133 active / 204 planning;81 个 planning 项目带非空 `active_workflow_key`(待 G4 审计分类)。
- Wave 5 已合入本地 `dev@19f6df5`;本任务 worktree 已从该 `dev` 创建,mutex `workflow` 进入 `in_progress`。
- G4 只读复测:141 active / 209 planning;**83** 个 planning 带非空 `active_workflow_key`,全部为 `PROJ_MGR_*`/`TEST_PROJ_*` 夹具。见 [audit](../../audit/2026-09-14-planning-with-workflow-key-anomaly.md)。
- G5 验收:[2026-09-14-governance-action-level-authz-test-report.md](../../test-reports/2026-09-14-governance-action-level-authz-test-report.md)。
@@ -0,0 +1,55 @@
---
title: "模块解耦架构与重构计划修订"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: feature/module-decoupling-remediation
worktree: .worktrees/feature/module-decoupling-remediation
mutex: architecture-docs
---
# 模块解耦架构与重构计划修订
## 目标
把模块解耦方案修订为可以分段实施、验证和回滚的架构与重构计划,补齐事务、并发互斥、授权、可靠事件、FAV、数据迁移和真实页面验收。
## 范围
- 修订模块化单体架构设计与 ADR。
- 新增详细整改与重构计划。
- 建立首个文档可靠性纵向试点及后续里程碑任务。
- 更新 CURRENT、FEATURE-MATRIX 和相关索引。
## 非目标
- 本任务不修改业务代码、数据库迁移或部署配置。
- 本任务不合并 `feature/final-artifact-vault`,只定义其集成依赖和边界。
- 本任务不执行共享容器验证,也不占用集成槽位。
## 步骤
1. [x] 对照当前源码、已接受 ADR、FAV 分支和外部权威资料复核原方案。
2. [x] 修订架构设计与 ADR。
3. [x] 编写详细整改计划、里程碑任务和验收清单。
4. [x] 更新协作 SSOT 与索引并完成文档一致性检查。
## 验收标准
- [x] 计划明确事务所有权、锁顺序、事件投递语义、授权主体和恢复边界。
- [x] 首个独立交付边界直接覆盖受控文档刷新、重启、投影缺失和授权负例。
- [x] 每个后续里程碑有依赖、文件范围、并发风险、测试矩阵、停走门和回滚边界。
- [x] FAV、迁移语料库和完整备份的职责不重叠,工作区不再承担最终成果事实源。
## 相关链接
- Checklist: [../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Handoff: 不需要;实现阶段使用两个 planned short-term 接续
- Test report: 本任务仅产出计划,不生成业务验收报告
## 证据 / 备注
- 原方案位于主工作区未跟踪文件;本任务在独立 worktree 重建并修订,未覆盖原工作区。
- `feature/final-artifact-vault` 已有实现与测试证据,但尚未合入本任务基线,实施前必须重新审计分支差异。
- 文档校验:本地相对链接、R/KTD/U ID 唯一性、Mermaid fence 和 `git diff --check` 均通过。
@@ -1,51 +0,0 @@
---
title: "移除 Herdr 工作与角色设定"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor-Auto
branch: feature/remove-herdr-agent-settings
worktree: "-"
mutex: agent-collab-docs
---
# 移除 Herdr 工作与角色设定
## 目标
从仓库活文档与脚本中移除 Herdr Agent 角色、审批、备援与派发设定,协作规范回到通用 AGENTS / worktree / mutex 流程。
## 范围
- 删除 `scripts/herdr-agent-start.sh`、`scripts/herdr-agent-dispatch.sh`
- 归档 roster / 相关 handoff
- 从 `AGENTS.md`、`PROJECT.md`、`.doc/README.md` 去掉 Herdr 专章与索引
## 非目标
- 不改写历史 audit / remediation / 已归档任务中的执行者名(如 `implementer_cursor`)作为证据
- 不卸载本机 Herdr 客户端
## 步骤
1. [x] 从 `dev` 开 `feature/remove-herdr-agent-settings` 并认领
2. [x] 移除活文档与脚本中的 Herdr 设定
3. [x] 归档 roster / handoff 并更新 CURRENT
4. [x] 提交
## 验收标准
- [x] 活文档与 `scripts/` 无 Herdr 角色/派发入口
- [x] 历史证据在 `archive/` 可追溯
## 相关链接
- Roster(已归档): [./2026-09-13-herdr-agent-roster.md](./2026-09-13-herdr-agent-roster.md)
- 既有治理归档: [./2026-09-13-herdr-agent-governance.md](./2026-09-13-herdr-agent-governance.md)
- Handoff(已归档): [./handoffs/2026-09-13-herdr-agent-governance.md](./handoffs/2026-09-13-herdr-agent-governance.md)
## 证据 / 备注
- 删除:`scripts/herdr-agent-start.sh`、`scripts/herdr-agent-dispatch.sh`
- 文档:去掉 `AGENTS.md` §6.6、`PROJECT.md` §10 Herdr 章与索引行、`.doc/README.md` roster 入口
- 归档:roster + handoff → `.doc/archive/ops/`
@@ -1,6 +1,6 @@
---
title: "workflow-plan 409 冻结态守卫 + 文档职责可选治理"
status: in_progress
status: done
created: 2026-09-14
updated: 2026-09-14
owner: implementer_cursor
@@ -37,29 +37,30 @@ mutex: workflow
1. [x] 定位项目 143 的 409 `PLAN_FROZEN` 根因并落盘 audit。
2. [x] 完成方案审核:补齐定义优先、零治理拦截、成员有效性、权限、快照清理和真实 UI 边界。
3. [ ] Wave 1:typed API error + frozen 独立只读视图 + sticky/可访问错误 + 两标签竞态恢复。
4. [ ] Wave 2:DutyMode、强制/可选任务策略、partial/成员/零治理校验、服务端规范化。
5. [ ] Wave 3:门禁、readiness、阶段/文档访问、运行时和预览统计统一。
6. [ ] Wave 4:前端逐文档“纳入人工审批”开关及 full/none/partial 交互测试。
7. [ ] Wave 5:合 dev、rebuild、真实浏览器新项目全链路;项目 143 只读回归;归档 test report。
2b. [x] 用户批准最终方案,开工登记(Wave 0)
3. [x] Wave 1:typed API error + frozen 独立只读视图 + sticky/可访问错误 + 两标签竞态恢复。
4. [x] Wave 2:DutyMode、强制/可选任务策略、partial/成员/零治理校验、服务端规范化。
5. [x] Wave 3:门禁、readiness、阶段/文档访问、运行时和预览统计统一。
6. [x] Wave 4:前端逐文档“纳入人工审批”开关及 full/none/partial 交互测试。
7. [x] Wave 5:合 dev、rebuild、真实浏览器设置页矩阵;项目 143 只读回归;归档 test report。真实 PI 生成/审批长链路未跑,见报告。
## 验收标准
- [ ] active 项目设置无编辑控件,页面显示冻结原因、工作流/阶段/职责快照和受控终止影响入口。
- [ ] 允许裁剪的非必需文档 full/none 均合法;partial 精确拒绝。
- [ ] 必需/阻断/不可裁剪文档全空被服务端拒绝。
- [ ] 保存和激活均拒绝非 active project member;预览后成员退出也 fail closed。
- [ ] 所有文档 none 时可保存草稿但不能激活。
- [ ] none 文档仍生成和入账本、项目成员只读可见、创建者可生成/编辑,但无 review/approve 且不阻塞阶段。
- [ ] disabled/none 的冻结快照、plan hash 和 assignment rows 不残留旧职责。
- [ ] 两标签陈旧保存的 409 在当前视口可见、草稿保留并转 frozen。
- [ ] 工程门禁与整改方案中的真实 UI 用例全部有证据;报告回链。
- [x] active 项目设置无编辑控件,页面显示冻结原因、工作流/阶段/职责快照和受控终止影响入口。
- [x] 允许裁剪的非必需文档 full/none 均合法;partial 精确拒绝。
- [x] 必需/阻断/不可裁剪文档全空被服务端拒绝(单测 + 定义优先)。
- [x] 保存和激活均拒绝非 active project member;预览后成员退出也 fail closed(单测)。
- [x] 所有文档 none 时可走预览拒绝「至少一份纳入人工审批」(页面 C)。
- [ ] none 文档仍生成和入账本、项目成员只读可见、创建者可生成/编辑,但无 review/approve 且不阻塞阶段(**本轮未跑真实 PI,单测已覆盖门禁/权限**)。
- [x] disabled/none 的冻结快照、plan hash 和 assignment rows 不残留旧职责(Wave 3 单测)。
- [x] 两标签陈旧保存的 409 在当前视口可见、草稿保留并转 frozen。
- [x] 设置页真实 UI 用例有截图证据并回链;生成/审批长链路另立项。
## 相关链接
- Audit: [2026-09-14-workflow-plan-409-frozen-and-optional-duties.md](../../audit/2026-09-14-workflow-plan-409-frozen-and-optional-duties.md)
- Remediation: [2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md](../../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md)
- Test report: (Wave 5 归档至 `.doc/test-reports/`)
- Test report: [2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md](../../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md)
## 证据 / 备注
@@ -67,4 +68,4 @@ mutex: workflow
- 当前 `parseError` 已读取后端 message;前端改造重点是 typed error、冻结态切换和视口内呈现。
- 当前职责校验只检查正数/互异,数据库只外键到 users;项目成员有效性必须补服务端校验。
- 当前终止实现会取消运行任务、关闭实例并退回 planning;关闭实例访问 fail closed,因此项目 143 不能作为终止测试对象。
- 开始编码前必须先把本任务从当前误置的 `feature/remove-herdr-agent-settings` 工作区迁移至声明的 `fix/workflow-plan-409-frozen-and-optional-duties` 分支/worktree,禁止污染无关分支。
- 方案已迁移至基于最新 dev 的 `fix/workflow-plan-409-frozen-and-optional-duties` 独立 worktree;用户已批准实施。
@@ -0,0 +1,63 @@
---
title: "M5/M6 组合根与传输门禁 U11–U12"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/app-composition-u11-u12
worktree: "-"
mutex: app
---
# M5/M6 组合根与传输门禁 U11–U12
## 目标
按整改计划四个子切片完成组合根、文档通知闭包迁出、stageflow 用例、UserProjectContext CAS;再收口 SSE 编码与已清零规则的 arch-check block。用户已明确授权继续 U11/U12(推翻 U10 报告的停止扩面)。
## 范围
- U11a:`internal/app` 唯一 composition root;幂等 Start/Stop
- U11b:文档 `OnOutbox` 通知迁到 `internal/app/docnotify`
- U11c:`internal/app/stageflow` 拥有 ExecuteTask / ExecuteStage
- U11d:`ContextUpdate` 版本 CAS,禁止跨模块字段级直改
- U12:SSE 中性 frame 编码;`import`/`event` 转 block;不改错误信封与 PI Runner 协议
## 非目标
- 不碰 `intent` 包行为(编码阶段 mutex 仍由 Codex 占用;合入后浏览器门另开 handoff)
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不终止或改写项目 143
- 不删除未到期的 sql_write/path 例外(U3/U5 残留)
- 不在 worktree 内 `env-service`
## 步骤
1. [x] 认领 CURRENT + 本任务
2. [x] U11a composition root
3. [x] U11b docnotify
4. [x] U11c stageflow
5. [x] U11d ContextUpdate
6. [x] U12 SSE + arch-check block_kinds
7. [x] 短测 / 目标包 race / 报告
8. [x] 占槽 `--no-ff` 合入 `dev` + 主仓 `dev rebuild`
## 验收标准
- [x] 重复 Start 不重复注册 subscriber;Stop 后再 Start worker 仍在
- [x] server 生产代码不再赋值 `OnOutbox`
- [x] HTTP 与 CLI 走同一 stageflow 用例
- [x] ContextUpdate 并发 stale version 不丢更新赢家
- [x] `arch-check --mode block` 对已清零的 import/event 通过
- [x] 测试报告回链 U11/U12
- [x] 合入后 `/health` `/ready` schema 38、`pi-agent`、新镜像 digest
## 相关链接
- Checklist: [../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- Test report: [../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md](../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md)
## 证据 / 备注
用户口头授权:「继续解耦到 U11、U12」。合入 `dev@bf59cce`。rebuild 镜像 `sha256:a8e3e940f01111c4298c67947ae9f4cd6105f13cf58134672f4a87daa19e27ab`。health/ready:`.doc/test-reports/assets/2026-09-15-app-composition-u11-u12/rebuild-health-ready.txt`。
@@ -0,0 +1,45 @@
---
title: "D4 bizdev locator 最终移除"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/bizdev-locator-removal
worktree: "-"
mutex: bizdev
---
# D4 bizdev locator 最终移除
## 目标
删除 bizdev 上 8 个 locator getter;组合根一次性 Snapshot 后由 Runtime/Server 持有端口。
## 范围
- `Pool` `DocGov` `DocRevision` `ContextManager` `CAS` `ProjectWorkflow` `FreeformDoc` `KB`
- Runtime / Server 字段
- archtest 禁止把 getter 加回去
- 调用方迁移
## 非目标
- 不删 SchemaVersion / DatabaseReady
- 不切事件 live
- 不实现 Track P
## 步骤
1. [x] Snapshot + Runtime 端口
2. [x] 迁移 server/cmd/tests
3. [x] 同批删除 8 getter
4. [x] 报告合入
## 验收标准
- [x] 生产无 8 个 getter
- [x] [S1 报告](../../test-reports/2026-09-15-bizdev-locator-removal-test-report.md)
## 相关链接
- Phase 2 D4
@@ -0,0 +1,39 @@
---
title: "D7b chat 编排剩余批次"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/chatflow-orchestration-boundary
worktree: "-"
mutex: chat
---
# D7b chat 编排剩余批次
## 目标
`internal/chat` 生产代码不再 import bizdev;任务请求走 stageflow 类型别名。
## 范围
- action_executor 去掉 Bizdev 字段
- 收紧 chat import allowlist
- 表征测试保留
## 非目标
- 不搬空测试 import
- 不把 taskrun 签名从 bizdev 别名拷成独立结构
- 不切事件 live
## 步骤
1. [x] action_executor 改 stageflow 类型
2. [x] 收紧 yaml
3. [x] 报告合入
## 验收标准
- [x] chat 生产无 bizdev import
- [x] [S4b 报告](../../test-reports/2026-09-15-chatflow-orchestration-boundary-test-report.md)
@@ -0,0 +1,59 @@
---
title: "U10 chatlog/contextasm 原地端口化"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/chatlog-contextasm-u10
worktree: "-"
mutex: chat
---
# U10 chatlog/contextasm 原地端口化
## 目标
在不物理拆包的前提下,为对话读取与 prompt 装配建立带 Principal 的消费者端口,使正文、分类、计数、导出、摘要和恢复使用同一授权可见集合。
## 范围
- `internal/app/chatflow` ChatLog / ContextAssembler 端口
- ctxmgr 表所有权不变;adapter 内做可见性过滤
- server 历史读取 handler 改走 ChatLog;忽略 query/body 中的 user_id 身份
- 会话 restore / 记忆召回只注入允许集合
- 不碰 `intent` mutex,不物理搬到 `chatlog`/`contextasm` 包
## 非目标
- U11–U12
- 整支 merge `feature/final-artifact-vault`
- 启用 `FAV_DEGRADED_READ`
- 纯搬包
## 步骤
1. [x] 核实 `chat` mutex:`fix/chat-history-refresh` 已是 `dev` 祖先;剩余真实 PI 刷新与 U10 同批收口
2. [x] 从最新 `dev` 开 `feature/chatlog-contextasm-u10` 并登记 CURRENT
3. [x] 定义 chatflow 端口与 ctxmgr adapter
4. [x] 迁移 window/day/stats/search/unread/export/digest/history/restore/memory
5. [x] 合同测试:同集计数、非 owner 403、restore/digest 不放大不可见消息
6. [x] 验收报告;最后一句 **停止扩面**
## 验收标准
- [x] 刷新前后同一授权集合的正文与分类计数一致(adapter 合同测试)
- [x] 跨用户负例 fail closed(guest 非 owner)
- [x] context assembly / digest 只使用允许集合
- [x] 真实 PI 闲聊刷新 E2E 证据(与对话刷新活验同批;编制任务链 save 400 未纳入停走)
- [x] 未物理拆包;DTO 转换为 0,拆包收益不成立
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- Chat refresh: [../../test-reports/2026-09-13-chat-history-refresh-test-report.md](../../test-reports/2026-09-13-chat-history-refresh-test-report.md)
- Test report: [../../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md](../../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md)
## 证据 / 备注
U9 最后一句 **继续 U10** 只批准进入 M4。禁止 U11–U12。`intent` 认领仍 `in_progress`,本单元不改意图分类。活验项目 6252 / `sess-p6252-u10`;产物 `.doc/test-reports/assets/2026-09-15-chat-history-refresh-live/live.json`。未占槽 rebuild。
@@ -0,0 +1,59 @@
---
title: "M3 U9 存量回填、migration corpus 与数据生命周期"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/dataset-lifecycle-u9
worktree: "-"
mutex: dataset
---
# M3 U9 存量回填、migration corpus 与数据生命周期
## 目标
只保留可解释的演示/回归数据,并持续验证旧数据迁移、重载和受控恢复。backfill 可暂停续跑,异常进 quarantine;八条轨道可重复;销毁默认 fail closed。
## 范围
- dataset registry(pinned / demo / regression / migration_baseline / ephemeral / quarantine)
- checkpoint 分批 backfill:只枚举 snapshot、approved/commit event、completed chat turn
- SKIP LOCKED 多 worker;禁止扫描 workspace
- 销毁门禁:FAV coverage + 完整备份 restore + corpus + 精确 manifest + 双人批准 + quarantine 观察窗
- restore 拒绝共享 env DSN;只允许 scratch
- 八轨:clean / oldest-supported / previous / hazard / import / reload / rollback / artifact recovery
## 非目标
- U10–U12;不碰 `chat` / `intent` mutex
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不修改历史 Goose;不销毁 `agent_system_dev/test/main`
- 不终止或改写项目 143;worktree 内禁止 `env-service`
## 步骤
1. [x] CURRENT 认领 `mutex=dataset`;从 `dev` 开 `feature/dataset-lifecycle-u9`
2. [x] Goose 00038 + `module-boundaries.yaml`
3. [x] `internal/artifactvault/backfill.go` + `internal/dataset` + `cmd/dataset`
4. [x] 硬化 `scripts/restore-system-db-drill.sh`
5. [x] 隔离库 + 八轨 + 目标包 `-race` + 占槽 rebuild
6. [x] 验收报告;最后一句 **继续 U10**
## 验收标准
- [x] backfill 中断、重复、并发新终态时分母/分子可复算且不重复 artifact
- [x] legacy-v0 / 旧 schema / 高 ID / projection fork / 缺 snapshot → quarantine 或升级
- [x] restore 拒绝共享 DSN、错误 storage identity、篡改 manifest、缺权限
- [x] coverage / backup / corpus 任一失败阻止 destroy
- [x] 批准 dataset 导入后关系、SHA、sequence 可复算
## 相关链接
- Checklist: `.doc/ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md`
- Plan: `.doc/remediation/2026-09-14-module-decoupling-refactor-plan.md` U9
- Test report: `.doc/test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md`
## 证据 / 备注
见验收报告。Goose 00038。dev schema 38。
@@ -0,0 +1,46 @@
---
title: "D6 doccontent canonical 边界"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/doccontent-canonical-boundary
worktree: "-"
mutex: docgov
---
# D6 doccontent canonical 边界
## 目标
Markdown canonicalization 与 SHA 抽到 `internal/doccontent`;生产 `docgov` 不再 import `docrevision`。
## 范围
- `internal/doccontent`
- `docgov/lease.go` 改走 doccontent
- `docrevision` 薄封装保持旧调用方
- golden + wrapper 对账
## 非目标
- 不改 hash 语义
- 不碰项目 143 数据
- 不删 `docrevision.CanonicalizeMarkdown` 导出(兼容)
## 步骤
1. [x] 分支与 CURRENT
2. [x] 提取模块与切断 docgov→docrevision
3. [x] golden / arch-check
4. [x] 报告并合入
## 验收标准
- [x] 生产 docgov 不 import docrevision
- [x] project143 hard-break golden 仍过
- [x] [S3 报告](../../test-reports/2026-09-15-doccontent-canonical-boundary-test-report.md)
## 相关链接
- Phase 2: [../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
@@ -0,0 +1,53 @@
---
title: "Track E 持久事件交付"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-e2-hook-guard
worktree: "-"
mutex: events
---
# Track E 持久事件交付
## 目标
按 E0A→E0B→E1A→E1B→E1C 完成 notify、workflow advance、projection 的 PG 持久交付,并用授权页面刷新/重启恢复证据关闭 `DOC-RELIABILITY-PILOT` 的事件部分。
## 范围
- E0A:生产入口/UoW、event contract、runtime registry、历史数据与 sequence 门。
- E0B:PG dispatcher、attempt audit、独立进程、并发与故障注入。
- E1A/B/C:三个消费者独立 shadow、switch、rollback 和真实恢复验收。
## 非目标
- FAV consumer 激活、bizdev/chat/intent 结构重构、HTTP 错误信封、PI typed result。
- 删除或覆盖历史事件;在 E0A 通过前启动 dispatcher。
## 步骤
1. [x] E0A 单独建 short-term/分支,dispatcher 保持 off。
2. [x] E0A 报告通过后再认领 E0B。
3. [x] 依次交付 E1A notify、E1B workflow advance、E1C projection;每步独立 go/no-go。
4. [x] E2 兼容守卫:live 时闭包停写;hook API 待 live 窗口后删除。
5. [x] 同步 test report、CURRENT、FEATURE-MATRIX、gap-matrix、[复盘](../research/2026-09-15-track-e-retrospective.md)。
## 验收标准
- [ ] 满足 [Phase 2 Track E Definition of Done](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md#track-e-definition-of-done)(共享 live 与删除 hook API 仍开放)。
- [x] 每个波次拥有独立 owner、mutex、分支、报告和回滚证据。
- [x] 未把计划、MemoryBus、stub 或日志冒充生产 PG/browser/restart 验收。
## 相关链接
- Checklist: 按每个波次建立
- Audit: [Phase 2 方案审阅](../../audit/2026-09-15-module-decoupling-phase2-plan-review.md)
- Remediation: [Phase 2 修订计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Test report: [E2](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
- 复盘: [./research/2026-09-15-track-e-retrospective.md](../research/2026-09-15-track-e-retrospective.md)
## 证据 / 备注
本条只建立执行入口,不代表已批准 E0A 或已认领 mutex。实施前必须按 CURRENT 检查冲突并从当时最新 dev 建分支。
@@ -0,0 +1,49 @@
---
title: "E0A 事件生产、契约与历史数据门"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-production-scope-contract
worktree: "-"
mutex: events
---
# E0A 事件生产、契约与历史数据门
## 目标
组合根注入唯一 `docflow.Commands`;candidate-ready、downstream-impact、approved 三条链在同一 UoW 写 envelope/delivery;缺 env/project fail closed;FAV 不写入;allowlist 与 runtime registry parity;历史 inventory 分类且不删数据;dispatcher 保持 off。
## 范围
- D3 生产入口与作用域
- D10 既有 event allowlist 补全与 registry parity
- D11 inventory、sequence ADR、repair/quarantine/expire、replay 骨架、service principal 表
## 非目标
- 不实现/启动 PG dispatcher
- 不激活 FAV,不写 staging/artifact/publication
- 不删除历史事件
- 不开始 Track S/P
## 步骤
1. [x] 从最新 `dev` 开 `fix/event-production-scope-contract` 并登记 CURRENT
2. [x] 唯一 Commands、三条链同 UoW、FAV 隔离
3. [x] allowlist + registry parity + 动态 FAV 注册失败
4. [x] inventory/repair/replay/principal additive schema 与用例
5. [x] 连续性模型 ADR;gap blocking 关闭
6. [x] 隔离库 PG 证据与 test-report
## 验收标准
- [x] 见 [E0A 测试报告](../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md)
## 相关链接
- Remediation: [../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md](../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md)
- ADR: [../../adr/2026-09-15-event-consumer-checkpoint.md](../../adr/2026-09-15-event-consumer-checkpoint.md)
@@ -0,0 +1,43 @@
---
title: "E0B PG dispatcher 基座"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/events-dispatcher-pg
worktree: "-"
mutex: events
---
# E0B PG dispatcher 基座
## 目标
原子 lease/attempt/heartbeat/fencing、独立 `cmd/events`、默认 mode=off、1/2/4 worker 与崩溃注入。
## 范围
- Goose 00040、ClaimLeases、cmd/events、compose events 服务
## 非目标
- 不把任何 consumer 切 live
- 不激活 FAV
- 不删除历史
## 步骤
1. [x] 从 E0A 后 `dev` 开 `feature/events-dispatcher-pg`
2. [x] additive schema + atomic claim
3. [x] worker/heartbeat/fencing/shadow scan
4. [x] cmd/events + compose
5. [x] 隔离库 PG + race + 报告
## 验收标准
- [x] [E0B 测试报告](../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md](../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md)
@@ -0,0 +1,48 @@
---
title: "E1A notify shadow 与切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-notify-cutover
worktree: "-"
mutex: events
---
# E1A notify shadow 与切换
## 目标
notify 消费者具备 shadow 覆盖门、live 唯一可见结果与显式 rollback;生产集群保持 off。
## 范围
- Goose 00041、`EmitVisibleDocumentEvent`、`docnotify.EventConsumer`、Handler 与 Ack 同事务
- cmd/events 注册 notify(mode=off 时不 claim)
## 非目标
- 不把共享环境 notify 切 live
- 不删除 OnOutbox 闭包
- 不激活 FAV / workflow advance / projection live
## 步骤
1. [x] 从 E0B 后 `dev` 开 `fix/event-notify-cutover`
2. [x] additive `source_event_id` 与可见结果唯一索引
3. [x] shadow dry-run + live 同事务 ack
4. [x] fixture N=30、quarantine、correlation、rollback
5. [x] 隔离库 PG + race + 报告
## 验收标准
- [x] [E1A 测试报告](../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md](../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md)
## 证据 / 备注
隔离库 `agent_rel_e1a` 测完已 DROP。共享 `event_consumer_modes.notify=off`。
@@ -0,0 +1,44 @@
---
title: "E1B workflow advance shadow 与切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-workflow-advance
worktree: "-"
mutex: events
---
# E1B workflow advance shadow 与切换
## 目标
workflow_advance 具备 shadow/live/rollback;并发或重放批准只产生一次阶段可推进可见结果。生产集群保持 off。
## 范围
- Goose 00042、`docadvance.EventConsumer`、`EmitVisibleStageReady`、MarkDocTaskApproved 走 fenced tx
- cmd/events 注册 workflow_advance
## 非目标
- 不把共享环境 workflow_advance 切 live
- 不删除 AddOnApprovedHook
- 不激活 FAV / projection live
## 步骤
1. [x] 从 E1A 后 `dev` 开 `fix/event-workflow-advance`
2. [x] additive source_event_id on stage_advance_requests
3. [x] consumer 重读文档并同事务 ack
4. [x] 隔离库并发/重放/quarantine/rollback
5. [x] 报告
## 验收标准
- [x] [E1B 测试报告](../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md](../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md)
@@ -0,0 +1,41 @@
---
title: "E1C projection no-replace"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-projection-cutover
worktree: "-"
mutex: events
---
# E1C projection no-replace
## 目标
projection 消费者幂等只前进;共享集群保持 off。
## 范围
- Goose 00043、ProjectHeadNoReplace、docproject.EventConsumer
## 非目标
- 不把共享 projection 切 live
- 不激活 FAV
- 不删除闭包
## 步骤
1. [x] 分支与 additive schema
2. [x] no-replace SQL + consumer
3. [x] 隔离库 + race + worker 重启
4. [x] 报告
## 验收标准
- [x] [E1C 测试报告](../../test-reports/2026-09-15-event-e1c-projection-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
@@ -0,0 +1,48 @@
---
title: "E2 闭包 live 停写与 Track E 复盘"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-e2-hook-guard
worktree: "-"
mutex: events
---
# E2 闭包 live 停写与 Track E 复盘
## 目标
在 dispatcher 仍默认 off 时保留 `OnOutbox` / `AddOnApprovedHook` 接线,使对应消费者切 `live` 后闭包立即停写,避免双写;并写 Track E 复盘。不关闭 `DOC-RELIABILITY-PILOT`。
## 范围
- `events.WriterLive`
- `docnotify.Subscriber.SkipWrite`
- Runtime / 遗留 HTTP hook 在 `workflow_advance` live 时 no-op
- 复盘与 E2 测试报告
## 非目标
- 不删除 hook API(须等 live 发布窗口)
- 不把共享 notify/advance/projection 切 live
- 不激活 FAV
- 不关闭 Track E 发布 blocker
## 步骤
1. [x] 从最新 `dev` 开 `fix/event-e2-hook-guard` 并登记 CURRENT
2. [x] WriterLive + 闭包守卫 + 单测
3. [x] 隔离库 mode 矩阵
4. [x] 复盘与报告
## 验收标准
- [x] live 时闭包不写;off/shadow 仍写
- [x] 生产仍保留 Bind / AddOnApprovedHook(mode=off 必需)
- [x] [E2 报告](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- 复盘: [../research/2026-09-15-track-e-retrospective.md](../research/2026-09-15-track-e-retrospective.md)
@@ -0,0 +1,54 @@
---
title: "共享环境事件消费者 live 切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/event-shared-live-cutover
worktree: "-"
mutex: events
---
# 共享环境事件消费者 live 切换
## 目标
在共享 `agent-dev` 上按 notify → workflow_advance → projection 完成 shadow → drain → live → 回滚演练,再删除生产 hook 注册。
## 范围
- `scripts/event-consumer-mode.sh` + `cmd/eventmode`
- 共享 `agent_system_dev` inventory / quarantine
- 逐消费者 live 与授权页纵切(项目 6275;143 只读)
## 非目标
- FAV live
- test/main 环境
- 编辑 Phase 2 计划原文
- Track P(独立波次)
## 步骤
1. [x] L0 受控 SetMode 与 inventory
2. [x] L1 notify
3. [x] L2 workflow_advance
4. [x] L3 projection + 授权页
5. [x] L4 删除生产 hook 注册
## 验收标准
- [x] fav / test / main 切模式失败
- [x] 每消费者独立 live 报告
- [x] 生产代码无 `OnOutbox =` / `AddOnApprovedHook(`
## 相关链接
- Long-term: [.doc/archive/ops/2026-09-15-event-shared-live-cutover.md](../../archive/ops/2026-09-15-event-shared-live-cutover.md)
- Notify: [.doc/test-reports/2026-09-15-event-notify-shared-live-test-report.md](../../test-reports/2026-09-15-event-notify-shared-live-test-report.md)
- Advance: [.doc/test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md](../../test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md)
- Projection: [.doc/test-reports/2026-09-15-event-projection-shared-live-test-report.md](../../test-reports/2026-09-15-event-projection-shared-live-test-report.md)
## 证据 / 备注
已合入 `dev@39dc68d`。生产 hook 注册已删;方法本体保留一个窗口。
@@ -0,0 +1,34 @@
---
title: "共享环境事件消费者 live 切换"
status: done
created: 2026-09-15
updated: 2026-09-15
---
# 共享环境事件消费者 live 切换
## 动机
Track E 已在隔离库证明 notify / workflow_advance / projection 的 exactly-one visible outcome 与 E2 闭包守卫。共享集群仍为 `off`,HTTP 闭包仍是唯一真实写者。未 live 则不能删 hook API,也不能关闭 `DOC-RELIABILITY-PILOT`。
## 成功标准
- 按消费者独立:shadow coverage → drain → 原子 live;E2 守卫使对应闭包停写。
- 授权页刷新/重启正文与 head digest 一致;未授权不泄露。
- 回滚开关保留一个发布窗口后再删 `OnOutbox` / `AddOnApprovedHook`。
- FAV 保持 disabled;项目 143 只读。
## 依赖
- E0A–E2 已合入;隔离库报告已归档。
- 需要明确授权:动共享 `agent-dev` 消费者 mode。
## 暂不启动原因
已完成共享 live 与生产去注册。方法本体保留一个窗口。
## 相关链接
- [Track E 复盘](../research/2026-09-15-track-e-retrospective.md)
- [E2 报告](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
- [gap-matrix DOC-RELIABILITY-PILOT](../../remediation/gap-matrix.md)
@@ -0,0 +1,39 @@
---
title: "D7a intent 与 bizdev 解绑"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/intent-bizdev-boundary
worktree: "-"
mutex: intent
---
# D7a intent 与 bizdev 解绑
## 目标
intent 只依赖成熟度词汇叶子包,不再 import bizdev。
## 范围
- `internal/maturity`
- intent 生产与表征测试
- bizdev 类型别名保持兼容
## 非目标
- 不改识别规则
- 不迁 coordinator / chatflow(D5/D7b)
## 步骤
1. [x] 叶子包与别名
2. [x] intent 切断 bizdev
3. [x] 表征测试与 arch-check
4. [x] 报告
## 验收标准
- [x] intent 生产 import 无 bizdev
- [x] [S4a 报告](../../test-reports/2026-09-15-intent-bizdev-boundary-test-report.md)
@@ -0,0 +1,50 @@
---
title: "清点旁支并收口已合入本地分支"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: chore/leftover-branch-cleanup
worktree: "-"
mutex: ops
---
# 清点旁支并收口已合入本地分支
## 目标
删除 tip 已是 `dev` 祖先的本地旁支与对应 worktree;不整支合入会回归或触红线的 5 条未合并分支;主仓跑一次 short 冒烟。
## 范围
- 拆 7 个已合入 worktree
- `git branch -d` 已 `--merged` 旁支
- CURRENT 记录故意保留的 FAV / herdr-removal / diagnosis / data-root / `dev-old-linear`
- vet / short / arch-check / health+ready
## 非目标
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不合入 `feature/remove-herdr-agent-settings`(会回归 U12 arch-check、删 Herdr 脚本)
- 不合入 `fix/project143-controlled-content-404-diagnosis`(会回退审计关闭结果)
- 不合入 `fix/dev-runtime-data-root-guard`、`dev-old-linear`
- 不 push;不删 `origin/*`;不从 worktree 起 docker;不碰项目 143
## 步骤
1. [x] 占 CURRENT 集成槽
2. [x] 拆已合入 worktree
3. [x] 删除已 merged 本地旁支
4. [x] 冒烟并写报告
5. [x] 槽位 idle + archive
## 验收标准
- [x] 已合入旁支 worktree 只剩 FAV 错名目录
- [x] `--merged dev` 旁支已删(31 条)
- [x] 5 条未合入分支仍在
- [x] 测试报告 + health/ready schema 38
## 相关链接
- Test report: [../../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md](../../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md)
@@ -0,0 +1,57 @@
---
title: "审阅并修订模块解耦 Phase 2 方案"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Codex
branch: docs/module-decoupling-ipc-assessment
worktree: "-"
mutex: architecture-docs
---
# 审阅并修订模块解耦 Phase 2 方案
## 目标
以当前代码、migration、ADR 和 Phase 1 计划为证据,修正调研与 Phase 2 方案,并补齐高并发、互斥、权限、历史数据、灰度和回滚设计;不实施业务代码。
## 范围
- 复核调研报告与原 Phase 2 方案的事实、依赖和完成边界。
- 将事件可靠性、结构解耦、HTTP/PI 协议拆成独立轨道。
- 补充 PG 状态机、fencing、幂等、顺序、连接预算、权限、replay、脱敏、迁移和 browser/restart 验收。
- 同步 audit、remediation、CURRENT、FEATURE-MATRIX 与 gap-matrix。
## 非目标
- 不实现 dispatcher、consumer、migration 或协议代码。
- 不合并、部署、重启容器、删除数据或审计/合入 FAV 分支。
- 不把文档完成写成系统能力完成。
## 步骤
1. [x] 完成仓库启动链和上位 ADR/Phase 1 证据复核。
2. [x] 完成一致性、可行性、范围、安全、产品与对抗视角审阅。
3. [x] 修正调研报告中的 PG、依赖方向、allowlist 与进程边界事实。
4. [x] 重写 Phase 2 为 Track E/S/P,补齐详细实施和停走门。
5. [x] 同步索引与状态 SSOT。
6. [x] 执行文档链接、diff、冲突标记和术语检查。
## 验收标准
- [x] 调研不再把 SELECT-only Claim、MemoryBus 测试或 allowlist 基线写成生产闭环。
- [x] Track E 可独立关闭,FAV/D8/D9 不阻塞。
- [x] 方案明确 at-least-once 与 exactly-one visible outcome、最终提交点 fencing、集群级切换和授权模型。
- [x] 历史脏数据只分类/隔离/修复,不授权删除。
- [x] 文档状态一致且没有实施或发布声明。
## 相关链接
- Audit: [方案审阅](../../audit/2026-09-15-module-decoupling-phase2-plan-review.md)
- Remediation: [Phase 2 修订计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Research: [IPC/RPC 现状评估](../../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)
- Test report: 不适用(文档审阅,无业务实现)
## 证据 / 备注
本任务沿用用户已创建的 `docs/module-decoupling-ipc-assessment` 分支。该分支名早于当前 `feature/*|fix/*` 规则;未改写或重命名用户分支。起点提交为 `a3392e3` 与 `5cef856`,本轮未获授权 commit/push。
@@ -0,0 +1,47 @@
---
title: "PI typed-result-v1 P1–P4"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/pi-typed-result
worktree: "-"
mutex: pi-agent
---
# PI typed-result-v1 P1–P4
## 目标
Runner additive 输出 `result_v1`;Go typed-first fail-closed;共享 dev 真实 PI 双轨对账;去掉 stderr/legacy 明文错误。
## 范围
- `configs/schemas/pi-run-result-v1.json`
- `deploy/pi-agent/result-v1.mjs` + runner 接线
- `internal/agent` parser / 负例 / `RUN_PI_E2E=1` 双轨
## 非目标
- 不把 member 正文搬进 `result_v1`(仍走 `patches[]`)
- 不改 HTTP 状态码;不启用 FAV;不写项目 143
## 步骤
1. [x] Schema + Runner additive
2. [x] Go typed-first + handshake
3. [x] 真实 PI 双轨
4. [x] 删 stderr/隐式 legacy;报告与合入
## 验收标准
- [x] typed-present-invalid 永不 fallback
- [x] handshake downgrade 负例 PASS
- [x] `RUN_PI_E2E=1` 成功/失败/取消/超时对账
- [x] test-report 归档
## 相关链接
- Test report: `.doc/test-reports/2026-09-15-pi-typed-result-v1-test-report.md`
- Remediation: `.doc/remediation/2026-09-15-pi-typed-result-v1-remediation.md`
- P0: `.doc/ops/research/2026-09-15-pi-typed-result-p0-matrix.md`
@@ -0,0 +1,45 @@
---
title: "晋升 dev → test 并部署测试环境"
status: in_progress
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/promote-dev-to-test-2026-09-15
worktree: "-"
mutex: infra
---
# 晋升 dev → test 并部署测试环境
## 目标
把已完成的 Phase 2 代码从本地 `dev` 合入 `test`,重建并冒烟测试环境,供人工实测。不实施多意图 HITL。
## 范围
- `test` 分支 `--no-ff` 合入当前 `dev`
- `./scripts/env-service.sh test rebuild`
- test 库 notify/workflow_advance/projection 切 live(L4 去 hook 后 off 会停写);FAV 保持 off
## 非目标
- 不实施多意图 HITL U1+
- 不合入 `main`、不启用 FAV
- 不写项目 143
## 步骤
1. [x] 确认 Phase 2 已在本地 `dev`
2. [ ] occupy 集成槽并合入 `test`
3. [ ] rebuild 测试服务
4. [ ] health/ready + schema 冒烟
## 验收标准
- [ ] `:8081` health/ready PASS
- [ ] events `:8089` health PASS
- [ ] FAV 仍 off
## 相关链接
- CURRENT: `.doc/ops/CURRENT.md`
@@ -0,0 +1,40 @@
---
title: "D5 stageflow 类型归属与 D7b chatflow 首批"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/stageflow-type-ownership
worktree: "-"
mutex: stageflow
---
# D5 stageflow 类型归属与 D7b chatflow 首批
## 目标
coordinator 生产代码不再 import bizdev;task/stage 请求走 stageflow 类型;chatflow assembler 改用 maturity。
## 范围
- stageflow 类型别名与状态常量
- coordinator 构造改为 StageTaskRunner + ContextServices
- chatflow 去掉 bizdev import
## 非目标
- 不复制行为方法成 DTO(身份别名 + token golden)
- 不删除 bizdev 八个 getter(D4)
- 不搬空 chat 包
## 步骤
1. [x] 类型边界与 coordinator 解绑
2. [x] chatflow assembler
3. [x] 表征测试与 arch-check
4. [x] 报告
## 验收标准
- [x] coordinator 生产 import 无 bizdev
- [x] [S2/S4b 报告](../../test-reports/2026-09-15-stageflow-type-ownership-test-report.md)
@@ -0,0 +1,60 @@
---
title: "M3 U8 TaskRun 终态与 RunManifest"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/taskrun-runmanifest
worktree: "-"
mutex: taskrun
---
# M3 U8 TaskRun 终态与 RunManifest
## 目标
TaskRun 终态在同一 UoW 内 CAS 写入唯一合法状态,并持久化类型化 RunManifest;重复 finalize / cancel race / SSE 断线不得产生第二条助手消息或第二份 artifact;workspace 清理仅在 verified receipt 之后。
## 范围
- Goose 00037 `task_run_manifests` + `finalizing` 状态
- `internal/taskrun` RunManifest 规范字节 / SHA / members
- `taskrun.Commands.Finalize` 唯一 finalize 命令;server 变薄
- `ctxmgr.FinalizeAssistantTaskMessage` 仅此写路径加入 UoW
- workspace 清理门禁;`ReadArtifact` 替代 `Join(workDir, "output.md")`
- BackendRef 服务端 policy;隔离库并发测试;占槽 rebuild;U8 报告
## 非目标
- U9 backfill / corpus / 八轨 / 销毁
- M4–M6;整支 merge FAV;启用 `FAV_DEGRADED_READ`
- 终止或改写项目 143
- 动 `chat` / `intent` 刷新任务
- worktree 内 `env-service`
## 步骤
1. [x] CURRENT 认领 `mutex=taskrun`;从本地 `dev` 开 `feature/taskrun-runmanifest`
2. [x] Goose 00037 Up+Down;`module-boundaries.yaml` 表属主
3. [x] Finalize 同 UoW:CAS + 助手 turn + manifest + envelope/staging
4. [x] 清理门禁与 server 去路径、BackendRef
5. [x] 隔离库双 pool / race;占槽 rebuild;报告最后一句只能「继续 U9」或「停止扩面」
## 验收标准
- [x] 重复 finalize:同一 status、同一 manifest SHA、助手消息 1 条、envelope/staging 不加倍
- [x] finalize ∥ cancel:恰好一个合法终态
- [x] SSE `done` 不出现在 TX 失败路径;commit 前断线重试不第二 turn
- [x] 无 verified receipt 则 cleanup FAIL;有 receipt 则可清 workspace 且 staging 仍能取出原 SHA
- [x] 报告最后一句为「继续 U9」或「停止扩面」;U9 清单项保持未勾
## 相关链接
- Checklist: [2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Remediation: [2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- 权威停走门: [2026-09-14-document-reliability-m2-test-report.md](../../test-reports/2026-09-14-document-reliability-m2-test-report.md)(继续 M3)
- Test report: [2026-09-15-taskrun-runmanifest-u8-test-report.md](../../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md)
## 证据 / 备注
未签字前禁止 U9–U12。合入 + 容器测占集成槽,主仓 `./scripts/env-service.sh dev rebuild`。
@@ -0,0 +1,31 @@
---
title: "Track P 协议实施(信封与 typed-result)"
status: done
created: 2026-09-15
updated: 2026-09-15
---
# Track P 协议实施(信封与 typed-result)
## 动机
H0/P0 盘点后独立实施 HTTP 信封与 PI typed-result,不回退事件 live。
## 成功标准
已关闭:
- [HTTP 信封 H1–H3](../../test-reports/2026-09-15-http-error-envelope-h1-h3-test-report.md)
- [PI typed-result P1–P4](../../test-reports/2026-09-15-pi-typed-result-v1-test-report.md)
## 依赖
mutex `server`/`web`/`pi-agent` 已释放。
## 暂不启动原因
已完成。
## 相关链接
- [Phase 2 计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
@@ -0,0 +1,55 @@
---
title: "PU6 语义摘要 shadow(SEMANTIC_SUMMARY_SHADOW)"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/pu6-semantic-summary
worktree: ".worktrees/feature-pu6-semantic-summary"
mutex: chat
---
# PU6 语义摘要 shadow
## 目标
在授权可见消息集合上落地 `SEMANTIC_SUMMARY_SHADOW`(默认 off):shadow 语义摘要、失败回 deterministic 并标注 freshness;不启用 REPLACE。
## 范围
- `internal/ctxmgr/summarizer.go` + semantic shadow
- `internal/app/chatflow/` 授权过滤入口
- `internal/server/chat_digest_api.go` 出站 freshness/shadow 字段
- 单元/表征测试;测试报告
## 非目标
- 不启用 `SEMANTIC_SUMMARY_REPLACE`
- 不合入 `dev`
- 不改 plan 文件
## 步骤
1. [x] 从 `dev` 开分支 / worktree 并认领
2. [x] flags + 无工具语义摘要器 + rolling summary shadow
3. [x] chatflow 授权路径 + digest API
4. [x] 测试与报告
5. [x] 渐进提交并 push
## 验收标准
- [x] flag off 行为与基线一致
- [x] shadow on:仅 authorized 消息;失败保留 deterministic + freshness
- [x] injection 不能提权;REPLACE 路径未接线
- [x] 测试报告归档
## 相关链接
- Contract: `../long-term/2026-09-16-pu6-semantic-summary-contract.md`
- Test report: `../../test-reports/2026-09-16-pu6-semantic-summary-test-report.md`
## 证据 / 备注
- 分支:`feature/pu6-semantic-summary`(worktree)
- 测试:`go test -short ./internal/ctxmgr/ ./internal/app/chatflow/ ./internal/server/` PASS
@@ -0,0 +1,30 @@
---
title: "Wave 2 PU4 真实 PI 补证(U8 + full/none)"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/wave2-real-pi-evidence
worktree: "-"
mutex: intent-plan
---
# Wave 2 PU4 真实 PI 补证(U8 + full/none)
## 目标
补齐 multi-intent U8 与工作流 full/none 的真实 PI / PG / 跨用户 / 恢复证据。
## 步骤
1. [x] 认领 + 占槽 rebuild
2. [x] U8 live 证据路径
3. [x] full/none 混合长链 live 测试
4. [x] 报告 + 矩阵更新 + 释放槽位
## 验收标准
- [x] U8 真实 PI PASS
- [x] full 跨用户审批 PASS
- [x] none 免审批且不阻塞 PASS
- [x] 报告归档 `.doc/test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md`
@@ -0,0 +1,53 @@
---
title: "修复 CreateOrGetDocument 可选职责 0→NULL FK"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: fix/docgov-optional-duty-null-fk
worktree: "-"
mutex: docgov
---
# 修复 CreateOrGetDocument 可选职责 0→NULL FK
## 目标
无 reviewer/approver 职责时创建文档账本成功,不再因 `reviewer_id=0` FK 失败并被标成 `INTERNAL_ERROR`。
## 范围
- `internal/docgov/engine.go`:`nullIfZero` 写入 author/reviewer/approver
- `internal/stream/classify.go`:`DOC_LEDGER_ERROR` 分型
- 回归测试 + audit/test-report
## 非目标
- 不强制项目配置 reviewer
- 不改前端 flushSync / 虚拟列表
- 不改项目 6417 存量数据(代码修好后重试即可)
## 步骤
1. [x] CreateOrGetDocument 0→NULL
2. [x] ClassifyError `DOC_LEDGER_ERROR`
3. [x] 单元/回归测试(`-short` 已绿)
4. [x] 占集成槽位 rebuild + 6417 复测(`run_1789625396102207018`,`doc_proj6417_intake` NULL FK)
5. [x] test-report 归档;合入 `dev`
## 验收标准
- [x] `go test -short ./internal/docgov/... ./internal/stream/...` PASS
- [x] 仅-author 项目 `CreateOrGetDocument` / 任务发起不再 `INTERNAL_ERROR`;`reviewer_id IS NULL`
- [x] 项目 6417 账本创建成功(full 职责路径未被本修复改动)
## 相关链接
- Audit: [../../audit/2026-09-17-docgov-optional-duty-null-fk.md](../../audit/2026-09-17-docgov-optional-duty-null-fk.md)
- Test report: [../../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md](../../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md)
## 证据 / 备注
- 失败 run:`run_1789622069585300787`
- 验证 run:`run_1789625396102207018` / `doc_proj6417_intake` author=9 reviewer/approver NULL
- merge:`e488d10 merge: fix/docgov-optional-duty-null-fk`
@@ -0,0 +1,55 @@
---
title: "修复 KB 宿主机错误口令与静默离线降级"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: fix/kb-host-auth-layered-load
worktree: "-"
mutex: infra
---
# 修复 KB 宿主机错误口令与静默离线降级
## 目标
消除 `config.Load("")` 只读 `configs/.env.dev`、忽略根 `.env` 的 `KB_DB_PASSWORD` 导致的错误默认口令与静默离线;E2E/nightly 默认 fail-closed。
## 范围
- `internal/config` 分层加载 + 宿主机 DNS 归一化 + 空默认口令
- `internal/kb` 脱敏日志、`Online()`、`KB_REQUIRE_ONLINE` / `KB_ALLOW_OFFLINE`
- `/health` 增加 `kb_ready`
- PI E2E helper 与 `scripts/run-nightly-real-pi.sh` 预检
- env 模板与验收报告
## 非目标
- 不改 KB 数据内容 / 法规迁移
- 不把真实口令写入 git 跟踪的 `configs/.env.*`
- 不把容器内 DNS 改成 localhost
## 步骤
1. [x] 分层 Load + 默认口令清空
2. [x] NormalizeKBHostForRuntime
3. [x] kb 客户端脱敏 + RequireOnline(EnsureOnline;不 Fatalf)
4. [x] health `kb_ready` + E2E/nightly 门禁
5. [x] 合入 `dev` 冒烟(rebuild + `/health` `kb_ready=true`)
## 验收标准
- [x] `config.Load("")` 分层合并后口令来自根 `.env`(单测临时文件 + live 布尔校验)
- [x] 宿主机 `shuimu-kb-shared` → `127.0.0.1`;容器内保留 compose DNS
- [x] 错口令/空口令离线且日志无明文密码;`KB_ALLOW_OFFLINE=1` 可降级
- [x] 合 `dev` 后 short 测 PASS;dev rebuild 后 `kb_ready=true`,日志 `online=true dsn=...:***@shuimu-kb-shared...`,无 `shared_kb_secret_pass`
## 相关链接
- Test report: `.doc/test-reports/2026-09-17-kb-host-auth-layered-load-test-report.md`
- Plan: 修复 KB 连接降级
## 证据 / 备注
根因:`Load` 优先单文件 `configs/.env.dev`(故意省略 `KB_DB_PASSWORD`),保留错误默认 `shared_kb_secret_pass`;Compose 本已分层,宿主机 `go test` 未对齐。
合入后容器日志:`[kb] online=true dsn=postgres://regkb:***@shuimu-kb-shared:5432/regulations?sslmode=disable`;health `kb_ready=true`。
@@ -1,9 +1,9 @@
---
title: "对话刷新恢复整改 Checklist"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
related_task: "../short-term/2026-09-13-chat-history-refresh-remediation.md"
updated: 2026-09-15
related_task: "../2026-09-13-chat-history-refresh-remediation.md"
---
# 对话刷新恢复整改 Checklist
@@ -36,10 +36,10 @@ related_task: "../short-term/2026-09-13-chat-history-refresh-remediation.md"
## Wave 5 — 验收
- [x] `go test -short ./...` — 证据:本机执行输出
- [ ] 真实 PI 刷新 E2E(需 dev 容器 + pi-agent)— 证据:待 test-report 补录
- [x] 真实 PI 刷新 E2E(需 dev 容器 + pi-agent)— 证据:`.doc/test-reports/assets/2026-09-15-chat-history-refresh-live/live.json`(项目 6252 闲聊刷新同集 + guest 403;编制任务链未通过)
- [x] 测试报告归档 — 证据:`.doc/test-reports/2026-09-13-chat-history-refresh-test-report.md`
## 完成定义
- [ ] 全部勾选且有证据链接
- [ ] gap-matrix `CHAT-HISTORY-REFRESH` → PASS
- [x] 全部勾选且有证据链接
- [x] gap-matrix `CHAT-HISTORY-REFRESH` → PASS
@@ -0,0 +1,49 @@
---
title: "FEATURE-MATRIX 深度测试 + 晋升部署 test"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/matrix-deep-test-promote-test
worktree: "-"
mutex: infra
---
# FEATURE-MATRIX 深度测试 + 晋升部署 test
## 目标
按 FEATURE-MATRIX 对已实现模块做分层深度回归,通过后将本地 `dev` 晋升到 `test`(`rc-v1.0.0-beta.2`)并 rebuild/冒烟 `:8081`。
## 范围
- Wave 1:vet/short/arch/npm/bundle + 模块定向 + 隔离治理 PG
- Wave 2:dev `:8080` live API 抽检
- Wave 3:真实 PI 抽样(失败再升格三链)
- Wave 4:`dev` → `test` + rebuild + smoke
- Wave 5:测试报告 + SSOT
## 非目标
- 不实现纯软件项目自举
- 不默认 28min 三工作流 PI;不合 `main`;不改项目 143;不启用 FAV
## 步骤
1. [x] 认领占槽
2. [x] 自动化深度回归
3. [x] live `:8080` 抽检
4. [x] PI 抽样
5. [x] 晋升 test 并冒烟
6. [x] 报告与归档
## 验收标准
- [x] 矩阵已实现行均有 PASS 证据
- [x] `:8081` health/ready schema=47;`test-env-smoke.sh` PASS
- [x] tag `rc-v1.0.0-beta.2`;报告归档
## 相关链接
- Plan: matrix_deep_test_promote
- FEATURE-MATRIX / CURRENT / gap-matrix
@@ -0,0 +1,47 @@
---
title: "发布门禁闭环 → production_ready"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: docs/production-ready-flip
worktree: "-"
mutex: ci
---
# 发布门禁闭环 → production_ready
## 目标
按 gap-matrix 发布门禁勾选 B1–B4,对齐环境 schema 后翻 `production_ready=yes`。
## 范围
- B1 CI TEST_DATABASE_URL + 治理 PG(已完成)
- B2 真实 PI 三工作流 E2E(已完成)
- B3 对话全链路恢复(已完成)
- B4 版本冲突/终止 preview(已完成)
- B5 SSOT 翻旗 + main schema 对齐(已完成)
## 非目标
- 多意图 U9–U12、软件项目自举、FAV、完整 PI change-report 叙事
## 步骤
1. [x] B1 BUG-08
2. [x] B2 PI E2E
3. [x] B3 chat refresh + restart
4. [x] B4 conflict + termination-preview + envelope unwrap
5. [x] B5 merge/smoke、main rebuild 迁库、翻旗
## 验收标准
- [x] gap 门禁四框可勾(含对话与前端)
- [x] FEATURE-MATRIX / gap / CURRENT `production_ready: yes`
- [x] main/dev/test health schema_version=47
## 相关链接
- Test reports: `2026-09-16-ci-governance-pg-bug08`、`pi-three-workflow-e2e`、`chat-refresh-gate`、`frontend-gate-b4`
- gap-matrix / FEATURE-MATRIX / CURRENT
@@ -0,0 +1,48 @@
---
title: "Wave 2B PU5B:nightly PI + promotion receipt"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/wave2b-nightly-promotion-receipt
worktree: "-"
mutex: ci
---
# Wave 2B PU5B:nightly PI + promotion receipt
## 目标
落地夜间真实 PI 回归入口、不可变 promotion receipt,以及晋升脚本强制校验;same-image digest 晋升本轮仅做到 same-commit + digest 可追溯。
## 范围
- promotion receipt 写/校验 + waiver
- nightly-real-pi.yml + run-nightly-real-pi.sh
- git-workflow-helper / promote-to-test / release-to-main 门禁钩子
- 报告与 FEATURE-MATRIX / remediation 同步
## 非目标
- compose 按 digest pull 的同镜像晋升流水线
- Playwright 双标签;升 MULTI_INTENT tier
## 步骤
1. [x] 认领 + 开分支
2. [x] receipt 写/校验脚本
3. [x] nightly workflow + 本机脚本
4. [x] 晋升钩子
5. [x] 报告 + 合入 dev
## 验收标准
- [x] 缺 secret/runner → infra_fail,晋升拒绝
- [x] product_fail → 晋升拒绝
- [x] pass receipt → 晋升可过;无 receipt → 非零退出
- [x] 报告归档(`.doc/test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md`)
## 相关链接
- Remediation PU5B: `../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md`
- Test report: `../../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md`
@@ -0,0 +1,41 @@
---
title: "Wave 2C:同 digest 镜像晋升"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/wave2c-same-image-digest
worktree: "-"
mutex: infra
---
# Wave 2C:同 digest 镜像晋升
## 目标
候选 commit 一次构建;test/main 按 receipt digests 启动;pinned 禁止 rebuild 另造镜像。
## 范围
- candidate-images-build/apply
- compose + env-service pinned
- promote/release 钩子 + receipt --require-digests
- nightly digests 对齐
## 非目标
- 远程 registry;升 tier;Playwright;U8 quality_failed(Phase 3)
## 步骤
1. [x] 认领 + 开分支
2. [x] build/apply + check digests
3. [x] compose/env-service/hooks
4. [x] nightly align
5. [x] 报告合入
## 验收标准
- [x] PASS receipt 含 digests;apply 后 ID 一致
- [x] pinned rebuild 不换 ID(env-service 拒绝 --build)
- [x] 缺 digest 拒绝晋升
@@ -0,0 +1,26 @@
---
title: "Wave 3 PU6–PU8 go/no-go 文档任务"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/wave3-pu6-pu8-go-no-go
worktree: "-"
mutex: architecture-docs
---
# Wave 3 PU6–PU8 go/no-go 文档任务
## 目标
完成 PU6–PU8 产品 go/no-go 记录与获批后契约;未获批不实施。
## 步骤
1. [x] 调研 go/no-go 总文
2. [x] PU6–PU8 / U9–U12 契约
3. [x] 勾 DoD + 矩阵/CURRENT 同步 + 合入
## 相关链接
- Research: `../research/2026-09-16-wave3-pu6-pu8-go-no-go.md`
@@ -76,7 +76,7 @@ severity: high
## 关联整改
- Remediation: [../remediation/2026-09-13-chat-history-refresh-remediation.md](../remediation/2026-09-13-chat-history-refresh-remediation.md)
- Short-term: [../ops/short-term/2026-09-13-chat-history-refresh-remediation.md](../ops/short-term/2026-09-13-chat-history-refresh-remediation.md)
- Short-term: [../archive/ops/2026-09-13-chat-history-refresh-remediation.md](../archive/ops/2026-09-13-chat-history-refresh-remediation.md)
- Gap matrix: [../remediation/gap-matrix.md](../remediation/gap-matrix.md)
## 证据
+33 -21
View File
@@ -1,20 +1,22 @@
---
title: "arch-check Wave 0 基线"
title: "arch-check U1 可重放基线"
status: done
created: 2026-09-14
updated: 2026-09-14
severity: medium
---
# arch-check Wave 0 基线
# arch-check U1 可重放基线
## 现象
模块边界此前只能靠人工约定。Wave 0 用当前 `go list` 生成 import allowlist,并用目标属主扫描表名与路径字面量,得到可重复的 warn 基线。
Wave 0 的全仓 grep 会把 Goose、`*_test.go` 和路径字面量一视同仁,无法作为生产写者门禁。U1 用 `go list` + AST/正则拆成四类规则,并给每条既有债写明 owner、原因、截止里程碑和到期日。
## 根因分析
`document_records`、`output.md`、`data/dev` 被多个包直接提及,与「单一写者 / 路径属主」目标不一致。这些不是本轮回归,而是 Wave 1+ 的收口对象。
- `document_records` 的生产写者不止 `docgov`:`docrevision.projectRootPointersTX` 与 `docduty` 职责槽位仍直接 `UPDATE`。
- `output.md` / `data/dev` / `workspaces/` 仍被 agent、bizdev、coordinator、docgov、docrevision、server、storage 用 `filepath.Join`、字符串字面量或间接常量构造。
- Goose 与测试夹具大量出现同样表名,不能算生产写者债。
## 严重度
@@ -24,29 +26,39 @@ severity: medium
- ADR: [../adr/2026-09-14-modular-monolith-decoupling.md](../adr/2026-09-14-modular-monolith-decoupling.md)
- 设计: [../system-design/2026-09-14-module-decoupling-architecture.md](../system-design/2026-09-14-module-decoupling-architecture.md)
- 任务: [../ops/short-term/2026-09-14-module-decoupling-wave0.md](../ops/short-term/2026-09-14-module-decoupling-wave0.md)
- 边界: [../system-design/module-boundaries.yaml](../system-design/module-boundaries.yaml)
- 任务: [../ops/short-term/2026-09-14-document-reliability-pilot.md](../ops/short-term/2026-09-14-document-reliability-pilot.md)
## 证据
命令:`./scripts/arch-check.sh --mode warn`(2026-09-14,本工作区)
- import 相对基线 allowlist:**0** 条新边
- 目标属主扫描:**21** 条 warn(按包去重)
命令(2026-09-14,`refactor/document-reliability-pilot` worktree):
```
WARN R5 table document_records mentioned in authz, workspace, docduty, server, bizdev, docrevision
WARN R5 table freeform_documents mentioned in docrevision
WARN R5 table task_runs mentioned in server, projectinstance, docgov
WARN R6 path output.md mentioned in coordinator, server, bizdev, docgov, docrevision, agent
WARN R6 path data/dev mentioned in coordinator, server, bizdev, storage
WARN R6 path workspaces/ mentioned in server
violations=21
arch-check warn: recorded 21 baseline findings
./scripts/arch-check.sh --mode warn
go test ./internal/archtest -count=1
```
`--mode block` 会因这 21 条失败,故 **不得**在 warn 期满前把脚本挂进集成冒烟。
可重放计数(只含生产 Go;Goose/`*_test.go` 不计):
## 后续
| 规则 | 计数 | 处理 |
|------|------|------|
| import | 0 | 相对 2026-09-14 production `go list` allowlist,无新边 |
| sql_write | 5 | 例外,U3/U8 到期 |
| path | 17 | 例外,U4/U5/U8 到期 |
| event | 0 | `OnOutbox` 生产者属主为 docrevision,server/notification 为消费者 |
- Wave 1 起按属主清零上表,再把对应规则转 block
- 本轮不占集成槽、不 `env-service` rebuild
验证:
- `deploy/postgres/goose` 与 `*_test.go` 出现 `document_records` 不报生产写者违规。
- 迷你仓 `internal/server/rogue_write.go` 新增 `UPDATE document_records` 时 `go test ./internal/archtest` 失败并指出文件。
- `filepath.Join`、字符串拼接、间接常量构造 `output.md` 均可检出。
- 无到期日例外、过期例外立即 block。
- `baseline_counts` 锁定现有计数,只能下降。
`--mode block` 在例外清零前会失败,不得挂进集成冒烟。
## 开放问题
- U3 收口 `document_records` / `freeform_documents` 跨属主写。
- U4/U5 收口 handler 与投影路径构造。
- U8 收口 `task_runs` 终止写与 finalize `output.md`。
@@ -0,0 +1,98 @@
---
title: "模块解耦方案复核"
status: done
created: 2026-09-14
updated: 2026-09-14
scope: architecture, transactions, concurrency, authorization, events, artifact recovery
---
# 模块解耦方案复核
## 结论
模块化单体、单一写者、瘦传输层和应用编排层的方向成立,但原方案不能直接批准 Wave 1–6。
原方案把事务、事件、工作区和最终成果四条边界拆开设计,可能在包依赖减少后产生新的数据不一致、跨租户授权旁路和不可恢复投影。
整改应先打通一条真实文档纵向链路,再按证据决定是否扩展到 chat、squad、SSE 和 PI Runner。
## 已确认问题
### A1. 单一写者拆分会破坏跨表原子性
`internal/docrevision/pg_mutate.go` 当前在一个事务中写版本账本并投影 `document_records` 根指针。
原方案要求 docrevision 改调 docgov/freedoc 普通端口,却没有定义跨属主事务或命令所有权。
如果各端口各自提交,会出现版本账本、正文 head、治理状态和 outbox 部分成功。
### A2. 现有 outbox 不是可泛化的可靠事件总线
`internal/docrevision/service.go` 在版本事务完成后调用 `OnOutbox`,并忽略回调错误。
`outbox_events` 只有全局 `published_at`,没有逐消费者确认、租约、重试、死信和幂等收件箱。
拟议的 `Publish(ctx, event)` 也没有事务作用域,不能兑现“与业务同事务”。
### A3. 工作区仍被当成事实源
原 `WorkspaceRef` 暴露 `Root`、`OutputDir` 和 `ManifestPath`,`OutputContract` 继续接受裸路径。
这不能从类型上阻止路径拼接、跨工作区访问或链接逃逸。
docquery 若继续在运行时从 `output.md` 选择正文,会保留导致历史 404/409 的 split-brain 根因。
### A4. 最终成果保险库未进入模块边界
`feature/final-artifact-vault` 已设计并实现终态归档、只读降级和 scratch 恢复,但尚未合入当前 dev 基线。
原解耦方案没有为 artifactvault 分配端口、事件、授权和恢复边界,后续容易由 docquery 或 CLI 重建旁路。
### A5. contracts 可能成为新的高扇入万能包
原方案把内部接口、HTTP DTO、事件、错误码和共享枚举集中到一个包,并要求所有 DTO 版本化。
这会把语义耦合搬到 `contracts` 和 `app`,使普通内部调整承担不必要的 ADR 成本。
### A6. 并发控制只覆盖了进程内互斥
当前代码同时存在 `sync.Mutex`、行锁、乐观 ETag、唯一幂等键和 `pg_advisory_xact_lock`。
原方案没有规定哪些锁用于正确性、锁顺序、超时、重试边界和多副本行为。
进程内锁只能优化单实例竞争,不能作为跨实例正确性条件。
### A7. 授权主体和后台执行边界缺失
“在应用层入口统一授权”没有定义可信 Principal 的来源,也没有覆盖 CLI、事件订阅者、恢复工具和后台任务。
若端口继续接受调用方填写的 `UserID`、`ProjectID` 或裸 `DocRef`,可能形成 confused-deputy 或跨项目访问。
### A8. 横向 Wave 缺少最小可交付边界
原方案先物理搬包,再接口化,最后才处理单写者和事件语义。
这会重复修改高扇出代码,并在真正验证边界之前冻结大量无消费者契约。
错误信封和 PI Runner 协议与文档一致性解耦没有直接依赖,不应阻塞核心路线。
### A9. 迁移与回滚承诺不成立
可靠多消费者 outbox、FAV 集成和必要的状态字段需要增量 migration,因此“数据零迁移”不成立。
后续里程碑会依赖前序契约,不能任意独立 revert;只能按 expand/migrate/contract 阶段和兼容窗口回退。
### A10. 架构检查范围会产生误报
表名和路径字面量合法存在于 Goose migration、fixture、测试和运维脚本。
R5/R6 应检查生产运行时的越权写入和路径解析,不应以全仓 grep 的零出现作为完成条件。
## 外部规则核对
- PostgreSQL 行锁和事务级 advisory lock 会在事务结束时释放,适合短期业务互斥;session 级 advisory lock 不跟随回滚,不用于本方案的业务锁。[PostgreSQL explicit locking](https://www.postgresql.org/docs/17/explicit-locking.html)
- `SKIP LOCKED` 适合多消费者队列表,不适合作为普通一致性查询语义。[PostgreSQL SELECT](https://www.postgresql.org/docs/current/sql-select.html)
- Serializable 或 deadlock 重试必须重跑完整事务,包括决定 SQL 和参数的业务逻辑。[PostgreSQL serialization failure handling](https://www.postgresql.org/docs/16/mvcc-serialization-failure-handling.html)
- 授权必须默认拒绝,并在每次请求或后台动作上重新校验,不能信任客户端传入的身份和资源归属。[OWASP Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html)
## 整改结论
1. 暂停批准原 Wave 1–6,保留只读架构基线。
2. 先定义事务、锁、授权、事件和持久成果契约。
3. 首个交付只覆盖受控文档读取与终态提交纵向链。
4. FAV、迁移语料和完整备份作为三个互补层接入。
5. 通过真实页面刷新、重启、并发、权限和恢复停走门后,再批准其他模块拆分。
## 证据入口
- `internal/docrevision/pg_mutate.go`
- `internal/docrevision/service.go`
- `internal/workspace/resolver.go`
- `internal/docduty/revoke.go`
- `internal/taskrun/manager.go`
- `deploy/postgres/goose/00018_2026-09-12-outbox-notifications-stage-advance.sql`
- `.doc/adr/2026-09-13-document-version-boundary.md`
- `feature/final-artifact-vault` 分支中的 FAV ADR、整改方案与测试报告
@@ -0,0 +1,56 @@
---
title: "planning 项目残留 active_workflow_key 异态审计"
status: done
created: 2026-09-14
updated: 2026-09-14
severity: low
---
# planning 项目残留 active_workflow_key 异态审计
## 现象
dev 库存在 `lifecycle_status='planning' AND active_workflow_key <> ''` 行。评审时记为 81;本轮只读复测为 **83**(相对评审 +2)。这些行看起来像「已选工作流但未走设置激活」。
## 根因分析
关闭 `initial_workflow_key` 直通前,`CreateProject` 在键非空时会写 `lifecycle=active` + `ActiveWorkflowKey`。本异态是 **planning 却带 key**,更符合自动化测试夹具成对插入(`PROJ_MGR_*` / `TEST_PROJ_*`),而不是真实用户走创建旁路后的 active 项目。
本轮 **未** `UPDATE`/`DELETE`。
## 严重度
`low`
创建旁路已在 `fix/governance-action-level-authz` 关闭。存量 83 行全部无 live 实例、无创建人,不影响项目 143,也不阻塞 G1 鉴权矩阵。
## 关联整改
- Short-term: [2026-09-14-governance-action-level-authz](../archive/ops/2026-09-14-governance-action-level-authz.md)
- Research: [2026-09-14-mvp-governance-rules-review](../ops/research/2026-09-14-mvp-governance-rules-review.md)
## 证据
只读查询(`shuimu-context-pg-dev` / `agent_system_dev`,2026-09-14):
| 指标 | 数量 |
|------|------|
| `lifecycle=active` | 141 |
| `lifecycle=planning` | 209 |
| `planning AND active_workflow_key <> ''` | **83** |
分类(禁止改库,仅标注):
| 分类 | 数量 | 判定 |
|------|------|------|
| 测试夹具 | **83** | `code` 为 `PROJ_MGR_YYYYMMDDHHMMSS`(名「智能微创内窥镜」)或 `TEST_PROJ_*`(名「测试内窥镜系统」);`active_workflow_key=main`;`workflow_selection_version=1`;`creator_user_id` 空;`has_live_instance=false`;时间戳成对出现于 2026-09-12~09-14 |
| 历史直通(真实用户创建旁路) | **0** | 无非夹具命名、无创建人、无 live 实例的业务项目 |
| 不明 | **0** | — |
样本 id(完整 83 行均属上表夹具模式,不逐条展开):61–62、122–128、6015–6021、6160–6161、6192/6195。项目 **143 不在此集合**。
相对评审 81 的 +2:`6192` / `6195`,创建于 2026-09-14 07:26 UTC,仍是同一对夹具命名。
## 开放问题
- 是否在后续专项清理夹具行(需单独任务与备份,不在本治理鉴权波次)。
@@ -0,0 +1,85 @@
---
title: "前端 mock 交付物污染真实项目:幻影受控文档伪造终审已生效态与法定职责"
status: done
created: 2026-09-15
updated: 2026-09-15
severity: critical
---
# 前端 mock 交付物污染真实项目:幻影受控文档伪造终审已生效态与法定职责
## 现象
用户在 **test 环境**(127.0.0.1:8081)新建测试项目「测试项目」(test 库 `projects.id=1`,唯一项目),工作台立即显示 11 份「受控文档」,其中包括与该项目毫无关系的:
- 《4K超高清荧光内窥镜系统立项与可行性报告》
- 《微创外科内窥镜全球竞品技术与临床深度调研报告》
- 神经外科双频超声吸引(NeuroPulse)系列
- CUSA 超声手术吸引系统系列
这些文档:
1. 显示**伪造的生命周期状态**(`reviewing` / `approved`——`DeckDrawer.tsx` 将 `approved` 渲染为「**终审已生效**」),即用户所称「生效区」出现从未经过任何 docgov 生命周期流转的"已生效"文档;
2. 带有**伪造的法定职责人**(author 张工 / reviewer 李主管 / approver 王总监——均非真实用户);
3. 带有伪造版本号(V1.0)、伪造更新时间、伪造正文全文;
4. 在项目成员视角按真实受控文档参与 RBAC 可见性过滤与工作流槽位合并,**与真实服务端文档混排**。
而 test 库 `document_records` 为 **0 行**——服务端受控文档台账完全为空,这 11 份文档**全部来自前端硬编码 mock 数据**。
## 根因分析
### 1. mock 交付物硬编码绑定 projectId 1/2/3/5201/6001–6010
`web/src/App.tsx:267` `INITIAL_DELIVERABLES` 硬编码 7 份 mock 交付物 `projectId: 1`(doc-001~004、doc-shared-001、doc-private-001/002);`P2_INITIAL`(projectId 2)、`CUSA_INITIAL_DELIVERABLES`(projectId 3)、`NEUROPULSE`(5201)、`TEN_PROJECTS`(6001+)同理。`ALL_INITIAL_DELIVERABLES` 聚合后作为 `loadDeliverables()` 的默认值(App.tsx:621),并经 `saveDeliverables` **写入 localStorage 持久化**。
### 2. 项目过滤按数字 ID 匹配,新建项目与 mock 项目 ID 撞车
`App.tsx:1014`:`currentProjectDeliverables = deliverables.filter(doc => doc.projectId === currentProjectId)`。
- test 库为全新库,用户新建的第一个项目得到 `id=1` → 与 mock 的 `projectId: 1` **精确撞车**,7 份幻影文档全部"归属"该项目;
- 新建项目时 `createProjectTemplateDeliverables`(App.tsx:3844)再克隆 7 份模板骨架(`doc-p1-*`,`lifecycleState: 'template'`,合规)→ 7 mock + 4~7 模板/私有,构成用户看到的 11 份;
- **dev 库同样中招**:`agent_system_dev.projects` 存在真实项目 id 1–8(智能微创内窥镜/测试内窥镜系统等),id 1/2/3 的真实项目同样被 mock 文档污染。
### 3. mock 正文与 mock 用户/权限无环境门控,已进生产构建产物
- `mockDocuments.ts` 无任何 `import.meta.env` 门控;`App.tsx` 中 `MOCK_USERS`(含伪造 `projectPermissions: {doc-001: approver...}`)作为 `loadUsers()` 默认值与 `currentUser` 初始身份兜底(App.tsx:610/617);
- **构建产物已验证污染**:`web/dist/assets/index-DogUjae5.js` 中 grep 命中「4K超高清荧光」字符串——dev/test/main 三环境共用同一前端构建,main 生产环境同样受影响。
### 4. 既有防线只挡"正文请求",不挡"清单展示"
团队已知悉 legacy mock ID(`revisionToolbarMount.ts:24 isLegacyLocalMockDocId`:`doc-\d{3}` / `doc-shared-*` / `doc-private-*` / `doc-cusa-*`),并禁止它们发起 content/revision 请求(`controlledDocHydrate.ts:shouldLoadControlledContent` 排除)。但这只防住了「幻影文档冒充服务端正文」,**没有防住幻影文档出现在交付物清单、生命周期徽章(终审已生效)、职责栏与项目文档统计中**——用户看到的正是后者。
### 5. 服务端权威清单未做前端对账
`GET /api/v1/projects/{id}/documents`(`docgov/project_docs.go`,`WHERE project_id=$1 AND task_key<>''`,服务端已正确按项目隔离)返回空数组时,`mergeWorkflowDocumentsFromServer`(`deliverableSync.ts:41`)**直接 `return prev`,不删除本地多余项**——本地幻影文档无任何下架机制。
## 严重度
`critical`:
1. **治理完整性破坏**:空项目展示「终审已生效」受控文档 + 三级法定职责人,在医疗器械合规语境下(ISO 13485 / 21 CFR Part 11 电子记录可靠性)构成"记录失实";
2. **跨环境广泛影响**:dev 真实项目 id 1–8、test 新建项目、main 生产同构建产物全部受影响;
3. **权限视图失真**:伪造职责人/权限映射混入 RBAC 过滤链,用户对"谁可审批什么"产生错误认知;
4. 既有防线(isLegacyLocalMockDocId)证明团队已两次踩坑(本审计为同域第三类症状),说明 mock 数据保留策略系统性不足。
## 关联整改
- Remediation: [2026-09-15-mock-deliverables-pollution-remediation.md](../remediation/2026-09-15-mock-deliverables-pollution-remediation.md)
## 证据
- test 库(`shuimu-system-pg-test`,127.0.0.1:5434):`projects` 仅 id=1「测试项目」(通用医疗器械);`document_records` 0 行;全库 87 张业务表除 projects/users/auth_sessions/chat_sessions/project_workflows 外全部为空
- dev 库(`shuimu-context-pg-dev`,127.0.0.1:5433):真实项目 id 1–8(智能微创内窥镜 / 测试内窥镜系统)→ 与 mock projectId 1/2/3 撞车
- `web/src/App.tsx:267-498`(INITIAL_DELIVERABLES/P2/CUSA/ALL_INITIAL_DELIVERABLES)、`621`(loadDeliverables)、`1014`(projectId 过滤)、`3844`(新建克隆模板)
- `web/src/data/mockDocuments.ts:32-505`(mock 文档全文与伪造 lifecycleState/职责人)、`web/src/data/seeds/neuropulseSeed.json`(projectId 5201)、`tenProjectsSeed.json`(6001–6010)
- `web/dist/assets/index-DogUjae5.js`:grep 命中「4K超高清荧光」(生产构建含 mock 数据)
- `web/src/features/documentRevision/revisionToolbarMount.ts:24-32`(isLegacyLocalMockDocId 既有防线)
- `web/src/lib/deliverableSync.ts:41-45`(serverDocs 空时不回收本地项)
- `web/src/components/doc/DeckDrawer.tsx:87-103`(approved → 「终审已生效」渲染)
- `web/src/api/projectDocuments.ts:46-58`(服务端清单 API,服务端隔离正确)
## 开放问题
- mock 数据的保留意图(demo 演示模式?)需要在整改方案中决策:彻底移除 vs 环境门控(`import.meta.env.MODE` / 构建期注入 `VITE_ENABLE_DEMO_SEEDS`)
- localStorage 中已被 `saveDeliverables` 持久化的 mock 项,需要一次性迁移清理(对齐既有 `dropRecordKeys`/ControlledInvalidationPlan 机制)
- main 环境是否已有真实用户看过幻影文档(`document_access_audit` 为 0 行,无服务端读取痕迹,风险主要在前端展示层)
@@ -0,0 +1,111 @@
---
title: "模块解耦 Phase 2 方案审阅"
status: done
created: 2026-09-15
updated: 2026-09-15
severity: high
---
# 模块解耦 Phase 2 方案审阅
## 结论
模块化单体、消费者端口、组合根和持久事件的方向成立,但原 Phase 2 方案不能直接进入实施。它把事件可靠性、结构整理和两个外部协议绑成一个完成目标,并基于数项不成立的代码事实设计切换门。修订版已把 Track E(持久事件)、Track S(结构解耦)、Track P(外部协议)拆开,Track E 必须先完成生产者与历史数据门,再启动 dispatcher。
## 高优先级发现
### A1. PG delivery 尚未形成生产闭环
`internal/events/pg.go` 的 `ClaimIDs` 只做 SELECT + `FOR UPDATE SKIP LOCKED`,没有在同一事务写 lease owner/token/until;也没有 PG ack/fail/retry/dead-letter 的完整生产实现。`internal/events/dispatcher_test.go` 验证的是 MemoryBus。原方案把这些能力写成“已有”,会低估 D1 的 migration、状态机和故障测试范围。
整改:D1 增加 additive migration、原子 lease、heartbeat、fenced side-effect/ack、retry/dead/quarantine、不可变 attempt 表和独立 `cmd/events` 进程。
### A2. “恰好一次投递”不可由当前算法保证
副作用成功后、ack 前崩溃会导致重放。Fencing 若只拦 ack,也拦不住租约过期的旧 worker 提交副作用。
整改:契约改为 at-least-once delivery + exactly-one visible outcome。Token 进入 consumer command 和最终提交点;数据库副作用与 inbox/token 校验同事务,projection 使用 expected version、digest 和单调 marker。
### A3. 原 shadow 定义会双写,且按天零差异可空跑通过
旧方案同时写闭包和消费者结果,却又称“不产生可见变化”;两者矛盾。三天 dev 流量也可能没有低频文档事件或失败分支。
整改:闭包是 shadow 期间唯一真实写者。消费者只计算 normalized intended outcome 并写 reconciliation。停走门同时要求预登记样本、分支覆盖、最短时间和零未解释 diff;生产入口未证明出事件前不开始计时。
### A4. 文档事件源与作用域尚不可信
部分生产 HTTP 路径临时构造 `docflow.Commands`,没有稳定注入 EventSink/UoW。`Environment:"dev"`、`ProjectID:0` 和 FAV stage project 0 会使跨环境/项目 delivery 失真。
整改:E0A 先由组合根注入唯一命令对象;领域变化、envelope、delivery 同一 UoW;缺 project/env fail closed;旧数据先 inventory。
### A5. AggregateVersion 不能直接当无缺口事件序号
当前只在部分领域转换发事件。历史文档首次事件可能从较高版本开始;按缺号等待会永久阻塞。
整改:D11 在独立 event sequence 与 consumer checkpoint/bootstrap 中二选一,审计现有 aggregate/version 唯一约束并迁移。未决前禁止开启 gap blocking。
### A6. docgov/docrevision 不是双向 import
生产方向为 `docgov → docrevision`,用途集中在 canonical Markdown 与 SHA helper。原方案“提升无行为类型到 vocabulary”不能承载 canonicalization 行为。
整改:D6 改为提取内聚 `doccontent` 行为模块和 golden vectors;D6 可独立执行,不依赖 bizdev/stageflow。
### A7. event allowlist 已存在
`module-boundaries.yaml` 已有 `event_producers`/`event_consumers`。问题是映射稀疏,且运行时注册没有与静态清单做 parity 检查。
整改:D10 提升到 E0A,补 payload schema/version、enabled state 与 registry parity;FAV 标记 disabled。
### A8. FAV、HTTP、PI 不应阻塞核心
FAV 分支未完成独立审计。ADR 已把 HTTP 错误信封和 PI result protocol 定义为独立工作。把三者放入 Track E DoD 会延迟最有价值的刷新恢复闭环。
整改:Track E 只激活 notify、workflow advance、projection。FAV 只预留 disabled 契约;D8/D9 分别另建 remediation。
### A9. Replay、后台权限与日志脱敏不足
延迟事件不能沿用历史用户权限;当前 replay 校验不足以支持生产 apply。Raw payload/error 进入 dead-letter 或 reconciliation 会泄露正文、路径或凭证。
整改:每 consumer 独立 service principal,处理时重读资源和当前权限。Replay 采用 capability + 精确范围 + dry-run digest/apply exact digest + 审计;多项目/批量 apply 两人批准。日志只存 ID/digest/typed code/sanitized summary。
### A10. 滚动切换缺少集群级权威写者
删除新版本 hook 不会阻止旧实例继续执行。若 dispatcher 同时 live,滚动部署会双写。
整改:`off|shadow|live` 使用带 revision 的集群级状态;先部署兼容代码、drain 全部旧实例、记录 backlog 水位,再原子切换。回滚先暂停 claim并核对 receipt/backlog。
### A11. Locator 门禁原文过宽
全局禁止 `*pgxpool.Pool`/`pgx.Tx` 会拦截组合根注入与登记表属主的合法 UoW unwrap。
整改:只禁止领域/用例 API 暴露、返回、转发 pool/tx;明确允许 app/cmd 构造注入和登记属主 unwrap。
## 范围修订
| 轨道 | 内容 | 关闭条件 |
|---|---|---|
| Track E | D1/D2/D3/D10/D11 | PG + browser + restart + auth/replay 证据完成后独立关闭 |
| Track S | D4/D5/D6/D7a/D7b | 各单元独立 go/no-go 与报告 |
| Track P | HTTP error、PI typed result | 各自独立 remediation,不阻塞 Track E/S |
## 关联整改
- [修订后的 Phase 2 计划](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- [修订后的现状调研](../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)
## 审阅方法与证据
- 代码证据:`internal/events/pg.go`、`bus.go`、`dispatcher_test.go`、`replay.go`、`internal/app/docflow/commands.go`、`internal/docgov/lease.go`、`internal/bizdev/service.go`。
- Schema:`deploy/postgres/goose/00035_2026-09-14-durable-event-delivery.sql`。
- 边界:`.doc/system-design/module-boundaries.yaml`。
- 上位决策:模块化单体 ADR 与 Phase 1 U6。
- 审阅视角:一致性、可行性、范围、安全、产品价值、对抗失败预演;外部 reviewer 的有效结论仅用于交叉验证,不替代仓库证据。
## 开放问题
以下问题必须由 E0A 的代码/数据审计回答,不能在计划阶段猜测:
- projection consumer 的最终 owner 与 no-replace 提交接口。
- event sequence 或 checkpoint/bootstrap 的选择及迁移成本。
- 每类事件前 7 天基线流量、shadow 样本 N 和 worker 连接预算。
- 现存错误 scope/schema delivery 的数量和 repair/quarantine/expire 分类。
@@ -0,0 +1,122 @@
---
title: "多意图与 HITL 方案复核"
status: done
created: 2026-09-15
updated: 2026-09-15
severity: high
---
# 多意图与 HITL 方案复核
## 结论
提案方向合理,且可复用现有 IntentFrameV2、ActionRegistry、PendingExpectation、交互卡和可靠事件骨架。但初稿不能直接实施:它会让 LLM backend 进入 `internal/intent`、把跨模块执行继续堆入 coordinator,并以不足以抵御多实例竞态的 PlanID+StepID 代替状态机和动作幂等,存在解耦回退、越权和双执行风险。
已按审阅结果重写[系统设计](../system-design/2026-09-15-multi-intent-hitl-plan.md)与[任务总览](../ops/short-term/2026-09-15-multi-intent-hitl.md)。本次仅修改文档,没有实施业务代码。
## 已确认问题
### P1:原 LLM 接线破坏 intent 纯模块边界
初稿要求在 `internal/intent/segmenter.go` 经既有 `agent.Backend` 分段;当前边界只允许 `intent -> maturity`。照此实施必然新增 intent 到 agent/coordinator 的依赖。
**整改:** 规则分段留在 intent;可选 LLM 仅作为 `app/intentflow` 外围 adapter,返回不可信分段建议,每段重新走确定性识别、安全扫描和 ActionRegistry。任何阶段都禁止 intent import agent、PG、storage 或 coordinator。
### P1:计划持久化缺少权威状态机与并发协议
初稿两表只有宽泛 status/payload,PlanID+StepID 只是标识,不能防重复确认、确认/取消/过期竞态、两个 worker 同时执行,也不能处理业务成功而步骤 receipt 未落库的崩溃窗口。
**整改:** 增加 plan revision/digest、append-only decisions、expected revision、decision nonce、步骤 CAS、lease/fencing、动作级幂等 receipt 和恢复对账。PG 是唯一权威;UserProjectContext/消息只保存 plan 引用。
### P1:确认未与当前授权绑定
持久化 user/role 或用户曾经确认都不能证明执行时仍有权。原稿没有要求恢复、读取和每步执行重新检查当前项目成员、duty、资源生命周期与版本。
**整改:** 确认只记录意愿;所有读取/决策验证 user/session/project 四元作用域;每步由动作 owner 按当前 principal 和 expected resource version 重新授权。失败 fail closed,不以系统身份代执行。
### P1:执行器方案会让 coordinator 再次成为 service locator
初稿拟扩展 `coordinator/action_planner.go` 的分发表来执行写动作,会把 docgov/taskrun/workflow 等具体实现重新聚集到 coordinator,抵消已完成的 chatflow/stageflow/bizdev 解耦。
**整改:** 新增深模块 `internal/app/intentflow` 作为计划生命周期 owner,通过消费者拥有的窄端口调用动作属主;coordinator/chat 仅保留兼容入口,组合根唯一装配。
### P1:事件与 SSE 被混为一条通道
现有 Track E 只处理注册的 PG 事件,不会自动把任意 delivery 变成 SSE。若只发 SSE,刷新丢失;若只写 outbox,浏览器不会自动得到状态。
**整改:** 计划状态同步落库;outbox 只发布版本化状态事实并驱动消息/read model 投影;SSE 是提交后的提示。刷新总是 GET PlanView。事件先登记 YAML、StaticContracts 和 payload allowlist。
### P1:不确定分段会退回单意图执行
“置信下降/指代补全失败就合并回单意图”与“不确定必须澄清、未确认零副作用”矛盾,仍可能执行 TopIntent 并丢弃其余任务。
**整改:** 只有确定为完整单意图连动时才合并;低置信、指代失败或无法证明完整一律澄清,保留候选理解但不执行。
### P1:数据复制与步骤传递缺少信任边界
初稿可能把原文、槽位、结果复制到 JSONB、日志、事件、SSE,再把查询摘要直接注入 task brief,扩大敏感数据面和提示注入路径。
**整改:** 计划保存消息引用/digest/allowlist display snapshot;事件和日志仅传 scope、状态与安全摘要引用;步骤间使用带 provenance/type/digest/sensitivity 的 ResultReference。结果只能进入隔离材料区,不能修改 action、target、tool 或 capability。
### P1:灰度开关顺序错误
现有 MULTI_INTENT_ENABLED 默认 true;初稿到最后一阶段才新增 tier,会让中间合入的行为缺少默认关闭门。
**整改:** U1 先建立默认 legacy 的新 tier;U2 只 shadow;auto_read 先维持两个查询的当前上限;确认和每个动作 adapter 分档开放。回滚必须继续支持已有计划读取/取消/收口。
## 重要产品修订
- 无活动写计划时单意图生成行为保持不变;多意图 generate 的确认/tier/adapter 能力由 intentflow BatchActionPolicy 管理,静态风险仍引用 ActionRegistry;
- 计划卡默认显示一句摘要和主动作,详细风险/步骤折叠展开,降低认知负担;
- 自然语言“确认”只有在当前会话恰有一个活动可见计划时才绑定;多计划或混入新任务时澄清;
- 聚合澄清不承诺一次自由文本必然填满所有槽位;只接受可唯一映射值,槽位依赖/冲突继续追问;
- 部分确认默认是分批批准,未选项保留待确认;只有显式排除才取消,部分完成提供重试/继续/关闭;
- 单意图生成兼容承诺只适用于当前没有活动写计划;有活动计划时统一冲突视图,避免双任务;
- 多意图价值必须用采用率、确认放弃率和拆单回退率证明;价值不足时停止写动作扩面,但保留“不静默丢任务”的安全改进。
- 批量确认、tier 和 adapter 策略归 intentflow 的 BatchActionPolicy;ActionRegistry 只保留动作身份与静态风险,避免编排政策回灌 L1;
- 计划卡折叠态仍显示目标、最高风险、不可撤销副作用和非原子语义;技术元数据才可折叠;
## 并发与权限检查表
- 同 turn 同 digest 返回原计划;同 turn 异 digest 冲突;
- decision 带 expected revision、nonce 与 digest;
- plan/step CAS 与单调 fencing;
- fencing 和幂等占位必须进入动作属主事务,只锁计划行不足以阻止旧 worker 副作用;
- confirm/cancel/expiry/edit 只有一个胜者;
- 部分确认必须依赖闭包;
- 双标签、双实例、worker 接管最多一次副作用;
- 跨 user/project/session 不可读、不可确认且不泄露存在性;
- 确认后成员/职责/资源状态变化仍会拒绝执行;
- SSE 重复、乱序、缺失由 GET reconcile;
- CSRF/Origin 沿用服务端认证策略,nonce 不冒充 CSRF。
- active-plan discovery 是刷新必需入口,不能依赖消息投影中恰好保存 plan_id。
## 范围与任务修订
原 T1–T5 被重拆为核心 U1–U8、可选实验 U9 和属主扩面 U10–U12:契约门禁、纯规则 shadow、持久计划、事件投影、决策/授权、Web、只读执行、task generate 首版、LLM adapter、mutate/docgov/workflow-run 分项扩面。每个单元有独立依赖、文件范围、测试、停走门与真实 mutex。总览不长期占用 `intent`;每个 action 仍需独立 short-term。
## 评审覆盖
- 本地视角:coherence、feasibility、security、scope、product、design、adversarial;
- 独立 cross-model:Claude Opus 5/high 的 security、product、adversarial 与 whole-document sweep;
- cross-model 审的是初稿,其关于 LLM 输入、plan ACL、结果传递、幂等、产品价值和确认负担的有效意见已纳入修订;其余由当前代码与边界事实校正。
## 关联整改
- System design: [2026-09-15-multi-intent-hitl-plan.md](../system-design/2026-09-15-multi-intent-hitl-plan.md)
- Short-term: [2026-09-15-multi-intent-hitl.md](../ops/short-term/2026-09-15-multi-intent-hitl.md)
## 证据
- `internal/intent/plan_builder.go`:首连接词、两段、写意图返回 nil;
- `internal/coordinator/action_planner.go`:pending confirm 仅文字提示;
- `internal/intent/registry.go`:task.run/adhoc 为 medium 且当前不全局 RequiresConfirm;
- `internal/intent/flags.go`:MULTI_INTENT_ENABLED 默认 true;
- `.doc/system-design/module-boundaries.yaml`:intent 只依赖 maturity,Track E/table owners 已登记;
- `internal/events/registry.go`:事件须静态注册;
- `internal/app/uow/uow.go`:不透明 TxScope;
- `web/src/App.tsx`:现有 card action 含前端本地业务状态路径。
## 开放问题
无阻塞性架构问题。各放量阈值必须在 U2 shadow 基线形成后预注册;这属于实施期量化,不授权跳过停走门。
@@ -0,0 +1,19 @@
---
title: "BUG-11 410 兼容策略冻结"
created: 2026-09-16
status: done
---
# BUG-11:旧 WORKFLOW_SWITCH API 410 策略
## 决定(2026-09-16 产品/工程冻结)
**保留** 治理可用时返回 `410 Gone` + `WORKFLOW_SWITCH_API_RETIRED`;治理不可用环境仍允许旧路径。
- 不视为能力缺口;不强制本轮删除路由。
- 遥测若证明零流量,可另开退役任务。
## 证据
- `internal/server/project_handlers.go` Gone 分支
- gap-matrix BUG-11 → PASS(策略冻结)
@@ -0,0 +1,44 @@
---
title: Demo/测试数据污染系统性审计
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
---
# Demo / 测试数据污染系统性审计
## 前序
本审计在 [2026-09-15 mock 交付物污染真实项目](./2026-09-15-mock-deliverables-pollute-real-projects.md)(及对应 [整改](../remediation/2026-09-15-mock-deliverables-pollution-remediation.md))之上收敛为全栈系统性排查:前端门控、goose 演示项目/会话、stub API。
## 背景
空项目展示「终审已生效」受控文档 + 伪造三级职责人。初判怀疑 docgov 隔离失败;实锤为前端 mock/seed 与 DB goose 演示种子污染。
## 结论
| 面 | 判定 | 说明 |
|----|------|------|
| 服务端 `document_records` / project_docs | **正常** | 按 `project_id` 隔离;空项目台账为 0 |
| 前端 `ALL_INITIAL_DELIVERABLES` / mockDocuments | **critical** | 无门控进生产包;projectId 1/2/3 撞车 |
| 前端 DEFAULT_PROJECTS / sessions / MOCK_USERS | **critical/high** | NeuroPulse 5201、CUSA id=3、6001–6010 |
| `deliverableSync` 空清单 `return prev` | **critical** | 权威空列表不回收本地 mock |
| `isLegacyLocalMockDocId` 覆盖不全 | **critical** | 未覆盖 neuropulse / ten-projects |
| Goose `00011`/`00012` | **critical** | 全环境写入 6001–6010 + 聊天 |
| API `backend=stub` | **high** | main 仍可请求 stub |
| `BootstrapDevSeedUsers` | **OK** | 已有 env 门控 |
## 证据路径
- `web/src/App.tsx`(整改前 INITIAL_*)
- `web/src/data/mockDocuments.ts` / `neuropulseDemo.ts` / `tenProjectsDemo.ts`
- `web/src/lib/deliverableSync.ts`
- `deploy/postgres/goose/00011_*.sql` / `00012_*.sql`
- `internal/taskrun/backend.go`
- 产物扫描:`scripts/check-prod-bundle.sh`
## 整改回链
- [remediation](../remediation/2026-09-16-demo-seed-pollution-remediation.md)
- [test-report](../test-reports/2026-09-16-demo-seed-pollution-test-report.md)
@@ -0,0 +1,24 @@
---
title: "FAV U7 incremental — remaining port inventory"
status: open
created: 2026-09-16
updated: 2026-09-17
---
# FAV U7 增量:未移植清单
相对 `feature/final-artifact-vault`,本切片 **未** 整支 merge,且因 `internal/artifactvault` 与当前 `dev`(dataset Candidate backfill)大面积 DIFF,下列能力仍待后续手工移植 + 审计:
| 项 | 旁支路径 | 阻塞 |
|----|----------|------|
| EnumerateTerminals / LoadExclusions | `internal/artifactvault/enumerate.go` | 依赖 TerminalRow;与现 `Enumerate(Candidate)` 并存需设计 |
| TerminalRow Backfill | FAV `backfill.go` | 现 backfill 已改为 dataset 路径 |
| 完整 CLI | `cmd/artifact-vault` 全命令 | 本切片仅 status stub |
| ingest hooks | `internal/server/vault.go` OnFinalArtifact* | 会写 staging;需与 publisher 门闩同批审批 |
| schema JSON | `*.schema.json` | 可选文档资产 |
| durable Register(fav) | `cmd/events` | events 硬门 + 单独 cutover 审批 |
| live staging → artifact → publication | publisher Drain / ingest hooks | 每级观察窗 ≥7 天;本轮 **未** 放量 |
**W6 已移植(仍非 live)**:`internal/app/fav.EventConsumer.ObserveShadow` 只计算 intended outcome(`WouldStage`/`WouldPublish` 恒 false);`FAV_DEGRADED_READ` 为 true 时 shadow 直接拒绝;`HandleLease` 与 `Registry.Register(fav)` 仍 fail-closed。
**红线保持**:`FAV_DEGRADED_READ=false`;fav consumer mode=off;禁止整支 merge。
@@ -0,0 +1,110 @@
---
title: "FEATURE-MATRIX production-ready 连续性审计"
status: done
created: 2026-09-16
updated: 2026-09-16
---
# FEATURE-MATRIX production-ready 连续性审计
## 结论
排除“纯软件项目自举”后,当前证据没有显示新的发布 blocker。`CURRENT.md`、`gap-matrix.md` 与 B1–B4 报告一致记录 `production_ready=yes`,dev/test/main 均为 schema 47。
`FEATURE-MATRIX.md` 仍需整改,但问题主要是状态语义混杂和证据漂移:同一个 `partial` 同时表示补证、首发后增强、实验、刻意关闭和真正的能力缺口。矩阵不能仅凭这些 `partial` 把 production-ready 回退,也不能据此宣称所有能力完整。
本轮只读核对文档和源码,没有运行测试、改业务代码、切换 feature flag 或操作共享环境。运行态事实仍以现有测试报告为准;后续状态提升必须重新验证。
## 审计边界
- 包含:除“纯软件项目自举”外的 `partial` 行、与这些行直接相关的 done/deferred 边界、发布门禁和证据链。
- 不包含:纯软件项目自举的实现方案、FAV 的实现审计、业务代码整改、部署或环境晋升。
- 权威关系:`FEATURE-MATRIX.md` 描述能力成熟度;`gap-matrix.md` 描述发布 blocker;`CURRENT.md` 描述当前协作与环境快照。
## 已确认事实
1. 发布门禁 B1–B4 已签,三环境 schema 为 47;U9–U12、FAV、完整 PI change-report 叙事和软件自举明确不挡当前首发。
2. 对话刷新、重登、重启和跨用户拒绝已有真实 PI/运行态证据。
3. 可靠事件 notify、workflow advance、projection 已 live,生产闭包 hook 已退出;FAV 仍保持 off。
4. 多意图 U1–U8 已合入默认 `legacy` 的安全基线,但 U8 真实 PI generate 在其报告中是 SKIP,不能写成真实生成闭环已签。
5. 工作流治理的设置页、DutyMode、动作级鉴权和三工作流真实 PI E2E 已签;full/none 文档长链的页面证据仍未完整覆盖。
6. 文档版本账本、人工修订、比较、通知和运行时 UI 已通过;change report 仍是明确标识的 deterministic fallback,不是完整 PI 叙事。
## 逐行核对
| 模块 | 当前判定 | 剩余工作 | 发布关系 |
|---|---|---|---|
| 意图识别 L1 | 当前行范围已具备改为 `done` 的条件 | 把 U9–U12 移出 L1 行;L1 只保留 18 类、三分支、读写分流和纯依赖边界 | 文档校准,不是 blocker |
| 多意图持久计划 | `partial` 合理 | 先补 U8 真实 PI + PG + browser + restart + 撤权证据;U9 独立实验;U10–U12 逐 action 扩面 | 默认 `legacy`,不挡首发 |
| 对话 / ctxmgr baseline | 当前冻结范围可改为 `done` | 语义摘要是 backlog D3,不是 D5;拆成独立 deferred/partial 行 | 文档校准,不是 blocker |
| 对话安全治理 D7 | `deferred` 独立行 | 数据分类,数据库/备份/日志控制盘点,留存删除口径和加密边界;若确认当前基线违规则升级 blocker | 待合规口径,不得无限期隐藏在普通 backlog |
| 工作流治理 | `partial` 合理 | full 文档真实 PI 人工审批长链;none 文档真实 PI 生成、免审批、账本持久化和阶段不阻塞长链 | 补证优先,不预设改代码 |
| IAM / 鉴权 | 现有缺口文字过时,模块仍应暂保 `partial` | 历史读取统一 owner/阶段授权已闭环;改为全路由 inventory、PG fail-closed、管理员例外、缓存失效和 410 退役决策 | 若发现现行旁路则升级 blocker |
| 文档版本与修改认知 baseline | 当前冻结范围可改为 `done` | 账本、人工修订、真实 diff+lineage 和 UI 已签;完整 PI narrative 拆成独立 deferred/partial 行 | 文档校准,不是 blocker |
| 前端工作台 | 当前行范围可改为 `done` | 其他 409 消费方复用信封解析应另列 hardening,不能让当前能力永久 `partial` | 文档校准,不是 blocker |
| CI / E2E | `partial` 合理 | 夜间 `RUN_PI_E2E=1`、失败分类与证据归档;修复全仓 race 的 TempDir 异步收口 flake | 阻止下一次晋升,不自动否定已发布版本 |
| Artifact promotion | `partial/deferred` 独立行 | 现状只证明同 commit 与各环境 digest 可追溯;要声明 same-image promotion,需一次构建、按 digest 晋升和可执行 receipt | 发布加固,不反向否定已签版本 |
| 模块解耦与可靠事件 | 当前核心范围可改为 `done` | 将 FAV 拆成独立 `deferred` 行;选择性后续解耦按收益触发 | FAV 保持 off,不挡首发 |
## 文档漂移
1. 多意图行仍写“共享环境 schema 45 待晋升”,与三环境 schema 47 冲突。
2. 对话行将语义摘要标成 D5;`chat-agent-p6-backlog.md` 中语义摘要实际为 D3,D5 是共享 KB 环境隔离评估。
3. IAM 行仍把已经闭环的历史读取 owner/阶段授权写成待办。
4. 前端行的“缺口/后续”没有未完成项,但状态仍是 `partial`。
5. 模块解耦行把已完成的事件核心和故意关闭的 FAV 混在同一状态中。
6. `2026-09-15-multi-intent-hitl-plan.md`、Phase 2 解耦方案、HTTP 信封方案和相关历史研究的头部状态或叙事已被后续报告部分或全部取代。
历史文档不得删除。应在原文增加 implemented/superseded 指针,或更新仍作为活方案的状态与证据链接。
## 风险发现
### IAM fail-open 潜在路径
`internal/auth/store_factory.go` 在 pool 为空或 IAM 表未就绪时回退 `MemoryStore`,没有按环境显式拒绝。当前 main schema 47 使该分支未被证实正在触发,因此本审计不直接翻转 production-ready;后续必须先只读核对部署实际选择,再把 fallback 改成仅 dev/test 加显式 opt-in 可用,空值、未知环境和 main/prod 一律 fail closed,并覆盖既有 session 的授权依赖中断负例。
### 状态提升越级
U8 的代码合入、默认 legacy 安全和真实 PI 放量是三件不同的事。矩阵若只写“U1–U8 完成”,会掩盖真实 PI stop-gate,并可能误导后续把 tier 升到 `confirm/full`。
### `none` 语义误写
`none` 表示不需要人工三权审批,不是“none 文档审批长链”。验收应证明真实 PI 生成、版本账本、审批动作不适用和阶段不阻塞。
### 证据失效
测试报告只证明其 commit、schema、镜像、runner/model/protocol 和环境。代码、迁移、compose、flag、runner 协议变化或环境晋升后,历史 PASS 不能单独证明新部署。
## 推荐状态模型
能力状态与发布状态必须正交:
- `done`:本行声明的能力边界已完成并有相应层级证据;不表示该领域永无后续。
- `partial`:已交付可用子集,行内列出尚未满足的关闭条件。
- `planned`:方案已存在但尚未实施。
- `deferred`:明确不进入当前路线,且不是发布 blocker。
- `blocked`:该行目标无法继续,必须给出 blocker 和恢复条件。
- `production_ready`:只由 `gap-matrix.md` 的发布门禁决定,不由所有能力行必须 `done` 推导。
## 重验触发器
发生以下任一变化时,受影响行必须重新验证,不能沿用旧 PASS:
- 授权谓词、owner port、会话或阶段作用域变化;
- schema、迁移、compose、镜像或环境晋升;
- feature flag/tier 从 off、legacy 或 shadow 升级;
- PI Runner URL、模型、typed-result 协议或 prompt/schema 变化;
- event consumer writer、lease、receipt、replay 或回滚路径变化;
- 浏览器用户流、SSE 恢复或持久化边界变化。
## 相关证据
- 能力矩阵:`status/FEATURE-MATRIX.md`
- 发布缺口:`remediation/gap-matrix.md`
- 当前环境:`ops/CURRENT.md`
- 发布门禁任务:`archive/ops/short-term/2026-09-16-production-ready-gates.md`
- 多意图设计与 U8:`system-design/2026-09-15-multi-intent-hitl-plan.md`、`test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md`
- 对话门禁:`test-reports/2026-09-16-chat-refresh-gate-test-report.md`
- 工作流 full/none 证据边界:`test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md`
- 文档版本:`test-reports/2026-09-14-document-revision-runtime-ui-test-report.md`
- 事件与解耦:`test-reports/2026-09-15-phase2-closeout-test-report.md`、`ops/research/2026-09-15-track-e-retrospective.md`
@@ -0,0 +1,23 @@
---
title: "R13 数据安全清单(nightly / real-PI)"
created: 2026-09-16
status: done
---
# R13 数据安全清单
用于真实 PI / nightly / 扩面验收的出站与留存门禁。
| # | 控制项 | 状态 | 证据/路径 |
|---|--------|------|-----------|
| 1 | 隔离合成 project/session,禁止生产真实 PII | PASS | nightly `agent_wave2_pi` + 合成 fixture |
| 2 | 凭证不入库;secrets 仅 Gitea Actions / `~/.secrets` | PASS | handoff gitea-nightly-secrets |
| 3 | evidence_refs 脱敏;日志无 token/密码 | PASS | `promotion-receipt-*` + run script |
| 4 | PI 最小字段 allowlist / typed-result-v1 | PASS | deploy/pi-agent typed-result |
| 5 | 跨项目/跨用户负例拒绝 | PASS | Wave2 / authz 套件 |
| 6 | 产物保留期有限(本地 tar / Actions) | PASS | workflow archive step |
| 7 | KB 出站失败降级不泄漏凭证 | PASS | pi-agent runner health 无 key |
## 开放增强
- 完整红队注入矩阵可另开 audit;不挡本清单基线勾选。
@@ -0,0 +1,62 @@
---
title: "D7 对话数据分类盘点"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: medium
---
# D7 对话数据分类盘点
## 现象
FEATURE-MATRIX「对话数据治理(D7)」为 `deferred`;ADR 数字 `pending-compliance-signoff`。W7 只盘点当前基线:会话正文、派生副本、共享 KB、日志、备份、事件敏感字段。本轮**未**按草案 365/180/30 天执行物理删除或备份清除。
## 根因分析
当前基线是「热库明文 + 软删除列预留 + 事件 ID 化」,不是已签字的留存作业。缺口是**尚未实现**的治理能力,不是已确认合规数字被违反。
## 严重度
`medium`(实现缺口;**不**升 gap-matrix blocker)
## 分类盘点
| 数据类 | 位置 | 形态 | 现状 |
|--------|------|------|------|
| 会话正文 | `chat_sessions` / `chat_messages.content` | 热库明文 TEXT;`deleted_at` 列存在 | dev 619 sessions / 3291 messages;`deleted_at` 全 NULL;Go 无 `SET deleted_at`、无 `DELETE FROM chat_*` |
| 派生摘要 | `chat_daily_digests` | headline / key_points JSON | 0 行 |
| 向量记忆 | `context_memory_chunks` | `content` TEXT + embedding | 102 行:`project_doc` 71、`chat_history` 24、`approved_case` 7。聊天派生副本会随正文留存 |
| 私密文档 | `freeform_documents` | `is_deleted` / `deleted_at` + version markdown | 122 份,其中 113 已软删(聊天消息无对等写路径) |
| 共享 KB | `shuimu-kb-shared` / `regulations` | 法规 chunks,无 chat 表 | `reg_documents` 2907、`reg_chunks` 312919;与对话库隔离 |
| 事件 envelope | `event_envelopes.payload` BYTEA | JSON 字段 | 4 条;keys 均为 ID/digest/`summary_ref`,`has_content=false` |
| 事件 DLQ / attempts | `event_dead_letters` / `event_delivery_attempts` | ID + reason / error_code | DLQ 0;attempts 4;无正文列 |
| 日志 | Docker `json-file` 无 max-size | 应用 slog | 抽检 rebuild 日志:DSN 已 `***`,无 chat content |
| 备份 | `scripts/backup-system-db.sh` `pg_dump -Fc` | 整库含 chat 明文 | 宿主机无 `./backups` 目录;CI 有 backup-restore-drill |
| Agent workspace | `data/dev/workspaces` 150M | 非终态工作区 | 无 30 天清理作业(ADR 草案待签字) |
| FAV | `final_artifacts` | 1 行;consumer mode=off | 与聊天口径解耦;W6 shadow 不写 |
事件 payload 比 `StaticContracts` allowlist **多出** `workspace_id` / `manifest_sha256` 等 ID 字段,但仍无聊天正文。属契约收紧 follow-up,不是 Track E 正文泄漏。
## 违规判定
对照已签字约束(Track E ID-only 日志/DLQ、R13 出站最小化、ADR 明确「签字前禁止按数字删除」):
- **未发现**已确认安全/合规基线被当前实现违反。
- **因此不写** `gap-matrix` blocker。
- 缺 365 天热库清理、缺聊天 soft-delete 写路径、缺字段级加密,均属 ADR 签字后的 W7 整改实现,不得在本轮当「已违规」执行删除。
## 关联整改
- ADR 草案: [../adr/2026-09-17-d7-chat-data-retention.md](../adr/2026-09-17-d7-chat-data-retention.md)
- 签字后整改:soft-delete 写路径 → 观察窗 → 物理清理;同步清 `context_memory_chunks` 的 `chat_history`;备份二次批准 + delete manifest(R22)
## 证据
`.doc/test-reports/assets/2026-09-17-w7-d7-inventory/`(counts / columns / event keys / KB / logs / health)。查询只读,未 `DELETE`/`UPDATE`。
## 开放问题
- 合规何时签字或改数(365/180/30)?
- 聊天 UI 删除是否要与 freeform 回收站对齐?
- `taskrun.completed` payload 额外 ID 字段是否收紧 allowlist?
@@ -0,0 +1,54 @@
---
title: "可选职责空审核人 CreateOrGetDocument 写 reviewer_id=0 触发 FK"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: high
---
# 可选职责空审核人 CreateOrGetDocument 写 reviewer_id=0 触发 FK
## 现象
dev 项目「内廷元无创神经刺激器」(6417) 发起 `intake` 任务后 UI 显示:
- `code: INTERNAL_ERROR`
- `userMessage: 系统内部错误,请重新开始会话`
- `requestId: run_1789622069585300787`
- `sessionId: sess-p6417-u9`
浏览器偶发 `flushSync was called from inside a lifecycle method`(错误态重渲染副作用,非根因)。
## 根因分析
1. app-dev 日志:`persist document ledger: ... document_records_reviewer_id_fkey (SQLSTATE 23503)`
2. 项目成员仅 `document_duty=author`(user 9),无 reviewer/approver
3. `resolveTaskDocumentDuties` 合法返回 `ReviewerID=0`
4. [`internal/docgov/engine.go`](../../internal/docgov/engine.go) `CreateOrGetDocument` 把 `0` 写入可空 FK,PG 拒绝(无 `users.id=0`)
5. `ClassifyError` 默认分支掩盖为 `INTERNAL_ERROR`
对照:[`internal/docduty/store.go`](../../internal/docduty/store.go) heal 路径已有 `nullIfZero`,**创建路径漏改**。
复现:`INSERT ... reviewer_id=0` → 同 FK 错误。近 7 天同因至少 3 次(6417/6359/6274)。
## 严重度
`high`(任何无 reviewer 职责的项目首次落文档账本均会失败;可扩散至 test/main)
## 关联整改
- Short-term: [../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md](../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md)
- Fix branch: `fix/docgov-optional-duty-null-fk`
- Test report: [../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md](../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md)
## 证据
- `docker logs shuimu-agent-app-dev` @ `2026-09-17T05:14:29Z` run_1789622069585300787
- `task_runs.error_message` 与上述一致;`document_records` 对 project 6417 为 0 行
- 手工 `INSERT reviewer_id=0` → `Key (reviewer_id)=(0) is not present in table "users"`
## 后续
- 创建路径 0→NULL;ClassifyError 增加 `DOC_LEDGER_ERROR`
- 不强制配置 reviewer(保持可选职责语义)
- flushSync 另开任务
+44 -2
View File
@@ -13,11 +13,53 @@
## 核心文档(按阅读顺序推荐)
### 模块边界 arch-check Wave 0 基线(2026-09-14)
### 可选职责空审核人 CreateOrGetDocument FK(2026-09-17)
**文件**: [2026-09-17-docgov-optional-duty-null-fk.md](./2026-09-17-docgov-optional-duty-null-fk.md)
**结论**: 无 reviewer 职责时 `CreateOrGetDocument` 写 `reviewer_id=0` 触发 FK,被 `ClassifyError` 掩盖为 `INTERNAL_ERROR`;heal 路径已有 `nullIfZero`,创建路径漏改。
**整改**: [short-term](../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md) · branch `fix/docgov-optional-duty-null-fk`
### FEATURE-MATRIX production-ready 连续性审计(2026-09-16)
**文件**: [2026-09-16-feature-matrix-production-readiness-audit.md](./2026-09-16-feature-matrix-production-readiness-audit.md)
**结论**: 排除纯软件项目自举后没有新增发布 blocker;矩阵需要拆分能力成熟度、发布关系、补证、增强和 deferred 状态,并修复 schema、D3/D5、IAM、前端与 FAV 叙事漂移。
**整改**: [FEATURE-MATRIX Production-Ready Continuity - Plan](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md)
### 多意图与 HITL 方案复核(2026-09-15)
**文件**: [2026-09-15-multi-intent-hitl-plan-review.md](./2026-09-15-multi-intent-hitl-plan-review.md)
**结论**: 多意图方向可行,但必须以 `app/intentflow` 深模块、PG 权威状态机、逐动作即时授权和分波 mutex 防止 intent/coordinator 再耦合;确认、卡片和 SSE 均不能替代授权或权威状态。
**设计/计划**: [多意图持久计划与 HITL](../system-design/2026-09-15-multi-intent-hitl-plan.md) · [核心 U1–U8 与扩面 U9–U12](../ops/short-term/2026-09-15-multi-intent-hitl.md)
### 模块解耦 Phase 2 方案复核(2026-09-15)
**文件**: [2026-09-15-module-decoupling-phase2-plan-review.md](./2026-09-15-module-decoupling-phase2-plan-review.md)
**结论**: PG delivery 尚未形成生产闭环;原计划把事件、结构和协议三轨绑成一次交付,并误判 docgov/docrevision 依赖方向。修订版先完成事件生产与历史数据门,再以 PG dispatcher、逐消费者 shadow 和真实刷新/重启恢复收口。
**整改**: [Phase 2 持久事件交付与后续解耦路线](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
### arch-check U1 可重放基线(2026-09-14)
**文件**: [2026-09-14-arch-check-baseline.md](./2026-09-14-arch-check-baseline.md)
**结论**: import 相对现状 allowlist 无新边;表/路径目标属主扫描 21 条 warn,作为 Wave 1+ 收口清单,不在本轮转 block。
**结论**: 四类规则(production import / SQL write / path / event)可重放。import=0,sql_write=5,path=17,event=0。Goose 与测试不计生产写者。新违规与过期例外立即 block。
### 模块解耦方案复核(2026-09-14)
**文件**: [2026-09-14-module-decoupling-plan-review.md](./2026-09-14-module-decoupling-plan-review.md)
**结论**: 模块化单体方向成立,但原横向 Wave 缺少跨属主事务、可靠事件、多副本互斥、逐动作授权和 FAV 边界;应先完成受控文档可靠性纵向试点,再按证据扩面。
**整改**: [模块解耦与文档可靠性重构计划](../remediation/2026-09-14-module-decoupling-refactor-plan.md)
### 项目 143 workflow-plan 409 与三权全有或全无(2026-09-14)
+157
View File
@@ -0,0 +1,157 @@
---
title: "Authorization matrix v3 — full route inventory"
created: 2026-09-16
updated: 2026-09-16
status: done
---
# Authorization matrix v3 — full route inventory
Generated from `mux.HandleFunc` registrations under `internal/server/`.
AuthN column is **heuristic**; negative-test pointers filled where known.
| Method | Path | Handler | File | AuthN (heuristic) | Neg test |
|--------|------|---------|------|-------------------|----------|
| GET | `/` | `s.serveSPA` | `server.go` | handler | see suite |
| GET | `/api/v1/admin/config` | `s.handleAdminConfig` | `server.go` | admin+project? | see suite |
| PUT | `/api/v1/admin/config` | `s.handleAdminConfig` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/permissions` | `s.handleAdminPermissions` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/roles` | `s.handleAdminRoles` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/roles` | `s.handleAdminRoles` | `server.go` | admin+project? | see suite |
| DELETE | `/api/v1/admin/roles/{id}` | `s.handleAdminRoleByID` | `server.go` | admin+project? | see suite |
| PATCH | `/api/v1/admin/roles/{id}` | `s.handleAdminRoleByID` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/templates` | `s.handleAdminTemplates` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/templates` | `s.handleAdminTemplates` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/templates/{key}/versions` | `s.handleAdminTemplateVersions` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/users` | `s.handleAdminUsers` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/users` | `s.handleAdminUsers` | `server.go` | admin+project? | see suite |
| PUT | `/api/v1/admin/users/{id}/role` | `s.handleAdminUpdateRole` | `server.go` | admin+project? | see suite |
| PUT | `/api/v1/admin/users/{id}/status` | `s.handleAdminUpdateStatus` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/workflows` | `s.handleAdminWorkflows` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/workflows` | `s.handleAdminWorkflows` | `server.go` | admin+project? | see suite |
| GET | `/api/v1/admin/workflows/{id}` | `s.handleAdminWorkflowByID` | `server.go` | admin+project? | see suite |
| PATCH | `/api/v1/admin/workflows/{id}/versions/{version}` | `s.handleAdminWorkflowVersion` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/workflows/{id}/versions/{version}/publish` | `s.handleAdminWorkflowPublish` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/workflows/{id}/versions/{version}/retire` | `s.handleAdminWorkflowRetire` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/workflows/{id}/versions/{version}/validate` | `s.handleAdminWorkflowValidate` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/admin/workspaces/reconcile` | `s.handleReconcileWorkspace` | `server.go` | admin+project? | see suite |
| POST | `/api/v1/auth/change-password` | `s.handleAuthChangePassword` | `server.go` | handler | see suite |
| POST | `/api/v1/auth/login` | `s.handleAuthLogin` | `server.go` | handler | see suite |
| POST | `/api/v1/auth/logout` | `s.handleAuthLogout` | `server.go` | handler | see suite |
| GET | `/api/v1/auth/me` | `s.handleAuthMe` | `server.go` | handler | see suite |
| GET | `/api/v1/auth/public-config` | `s.handleAuthPublicConfig` | `server.go` | handler | see suite |
| POST | `/api/v1/auth/register` | `s.handleAuthRegister` | `server.go` | handler | see suite |
| GET | `/api/v1/auth/sessions` | `s.handleAuthSessions` | `server.go` | handler | see suite |
| DELETE | `/api/v1/auth/sessions/{id}` | `s.handleAuthSessionByID` | `server.go` | handler | see suite |
| POST | `/api/v1/chat` | `s.handleChat` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/categories` | `s.handleListChatCategories` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/dates` | `s.handleListChatDates` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/digests` | `s.handleListDailyDigests` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/digests/generate` | `s.handleGenerateDailyDigest` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/export/messages` | `s.handleChatExportMessages` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/messages` | `s.handleGetChatMessages` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/messages/day` | `s.handleGetChatDayMessages` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/messages/import` | `s.handleImportChatMessages` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/messages/window` | `s.handleGetChatWindow` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/messages/{message_id}/export-capability` | `s.handleGetExportCapability` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/messages/{message_id}/export-source` | `s.handleGetExportSource` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/read` | `s.handleChatRead` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/recategorize` | `s.handleChatRecategorize` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/search` | `s.handleChatSearch` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/sessions` | `s.handleListChatSessions` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/sessions` | `s.handleUpsertChatSession` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/stream` | `s.handleChatStream` | `server.go` | session+project | see suite |
| POST | `/api/v1/chat/stream` | `s.handleChatStream` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/turns/{client_turn_id}` | `s.handleGetChatTurn` | `server.go` | session+project | see suite |
| GET | `/api/v1/chat/unread` | `s.handleChatUnread` | `server.go` | session+project | see suite |
| GET | `/api/v1/context/cases/recommend` | `s.handleRecommendCases` | `server.go` | handler | see suite |
| GET | `/api/v1/context/project` | `s.handleGetProjectContext` | `server.go` | handler | see suite |
| GET | `/api/v1/context/user` | `s.handleGetUserContext` | `server.go` | handler | see suite |
| PUT | `/api/v1/context/user/preference` | `s.handleUpdateUserPreference` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/approver-decision` | `s.handleDocGovApproverDecision` | `server.go` | handler | see suite |
| GET | `/api/v1/docgov/audit-logs` | `s.handleDocGovListAuditLogs` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/claim` | `s.handleDocGovClaim` | `server.go` | handler | see suite |
| GET | `/api/v1/docgov/comments` | `s.handleDocGovListComments` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/comments` | `s.handleDocGovAddComment` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/content` | `s.handleDocGovSaveContent` | `server.go` | handler | see suite |
| GET | `/api/v1/docgov/document` | `s.handleDocGovGetDocument` | `server.go` | handler | see suite |
| GET | `/api/v1/docgov/documents/{doc_id}/content` | `s.handleDocGovGetDocumentContent` | `server.go` | session+project | see suite |
| POST | `/api/v1/docgov/lease/acquire` | `s.handleDocGovAcquireLease` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/lease/heartbeat` | `s.handleDocGovHeartbeatLease` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/lease/release` | `s.handleDocGovReleaseLease` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/proposal/decide` | `s.handleDocGovDecideProposal` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/review-decision` | `s.handleDocGovReviewDecision` | `server.go` | handler | see suite |
| POST | `/api/v1/docgov/submit-review` | `s.handleDocGovSubmitReview` | `server.go` | handler | see suite |
| GET | `/api/v1/documents/{doc_id}/agent-candidates/{candidate_id}` | `s.handleDocRevisionGetCandidate` | `document_revision_handlers.go` | session+project | see suite |
| POST | `/api/v1/documents/{doc_id}/agent-candidates/{candidate_id}/decision` | `s.handleDocRevisionCandidateDecision` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/change-reports/{report_id}` | `s.handleDocRevisionGetReport` | `document_revision_handlers.go` | session+project | see suite |
| PATCH | `/api/v1/documents/{doc_id}/content` | `s.handleDocRevisionPatchContent` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/diff` | `s.handleDocRevisionDiff` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/manual-overlay` | `s.handleDocRevisionManualOverlay` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/revision-state` | `s.handleDocRevisionState` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/versions` | `s.handleDocRevisionListVersions` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/documents/{doc_id}/versions/{version_no}` | `s.handleDocRevisionGetVersion` | `document_revision_handlers.go` | session+project | see suite |
| GET | `/api/v1/freeform-documents` | `s.handleListFreeformDocs` | `server.go` | session+project | see suite |
| POST | `/api/v1/freeform-documents` | `s.handleCreateFreeformDoc` | `server.go` | session+project | see suite |
| POST | `/api/v1/freeform-documents/from-message` | `s.handleCreateFreeformDocFromMessage` | `server.go` | session+project | see suite |
| DELETE | `/api/v1/freeform-documents/{doc_id}` | `s.handleDeleteFreeformDoc` | `server.go` | session+project | see suite |
| GET | `/api/v1/freeform-documents/{doc_id}` | `s.handleGetFreeformDoc` | `server.go` | session+project | see suite |
| PUT | `/api/v1/freeform-documents/{doc_id}` | `s.handleUpdateFreeformDoc` | `server.go` | session+project | see suite |
| POST | `/api/v1/freeform-documents/{doc_id}/share` | `s.handleShareFreeformDoc` | `server.go` | session+project | see suite |
| POST | `/api/v1/freeform-documents/{doc_id}/unshare` | `s.handleUnshareFreeformDoc` | `server.go` | session+project | see suite |
| GET | `/api/v1/health` | `s.handleHealth` | `server.go` | public | see suite |
| GET | `/api/v1/me/preferences` | `s.handleMePreferences` | `server.go` | handler | see suite |
| PUT | `/api/v1/me/preferences` | `s.handleMePreferences` | `server.go` | handler | see suite |
| GET | `/api/v1/me/profile` | `s.handleMeProfile` | `server.go` | handler | see suite |
| PATCH | `/api/v1/me/profile` | `s.handleMeProfile` | `server.go` | handler | see suite |
| PATCH | `/api/v1/notifications/{id}` | `s.handlePatchNotification` | `document_revision_handlers.go` | handler | see suite |
| GET | `/api/v1/projects` | `s.handleListProjects` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects` | `s.handleCreateProject` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}` | `s.handleGetProjectByID` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects/{id}/activation-preview` | `s.handleActivationPreview` | `server.go` | session+project | see suite |
| PUT | `/api/v1/projects/{id}/active-workflow` | `s.handleActivateWorkflow` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/assets` | `s.handleListProjectAssets` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects/{id}/assets` | `s.handleUploadProjectAsset` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/documents` | `s.handleListProjectWorkflowDocuments` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/lineage` | `s.handleGetProjectLineage` | `server.go` | session+project | see suite |
| DELETE | `/api/v1/projects/{id}/members` | `s.handleProjectMembers` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/members` | `s.handleProjectMembers` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects/{id}/members` | `s.handleProjectMembers` | `server.go` | session+project | see suite |
| PUT | `/api/v1/projects/{id}/members` | `s.handleProjectMembers` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/notifications` | `s.handleListProjectNotifications` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/settings` | `s.handleGetProjectSettings` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects/{id}/workflow-instances/activate` | `s.handleActivateWorkflowInstance` | `server.go` | session+project | see suite |
| PUT | `/api/v1/projects/{id}/workflow-plan` | `s.handleSaveWorkflowPlan` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/workflow-plan/default` | `s.handleGetDefaultWorkflowPlan` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/workflows` | `s.handleListProjectWorkflows` | `server.go` | session+project | see suite |
| POST | `/api/v1/projects/{id}/workflows/{workflow_key}/run` | `s.handleRunProjectWorkflow` | `server.go` | session+project | see suite |
| GET | `/api/v1/projects/{id}/workflows/{workflow_key}/runs` | `s.handleListProjectWorkflowRuns` | `server.go` | session+project | see suite |
| GET | `/api/v1/ready` | `s.handleReadiness` | `server.go` | public | see suite |
| POST | `/api/v1/tasks/run` | `s.handleRunTask` | `server.go` | session+project | see suite |
| GET | `/api/v1/tasks/run/stream` | `s.handleRunTaskStream` | `server.go` | session+project | see suite |
| POST | `/api/v1/tasks/run/stream` | `s.handleRunTaskStream` | `server.go` | session+project | see suite |
| POST | `/api/v1/tasks/runs` | `s.handleCreateTaskRun` | `server.go` | session+project | see suite |
| GET | `/api/v1/tasks/runs/{run_id}` | `s.handleGetTaskRun` | `server.go` | session+project | see suite |
| POST | `/api/v1/tasks/runs/{run_id}/cancel` | `s.handleCancelTaskRun` | `server.go` | session+project | see suite |
| GET | `/api/v1/tasks/runs/{run_id}/events` | `s.handleTaskRunEvents` | `server.go` | session+project | see suite |
| POST | `/api/v1/tasks/runs/{run_id}/resume` | `s.handleResumeTaskRun` | `server.go` | session+project | see suite |
| GET | `/api/v1/workflow-instances/{id}` | `s.handleGetWorkflowInstance` | `server.go` | session+project | see suite |
| POST | `/api/v1/workflow-instances/{id}/stages/{stage}/advance` | `s.handleAdvanceStage` | `server.go` | session+project | see suite |
| GET | `/api/v1/workflow-instances/{id}/stages/{stage}/readiness` | `s.handleGetStageReadiness` | `server.go` | session+project | see suite |
| POST | `/api/v1/workflow-instances/{id}/terminate` | `s.handleTerminateWorkflowInstance` | `server.go` | session+project | see suite |
| GET | `/api/v1/workflow-instances/{id}/termination-preview` | `s.handleTerminationPreview` | `server.go` | session+project | see suite |
| GET | `/api/v1/workflows` | `s.handleListWorkflowDefinitions` | `server.go` | session+project | see suite |
| GET | `/api/v1/workflows/catalog` | `s.handleWorkflowCatalog` | `server.go` | session+project | see suite |
| GET | `/health` | `s.handleHealth` | `server.go` | public | see suite |
| GET | `/ready` | `s.handleReadiness` | `server.go` | public | see suite |
| * | `/sse` | `func(w http.ResponseWriter, r *http.Request` | `task_run_idempotent_sse_test.go` | handler | see suite |
**Total routes:** 133
## Session interrupt fail-closed
When IAM/auth store unavailable after session established, protected reads must reject (see `TestAuthStore_SessionInterruptFailClosed`).
## BUG-11 410 policy
Product decision 2026-09-16: **retain** `WORKFLOW_SWITCH_API_RETIRED` 410 when governance available; legacy path only when governance unavailable. Not a capability gap.
@@ -1,12 +1,10 @@
# Herdr Agent 角色、审批与备援 SSOT
> **archived / superseded 2026-09-14**:不再作为活协作规范;脚本已删除。历史证据保留本文件。移除任务见 [./2026-09-14-remove-herdr-agent-settings.md](./2026-09-14-remove-herdr-agent-settings.md)。
**更新**: 2026-09-13(归档标注 2026-09-14)
**更新**: 2026-09-13
**owner**: `orchestrator_codex`
**status**: archived
**status**: active
本文只管理工程协作终端,不管理产品运行时智能体。通用分支、worktree、mutex、集成槽、密钥和破坏性操作规则仍以仓库根 [AGENTS.md](../../../AGENTS.md) 为准。
本文只管理工程协作终端,不管理产品运行时智能体。通用分支、worktree、mutex、集成槽、密钥和破坏性操作规则仍以仓库根 [AGENTS.md](../../AGENTS.md) 为准。
## 1. 身份边界
+108 -21
View File
@@ -1,24 +1,70 @@
# 当前焦点
**更新**: 2026-09-14
**production_ready**: no(`CHAT-INTENT-STATE` 等无关 blocker 仍开放。文档账本运行时 UI Round20 **PASS**,不把 fallback change report 写成完整 PI,也不把本轮写成全仓可发布)
**更新**: 2026-09-17
**production_ready**: yes(门禁 B1–B4 已签;dev/test `schema_version=48`;main `schema_version=47`;goose 00048 已在 test 迁移。不把 fallback change report 写成完整 PI)
## 焦点
1. **WORKFLOW-PLAN**: [冻结 409 与文档职责可选治理](../audit/2026-09-14-workflow-plan-409-frozen-and-optional-duties.md)(Wave 1–4 已在 `fix/workflow-plan-409-frozen-and-optional-duties` 落地;Wave 5 占槽 e2e 进行中;后续治理原则见 [MVP 治理规则评审](../ops/research/2026-09-14-mvp-governance-rules-review.md))
2. **CHAT-INTENT**: [对话意图运行时状态](../audit/2026-09-13-conversation-intent-runtime-state.md)(`fix/conversation-intent-state`;与文档账本运行时无关)
3. **CHAT**: [对话历史刷新](../audit/2026-09-13-chat-history-refresh-disappears.md)(认领仍 `in_progress`;gap 行已 PASS,以代码/handoff 为准收敛)
1. **promote null-fk → test**:`rc-v1.0.0-beta.4`(docgov optional-duty FK 修复)
2. **partial/deferred 全量收口**:W1–W4 **done**;W5a **done**(矩阵自举行仍 partial);W6 **shadow done**(矩阵 FAV 仍 partial);W7 **盘点 done**(矩阵 D7 仍 deferred)。已晋升:`rc-v1.0.0-beta.3` → 本轮 `beta.4`
3. **红线**:禁止整支 merge FAV;不默认升 `MULTI_INTENT_PLAN_TIER=full`(升 `confirm` 须 W4 闭环后独立授权);`SEMANTIC_SUMMARY_REPLACE` 不随 W2 开启;FAV live 顺序 staging→artifact→publication、每级观察窗证据驱动(下限 ≥7 天)、`FAV_DEGRADED_READ=false`;flag 默认 off;项目 143 只读
## 并行认领
| owner | task | branch | worktree | mutex | status |
|-------|------|--------|----------|-------|--------|
| verifier_antigravity | controlled-content-ui-acceptance | fix/controlled-content-ui-acceptance | .worktrees/fix-controlled-content-ui-acceptance | document-content-ui-acceptance | done |
| implementer_cursor | controlled-content-canonical-hash | fix/controlled-content-canonical-hash | .worktrees/fix-controlled-content-canonical-hash | docgov | done |
| Cursor | 2026-09-17-promote-null-fk-to-test | feature/promote-null-fk-to-test | - | infra | in_progress |
| Cursor | 2026-09-17-docgov-optional-duty-null-fk | fix/docgov-optional-duty-null-fk | - | docgov | done |
| Cursor | 2026-09-17-leftover-hygiene | chore/leftover-hygiene-2026-09-17 | - | ops | done |
| Cursor | 2026-09-17-w2-semantic-summary-shadow | feature/w2-semantic-summary-shadow-live | - | chat | done |
| Cursor | 2026-09-17-w3-pi-change-report-narrative | feature/w3-pi-change-report-narrative-live | - | docgov | done |
| Cursor | 2026-09-17-w4-multi-intent-u9-u12 | feature/w4-u9-segment-live | - | intent-plan | done |
| Cursor | 2026-09-17-w5a-software-bootstrap-ui | feature/w5a-software-bootstrap-ui-pi | - | workflow-design | done |
| Cursor | 2026-09-17-w6-fav-subscriber-shadow | feature/w6-fav-subscriber-shadow | - | events | done |
| Cursor | 2026-09-17-w7-d7-inventory | feature/w7-d7-data-inventory | - | chat | done |
| Cursor | 2026-09-17-promote-dev-to-test | feature/promote-dev-to-test-2026-09-17 | - | infra | done |
| Cursor | 2026-09-17-kb-host-auth-fix | fix/kb-host-auth-layered-load | - | infra | done |
| Cursor | 2026-09-17-w1-ci-e2e-green-nightly | feature/w1-ci-e2e-green-nightly | - | ci | done |
| Cline | 2026-09-16-partial-deferred-completion | docs/partial-deferred-completion-plan | - | architecture-docs | in_progress |
| Cursor | 2026-09-16-intent-plan-playwright-dual-tab | feature/intent-plan-cards-playwright | .worktrees/feature-intent-plan-cards-playwright | web | done |
| Cursor | 2026-09-16-full-backlog-override | docs/override-nogo-full-backlog | - | architecture-docs | done |
| Cursor | 2026-09-16-gitea-nightly-docker-datadir | fix/gitea-nightly-docker-datadir | - | ci | done |
| Cursor | 2026-09-16-gitea-nightly-host-tools | fix/gitea-nightly-host-tools | - | ci | done |
| Cursor | 2026-09-16-wave-leftovers | fix/wave-leftovers-n7-playwright-dod | - | ci | done |
| Cursor | 2026-09-16-wave3-pu6-pu8-go-no-go | feature/wave3-pu6-pu8-go-no-go | - | architecture-docs | done |
| Cursor | 2026-09-16-wave2c-same-image-digest | feature/wave2c-same-image-digest | - | infra | done |
| Cursor | 2026-09-16-wave2b-nightly-promotion-receipt | feature/wave2b-nightly-promotion-receipt | - | ci | done |
| Cursor | 2026-09-16-wave2-real-pi-evidence | feature/wave2-real-pi-evidence | - | intent-plan | done |
| Cursor | 2026-09-16-wave1-race-tempdir-cleanup | fix/race-tempdir-cleanup | - | ci | done |
| Cursor | 2026-09-16-wave1-iam-fail-closed | fix/iam-store-fail-closed | - | authz | done |
| Cursor | 2026-09-16-feature-matrix-wave0-calibration | feature/feature-matrix-production-readiness-plan | .worktrees/feature-matrix-production-readiness-plan | architecture-docs | done |
| Codex | 2026-09-16-feature-matrix-production-readiness-plan | feature/feature-matrix-production-readiness-plan | .worktrees/feature-matrix-production-readiness-plan | architecture-docs | done |
| Cursor-Auto | 2026-09-16-matrix-deep-test-promote-test | feature/matrix-deep-test-promote-test | - | infra | done |
| Cursor-Auto | 2026-09-16-production-ready-gates | docs/production-ready-flip | - | ci | done |
| Cursor-Auto | 2026-09-16-demo-seed-pollution | fix/demo-data-pollution-web | - | web | done |
| Cursor | 2026-09-16-multi-intent-u8-task-generate | feature/multi-intent-u8-task-generate | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u7-auto-read | feature/multi-intent-u7-auto-read | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u6-web-cards | feature/multi-intent-u6-web-cards | - | web | done |
| Cursor | 2026-09-16-multi-intent-u5-decision-api | feature/multi-intent-u5-decision-api | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u4-outbox-projection | feature/multi-intent-u4-outbox-projection | - | events | done |
| Cursor | 2026-09-15-multi-intent-u3-intentflow-pg | feature/multi-intent-u3-intentflow-pg | - | intent-plan | done |
| Cursor | 2026-09-15-multi-intent-u2-segmenter | feature/multi-intent-u2-segmenter | - | intent | done |
| Cursor | 2026-09-15-multi-intent-u1-contracts | feature/multi-intent-u1-contracts | - | architecture-docs | done |
| Cursor | app-composition-u11-u12 | feature/app-composition-u11-u12 | - | app | done |
| Cursor | chatlog-contextasm-u10 | feature/chatlog-contextasm-u10 | - | chat | done |
| Cursor | chat-history-refresh-remediation | fix/chat-history-refresh | - | chat | done |
| Cursor | dataset-lifecycle-u9 | feature/dataset-lifecycle-u9 | - | dataset | done |
| Cursor | taskrun-runmanifest-u8 | feature/taskrun-runmanifest | - | taskrun | done |
| Cursor | document-reliability-m1-live-and-m2 | refactor/document-reliability-pilot | - | workspace | done |
| Codex | module-decoupling-remediation-plan | feature/module-decoupling-remediation | - | architecture-docs | done |
| Codex | module-decoupling-phase2-plan-review | docs/module-decoupling-ipc-assessment | - | architecture-docs | done |
| Cursor | module-decoupling-phase2-docs | feature/module-decoupling-phase2-docs | - | architecture-docs | done |
| verifier_antigravity | controlled-content-ui-acceptance | fix/controlled-content-ui-acceptance | - | document-content-ui-acceptance | done |
| implementer_cursor | controlled-content-canonical-hash | fix/controlled-content-canonical-hash | - | docgov | done |
| Codex | project143-controlled-content-404-diagnosis | fix/project143-controlled-content-404-diagnosis | - | docgov-content-diagnosis | done |
| Codex | software-project-bootstrap-plan | feature/software-project-bootstrap-plan | - | workflow-design | done |
| Cursor | chat-history-refresh-remediation | fix/chat-history-refresh | - | chat | in_progress |
| Codex | conversation-intent-runtime-state | fix/conversation-intent-state | .worktrees/fix-conversation-intent-state | intent | in_progress |
| Codex | conversation-intent-runtime-state | fix/conversation-intent-state | - | intent | done |
| Cursor | conversation-intent-runtime-state | docs/conversation-intent-dual-tab | - | intent | done |
| Cursor | document-revision-wave1-6-implementation | feature/document-revision-management | - | docgov | done |
| Cursor-Auto | document-revision-runtime-ui03 | fix/document-revision-runtime-ui03 | - | docgov | done |
| Cursor-Auto | document-revision-sse-idempotency | fix/document-revision-sse-idempotency | - | docgov | done |
@@ -46,21 +92,36 @@
| Cursor-Auto | document-revision-evidence-count | fix/document-revision-evidence-count | - | document-revision-evidence-count | done |
| Cursor-Auto | document-revision-session-close | feature/document-revision-session-close | - | document-revision-session-close | done |
| Cursor-Auto | vite-frp-allowed-hosts | fix/vite-frp-allowed-hosts | - | web-devserver | done |
| Cursor-Auto | remove-herdr-agent-settings | feature/remove-herdr-agent-settings | - | agent-collab-docs | done |
| implementer_cursor | workflow-plan-409-frozen-and-optional-duties | fix/workflow-plan-409-frozen-and-optional-duties | .worktrees/fix-workflow-plan-409-frozen-and-optional-duties | workflow | in_progress |
| Cline | governance-action-level-authz | fix/governance-action-level-authz | - | workflow | blocked |
| Cursor | module-decoupling-wave0 | feature/remove-herdr-agent-settings | - | arch | done |
| implementer_cursor | workflow-plan-409-frozen-and-optional-duties | fix/workflow-plan-409-frozen-and-optional-duties | - | workflow | done |
| implementer_cursor | governance-action-level-authz | fix/governance-action-level-authz | - | workflow | done |
| Cursor | leftover-branch-cleanup | chore/leftover-branch-cleanup | - | ops | done |
| Cursor | event-e0a-production-scope-contract | fix/event-production-scope-contract | - | events | done |
| Cursor | event-e0b-dispatcher-pg | feature/events-dispatcher-pg | - | events | done |
| Cursor | event-e1a-notify-cutover | fix/event-notify-cutover | - | events | done |
| Cursor | event-e1b-workflow-advance | fix/event-workflow-advance | - | events | done |
| Cursor | event-e1c-projection-cutover | fix/event-projection-cutover | - | events | done |
| Cursor | event-e2-hook-guard | fix/event-e2-hook-guard | - | events | done |
| Cursor | doccontent-canonical-boundary | fix/doccontent-canonical-boundary | - | docgov | done |
| Cursor | intent-bizdev-boundary | fix/intent-bizdev-boundary | - | intent | done |
| Cursor | stageflow-type-ownership | fix/stageflow-type-ownership | - | stageflow | done |
| Cursor | bizdev-locator-removal | fix/bizdev-locator-removal | - | bizdev | done |
| Cursor | chatflow-orchestration-boundary | fix/chatflow-orchestration-boundary | - | chat | done |
| Cursor | phase2-closeout-inventories | feature/phase2-closeout-inventories | - | architecture-docs | done |
| Cursor | event-shared-live-cutover | feature/event-shared-live-cutover | - | events | done |
| Cursor | pi-typed-result | feature/pi-typed-result | - | pi-agent | done |
| Cursor | promote-dev-to-test-2026-09-15 | feature/promote-dev-to-test-2026-09-15 | - | infra | done |
> 新任务开始前登记。`branch` 必须为 `feature/<slug>` 或 `fix/<slug>`,**禁止** `dev` / `test` / `main`。同一 `mutex` 同时仅一个 `in_progress`。
> `workflow-plan-409-frozen-and-optional-duties` 已由 implementer_cursor 接管:worktree 已创建,Wave 1–4 提交落地,Wave 5 占集成槽位(e2e)进行中。
> `governance-action-level-authz` blocked 仅为等待同 mutex `workflow` 的 Wave 5 收敛;收敛后从最新 `dev` 创建 `fix/governance-action-level-authz` 并改 `in_progress`,不得在当前 `feature/remove-herdr-agent-settings` 工作区编码。
> workflow-plan 409 与治理鉴权 G1–G5 已收口(见 [test-report](../test-reports/2026-09-14-governance-action-level-authz-test-report.md))。禁止终止或改写项目 143。
> `document-reliability-pilot` U11–U12 已合入 `dev@bf59cce` 并 rebuild。`CHAT-INTENT-STATE` 双标签 busy 已 PASS(项目 6275)。禁止 worktree 内 `env-service`。项目 143 只读,禁止终止。
> 2026-09-17 leftover 二次收口:[报告](../test-reports/2026-09-17-leftover-hygiene-test-report.md)。已合入 leftover worktree/旁支再拆一轮;`feature/software-project-bootstrap` L1 已在 `dev`(残留关闭 commit 已丢弃)。`fix/clean-test-env-baseline` **不 merge**(前端 demo 清理已放弃;仅保留已挑拣的 `SEED_DEMO_USERS=false`)。extra worktree 仅余 `.worktrees/fix-dev-runtime-data-root-guard`(目录名是 guard,检出的是 `feature/final-artifact-vault`)。**故意不合入、不删**:`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/*`。不整支 merge FAV;不启用 `FAV_DEGRADED_READ`。
## 集成槽位
| holder | phase | since | scope | queue |
|--------|-------|-------|-------|-------|
| implementer_cursor | e2e | 2026-09-14 | workflow-plan 409 frozen + optional duties | governance-action-level-authz |
| Cursor | merging | 2026-09-17 | promote null-fk → test (rc-v1.0.0-beta.4) | - |
**phase**: `idle` | `merging` | `smoke` | `e2e`
@@ -70,24 +131,50 @@
| 环境 | 端口 | schema | 状态 |
|------|------|--------|------|
| dev | 8080 | **32** | healthy(产品代码部署为 `36e4bc3`;真实 UI 主链+restart PASS) |
| test | 8081 | 25→27* | healthy |
| main | 8000 | 25→27* | healthy(app + runner + DB) |
| dev | 8080 | **48** | healthy(`pi-agent` typed-result-v1;events worker `:8088`;notify/advance/projection live、fav off;health+ready PASS;demo 6001–6010 retired) |
| test | 8081 | **48** | healthy(`rc-v1.0.0-beta.3`;pi-agent `:18866`;events `:8089`;notify/advance/projection live、fav off;health+ready PASS;goose 00048 已迁移) |
| main | 8000 | **47** | healthy(app + events + runner + DB;与 dev/test 对齐) |
## SSOT
| 类型 | 路径 |
|------|------|
| 文档总地图 | [../README.md](../README.md) |
| 模块完成度 | [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) |
| 发布缺口 | [gap-matrix](../remediation/gap-matrix.md) |
| 模块完成度 | [FEATURE-MATRIX](../status/FEATURE-MATRIX.md)(Wave 0 已校准契约与冻结边界) |
| 发布缺口 | [gap-matrix](../remediation/gap-matrix.md)(`production_ready=yes`;Wave 0 IAM 只读未发现旁路) |
| 连续性审计/计划 | [audit](../audit/2026-09-16-feature-matrix-production-readiness-audit.md) · [remediation](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md) · [Wave 0 任务](./short-term/2026-09-16-feature-matrix-wave0-calibration.md) |
| 测试报告 | [test-reports/](../test-reports/) |
| D7 盘点(W7) | [audit](../audit/2026-09-17-d7-data-inventory.md) · [报告](../test-reports/2026-09-17-w7-d7-inventory-test-report.md) · ADR 仍 `pending-compliance-signoff` |
| Agent 手册 | [AGENTS.md](../../AGENTS.md) |
| 意图双标签 busy 交接 | [./handoffs/2026-09-15-conversation-intent-dual-tab.md](./handoffs/2026-09-15-conversation-intent-dual-tab.md) |
| 受控正文 hash 漂移 W1–W6 | [../ops/handoffs/2026-09-14-controlled-content-canonical-hash.md](../ops/handoffs/2026-09-14-controlled-content-canonical-hash.md) |
| DOCREV ADR | [../adr/2026-09-13-document-version-boundary.md](../adr/2026-09-13-document-version-boundary.md) |
| DOCREV 管理测试 | [../test-reports/2026-09-13-document-revision-management-test-report.md](../test-reports/2026-09-13-document-revision-management-test-report.md) |
| DOCREV 运行时 UI Round20 | [../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md) |
| 纯软件项目自举设计 | [../system-design/2026-09-14-software-project-bootstrap-workflow.md](../system-design/2026-09-14-software-project-bootstrap-workflow.md) |
| 模块化单体解耦架构 | [../system-design/2026-09-14-module-decoupling-architecture.md](../system-design/2026-09-14-module-decoupling-architecture.md) |
| 模块解耦整改计划 | [../remediation/2026-09-14-module-decoupling-refactor-plan.md](../remediation/2026-09-14-module-decoupling-refactor-plan.md) |
| Phase 2 方案审阅 | [../audit/2026-09-15-module-decoupling-phase2-plan-review.md](../audit/2026-09-15-module-decoupling-phase2-plan-review.md) |
| Phase 2 修订计划 | [../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md) |
| 多意图 HITL 复核方案 | [../system-design/2026-09-15-multi-intent-hitl-plan.md](../system-design/2026-09-15-multi-intent-hitl-plan.md) |
| 多意图 HITL U1 契约 | [../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md) |
| 多意图 HITL U2 分段 | [../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) |
| 多意图 HITL U3 PG | [../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) |
| 多意图 HITL U4 投影 | [../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md](../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md) |
| 多意图 HITL U5 API | [../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md](../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md) |
| 多意图 HITL U6 Web | [../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md](../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md) |
| 多意图 HITL U8 generate | [../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md](../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md) |
| 多意图 HITL U7 只读 | [../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md](../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md) |
| 文档可靠性 M1 报告 | [../test-reports/2026-09-14-document-reliability-pilot-test-report.md](../test-reports/2026-09-14-document-reliability-pilot-test-report.md) |
| 文档可靠性 M1 活验 | [../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 | [../test-reports/2026-09-14-document-reliability-m2-test-report.md](../test-reports/2026-09-14-document-reliability-m2-test-report.md) |
| 文档可靠性 M3 U8 | [../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md](../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md) |
| 文档可靠性 M3 U9 | [../test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md](../test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md) |
| 文档可靠性 M4 U10 | [../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md) |
| 文档可靠性 M5/M6 U11–U12 | [../test-reports/2026-09-15-app-composition-u11-u12-test-report.md](../test-reports/2026-09-15-app-composition-u11-u12-test-report.md) |
| Track E E2 闭包守卫 | [../test-reports/2026-09-15-event-e2-hook-guard-test-report.md](../test-reports/2026-09-15-event-e2-hook-guard-test-report.md) |
| Track E 复盘 | [./research/2026-09-15-track-e-retrospective.md](./research/2026-09-15-track-e-retrospective.md) |
| 旁支清点收口 | [../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md](../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md) · [二次收口](../test-reports/2026-09-17-leftover-hygiene-test-report.md) |
| SSE/幂等审计 | [../audit/2026-09-13-document-revision-sse-idempotency.md](../audit/2026-09-13-document-revision-sse-idempotency.md) |
| 质量门禁自污染审计 | [../audit/2026-09-13-document-revision-quality-gate-self-pollution.md](../audit/2026-09-13-document-revision-quality-gate-self-pollution.md) |
| 当前文档路由审计 | [../audit/2026-09-13-document-revision-active-doc-routing.md](../audit/2026-09-13-document-revision-active-doc-routing.md) |
@@ -0,0 +1,74 @@
---
title: "模块解耦重构验收清单"
status: in_progress
created: 2026-09-14
updated: 2026-09-15
owner: Cursor
---
# 模块解耦重构验收清单
## M0 架构与基线
- [x] contracts 分类、事务 owner、表属主、锁顺序、事件信封、Principal 和 FAV 边界均有唯一规范来源。
- [x] arch-check 分离 production import、SQL write、path 和 event registration;例外有 owner 与到期日。
- [x] 当前违规基线可重复生成,新违规立即阻断。
## M1 文档可靠性
- [x] 人工编辑、agent commit、approve/reject 的跨表写入同事务(U3;隔离库双会话编辑已测)。
- [x] fault injection 任一点失败均无部分提交(U2 隔离库)。
- [x] 同 ETag 并发写只有一个赢家(内存 + 双会话)。
- [x] 1、2、4 app replicas 结果一致。
- [x] GET 服务端零写入 + typed consistency(U4 单测)。refresh/reload 真页面 PASS([活验报告](../../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md))。
- [x] 项目 143 等价 hazard 与新项目真实页面刷新、重登、restart、rebuild PASS。
- [x] 服务端负例 fail closed;浏览器跨用户 401/404 PASS。
## M2 事件与 FAV
- [x] 业务终态、staging 和 outbox 同事务。
- [x] 每个 consumer 有独立 delivery/inbox/attempt/lease/dead-letter。
- [x] 1、2、4 dispatcher 无重复可见副作用和永久饥饿。
- [x] crash-before/after-side-effect/ack 全部可恢复。
- [x] stale fencing、跨项目事件、错误 producer、坏 digest 均拒绝。
- [x] FAV 中间结果、Prompt、工具轨迹和 secret 准入率为零。
- [x] DB 授权成功后才允许 degraded read;授权图缺失 fail closed。
- [x] tombstone/删除账本 union-deny PASS。
## M3 TaskRun、workspace 与数据生命周期
- [x] RunManifest 规范字节、SHA、成员和 storage identity 持久化。
- [x] 重复 finalize、SSE 断线和 cancel race 不重复消息或 artifact。
- [x] WorkspaceRef 无物理路径,路径遍历和链接逃逸负例 PASS。
- [x] 旧 lease writer 被 fencing token 拒绝。
- [x] workspace 清空后最终成果仍可定位和校验。
- [x] backfill 可暂停、续跑和重放;异常进入 quarantine。
- [x] 八条 migration/reload/recovery 轨道 PASS。
- [x] 数据销毁前完整备份、corpus、FAV coverage 和人工批准全部满足。
## M4–M6 选择性扩展
- [x] 每个子切片在原包边界先获得行为收益,再决定物理搬包。
- [x] chatlog/contextasm 保持授权可见集合和计数一致。
- [x] app 是唯一组合根,subscriber 重复启动不重复注册。
- [x] UserProjectContext 跨模块写路径走类型化 ContextUpdate + 版本 CAS(coordinator 作为 owner 仍可改 Project 字段)。
- [ ] server 无 SQL、路径拼接和业务闭包。(OnOutbox 已迁出;生产 SQL 无新增;path 例外 `workspaces/` / `output.md` 未到期,未删)
- [ ] 对应架构规则全部 block,过期例外和 flags 已删除。(`import`/`event` 已 block;sql_write/path 基线例外仍在)
## 证据分层
- [x] Unit/stub 证据。
- [x] PostgreSQL integration 证据(隔离库,非共享 env 库)。
- [x] race/concurrency 目标包证据(非全仓 race)。
- [x] fault injection 证据(U2)。
- [x] 真实 PI 证据。
- [x] 真实浏览器证据。
- [x] restart/rebuild 证据。
- [x] cross-user/project authorization negative 服务端证据。
- [x] scratch recovery 与完整 DB restore 证据。
## 关闭条件
- [x] test report 回链具体 U-ID、commit、环境 identity 和 fixture/dataset。([U11–U12 报告](../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md);合入 `dev` 后补 rebuild 镜像)
- [x] CURRENT、FEATURE-MATRIX、gap-matrix 与任务状态一致。
- [x] 未实施后续仍为 planned/deferred,不用局部测试冒充全计划完成。
@@ -0,0 +1,22 @@
---
title: "多意图 HITL U1 契约冻结 checklist"
status: done
created: 2026-09-15
updated: 2026-09-15
related_task: "2026-09-15-multi-intent-u1-contracts"
---
# 多意图 HITL U1 契约冻结 checklist
## Wave 0
- [x] YAML `app/intentflow` allowlist + 三表 owner + unwrap_owners — 证据:`.doc/system-design/module-boundaries.yaml`
- [x] 三条 `intent.plan.*` YAML ↔ StaticContracts parity — 证据:`go test ./internal/events -run RegistryParity`
- [x] archtest 扫描 `intent.plan.*` — 证据:`go test ./internal/archtest`
- [x] intentflow 状态/错误码/Service/政策/legacy tier — 证据:`go test ./internal/app/intentflow`
- [x] CSRF/Bearer 结论落盘 — 证据:U1 short-term
- [x] `go test -short ./...` — 证据:[U1 报告](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,22 @@
---
title: "多意图 HITL U2 规则分段 checklist"
status: done
created: 2026-09-15
updated: 2026-09-15
related_task: "2026-09-15-multi-intent-u2-segmenter"
---
# 多意图 HITL U2 规则分段 checklist
## Wave 1
- [x] characterization 锁定 legacy IntentPlan — 证据:`internal/intent/plan_builder_test.go`;[报告 §5.1](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md)
- [x] 分段器 golden(连接词/句号/序号/先再最后) — 证据:[proposal-verbose.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/proposal-verbose.txt)
- [x] 查询并总结不拆;写段进入提案;5 段拒绝;红线整体拒绝;指代澄清 — 证据:同上
- [x] digest 稳定;shadow 不改 TopIntent — 证据:`TestPlanProposal_DigestStable` / `TestPlanProposal_WriteNotDroppedAndLegacyUnchanged`
- [x] 反事实 auto_read 错误自动执行 = 0 — 证据:`plan-proposal eval denom=8 false_auto_execute=0`
- [x] `go test -short ./internal/intent ./internal/coordinator ./internal/app/intentflow` — 证据:[unit.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/unit.txt);[short.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/short.txt)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,22 @@
---
title: "多意图 HITL U3 intentflow PG checklist"
status: done
created: 2026-09-15
updated: 2026-09-15
related_task: "2026-09-15-multi-intent-u3-intentflow-pg"
---
# 多意图 HITL U3 intentflow PG checklist
## Wave 2
- [x] Goose 00044 三表 + unique/CAS/lease 列 — 证据:`deploy/postgres/goose/00044_2026-09-15-intent-plans.sql`;`TestGooseU3_00044_HasUpAndDown`
- [x] 创建幂等与同 turn 异 digest — 证据:[plans-verbose.txt](../../test-reports/assets/2026-09-15-multi-intent-u3-intentflow-pg/plans-verbose.txt)
- [x] 决策 nonce / revision CAS / 过期 — 证据:同上
- [x] 两 worker 无双 owner;租约接管;旧 fence 拒绝 — 证据:`TestTwoWorkersOneOwnerAndLeaseTakeover`
- [x] receipt 对账不盲跑;环境隔离;legacy HandleTurn 不落盘 — 证据:`TestReceiptWritebackFailureDoesNotRerun` / `TestHandleTurnLegacyDoesNotPersist`
- [x] Assemble 接线且 chat 不调用;arch-check 无新例外 — 证据:[short.txt](../../test-reports/assets/2026-09-15-multi-intent-u3-intentflow-pg/short.txt)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,19 @@
---
title: "多意图 HITL U4 outbox checklist"
status: done
created: 2026-09-16
updated: 2026-09-16
related_task: "2026-09-16-multi-intent-u4-outbox-projection"
---
# 多意图 HITL U4 outbox checklist
- [x] 同 UoW Append intent.plan.* — 证据:[emit-verbose.txt](../../test-reports/assets/2026-09-16-multi-intent-u4-outbox-projection/emit-verbose.txt)
- [x] golden payload 无敏感字段 — 证据:`testdata/intent-plan-awaiting-v1.json`
- [x] 重复/乱序/伪造 producer — 证据:`TestProjectionOnlyForwardAndForgedRejected`
- [x] 投影只前进;跨用户隔离 — 证据:同上
- [x] dispatcher 语义未改;arch-check 绿 — 证据:[short.txt](../../test-reports/assets/2026-09-16-multi-intent-u4-outbox-projection/short.txt)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,20 @@
---
title: "多意图 HITL U5 decision API checklist"
status: done
created: 2026-09-16
updated: 2026-09-16
related_task: "2026-09-16-multi-intent-u5-decision-api"
---
# 多意图 HITL U5 decision API checklist
- [x] 冻结 REST 路径挂到认证 mux — 证据:[http-verbose.txt](../../test-reports/assets/2026-09-16-multi-intent-u5-decision-api/http-verbose.txt)
- [x] Principal 不从 body 复制 — 证据:`TestIntentPlanHTTP_IgnoresBodyPrincipalAndSameReceipt`
- [x] 非成员/跨作用域/管理员负例 — 证据:`TestIntentPlanHTTP_ScopeNegatives` / `AdminDoesNotBypassMembership`
- [x] StepAuthorizer 在 confirm 与 execute 前调用 — 证据:[authorize-verbose.txt](../../test-reports/assets/2026-09-16-multi-intent-u5-decision-api/authorize-verbose.txt)
- [x] stale/nonce/edit/非法部分确认 — 证据:同上
- [x] arch-check / short 绿 — 证据:[short.txt](../../test-reports/assets/2026-09-16-multi-intent-u5-decision-api/short.txt)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,19 @@
---
title: "多意图 HITL U6 Web checklist"
status: done
created: 2026-09-16
updated: 2026-09-16
related_task: "2026-09-16-multi-intent-u6-web-cards"
---
# 多意图 HITL U6 Web checklist
- [x] PLAN_CONFIRM 类型与 PlanView 映射 — 证据:`web/src/engine/planCard.test.ts`
- [x] 决策走 REST,不改 AST — 证据:`planCardTouchesLocalAST` + App early-return
- [x] 409/过期/submitting 状态 — 证据:同上
- [x] App early-return — 证据:`web/src/App.tsx`
- [x] 单元测试绿;Playwright 门控 skip — 证据:[npm-test.txt](../../test-reports/assets/2026-09-16-multi-intent-u6-web-cards/npm-test.txt)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -0,0 +1,14 @@
---
title: "U7 auto_read checklist"
status: done
created: 2026-09-16
related_task: "2026-09-16-multi-intent-u7-auto-read"
---
# U7
- [x] legacy HandleTurn 不落盘
- [x] auto_read 查询创建并执行
- [x] 写话语不落盘
- [x] QueryGuard 拒绝 task.run
- [x] chat 调用 HandleTurn;arch 绿
@@ -0,0 +1,23 @@
---
title: "U8 task generate checklist"
status: done
created: 2026-09-16
updated: 2026-09-16
related_task: "2026-09-16-multi-intent-u8-task-generate"
---
# U8
- [x] confirm 话语落盘 awaiting,确认前不执行 — 证据:`TestHandleTurnConfirmPersistsAwaitingWithoutExecute`
- [x] 第二活动写计划冲突 — 证据:`TestHandleTurnConfirmRejectsSecondActiveWritePlan`
- [x] OwnerMux 路由 + nil Task fail closed — 证据:`TestOwnerMuxRoutesGenerateToTask` / `TestOwnerMuxNilTaskFailClosed`
- [x] 确认后 generate 一次、重放不双跑 — 证据:`TestConfirmThenMuxExecutesGenerateOnce`
- [x] adapter 幂等 / 拒查询 / 撤销 — 证据:`TestTaskRunAdapter*`
- [x] LiveTaskStarter 同键重放 — 证据:`TestLiveTaskStarterReplaysIdempotencyKey`
- [x] QueryGuard 仍拒 task.run;auto_read 写话语不落盘 — 证据:U7 回归 + `TestQueryGuardRejectsGenerate`
- [x] 真实 PI stop-gate — 证据:`TestTaskGenerateRealPIStopGate` SKIP
- [x] arch-check block 绿 — 证据:[报告](../../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md)
## 完成定义
- [x] 全部勾选且有证据链接
@@ -8,8 +8,6 @@ status: closed
# 交接:Herdr Agent 治理分支待集成
> **superseded 2026-09-14**:Herdr 角色/脚本已从活文档移除;本交接仅作历史证据。见 [.././2026-09-14-remove-herdr-agent-settings.md](.././2026-09-14-remove-herdr-agent-settings.md)。
## 目标(下一位 Agent 应完成什么)
治理规范已完成并准备合入 `dev`;本文件保留为集成证据。
@@ -38,9 +36,9 @@ status: closed
| 路径 | 说明 |
|------|------|
| `.doc/archive/ops/2026-09-13-herdr-agent-roster.md` | 角色与路由 SSOT(已归档) |
| `scripts/herdr-agent-start.sh` | 免人工审批启动入口(已删除) |
| `scripts/herdr-agent-dispatch.sh` | 主备派发与防重复策略(已删除) |
| `.doc/ops/2026-09-13-herdr-agent-roster.md` | 角色与路由 SSOT |
| `scripts/herdr-agent-start.sh` | 免人工审批启动入口 |
| `scripts/herdr-agent-dispatch.sh` | 主备派发与防重复策略 |
| `AGENTS.md` / `PROJECT.md` | 强制入口与 PI 身份边界 |
## 如何验证
@@ -61,5 +59,5 @@ git diff --check
## 相关链接
- CURRENT: [CURRENT.md](../CURRENT.md)
- Task: [2026-09-13-herdr-agent-governance.md](./2026-09-13-herdr-agent-governance.md)
- Task: [2026-09-13-herdr-agent-governance.md](../../archive/ops/2026-09-13-herdr-agent-governance.md)
- Checklist: 任务文中的验收标准
@@ -0,0 +1,67 @@
---
title: "意图 mutex 从 Codex 转 Cursor:仅剩浏览器双标签门"
created: 2026-09-15
from: Codex
to: Cursor
status: closed
---
# 交接:对话意图运行时状态 — 浏览器双标签门
## 目标(下一位 Agent 应完成什么)
在 U11–U12 已合入并 rebuild 的 `:8080` 上,用**新建项目**补齐真实 PI + 双标签 busy / 刷新恢复证据。通过则关 `CHAT-INTENT-STATE` 并 archive;失败则从最新 `dev` 新开 `fix/conversation-intent-dual-tab`,**不要**在已合入的 `fix/conversation-intent-state` 上追加。
## 已完成
- Wave 0–4 服务端/单测已在 `dev`(`fix/conversation-intent-state` 是祖先)。
- 前端 5s 租约轮询:`web/src/App.tsx`。
- `DOC_BUSY` 预检:`internal/server/task_run_handlers.go`(不创建第二 run,`error_info.actions=[]`)。
- UI busy 文案:`BlockRenderer` / `DeckDrawer`「编辑中」。
- 只读总结真实 PI(用例 H)已签;项目 143 诊断污染未删。
## 未完成
- 浏览器刷新恢复与双标签租约可见性(报告用例 E)。
- 整改 Wave 3–4 未勾项:运行中刷新、busy 自动解除、并发写不新增 run 的**活验证据**。
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | no(`intent` 转 Cursor `in_progress`) |
| 集成槽位 holder | idle(U11–U12 已释放;本门禁不占槽,除非要合入 UI 补丁) |
| branch | 编码已在 `dev`;活验文档用 `docs/conversation-intent-dual-tab` |
| worktree | `.worktrees/fix-conversation-intent-state` **禁止** `env-service` |
> 用户已要求关掉 CURRENT 两行 `in_progress`,授权 Cursor 接管剩余验收。不覆盖 Codex worktree 未合并代码。
## 关键文件
| 路径 | 说明 |
|------|------|
| `.doc/ops/short-term/2026-09-13-conversation-intent-runtime-state.md` | 任务文 |
| `.doc/test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md` | 用例 E 待补 |
| `.doc/remediation/2026-09-13-conversation-intent-runtime-state-remediation.md` | Wave 3–4 |
| `web/src/App.tsx` | 5s lease 轮询 |
| `internal/server/task_run_handlers.go` | DOC_BUSY 预检 |
## 如何验证
```bash
# 主仓已 rebuild 的 dev,禁止 worktree 内 env-service
curl -sf http://127.0.0.1:8080/ready
# 新建项目 + 隔离 session;禁止项目 143;禁止 sess-p143-u9 探针
```
## 风险 / Blocker
- 项目 143 只读:不终止、不改写、不打探针。
- 客户端在 lease 已投影后会本地拦截写请求(不发 POST);HTTP 409 须在轮询窗口内或走 API 第二通道取证。
- 诊断污染消息仍不擅自删除。
## 相关链接
- CURRENT: [CURRENT.md](../CURRENT.md)
- Task: [../short-term/2026-09-13-conversation-intent-runtime-state.md](../short-term/2026-09-13-conversation-intent-runtime-state.md)
- Test report: [../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md](../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md)
@@ -0,0 +1,66 @@
---
title: "Wave 0 FEATURE-MATRIX 校准完成 → 待合 dev / Wave 1"
created: 2026-09-16
from: Cursor
to: next-agent
status: done
---
# 交接:FEATURE-MATRIX Wave 0 完成后
## 目标(下一位 Agent 应完成什么)
1. 开启 **Wave 1**:PU3 IAM fail-closed + PU5A TempDir race flake(独立 `fix/*` / `feature/*`,分 mutex `authz` / `ci`)。
2. 勿把 Wave 0 的 `done` 行当作真实 PI 补证已完成;U8 / full-none 仍归 Wave 2。
## 已完成
- PU1:FEATURE-MATRIX 状态契约、行模板、status README
- PU2:按冻结边界收口 L1 / Chat baseline / DocRev baseline / 前端 / 可靠事件;拆出 D3、D7、PI 叙事、U9–U12、FAV、artifact promotion
- 修正漂移:schema 47、D3≠D5、IAM 历史缺口文案、事件与 FAV 拆行
- 历史指针:multi-intent 设计、Phase2 remediation、HTTP envelope、Track E 复盘
- IAM 只读核验:dev/test/main schema 47、IAM 表齐全、`ALLOW_IN_MEMORY=false`;**未**证实 MemoryStore 旁路 → **保持** `production_ready=yes`,未新增 gap-matrix blocker
- 文档已 `--no-ff` 合入 `dev`;**未** push
## 未完成
- Wave 1+(IAM 代码 fail-closed、race、真实 PI 补证、nightly/receipt)
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | yes |
| 集成槽位 holder | idle(合入后已释放) |
| branch | 已合入 `dev`(merge commit) |
| worktree | `.worktrees/feature-matrix-production-readiness-plan`(可移除) |
## 关键文件
| 路径 | 说明 |
|------|------|
| `.doc/status/FEATURE-MATRIX.md` | 校准后能力矩阵 |
| `.doc/ops/short-term/2026-09-16-feature-matrix-wave0-calibration.md` | Wave 0 任务与 IAM 证据 |
| `.doc/remediation/2026-09-16-feature-matrix-production-readiness-plan.md` | 五波总计划 |
| `.doc/audit/2026-09-16-feature-matrix-production-readiness-audit.md` | 审计 |
| `.doc/remediation/gap-matrix.md` | 仅增加 Wave 0 核验注记;`production_ready=yes` |
## 如何验证
```bash
# 在 worktree
git diff --check
# 人工对账 FEATURE-MATRIX / CURRENT / gap-matrix 叙事一致
# IAM 只读证据见 short-term「证据 / 备注」
```
## 风险 / Blocker
- `store_factory.go` 仍可能在缺表时 silent MemoryStore → Wave 1 必须 fail-closed;当前部署未触发。
- 合入前确认主仓 CURRENT 与 worktree 无冲突(主仓可能另有 matrix-deep-test 认领行)。
## 相关链接
- CURRENT: [CURRENT.md](../CURRENT.md)
- Task: [../short-term/2026-09-16-feature-matrix-wave0-calibration.md](../short-term/2026-09-16-feature-matrix-wave0-calibration.md)
- Remediation: [../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md](../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md)
@@ -0,0 +1,41 @@
---
title: "Gitea nightly secrets 已本机配置"
created: 2026-09-16
from: Cursor
to: any
blocker: false
---
# Gitea nightly secrets 已本机配置
## 已配置(weichen/Agent-System)
**Secrets**(API,值不入库):
- `RUNNER_AUTH_TOKEN` ← `configs/.env.dev`
- `NIGHTLY_TEST_DATABASE_URL` → `127.0.0.1:5434/agent_wave2_pi`
**Variables**:
- `PI_AGENT_RUNNER_URL=http://127.0.0.1:18865`
- `PI_AGENT_MODEL` ← `.env.dev` MINIMAX_MODEL_ID
## Runner(本机 `/home/weichen/gitea`)
- label:`nightly:host`(写入 `runner/data/.runner`,勿只改 compose)
- `network_mode: host` + `address=http://127.0.0.1:3000`(PI 只绑 `127.0.0.1:18865`,bridge 不可达)
- 挂载 brew + 宿主机 glibc + `/usr/bin/docker` + `/host-agent-data`(仓库 `data/`)
- workflow:`DATA_DIR=/host-agent-data/test`;artifact 用本地 tar(Gitea 不支持 upload-artifact@v4)
- `run-nightly-real-pi.sh`:全 SKIP / 镜像构建失败 → `infra_fail` receipt(不再 silent exit 127)
## 验证
- run#15:缺 node → FAIL
- run#17:checkout/setup-go PASS;curl 缺失 → `infra_fail`;upload-artifact@v4 → GHESNotSupported
- run#19:curl/PI OK;缺 docker + 无 DATA_DIR → SKIP 后 exit 127、无 receipt
- run#21:DATA_DIR+docker OK;用例真实执行;receipt=`product_fail`;archive/summarize PASS
(产品失败属套件本身,非 runner/secrets 配置问题)
## 触发
Gitea Actions → Nightly Real PI → Run workflow;或 schedule UTC 16:00。
@@ -0,0 +1,33 @@
---
title: "Phase 3 遗留清点收口"
created: 2026-09-16
from: Cursor
to: any
blocker: false
---
# Phase 3 遗留清点收口
## 已关闭本轮
| 项 | 处置 |
|----|------|
| N7 U8 `quality_failed` 偶发 | `run-nightly-real-pi.sh` 对 quality_failed 全文重试一次;仍失败则 `product_fail`(非 PASS)。根因:模型质量门,非 secret/runner。 |
| Playwright intent-plan 双标签 | 正式长期 gated + long-term 契约;矩阵关闭条件写死 |
| Wave3 PU6–PU8 | 已 no-go(Phase 2) |
| Artifact same-image | Wave2C done |
## 保留开放(需产品/另任务,不假装 done)
| 项 | 说明 |
|----|------|
| IAM 全路由 inventory | 仍开放;fail-closed 核心已签 |
| session 中断负例 / 410 退役 | 需产品拍板 |
| R13 全量清单勾选 | nightly 脱敏证据路径已有;完整 R13 矩阵另开 audit |
| deterministic/B1–B4 持续回归 | 合入冒烟覆盖 short;全量门禁保持现有 CI |
| FAV / 旁支分支 | CURRENT 已声明故意不合入 |
## 下一步
- 配置 Actions `RUNNER_AUTH_TOKEN` + `NIGHTLY_TEST_DATABASE_URL` 使 nightly 真跑
- 获批后按 long-term 契约开 PU6–PU8 / Playwright 实现任务
@@ -0,0 +1,47 @@
---
title: "选择性模块解耦 M4–M6"
status: planned
created: 2026-09-14
updated: 2026-09-14
owner: TBD
mutex: architecture
review_cycle: milestone
---
# 选择性模块解耦 M4–M6
## 目标
在文档可靠性、可靠事件和 FAV 已证明收益后,按 U10–U12 分别收敛 chatlog/contextasm、应用组合根、共享上下文和传输层。
## 为什么是长期任务
这些改动不直接修复当前受控正文事实源问题,且会触及仍在进行的 chat/intent 工作。
M1–M3 未通过前执行会扩大冲突面,并提前冻结未经真实消费者验证的契约。
## 触发条件
- M1–M3 的 test report 全部 PASS。
- 同类缺陷触达文件数和运行故障率表明继续解耦具有收益。
- `chat`、`intent`、`bizdev/coordinator`、`server/stream` mutex 按子切片释放。
- 每个子切片有独立 owner、回滚点和行为验收,不批准一个巨型 Wave。
## 候选子任务
1. U10 chatlog/contextasm 原地端口化。
2. U11a 唯一 app composition root。
3. U11b 按事件逐个替换闭包桥。
4. U11c 逐 use case 迁移 ExecuteTask/executeStageInternal。
5. U11d UserProjectContext snapshot/update 收权。
6. U12 server/SSE 边界和架构门禁收口。
## 不包含
- 错误信封统一。
- PI Runner result.json 协议。
- 微服务拆分。
## 相关链接
- [模块解耦整改与重构计划](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- [模块化单体解耦架构](../../system-design/2026-09-14-module-decoupling-architecture.md)
@@ -1,8 +1,8 @@
---
title: "纯软件项目自举工作流实施"
status: planned
status: in_progress
created: 2026-09-14
updated: 2026-09-14
updated: 2026-09-17
---
# 纯软件项目自举工作流实施
@@ -22,6 +22,19 @@ updated: 2026-09-14
- 真实 PI 和 Ubuntu 无头浏览器黄金项目验收通过;
- 未实现受控代码执行前,系统不会直接修改项目仓库。
## 实施进度(2026-09-17)
| Epic | 状态 | 说明 |
|------|------|------|
| SWBOOT-00 | done(契约) | ADR `.doc/adr/2026-09-16-software-project-bootstrap-keys.md` |
| SWBOOT-01 | done(迁移) | goose `00048` additive;已合 `dev` |
| SWBOOT-02..04 | done(L1) | manifests + catalog 五 key;医疗三门禁保留;已合 `dev`(`f0029df`) |
| SWBOOT-05..08 | done(W5a) | catalog 驱动创建向导;软件不克隆医疗 7 模板;solo 未独立评审标注 |
| SWBOOT-09 | partial | docs_only 真实 PI 已出;无头浏览器全向导仍 NOT RUN |
| SWBOOT-10 | stub only | allowlist + fail-closed;真 patch/merge 归 W5b,本轮不实施 |
L1(SWBOOT-00…09 契约/迁移/目录钩子 + SWBOOT-10 stub)**已合入 `dev`**。后续由 [partial/deferred W5](../short-term/2026-09-16-partial-deferred-completion.md) 承接:W5a = UI + `docs_only` 真实 PI;W5b = 受控执行器(独立安全评审)。
## 实施拆分
| Epic | 范围 | 依赖 | 验收 |
@@ -46,9 +59,9 @@ updated: 2026-09-14
- 文档版本运行时 Round20 能力作为文档链基线;
- 用户确认首期执行模式及 solo/collaborative 策略。
## 暂不启动原因
## 剩余工作
本轮用户要求先梳理和制定详细方案;业务代码、迁移、模板和智能体配置尚未授权进入实施。本任务保持 `planned`,启动时须从 `dev` 新建独立 feature 分支,并在 CURRENT 认领 `workflow-design`/相应拆分 mutex。
L1 已合 `dev`。W5a 从 `dev` 开 `feature/w5a-software-bootstrap-ui-pi`(mutex `workflow-design`)。W5b 受控执行器未启动,SWBOOT-10 保持 fail-closed stub。
## 相关链接
@@ -0,0 +1,27 @@
---
title: "Playwright intent-plan 双标签 — 长期 gated"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/intent-plan-cards-playwright
mutex: web
---
# Playwright intent-plan 双标签 — 长期 gated
## 现状
- short-term / 报告已关闭:见 [../short-term/2026-09-16-intent-plan-playwright-dual-tab.md](../short-term/2026-09-16-intent-plan-playwright-dual-tab.md) 与 [../../test-reports/2026-09-16-intent-plan-playwright-dual-tab-test-report.md](../../test-reports/2026-09-16-intent-plan-playwright-dual-tab-test-report.md)
- `RUN_UI_ACCEPTANCE=1` 真浏览器 PASS(Docker Playwright);默认 skip
- **不升** `MULTI_INTENT_PLAN_TIER`
## 关闭条件
1. 独立 short-term + `RUN_UI_ACCEPTANCE=1` 真浏览器:双标签 confirm 不同时本地成功
2. 刷新/重登后与 PG plan 一致
3. 报告归档 `.doc/test-reports/`;不升 MULTI_INTENT tier
## 非目标
- 用 stub/SKIP 冒充 PASS
@@ -0,0 +1,33 @@
---
title: "PU6 语义摘要 D3 — 获批后任务契约"
status: done
created: 2026-09-16
updated: 2026-09-17
owner: Cursor
branch: feature/w2-semantic-summary-shadow-live
mutex: chat
go_no_go: go
---
# PU6 语义摘要 D3 — 获批后任务契约
**go/no-go**:GO。脚手架 + W2 live 已合 `dev`。`SEMANTIC_SUMMARY_SHADOW` 默认 off;开 flag 时组合根注入产品 PI no-tool summarizer。**不启用** `SEMANTIC_SUMMARY_REPLACE`。
## 目标
在授权可见集合上 shadow 语义摘要,可解释 fallback;REPLACE 为后置独立授权任务。
## 预注册门
- flag:`SEMANTIC_SUMMARY_SHADOW` → 可选 `SEMANTIC_SUMMARY_REPLACE`(本轮不启用)
- 输入:authorized view only;无工具权限摘要器;R13 出站门
- 失败:保留旧摘要/deterministic;标注 freshness
- 负例:撤权消息不入摘要;injection 不能改权限
## 路径提示
`internal/ctxmgr/summarizer.go`、`internal/ctxmgr/semantic_summary.go`、`internal/app/chatflow/`、`internal/server/chat_digest_api.go`、`internal/agent/piagent.go`
## 回滚
关 flag;读路径回 deterministic;保留历史证据指针
@@ -0,0 +1,38 @@
---
title: "PU7 PI change-report 叙事 — 获批后任务契约"
status: done
created: 2026-09-16
updated: 2026-09-17
owner: Cursor-Auto
branch: feature/pu7-pi-narrative
mutex: docgov
go_no_go: go
---
# PU7 PI change-report 叙事 — 获批后任务契约
**go/no-go**:GO(用户覆盖授权,见 Wave3 research)。脚手架已合 `dev`;W3 live(产品 PI + digest 绑定)已接线,默认 flag 仍 off。
## 目标
只读消费 immutable diff+lineage+risk floor 的 PI 叙事;任意 schema/超时/注入 → 全量 fallback。
## 预注册门
- flag:`PI_CHANGE_REPORT_NARRATIVE`(默认 off)
- 禁止覆盖服务端风险/审批结论
- typed schema + input digest 绑定(`change_report_narrative_v1`)
- UI 明确区分 narrative vs 事实字段
## 路径
- `internal/docrevision/flags.go` / `narrative.go` / `service.go`
- `deploy/pi-agent/change-report-narrative-v1.mjs`
- `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)
## 回滚
关 flag;仅 deterministic fallback;无第二份 candidate
@@ -0,0 +1,19 @@
---
title: "PU8-U10 mutate — 获批后任务契约"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
mutex: intent-plan
go_no_go: go
flag: MULTI_INTENT_U10_MUTATE
---
# PU8-U10 mutate
**go/no-go**:GO(覆盖授权)。独立 flag 脚手架已合 `dev`。W4:dry-run→confirm 幂等 receipt 证据;mutex `intent-plan`。不升 `MULTI_INTENT_PLAN_TIER`。报告:[../../test-reports/2026-09-17-w4-u10-mutate-test-report.md](../../test-reports/2026-09-17-w4-u10-mutate-test-report.md)
## 负例
未确认、越权、stale revision、重复提交 → 零越界副作用。
@@ -0,0 +1,15 @@
---
title: "PU8-U11 docgov action — 获批后任务契约"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
mutex: intent-plan
go_no_go: go
flag: MULTI_INTENT_U11_DOCGOV
---
# PU8-U11 docgov
**go/no-go**:GO(覆盖授权)。独立 flag 脚手架已合 `dev`。W4:项目 143 只读 fail-closed。mutex `intent-plan`。报告:[../../test-reports/2026-09-17-w4-u11-docgov-test-report.md](../../test-reports/2026-09-17-w4-u11-docgov-test-report.md)
@@ -0,0 +1,15 @@
---
title: "PU8-U12 workflow/run-control — 获批后任务契约"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
mutex: intent-plan
go_no_go: go
flag: MULTI_INTENT_U12_RUN_CONTROL
---
# PU8-U12 workflow/run-control
**go/no-go**:GO(覆盖授权)。独立 flag 脚手架已合 `dev`。W4:独立 flag dry-run 证据。不升 `MULTI_INTENT_PLAN_TIER`。报告:[../../test-reports/2026-09-17-w4-u12-run-control-test-report.md](../../test-reports/2026-09-17-w4-u12-run-control-test-report.md)
@@ -0,0 +1,19 @@
---
title: "PU8-U9 segment proposal — 获批后任务契约"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
mutex: intent-plan
go_no_go: go
flag: MULTI_INTENT_U9_SEGMENT
---
# PU8-U9 segment proposal
**go/no-go**:GO(覆盖授权)。flag 脚手架已合 `dev`。W4:真实 LLM proposer;规则能判断则不出 proposal。不升 `MULTI_INTENT_PLAN_TIER`。报告:[../../test-reports/2026-09-17-w4-u9-segment-test-report.md](../../test-reports/2026-09-17-w4-u9-segment-test-report.md)
## 安全 stop gate
授权旁路 / 跨用户泄漏 / B1–B4 回归 → 停全部扩面并写 gap-matrix。
@@ -0,0 +1,55 @@
---
title: "H0 HTTP/SSE 公开错误信封盘点"
created: 2026-09-15
status: done
confidence: high
---
# 调研:H0 HTTP/SSE 公开错误信封盘点
## 结论
`Server.Routes()` 现有 **122** 条公开路由。错误响应至少三种并存:纯文本 `http.Error`、`{"error","message"}` JSON、以及 SSE `error_info`(`user_message/code/class/request_id`)。前端设置页已按 `error` code 分支,聊天流走 `error_info`;大量文档/任务路由仍回传 `err.Error()`,H1 必须 additive 统一,不能先改状态码。
## 证据
| 项 | 路径/命令 | 结果 |
|----|-----------|------|
| 路由清单 | `internal/server/server.go` `Routes()` | 122 条 `mux.HandleFunc` |
| 纯文本/拼接 error | `handlers.go`、`task_run_handlers.go`、`asset_handlers.go`、`sse.go` | `http.Error(w, err.Error(), …)` 会泄露内部原因 |
| JSON `{error,message}` | `project_settings_handlers.go`、`project_members_handlers.go`、`auth_helpers.go`、`chatflow_http.go` | 已有 `ERR_*` / `PLAN_FROZEN` 等稳定 code |
| SSE | `internal/stream/types.go` `ErrorInfo`;`classify.go` 固定 `UserMessage` | 有 `request_id`;`error` 字符串与 `error_info.user_message` 并存 |
| 前端 code 分支 | `web/src/api/projectSettingsError.ts` | `PLAN_FROZEN` / `PLAN_REVISION_CONFLICT` / `ERR_CONCURRENT_SWITCH` |
| 前端文案匹配 | `web/src/App.tsx` `detail.includes('无权访问该项目')` | 未知 code 仍靠 substring |
## 兼容风险
| 家族 | 代表路由 | 现状 | H1 风险 |
|------|----------|------|---------|
| 纯文本 | `POST /api/v1/chat`、`POST /api/v1/tasks/runs` | `Content-Type` 非 JSON,正文即 message | 前端若按 JSON 解析会失败;须 additive 保留旧正文或双写 |
| JSON error+message | 设置/成员/鉴权 | `error` 当 code | 与目标 `code` 字段同义;H1 应同时输出 `code` 与 `error` |
| SSE error_info | `/api/v1/chat/stream`、task stream | 已有 code/class/request_id | 与 HTTP 信封字段名不完全对齐(`user_message` vs `message`) |
| 授权拒绝 | `ERR_UNAUTHENTICATED` / `ERR_FORBIDDEN` | 部分 JSON、部分纯文本 | 统一后仍须不泄露资源存在性 |
## 建议映射(领域 → 目标 wire code)
| 领域情况 | 目标 code | 备注 |
|----------|-----------|------|
| 未登录 | `AUTHZ` | 不区分用户是否存在 |
| 项目/文档无权 | `AUTHZ` | 与 404 策略保持现有授权选择 |
| 参数/校验 | `VALIDATION` | details 只允许公开字段名 |
| 版本/修订冲突 | `VERSION_CONFLICT` | 现 `PLAN_REVISION_CONFLICT` 映射 |
| 幂等/重复提交 | `IDEMPOTENCY_CONFLICT` | 任务 run 已有 idempotency |
| 规划冻结 | `VALIDATION` 或保留 `PLAN_FROZEN` | H3 前不得改状态码 |
| 内部错误 | `INTERNAL` | 仅 `request_id`;禁止 SQL/路径/凭证 |
## 开放问题
- H1 是否把 SSE `user_message` 与 HTTP `message` 做成别名双写,需实施时定,不阻塞立项。
- 状态码 breaking 必须另写 ADR(H3)。
## 建议动作
- H1:envelope registry + request ID 中间件;旧 `error` 字段 additive 保留。
- 负例:XSS、路径、SQL、token、prompt、跨租户 ID 不得进入 `message`/`details`。
- 实施见 [HTTP 信封整改](../../remediation/2026-09-15-http-error-envelope-remediation.md)。
@@ -0,0 +1,149 @@
---
title: "模块解耦与 IPC/RPC 交互现状评估(复核修订版)"
status: done
created: 2026-09-15
updated: 2026-09-15
author: Cline
confidence: high
---
# 调研:模块解耦与 IPC/RPC 交互现状评估
## 结论
1. 系统采用模块化单体,不应把所有模块调用改成 IPC/RPC。当前已运行的外部传输边界有两条:Web 与 server 的 HTTP/SSE、Go server 与 PI Agent Runner 的 HTTP。`cmd/events` 和 FAV worker 是计划中的独立进程,不是已运行事实。
2. 端口、组合根、事件信封、RunManifest、幂等键和 arch-check 提供了可执行的边界基础;`import=0/event=0` 只表示没有超出现有 allowlist/baseline 的新违规,不能证明语义解耦已经完成。
3. 首要可靠性缺口是事件“部分生产、没有生产级消费闭环”。`internal/events/pg.go` 尚无原子 lease、ack/fail、retry/dead-letter 的完整实现;现有 dispatcher 测试覆盖 MemoryBus,不是 PostgreSQL 运行证据。
4. 最大结构扩散源仍是 bizdev service locator。另有 `docgov → docrevision` 单向 canonical/hash 工具依赖、chat/coordinator 扇出和 `intent → bizdev` 依赖。此前“docgov↔docrevision 双向 import”的结论不成立。
5. HTTP 错误信封与 PI Runner typed result 是独立协议债,不应阻塞持久事件链关闭。FAV 分支也不应成为 notify/projection 交付的前置条件。
## 1. 通信边界
| 边界 | 机制 | 当前状态 |
|---|---|---|
| Web ↔ server | `/api/v1/*` HTTP + SSE | 已运行;错误信封仍未统一 |
| Go ↔ PI Agent Runner | HTTP + Bearer;health/run/cancel/search | 已运行;结果仍依赖 legacy stdout/result.json 路径 |
| 单体内模块 | 消费者端口 + `internal/app` 组合根 | 已运行;bizdev locator 和部分直依赖仍扩大改动面 |
| 领域事件 | PG envelope/delivery schema | 写侧部分存在;生产 dispatcher 未闭环 |
| `cmd/events` | 计划中的独立 worker | 尚未实现/部署 |
| FAV worker | 独立审计轨道 | 分支未整支合入;不得作为本轮验收前置 |
不建议把单体内端口改成 RPC。那会增加序列化、延迟、部分失败与运维成本,却不消除当前 locator、授权、幂等和事件消费缺口。
## 2. 已有契约与真实边界
### 已有且可校验
- `.doc/system-design/module-boundaries.yaml` 与 `internal/archtest` 管理 import、SQL write、path 和 event 规则。
- `events.Envelope` schema 1 包含 event/aggregate/correlation/causation/idempotency/digest/producer 等字段,并校验 digest 与敏感字段。
- `taskrun.RunManifest` schema 1 使用 canonical JSON 与 SHA-256。
- TaskRun 同 idempotency key 异 request digest 返回冲突;文档写使用 expected head/ETag。
- backend 选择由服务端 allowlist 控制,出站数据经过 secret stripping。
- `module-boundaries.yaml` 已有 `event_producers` 与 `event_consumers` 段。后续工作是补全并校验 runtime registry parity,不是新建段落。
### 尚未闭合
- `PGSink.Append`/`InsertEnvelope` 已存在,但 `ClaimIDs` 仍是 SELECT-only claim;没有生产级 lease 获取、heartbeat、fenced ack/fail、retry、dead-letter 和 immutable attempt audit 闭环。
- `event_deliveries` 每个 event/consumer 一行,只保存当前状态和累计 attempt;无法还原每次 lease/attempt 历史。
- `internal/events/replay.go` 只检查 dry-run 与 consumer/operator/reason 等基础字段,尚未形成带认证主体、env/project/event scope、plan digest 和 apply 审计的应用用例。
- `docflow` envelope 仍存在 `Environment:"dev"`、`ProjectID:0`,且 `Fav.StageAgentCommit(ctx, 0, ...)` 使用错误项目作用域。
- 部分 server 路径临时构造 `docflow.Commands`,没有稳定注入 EventSink/UoW;不能假设 candidate-ready、downstream-impact、approved 三条链已经产生可供 shadow 的事件。
- 闭包 hook 没有版本、重试、delivery 或 replay 记录。
## 3. 耦合点
### 3.1 bizdev service locator
`bizdev.Service` 暴露 `Pool()/CAS()/DocGov()/DocRevision()/ProjectWorkflow()/FreeformDoc()/KB()/ContextManager()`。调用方可以绕过端口取得数据库池和其他模块实现,令签名或构造变化向多包扩散。
整改应先加 no-new-callers 门禁,再逐调用方迁移,最后在一个 contract 提交删除 8 个 getter。门禁应禁止领域/用例 API 暴露或转发 pool/tx,同时允许 app/cmd 组合根向表属主构造器注入 pool,并允许登记属主从 opaque TxScope 解出 tx。
### 3.2 docgov 到 docrevision 的单向工具依赖
生产依赖方向是 `docgov → docrevision`。直接用途集中在 Markdown canonicalization 与 SHA helper;`docrevision` 不生产 import `docgov`。
目标不是“破双向环”,而是把 canonical Markdown + digest 提取为有行为、内聚、带 golden vectors 的共享模块,例如 `internal/doccontent`。它不应进入只放无行为值对象的 vocabulary。
### 3.3 chat、coordinator 与 intent
- coordinator 仍以 `bizdev.TaskRunRequest/Result` 为词汇。
- chat 编排跨多个模块,需按用例逐批迁入 chatflow。
- intent 与 bizdev 的解绑是较小且独立的迁移,不应和 chat 大迁移绑成一个分支。
### 3.4 闭包桥与未接线事件
当前批准后的推进与通知仍可通过 `docrevision.OnOutbox`、`docgov.AddOnApprovedHook` 及组合根闭包执行。闭包在提交后的进程内调用不能提供 durable delivery、重试、dead-letter、replay 或 attempt audit。
不能直接删除闭包。正确顺序是:
1. 证明生产入口在同一 UoW 写入领域变化、envelope 和目标 delivery。
2. 对历史事件做 dry-run inventory,隔离 scope/schema/sequence 异常。
3. 完成真实 PG dispatcher。
4. shadow 只计算 intended outcome,不执行业务副作用。
5. 以时间、样本和状态分支覆盖作为切换门。
6. 按 notify、workflow advance、projection 独立切换和回滚。
## 4. 并发、数据与权限风险
### 并发
- `FOR UPDATE SKIP LOCKED` 只有在 claim 事务同时更新 lease owner/token/until 并 RETURNING 时才完成所有权转移;当前 SELECT-only `ClaimIDs` 不够。
- Fencing 不能只保护 ack。token 必须进入 consumer command,并在数据库副作用或 projection marker 的最终提交点校验。heartbeat 失败应取消 handler。
- 同一 consumer/aggregate 最多一个 inflight;不同 aggregate 并行。领域版本可能稀疏,不能直接当无缺口事件序号。
- at-least-once delivery 通过 inbox/唯一键/CAS/no-replace 得到 exactly-one visible outcome;不能声称 delivery 本身 exactly once。
### 历史数据
旧记录可能含 project 0、错误 environment、未知 consumer、未知 payload schema 或稀疏 aggregate version。启用 live claim 前必须生成 manifest,并分类 safe/repair/quarantine/expire。任何修复保留 old/new digest、operator、reason、approval;本计划不删历史数据。
### 权限
后台 consumer 使用按 env/consumer/action 约束的 service principal。处理事件时按 ProjectID/DocID 重读资源归属、成员/duty、workflow config revision、活动 stage 和当前状态。事件 actor 只用于审计,不能把历史用户权限带到延迟执行时。
Replay 必须是应用用例:管理员 capability、精确范围、reason/approval、dry-run plan digest、apply exact digest 和不可变审计。多项目或批量 apply 需要操作者与批准人分离。
日志、dead-letter 和 reconciliation 只能保存 ID、digest、typed error code 与字段 allowlist 生成的摘要,不能保存原始 payload、正文、SQL error、绝对路径、token 或 prompt。
## 5. 优先级建议
### P0:Track E 持久事件交付
1. 修正 docflow 生产入口、env/project 作用域和 UoW 原子写。
2. 补全既有 event allowlist 与 runtime registry parity。
3. 审计历史事件、sequence/checkpoint 模型和现有唯一约束。
4. 实现 `cmd/events` 的 PG lease/heartbeat/fencing/attempt/dead-letter。
5. notify、workflow advance、projection 逐个 shadow、live、回滚。
6. 用真实 browser + PG + worker restart 证明刷新后正文恢复,无 projection-missing。
### P1:Track S 结构解耦
- D4:bizdev locator 调用方迁移与最终 getter 原子删除。
- D5:stageflow 自有 use-case 类型,coordinator 解绑 bizdev DTO。
- D6:提取 doccontent canonical 行为模块,移除单向工具依赖。
- D7a:intent 单独解绑 bizdev。
- D7b:chat 按用例迁入 chatflow。
这些单元分别 go/no-go,不作为事件可靠性 blocker 的关闭条件。
### P2:Track P 独立协议
- HTTP/SSE 错误信封另立 remediation;公开 details 必须按 code allowlist 并脱敏。
- PI Runner 任务命名为 typed-result-v1 rollout,不混称“协议 v2”。typed 字段存在但无效时 fail closed;只有字段缺失且握手声明旧 Runner 时才允许 legacy。
## 6. 证据索引
| 事实 | 证据 |
|---|---|
| 模块化单体决策 | `.doc/adr/2026-09-14-modular-monolith-decoupling.md` |
| PG delivery 当前实现 | `internal/events/pg.go`、`deploy/postgres/goose/00035_2026-09-14-durable-event-delivery.sql` |
| MemoryBus 测试边界 | `internal/events/dispatcher_test.go`、`internal/events/bus.go` |
| replay 当前校验 | `internal/events/replay.go` |
| 事件字段硬编码 | `internal/app/docflow/commands.go` |
| 闭包桥 | `internal/app/docnotify/subscriber.go`、`internal/docgov/engine.go`、`internal/app/app.go` |
| bizdev locator | `internal/bizdev/service.go:229-260` |
| 单向 canonical 依赖 | `internal/docgov/lease.go`、`internal/docrevision` canonical helper |
| allowlist 已存在 | `.doc/system-design/module-boundaries.yaml` |
## 建议动作
下一项只立 Track E 的 E0A:事件生产、契约与历史数据门。Dispatcher 必须保持 off,直到 PG 测试证明事件源和旧数据分类正确。完整执行计划见 [Phase 2 持久事件交付与后续解耦路线](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)。
@@ -0,0 +1,54 @@
---
title: "P0 PI Runner typed-result 兼容矩阵"
created: 2026-09-15
status: done
confidence: high
---
# 调研:P0 PI Runner typed-result 兼容矩阵
## 结论
当前 `/v1/run` 远程响应与本地 bridge stdout **都不是** `result_v1`。Go 只解析 `ok/fallback_reason/stderr/retryable/patches[]`;成功路径再 `MaterializeTargets`。仓库里没有 `configs/schemas/pi-run-result-v1.json`。typed 字段一旦出现但非法必须 fail closed;本盘点确认 legacy 窗口仍是默认路径。
## 证据
| 项 | 路径/命令 | 结果 |
|----|-----------|------|
| 远程调用 | `internal/agent/piagent.go` `executeRemote` | `POST {runnerURL}/v1/run`;Bearer via `ApplyRunnerAuth` |
| 远程解码 | 同上 `remoteResp` | `ok`, `fallback_reason`, `stderr`, `retryable`, `patches[].rel_path/content` |
| 本地 bridge | `PiAgentBackend.Execute` | stdin JSON payload;stdout **最后一行** JSON;失败把 `stderr` 拼进 `ErrorReason` |
| 产物 | `MaterializeTargets(workDir, req.Targets, incoming)` | 默认 target `output.md` |
| 既有 schema | `configs/schemas/` | 仅 `change-report-v1.json`,无 run-result |
| 取消/超时 | `CommandContext` + `http.Client{Timeout}` | 超时进 `ErrorReason`;无单调终态结构体 |
| Handshake | 无 | 未声明 typed capability,故今日全部算旧 Runner |
## 兼容矩阵
| Runner 形态 | 成功输出 | 失败输出 | Go 行为 | P1/P2 约束 |
|-------------|----------|----------|---------|------------|
| 远程 HTTP `/v1/run` | `ok=true` + patches | `ok=false` + fallback/stderr | 解码失败即失败;不读 `result_v1` | P1 additive 加 `result_v1`;P2 typed-present-invalid 禁止 fallback |
| 本地 bridge 二进制 | stdout 末行 `{ok}` | `ok=false` 或进程 err | 整段 stdout 进 `Logs` | Logs 不得含 prompt/token;P1 后 Logs 只留 digest |
| stub | 内存产物 | 分类失败 | 测试夹具 | 不作为真实 PI 证据 |
| 未知 major / 缺 schema | — | — | 今日不会发生 | P2 fail closed |
## 体积与路径风险
- patches `Content` 无 body/member 上限;P1 必须在分配前限制。
- `RelPath` 未在 adapter 层拒绝 `..` / 绝对路径(依赖 `MaterializeTargets`);P1 负例要覆盖 symlink escape。
- `ErrorReason` 拼接 `stderr`,可能带模型/路径;公开日志禁止原样落盘。
## 取消与竞争
- HTTP client timeout 与 context cancel 共用;无独立 cancel token 与 result 的 CAS。
- P3 真实 PI E2E 必须覆盖:成功、typed error、取消、超时、未知 schema。
## 开放问题
- 真实容器内 Runner 镜像版本与是否已能吐 `result_v1` 需 P1 时对一下 pi-agent 镜像,不阻塞立项。
## 建议动作
- P1:共享 JSON Schema `configs/schemas/pi-run-result-v1.json`;Runner additive 输出。
- P2:Go typed-first parser;handshake 声明旧 Runner 才允许 legacy。
- 实施见 [PI typed-result-v1](../../remediation/2026-09-15-pi-typed-result-v1-remediation.md)。
@@ -0,0 +1,39 @@
---
title: "Track E 持久事件交付复盘"
created: 2026-09-15
updated: 2026-09-16
status: done
confidence: high
---
# 调研:Track E 持久事件交付复盘
> **Superseded 指针(2026-09-16)**:共享 notify/advance/projection 已 live;生产闭包 hook 已退出;`DOC-RELIABILITY-PILOT` 在 gap-matrix 为 PASS。可靠事件核心见 [FEATURE-MATRIX](../../status/FEATURE-MATRIX.md) `done`;FAV 仍 `deferred`。下文「共享 off / OPEN」为复盘当时快照,勿作 live status。
## 结论
E0A–E1C 已在隔离库证明:领域变化、envelope、delivery 同 UoW;PG dispatcher 原子 lease/fencing;notify / workflow_advance / projection 各自 exactly-one visible outcome。共享集群消费者保持 **off**,HTTP 闭包仍是唯一真实写者。E2 已部署兼容守卫:消费者 `live` 时闭包停写,`off`/`shadow` 时闭包继续写。删除 `OnOutbox` / `AddOnApprovedHook` 必须等 live 发布窗口;当前删除会让 notify/advance 停写。`DOC-RELIABILITY-PILOT` 保持 OPEN。FAV 保持 disabled。
## 证据
| 项 | 路径/命令 | 结果 |
|----|-----------|------|
| E0A | [E0A 报告](../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md) | PASS;dispatcher off;FAV 不写入 |
| E0B | [E0B 报告](../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md) | PASS;1/2/4 worker;旧 token 失败 |
| E1A | [E1A 报告](../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md) | 隔离库 unique notify PASS;共享 off |
| E1B | [E1B 报告](../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md) | 隔离库 unique stage-ready PASS;共享 off |
| E1C | [E1C 报告](../../test-reports/2026-09-15-event-e1c-projection-test-report.md) | no-replace PASS;共享 off |
| E2 | [E2 报告](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md) | live 停写;off/shadow 仍写;API 保留 |
| Shared live(后续) | [notify](../../test-reports/2026-09-15-event-notify-shared-live-test-report.md) · [advance](../../test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md) · [projection](../../test-reports/2026-09-15-event-projection-shared-live-test-report.md) | 共享 live PASS(后于本复盘) |
## 开放问题(复盘当时;2026-09-16 状态)
- ~~共享环境尚未做 live~~ → **已关闭**(shared live 报告)。
- 历史 inventory 的 repair/quarantine 真实批量审批未在共享库演练(仍开放,非发布 blocker)。
- FAV 仍只预留 disabled 契约(FEATURE-MATRIX `deferred`)。
## 建议动作
- 下一窗口:按消费者独立 shadow coverage → drain → live,闭包因 E2 守卫自动停写;确认 backlog 与 receipt 后再删 hook API。
- Track S 从 D6(`internal/doccontent`)开始,不占用 events mutex。
- Track P 保持独立 remediation,不阻塞事件交付。
@@ -0,0 +1,57 @@
---
title: "Wave 3 PU6–PU8 产品 go/no-go"
created: 2026-09-16
updated: 2026-09-16
status: done
confidence: high
---
# 调研:Wave 3 PU6–PU8 产品 go/no-go
## 结论
**2026-09-16 用户授权覆盖**:选择全量 backlog 范围 **3(A+B)**,**PU6 / PU7 / PU8 / Playwright 双标签 / 软件自举 / FAV 增量 一律 GO(进入实施)**。
- 仍 **不** 默认升 `MULTI_INTENT_PLAN_TIER=full`;升 tier 另开任务。
- 新能力默认 **flag off / shadow**;获证据后再独立开 flag。
- 样本门槛豁免:用隔离合成会话替代 ≥20 痛点样本(owner=工程执行方 Cursor,授权记录见 short-term 总控)。
历史 no-go 记录保留于本文「历史结论」;实施以本节为准。
## 冻结字段(覆盖后)
| 字段 | 本轮取值 |
|------|----------|
| 用户信号 | **覆盖授权**:产品明确要求全量实施 |
| 预期收益 | 体验增强 + 工程闭环;非 gap-matrix 首发 blocker |
| 维护成本 | 高(真实 PI、R13、shadow、泄漏负例、回滚) |
| owner | Cursor(工程)+ 用户授权 |
| 最小样本 | **豁免**:隔离合成会话 + 负例矩阵 |
| 晋级阈值 | 各契约预注册;未达则保持 shadow/off |
| 零容忍失败 | 授权旁路、跨用户泄漏、双 writer、B1–B4 回归、敏感出站 |
## 分项决定
### PU6 语义摘要(D3)— **GO / planned**
- 契约:`.doc/ops/long-term/2026-09-16-pu6-semantic-summary-contract.md`
- Flag:`SEMANTIC_SUMMARY_SHADOW`(默认 off)
### PU7 PI change-report 叙事 — **GO / planned**
- 契约:`.doc/ops/long-term/2026-09-16-pu7-pi-narrative-contract.md`
- Flag:`PI_CHANGE_REPORT_NARRATIVE`(默认 off)
### PU8 多意图扩面(U9 / U10–U12)— **GO / planned(分项独立 flag)**
- 禁止共用一个开关批量上线;顺序 U9→U10→U11→U12。
- 契约见 long-term `pu8-u9`…`pu8-u12`。
## 历史结论(2026-09-16 初版,已覆盖)
初版在缺少痛点样本与 owner 签字下为 **no-go / deferred**。已被本节用户授权覆盖;勿回退为实施禁令。
## 建议动作
- [x] 产品 go/no-go(覆盖授权)
- [ ] 按 short-term `2026-09-16-full-backlog-override.md` 实施 P1–P7
@@ -0,0 +1,54 @@
---
title: "文档可靠性 M1 活验签字与条件 M2"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor
branch: refactor/document-reliability-pilot
worktree: .worktrees/refactor-document-reliability-pilot
mutex: workspace
---
# 文档可靠性 M1 活验签字与条件 M2
## 目标
占集成槽把试点合入本地 `dev` 并 rebuild,补齐真实 PI / 浏览器 / 跨用户 / 多会话签字。仅当新报告最后一句为「继续 M2」时开工 U5–U7。
## 范围
- A1 占槽、合入、rebuild、health/ready
- A2 143 只读 + 新建项目页面 + fail-closed
- A3 真实 pi-agent 编制后刷新
- A4 隔离库双 pool / 4 会话
- A5 活验 go/no-go
- B 仅 go 后:U5–U7
## 非目标
- 不终止项目 143
- 未 go 不开 outbox/FAV
- 不拆 chat/squad
## 步骤
1. [x] 占集成槽并合入本地 dev rebuild
2. [x] 浏览器 + 跨用户
3. [x] 真实 PI
4. [x] 双 pool/4 会话
5. [x] 活验报告(最后一句:继续 M2)
6. [x] 条件 M2(U5–U7)
## 验收标准
- [x] health + ready 来自本分支镜像
- [x] 143/新项目刷新 404/409/projection-missing = 0 或报告停止扩面
- [x] 报告最后一句只能是继续 M2 或停止扩面
- [x] M2 报告最后一句只能是继续 M3 或停止扩面
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Prior 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)
@@ -0,0 +1,64 @@
---
title: "文档可靠性纵向试点 M0–M1"
status: blocked
created: 2026-09-14
updated: 2026-09-14
owner: Cursor
branch: refactor/document-reliability-pilot
worktree: .worktrees/refactor-document-reliability-pilot
mutex: docgov
---
# 文档可靠性纵向试点 M0–M1
## 目标
在不横向搬包的前提下,完成 U1–U4,使受控文档在并发提交、页面刷新、重登、restart、rebuild 和 projection 缺失后仍从数据库账本返回唯一授权正文。
## 范围
- U1 架构基线与 production writer/path 门禁。
- U2 应用 UnitOfWork 和跨属主事务能力。
- U3 人工编辑、agent commit、批准/驳回事务化。
- U4 授权后的文档统一读模型。
- 项目 143 等价脱敏 hazard 与新项目真实 PI/UI 验收。
## 非目标
- 不启用 FAV degraded read。
- 不拆 chatlog/contextasm/squadrun 包。
- 不统一错误信封,不修改 PI Runner 协议。
- 不清理历史 dev 数据。
## 步骤
1. [x] 从最新 `dev`(`a8f9451`)创建实现分支,登记 CURRENT 并确认 `docgov` mutex 已释放。
2. [x] U1:四类规则 arch-check + archtest + 可重放基线(新违规 block)。
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。
## 验收标准
- [x] 同一 ETag 并发编辑只有一个合法赢家(内存 8 协程 + 隔离库双会话)。
- [x] 任一事务故障点不会留下部分提交(U2 隔离库)。
- [ ] 项目 143 等价 hazard 和新项目刷新/重启目标 404/409/projection missing 为 0(真实页面未测)。
- [x] 服务端匿名/未知文档/跨项目/错误责任人 fail closed;浏览器跨登录未测。
- [ ] 1、2、4 个 app 实例的最终状态一致(仅到双会话)。
- [x] M1 test report 结论:**停止扩面**。
## 相关链接
- 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)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
## M2+ 门(不开工)
U5 WorkspaceRef、U6 outbox、U7 按文件摘 FAV 需要独立审批,且仅当 M1 报告最后一句为「继续 M2」。当前是「停止扩面」,禁止实现 U5–U12。
## 证据 / 备注
隔离库与目标包 race 见 test-report assets。未占槽、未 rebuild。只有真实 PI/浏览器/rebuild 补测并把报告改为「继续 M2」后,才允许启动 durable event/FAV。
@@ -1,54 +0,0 @@
---
title: "模块解耦 Wave 0:契约包骨架 + 架构门禁基线"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor
branch: feature/remove-herdr-agent-settings
worktree: "-"
mutex: arch
---
# 模块解耦 Wave 0:契约包骨架 + 架构门禁基线
> 总方案:[../../system-design/2026-09-14-module-decoupling-architecture.md](../../system-design/2026-09-14-module-decoupling-architecture.md)
> ADR:[../../adr/2026-09-14-modular-monolith-decoupling.md](../../adr/2026-09-14-modular-monolith-decoupling.md)
## 目标
建立 `internal/contracts` 骨架与 `scripts/arch-check.sh` 依赖门禁(warn 基线),使模块边界从此可度量、可执行,为 Wave 1–6 提供验收对照。
## 范围
- `internal/contracts/`:vocabulary.go(MaturityStage 等共享枚举占位)、errors.go(错误码表)、events.go(首批事件类型定义,纯定义零实现)
- `scripts/arch-check.sh` + `.doc/system-design/module-boundaries.yaml`(以现状生成 allowlist,不收紧)
- 基线违规报告存 `.doc/audit/2026-09-14-arch-check-baseline.md`
## 非目标
- 不改任何业务行为、不迁移任何包(属 Wave 1+)
- 不收紧任何依赖规则(block 转换在两周 warn 期后)
## 步骤
1. [x] 用户确认 ADR → 状态转「已接受」
2. [x] 建 contracts 骨架(纯定义,`go test ./internal/contracts` 绿)
3. [x] 写 arch-check.sh(import allowlist / 表属主 / 路径字面量三类检查,支持 --mode warn|block)
4. [x] 运行 warn 模式,基线报告落 `.doc/audit/`
5. [ ] 合 `dev` 占槽冒烟(本轮不占槽;集成槽仍由 workflow-plan Wave 5 持有)
## 验收标准
- [x] `./scripts/arch-check.sh --mode warn` 可运行并产出基线报告
- [x] `go vet ./... && go test -short ./...` 全绿(2026-09-14 本工作区;`internal/server` 9.823s)
- [x] ADR 状态「已接受」;本文件 status → done
## 相关链接
- Checklist: -
- Handoff: -
- Test report: -
## 证据 / 备注
- 依赖图实测(2026-09-14):server 25 内部包 / 17,007 行;bizdev 16 包;详见总方案 §1.1
@@ -0,0 +1,105 @@
---
title: "多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)"
status: done
created: 2026-09-15
updated: 2026-09-16
owner: Cursor
branch: "-"
worktree: "-"
mutex: "-"
---
# 多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)
## 目标
不回退现有模块解耦、单意图行为和权限边界,交付可持久、可恢复、可并发裁决的 2–4 步计划;所有批量生成/写入/控制确认前零副作用,执行前逐动作重新授权。
## 权威文档
- [详细设计与计划](../../system-design/2026-09-15-multi-intent-hitl-plan.md)
- [复核审计](../../audit/2026-09-15-multi-intent-hitl-plan-review.md)
- [模块边界 SSOT](../../system-design/module-boundaries.yaml)
## 强制约束
- `internal/intent` 继续只依赖 `maturity`;新生命周期归 `internal/app/intentflow`;
- 确认不是授权;每步由动作 owner 按当前主体、状态和版本重新鉴权;
- PG plan state 权威,卡片/SSE 仅投影;
- 每步一个业务事务,不做跨模块长事务;
- 中间结果不进 FAV;
- 新行为从 legacy/shadow 开始,回滚不丢已有计划。
## 波次
| 波次 | 单元 | 交付 | 依赖 | 主 mutex | go/no-go |
|------|------|------|------|----------|----------|
| W0 | U1 | 模块/API/状态/事件契约 | 无 | `intent`,`events` | arch/event/table owner 全绿 |
| W1 | U2 | 纯规则提案 shadow | U1 | `intent` | 不改路由,安全错误为 0 |
| W2 | U3 | intentflow + PG/CAS/lease | U1,U2 | `intent-plan` | 两 worker 无双 owner/执行 |
| W2 | U4 | outbox + 投影 | U3 | `events` | projection diff=0 |
| W3 | U5 | decision API + 授权端口 | U3 | `intent-plan`,`server/authz` | 权限负例全绿 |
| W3 | U6 | Web 卡片/刷新/a11y | U4,U5 | `web` | 双标签/reload 无假成功 |
| W4 | U7 | 低风险只读执行 | U4-U6 | `intent-plan`,`chat` | legacy 无回归 |
| W4 | U8 | task generate adapter | U7 | `taskrun`,`intent-plan` | 首版 real PI 闭环 |
| W5 | U9 | 可选 LLM adapter 实验 | U2,U7 | `intent-plan`,`pi-agent` | 不阻塞首版;达阈值才启用 |
| W5+ | U10 | low mutate 逐 action 扩面 | U8 | 实际 owner | 单 action 签署 |
| W5+ | U11 | docgov 逐 action 扩面 | U8 | `docgov`,`intent-plan` | 单 action 签署 |
| W5+ | U12 | workflow/run-control 分项扩面 | U8 | `workflow`/`taskrun` | 分项签署 |
> 本文件仅是总览,不长期占用一个 mutex。实施时每个 U-ID 新建独立 short-term、分支和认领;U10–U12 还必须按 action 拆分。核心首版为 U1–U8,U9 与后续 owner 扩面不阻塞首版关闭。
## 步骤
1. [x] U1 冻结边界、状态机、批量策略、错误码、事件和默认 legacy tier([独立任务](./2026-09-15-multi-intent-u1-contracts.md);[报告](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md));
2. [x] U2 characterization-first 建 golden/hard-negative 与 shadow 基线([独立任务](./2026-09-15-multi-intent-u2-segmenter.md);[报告](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md));
3. [x] U3 建 intentflow owner、PG schema、CAS/lease/fencing/retention([独立任务](./2026-09-15-multi-intent-u3-intentflow-pg.md);[报告](../../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md));
4. [x] U4 接 Track E outbox/dispatcher,只投影状态事实([独立任务](./2026-09-16-multi-intent-u4-outbox-projection.md);[报告](../../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md));
5. [x] U5 建统一 decision command 与动作 owner 授权端口([独立任务](./2026-09-16-multi-intent-u5-decision-api.md);[报告](../../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md));
6. [x] U6 取消计划动作的前端本地成功路径,以 PlanView 恢复([独立任务](./2026-09-16-multi-intent-u6-web-cards.md);[报告](../../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md));
7. [x] U7 只开放独立低风险查询([独立任务](./2026-09-16-multi-intent-u7-auto-read.md);[报告](../../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md));
8. [x] U8 只接 task generate,完成首版闭环(真实 PI 环境缺失记 stop-gate)([独立任务](./2026-09-16-multi-intent-u8-task-generate.md);[报告](../../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md));
9. [ ] U9 作为独立可选实验接语义分段;
10. [ ] U10–U12 分别按 mutate/docgov/workflow/run-control owner 扩面。
## 验收标准
- [ ] 含写/生成/控制时,确认前相关表、任务、文档和工作流零变化;
- [ ] 两标签确认/取消只产生一个决策和至多一次动作;
- [ ] 服务/worker 重启后 PG 恢复,成功步骤不重跑;
- [ ] 确认后权限或资源版本变化时 fail closed;
- [ ] 跨用户/项目/会话读取和决策被隐藏;
- [ ] 按钮与自然语言确认得到同一服务端 receipt;
- [ ] intent 边界、单一写者、UoW、事件静态契约和组合根无回退;
- [ ] 无活动计划时单意图生成保持;有活动计划时不创建第二任务;多意图生成需确认;
- [ ] 部分确认可稍后处理未选项,只有显式排除才取消;部分完成可重试、继续或关闭;
- [ ] 双标签/刷新/重开/SSE 重连真实页面通过;
- [ ] 适用的真实 PI E2E 通过,stub 不冒充验收。
## 非目标
- >4 步、并行 DAG、多活动写计划自动合并;
- 跨步骤 ACID/自动补偿;
- coordinator/chat 全量重构;
- FAV 启用或中间产物归档;
- 改变单意图生成策略。
## 交付纪律
- 每单元记录精确边界影响、适用测试、go/no-go、回滚、branch/commit/merge/push 状态;
- 每单元独立 test report、CURRENT 认领/集成槽和 FEATURE-MATRIX 回链;
- 安全、越权、双执行或刷新差异任一出现,停止当前 tier;dispatcher 故障只停投影;LLM 故障进入澄清。
## 相关链接
- Checklist: [U1](../checklists/2026-09-15-multi-intent-u1-contracts.md);[U2](../checklists/2026-09-15-multi-intent-u2-segmenter.md);[U3](../checklists/2026-09-15-multi-intent-u3-intentflow-pg.md);[U8](../checklists/2026-09-16-multi-intent-u8-task-generate.md)
- Handoff: 每个 U-ID 独立建立
- Test report: [U1](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md);[U2](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md);[U3](../../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md);[U4](../../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md);[U5](../../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md);[U6](../../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md);[U7](../../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md);[U8](../../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md)
## 证据 / 备注
- 当前 `plan_builder.go` 最多两段且写意图返回 nil;`action_planner.go` 的确认仍是文字提示。
- 当前 `module-boundaries.yaml` 中 intent 仅依赖 maturity;Track E live,FAV off。
- U1 已冻结 intentflow 契约、事件与 BatchActionPolicy,默认 `MULTI_INTENT_PLAN_TIER=legacy`。
- U2 已落地规则分段与 shadow `PlanProposal`;生产 TopIntent / IntentPlan 不变;反事实 `false_auto_execute=0`。
- U8 已落地 confirm 落盘与 `task.run` adapter;默认 legacy 不落盘。U9–U12 不阻塞核心首版。共享环境 schema 45 待晋升窗口。
@@ -0,0 +1,76 @@
---
title: "多意图 HITL U1:契约冻结"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/multi-intent-u1-contracts
worktree: "-"
mutex: architecture-docs
---
# 多意图 HITL U1:契约冻结
## 目标
冻结 `app/intentflow` 边界、状态机、BatchActionPolicy、错误码、事件契约与默认 `legacy` tier;不改识别路由、不建表、不接 HTTP。
## 范围
- `module-boundaries.yaml`:`app/intentflow` allowlist、三表 owner、`unwrap_owners`、三条 `intent.plan.*` 事件
- `events.StaticContracts` 与 YAML 对等;archtest 扫描 `intent.plan.*`
- `internal/app/intentflow` 骨架:状态、错误码、Service 端口、政策、tier 开关
- CSRF/认证结论:现有 Bearer + CORS 对 U5 足够,不是 blocker
## 非目标
- 不修改 `internal/intent` 业务类型或 `MULTI_INTENT_ENABLED`
- 不建 Goose 表、不接线 `app.Assemble`、不改 chat/coordinator/Web
- 不 Append 事件、不实施 U2–U12
## REST(U5 再挂路由)
- `GET /api/v1/intent-plans/active`
- `GET /api/v1/intent-plans/{plan_id}`
- `POST /api/v1/intent-plans/{plan_id}/decisions`
- body:`expected_revision`、`decision_nonce`、`decision_digest`、`kind`、步骤选择
## CSRF / 认证(U5 前置结论,非 blocker)
现有认证是 `Authorization: Bearer` 或 `X-Session-Token` 请求头(`internal/server/auth_handlers.go`),无 cookie 会话,无独立 CSRF 中间件;另有 Origin allowlist CORS。
- 自定义头不会被浏览器跨站表单自动带上,现有模式对 U5 足够
- `decision_nonce` / 幂等键只防重放与并发,**不替代** CSRF 或身份认证
- U5 必须 `requireAuthenticatedUser` + 四元作用域(environment/project/session/user)
- **禁止**为计划 API 改成 cookie 自动提交
- 若未来改 cookie 认证,另立 auth 任务,不得在 intent-plan 端点发明弱 CSRF
## 步骤
1. [x] 从最新 `dev` 检出 `feature/multi-intent-u1-contracts` 并认领 CURRENT
2. [x] 登记边界 YAML、事件契约、archtest regex
3. [x] 落地 intentflow 骨架与 BatchActionPolicy
4. [x] arch/parity/short 测试与 U1 报告
## 验收标准
- [x] `intent -> maturity` 保持;server/chat 不直写计划表
- [x] YAML ↔ StaticContracts parity 绿
- [x] 未知 action/policy key fail closed;ActionRegistry 无 batch/tier 字段
- [x] 默认 `MULTI_INTENT_PLAN_TIER=legacy`
- [x] 单意图生成策略不变(本单元无运行时改动)
## 相关链接
- 总览: [2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
- 设计: [../../system-design/2026-09-15-multi-intent-hitl-plan.md](../../system-design/2026-09-15-multi-intent-hitl-plan.md)
- Checklist: [../checklists/2026-09-15-multi-intent-u1-contracts.md](../checklists/2026-09-15-multi-intent-u1-contracts.md)
- Test report: [../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)
## 证据 / 备注
- 事件登记窗口同时占用 `events` mutex;U1 不改 intent 代码。
- 生产者含 `events`:StaticContracts 字面量落在 `internal/events/registry.go`,与现有 document.* 先例一致。
- CSRF:Bearer / `X-Session-Token` + CORS allowlist,U5 非 blocker。
- 冒烟:`go vet ./...`、`go test -short ./...`、`./scripts/arch-check.sh --mode block` PASS。U1 无 schema/容器变更,集成槽位保持 idle。
- 提交:`bdccb4d` docs(ops);`aefb1e4` feat(events);`9364da4` feat(intentflow);随后 docs(status)。
@@ -0,0 +1,63 @@
---
title: "多意图 HITL U2:规则分段与 shadow 提案"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/multi-intent-u2-segmenter
worktree: "-"
mutex: intent
---
# 多意图 HITL U2:规则分段与 shadow 提案
## 目标
在不改变生产路由(TopIntent / 现有 IntentPlan)的前提下,用纯规则分段器生成 2–4 步 `PlanProposal` 与 shadow 指标;写段不再在提案层被静默丢弃。
## 范围
- `internal/intent/segmenter.go`:连接词/句号/分号/换行/序号/先再最后,上限 4
- `PlanProposal` L1 值对象:span、证据、缺槽、依赖建议、稳定 digest
- Recognize 附加提案与 shadow;**不**改 coordinator 执行路径
- golden / hard-negative / 反事实(若处于 auto_read 会如何)
## 非目标
- 不建 PG、不接 HTTP、不改 Web
- 不把 HITL/tier 回灌 ActionRegistry
- 不启用 LLM 分段(U9)
- 不把 shadow 提案当作生产 IntentPlan
## 步骤
1. [x] 认领 CURRENT,characterization 锁定现有 IntentPlan
2. [x] 分段器 + PlanProposal + digest
3. [x] 接入 Recognize(leaf 识别防递归)
4. [x] golden/hard-negative/反事实与报告
## 验收标准
- [x] 「查风险,然后查法规」现有 IntentPlan 仍为 2 步 query
- [x] 「查法规然后生成报价单」生产 IntentPlan 仍为 nil(路由不变),提案含写段且 ComboHint=needs_confirm
- [x] 「查询并总结」不拆
- [x] 指代失败 → needs_clarify
- [x] 红线混入 → rejected
- [x] 5 段 → rejected_batch_size
- [x] 同输入 digest 稳定
- [x] 反事实错误自动执行 = 0
- [x] `intent -> maturity` 保持
## 相关链接
- 总览: [2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
- 设计: [../../system-design/2026-09-15-multi-intent-hitl-plan.md](../../system-design/2026-09-15-multi-intent-hitl-plan.md)
- Checklist: [../checklists/2026-09-15-multi-intent-u2-segmenter.md](../checklists/2026-09-15-multi-intent-u2-segmenter.md)
- Test report: [../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md)
## 证据 / 备注
- L1 不 import intentflow;`ComboHint` 只是结构提示,不是授权。
- 单段复用 primary frame,避免二次 Recognize。
- 冒烟:`go vet ./...`、`go test -short ./...`、`./scripts/arch-check.sh --mode block` PASS。U2 无 schema/容器变更。
- 提交:`4751348` docs(ops) 认领;`9005766` test(intent) characterization;`932ba87` feat(intent) 分段器与 shadow 提案。
@@ -0,0 +1,68 @@
---
title: "多意图 HITL U3:intentflow PG/CAS/lease"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/multi-intent-u3-intentflow-pg
worktree: "-"
mutex: intent-plan
---
# 多意图 HITL U3:intentflow PG/CAS/lease
## 目标
建立持久计划/步骤/决策与并发协议(CAS revision、decision nonce、lease/fencing、创建幂等、retention);不接真实写动作,不改 chat/coordinator 生产路由。
## 范围
- Goose `00044`:`intent_plans` / `intent_plan_steps` / `intent_plan_decisions`
- `app/intentflow` owner repository + UoW;owner 可 unwrap pgx
- 创建幂等 `(environment, session_id, client_turn_id)`;同 turn 异 digest 冲突
- 决策 CAS + nonce 同/异 digest;确认/取消/过期竞态
- 步骤 lease + 单调 fencing;两 worker 只一个 owner
- 业务成功但 receipt 写回失败时按幂等键对账,不盲跑
- 环境隔离;关闭计划 retention 由 owner 删除
- `app.Assemble` 装配 `*intentflow.Plans`,chat 仍不调用
## 非目标
- 不接 HTTP(U5)、不 Append 事件(U4)、不接真实 action adapter(U7/U8)
- 不把 HITL/tier 回灌 ActionRegistry
- 不改 `internal/intent` 生产 TopIntent / IntentPlan
- 不 rebuild 共享 `:8080`(schema 44 仅隔离库/后续晋升窗口应用)
## 步骤
1. [x] 认领 CURRENT(mutex `intent-plan`)
2. [x] Goose 00044 + migrate gate
3. [x] Store/Engine:Create/Decide/Claim/Receipt/Expire/Purge
4. [x] 内存并发 + 可选 PG 测试;Assemble 接线
5. [x] 报告并合回本地 dev
## 验收标准
- [x] 双创建同 digest 返回同一 plan;异 digest 冲突
- [x] nonce 同 digest 返回 receipt;异 digest 冲突
- [x] 确认/取消/过期只一个 CAS 胜出
- [x] 两 worker 抢 eligible 步骤无双 owner
- [x] 租约过期可接管;旧 fencing token 被动作属主拒绝
- [x] 重启后 succeeded 不重跑;receipt 写回失败按幂等键恢复
- [x] 跨 environment 隐藏
- [x] 默认 legacy 时 HandleTurn 不落盘
- [x] `go test -short ./internal/app/intentflow ./internal/app ./internal/archtest ./internal/db` 绿
## 相关链接
- 总览: [2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
- 设计: [../../system-design/2026-09-15-multi-intent-hitl-plan.md](../../system-design/2026-09-15-multi-intent-hitl-plan.md)
- Checklist: [../checklists/2026-09-15-multi-intent-u3-intentflow-pg.md](../checklists/2026-09-15-multi-intent-u3-intentflow-pg.md)
- Test report: [../../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md](../../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md)
## 证据 / 备注
- HandleTurn 在默认 legacy 下不落盘;CreatePlan 是 U3 测试与后续 U7 入口。
- 动作属主端口仅 FakeActionOwner;真实 adapter 从 U7/U8 按 key 接入。
- PG 活验需隔离 `TEST_DATABASE_URL`;本机 short 门禁跳过。共享 `:8080` 仍 schema 43。
- 提交:`a75aa45` docs(ops) 认领;`7dfd6d6` feat(db);`da0b3d8` feat(intentflow);`1385002` feat(app)。
@@ -0,0 +1,51 @@
---
title: Demo/测试数据污染全面整改
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: fix/demo-data-pollution-web
worktree: "-"
mutex: web
---
# Demo / 测试数据污染全面整改
## 目标
消除前端 mock/seed 与 DB 演示项目对真实项目清单的污染;生产包无演示文案;main 拒 stub。
## 范围
- Wave 0–5 代码 + Wave 6 文档(本分支合并实现)
## 非目标
- 删除合法 `*.test.ts` fixture
- 改写工作流模板骨架
## 步骤
1. [x] Wave 0 止血
2. [x] Wave 1 门控
3. [x] Wave 2 localStorage 迁移
4. [x] Wave 3 UI 语义
5. [x] Wave 4 DB retire
6. [x] Wave 5 stub gate
7. [x] Wave 6 文档
## 验收标准
- [x] `check-prod-bundle.sh` PASS
- [x] deliverableSync / demoSeedIds / ResolveBackend 单测 PASS
- [x] `cd web && npm test` 全绿(审核 P0)
- [x] 00046/00047 retire + ListChatSessions 过滤(审核 P1)
- [x] 合入后共享环境 migrate + 人工空项目/会话抽检(dev schema 47;项目 6357 docs=0;列表无 6001–6010 / sess-wangjing)
## 相关链接
- Audit: [.doc/audit/2026-09-16-demo-seed-pollution-systemic.md](../audit/2026-09-16-demo-seed-pollution-systemic.md)
- 前序 Audit: [.doc/audit/2026-09-15-mock-deliverables-pollute-real-projects.md](../audit/2026-09-15-mock-deliverables-pollute-real-projects.md)
- Remediation: [.doc/remediation/2026-09-16-demo-seed-pollution-remediation.md](../remediation/2026-09-16-demo-seed-pollution-remediation.md)
- Test report: [.doc/test-reports/2026-09-16-demo-seed-pollution-test-report.md](../test-reports/2026-09-16-demo-seed-pollution-test-report.md)
- 挑拣:`a91a031` `SEED_DEMO_USERS=false`(自 `fix/clean-test-env-baseline`)

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