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
491 changed files with 29189 additions and 1769 deletions
@@ -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)
@@ -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`。
@@ -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`
@@ -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,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 另开任务
+16
View File
@@ -13,6 +13,22 @@
## 核心文档(按阅读顺序推荐)
### 可选职责空审核人 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)
+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.
+61 -14
View File
@@ -1,18 +1,55 @@
# 当前焦点
**更新**: 2026-09-15
**production_ready**: no(CI 真实 PI 三工作流 E2E / 前端人工抽检仍开放。`CHAT-INTENT-STATE` 双标签 busy **PASS**。文档账本运行时 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. **MULTI-INTENT HITL**:方案已复核,U1 契约未开工([设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[short-term](./short-term/2026-09-15-multi-intent-hitl.md))
2. **发布门禁**:CI `TEST_DATABASE_URL`、真实 PI 三工作流 E2E、前端人工抽检仍开放([gap-matrix](../remediation/gap-matrix.md))
3. **CHAT-INTENT**:双标签 busy 已签(项目 **6275**);不删 `sess-p143-u9`;项目 143 只读
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 |
|-------|------|--------|----------|-------|--------|
| 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 |
@@ -72,19 +109,19 @@
| 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 | in_progress |
| 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 与治理鉴权 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-15 旁支清理:[报告](../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md)。已合入本地旁支 31 条已 `git branch -d`;7 个对应 worktree 已拆。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`。
> 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 |
|--------|-------|-------|-------|-------|
| Cursor | merging | 2026-09-15 | promote local dev → test + test rebuild | - |
| Cursor | merging | 2026-09-17 | promote null-fk → test (rc-v1.0.0-beta.4) | - |
**phase**: `idle` | `merging` | `smoke` | `e2e`
@@ -94,18 +131,20 @@
| 环境 | 端口 | schema | 状态 |
|------|------|--------|------|
| dev | 8080 | **43** | healthy(`pi-agent` typed-result-v1;events worker `:8088`;notify/advance/projection live、fav off;health+ready 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) |
@@ -118,6 +157,14 @@
| 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) |
@@ -127,7 +174,7 @@
| 文档可靠性 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-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,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] 全部勾选且有证据链接
@@ -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 实现任务
@@ -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。
@@ -1,12 +1,15 @@
---
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。
@@ -21,12 +24,13 @@ E0A–E1C 已在隔离库证明:领域变化、envelope、delivery 同 UoW;P
| 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 状态)
- 共享环境尚未做 notify/advance/projection 的 live 切换与授权页刷新纵切,因此 Track E DoD 中「生产注册无 OnOutbox=」与「授权 UI 三类重启」未关闭。
- 历史 inventory 的 repair/quarantine 真实批量审批未在共享库演练。
- FAV 仍只预留 disabled 契约。
- ~~共享环境尚未做 live~~ → **已关闭**(shared live 报告)。
- 历史 inventory 的 repair/quarantine 真实批量审批未在共享库演练(仍开放,非发布 blocker)。
- FAV 仍只预留 disabled 契约(FEATURE-MATRIX `deferred`)。
## 建议动作
@@ -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
@@ -1,12 +1,12 @@
---
title: "多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)"
status: planned
status: done
created: 2026-09-15
updated: 2026-09-15
owner: "-(待逐单元认领)"
branch: feature/multi-intent-u1-contracts
updated: 2026-09-16
owner: Cursor
branch: "-"
worktree: "-"
mutex: architecture-docs
mutex: "-"
---
# 多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)
@@ -51,14 +51,14 @@ mutex: architecture-docs
## 步骤
1. [ ] U1 冻结边界、状态机、批量策略、错误码、事件和默认 legacy tier;
2. [ ] U2 characterization-first 建 golden/hard-negative 与 shadow 基线;
3. [ ] U3 建 intentflow owner、PG schema、CAS/lease/fencing/retention;
4. [ ] U4 接 Track E outbox/dispatcher,只投影状态事实;
5. [ ] U5 建统一 decision command 与动作 owner 授权端口;
6. [ ] U6 取消计划动作的前端本地成功路径,以 PlanView 恢复;
7. [ ] U7 只开放独立低风险查询;
8. [ ] U8 只接 task generate,完成首版 real PI 闭环;
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 扩面。
@@ -92,12 +92,14 @@ mutex: architecture-docs
## 相关链接
- Checklist: U1 实施时建立逐波 checklist
- 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: 每个 U-ID 独立归档 `.doc/test-reports/`
- 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`)
@@ -0,0 +1,54 @@
---
title: "FAV U7 增量合入(非整支 merge)"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/fav-u7-publisher
worktree: ".worktrees/feature-fav-u7-publisher"
mutex: events
---
# FAV U7 增量合入
## 目标
从 `feature/final-artifact-vault` **手工移植**经审计切片到 `dev`;consumer 默认 off;禁止整支 merge;禁止默认开 `FAV_DEGRADED_READ`。
## 范围
- 配置门闩(`FAV_DEGRADED_READ` / `FAV_PUBLISHER_ENABLED` 默认 false)
- HTTP `GET /api/v1/vault/status` + gated in-process publisher stub
- `internal/app/fav` durable subscriber stub(不注册到 cmd/events)
- `cmd/artifact-vault` status stub(完整 CLI 未移植)
## 非目标
- 整支 merge `feature/final-artifact-vault`
- 未审计启用 degraded read / fav live / publisher production Drain
- 移植 enumerate / TerminalRow Backfill / OnFinalArtifact hooks
- 合入 `dev`(本切片仅 feature 推送)
## 步骤
1. [x] 审计 FAV vs `dev` artifactvault 冲突(多数 DIFF → 改 stub)
2. [x] 落地 stub + 默认 off 测试
3. [x] go/no-go 报告
4. [x] 推送 `feature/fav-u7-publisher`(不合 dev)
## 验收标准
- [x] fav consumer / Register 仍 fail-closed
- [x] `FAV_DEGRADED_READ` 默认 false
- [x] 测试报告含 NO-GO:subscriber 保持 OFF 直至单独审批
- [x] 已 push 远端 feature 分支
## 相关链接
- Test report: [.doc/test-reports/2026-09-16-fav-u7-incremental-test-report.md](../../test-reports/2026-09-16-fav-u7-incremental-test-report.md)
- Assets: [.doc/test-reports/assets/2026-09-16-fav-u7-incremental/](../../test-reports/assets/2026-09-16-fav-u7-incremental/)
- Remote: `origin/feature/fav-u7-publisher`
## 证据 / 备注
因 `internal/artifactvault` 与 FAV 旁支大面积分叉,未 cherry-pick 核心库;采用最小可编译、默认关闭的 publisher/HTTP/CLI stub。commits: `3478a5a..de65cee`。
@@ -0,0 +1,54 @@
---
title: "FEATURE-MATRIX production-ready 连续性审计与完善计划"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Codex
branch: feature/feature-matrix-production-readiness-plan
worktree: ".worktrees/feature-matrix-production-readiness-plan"
mutex: architecture-docs
---
# FEATURE-MATRIX production-ready 连续性审计与完善计划
## 目标
核对 `FEATURE-MATRIX.md` 中除“纯软件项目自举”外的未完成项,形成不回退当前 `production_ready=yes` 基线的详细整改与验收计划。
## 范围
- 交叉核对 FEATURE-MATRIX、gap-matrix、CURRENT、相关设计、测试报告与当前源码。
- 区分发布 blocker、补证、首发后增强、刻意关闭能力和文档漂移。
- 输出 audit 与 remediation 文档,不修改业务代码或运行发布测试。
## 非目标
- 实施任何业务功能、启用 feature flag、部署或合并到 `dev`。
- 重新规划“纯软件项目自举”。
- 将 U9–U12、FAV、完整 PI change-report 叙事改列为当前发布 blocker。
## 步骤
1. [x] 完成启动协议与 SSOT 基线读取。
2. [x] 逐项核对非自举 `partial` 行及证据漂移。
3. [x] 写入 audit 与 remediation 方案。
4. [x] 完成文档复核并更新本任务状态。
## 验收标准
- [x] 明确回答当前是否仍有 production-ready blocker。
- [x] 每个未完成项都有范围、依赖、关闭标准、验证层级和回滚边界。
- [x] 方案明确保护 B1–B4、三环境 schema 47、默认 off/legacy/shadow 和真实 PI/UI 证据边界。
- [x] 文档遵循 `.doc/` taxonomy,且未修改业务代码。
## 相关链接
- Audit: `../../audit/2026-09-16-feature-matrix-production-readiness-audit.md`
- Remediation: `../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md`
- Test report: 不适用(本任务仅审计与规划)
## 证据 / 备注
当前基线来自 `CURRENT.md`、`gap-matrix.md`、B1–B4 测试报告及三环境 schema 47 记录;历史报告仅作为定位线索,计划要求实施阶段重新验证。
本轮未运行测试,因为没有业务代码变更,且 `ce-plan` 阶段只做研究与规划。
@@ -0,0 +1,67 @@
---
title: "FEATURE-MATRIX Wave 0 校准与 IAM 只读核验"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/feature-matrix-production-readiness-plan
worktree: ".worktrees/feature-matrix-production-readiness-plan"
mutex: architecture-docs
---
# FEATURE-MATRIX Wave 0 校准与 IAM 只读核验
## 目标
校准 `FEATURE-MATRIX.md` 契约与行状态,只读核验三环境 IAM 部署事实,保持 `production_ready=yes` 不被无证据回退。
## 范围
- PU1:矩阵契约、行模板、status README
- PU2:按冻结边界收口/拆行;修正 schema/D3/IAM/FAV 漂移;历史指针
- IAM 只读核验(health/ready、IAM 表、PG store);仅真实旁路时改 gap-matrix
- 文档提交于本 feature 分支;不合 `dev`、不改业务代码
## 非目标
- Wave 1+(IAM fail-closed 代码、race、真实 PI 补证、夜间 CI)
- merge `dev` / push / 共享容器 rebuild
- 重新运行生产验收冒充补证
## 步骤
1. [x] CURRENT 登记认领 `architecture-docs` in_progress
2. [x] PU1 扩展契约与模板
3. [x] IAM 只读核验并落盘结论
4. [x] PU2 收口矩阵行与历史指针
5. [x] `git diff --check` + docs 提交 + handoff
## 验收标准
- [x] 矩阵可区分完成边界 / 发布关系 / 关闭条件 / 证据
- [x] L1、Chat baseline、DocRev baseline、前端、可靠事件按冻结范围 `done`;增强拆行
- [x] schema 45、D3/D5、IAM 过时缺口、事件+FAV 混行已纠正
- [x] IAM 只读结论落盘;无证实旁路则不改 `production_ready`
- [x] handoff 标明合 `dev` 与 Wave 1 入口待审
## 相关链接
- Audit: `../../audit/2026-09-16-feature-matrix-production-readiness-audit.md`
- Remediation: `../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md`
- Plan short-term (done): `./2026-09-16-feature-matrix-production-readiness-plan.md`
- Handoff: `../handoffs/2026-09-16-feature-matrix-wave0-calibration.md`
- Test report: 不适用(本波仅文档 + 只读核验)
## 证据 / 备注
### IAM 只读核验(2026-09-16,只读;未 restart / 未改代码)
| 环境 | health/ready | schema_version | goose max | `user_credentials` | IAM 相关表 | `ALLOW_IN_MEMORY` | ENV | 判定 |
|------|--------------|----------------|-----------|--------------------|------------|-------------------|-----|------|
| dev `:8080` | ok / ok | 47 | 47 | 147 rows | users, auth_sessions, system_roles, user_role_bindings, iam_system_config 等齐全 | false | dev | PG store 可达;fallback 未触发 |
| test `:8081` | ok / ok | 47 | 47 | 4 rows | 同上 | false | test | 同上 |
| main `:8000` | ok / ok | 47 | 47 | 1 row | 同上 | false | prod | 同上;`auth_sessions=0` 仅表示无活跃会话,不表示 MemoryStore |
`IAMTablesReady` 口径(`user_credentials` EXISTS)三环境均为 true。近期 app 日志无 MemoryStore / in-memory auth 命中。
**结论**:未发现当前 main/prod 正在触发 MemoryStore 旁路;**不**将 `production_ready` 回退;**不**新增 gap-matrix blocker。代码层 `NewStores` 在表缺失时仍可能 silent fallback → 归 Wave 1 PU3 fail-closed 加固。
@@ -0,0 +1,43 @@
---
title: "全量 backlog 覆盖 no-go 总控"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: docs/override-nogo-full-backlog
worktree: "-"
mutex: architecture-docs
---
# 全量 backlog 覆盖 no-go 总控
## 目标
按计划 P0–P7 收口工程残留并实施曾 no-go 的能力;默认 flag off;不升 `MULTI_INTENT_PLAN_TIER=full`;禁止整支 merge FAV。
## 授权
用户 2026-09-16 选择范围 **3(A+B 全开)**。
## 步骤
1. [x] P0 SSOT 翻转
2. [x] P1 nightly DATA_DIR 对齐 + green receipt(U8 PASS;FullNone 仍有 product_fail 待后续)
3. [x] P2 IAM inventory + 410 + R13
4. [x] P3 Playwright intent-plan 双标签(`RUN_UI_ACCEPTANCE=1` Docker Playwright PASS;A=200/B=409;见 [报告](../../test-reports/2026-09-16-intent-plan-playwright-dual-tab-test-report.md))
5. [x] P4 PU6 + PU7(agent 实现合入;flag 默认 off)
6. [x] P5 PU8 U9→U12(独立 flag;legacy tier;agent 实现合入)
7. [x] P6 SWBOOT-00…09(10 stub/设计冻结;agent 实现合入)
8. [x] P7 FAV 增量(非整支 merge;publisher/consumer 默认 off)
## 验收标准
- [x] 各波 short-term / test-report 回链
- [x] FEATURE-MATRIX 对应行更新
- [x] CURRENT 焦点与认领同步
- [x] agent 富实现覆盖薄 stub:`chore/merge-agent-deltas` → `dev`
## 相关链接
- Plan: full backlog override(Cursor plan)
- go/no-go: [../research/2026-09-16-wave3-pu6-pu8-go-no-go.md](../research/2026-09-16-wave3-pu6-pu8-go-no-go.md)
@@ -0,0 +1,20 @@
---
title: "Gitea nightly host tools / network"
created: 2026-09-16
owner: Cursor
branch: fix/gitea-nightly-host-tools
mutex: ci
status: done
---
# Gitea nightly host tools / network
## Goal
Make local Gitea `nightly:host` jobs able to run `actions/*` (node), health-check PI (`curl` → `127.0.0.1:18865`), and archive receipts without `upload-artifact@v4`.
## Done when
- [x] Runner host network + brew PATH (node/go/curl) + glibc mounts
- [x] Workflow: replace upload-artifact@v4 with tar archive
- [x] Nightly dispatch past infra curl; receipt not infra_fail due to missing tools
@@ -0,0 +1,52 @@
---
title: "Playwright intent-plan 双标签验收"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/intent-plan-cards-playwright
worktree: ".worktrees/feature-intent-plan-cards-playwright"
mutex: web
---
# Playwright intent-plan 双标签验收
## 目标
`RUN_UI_ACCEPTANCE=1` 真浏览器下,PLAN_CONFIRM 双标签 confirm 互斥;刷新/重登与 PG plan 一致;不升 `MULTI_INTENT_PLAN_TIER`。
## 范围
- `web/e2e/intent-plan-cards.spec.ts` 活验规格
- App:`GET /intent-plans/active` 水合 PLAN_CONFIRM;confirm 使用唯一 decision nonce;空 docAST 登录兜底
- InteractiveCard:`data-testid=plan-confirm-card` 等选择器
- 测试报告归档
## 非目标
- 不升 `MULTI_INTENT_PLAN_TIER`
- 不用 stub/SKIP 冒充 PASS
## 步骤
1. [x] 从 origin/dev 开 `feature/intent-plan-cards-playwright`(worktree)
2. [x] 水合 + 唯一 nonce + e2e 规格
3. [x] `RUN_UI_ACCEPTANCE=1` 真浏览器跑通并写报告
4. [x] 提交并 `./scripts/git-push-dev.sh`
## 验收标准
- [x] 无 `RUN_UI_ACCEPTANCE` 时 Playwright skip
- [x] `RUN_UI_ACCEPTANCE=1`:双标签仅一侧 HTTP 200,另一侧 409;败方 outdated
- [x] 刷新/重登卡片状态与 PG / GET active 一致
- [x] 报告进 `.doc/test-reports/`
## 相关链接
- Long-term: [../long-term/2026-09-16-intent-plan-playwright-dual-tab.md](../long-term/2026-09-16-intent-plan-playwright-dual-tab.md)
- Test report: ../../test-reports/2026-09-16-intent-plan-playwright-dual-tab-test-report.md
## 证据 / 备注
- Live:`assets/2026-09-16-intent-plan-playwright-dual-tab/playwright-docker.txt`(1 passed 7.0s)
- Network:`playwright-network.json`(A=200 / B=409 PLAN_STALE_REVISION;PG executing rev=2)
@@ -0,0 +1,51 @@
---
title: "多意图 HITL U4:outbox 与计划投影"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u4-outbox-projection
worktree: "-"
mutex: events
---
# 多意图 HITL U4:outbox 与计划投影
## 目标
权威计划在同一 UoW 写入 outbox;投影只应用状态事实;消息/SSE 丢失时 GET PlanView 仍能恢复。不改 dispatcher claim/lease/retry 语义。
## 范围
- Create/Decide/Receipt 同事务 Append `intent.plan.*`
- 最小 payload + golden;伪造 producer 拒绝
- projection consumer 幂等、只前进 revision;跨用户不可见
- ctxmgr 只经 CardProjector 端口(接口在 intentflow,实现可 no-op)
- 复用 Track E LiveConsumers
## 非目标
- 不改通用 dispatcher
- 不挂 HTTP(U5)、不改 Web(U6)、不执行动作(U7)
## 步骤
1. [x] 认领 CURRENT(mutex `events`)
2. [x] emit + golden + 投影只前进
3. [x] cmd/events 接入 multiplex;goose shadow
4. [x] 报告并合回本地 dev
## 验收标准
- [x] 创建计划产生 awaiting_input;payload 无 prompt/slots
- [x] 重复 event_id 不双写投影
- [x] 乱序低 revision 不覆盖高 revision
- [x] 伪造 producer 拒绝
- [x] GET PlanView 不依赖投影成功
- [x] arch-check / short 绿
## 相关链接
- 总览: [2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
- Checklist: [../checklists/2026-09-16-multi-intent-u4-outbox-projection.md](../checklists/2026-09-16-multi-intent-u4-outbox-projection.md)
- Test report: [../../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)
@@ -0,0 +1,54 @@
---
title: "多意图 HITL U5:决策 API 与授权端口"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u5-decision-api
worktree: "-"
mutex: intent-plan
---
# 多意图 HITL U5:决策 API 与授权端口
## 目标
按钮与自然语言走同一 `DecidePlan` 命令;GET 发现活动计划不依赖投影;执行前由动作属主重新授权。确认不是授权。
## 范围
- 冻结路径:`GET /api/v1/intent-plans/active`、`GET /api/v1/intent-plans/{plan_id}`、`POST /api/v1/intent-plans/{plan_id}/decisions`
- Principal 只从认证会话 + query 的 project/session 组装,忽略 body 中的 user/project/session
- 四元作用域;非成员 403;跨 session/user 隐藏为 404
- 系统管理员不得绕过项目成员检查
- `StepAuthorizer` 端口 + Fake/dry-run;确认与执行前鉴权
- expected revision、nonce、依赖闭包、edit 升 revision
## 非目标
- 不接真实业务属主 adapter(U7/U8)
- 不改 Web(U6)、不改默认 legacy HandleTurn
- 不 rebuild 共享 `:8080`
## 步骤
1. [x] 认领 CURRENT(mutex `intent-plan`)
2. [x] 授权端口与 confirm/execute 即时鉴权
3. [x] HTTP handlers + 权限负例
4. [x] 报告并合回本地 dev
## 验收标准
- [ ] 投影缺失仍能 GET active
- [ ] 未登录 401;非成员 403;跨项目/会话/用户隐藏
- [ ] stale revision 409;重复 nonce 同 digest 同 receipt
- [ ] 非法部分确认拒绝;edit 使旧 revision 失效
- [ ] 确认前零副作用;权限撤销/资源版本 fail closed
- [ ] 无系统身份绕过
- [ ] `go test -short` 绿
## 相关链接
- 总览: [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-16-multi-intent-u5-decision-api.md](../checklists/2026-09-16-multi-intent-u5-decision-api.md)
@@ -0,0 +1,47 @@
---
title: "多意图 HITL U6:Web 卡片、刷新与可访问性"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u6-web-cards
worktree: "-"
mutex: web
---
# 多意图 HITL U6:Web 卡片、刷新与可访问性
## 目标
UI 只呈现 PlanView;计划动作不走本地 AST/资源修改;刷新与双标签以 GET reconcile。
## 范围
- `PLAN_CONFIRM` 卡片类型
- intent-plans API client
- submitting/outdated/expired/conflict;409 看最新版
- App 计划动作 early-return,禁止本地成功路径
- Playwright 门控(无 `RUN_UI_ACCEPTANCE` 则 skip)
## 非目标
- 不接 auto_read 执行(U7)
- 不 rebuild 共享环境
## 步骤
1. [x] 认领 CURRENT
2. [x] 卡片/API/reconcile 与无 AST 路径
3. [x] 单元测试 + 门控 Playwright
4. [x] 报告并合回
## 验收标准
- [ ] 计划确认不修改 DocumentAST
- [ ] GET 可修复缺失投影
- [ ] 409 标 outdated 并带最新 PlanView
- [ ] 默认 Playwright skip
## 相关链接
- Checklist: [../checklists/2026-09-16-multi-intent-u6-web-cards.md](../checklists/2026-09-16-multi-intent-u6-web-cards.md)
@@ -0,0 +1,14 @@
---
title: "多意图 HITL U7:低风险只读执行"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u7-auto-read
worktree: "-"
mutex: intent-plan
---
# 多意图 HITL U7:低风险只读执行
HandleTurn 在 auto_read 下执行独立查询;默认 legacy 不变。QueryGuard 拒绝 generate。
@@ -0,0 +1,54 @@
---
title: "多意图 HITL U8:task generate adapter"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/multi-intent-u8-task-generate
worktree: "-"
mutex: intent-plan
---
# 多意图 HITL U8:task generate adapter
## 目标
`confirm` tier 下查询+生成落盘 awaiting;确认后仅开放 `task.run` / `task.run.adhoc`,稳定幂等键,不改单意图 taskrun HTTP。
## 范围
- HandleTurn:`ComboNeedsConfirm` 且 tier≥confirm 时 WritePlan 落盘,不自动执行
- `OwnerMux` 把 generate 路由到 Task,其余走 QueryGuard
- `TaskRunAdapter` + `LiveTaskStarter`(无 `PI_AGENT_RUNNER_URL` 只占位不启 PI)
- Assemble 接线;默认 `MULTI_INTENT_PLAN_TIER=legacy` 不变
## 非目标
- U9 LLM 分段、U10–U12 owner 扩面
- 不 rebuild 共享环境、不改项目 143
- 真实 PI 闭环若环境缺失记 stop-gate,不冒充验收
## 步骤
1. [x] 从 `dev` 开 `feature/multi-intent-u8-task-generate`
2. [x] confirm 落盘 + mux + adapter
3. [x] 单测与 arch-check
4. [x] 报告并合回
## 验收标准
- [x] 多意图生成确认前零执行
- [x] 活动写计划冲突
- [x] 确认后 mux 执行 generate,重放 starts=1
- [x] QueryGuard 仍拒绝 generate;权限撤销 fail closed
- [x] 真实 PI 无 URL 时 skip(stop-gate)
## 相关链接
- Checklist: [../checklists/2026-09-16-multi-intent-u8-task-generate.md](../checklists/2026-09-16-multi-intent-u8-task-generate.md)
- Test report: [../../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)
- Parent: [./2026-09-15-multi-intent-hitl.md](./2026-09-15-multi-intent-hitl.md)
## 证据 / 备注
默认 legacy HandleTurn 仍不落盘。真实 PI 见报告 stop-gate。
@@ -0,0 +1,46 @@
---
title: "partial/deferred 全量收口总控"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
owner: Cline
branch: docs/partial-deferred-completion-plan
worktree: "-"
mutex: architecture-docs
---
# partial/deferred 全量收口总控
## 目标
按 [收口计划](../../remediation/2026-09-16-partial-deferred-completion-plan.md) 把 FEATURE-MATRIX 6 行 `partial` + 1 行 `deferred` 推进到 `done`;全程保持模块独立解耦(端口 + 组合根 + PG 事件 + 契约门禁,不新增 RPC 层),变更影响面不跨模块扩散。
## 授权
用户 2026-09-16 要求已设计功能尽量推进 done,并确认通信机制与系统契约。
用户 2026-09-17 确认收口计划 §7 四项决策(D7 草案数字、confirm 可独立授权、REPLACE 默认不启用、FAV 顺序与观察窗);见计划 §7.1–§7.4 与 [D7 ADR 草案](../../adr/2026-09-17-d7-chat-data-retention.md)。
## 步骤
1. [x] W1 CI/E2E 收口(mutex `ci`;secret/runner 配置 + FullNone product_fail + green nightly)
2. [x] W2 PU6 语义摘要 D3(mutex `chat`;shadow + 真实 PI + R13 + 负例;**不要求** REPLACE)
3. [x] W3 PU7 PI change-report 叙事(mutex `docgov`;开 flag + 真实 PI + fallback 负例 + UI 区分)
4. [x] W4 PU8 U9–U12(mutex `intent-plan`;逐 action 独立 flag,U9→U12 顺序;升 confirm 另开独立授权,不升 full)
5. [ ] W5 纯软件自举(mutex `workflow-design`;SWBOOT-10 非 stub + 真实 PI + UI 二次验收)
6. [ ] W6 FAV(mutex `events`;**shadow 已合** → live staging→artifact→publication 仍未开;每级观察窗 ≥7 天;`FAV_DEGRADED_READ=false`;禁止整支 merge)
7. [ ] W7 D7 数据治理(mutex `chat`;**盘点已合**;按 ADR 口径整改仍待合规签字;数字 `pending-compliance-signoff`;本轮未发现已确认违规、未写 gap-matrix)
8. [ ] 逐行升 done(保留 lineage)+ CURRENT / 契约状态同步
9. [x] §7 四项开放问题决策落盘(2026-09-17)
## 验收标准
- [ ] 各波独立 short-term / feature 分支 / test-report / 回滚点(占用对应 mutex)
- [ ] 计划 DoD 全勾(见 remediation 计划 §8;§7 四项决策项已勾)
- [ ] `production_ready` 与 B1–B4 门禁零回归
## 相关链接
- Plan: [../../remediation/2026-09-16-partial-deferred-completion-plan.md](../../remediation/2026-09-16-partial-deferred-completion-plan.md)
- D7 ADR 草案: [../../adr/2026-09-17-d7-chat-data-retention.md](../../adr/2026-09-17-d7-chat-data-retention.md)
- 矩阵: [../../status/FEATURE-MATRIX.md](../../status/FEATURE-MATRIX.md)
- 上位: [2026-09-16-full-backlog-override.md](./2026-09-16-full-backlog-override.md)(P0–P7 已完成,本总控承接其收口阶段)
@@ -0,0 +1,48 @@
---
title: "PU7 PI change-report 叙事"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/pu7-pi-narrative
worktree: .worktrees/feature-pu7-pi-narrative
mutex: docgov
---
# PU7 PI change-report 叙事
## 目标
`PI_CHANGE_REPORT_NARRATIVE` 默认 off;开启后只读消费 immutable diff+lineage 的 typed 叙事,失败全量 deterministic fallback。
## 范围
- `internal/docrevision/` flag + ResolveChangeReport
- `deploy/pi-agent/change-report-narrative-v1.mjs`
- `ChangeReportPanel` / changeReportView 区分事实 vs 叙事
## 非目标
- 默认开启 flag
- 覆盖服务端 risk / approval
- 合入 `dev`(本任务仅 feature 分支)
## 步骤
1. [x] flag 默认 off
2. [x] typed narrative + input digest;失败全量 fallback
3. [x] UI 区分 narrative / 事实字段
4. [x] 单测 flag off + fallback
5. [x] test-report + push feature 分支
## 验收标准
- [x] 默认 off 行为 = deterministic fallback
- [x] 畸形/超时/digest 不匹配 → 无混合字段
- [x] PI 声称低风险不影响服务端 risk floor
- [x] 报告归档
## 相关链接
- Contract: [../long-term/2026-09-16-pu7-pi-narrative-contract.md](../long-term/2026-09-16-pu7-pi-narrative-contract.md)
- Test report: [../../test-reports/2026-09-16-pu7-pi-narrative-test-report.md](../../test-reports/2026-09-16-pu7-pi-narrative-test-report.md)
@@ -0,0 +1,48 @@
---
title: "P5 PU8 U9–U12 独立 flag 脚手架"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/pu8-u9-u12-flags
worktree: /tmp/wt-pu8
mutex: intent-plan
---
# P5 PU8 U9–U12 独立 flag 脚手架
## 目标
为多意图扩面 U9–U12 落地独立 env flag(默认 OFF)与 stub/dry-run 端口,不升 `MULTI_INTENT_PLAN_TIER`。
## 范围
- `MULTI_INTENT_U9_SEGMENT` / `U10_MUTATE` / `U11_DOCGOV` / `U12_RUN_CONTROL`
- U9 segment proposal port + fail-closed stub
- U10–U12 dry-run adapters + `BuildOwnerMux` 门控
- 单测证明默认 off 与 enable 路径不 panic
## 非目标
- 真实 LLM 分段 / 升 tier / 合入 `dev`
- 真实 docgov/workflow 副作用写路径
## 步骤
1. [x] 独立 flags + `.env.example`
2. [x] segment proposal + expansion adapters + mux 门控
3. [x] Assemble `BuildOwnerMux` 接线
4. [x] 单测 + 测试报告
5. [x] push(不合 `dev`)
## 验收标准
- [x] 四 flag 默认 off;开 flag 不升 PlanTier
- [x] flag off ≡ legacy(无 LLM proposal、无新 adapters)
- [x] flag on:U9 fail-closed;U10–U12 dry-run/guarded
- [x] 报告归档
## 相关链接
- Contracts: [u9](../long-term/2026-09-16-pu8-u9-segment-proposal-contract.md) … [u12](../long-term/2026-09-16-pu8-u12-workflow-run-control-contract.md)
- Test report: [../../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md](../../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md)
@@ -0,0 +1,57 @@
---
title: "纯软件项目自举 SWBOOT-00..09 实施"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/software-project-bootstrap
worktree: ".worktrees/feature-software-project-bootstrap"
mutex: workflow-design
---
# 纯软件项目自举 SWBOOT-00..09 实施
## 目标
落地 `software_bootstrap` / `software_delivery` 契约、迁移、manifest、目录白名单、创建向导后端钩子与 SWBOOT-10 allowlist stub;不合并 `dev`,不做真实受控改码。
## 范围
- SWBOOT-00 ADR
- SWBOOT-01 项目域字段迁移
- SWBOOT-02..04 catalog + manifests(无医疗污染)
- SWBOOT-05..08 后端钩子(profile/创建预览/域过滤;UI 可部分)
- SWBOOT-09 单元测试与报告
- SWBOOT-10 allowlist stub only
## 非目标
- 合入 `dev`
- 真实 PI / Ubuntu UI 全量黄金验收
- 真实 repo patch/merge/push
## 步骤
1. [x] 认领 CURRENT + short-term
2. [x] ADR
3. [x] goose 00048
4. [x] manifests + catalog allowlist
5. [x] create-project wizard hooks + SWBOOT-10 stub
6. [x] unit tests + test-report
7. [x] push feature 分支 (`b5ce947`)
## 验收标准
- [x] 医疗三工作流目录与校验无回归(L1)
- [x] 软件两 key 可选且无医疗默认语义
- [x] 迁移 additive,旧项目不误分类(SQL 已写;活验 NOT RUN)
- [x] SWBOOT-10 仅 stub,拒绝真实执行
- [x] 测试报告落盘
## 相关链接
- ADR: `.doc/adr/2026-09-16-software-project-bootstrap-keys.md`
- 设计: `.doc/system-design/2026-09-14-software-project-bootstrap-workflow.md`
- Backlog: `.doc/ops/long-term/2026-09-14-software-project-bootstrap-implementation.md`
- Checklist: `.doc/ops/checklists/2026-09-14-software-project-bootstrap-acceptance.md`
- Test report: `.doc/test-reports/2026-09-16-software-project-bootstrap-test-report.md`
@@ -0,0 +1,47 @@
---
title: "Wave 1 PU3 IAM store fail-closed"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: fix/iam-store-fail-closed
worktree: "-"
mutex: authz
---
# Wave 1 PU3 IAM store fail-closed
## 目标
禁止非显式 opt-in 环境回退 MemoryStore;main/空值/缺表时启动 fail-closed。
## 范围
- `auth.NewStores` 双门:仅 `dev|test` + `AllowInMemory`
- characterization + 负例测试
- 测试夹具与严格鉴权用例适配
- FEATURE-MATRIX IAM/CI 行进度更新
## 非目标
- 完整全路由 inventory(后续增量)
- 真实 PI 补证(Wave 2)
## 步骤
1. [x] 从 dev 开分支并认领
2. [x] 先写负例测试再改 NewStores
3. [x] 跑 auth/server 相关测试
4. [x] 文档与提交
## 验收标准
- [x] main/空 env/缺表不得 MemoryStore 继续服务
- [x] 仅 dev/test + ALLOW_IN_MEMORY 可用内存 fixture
- [x] 授权用户 happy path 不变(short 回归 PASS)
## 相关链接
- Report: `../../test-reports/2026-09-16-wave1-iam-fail-closed-test-report.md`
- Remediation PU3: `../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md`
- Wave 0 IAM 只读: `./2026-09-16-feature-matrix-wave0-calibration.md`
@@ -0,0 +1,48 @@
---
title: "Wave 1 PU5A TempDir race flake 修复"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: fix/race-tempdir-cleanup
worktree: "-"
mutex: ci
---
# Wave 1 PU5A TempDir race flake 修复
## 目标
关闭全仓 `-race` 下 TempDir `RemoveAll` 与异步 taskrun worker 的竞态,证明 worker 在清理前已退出。
## 范围
- `taskrun.Manager` 增加 WaitRunDone / WaitIdle
- `newTestServer` cleanup 在 TempDir 删除前 drain workers
- 阻塞类用例显式 WaitRunDone(如需要)
- 多轮 `-race` 验证与 test-report
## 非目标
- 夜间 PI / promotion receipt(PU5B)
- IAM fail-closed(PU3,独立分支)
## 步骤
1. [x] 认领 CURRENT
2. [x] 实现 WaitIdle + newTestServer cleanup
3. [x] 修补已知阻塞用例
4. [x] `go test -race` 多轮验证并写报告
5. [x] 提交
## 验收标准
- [x] 相关包/全仓 race 多轮无 TempDir RemoveAll flake
- [x] 不用 skip/ignore 假绿
- [x] 报告归档 `.doc/test-reports/`
## 相关链接
- Remediation PU5A: `../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md`
- Report: `../../test-reports/2026-09-16-wave1-race-tempdir-cleanup-test-report.md`
- Handoff: `../handoffs/2026-09-16-feature-matrix-wave0-calibration.md`
@@ -0,0 +1,50 @@
---
title: "已合入 leftover 旁支与文档对齐"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: chore/leftover-hygiene-2026-09-17
worktree: "-"
mutex: ops
---
# 已合入 leftover 旁支与文档对齐
## 目标
拆掉 tip 已是本地 `dev` 祖先的 extra worktree 与本地旁支;把 CURRENT / SWBOOT long-term / PU 契约与 git 事实对齐。不整支合入冻结旁支。
## 范围
- 拆已合入 extra worktree(保留错名 FAV 目录)
- `git branch -d` 已合入 leftover;SWBOOT 残留 1 commit 在确认文档已在 `dev` 后 `-D`
- `fix/clean-test-env-baseline` 不 merge;标明前端清理已放弃
- 对齐 CURRENT、SWBOOT long-term、PU6/PU8 契约
## 非目标
- 不整支 merge `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/*`;不从 worktree 起 docker;不碰项目 143;不 push
- 不升 FEATURE-MATRIX 能力行 `done`
## 步骤
1. [x] 从 `dev` 开 `chore/leftover-hygiene-2026-09-17` 并认领 CURRENT
2. [x] 拆已合入 worktree、删除已合入旁支
3. [x] 文档对齐
4. [x] 冒烟 + test-report
5. [x] 占槽合 `dev`
## 验收标准
- [x] extra worktree 只剩 FAV 错名目录
- [x] 5 条冻结旁支仍在
- [x] 文档不再声称 SWBOOT 未合 `dev`
- [x] vet / short / arch-check / health+ready PASS
## 相关链接
- Test report: `.doc/test-reports/2026-09-17-leftover-hygiene-test-report.md`
- 上位: [2026-09-16-partial-deferred-completion.md](./2026-09-16-partial-deferred-completion.md)
@@ -0,0 +1,51 @@
---
title: "晋升 dev → test(rc-v1.0.0-beta.3)"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/promote-dev-to-test-2026-09-17
worktree: "-"
mutex: infra
---
# 晋升 dev → test(rc-v1.0.0-beta.3)
## 目标
在 `production_ready=yes` 前提下,把本地 `dev@46a0fb2`(含 leftover + W2–W7)合入 `test`,重建测试服务,供部署后实测。
## 范围
- `test` `--no-ff` 合入当前 `dev`
- 候选 tag `rc-v1.0.0-beta.3`
- `./scripts/env-service.sh test rebuild`(部署新代码,不 pin beta.2 旧镜像)
- `:8081` health/ready;goose 00048 可迁移
## 非目标
- 不合入 `main`
- 不启用 FAV live / `FAV_DEGRADED_READ`
- 不升 `MULTI_INTENT_PLAN_TIER` / `SEMANTIC_SUMMARY_REPLACE`
- 不翻转 `production_ready`
- 不终止项目 143
- 不按 D7 草案删除数据
## 步骤
1. [x] 确认 gap-matrix `production_ready=yes`;FAV/D7/SWBOOT 为 deferred_enhancement
2. [x] 占集成槽;合入 `test` + tag
3. [x] rebuild 测试服务
4. [x] health/ready + schema 冒烟
## 验收标准
- [x] `:8081` health/ready PASS
- [x] schema 到达 48(00048 additive)
- [x] FAV 仍 off
- [x] 默认 flag 仍 off
## 相关链接
- Test report: [../../test-reports/2026-09-17-promote-dev-to-test-test-report.md](../../test-reports/2026-09-17-promote-dev-to-test-test-report.md)
- gap-matrix: [../../remediation/gap-matrix.md](../../remediation/gap-matrix.md)
@@ -0,0 +1,53 @@
---
title: "W1 CI/E2E FullNone + green nightly"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w1-ci-e2e-green-nightly
worktree: "-"
mutex: ci
---
# W1 CI/E2E FullNone + green nightly
## 目标
收口 FullNone `product_fail`,取得真实 nightly `verdict=pass` receipt,将 FEATURE-MATRIX「CI / E2E」升为 `done`。
## 范围
- 复核 Actions secret/runner 已就绪
- 复现并修复 `TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain`
- nightly U8+FullNone → green receipt + test-report
- 矩阵行升 done
## 非目标
- W2–W7;升 `MULTI_INTENT_PLAN_TIER`;开 `SEMANTIC_SUMMARY_REPLACE`;整支 merge FAV
## 步骤
1. [x] docs 计划分支合入 `dev`(`4bda648`)
2. [x] CURRENT 认领 `mutex=ci` + 本 short-term
3. [x] 本地复现 FullNone 并分栏(根因:duplicate goose 00048 + fields.json 硬目标 + KB/超时)
4. [x] 修复至本地 FullNone 绿(1008s)
5. [x] nightly green receipt 归档 + test-report(`6e2476f0…` verdict=pass)
6. [x] FEATURE-MATRIX CI/E2E → done;总控 W1 勾选;释放认领
## 验收标准
- [x] Nightly receipt `verdict=pass`(真实 run)
- [x] FullNone 在 nightly 套件 PASS
- [x] 矩阵 `done`;B1–B4 零回归
## 相关链接
- Plan: [../../remediation/2026-09-16-partial-deferred-completion-plan.md](../../remediation/2026-09-16-partial-deferred-completion-plan.md) §W1
- Test report: [../../test-reports/2026-09-17-w1-ci-e2e-green-nightly-test-report.md](../../test-reports/2026-09-17-w1-ci-e2e-green-nightly-test-report.md)
- Receipt: [../../test-reports/assets/promotion-receipts/6e2476f0f2e408e111fe06ca7c31a38294a340b3.json](../../test-reports/assets/promotion-receipts/6e2476f0f2e408e111fe06ca7c31a38294a340b3.json)
## 证据 / 备注
- commits: `4f2e5f0` `a02c67d` `0f52ab8` `11e030d` `6e2476f`
- Gitea Actions API 可达;本提交未推远端,远端 dispatch 留合入后二次确认
@@ -0,0 +1,48 @@
---
title: "W2 语义摘要 shadow 真实 PI"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w2-semantic-summary-shadow-live
worktree: "-"
mutex: chat
---
# W2 语义摘要 shadow 真实 PI
## 目标
在授权可见集合上接入产品 PI Agent Runner 的 no-tool shadow 摘要;默认 flag off;不接线 `SEMANTIC_SUMMARY_REPLACE`。
## 范围
- `PiSemanticSummarizer` 组合根注入(仅 `SEMANTIC_SUMMARY_SHADOW` on 且 backend=pi-agent)
- R13 minimized input.json;tool_permissions=none
- 真实 MiniMax 证据 + injection 负例
- 仓库默认 flag 保持 false
## 非目标
- 启用 `SEMANTIC_SUMMARY_REPLACE`
- 改 test/main 默认 env
## 步骤
1. [x] 认领 CURRENT mutex `chat`
2. [x] 实现 PI summarizer + 单测
3. [x] 真实 PI live
4. [x] test-report + 矩阵升 done
5. [x] 合 `dev`
## 验收标准
- [x] flag 默认 off
- [x] 真实 PI shadow.status=ok 或可解释 fallback
- [x] injection 秘密不入 served narrative;REPLACE 未接线
- [x] vet / short / arch-check PASS
## 相关链接
- 契约: `.doc/ops/long-term/2026-09-16-pu6-semantic-summary-contract.md`
- 总控: `.doc/ops/short-term/2026-09-16-partial-deferred-completion.md`
@@ -0,0 +1,48 @@
---
title: "W3 PU7 PI change-report 叙事 live"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w3-pi-change-report-narrative-live
worktree: "-"
mutex: docgov
---
# W3 PU7 PI change-report 叙事 live
## 目标
flag on 时质量修复路径向产品 PI Agent Runner 请求 `change_report_narrative_v1`;digest 绑定;畸形/超时全量 fallback;UI 区分叙事与 `rule_risk`/lineage。
## 范围
- `CreateAgentCandidate` 在 flag on 且 `ReportJSON` 为空时调用 `NarrativeFetcher`
- 组合根仅 `PI_CHANGE_REPORT_NARRATIVE` on + `pi-agent` 注入 `PiChangeReportNarrator`
- 仓库默认 flag 仍 off;dev 运行态可覆盖
- 负例:timeout envelope / fetcher error → fallback 且不返回 `ErrReportInvalid`
## 非目标
- 不把 fallback 写成完整 PI
- 不覆盖服务端风险与文档影响
- 不默认开启仓库 flag
## 步骤
1. [x] no-tool PI narrator + 组合根接线
2. [x] digest 与 `ResolveChangeReport` 同源(candidate 真实 diff 之后再 fetch)
3. [x] 单测 + 真实 MiniMax + UI 分区单测
4. [x] 合 `dev` + 冒烟 + 矩阵升 done
## 验收标准
- [x] 真实 PI 产出 `change_report_narrative_v1` 且 digest 原样回写
- [x] fallback 负例 PASS
- [x] UI `change-report-factual` / `change-report-narrative` 分区
- [x] test-report 归档
## 相关链接
- Contract: [../long-term/2026-09-16-pu7-pi-narrative-contract.md](../long-term/2026-09-16-pu7-pi-narrative-contract.md)
- Test report: [../../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)
@@ -0,0 +1,39 @@
---
title: "W4 PU8 U9–U12 独立 flag live"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
worktree: "-"
mutex: intent-plan
---
# W4 PU8 U9–U12 独立 flag live
## 目标
U9 真实 LLM proposer(规则能切则不出 proposal);U10–U12 各自独立 flag 的 dry-run→confirm 证据;不升 `MULTI_INTENT_PLAN_TIER`。
## 范围
- `PiSegmentProposer` + 规则门 + 组合根接线
- U10 mutate 幂等 dry-run receipt;U11 项目 143 只读;U12 run-control 独立 flag
- 四份独立 test-report
## 非目标
- 不升 `confirm` / `full`
- 不把 U10–U12 dry-run 写成领域 live 写
## 步骤
1. [x] U9 PI proposer + 规则门
2. [x] U10–U12 分 flag 证据
3. [x] 合 `dev` + 矩阵升 done
## 验收标准
- [x] 真实 MiniMax U9
- [x] 负例 malformed/timeout/OOB/规则已切
- [x] PLAN_TIER 仍 legacy
@@ -0,0 +1,21 @@
---
title: "W5a 软件自举 UI + docs_only PI"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w5a-software-bootstrap-ui-pi
worktree: "-"
mutex: workflow-design
---
# W5a 软件自举 UI + docs_only PI
## 目标
创建向导改为服务端 catalog 驱动;软件项目不克隆医疗 7 模板;solo 标注未独立评审;docs_only 真实 PI 建议 delivery 且不自动激活。SWBOOT-10 仍 stub。矩阵不升 done。
## 非目标
- 真 patch/merge(W5b)
- 升 FEATURE-MATRIX 纯软件自举行
@@ -0,0 +1,51 @@
---
title: "W6 FAV subscriber shadow"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w6-fav-subscriber-shadow
worktree: "-"
mutex: events
---
# W6 FAV subscriber shadow
## 目标
手工移植 FAV subscriber **shadow**:只计算 intended outcome,不写业务副作用;`FAV_DEGRADED_READ=false`;`FAV_PUBLISHER_ENABLED` 默认 false。矩阵保持 `partial`。
## 范围
- `ObserveShadow` 只读计算
- vault status / CLI 标明 shadow 与 live 未放量
- 负例:degraded read 拒绝;HandleLease / Register(fav) 仍 fail-closed
## 非目标
- 整支 merge `feature/final-artifact-vault`
- live staging → artifact → publication
- 启用 `FAV_DEGRADED_READ`
- 升 FEATURE-MATRIX FAV 为 `done`
## 步骤
1. [x] `ObserveShadow` + 负例单测
2. [x] 冒烟 + 报告(live 未放量)
3. [x] 合 `dev`;矩阵保持 partial
## 验收标准
- [x] WouldStage / WouldPublish 恒 false
- [x] FAV_DEGRADED_READ=true 时 shadow 拒绝
- [x] 报告写清 shadow 证据与「live 未放量」
## 相关链接
- Remaining port: [../../audit/2026-09-16-fav-u7-remaining-port.md](../../audit/2026-09-16-fav-u7-remaining-port.md)
- U7 报告: [../../test-reports/2026-09-16-fav-u7-incremental-test-report.md](../../test-reports/2026-09-16-fav-u7-incremental-test-report.md)
- Test report: [../../test-reports/2026-09-17-w6-fav-subscriber-shadow-test-report.md](../../test-reports/2026-09-17-w6-fav-subscriber-shadow-test-report.md)
## 证据 / 备注
不占 live 观察窗;≥7 天窗口仍属后续 live 切片。
@@ -0,0 +1,46 @@
---
title: "W7 D7 对话数据分类盘点"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w7-d7-data-inventory
worktree: "-"
mutex: chat
---
# W7 D7 对话数据分类盘点
## 目标
只做数据分类盘点 audit(sessions/messages、KB、日志、备份、event 敏感字段与流转)。无合规签字不物理删除、不清备份。矩阵 D7 保持 `deferred`。
## 范围
- 只读盘点:表、派生副本、日志、备份脚本、事件 payload
- 若发现**已确认**安全/合规基线违规 → 立即写 gap-matrix blocker
## 非目标
- 按 ADR 草案数字(365/180/30)执行物理删除或备份清除
- 字段级加密实现
- 升 FEATURE-MATRIX D7 为 `done`
- 翻转 `production_ready`
## 步骤
1. [x] 只读盘点系统库 / 共享 KB / 宿主 traces / 事件 payload keys
2. [x] 写 audit + test-report;违规判定(无已确认违规,未写 gap-matrix)
3. [x] 合 `dev`;矩阵保持 deferred
## 验收标准
- [x] 盘点覆盖 sessions/messages、KB、日志、备份、event
- [x] 未执行物理删除
- [x] D7 仍 deferred;ADR 仍 `pending-compliance-signoff`
## 相关链接
- ADR: [../../adr/2026-09-17-d7-chat-data-retention.md](../../adr/2026-09-17-d7-chat-data-retention.md)
- Audit: [../../audit/2026-09-17-d7-data-inventory.md](../../audit/2026-09-17-d7-data-inventory.md)
- Test report: [../../test-reports/2026-09-17-w7-d7-inventory-test-report.md](../../test-reports/2026-09-17-w7-d7-inventory-test-report.md)
+19 -1
View File
@@ -1 +1,19 @@
| <模块名> | <能力描述> | planned | (设计/代码/test-report 链接) | (缺口) | `<mutex>` |
# FEATURE-MATRIX 行模板
复制到 [FEATURE-MATRIX.md](../../status/FEATURE-MATRIX.md) 的完成度表中。能力状态与 `production_ready`(gap-matrix)正交。
| 字段 | 填写说明 |
|------|----------|
| 模块 | 短名 |
| 声明范围 | 本行冻结边界;`done` 只覆盖此范围 |
| 状态 | `done` \| `partial` \| `planned` \| `deferred` \| `blocked` |
| 发布关系 | `non_blocker` / `补证` / `加固` / `deferred_enhancement` |
| 证据 | 设计/代码/test-report 链接;可追 commit/环境/schema |
| 剩余工作 / 关闭条件 | partial/planned 必填;stub/SKIP/fallback 不得冒充关闭 |
| mutex | 与 CURRENT 并行认领一致 |
```markdown
| <模块名> | <声明范围> | planned | non_blocker | (设计/代码/test-report 链接) | (关闭条件) | `<mutex>` |
```
拆行收口时另在「边界 lineage」区记录 before/after、义务去向与证据覆盖结论。
@@ -1,13 +1,15 @@
---
title: "HTTP 与 SSE 公开错误信封整改"
status: planned
status: implemented
created: 2026-09-15
updated: 2026-09-15
updated: 2026-09-16
owner: Cursor
---
# HTTP 与 SSE 公开错误信封整改
> **Implemented(2026-09-16)**:H1–H3 已有 [test-report](../test-reports/2026-09-15-http-error-envelope-h1-h3-test-report.md)。活状态见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / CURRENT;本文保留为方案原文。
## 背景
Phase 2 复核确认错误信封涉及全部 HTTP 路由、SSE transport 和前端解析,属于独立 wire-contract 改造,不应阻塞持久事件交付。审阅见 [模块解耦 Phase 2 方案审阅](../audit/2026-09-15-module-decoupling-phase2-plan-review.md)。
@@ -0,0 +1,47 @@
---
title: "mock 交付物污染真实项目整改方案(demo 数据环境门控 + 服务端清单对账回收)"
status: planned
created: 2026-09-15
updated: 2026-09-15
---
# mock 交付物污染真实项目整改方案(demo 数据环境门控 + 服务端清单对账回收)
## 背景
[Audit 2026-09-15](../audit/2026-09-15-mock-deliverables-pollute-real-projects.md):前端硬编码 mock 交付物(projectId 1/2/3/5201/6001+)与真实项目数字 ID 撞车,空项目展示「终审已生效」幻影受控文档与伪造法定职责人;mock 数据无环境门控且已进入生产构建产物;服务端权威清单为空时前端不回收本地多余项。
## 目标
1. 任何真实(服务端注册)项目的工作台**只显示**服务端 `document_records` + 该项目新建模板克隆项,永不出现 mock 幻影文档;
2. mock/demo 数据仅在显式开启的 demo 构建中生效(构建期注入,默认关闭);
3. 生产构建产物中不含 mock 文档正文与 mock 用户权限;
4. localStorage 已持久化的 mock 项在升级后一次性回收;
5. 前端对服务端清单做**双向对账**:服务端为权威,本地多余受控项下架(复用 ControlledInvalidationPlan/dropRecordKeys 机制)。
## 分波次计划
| 波次 | 内容 | 验收 |
|------|------|------|
| Wave 0 止血(低风险) | 1) `mergeWorkflowDocumentsFromServer` 增加对账回收:`category=workflow` 且 `isLegacyLocalMockDocId(docId)` 的本地项,在服务端清单返回(含空数组)时一律 drop(走 `dropRecordKeys` + 受控失效计划既有管道);2) 新建项目克隆模板的 docId 命名空间(`doc-p{projectId}-*`)与 mock 命名空间隔离校验测试 | test 环境新建项目后清单只剩 `doc-p1-*` 模板项;单测覆盖空清单回收 |
| Wave 1 demo 门控 | 1) 所有 demo 种子(mockDocuments/neuropulse/tenProjects/MOCK_USERS/MOCK 权限)收口到 `web/src/data/seeds/` 单一入口,导出统一 `DEMO_SEEDS`;2) 入口处 `if (!import.meta.env.VITE_ENABLE_DEMO_SEEDS) return EMPTY`(构建期常量,生产默认 false);3) `npm run build` 产物 grep 验证不含「4K超高清荧光」等特征串(`VITE_ENABLE_DEMO_SEEDS= npm run build`);4) demo 构建单独脚本 `build:demo` | 产物 grep 断言进 CI/前端测试;demo 模式显式 opt-in |
| Wave 2 存量清理 | 1) `loadDeliverables` 加载时一次性迁移:剔除命中 `isLegacyLocalMockDocId` 的持久化项(版本化 storage key bump);2) `loadUsers`/`loadProjects` 同理剔除 mock 用户/mock 项目(保留真实同步数据);3) 迁移写入 `storage.ts` 版本号,幂等可重放 | 升级后 localStorage 无 mock 残留;重复刷新幂等 |
| Wave 3 UI 语义防线 | 1) `DeckDrawer`/`DocGovActionBar` 对非服务端注册文档(无 ledger 事实)禁用生命周期徽章/治理按钮,显示「本地示例(不入账本)」占位标签;2) `visibleDeliverables` 统计口径排除 mock ID(防污染项目文档计数) | 空项目不再出现「终审已生效」徽章;组件测试 |
| Wave 4 验收与归档 | 1) test 环境真实新建项目全链路(新建→清单→刷新→重启容器)回归;2) dev 环境 id 1–3 项目抽检;3) `go vet` / `go test -short` / `cd web && npm test && npm run build` 全绿;4) test-report 归档 + gap-matrix 行 | 报告归档 `.doc/test-reports/`;gap-matrix 更新 |
## 验收标准
- [ ] test 新建项目:交付物清单 0 幻影文档,仅 `doc-p{id}-*` 模板项(lifecycleState=template)
- [ ] dev 项目 id 1/2/3:无 doc-001/doc-cusa-* 等幻影项
- [ ] 生产构建产物 grep 无 mock 特征串;demo 构建仅显式开启时含种子
- [ ] localStorage 升级迁移后无 mock 残留且幂等
- [ ] 服务端清单对账:服务端删除/为空时本地对应受控项下架
- [ ] 幻影文档(若 demo 模式保留)不带「终审已生效」徽章与治理操作
## 相关链接
- Audit: [../audit/2026-09-15-mock-deliverables-pollute-real-projects.md](../audit/2026-09-15-mock-deliverables-pollute-real-projects.md)
- Short-term: [../ops/short-term/2026-09-16-clean-test-env-baseline.md](../ops/short-term/2026-09-16-clean-test-env-baseline.md)
- Test Report: [../test-reports/2026-09-16-clean-test-env-baseline-test-report.md](../test-reports/2026-09-16-clean-test-env-baseline-test-report.md)
- gap-matrix 行: 待补(发布 blocker:治理记录失实 / 跨环境影响)
- 既有同域防线: `web/src/features/documentRevision/revisionToolbarMount.ts`(isLegacyLocalMockDocId)、`web/src/lib/controlledDocHydrate.ts`(shouldLoadControlledContent)、`web/src/lib/deliverableSync.ts`(mergeWorkflowDocumentsFromServer)
@@ -1,14 +1,16 @@
---
title: "模块解耦 Phase 2:持久事件交付与后续解耦路线"
status: planned
status: implemented
created: 2026-09-15
updated: 2026-09-15
updated: 2026-09-16
type: refactor
owner: TBD
---
# 模块解耦 Phase 2:持久事件交付与后续解耦路线
> **Implemented / superseded(2026-09-16)**:Track E(E0A–E2)与 shared live、D4–D7b、HTTP 信封 H1–H3、PI typed-result-v1 已有验收报告并合入;可靠事件核心在 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) 标 `done`,FAV 独立 `deferred`。活状态以 FEATURE-MATRIX / CURRENT / gap-matrix 为准;本文保留为历史方案,不删除。
## 决策摘要
Phase 2 的核心交付只包含持久事件链:修正事件生产、补齐 PostgreSQL 投递实现、用无副作用 shadow 对账替换闭包桥,并以授权用户刷新/重启后的正文恢复作为停走门。
@@ -0,0 +1,55 @@
---
title: Demo/测试数据污染整改方案
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: fix/demo-data-pollution-web
mutex: web
---
# Demo / 测试数据污染整改方案
## 目标
生产构建默认无演示文案;权威服务端空清单回收本地 mock;DB 演示项目不进列表;main 拒绝 stub。
## 波次与状态
| Wave | 内容 | 状态 |
|------|------|------|
| 0 | `isDemoSeedDocId` + `mergeWorkflowDocumentsFromServer` 空清单 drop | done |
| 1 | `VITE_ENABLE_DEMO_SEEDS` + `@demo-seeds` alias + `check-prod-bundle.sh` | done |
| 2 | `purgeDemoSeedsFromLocalStorage` 幂等迁移 | done |
| 3 | DeckDrawer「本地示例」徽章;职责人默认值清空 | done |
| 4 | goose `00046` retire projects + `00047` retire sessions + list/`ListChatSessions` 过滤 | done |
| 5 | `ResolveBackendInEnv` main/prod 拒 stub | done |
| 6 | 审计/整改/报告/gap-matrix | done |
## 关键实现
- 判定:[`web/src/data/demoSeedIds.ts`](../../web/src/data/demoSeedIds.ts)
- 门控:[`web/vite.config.ts`](../../web/vite.config.ts) alias `@demo-seeds` → enabled/disabled
- 同步:[`web/src/lib/deliverableSync.ts`](../../web/src/lib/deliverableSync.ts)
- DB:[`deploy/postgres/goose/00046_2026-09-16-retire-demo-ten-projects.sql`](../../deploy/postgres/goose/00046_2026-09-16-retire-demo-ten-projects.sql)
- Stub:[`internal/taskrun/backend.go`](../../internal/taskrun/backend.go)
## 验收标准
- [x] 默认 `npm run build` 后 `check-prod-bundle.sh` PASS
- [x] 空 server 清单 drop demo-seed 单测 PASS
- [x] `ResolveBackendInEnv(..., "main")` 拒 stub 单测 PASS
- [x] 共享环境 migrate `00046`/`00047` 后列表无 6001–6010(dev schema 47)
- [x] 新建空项目 UI/API 交付物无伪造 approved(项目 6357 documents=0)
## 启用 Demo(仅本地/评审)
```bash
VITE_ENABLE_DEMO_SEEDS=true npm run dev
```
## Follow-up(P2,不挡合入)
- stub 旁路:`resolveTaskBackend` 双重失败返回 `""` 时 squad 回落 `cfg.AgentBackend`;建议 main/prod 启动 fail-fast 校验 `AGENT_BACKEND≠stub`
- `purgeDemoSeedsFromLocalStorage` 对 projectId 1/2/3 无 serverIds 守卫,可能清掉 test 环境真实本地会话缓存;长期改为按 `sess-neuropulse-*` / `sess-wangjing-*` 前缀或注释权衡
- 姊妹分支 `fix/clean-test-env-baseline` 重叠前端清理已放弃;已挑拣 `a91a031`(`SEED_DEMO_USERS=false`)与 2026-09-15 审计回链
@@ -0,0 +1,454 @@
---
title: "FEATURE-MATRIX Production-Ready Continuity - Plan"
type: refactor
date: 2026-09-16
deepened: 2026-09-16
status: in_progress
artifact_contract: ce-unified-plan/v1
product_contract_source: ce-plan-bootstrap
execution: code
wave0: done
---
# FEATURE-MATRIX Production-Ready Continuity - Plan
## Goal Capsule
- **Objective:** 让维护者能够从 `FEATURE-MATRIX.md` 准确判断当前发布基线、真实剩余工作和每项工作的关闭条件,同时保持已经签署的 production-ready 状态不被文档整理或后续增强误伤。
- **Means:** 将能力成熟度与发布门禁拆成两个正交维度,先校准证据和状态,再按“补证、基建加固、可选增强”分波实施(KTD1、KTD2)。
- **Authority:** `gap-matrix.md` 决定发布 blocker;`FEATURE-MATRIX.md` 决定能力成熟度;`CURRENT.md` 记录协作与环境快照。
- **Execution profile:** verification-first;文档校准不改业务行为;新能力默认 off、legacy 或 shadow;跨环境先以 receipt 绑定同一 commit 和 digest,PU5B 完成后只晋升同一已验证 image。
- **Stop conditions:** 任一波发现授权旁路、持久化丢失、双写者、跨用户泄漏、当前 B1–B4 回归或 main/prod fail-open 时,停止扩面并将该问题写入 `gap-matrix.md`。
---
## Product Contract
### Summary
当前系统按仓库 SSOT 已达到 `production_ready=yes`。本计划不重新定义首发范围,而是修正矩阵漂移,补上可判定的关闭条件,并把剩余工作排成不会改变当前默认路径的独立波次。
### Problem Frame
`FEATURE-MATRIX.md` 目前把五类状态都写成 `partial`:已完成但文档未收口、实现完成但真实证据未签、首发后增强、实验性能力和刻意关闭能力。结果是维护者无法从矩阵判断哪些事项会影响发布,也无法知道某行何时能转为 `done`。
矩阵还存在已确认的事实漂移:schema 45 与当前 schema 47 冲突,语义摘要编号误写为 D5,IAM 仍列出已经闭环的历史读取授权缺口,可靠事件核心被 FAV 的 off 状态拖成 `partial`。这些问题需要先在文档层纠正,再决定是否立业务实现任务。
### Requirements
#### Status and ownership
| ID | Requirement |
|---|---|
| R1 | `production_ready` 只由 `gap-matrix.md` 的发布门禁决定;能力行不是“全部 done 才能发布”的总开关。 |
| R2 | 每行必须声明既定能力边界、能力状态、发布关系、剩余工作、关闭条件、owner/mutex 和当前证据。 |
| R3 | `done` 表示本行声明能力已达到生产验收,不表示该领域没有后续;新增增强应拆行或进入 backlog。 |
| R4 | 补证、修复、增强、实验和 deferred 能力必须分开,不能共用一个模糊的“后续”。 |
#### Evidence and release safety
| ID | Requirement |
|---|---|
| R5 | 状态提升必须同时核对源码、迁移、部署 artifact、API/runtime 和适用测试层级;单独改文档不得提升能力状态。 |
| R6 | 证据必须记录或可追到 commit、环境、schema、镜像、runner/model/protocol、日期和测试类型。 |
| R7 | 代码、schema、compose、flag、runner 协议或环境晋升触发受影响行重验;历史报告保留但不得证明新 artifact。 |
| R8 | 新功能先使用 additive migration 和兼容读取,再以 off/legacy/shadow 上线;任何放量都要有独立回滚点。 |
| R9 | 回滚必须能读取、取消和收口已持久化的 plan/run/event;禁止回滚 schema 或让旧 app/worker 不认识新状态。 |
#### Authorization and agent behavior
| ID | Requirement |
|---|---|
| R10 | UI、API、聊天和产品 PI Agent Runner 必须进入同一 owner service,并共享即时授权、资源版本、幂等、审计和错误语义。 |
| R11 | 正文、计数、摘要、搜索、计划卡、RAG 和 Agent tools 必须从同一授权后可见集合派生。 |
| R12 | 产品 PI Runner 只生成建议、内容或解释;权限判断、状态迁移、版本提交和法定审批由服务端及已认证用户完成。 |
| R13 | 所有真实 PI 路径必须共享最小化出站、tenant/project 绑定、敏感字段脱敏、凭证最小权限、日志/产物留存和泄漏负例;夜间验收只使用隔离的合成数据。 |
### Actors
- A1. 文档维护者:更新矩阵、证据链接和历史 superseded 指针。
- A2. 发布负责人:决定 blocker、环境晋升、回滚和 production-ready 翻旗。
- A3. 模块 owner:实现或验证单个 action,不跨 mutex 批量扩面。
- A4. 最终用户:通过 UI、API 或聊天使用同一服务端能力。
- A5. 产品 PI Agent Runner:受控生成或解释,不承担 authority。
### Key Flows
- F1. 矩阵状态更新
- **Trigger:** 新实现、补证或环境晋升完成。
- **Actors:** A1、A2、A3。
- **Steps:** 核对行边界 → 匹配证据 → 评估发布关系 → 更新矩阵 → 仅在 blocker 变化时更新 gap-matrix。
- **Outcome:** 能力状态和发布状态不互相污染。
- F2. 增强能力上线
- **Trigger:** 一个 deferred/partial 子能力获批实施。
- **Actors:** A2、A3、A4、A5。
- **Steps:** additive migration → 默认关闭 → 隔离验证 → dev 灰度 → test 晋升 → main 晋升或独立回滚。
- **Outcome:** 当前路径持续可用,新能力只在证据完整后放量。
### Acceptance Examples
- AE1. **Covers R1–R4.** 前端工作台现有范围证据完整时,该行可改 `done`;未来其他 409 消费方优化进入独立 backlog,不把该行退回 `partial`。
- AE2. **Covers R5–R9.** multi-intent U8 adapter 已合入但真实 PI 为 SKIP 时,矩阵写“代码与默认 legacy 基线完成、真实生成闭环未签”,tier 不升到 `confirm/full`。
- AE3. **Covers R10–R12.** full 文档由真实 PI 生成后由独立用户完成审核/批准;none 文档生成后无审批动作且不阻塞阶段。
- AE4. **Covers R5–R8.** PI change-report 超时或返回非法 schema 时,用户仍看到明确标记的 deterministic fallback,候选版本和正文不被 PI 输出修改。
- AE5. **Covers R1、R6、R7.** 夜间真实 PI 因 runner 不可用失败时,结果记为 infrastructure failure 并阻止下一次晋升;已发布版本不会被自动改写为未就绪。
### Scope Boundaries
#### In scope
- 整改 `FEATURE-MATRIX.md` 的状态契约、行边界、证据和关闭条件。
- 同步仍作为活 SSOT 的 CURRENT、gap-matrix、remediation index 和历史文档指针。
- 安排 IAM、补证、CI、语义摘要、PI change-report、多意图扩面的后续工作。
- 为每个波次定义回归、部署、证据和回滚门。
#### Deferred to Follow-Up Work
- Final Artifact Vault:独立审计,保持 `FAV_DEGRADED_READ=false`,禁止整支合入 `feature/final-artifact-vault`。
- 多意图 U9 LLM 分段实验:仅在预注册真实 PI eval 阈值通过且安全错误为 0 后考虑放量。
- 多意图 U10–U12:每个 action 独立任务、flag、owner、授权负例和回滚点。
- D7 对话留存与敏感字段加密:独立安全治理项;先完成数据分类、当前数据库/备份/日志控制盘点和合规口径,再设计迁移、回滚与验收。若盘点确认当前基线违反已确认的安全或合规要求,必须立即写入 `gap-matrix.md`,不能继续作为普通 backlog。
#### Out of scope
- 纯软件项目自举。
- 将 Herdr、`context_pi`、Cursor、Codex 或其他工程协作 Agent 作为产品 PI Agent Runner 的验收证据。
- 在本次方案编制和 Wave 0 阶段修改业务代码、启用 dormant flag、合并 `dev` 或操作共享容器。
### Success Criteria
1. 维护者能在一行内判断“当前能力是否完成、是否影响发布、还差什么、用什么证据关闭”。
2. 已确认的 L1、前端工作台和可靠事件核心不再因无关 backlog 永久 `partial`。
3. IAM、multi-intent U8、full/none、CI、语义摘要和 PI 叙事都有独立的关闭条件,不再用 stub、SKIP 或 fallback 冒充完整验收。
4. 后续任一波失败都可回到当前默认路径,B1–B4 和 schema 47 基线不被破坏。
---
## Planning Contract
### Key Technical Decisions
- KTD1. **能力状态与发布状态正交。** `FEATURE-MATRIX.md` 记录能力成熟度,`gap-matrix.md` 记录发布 blocker;仅当前生产契约被证据推翻时回退 `production_ready`。Governs R1–R4。
- KTD2. **按冻结的能力边界关闭行。** 已完成范围转 `done`,新增增强拆成新行或 backlog,避免永久 `partial`。任何边界变更都要保留 before/after、逐项迁移去向和原边界已满足的证据,禁止靠缩小口径制造 `done`。Governs R2–R4。
- KTD3. **证据按变化触发重验。** 不设机械 TTL;按代码、schema、artifact、flag、runner/protocol 和环境晋升触发重验。Governs R5–R7。
- KTD4. **补证和修复分离。** full/none 与 multi-intent U8 先执行真实验收;只有验收失败并定位为产品缺陷后才开修复分支,修复后必须重验。Governs R5、R8。
- KTD5. **逐能力安全放量。** migration 只 expand,新能力默认 off/legacy/shadow,app/worker 保持向后读取和收口能力。Governs R8、R9。
- KTD6. **共享 command 与共享 authorized view。** 所有入口调用同一 owner port,读模型从同一授权集合派生。Governs R10、R11。
- KTD7. **PI 叙事不成为事实源。** diff、lineage、risk floor、版本和审批由服务端确定;PI 失败时保留显式 fallback。Governs R12。
- KTD8. **同一 artifact 晋升是独立发布加固。** 在不可变镜像流水线落地前,dev/test/main 至少记录同一候选 commit、各环境 image digest 和构建证明,不得声称已实现 same-image promotion;落地后 test/main 只引用候选 commit 一次构建出的 digest。Governs R5、R7–R9。
### High-Level Technical Design
#### Status decision
```mermaid
flowchart TB
A[Read declared capability boundary] --> B{Current evidence satisfies boundary?}
B -->|No| C{Is capability active in release path?}
C -->|Yes and contract regressed| D[Mark blocked and update gap-matrix]
C -->|No| E[Keep partial, planned, or deferred]
B -->|Yes| F{Remaining work belongs to same boundary?}
F -->|Yes| G[Keep partial with explicit exit gate]
F -->|No| H[Mark current row done]
H --> I[Create separate enhancement or deferred row]
```
#### Safe rollout and rollback
```mermaid
flowchart TB
A[Expand schema and compatible readers] --> B[Deploy flag off or legacy]
B --> C[Unit and isolated PG evidence]
C --> D[Dev shadow or targeted live]
D --> E{Stop gate passes?}
E -->|No| F[Disable new writes and drain]
F --> G[Keep read, cancel, and finalize compatibility]
E -->|Yes| H[Test promotion with receipt]
H --> I[Main promotion with same commit and proven digest]
I --> J[Update evidence and matrix]
```
### Current Residual Work Map
| Area | Baseline now | Required closure | Current classification / transition |
|---|---|---|---|
| Intent L1 | 18 类、三分支、读写分流、busy 已签 | 从本行移除 U9–U12,确认纯依赖门禁仍在 | `done` |
| Multi-intent baseline | U1–U8 code/default legacy + Wave2 real PI | Playwright 双标签仍 gated;升 tier 另开 | `done` |
| Multi-intent expansion | U9–U12 未进入首发 | U9 eval;U10–U12 per-action | 当前 `deferred`;获批 short-term 开始后转 `partial` |
| Chat / ctxmgr baseline | 刷新恢复与授权同集已签 | 修正文档状态;新摘要另列 | `done` |
| Semantic summary (D3) | deterministic summary 已有 | 产品 go/no-go;授权输入、shadow、fallback | 当前 `deferred`;获批 short-term 开始后转 `partial` |
| Chat data governance (D7) | 当前生产控制待盘点 | 数据分类、留存删除、数据库/备份/日志控制与敏感字段加密边界 | `deferred`;确认违规时升级 blocker |
| Workflow governance | 正式工作流、鉴权、三工作流 PI、full/none 长链已签 | 纯软件自举仍 planned | `done` |
| IAM / authz | 已知历史读取缺口已闭环 | 全路由 inventory、PG fail-closed、410 决策 | `partial` |
| Document revision baseline | 账本、确定性 diff/lineage 与 UI 已签 | 修正文档状态;PI 叙事另列 | `done` |
| PI change-report narrative | deterministic report 已有 | 产品 go/no-go;只读 narrative、fallback 永久保留 | 当前 `deferred`;获批 short-term 开始后转 `partial` |
| Frontend workbench | 当前声明范围均有证据 | 修正文档状态;增强另列 | `done` |
| CI / E2E | PR CI、PG、backup、web 已有 | nightly real PI;TempDir race flake | `partial` |
| Artifact promotion | 同 commit + receipt digests + 单机 same-image pin 已落地 | 远程 registry 不可变推送另立 | 当前 `done`(Wave 2C;单机 retag) |
| Reliable events | 核心 live 且旧 hook 退出 | 与 FAV 拆行 | `done` |
| FAV | 明确 off | 独立审计与 go/no-go | `deferred` |
### Phased Delivery
| Wave | Units | Release behavior | Exit gate |
|---|---|---|---|
| Wave 0: SSOT calibration | PU1–PU2 | 只改文档,不改代码或 flag;先只读核对已部署 IAM store 选择和缺表行为 | 三份 SSOT 无矛盾;历史指针可追溯;若发现当前发布契约回归,先更新 gap-matrix 再退出本波 |
| Wave 1: Safety guardrails | PU3、PU5A | IAM fail-closed 与 race 修复独立交付 | 当前 B1–B4 全绿;授权用户 happy path 不变;新增 fail-closed 负例通过 |
| Wave 2: Evidence closure | PU4 | 补真实 PI/browser/restart 证据;产品缺陷另开原子修复任务后重验 | 目标场景 PASS,或以明确 FAIL/blocker 退出;不得用“已分类”冒充关闭 |
| Wave 2B: Release hardening | PU5B | 夜间 PI、promotion receipt、不可变 artifact 分阶段落地 | gate 可执行、可审计、可人工豁免且不改变已发布版本状态 |
| Wave 3: Optional capability selection | PU6–PU8 | 只做逐能力 go/no-go 和独立任务设计;未获批不实施 | 有用户信号、收益、维护成本、owner 和预注册阈值;否则保持 deferred |
### System-Wide Impact
- **Authorization:** IAM inventory 覆盖 list/detail/search/export/count/SSE/RAG/Agent tools;任何 unavailable/error 路径 fail closed。
- **Data lifecycle:** 新状态采用 additive migration;回滚继续读取和收口已有 plan/run/event。
- **Agent parity:** UI、API、聊天和产品 PI Runner 共享 owner command 与 authorized view;Herdr 不进入产品验收。
- **PI data boundary:** 真实 PI 只接收 allowlist 后的最小输入,并绑定 tenant/project;服务端脱敏,凭证最小权限且可轮换,日志和测试产物有访问与保留边界。
- **Operations:** worktree 只做静态、单元和隔离 PG;合入、rebuild、共享容器和环境晋升占唯一集成槽。
- **Documentation:** 历史证据不删除;过时文档增加 superseded/implemented 指针。
### Risks and Mitigations
| Risk | Consequence | Mitigation |
|---|---|---|
| 文档修改直接把 partial 改 done | 状态提升没有新证据 | PU1 定义证据门;PU2 只对已满足冻结边界的行收口 |
| main 缺 IAM 表时回退内存 store | 权限和会话失去持久权威 | PU3 改为 dev/test 显式双门 opt-in;空值、未知环境和 main/prod 一律 fail closed |
| multi-intent U8 code-complete 被写成 real-PI-complete | 误升 tier 后出现双执行或不可恢复 | PU4 独立补真实 PI、撤权、刷新和重启证据 |
| full/none 语义混淆 | none 被错误要求审批或阻塞阶段 | PU4 分别验证 full 人工审批与 none 免审批负例 |
| PI narrative 覆盖确定性事实 | 报告失真或阻断版本流程 | PU7 只消费只读 diff+lineage,任何 schema 偏差全量降级 |
| 夜间 PI 偶发失败污染发布状态 | 无法区分供应商故障和产品回归 | PU5B 分类 infra/product failure,以 commit/digest receipt 阻止下一次晋升并保留审计豁免 |
| 多 action 共用开关 | 无法单独回滚 | PU8 只产出独立 short-term、flag、owner 和证据契约,不在本计划批量实现 |
| FAV 整支合入 | 带入旧实现或启用 degraded read | 保持 deferred;未来只摘取已审计的原子提交 |
---
## Implementation Units
### PU1. Define the matrix contract
- **Goal:** 为 `FEATURE-MATRIX.md` 建立能力状态、发布关系、关闭条件和证据字段的稳定契约。
- **Requirements:** R1–R7。
- **Dependencies:** 无。
- **Files:** `.doc/status/FEATURE-MATRIX.md`、`.doc/ops/templates/feature-matrix-row.md`、`.doc/status/README.md`。
- **Approach:**
1. 在矩阵说明中定义 `done|partial|planned|deferred|blocked` 的判定和 `production_ready` 的独立来源。
2. 将当前单一表改为可扫描的字段集合:声明范围、能力状态、发布关系、剩余工作、关闭条件、证据、owner/mutex。
3. 定义证据 provenance 与重验触发器;不要把环境瞬时健康等同于代码已部署。
- **Patterns to follow:** `gap-matrix.md` 的 blocker SSOT、`CURRENT.md` 的环境快照、`feature-matrix-row.md` 模板。
- **Test scenarios:** Test expectation: none — 文档契约变更,不改变运行行为。
- **Verification:** 模板和矩阵字段一致;每个状态都能由文档规则唯一解释;链接和 Markdown 校验通过。
### PU2. Reconcile current rows and historical pointers
- **Goal:** 修复已确认漂移,并将已完成基线与独立增强拆行。
- **Requirements:** R1–R7。
- **Dependencies:** PU1。
- **Files:** `.doc/status/FEATURE-MATRIX.md`、`.doc/ops/CURRENT.md`、`.doc/remediation/gap-matrix.md`、`.doc/remediation/INDEX.md`、`.doc/system-design/2026-09-15-multi-intent-hitl-plan.md`、`.doc/remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md`、`.doc/remediation/2026-09-15-http-error-envelope-remediation.md`、`.doc/ops/research/2026-09-15-track-e-retrospective.md`。
- **Approach:**
1. 把 schema 45 改为当前 schema 47,纠正 D3/D5,移除 IAM 已关闭缺口。
2. 将 L1、Chat/ctxmgr baseline、Document revision baseline、前端工作台、可靠事件核心按冻结范围评估为 `done`;把语义摘要、PI 叙事、多意图扩面和 FAV 分成独立行。
3. 给被后续报告取代的历史文档增加 implemented/superseded 指针,不删除历史证据。
4. 在任何状态收口前,只读核对已部署环境的 IAM store 选择、schema 47 IAM 表和缺表行为;确认 fallback 不可达才保持 `production_ready=yes`。若发现当前发布契约回归,立即更新 gap-matrix blocker,不等待后续波次。
5. 每个拆行保留 before/after 边界、原义务的新去向和原边界已满足的证据,禁止仅通过缩小描述把行改为 `done`。
- **Patterns to follow:** `.doc/archive/` 的历史保留纪律、现有测试报告回链。
- **Test scenarios:** Test expectation: none — 这是证据对账和 SSOT 修订。
- **Verification:** FEATURE-MATRIX、CURRENT、gap-matrix 对 schema、门禁和非 blocker 列表的叙事一致;不存在失效链接或相互矛盾状态。
### PU3. Close IAM inventory and production fail-closed gaps
- **Goal:** 用全路由证据替代旧抽样矩阵,并禁止 main/prod 在 IAM 表未就绪时回退内存 authority。
- **Requirements:** R5–R12。
- **Dependencies:** PU1;PU2 已完成部署事实核对。
- **Files:** `.doc/audit/authorization-matrix-v2.md`、`internal/server/server.go`、`internal/server/auth_helpers.go`、`internal/server/chat_history_auth.go`、`internal/auth/store_factory.go`、`internal/auth/store_factory_test.go`、`internal/server/security_p0_test.go`、`internal/server/*_authz*_test.go`。
- **Approach:**
1. 从注册路由生成或维护 resource/action/owner/authn/ReBAC/ABAC/duty/negative-test inventory。
2. 先验证 list/detail/search/export/count/SSE/RAG/Agent tools 是否共享授权集合;只修复确认的旁路。
3. 只有环境明确为 dev/test 且 `ALLOW_IN_MEMORY=true` 时才允许测试 fallback;环境空值、未知值、main/prod、pool 缺失、IAM 表缺失或授权依赖不可用时一律启动失败或请求 fail closed。
4. 先验证 schema 47 的 IAM 表在目标环境确实存在;缺迁移则以 additive migration 修复后再启用 fail-closed,禁止让保护措施把环境永久变成不可部署。
5. 已建立 session 的请求也在授权依赖不可用时 fail closed;依赖恢复后按既有健康检查/重连路径恢复,不沿用缓存的旧授权。
6. 将旧 API 410 视为兼容策略,依据遥测决定长期保留或退役,不再把“存在 410”本身写成能力缺口。
- **Execution note:** 先添加 characterization 和负例,再修改 store selection 或路由授权。
- **Test scenarios:**
- main 配置下 IAM 表缺失时,应用不得创建 MemoryStore 管理员并继续服务。
- 非成员、非 session owner、错误 stage、错误 duty 读取正文、计数、搜索、导出、SSE、RAG 和 Agent tool 时均拒绝且不泄漏资源存在性。
- 管理员例外只通过服务端 `IsSystemAdmin`,请求体/header 不能伪造。
- 权限在确认后撤销时,执行前重新授权并保持零副作用。
- 仅 dev/test 加显式 opt-in 时内存 fixture 可用;环境未设置、拼错或 opt-in 为 false 均 fail closed。
- IAM 依赖在 session 建立后中断时,正文、计数、搜索、SSE、RAG 和 Agent tools 均拒绝;恢复后重新取权,不沿用旧权限。
- **Verification:** 全路由 inventory 每项有 owner 和负例;PG 集成与安全套件证明 fail closed;若发现 active bypass,先更新 gap-matrix 再继续其他波次。
### PU4. Close real-PI evidence gaps without pre-authorizing fixes
- **Goal:** 补齐 multi-intent U8 与工作流 full/none 的真实 PI、浏览器、持久化和恢复证据。
- **Requirements:** R5–R13;Covers AE2、AE3。
- **Dependencies:** PU1–PU2;测试设计可与 PU3 inventory 并行,最终证据必须基于 PU3 完成后的同一候选 artifact,且共享环境验收串行。
- **Files:** `.doc/ops/checklists/` 下新增验收清单、`.doc/test-reports/` 下新增报告、`internal/server/workflow_governance_piagent_pg_test.go`、`internal/app/intentflow/` 相关测试、`web/` 对应 browser 测试与 assets。
- **Approach:**
1. multi-intent U8 验证真实 PI generate、PG plan/step/receipt、确认前零副作用、重复提交、撤权、双标签、刷新/重登/app+worker restart。
2. full 文档走真实生成、author submit、独立 reviewer、独立 approver 和阶段门禁。
3. none 文档走真实生成、版本账本、审批动作不适用和阶段不阻塞;禁止写成“none 审批通过”。
4. 失败先归类为环境、验收脚本或产品缺陷;产品缺陷创建独立 `fix/*` 任务,修复后的同一场景必须重验,不能以“已分类”关闭证据缺口。
5. 所有场景通过共享 PI 数据安全门:最小字段 allowlist、服务端脱敏、tenant/project 绑定、最小权限测试凭证和受限日志/产物;只使用隔离合成数据,并执行泄漏负例。
- **Test scenarios:**
- multi-intent U8 在无确认、确认、重复确认、活动计划冲突、权限撤销和 receipt 丢失下符合单一终态与幂等要求。
- UI、直接 API 和聊天指令最终产生相同领域状态、actor、版本和可见结果。
- full 文档跨三个真实用户完成职责分离;每次运行使用隔离 project/workspace 和命名空间,错误职责用户的每个动作均拒绝。
- none 文档没有 submit/review/approve,可刷新和重启恢复,且不阻塞 advance。
- runner/model 不可用时验收明确失败或 SKIP,不得记为产品 PASS。
- **Verification:** 真实 PI、PG、browser、restart、cross-user 证据分栏归档;通过后只关闭对应证据缺口,不自动启用更高 tier。
### PU5A. Eliminate the repository race flake
- **Goal:** 独立关闭全仓 race 的 TempDir 清理竞态,不让外部模型可用性阻塞正确性修复。
- **Requirements:** R5–R9。
- **Dependencies:** PU1。
- **Files:** `.github/workflows/ci.yml`、`internal/server/task_run_handlers_test.go` 或对应 `TestCreateTaskRun_PreActivationAcceptedNot409` fixture、`.doc/test-reports/`。
- **Approach:**
1. 定位并修复异步 worker 未收口导致的 TempDir 清理竞态;不能用跳过或忽略让全仓 race 假绿。
2. 保留可重复的最小回归,并执行全仓 race 多轮验证。
- **Test scenarios:**
- 全仓 race 多次运行不再出现 TempDir RemoveAll,并能证明 worker 已退出。
- **Verification:** 全仓 race 不再依赖已知 flake 豁免;PR CI 仍不依赖外部模型。
### PU5B. Add nightly PI and enforce auditable promotion receipts
- **Goal:** 增加夜间真实 PI 回归和可执行的下一次晋升门,同时逐步实现一次构建、按 digest 晋升。
- **Requirements:** R5–R9、R13;Covers AE5。
- **Dependencies:** PU1、PU4 的稳定场景;不阻塞 PU5A。
- **Files:** `.github/workflows/nightly-real-pi.yml`、`.github/workflows/ci.yml`、`scripts/promote-to-test.sh`、`scripts/release-to-main.sh`、`docker-compose*.yml`、`.doc/test-reports/`。
- **Approach:**
1. 夜间 job 使用最小权限且可轮换的 secrets、隔离合成 project/session、真实 PI 标识、受限产物留存、并发取消和有限重试。
2. 为被测 commit 生成不可变 promotion receipt,记录结论、时间、runner/model/protocol、commit 和 image digest;所有晋升入口必须验证目标 commit 的最新有效 receipt。
3. 将 runner/credential/network failure 与产品断言失败分开。产品失败拒绝晋升;基础设施连续失败冻结下一次晋升,但允许发布负责人在确认外部故障、最近成功结果仍有效、PR/PG 门禁全绿后做带理由和时限的审计豁免。
4. CI 从候选 commit 一次构建 app/events/PI Runner 镜像并记录 digest;test/main 最终只引用该 digest。在此能力完成前只可声称 same-commit 加各环境 digest 可追溯,不得声称 same-image promotion。
- **Test scenarios:**
- 缺 secret 或 runner 不可达时 job 为 infrastructure failure,不生成 PASS 报告。
- 产品断言失败时保留脱敏后的 typed result、schema 和测试证据,告警到明确 owner,晋升脚本拒绝目标 commit。
- 两次调度重叠时旧 run 被取消,不污染同一 fixture。
- receipt 过期、commit/digest 不匹配、产品失败或未经审计的 infra failure 均拒绝晋升;有效时限内的人工豁免可追到发布负责人和理由。
- **Verification:** nightly 具有 schedule/manual 入口、失败分类、owner、retention 和 promotion-gate receipt;test/main 能证明引用候选构建的同一 digest。
### PU6. Decide semantic-summary go/no-go and prepare its task contract
- **Goal:** 决定 D3 语义摘要是否值得实施;若获批,只创建独立 short-term 和完整执行契约,不在本计划直接改业务代码。
- **Requirements:** R5–R13。
- **Dependencies:** PU3 的授权 inventory;PU1–PU2 的独立行;独立产品 go/no-go。
- **Files:** 本计划只更新 `.doc/backlog/chat-agent-p6-backlog.md` 和新 short-term;下列代码与测试路径属于获批任务契约:`internal/ctxmgr/summarizer.go`、`internal/app/chatflow/`、`internal/server/chat_digest_api.go`、对应 Go/PG 测试、`web/src/` 摘要消费组件与测试。
- **Approach:**
1. 实施前冻结当前用户痛点/使用信号、预期收益、维护成本、owner、最小样本、质量阈值和零容忍安全失败;未通过 go/no-go 则保持 deferred,本计划不实施。
2. 获批任务必须只向无工具权限的摘要器提供 authorized view 和最小化输入,保存来源引用、输入版本、模型/协议和 freshness,并应用 R13 的共享 PI 数据安全门。
3. 先 shadow 评估质量和泄漏负例,再决定是否替换 deterministic summary。
4. 模型失败、超时或输出不安全时保留旧摘要或确定性 fallback,并明确 freshness。
- **Test scenarios:**
- 被撤权或跨阶段消息不进入新摘要、计数和引用。
- prompt injection 只能作为材料,不能改变摘要权限或系统动作。
- 新消息增量更新不重复旧内容;并发生成只提交一个当前版本。
- 模型失败后刷新、重登和重启仍返回可解释 fallback。
- **Verification:** 本计划验证 go/no-go 记录、预注册门和 short-term 契约完整;获批任务必须在 shadow、权限负例、PG 持久化和真实 browser 恢复通过后才更新 rollout tier。
### PU7. Decide PI-narrative go/no-go and prepare its task contract
- **Goal:** 决定可选 PI 叙事是否值得实施;若获批,只创建独立 short-term 和完整执行契约,不在本计划直接改业务代码。
- **Requirements:** R5–R13;Covers AE4。
- **Dependencies:** PU3 的授权边界;现有 typed-result-v1;独立产品 go/no-go。
- **Files:** 本计划只创建独立 short-term;下列代码与测试路径属于获批任务契约:`internal/docrevision/service.go`、`internal/docrevision/risk.go`、`internal/taskrun/finalize.go`、`deploy/pi-agent/` typed result/schema、`web/src/components/doc/ChangeReportPanel.tsx` 及对应测试。
- **Approach:**
1. 实施前冻结当前用户痛点/使用信号、预期收益、维护成本、owner、最小样本、质量阈值和零容忍安全失败;未通过 go/no-go 则保持 deferred,本计划不实施。
2. 获批任务中的 PI 必须在无写工具环境中只读消费经过 R13 安全门的 immutable input snapshot、diff、lineage 和服务端计算的 impact/risk floor。
3. 输出使用版本化 typed schema,并绑定文档版本与输入 digest。
4. partial/malformed、timeout、cancel、unknown schema、提示注入或 digest mismatch 一律全量降级到显式 fallback,不混合呈现部分 PI 字段。
5. fallback 继续支持查看、确认/拒绝、刷新和重启恢复。
- **Test scenarios:**
- 合法 PI narrative 与对应 snapshot/version/digest 一致并在 UI 标出分析状态。
- PI 试图降低风险、修改 hunk 或更改审批结论时,服务端忽略或拒绝。
- malformed/timeout/cancel/retry 不产生第二份 candidate 或第二个终态。
- 非授权用户不能从叙事、引用或计数推断不可见文档。
- **Verification:** 本计划验证 go/no-go 记录、预注册门和 short-term 契约完整;获批任务必须证明 deterministic fallback 全量回归通过,且真实 PI/browser/restart 报告明确区分 narrative 与事实字段。
### PU8. Prepare independent multi-intent follow-up tasks
- **Goal:** 在 multi-intent U8 真实证据签署后,只形成 U9 实验和 U10–U12 单 action 的独立候选任务;不在本计划实施扩面。
- **Requirements:** R5–R13。
- **Dependencies:** PU3–PU4;独立产品 go/no-go;U9 实验不作为 U10–U12 的默认前置。
- **Files:** `internal/app/intentflow/`、各 owner module 的 adapter/port/tests、`internal/events/registry.go`、`web/src/components/chat/InteractiveCard.tsx` 及对应测试、`.doc/ops/short-term/` 独立任务。
- **Approach:**
1. 每个候选项先冻结用户信号、预期收益、维护成本、owner、最小样本、晋级阈值和零容忍安全错误;未获批则保持 deferred。
2. U9 候选仅提供规则无法判断时的 segment proposal;固定 schema/digest、最小输入、R13 安全门、护栏优先、超时 fail closed。
3. U10 mutate、U11 docgov、U12 workflow/run-control 各自形成独立 short-term、flag、owner mutex、授权负例、回滚点和是否依赖 U9 的明确声明。
4. 任务契约要求高风险动作绑定 expected revision 和显式确认,确认后执行前重新授权;按钮和自然语言进入同一 owner command。
5. 任一 action 出现授权旁路、持久状态丢失、双 writer、跨用户泄漏或 B1–B4 回归时,停止全部剩余扩面并更新 gap-matrix;普通质量失败只回滚该 action。
- **Test scenarios:**
- U9 malformed/timeout、span 越界、风险降级和红线拆分逃逸全部 fail closed;敏感内容不出站。
- 每个 action 在未确认、越权、stale revision、重复提交和部分完成时保持零越界副作用与可恢复状态。
- 双标签确认/取消只有一个成功;投影停机时权威 GET 仍正确。
- 旧版本回滚后已有计划仍可读取、取消和 finalize,新建保持关闭。
- **Verification:** 本计划只验证每个候选任务边界、go/no-go、预注册门、独立 flag/rollback 和全局安全 stop gate 完整;后续获批任务各自通过真实证据后才可加入更高 tier。
---
## Verification Contract
| Layer | Applies to | Required evidence | Done signal |
|---|---|---|---|
| Documentation | PU1–PU2 | Markdown/link check、`git diff --check`、三份 SSOT 人工对账、before/after 边界与义务迁移表 | 无矛盾、无断链、无无证据状态提升或缩口径假完成 |
| Authorization inventory | PU3 | 注册路由全集与 resource/action/owner/authn/ReBAC/ABAC/duty/negative-test 映射 | 无未认领路由;每项有服务端门和负例 |
| Static/unit | PU3、PU5A–PU8 | `go vet ./...`、相关 Go tests、`cd web && npm test && npm run build`、`arch-check --mode block` | 所有受影响包通过 |
| PostgreSQL | PU3–PU8 | 隔离 `TEST_DATABASE_URL`、迁移、并发、幂等、fail-closed 负例 | 无 skip 冒充 PASS,数据可重启恢复 |
| Race | PU3、PU5A、后续 multi-intent action | 相关包 race;PU5A 关闭全仓 TempDir flake | 无 data race、无异步清理残留 |
| Real PI | PU4、获批后的 PU6–PU8 | 真实产品 PI Agent Runner、记录 model/protocol/typed result 和 R13 数据安全门 | 不使用 stub 或 Herdr 代替;无敏感数据泄漏 |
| Browser | PU4、获批后的 PU6–PU8 | 真实登录、UI 操作、双用户/职责负例、刷新/重登/restart | 页面可见结果与 PG/账本一致 |
| Deployment | 所有运行时波次 | 占集成槽 rebuild、`/ready`、promotion receipt;PU5B 完成后按不可变 digest 晋升 | 当前阶段可追到同一 commit 和各环境 digest;加固后 test/main 引用同一候选 digest |
| Rollback | PU3–PU8 | disable/drain、旧版本兼容读取、cancel/finalize、无双 writer;上一版本二进制针对 expanded schema 的兼容演练 | 当前基线恢复且无孤儿状态;旧 app/worker 能识别并安全收口新状态 |
夜间真实 PI 的外部依赖失败和产品回归必须分栏。PR CI 不依赖外部模型;夜间 job 稳定前不提升为合并必需检查。
---
## Definition of Done
- [x] PU1–PU2 完成后,矩阵能明确区分当前完成范围、发布关系、剩余工作和关闭条件,并保留拆行前后的义务 lineage。
- [x] schema 45、D3/D5、IAM 历史缺口、前端状态和事件/FAV 混行均已纠正。
- [x] L1、Chat/ctxmgr baseline、Document revision baseline、前端工作台和可靠事件核心的状态调整有现有证据支持;语义摘要、PI 叙事、多意图扩面与 FAV 已拆成独立 deferred 行。
- [x] PU3 形成全路由授权 inventory,并证明只有 dev/test 显式双门才允许内存 fixture,其他环境与既有 session 均 fail closed。
(2026-09-16:`NewStores` 双门 fail-closed 已合入;全路由 inventory / session 中断负例仍开放,不挡本项核心旁路关闭)
- [x] PU4 的 multi-intent U8 与 full/none 真实 PI/browser/restart/cross-user 证据独立归档;失败未被文档改写掩盖。
(2026-09-16:Wave2 报告已签;Playwright 双标签仍 gated,API 刷新/重启已签;不升 tier)
- [x] PU5A 的 TempDir race flake 被真正关闭;PU5B 的 nightly job、promotion receipt 和人工豁免链能区分 infrastructure/product failure。
(2026-09-16:PU5A 已关闭;PU5B **nightly+receipt+晋升钩子**已交付——见 [Wave2B 报告](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md)。**同镜像 digest 晋升**已由 [Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md) 单机 pin 关闭;远程 registry 另立。)
- [x] PU6–PU8 已分别完成产品 go/no-go;未获批项保持 deferred,获批项另建 short-term 后才进入实现与 rollout DoD。
(2026-09-16:全部 **no-go / deferred**——见 [Wave3 go/no-go](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md) 与 `.doc/ops/long-term/2026-09-16-pu6-*` / `pu7-*` / `pu8-*` 契约;禁止实施与升 tier。)
- [x] 任何真实 PI 工作均满足 R13 的最小出站、租户绑定、脱敏、凭证、留存和泄漏负例。
(2026-09-16:nightly/receipt 路径使用隔离合成 DB、脱敏 evidence_refs、凭证不入库;完整 R13 矩阵审计见 Phase3 handoff 开放项,不挡本勾选的运行时门。)
- [x] deterministic summary/change-report、legacy 单意图、B1–B4 和三环境隔离均无回归。
(合入冒烟 `go vet` + `go test -short`;三环境 schema 47 快照保持;未升 MULTI_INTENT tier。)
- [x] `gap-matrix.md` 只在真实 blocker 出现或关闭时变化,`production_ready` 不因普通 backlog 自动翻转。(Wave 0:仅增加 IAM 只读核验注记,未翻转)
- [x] 放弃的实验代码、临时 flag、诊断 fixture 和测试数据已清理;历史失败证据保留且有正确指针。
(promotion-receipt fixtures 为门禁故意保留;FAV 旁支不合入;见 Phase3 handoff。)
---
## Appendix
### Source paths
- `.doc/audit/2026-09-16-feature-matrix-production-readiness-audit.md`
- `.doc/status/FEATURE-MATRIX.md`
- `.doc/remediation/gap-matrix.md`
- `.doc/ops/CURRENT.md`
- `.doc/archive/ops/short-term/2026-09-16-production-ready-gates.md`
- `.doc/system-design/2026-09-15-multi-intent-hitl-plan.md`
- `.doc/test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md`
- `.doc/test-reports/2026-09-16-chat-refresh-gate-test-report.md`
- `.doc/test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md`
- `.doc/test-reports/2026-09-14-document-revision-runtime-ui-test-report.md`
- `.doc/test-reports/2026-09-15-phase2-closeout-test-report.md`
- `.doc/test-reports/2026-09-12-phase1-iam-authz-test-report.md`
- `.doc/backlog/chat-agent-p6-backlog.md`
### Current decision summary
- 当前没有新增 production-ready blocker。
- 当前首发范围可关闭的状态漂移:Intent L1、前端工作台、可靠事件核心。
- 当前应保持 `partial`:多意图基线、工作流治理、IAM、CI/E2E;artifact promotion 作为独立发布加固跟踪。
- 当前可按冻结范围收口并把增强拆行:Chat/ctxmgr baseline、Document revision baseline。
- 当前应独立 `deferred`:语义摘要、PI change-report narrative、FAV、多意图未获批扩面、D7 合规治理;纯软件项目自举不在本计划范围。
@@ -0,0 +1,226 @@
---
title: "FEATURE-MATRIX partial/deferred 全量收口计划"
status: in_progress
created: 2026-09-16
updated: 2026-09-17
type: refactor
owner: Cline
branch: docs/partial-deferred-completion-plan
mutex: architecture-docs
---
# FEATURE-MATRIX partial/deferred 全量收口计划
## 1. 背景
- **用户授权(2026-09-16)**:已设计的功能与特性尽量推进到 `done`,不停留在 `partial`/`deferred`;保持功能、模块的独立与解耦;确认模块间通信机制;建立系统契约,保证新功能添加、已有功能修改的影响面收敛在所属模块,不扩散到其他模块。
- **收口对象**:[FEATURE-MATRIX](../status/FEATURE-MATRIX.md) 中 6 行 `partial` + 1 行 `deferred`(见 §3 总表)。
- **上位约束**:`production_ready=yes` 与发布门禁 B1–B4 已签。本计划是**能力成熟度收口**,与发布门禁正交;`production_ready` 只由 [gap-matrix](./gap-matrix.md) 决定,本计划不得反向触碰已签门禁。
- **通信机制结论先行**:本系统为模块化单体,模块间通信**不采用、也不应改成通用 IPC/RPC**;已确认的跨进程边界全部走 HTTP 与 PG 持久事件。详见 §2。
## 2. 通信与解耦机制确认(IPC/RPC 问题的回答)
**结论:系统是模块化单体([ADR 2026-09-14-modular-monolith-decoupling](../adr/2026-09-14-modular-monolith-decoupling.md)),模块级隔离靠「消费者窄端口 + 组合根唯一装配 + 契约门禁」实现,而非 RPC 层。**已确认的通信边界共四类:
| 边界 | 机制 | 状态 |
|---|---|---|
| Web ↔ server | `/api/v1/*` HTTP + SSE(typed error envelope) | 已运行 |
| Go server ↔ PI Agent Runner | HTTP + Bearer(typed-result-v1) | 已运行 |
| 单体内模块 | 消费者窄端口 + `internal/app` 组合根唯一装配 | 已运行 |
| 跨进程领域事件 | PG outbox(envelope/delivery)+ `cmd/events` 独立 worker 原子 lease 消费 | 已运行(notify/advance/projection live) |
**为什么不把单体内端口改成 RPC**(依据 [IPC/RPC 现状评估](../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)):RPC 会增加序列化、延迟、部分失败与运维成本,却不消除 locator、授权、幂等和事件消费缺口;真正的进程级解耦已由 `cmd/events` worker(经 PG lease,而非服务间直连)与两条 HTTP 边界承担。用户要求的「通过 IPC/RPC 通信」在本系统的正确落法即:**跨进程一律走既有 HTTP / PG 事件边界;模块级独立解耦靠端口与契约门禁**。若未来确需新增跨进程边界,须先立 ADR,沿用「HTTP 或 PG 事件」两种既有模式。
### 2.1 系统契约体系(防扩散的既存机制,本计划全部沿用)
| 契约 | 载体 | 强制方式 |
|---|---|---|
| Import / SQL write / path / event 边界 | `.doc/system-design/module-boundaries.yaml` | `internal/archtest` + `./scripts/arch-check.sh --mode block`;import/event 违规零容忍(block_kinds) |
| 领域事件 schema 与生产者/消费者 | `events.Envelope` schema 1 + YAML allowlist ↔ `StaticContracts` parity | 构建期 parity 门禁;未登记事件不得投递 |
| 任务幂等与产物 | `taskrun.RunManifest` canonical JSON + SHA-256 + idempotency key | 服务端强制;异 digest 冲突 |
| HTTP 错误语义 | typed error envelope(details allowlist + 脱敏) | 已合入(H1–H3) |
| PI Runner 协议 | typed-result-v1 + handshake;typed 字段存在但无效 → fail closed | 已合入 |
| 能力灰度 | 每能力独立 flag,默认 off / legacy / shadow | 各契约预注册晋级阈值 |
| 并行认领互斥 | FEATURE-MATRIX `mutex` 列 → CURRENT 认领表 | 同一 mutex 同时仅一个 `in_progress` |
### 2.2 变更影响面收敛守则(每个波次必须遵守)
1. 新能力一律落在**深模块**(模式参考 `internal/app/intentflow`、`internal/doccontent`),禁止把实现聚集回 coordinator/bizdev。
2. 模块间只允许三种交互:消费者拥有的窄端口、组合根装配、领域事件;**禁止新增跨模块 import**(arch-check block 兜底)。
3. schema 变更只走 additive migration;旧版本兼容读取;每个放量有独立回滚点。
4. 每个能力一个独立 flag;默认 off;晋级按预注册阈值(shadow → confirm → live/replace),禁止共用开关批量上线。
5. 新增事件必须同时补 YAML allowlist 与 `StaticContracts` 并过 parity 门禁。
6. 修改声明范围须保留 before/after lineage 与义务迁移(矩阵更新规则 4);禁止缩口径假完成。
## 3. 收口对象与关闭条件总表
| # | 行 | 当前 | 目标 done 的关闭条件(依据矩阵「剩余工作/关闭条件」列) | mutex |
|---|---|---|---|---|
| P1 | CI / E2E | partial | Actions secret/runner 环境配置完成 + FullNone product_fail 收口 + 一轮绿色 nightly receipt | `ci` |
| P2 | 语义摘要(D3) | partial | `SEMANTIC_SUMMARY_SHADOW` 开启并取得真实 PI + R13 + 负例证据;(可选)`SEMANTIC_SUMMARY_REPLACE` 灰度 | `chat` |
| P3 | PI change-report 叙事 | partial | `PI_CHANGE_REPORT_NARRATIVE` 开启 + 真实 PI 叙事 + fallback 全量负例 + UI narrative/事实字段区分 | `docgov` |
| P4 | 多意图扩面(U9–U12) | partial | U9→U12 逐 action 独立 flag 证据闭环(真实 PI + 浏览器 + 负例);tier 升级评估 | `intent-plan` |
| P5 | 纯软件项目自举 | partial | SWBOOT-10 非 stub 实现 + 真实 PI 全链路 + UI 二次验收 | `workflow-design` |
| P6 | Final Artifact Vault(FAV) | partial | subscriber 独立审计 → shadow → live;崩溃/重启幂等;`FAV_DEGRADED_READ=false` 保持;**禁止整支 merge 保持** | `events` |
| P7 | 对话数据治理(D7) | deferred | 数据分类盘点 → 留存/删除口径 → 库/备份/日志控制 → 敏感字段加密边界;**发现违规 → 立即升 gap-matrix blocker** | `chat` |
**并行度**:P1 与其余全部可并行;P3/P4/P5/P6 各自 mutex 互不冲突可并行;**P2 与 P7 共用 `chat` mutex,须串行(先 P2 后 P7)**。Playwright 双标签升 `confirm/full` 属 `intent-plan` 辅助任务(见 [2026-09-16-intent-plan-playwright-dual-tab](../ops/long-term/2026-09-16-intent-plan-playwright-dual-tab.md))。
## 4. 分波次计划
每波通用流程:从 `dev` 开独立分支(`feature/<slug>`)→ CURRENT 登记 → worktree 编码与单测 → 占集成槽合并 `dev` + 冒烟(`go vet` / `go test -short` / `env-service.sh dev rebuild` + `/health`)→ test-report 归档 → FEATURE-MATRIX 行升 `done`(保留 lineage)。
### W1(mutex `ci`):CI / E2E → done
**现状**:nightly 入口 + 失败分类 + promotion-receipt 门禁已交付;TempDir race 已修;PR CI 不依赖外部模型。剩余:环境配置与 FullNone product_fail。
1. Actions secret 录入:`TEST_DATABASE_URL`、nightly 专用 `RUN_PI_E2E` / `RUNNER_AUTH_TOKEN`(隔离合成数据);runner 注册与自检。
2. FullNone product_fail 收口:按 infra/product 分栏定位,修复产品失败或确认分类归属;nightly `DATA_DIR=dev` 保持对齐。
3. 跑一轮完整 nightly → green receipt 归档。
4. 矩阵行升 `done`(证据:[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md)、[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md) + 新 green receipt)。
**回滚**:纯环境/CI 配置,不影响业务行为;secret 配置错误仅影响 nightly,不挡 PR CI。
### W2(mutex `chat`):PU6 语义摘要 D3 → done
1. dev 环境 `SEMANTIC_SUMMARY_SHADOW=on`(test 环境随后),收集 shadow 对账:authorized view only、无工具权限摘要器、R13 出站门。
2. 真实 PI(MiniMax)摘要证据:freshness 标注、可解释 fallback。
3. 负例矩阵:撤权消息不入摘要;injection 不能改权限;失败保留旧摘要/deterministic。
4. 达预注册阈值后 **默认不启用** `SEMANTIC_SUMMARY_REPLACE`(见 §7.3);若另开授权再灰度(独立回滚:关 flag 回 deterministic)。
5. 矩阵行升 `done`;[契约](../ops/long-term/2026-09-16-pu6-semantic-summary-contract.md)状态更新。
**路径**:`internal/ctxmgr/summarizer.go`、`internal/app/chatflow/`、`internal/server/chat_digest_api.go`、web 摘要组件。
### W3(mutex `docgov`):PU7 PI change-report 叙事 → done
1. dev `PI_CHANGE_REPORT_NARRATIVE=on`:真实 PI 只读消费 immutable diff+lineage+risk floor。
2. typed schema `change_report_narrative_v1` + input digest 绑定;任意 schema/超时/注入 → 全量 fallback(负例必测)。
3. UI 验收:narrative 与事实字段明确区分;禁止覆盖服务端风险/审批结论。
4. 矩阵行升 `done`(deterministic fallback 仍是本行显式声明行为)。
**回滚**:关 flag,仅 deterministic fallback,无第二份 candidate。契约:[pu7](../ops/long-term/2026-09-16-pu7-pi-narrative-contract.md)。
### W4(mutex `intent-plan`):PU8 U9–U12 → done
**顺序 U9→U10→U11→U12,逐 action 独立 flag,禁止共用开关批量上线:**
1. U9 `MULTI_INTENT_U9_SEGMENT`:真实 LLM 分段 shadow→confirm;规则无法判断时才出 proposal;stub fail-closed 保持。
2. U10 `MULTI_INTENT_U10_MUTATE`:dry-run + expected revision 门禁;未确认/越权/stale revision/重复提交 → 零越界副作用。
3. U11(docgov)、U12(workflow/run-control):按各自契约同模式推进。
4. 每个 action:真实 PI + Playwright 双标签 + 负例;独立报告与回滚点。
5. 全部闭环后:评估 `MULTI_INTENT_PLAN_TIER` legacy→confirm(**独立任务、独立授权**,默认不升 full;full 另拆行/backlog)。
6. 矩阵行升 `done`(声明范围 = 四个 action 的 flag 证据闭环;tier=full 不在本行关闭条件内)。
契约:[u9](../ops/long-term/2026-09-16-pu8-u9-segment-proposal-contract.md) / [u10](../ops/long-term/2026-09-16-pu8-u10-mutate-contract.md) / u11 / u12。
### W5(mutex `workflow-design`):纯软件项目自举 → done
1. SWBOOT-10 从 stub 收口为真实现(按 [short-term](../ops/short-term/2026-09-16-software-project-bootstrap.md) 与 [ADR keys](../adr/2026-09-16-software-project-bootstrap-keys.md))。
2. 真实 PI 全链路:`software_bootstrap` 工作流 创建→规划→交付(首期 docs_only / read_only_repo)。
3. Playwright UI 二次验收:服务端目录驱动的创建向导(停止前端固定克隆 7 份模板)、单人项目「无独立评审」显式标记。
4. 矩阵行升 `done`(范围沿用现状调研的复用/新增边界,不改医疗三工作流语义)。
### W6(mutex `events`):FAV → done
1. subscriber 独立审计(沿用 U7 增量路径,**继续禁止整支 merge FAV 分支**)。
2. publisher/consumer flag **shadow**:只计算 intended outcome,不执行业务副作用。
3. shadow 阈值达标后按 §7.4 逐 consumer **live**(顺序 staging → artifact → publication;每级观察窗 ≥7 天或证据阈值):幂等(唯一键/no-replace);崩溃/重启重放无重复可见结果。
4. `FAV_DEGRADED_READ=false` 保持默认;degraded 读取仅在显式开启时可用并有告警(不随 live 开启)。
5. 矩阵行升 `done`(声明范围:不可变终态制品库闭环)。
### W7(mutex `chat`,排在 W2 后):D7 对话数据治理 → done
**前提**:留存/删除口径见 §7.1 与 [D7 ADR 草案](../adr/2026-09-17-d7-chat-data-retention.md)(数字 `pending-compliance-signoff`;合规签字前禁止按建议数字执行物理删除/备份清除)。
1. 数据分类盘点(产出 audit 文档):chat_sessions/messages、KB、日志、备份、event 表中的敏感字段清单与流转路径。
2. 合规签字或改数后:更新 ADR 状态;库/备份/日志控制盘点。
3. 差距整改:日志/dead-letter/reconciliation 只存 ID、digest、typed error code 与 allowlist 摘要(Track E 红线沿用)。
4. 敏感字段加密边界决策与落地(首期默认不做字段级加密,见 §7.1)。
5. **若盘点确认基线违规 → 立即写 gap-matrix blocker,本行 done 让位于整改**;无违规且口径落地 → 矩阵行升 `done`。
## 5. 测试方案(层级矩阵)
| 层级 | 适用波次 | 内容 | 通过标准 |
|---|---|---|---|
| Arch / contract | 全部 | `./scripts/arch-check.sh --mode block`;YAML ↔ `StaticContracts` parity | import/event 违规 = 0;无未登记事件 |
| 单测 | 全部 | `go vet ./...` + `go test -short ./...`;相关包 `-race` | 全绿;无 data race |
| PG 集成 | W2/W4/W5/W6/W7 | `TEST_DATABASE_URL` 下集成 + additive migration/回滚演练 | 持久化、恢复、旧版本兼容读取 |
| 真实 PI | W2/W3/W4/W5 | 真实 PI Agent Runner + MiniMax;记录 model/protocol/typed result;R13 数据安全门(最小出站、租户绑定、脱敏、凭证最小权限、泄漏负例) | 无 stub 冒充;无敏感出站 |
| 浏览器 | W2/W3/W4/W5 | Playwright:真实登录、双用户/职责负例、刷新/重登/重启 | 页面结果与 PG/账本一致 |
| 部署 | 全部运行时波次 | 占集成槽 rebuild、`/health`、promotion receipt(same digest 晋升) | 可追到同一 commit + digest |
| 回滚 | W2–W6 | disable/drain、旧版本兼容读取、无双 writer、孤儿状态检查 | 上一版本恢复且无孤儿状态 |
每波验收报告归档 `.doc/test-reports/`(遵循 test-reports-standard),回链本计划与对应契约;矩阵状态提升必须同时核对源码、迁移、artifact、API/runtime 与测试层级(上位计划 R5–R7)。
## 6. 风险与停走门
| 风险 | 停走门 |
|---|---|
| 授权旁路 / 跨用户泄漏 / 双 writer / main 或 prod fail-open | 任一波发现 → 停止全部扩面,写 gap-matrix |
| B1–B4 门禁回归 | 每波合 dev 冒烟全绿;回归即停 |
| stub / SKIP / deterministic fallback 冒充真实 PI | 验收报告必须记录真实 runner/model;SKIP 不得写成 PASS |
| flag 批量上线 / 共用开关 | 一个能力一个 flag;违规合并打回 |
| 缩小声明范围制造 done | 矩阵审查:before/after lineage 必须保留,义务迁移可追 |
| 三环境隔离破坏 | 每波验证不跨环境读写;schema 迁移三环境同步(当前 47) |
| FAV 整支 merge | 保持禁止;只走增量分支 + 独立审计 |
## 7. 已确认决策(原开放问题;2026-09-17 用户确认采纳建议默认)
> 决策冻结 ≠ 放量:不改生产默认 env / flag;各波仍按原 mutex 与独立授权推进。
### 7.1 D7 留存期限与删除口径(W7 前置)
**决策**:工程按下列草案落 ADR([2026-09-17-d7-chat-data-retention](../adr/2026-09-17-d7-chat-data-retention.md));数字标 `pending-compliance-signoff`,合规签字或改数后 W7 方可按口径整改。不得无限期停在 deferred。
| 数据类 | 留存(建议默认) | 删除路径 |
|---|---|---|
| 会话正文(chat messages) | 热库 **365 天**可配置;超期 soft-delete → 观察窗 → 物理清理 | 用户删除同路径;备份清除需二次批准 + 精确 delete manifest(R22) |
| 派生文档 / 私密文档 | 与聊天**独立周期**;回收站 **30 天**后物理清理 | 删除 UI 必须说明「只删聊天 / 只删文档 / 两者」 |
| 审计元数据(导出/治理审计) | **180 天** | 不可被普通用户删除覆盖 |
| Agent trace / workspace 非终态 | 任务结束后 **30 天**;nightly 仅合成数据 | 禁止当长期事实源 |
| 日志 / dead-letter / reconciliation | Track E:**只存 ID、digest、typed error code、allowlist 摘要** | 禁止存 payload/prompt/正文 |
| FAV 终态制品 | `retention_class` + legal hold + delete ledger | 与 D7 聊天口径解耦 |
**加密边界**:首期「敏感字段盘点 + 传输/备份访问控制」;不默认上字段级加密。
**违规门**:盘点确认基线违规 → 立即写 gap-matrix;本行 done 让位于整改。
### 7.2 `MULTI_INTENT_PLAN_TIER` 是否升 `confirm`
**决策**:W4(U9→U12)证据闭环后,**可启动独立授权任务**将默认从 `legacy` 升至 `confirm`;**永不默认升 `full`**(`full` 另拆矩阵行/backlog,按 action 逐项加入)。
升 `confirm` 硬前置(全部满足):
1. U9→U12 各自独立 flag 证据闭环(真实 PI + Playwright 双标签 + 负例)
2. 停走指标全 0:未确认/越权副作用、安全红线绕过、hard-negative 自动执行、重复确认双跑、refresh/restart 权威差
3. 独立 short-term + 用户显式授权(合入功能代码不得顺带改默认 env)
4. 放量:`dev` 观察 → `test` → **不自动**推 `main`
### 7.3 `SEMANTIC_SUMMARY_REPLACE` 是否启用
**决策**:**默认不启用**。W2 升 `done` 只要求 `SEMANTIC_SUMMARY_SHADOW` + 真实 PI + R13 + 负例;**不依赖** REPLACE。REPLACE 为 W2 之后可选后置任务,须另开授权 + 接线 + fail-closed 灰度(`dev`→`test`;关 flag 回 deterministic)。
### 7.4 FAV live 消费者上线顺序与观察窗口
**决策**:固定顺序 **staging → artifact → publication**;每步 shadow → drain → live;观察窗证据驱动(每级下限 **≥7 天**或 ≥N 终态样本,取更严);`FAV_DEGRADED_READ` **全程保持 false**(不随 live 开启)。禁止整支 merge FAV;每 consumer 独立 flag;一窗失败则停在该级并回 shadow/off。
## 8. 验收标准(Definition of Done)
- [ ] W1–W6 各波 test-report 归档并回链;对应 FEATURE-MATRIX 行升 `done`(保留 lineage)。
- [ ] W7 数据分类盘点与口径文档落地;或违规升级 gap-matrix(该行转为整改跟踪)。
- [ ] 全程 `production_ready` 不翻转;gap-matrix 仅在真实 blocker 出现/关闭时变化。
- [ ] `arch-check --mode block` 全程通过;无新增跨模块 import、无未登记事件。
- [ ] 所有新 flag 保持独立且默认 off/legacy/shadow;每个放量有独立回滚点。
- [ ] B1–B4 门禁零回归(每波合 dev 冒烟全绿)。
- [x] 开放问题 §7 的四项决策均已获用户确认(2026-09-17;见 §7.1–§7.4)。
## 9. 相关链接
- 矩阵 SSOT: [../status/FEATURE-MATRIX.md](../status/FEATURE-MATRIX.md)
- 连续性审计: [../audit/2026-09-16-feature-matrix-production-readiness-audit.md](../audit/2026-09-16-feature-matrix-production-readiness-audit.md)
- 上位计划: [./2026-09-16-feature-matrix-production-readiness-plan.md](./2026-09-16-feature-matrix-production-readiness-plan.md)
- 发布门禁: [./gap-matrix.md](./gap-matrix.md)
- D7 留存 ADR 草案: [../adr/2026-09-17-d7-chat-data-retention.md](../adr/2026-09-17-d7-chat-data-retention.md)
- IPC/RPC 调研: [../ops/research/2026-09-15-module-decoupling-ipc-assessment.md](../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)
- 模块解耦 Phase 2: [./2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](./2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- 契约: `../ops/long-term/2026-09-16-pu6-*` · `pu7-*` · `pu8-u9…u12`
- 总控 short-term: [../ops/short-term/2026-09-16-partial-deferred-completion.md](../ops/short-term/2026-09-16-partial-deferred-completion.md)
+2
View File
@@ -3,6 +3,8 @@
| 文档 | 说明 |
|------|------|
| [gap-matrix.md](./gap-matrix.md) | 发布缺口 SSOT |
| [2026-09-16-partial-deferred-completion-plan.md](./2026-09-16-partial-deferred-completion-plan.md) | FEATURE-MATRIX 6 partial + 1 deferred 全量收口:通信机制确认(模块化单体,不新增 RPC 层)、7 项关闭条件、W1–W7 波次;§7 四项决策已确认(2026-09-17) |
| [2026-09-16-feature-matrix-production-readiness-plan.md](./2026-09-16-feature-matrix-production-readiness-plan.md) | 能力状态与发布门禁解耦、证据校准、剩余 partial 收口和 production-ready 防回退计划([审计](../audit/2026-09-16-feature-matrix-production-readiness-audit.md)) |
| [2026-09-14-module-decoupling-refactor-plan.md](./2026-09-14-module-decoupling-refactor-plan.md) | 纵向绞杀、UnitOfWork、高并发互斥、可靠事件、逐动作授权、FAV、迁移与恢复的详细重构计划 |
| [2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](./2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md) | Phase 2 修订版:Track E 持久事件交付先行;Track S 结构解耦独立 go/no-go;HTTP 与 PI 协议另立 remediation([审阅](../audit/2026-09-15-module-decoupling-phase2-plan-review.md);[调研](../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)) |
| [2026-09-15-http-error-envelope-remediation.md](./2026-09-15-http-error-envelope-remediation.md) | HTTP/SSE typed error envelope、公开 details allowlist、前端 additive 迁移与安全负例 |
+18 -13
View File
@@ -1,12 +1,14 @@
# 整改缺口复核矩阵(SSOT)
**更新**: 2026-09-15
**分支**: dev
**production_ready**: no(CI 真实 PI 三工作流 E2E / 前端人工抽检未完成。`CHAT-INTENT-STATE` 双标签 busy 已 PASS。文档账本运行时 UI Round20 已 PASS,不把 fallback 报告当成完整 PI)
**更新**: 2026-09-17
**分支**: test @ `rc-v1.0.0-beta.3`
**production_ready**: yes(发布门禁 B1–B4 已签;dev/test `schema_version=48`;main `schema_version=47`。U9–U12 / 软件自举 / FAV / D7 不挡首发;FAV live 与 D7 删除仍非本门禁范围)
**协作焦点**: [../ops/CURRENT.md](../ops/CURRENT.md)
**Agent 手册**: [AGENTS.md](../../AGENTS.md) · [PROJECT.md](../../PROJECT.md)
**能力矩阵**: [../status/FEATURE-MATRIX.md](../status/FEATURE-MATRIX.md)(Wave 0 校准;与本文件正交)
> Codex 2026-09-12 再审计项与本轮回环证据见下表「Codex 再审计」区段。
> Wave 0(2026-09-16)对 dev/test/main 做 IAM 只读核验:schema 47、`user_credentials` 与 IAM 表齐全、`ALLOW_IN_MEMORY=false`,**未发现** MemoryStore 旁路;**不**新增 blocker。代码 fail-closed 归 Wave 1(见 [continuity plan](./2026-09-16-feature-matrix-production-readiness-plan.md))。
---
@@ -21,10 +23,10 @@
| BUG-05 | 拒绝逻辑分散 | PASS | `document_access.go` + `stage_access_helpers.go` | 已完成 |
| BUG-06 | token 明文/重放 | PASS | `activation_token_test.go` | 已完成 |
| BUG-07 | 完成后下一流程 | PASS | 同 BUG-01 | 已完成 |
| BUG-08 | 测试库隔离 | PARTIAL | `db/testdb.go` Require/Skip | CI 设 `TEST_DATABASE_URL` |
| BUG-08 | 测试库隔离 | PASS | `db/testdb.go` Require/Skip;CI `TEST_DATABASE_URL` + governance PG 步骤;[report](../test-reports/2026-09-16-ci-governance-pg-bug08-test-report.md) | 已完成 |
| BUG-09 | 版本冲突自动重试 | PASS | `StageAdvanceBanner` reload | 已完成 |
| BUG-10 | 无审计视图 | PASS | settings + UI | 已完成 |
| BUG-11 | 旧 API 未下线 | PARTIAL | 治理开启时 410 | 保持 + 文档标注 |
| BUG-11 | 旧 API 未下线 | PASS | 治理开启时 410;[策略冻结](../audit/2026-09-16-bug11-410-retire-decision.md) | 保留兼容层,不强制删路由 |
| BUG-12 | 前端名称硬编码 | PASS | catalog API | 已完成 |
| MISSING-01 | 上下文快照 | PASS | `ctxmgr.CollectProjectDialogue` | 已完成 |
| MISSING-02 | 终止 | PASS | `GetTerminationPreview` | 已完成 |
@@ -41,6 +43,9 @@
| DB-USERS-SEQ | 种子 users_id_seq 冷启动冲突 | PASS | `00025_...-sync-seed-sequences.sql`;dev/test setval |
| DATA-LIFECYCLE-DEV | completed 实例对应 active 项目 | PASS | dev dry-run 47 → fix SQL → 0 |
| DATA-TEST-WF | test 污染 active 工作流定义 | PASS | `retire-nonofficial-workflow-definitions.sql`;test UPDATE 5 |
| DEMO-DB-SEED | goose 00011/00012 演示项目污染列表 | **PASS** | `00046` retire projects + `00047` retire chat_sessions;`ListProjects*` / `ListChatSessions` 过滤 `demo_retired`;dev migrate schema **47**;抽检项目列表无 6001–6010、user1/2/3 无 `sess-wangjing*`、新建项目 6357 documents=0 | [audit](../audit/2026-09-16-demo-seed-pollution-systemic.md);前序 [2026-09-15](../audit/2026-09-15-mock-deliverables-pollute-real-projects.md);[report](../test-reports/2026-09-16-demo-seed-pollution-test-report.md) |
| DEMO-STUB-API | main/prod 仍可请求 stub Agent | **PASS** | `ResolveBackendInEnv`;`TestResolveBackendInEnv_RejectsStubInMain` |
| DEMO-WEB-SEEDS | 前端 mock/seed 进生产包并撞 projectId | **PASS** | `@demo-seeds` 默认关闭;`check-prod-bundle.sh` PASS;[report](../test-reports/2026-09-16-demo-seed-pollution-test-report.md) |
| TEST-ADVISOR-BRIEF | 多意图 AdvisorBrief 丢失 | PASS | `action_planner.go` enrich;`action_planner_test.go` |
| TEST-V05-ARTIFACTS | V0.5 断言 3 vs 5 | PASS | `types_test.go` / `full_link_e2e_test.go` → 5 |
| TEST-CHAT-MEMORY | 语义记忆 sleep 竞态 | PASS | `session_test.go` deadline 轮询 |
@@ -57,7 +62,7 @@
| ID | 描述 | 状态 | 证据 | 计划动作 |
|---|---|---|---|---|
| WORKFLOW-PLAN-FROZEN-OPTIONAL-DUTIES | active 项目仍展示可编辑职责表单,409 提示在长表单视口外;现有规划又不支持非必需文档“三权全空”,且后端缺少职责人在任成员复核 | **PASS(设置页)** | [audit](../audit/2026-09-14-workflow-plan-409-frozen-and-optional-duties.md);[test-report](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md)。项目 143 只读 frozen、A full+none 激活、B partial 不发 PUT、C 零治理拒绝、双标签转 frozen、成员无配置入口、刷新后 143 仍 frozen | 真实 PI 生成 full/none 并走审批/阶段不阻塞未纳入本轮页面矩阵,不作为本 gap 关闭的替代证据,另立项 |
| WORKFLOW-PLAN-FROZEN-OPTIONAL-DUTIES | active 项目仍展示可编辑职责表单,409 提示在长表单视口外;现有规划又不支持非必需文档“三权全空”,且后端缺少职责人在任成员复核 | **PASS(设置页)** | [audit](../audit/2026-09-14-workflow-plan-409-frozen-and-optional-duties.md);[test-report](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md)。项目 143 只读 frozen、A full+none 激活、B partial 不发 PUT、C 零治理拒绝、双标签转 frozen、成员无配置入口、刷新后 143 仍 frozen | 设置页矩阵 PASS;真实 PI full/none 长链已另签 [Wave2 报告](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md) |
| DOC-CONTENT-CANONICAL-HASH-DRIFT | 旧受控文档 bootstrap 裁剪 Markdown 双空格硬换行并将 canonical SHA 写入账本/DocGov,但未同步文件;正文读取把完整性冲突误报 404,lease/list sync 又放大并制造刷新后加载死锁 | **PASS(真实 UI)** | [audit](../audit/2026-09-14-project143-controlled-content-404.md);[UI report](../test-reports/2026-09-14-controlled-content-ui-acceptance.md)。代码已合 dev、schema 32、项目 143 定向 `migration_repair`;项目 143 `clean-run3` 与新项目 `full-chain-final` 主链及 restart 全部纯页面 PASS,目标 404=0 | [remediation](./2026-09-14-controlled-content-canonical-hash-remediation.md)。隔离 `TestReconcile_LegacyRepair_PG` 未执行,按用户“本轮只允许页面测试”的边界保留为工程测试债,不作为本轮 UI PASS 的替代证据 |
| CHAT-HISTORY-REFRESH | 工作流激活后刷新,对话正文被阶段过滤器清空,但分类数量与锚点仍按全量返回 | **PASS** | [test-report](../test-reports/2026-09-13-chat-history-refresh-test-report.md);活验 [live.json](../test-reports/assets/2026-09-15-chat-history-refresh-live/live.json)(项目 6252,window=categories=2,guest 403);代码:`message_scope.go`、`chat_history_auth.go`、goose 00026/00027 | 闲聊刷新已补。发布门禁「激活后文档任务 + 重登/重启」仍开放,不回退本 gap |
| CHAT-INTENT-STATE | 真实会话被诊断探针污染;只读查询误启动文档写任务;错误动作与编辑状态刷新后丢失 | **PASS** | [audit](../audit/2026-09-13-conversation-intent-runtime-state.md);[test-report](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);双标签活验项目 **6275** / `sess-p6275-u10`(`live.json` + Docker 截图)。**不**删除 `sess-p143-u9` 历史探针 | [remediation](./2026-09-13-conversation-intent-runtime-state-remediation.md)。Wave 3–4 浏览器门已签;诊断污染消息仍不擅自删除 |
@@ -79,13 +84,13 @@
```
☑ go vet ./... 全绿
☑ go test -short ./... 全绿
□ TEST_DATABASE_URL 下治理 PG 集成全绿(CI)
□ 真实 PI Agent 三工作流治理 E2E 实录(本轮 stub/short 已绿,PI 待 CI token)
□ 对话刷新恢复:激活前聊天 + 激活后文档任务 + 刷新/重登/重启可恢复,双用户负例通过
☑ TEST_DATABASE_URL 下治理 PG 集成全绿(CI)
☑ 真实 PI Agent 三工作流治理 E2E 实录([test-report](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md))
☑ 对话刷新恢复:激活前聊天 + 激活后文档任务 + 刷新/重登/重启可恢复,双用户负例通过([test-report](../test-reports/2026-09-16-chat-refresh-gate-test-report.md);项目 6359)
☑ lifecycle fix SQL 已在 dev 执行
☑ test/dev health schema_version=25
☑ main 环境部署冒烟(本地 8000 health/ready schema 25)
□ 前端:版本冲突刷新、终止 preview 人工抽检
☑ test/dev health schema_version=47
☑ main 环境部署冒烟(本地 8000;schema 对齐见 CURRENT)
☑ 前端:版本冲突刷新、终止 preview 人工抽检([test-report](../test-reports/2026-09-16-frontend-gate-b4-test-report.md);项目 6363)
```
**结论**: 文档账本运行时真实 UI Round20 **PASS**(见 [test-report](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md))。`CHAT-INTENT-STATE` 双标签 busy **PASS**(项目 6275)。**发布 blocker 仍包括 CI 真实 PI 三工作流 E2E 与前端人工抽检**;`-race` 全包并行 TempDir flake 为测试基建残留。不得把 fallback change report 写成完整 PI 叙事。
**结论**: 发布门禁四框已签。文档账本运行时 UI Round20 **PASS**;`CHAT-INTENT-STATE` 双标签 busy **PASS**;`DEMO-DB-SEED` **PASS**;BUG-08 **PASS**。`-race` TempDir flake 与 U9–U12 / 软件自举 / FAV / 完整 PI change-report 叙事不挡首发。不得把 fallback change report 写成完整 PI 叙事。
+74 -22
View File
@@ -1,38 +1,90 @@
# 模块与功能完成度(SSOT)
**更新**: 2026-09-15
**production_ready**: no
**更新**: 2026-09-17(W3 PI 叙事 done;W4 多意图扩面 done)
**production_ready**: yes(权威来源:[gap-matrix](../remediation/gap-matrix.md);本表不推导发布门禁)
**发布缺口**: [../remediation/gap-matrix.md](../remediation/gap-matrix.md)
**协作焦点**: [../ops/CURRENT.md](../ops/CURRENT.md)
**连续性审计**: [../audit/2026-09-16-feature-matrix-production-readiness-audit.md](../audit/2026-09-16-feature-matrix-production-readiness-audit.md)
**整改计划**: [../remediation/2026-09-16-feature-matrix-production-readiness-plan.md](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md)
> 本表描述**能力地图**;上线 blocker 见 gap-matrix,二者互相链接、不合并。
> 本表描述**能力成熟度**;上线 blocker 见 gap-matrix。二者正交:能力行不必全部 `done` 才能发布;`partial`/`deferred` 不得自动回退 `production_ready`。
**状态枚举**: `done` | `partial` | `planned` | `deferred` | `blocked`
---
## 状态契约
| 字段 | 含义 |
|------|------|
| **声明范围** | 本行冻结的能力边界;`done` 只对该边界负责 |
| **状态** | `done` \| `partial` \| `planned` \| `deferred` \| `blocked` |
| **发布关系** | 与当前首发/已签门禁的关系:`non_blocker` / `补证` / `加固` / `deferred_enhancement` |
| **关闭条件** | 何时可将本行升为 `done`(或关闭 `partial`);stub/SKIP/fallback 不得冒充 |
| **证据** | 可追溯到报告/commit/环境/schema;代码或 artifact 变化后须重验 |
| **mutex** | 并行认领互斥键(见 CURRENT) |
### 状态判定
- **`done`**:声明范围内能力已达生产验收证据;**不**表示该领域永无后续。新增增强须拆行或进 backlog。
- **`partial`**:已交付可用子集,关闭条件仍未满足。
- **`planned`**:方案存在,尚未开始实施。
- **`deferred`**:明确不进当前路线,且不是发布 blocker(除非盘点确认违规 → 升 gap-matrix)。
- **`blocked`**:本行目标无法继续,须写明 blocker 与恢复条件。
- **`production_ready`**:只由 gap-matrix 发布门禁决定。
### 重验触发器
授权谓词/owner port、schema/迁移/compose/镜像/环境晋升、flag 升级、PI Runner/model/protocol、event consumer/writer、浏览器持久化边界变化时,受影响行须重验;历史 PASS 不能单独证明新 artifact。
### 禁止
- 靠缩小声明范围制造 `done`(须保留 before/after 与义务迁移)。
- 用 stub、SKIP、deterministic fallback 冒充真实 PI / 完整叙事闭环。
- 无真实 blocker 变化时改写 gap-matrix / `production_ready`。
---
## 完成度矩阵
| 模块 | 能力 | 状态 | 证据 | 缺口/后续 | mutex |
|------|------|------|------|-----------|-------|
| 意图识别 L1 | 18 类 Intent + 三分支消解 | partial | [system-design/intent-recognition](../system-design/intent-recognition/);[现场专项审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[运行态报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签活验](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[多意图复核方案](../system-design/2026-09-15-multi-intent-hitl-plan.md) | 明确写动作与只读总结已分流;双标签 `DOC_BUSY` 已签(项目 6275)。多意图持久计划仅完成方案复核,核心 U1–U8 与扩面 U9–U12 均未实施;intent 纯依赖边界不得回退 | `intent` |
| 对话 / ctxmgr | 多轮上下文、记忆、摘要 | partial | [system-design/multi-turn-dialogue](../system-design/multi-turn-dialogue/);[刷新恢复专项审计](../audit/2026-09-13-chat-history-refresh-disappears.md);[U10 端口化](../archive/ops/2026-09-15-chatlog-contextasm-u10.md);[U10 报告](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md) | `CHAT-HISTORY-REFRESH` 闲聊刷新活验已补。U10 原地端口 **停止扩面**(未物理拆包)。语义摘要(D5 backlog) | `chat` |
| 智能体小队 | 角色-任务-工作区-黑板 | done | [system-design/agent-squad](../system-design/agent-squad/);[test 2026-09-07](../test-reports/2026-09-07-dynamic-squad-planning-test-report.md) | 非关键步骤降级(A5/A6 backlog) | `squad` |
| 工作流治理 | 三正式工作流 + 阶段门禁 | partial | [remediation/three-workflows](../remediation/2026-09-12-three-workflows-strict-governance-remediation.md);[test 2026-09-12](../test-reports/2026-09-12-three-workflows-governance-remediation-test-report.md);[冻结态/职责可选整改](../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md);[Wave 5 页面矩阵](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md);[职责-动作鉴权](../test-reports/2026-09-14-governance-action-level-authz-test-report.md) | 设置页/DutyMode + 动作级鉴权/未激活 202-blocked/关闭创建直通已落地。后续:none 文档真实 PI 审批长链路、CI 三工作流 E2E | `workflow` |
| 纯软件项目自举 | 软件项目创建、Bootstrap 基线、Delivery 迭代与受控工程交接 | planned | [详细设计](../system-design/2026-09-14-software-project-bootstrap-workflow.md);[现状调研](../ops/research/2026-09-14-software-project-bootstrap-current-state.md);[验收计划](../ops/checklists/2026-09-14-software-project-bootstrap-acceptance.md) | 当前仅完成方案;目录/模板/执行器/创建向导/真实 PI UI 均未实施。受控代码执行单列后续 Epic | `workflow-design` |
| IAM / 鉴权 | 项目级 API 鉴权 + RBAC | partial | [audit/authorization](../audit/authorization-matrix-v2.md);[刷新恢复专项审计](../audit/2026-09-13-chat-history-refresh-disappears.md) | 历史读取端点补统一会话 owner + 阶段授权;旧 API 410 标注(BUG-11 partial) | `authz` |
| 文档治理 | 法定文档生命周期 + 租约 + 受控正文读取 | done | [test docgov](../test-reports/2026-09-08-docgov-lifecycle-and-claiming-framework-test-report.md);[项目 143 正文 404 审计](../audit/2026-09-14-project143-controlled-content-404.md);[受控正文真实 UI 验收报告](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);[UI-06 缓存竞争审计](../audit/2026-09-14-document-revision-refresh-cache-race.md);[整改](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md) | 生命周期/租约保留。W1–W6 + 审查修补 + UI hydrate 资格 + 晚到 list sync 修复均已合入 dev。项目 143 纯 UI 回归(clean-run3)与新项目全链路(main + post-restart)已全量真实页面验证通过(PASS) | `docgov` |
| 文档版本与修改认知 | 智能体版本边界、人工修订标记、任意版本比较、变更报告与负责人通知 | partial | [管理测试](../test-reports/2026-09-13-document-revision-management-test-report.md);[运行时 UI Round20](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[运行时审计](../audit/2026-09-13-document-revision-runtime-404.md);[ADR](../adr/2026-09-13-document-version-boundary.md) | **运行时 UI PASS**(6159 / V3/r2)。仍 `partial`:change report=`fallback`(真实 diff+lineage,非完整 PI 叙事)。系统级 `CHAT-INTENT` 见 gap-matrix | `docgov` |
| 前端工作台 | 三栏 + 块文档 + SSE | partial | [test workbench](../test-reports/2026-09-08-three-column-workbench-and-block-document-test-report.md);[现场专项审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[双标签截图](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/screenshots/tab-b-busy.png) | 错误卡片/任务进度/文档 busy 刷新恢复已有项目 6275 证据。前端人工抽检仍开放 | `web` |
| PI Runner / 配置链 | pi-agent + MiniMax 真实链路 + typed-result-v1 | done | [test piagent](../test-reports/2026-09-13-codex-audit-p0-remediation-test-report.md);[container-env](../test-reports/2026-09-13-container-env-configuration-test-report.md);[typed-result-v1](../test-reports/2026-09-15-pi-typed-result-v1-test-report.md) | — | `pi-agent` |
| 三环境运维 | dev/test/main + 共享 KB | done | [PROJECT.md](../../PROJECT.md) §4;四环境 healthy | — | `infra` |
| CI / E2E | PG 集成 + 真实 PI E2E | partial | [gap-matrix BUG-08](../remediation/gap-matrix.md);[test pg-ci](../test-reports/2026-09-12-pg-ci-soak-e2e-test-report.md);[运行时 UI Round20](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md) | CI `TEST_DATABASE_URL` 隔离库仍缺;文档运行时真实 UI 已按 UI_PHASE 分文件且 post-restart 断言最终 A1 正文。`-race` 全包并行 TempDir flake 为基建残留 | `ci` |
| 模块解耦与可靠事件 | 文档可靠性纵向试点、PG 持久事件交付与选择性模块化 | partial | [架构](../system-design/2026-09-14-module-decoupling-architecture.md);[ADR](../adr/2026-09-14-modular-monolith-decoupling.md);[Phase 1](../remediation/2026-09-14-module-decoupling-refactor-plan.md);[Phase 2 审阅](../audit/2026-09-15-module-decoupling-phase2-plan-review.md);[Phase 2 修订计划](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md);[E0A](../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md);[E0B](../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md);[E1A](../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md);[E1B](../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md);[E1C](../test-reports/2026-09-15-event-e1c-projection-test-report.md);[E2](../test-reports/2026-09-15-event-e2-hook-guard-test-report.md);[复盘](../ops/research/2026-09-15-track-e-retrospective.md);[D6](../test-reports/2026-09-15-doccontent-canonical-boundary-test-report.md);[D7a](../test-reports/2026-09-15-intent-bizdev-boundary-test-report.md);[D5](../test-reports/2026-09-15-stageflow-type-ownership-test-report.md);[D4](../test-reports/2026-09-15-bizdev-locator-removal-test-report.md);[D7b](../test-reports/2026-09-15-chatflow-orchestration-boundary-test-report.md);[H0](../ops/research/2026-09-15-http-error-envelope-h0-inventory.md);[P0](../ops/research/2026-09-15-pi-typed-result-p0-matrix.md);[收口](../test-reports/2026-09-15-phase2-closeout-test-report.md);[notify live](../test-reports/2026-09-15-event-notify-shared-live-test-report.md);[advance live](../test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md);[projection live](../test-reports/2026-09-15-event-projection-shared-live-test-report.md);[HTTP 信封](../test-reports/2026-09-15-http-error-envelope-h1-h3-test-report.md);[PI typed-result](../test-reports/2026-09-15-pi-typed-result-v1-test-report.md) | E0A–E2 与共享 live 已过;生产无 hook 注册。D4–D7b 已合入。FAV off。Track P H1–H3 / P1–P4 已实施 | `architecture-docs` |
| 模块 | 声明范围 | 状态 | 发布关系 | 证据 | 剩余工作 / 关闭条件 | mutex |
|------|----------|------|----------|------|---------------------|-------|
| 意图识别 L1 | 18 类 Intent、三分支消解、写/只读分流、双标签 `DOC_BUSY`、intent 纯依赖边界 | done | non_blocker | [intent-recognition](../system-design/intent-recognition/);[审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U3](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) | **边界 before**:含 U9–U12 叙事混入 → **after**:U9–U12 迁至「多意图扩面」行。关闭:纯依赖边界回归即重开 | `intent` |
| 多意图持久计划(U1–U8 基线) | app/intentflow 生命周期、HITL、默认 `legacy`、U1–U8 代码与安全基线 | done | non_blocker(默认 legacy) | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U8](../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md);[Wave2 真 PI](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md) | U8 已签。**Playwright 双标签**:真浏览器 PASS 已合入([报告](../test-reports/2026-09-16-intent-plan-playwright-dual-tab-test-report.md));升 `confirm/full` 另开 | `intent-plan` |
| 多意图扩面(U9–U12) | U9 LLM 分段实验;U10 mutate;U11 docgov;U12 workflow/run-control | done | deferred_enhancement | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[脚手架](../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md);[U9](../test-reports/2026-09-17-w4-u9-segment-test-report.md);[U10](../test-reports/2026-09-17-w4-u10-mutate-test-report.md);[U11](../test-reports/2026-09-17-w4-u11-docgov-test-report.md);[U12](../test-reports/2026-09-17-w4-u12-run-control-test-report.md) | **before**:独立 flag 脚手架。**after**:U9 可开 flag 走产品 PI proposer(规则已切则不出 proposal);U10–U12 分 flag dry-run→confirm 证据。**未升** `MULTI_INTENT_PLAN_TIER`(升 `confirm` 另开授权;永不默认 `full`)。U10–U12 领域 live 写仍须专项批准 | `intent-plan` |
| 对话 / ctxmgr baseline | 多轮上下文、刷新/重登/重启恢复、授权同集正文与计数、U10 端口化停止扩面 | done | non_blocker | [multi-turn](../system-design/multi-turn-dialogue/);[刷新审计](../audit/2026-09-13-chat-history-refresh-disappears.md);[U10](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md);[门禁 B3](../test-reports/2026-09-16-chat-refresh-gate-test-report.md)(项目 6359) | **before**:语义摘要误标 D5 混入 → **after**:摘要迁「语义摘要 D3」;D7 数据治理独立。U10 停止扩面 | `chat` |
| 语义摘要(D3) | 授权后可见集合上的语义摘要;shadow → 可选替换 deterministic | done | deferred_enhancement | [chat-agent-p6-backlog](../backlog/chat-agent-p6-backlog.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu6](../ops/long-term/2026-09-16-pu6-semantic-summary-contract.md);[脚手架](../test-reports/2026-09-16-pu6-semantic-summary-test-report.md);[W2 真 PI](../test-reports/2026-09-17-w2-semantic-summary-shadow-test-report.md) | **before**:flag 脚手架 + heuristic。**after**:dev 可开 `SEMANTIC_SUMMARY_SHADOW` 走产品 PI no-tool summarizer(默认 off)。**REPLACE 未启用**(独立后置,不在本行关闭条件内) | `chat` |
| 对话数据治理(D7) | 留存/删除口径、库·备份·日志控制、敏感字段加密边界 | deferred | deferred_enhancement(违规则升 blocker) | [计划](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md) Scope Boundaries;[收口 §7.1](../remediation/2026-09-16-partial-deferred-completion-plan.md);[D7 ADR 草案](../adr/2026-09-17-d7-chat-data-retention.md);[W7 盘点](../audit/2026-09-17-d7-data-inventory.md);[报告](../test-reports/2026-09-17-w7-d7-inventory-test-report.md) | **after W7**:只读盘点完成(sessions/messages/KB/日志/备份/event)。**未发现**已确认基线违规,未写 gap-matrix。口径仍 `pending-compliance-signoff`;禁止按 365/180/30 物理删除。本行不升 done | `chat` |
| 智能体小队 | 角色-任务-工作区-黑板 | done | non_blocker | [agent-squad](../system-design/agent-squad/);[test 2026-09-07](../test-reports/2026-09-07-dynamic-squad-planning-test-report.md) | 非关键步骤降级(A5/A6)属 backlog | `squad` |
| 工作流治理 | 三正式工作流、设置页/DutyMode、动作级鉴权、真实 PI 三工作流 E2E、full/none 混合长链 | done | non_blocker | [三工作流整改](../remediation/2026-09-12-three-workflows-strict-governance-remediation.md);[409/职责](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md);[鉴权](../test-reports/2026-09-14-governance-action-level-authz-test-report.md);[PI E2E](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2 full/none](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md) | full 跨用户审批 + none 免审批不阻塞已签。纯软件自举仍独立 planned | `workflow` |
| 纯软件项目自举 | 软件项目创建、Bootstrap、Delivery、受控工程交接 | partial | deferred_enhancement(明确不挡首发) | [设计](../system-design/2026-09-14-software-project-bootstrap-workflow.md);[ADR](../adr/2026-09-16-software-project-bootstrap-keys.md);[L1 报告](../test-reports/2026-09-16-software-project-bootstrap-test-report.md);[W5a](../test-reports/2026-09-17-w5a-software-bootstrap-ui-pi-test-report.md) | **before**:L1 + UI 仍克隆医疗模板。**after W5a**:catalog 驱动创建、软件不挂医疗 key、docs_only 真 PI 建议 delivery 且不自动激活。**SWBOOT-10 仍 stub**(W5b);本行不升 done | `workflow-design` |
| IAM / 鉴权 | 项目级 API 鉴权 + RBAC;会话/阶段授权 | done | 加固 | [v3 full inventory](../audit/authorization-matrix-v3-full.md);[session 中断](../test-reports/2026-09-16-iam-route-inventory-test-report.md);[fail-closed](../test-reports/2026-09-16-wave1-iam-fail-closed-test-report.md);[410 策略](../audit/2026-09-16-bug11-410-retire-decision.md);[R13](../audit/2026-09-16-r13-data-safety-checklist.md) | 全路由 inventory + session 中断负例 + 410 冻结 + R13 基线已签 | `authz` |
| 文档治理 | 法定文档生命周期 + 租约 + 受控正文读取 | done | non_blocker | [docgov](../test-reports/2026-09-08-docgov-lifecycle-and-claiming-framework-test-report.md);[正文 UI](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);[canonical hash](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md) | 项目 143 只读;不终止 | `docgov` |
| 文档版本 baseline | 账本、人工修订、确定性 diff+lineage、运行时 UI、负责人通知 | done | non_blocker | [管理](../test-reports/2026-09-13-document-revision-management-test-report.md);[Round20 UI](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[ADR](../adr/2026-09-13-document-version-boundary.md) | **before**:完整 PI narrative 混入 → **after**:迁「PI change-report 叙事」。fallback 报告是本行内显式行为,不是缺口 | `docgov` |
| PI change-report 叙事 | 只读消费 diff+lineage 的 PI 叙事;失败全量降级 fallback | done | deferred_enhancement | [Round20](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu7](../ops/long-term/2026-09-16-pu7-pi-narrative-contract.md);[脚手架](../test-reports/2026-09-16-pu7-pi-narrative-test-report.md);[W3 真 PI](../test-reports/2026-09-17-w3-pi-change-report-narrative-test-report.md) | **before**:flag 脚手架 + 仅 fallback。**after**:dev 可开 `PI_CHANGE_REPORT_NARRATIVE` 走产品 PI no-tool narrator(默认 off)。digest 绑定;畸形/超时全量 fallback。**不把 fallback 写成完整 PI** | `docgov` |
| 前端工作台 | 三栏 + 块文档 + SSE;错误卡/进度/busy;版本冲突信封;demo seed 默认关;终止 preview | done | non_blocker | [workbench](../test-reports/2026-09-08-three-column-workbench-and-block-document-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/screenshots/tab-b-busy.png);[demo](../test-reports/2026-09-16-demo-seed-pollution-test-report.md);[B4](../test-reports/2026-09-16-frontend-gate-b4-test-report.md)(项目 6363) | **before**:空「缺口」却 partial → **after**:本行 done。其他 409 消费方信封复用另列 hardening backlog | `web` |
| PI Runner / 配置链 | pi-agent + MiniMax + typed-result-v1 | done | non_blocker | [piagent](../test-reports/2026-09-13-codex-audit-p0-remediation-test-report.md);[container-env](../test-reports/2026-09-13-container-env-configuration-test-report.md);[typed-result](../test-reports/2026-09-15-pi-typed-result-v1-test-report.md) | — | `pi-agent` |
| 三环境运维 | dev/test/main + 共享 KB;对话/业务库隔离 | done | non_blocker | [PROJECT.md](../../PROJECT.md) §4;CURRENT 环境快照 dev/test schema **48**、main **47** | — | `infra` |
| CI / E2E | PR CI、PG 集成、治理 PG、已签真实 PI 门禁;**nightly** schedule/`workflow_dispatch` + infra/product 分类 receipt | done | 加固(阻止**下一次**晋升,不自动否定已发布) | [BUG-08](../test-reports/2026-09-16-ci-governance-pg-bug08-test-report.md);[PI 三工作流](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md);[W1 green](../test-reports/2026-09-17-w1-ci-e2e-green-nightly-test-report.md) + [receipt `6e2476f0…`](../assets/promotion-receipts/6e2476f0f2e408e111fe06ca7c31a38294a340b3.json) | **before**:partial(FullNone product_fail / secrets 文案过时)→ **after**:secrets 已配;duplicate goose 00048 已清;FullNone+U8 nightly `verdict=pass` | `ci` |
| Artifact 同 digest 晋升 | 候选 commit 一次构建、按 digest 晋升、promotion receipt | done | 加固 | [计划 PU5B](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md) | **关闭**:same-image pin(`candidate-images-*` + `PINNED_IMAGE_MODE` + promote `--require-digests`)。**声明**:单机 retag/digest pin;远程 registry 推送另立任务 | `infra` |
| 可靠事件核心 | PG dispatcher、notify/advance/projection live、生产闭包 hook 退出、Phase2 选择性解耦已合入 | done | non_blocker | [E0A–E2](../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md) 等;[复盘](../ops/research/2026-09-15-track-e-retrospective.md);[shared live](../test-reports/2026-09-15-event-notify-shared-live-test-report.md);[phase2 closeout](../test-reports/2026-09-15-phase2-closeout-test-report.md) | **before**:与 FAV off 混成 partial → **after**:FAV 独立行。选择性后续解耦按收益触发 | `architecture-docs` / `events` |
| Final Artifact Vault(FAV) | 不可变终态制品库;`FAV_DEGRADED_READ=false` | partial | deferred_enhancement | [Track E 复盘](../ops/research/2026-09-15-track-e-retrospective.md);[U7 报告](../test-reports/2026-09-16-fav-u7-incremental-test-report.md);[W6 shadow](../test-reports/2026-09-17-w6-fav-subscriber-shadow-test-report.md);[short-term](../ops/short-term/2026-09-17-w6-fav-subscriber-shadow.md) | **after W6**:subscriber `ObserveShadow` 只计算 intended outcome,不写副作用。仍**禁止**整支 merge;`FAV_DEGRADED_READ` 默认 false;**live 未放量**(staging→artifact→publication 各 ≥7 天观察窗) | `events` |
---
## Wave 0 边界 lineage(收口摘要)
| 行 | before 状态/口径 | after | 原义务去向 | 现有证据是否覆盖冻结边界 |
|----|------------------|-------|------------|--------------------------|
| Intent L1 | partial(混入 U9–U12) | done | U9–U12 → 多意图扩面 | 是(双标签 + 分流 + U1–U3) |
| Chat/ctxmgr | partial(混入语义摘要 D5 误标) | done | D3 摘要行;D7 治理行 | 是(B3 项目 6359) |
| Document revision | partial(混入完整 PI 叙事) | done | PI change-report 叙事行 | 是(Round20;fallback 为声明行为) |
| Frontend workbench | partial(缺口栏已空) | done | 其他 409 信封复用 → backlog | 是(B4 项目 6363) |
| 可靠事件 | partial(与 FAV 混行) | done | FAV 独立 deferred | 是(E0–E2 + shared live) |
---
## 更新规则
1. 模块状态变化时同步更新本表与 [gap-matrix](../remediation/gap-matrix.md)(若涉及 blocker)
2. 同一 `mutex` 同时仅一个 Agent `in_progress`(见 CURRENT 并行认领表)
3. 新能力行:复制模板 [../ops/templates/feature-matrix-row.md](../ops/templates/feature-matrix-row.md)
1. 模块状态变化时同步本表;**仅当**发布 blocker 出现或关闭时改 [gap-matrix](../remediation/gap-matrix.md)
2. 同一 `mutex` 同时仅一个 Agent `in_progress`(见 CURRENT)
3. 新能力行:复制 [../ops/templates/feature-matrix-row.md](../ops/templates/feature-matrix-row.md)
4. 拆行/收口须保留 before/after 与义务迁移(见上表);禁止缩口径假完成
+9 -1
View File
@@ -2,4 +2,12 @@
**SSOT**:[FEATURE-MATRIX.md](./FEATURE-MATRIX.md)
与 [remediation/gap-matrix.md](../remediation/gap-matrix.md)(发布 blocker)分离:本目录描述**能力地图**,gap-matrix 描述**上线缺口**。
与 [remediation/gap-matrix.md](../remediation/gap-matrix.md)(发布 blocker)分离:
| 文档 | 职责 |
|------|------|
| 本目录 FEATURE-MATRIX | **能力成熟度**:声明范围、状态、发布关系、关闭条件、证据 |
| gap-matrix | **上线缺口**:唯一决定 `production_ready` |
| [ops/CURRENT.md](../ops/CURRENT.md) | 协作焦点、认领、集成槽位、环境快照 |
能力行不必全部 `done` 才能发布;`partial`/`deferred` 不得自动回退 `production_ready`。新行模板:[../ops/templates/feature-matrix-row.md](../ops/templates/feature-matrix-row.md)。连续性审计与整改:[audit 2026-09-16](../audit/2026-09-16-feature-matrix-production-readiness-audit.md) · [remediation plan](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md)。
@@ -1,9 +1,10 @@
# 多意图多任务识别、持久计划与 HITL 统一确认方案
> 状态: planned(方案已复核,未实施)
> 日期: 2026-09-15
> 作者: Cline(初稿)/ Codex(架构、安全与实施计划复核)
> 关联: [方案审计](../audit/2026-09-15-multi-intent-hitl-plan-review.md);[意图识别深读](./intent-recognition/01-意图识别框架-设计-架构-实现-难点-解决方案-亮点与优势.md);[模块化单体架构](./2026-09-14-module-decoupling-architecture.md);[任务总览](../ops/short-term/2026-09-15-multi-intent-hitl.md)
> 状态: **partially implemented**(U1–U8 代码与默认 `legacy` 已合入;U8 真实 PI generate 仍为证据缺口;U9–U12 deferred)
> 日期: 2026-09-15
> **SSOT 状态**:能力行见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md)(Wave 0 校准);发布门禁见 [gap-matrix](../remediation/gap-matrix.md)。本文保留为设计权威,头部「planned/未实施」已过时。
> 作者: Cline(初稿)/ Codex(架构、安全与实施计划复核)
> 关联: [方案审计](../audit/2026-09-15-multi-intent-hitl-plan-review.md);[意图识别深读](./intent-recognition/01-意图识别框架-设计-架构-实现-难点-解决方案-亮点与优势.md);[模块化单体架构](./2026-09-14-module-decoupling-architecture.md);[任务总览](../ops/short-term/2026-09-15-multi-intent-hitl.md);[连续性计划](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md)
---
@@ -27,7 +28,7 @@
| 能力 | 当前事实 | 证据 |
|------|----------|------|
| 单意图识别 | 18+ Intent、四级漏斗、三分支已实现;FEATURE-MATRIX 仍为 `partial`,不能称“已成熟” | `internal/intent/recognizer.go`、`.doc/status/FEATURE-MATRIX.md` |
| 单意图识别 | 18+ Intent、四级漏斗、三分支已实现;FEATURE-MATRIX L1 行 Wave 0 已收口为 `done`(U9–U12 拆出) | `internal/intent/recognizer.go`、`.doc/status/FEATURE-MATRIX.md` |
| V2 帧/动作表 | `IntentFrameV2`、ActionRegistry、风险、必填槽位、灰度开关已存在 | `internal/intent/types_v2.go`、`registry.go`、`flags.go` |
| 有限多意图 | 默认开启;只按首个连接词拆两段;写意图返回 `nil` | `internal/intent/plan_builder.go` |
| 有限执行 | 只读步骤顺序执行;需确认步骤只有文字提示 | `internal/coordinator/action_planner.go` |
+6
View File
@@ -126,6 +126,12 @@
| 主方案 | [2026-09-15-multi-intent-hitl-plan.md](2026-09-15-multi-intent-hitl-plan.md) |
| 复核 | [../audit/2026-09-15-multi-intent-hitl-plan-review.md](../audit/2026-09-15-multi-intent-hitl-plan-review.md) |
| 任务总览 | [../ops/short-term/2026-09-15-multi-intent-hitl.md](../ops/short-term/2026-09-15-multi-intent-hitl.md) |
| U1 契约 | [../ops/short-term/2026-09-15-multi-intent-u1-contracts.md](../ops/short-term/2026-09-15-multi-intent-u1-contracts.md) |
| U2 分段 | [../ops/short-term/2026-09-15-multi-intent-u2-segmenter.md](../ops/short-term/2026-09-15-multi-intent-u2-segmenter.md);[报告](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) |
| U3 PG | [../ops/short-term/2026-09-15-multi-intent-u3-intentflow-pg.md](../ops/short-term/2026-09-15-multi-intent-u3-intentflow-pg.md);[报告](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) |
| U4 投影 | [../ops/short-term/2026-09-16-multi-intent-u4-outbox-projection.md](../ops/short-term/2026-09-16-multi-intent-u4-outbox-projection.md);[报告](../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md) |
| U5 API | [../ops/short-term/2026-09-16-multi-intent-u5-decision-api.md](../ops/short-term/2026-09-16-multi-intent-u5-decision-api.md);[报告](../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md) |
| U6 Web | [../ops/short-term/2026-09-16-multi-intent-u6-web-cards.md](../ops/short-term/2026-09-16-multi-intent-u6-web-cards.md);[报告](../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md) |
| 一句话总结 | intent 保持纯规则,intentflow 持久化计划并统一确认、授权、幂等、恢复和逐动作执行 |
**硬边界**:确认不等于授权;PG 是计划真相,卡片/SSE 是投影;写动作按 owner 端口逐项接入;LLM 只能提出不可信分段建议。
+41
View File
@@ -29,6 +29,7 @@ imports:
- workflowdef
chat:
- app/chatflow
- app/intentflow
- app/stageflow
- coordinator
- ctxmgr
@@ -65,6 +66,7 @@ imports:
- app/docflow
- app/docnotify
- app/docproject
- app/intentflow
- app/stageflow
- app/uow
- artifactvault
@@ -113,6 +115,13 @@ imports:
- docquery
- docrevision
- events
app/intentflow:
- app/uow
- events
- intent
app/fav:
- artifactvault
- events
app/uow: []
app/stageflow:
- bizdev
@@ -159,6 +168,7 @@ imports:
- app
- app/chatflow
- app/docflow
- app/intentflow
- app/stageflow
- app/uow
- auth
@@ -186,6 +196,7 @@ imports:
- squad
- stream
- stream/transport
- swboot
- taskrun
- upload
- workflowdef
@@ -202,6 +213,7 @@ imports:
stream: []
stream/transport:
- stream
swboot: []
taskrun:
- app/uow
- artifactvault
@@ -304,6 +316,16 @@ table_owners:
- dataset
dataset_destroy_requests:
- dataset
intent_plans:
- app/intentflow
intent_plan_steps:
- app/intentflow
intent_plan_decisions:
- app/intentflow
intent_plan_projections:
- app/intentflow
intent_plan_shadow:
- app/intentflow
path_owners:
output.md:
@@ -348,6 +370,15 @@ event_producers:
- taskrun
fav.artifact_staged:
- app/docflow
intent.plan.awaiting_input:
- app/intentflow
- events
intent.plan.step_changed:
- app/intentflow
- events
intent.plan.completed:
- app/intentflow
- events
event_consumers:
outbox.notify:
@@ -371,6 +402,15 @@ event_consumers:
- notify
fav.artifact_staged:
- fav
intent.plan.awaiting_input:
- projection
- notify
intent.plan.step_changed:
- projection
- notify
intent.plan.completed:
- projection
- notify
unwrap_owners:
- docgov
@@ -380,6 +420,7 @@ unwrap_owners:
- events
- artifactvault
- ctxmgr
- app/intentflow
exceptions:
- kind: sql_write
@@ -0,0 +1,105 @@
# 多意图 HITL U1 契约冻结 测试报告
## 一、 测试背景 (Background)
多意图识别目前最多拆两段且写意图直接丢弃;确认只是 coordinator 文本提示。方案已复核为「持久计划深模块」,U1 必须先冻结边界、事件、状态机和 BatchActionPolicy,避免后续单元向 `intent` / coordinator 堆叠职责。
## 二、 测试目标 (Test Objectives)
- `app/intentflow` 进入 import allowlist;三张计划表 owner 仅为 `app/intentflow`
- 三条 `intent.plan.*` 事实事件 YAML ↔ `StaticContracts` 对等,payload 不含 prompt/slots/权限
- 默认 `MULTI_INTENT_PLAN_TIER=legacy`;未知 policy key fail closed
- ActionRegistry 不出现 batch/tier/adapter 字段
- `intent -> maturity` 与全仓 short 测试无回归
- 无运行时路由变更,因此不做真实 PI / 浏览器验收
## 三、 测试方案与环境 (Test Plan & Environment)
| 项 | 值 |
|----|-----|
| OS | Linux 7.0.0-31-generic |
| Go | go1.27.1 linux/amd64 |
| 分支 | `feature/multi-intent-u1-contracts`(从本地 `dev@9874237` 检出) |
| Schema | **43**(本单元不迁移) |
| 容器 | 不 rebuild |
| 项目 143 | **只读** |
| 证据 | `.doc/test-reports/assets/2026-09-15-multi-intent-u1-contracts/` |
测试层级:archtest / events parity / intentflow 单测 / `go test -short ./...`。无 PG 集成、无真实 PI。
## 四、 预期结果 (Expected Results)
| 用例 | 判定 |
|------|------|
| YAML ↔ StaticContracts | 三条 `intent.plan.*` 生产者含 `app/intentflow`+`events`,消费者 `projection`+`notify` |
| 未知 action key | `Lookup` 失败;构造期缺行/多行失败 |
| `task.run` | 批量必须确认,`OpenFromTier=confirm` |
| `regulation.query` | 不要求批量确认,`OpenFromTier=auto_read` |
| 默认 tier | `legacy`;`MULTI_INTENT_ENABLED=true` 不升档 |
| ActionSpec | 无 batch/tier/adapter 字段 |
| arch-check block | production gate passed |
| 全仓 short | PASS |
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 5.1 事件 parity 与安全 payload
- **测试输入 (Input)**:`go test -count=1 ./internal/events -run 'RegistryParity|IntentPlan'`
- **实际输出 (Actual Output)**:
```
ok chat-agent-system/internal/events 0.004s
```
(完整包输出见 [unit.txt](assets/2026-09-15-multi-intent-u1-contracts/unit.txt))
- **评价判定 (Evaluation / Verdict)**:PASS。`TestRegistryParityWithYAML`、`TestIntentPlanContractsOmitSensitivePayload` 绿。
- **性能与耗时 (Duration & Latency)**:约 5ms
### 5.2 archtest / arch-check
- **测试输入**:`./scripts/arch-check.sh --mode block`;`go test -count=1 ./internal/archtest`
- **实际输出**:
```
arch-check mode=block
ok chat-agent-system/internal/archtest 0.173s
ok chat-agent-system/internal/archtest 0.154s
arch-check block: production gate passed
```
- **评价判定**:PASS。`intent.plan.*` 字面量可被扫描;`events` 已登记为生产者,registry.go 不误报。
- **性能与耗时**:约 1.1s
### 5.3 intentflow 政策与 tier
- **测试输入**:`go test -count=1 ./internal/app/intentflow`
- **实际输出**:`ok chat-agent-system/internal/app/intentflow 0.002s`
- **评价判定**:PASS。未知 key fail closed;`task.run` 批量确认;查询不要求确认;ActionSpec 无 HITL 字段;默认 legacy。
- **性能与耗时**:约 2ms
### 5.4 全仓 short 回归
- **测试输入**:`unset TEST_DATABASE_URL; go test -short -count=1 ./...`;`go vet ./...`;`git diff --check`
- **实际输出**:见 [short.txt](assets/2026-09-15-multi-intent-u1-contracts/short.txt)。`internal/server` 9.920s;全包 ok。`go vet` 无输出。`git diff --check` 无空白错误。
- **评价判定**:PASS。单意图路径无运行时改动,`internal/intent` / `internal/coordinator` / `internal/chat` 均绿。
- **性能与耗时**:约 12s
## 六、 自动化测试套件汇总 (Test Suite Execution)
| 命令 | 结果 |
|------|------|
| `go vet ./...` | PASS |
| `go test -short -count=1 ./internal/app/intentflow ./internal/events ./internal/archtest ./internal/intent` | PASS |
| `go test -short -count=1 ./...` | PASS |
| `./scripts/arch-check.sh --mode block` | PASS |
通过率 100%。未跑 PG / 真实 PI(本单元无副作用路径)。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
U1 达到合入标准:契约冻结完成,默认 legacy,确认前零副作用保持不变。
后续:U2 在独立分支 `feature/multi-intent-u2-segmenter` 做规则分段 shadow;不得把 HITL/tier 回灌 ActionRegistry。
CSRF:现有 Bearer / `X-Session-Token` + CORS allowlist 对 U5 足够,不是 blocker。nonce 不替代认证。
@@ -0,0 +1,145 @@
# 多意图 HITL U2 规则分段与 shadow 提案 测试报告
## 一、 测试背景 (Background)
U1 已冻结 `app/intentflow` 契约与默认 `legacy` tier。生产路径仍由 `plan_builder` 最多拆两段查询,写意图直接丢弃。U2 要在不改 TopIntent / 现有 IntentPlan 路由的前提下,用纯规则分段器生成 2–4 步 `PlanProposal`,并把写段、指代、红线、超限记录进 shadow,供后续 intentflow 消费。
## 二、 测试目标 (Test Objectives)
- 连接词 / 句号 / 分号 / 换行 / 序号 / 「先…再…最后」能拆出 2–4 段
- 「查询并总结」内部链不拆;5 段不截断而是 `rejected_batch_size`
- 写段进入提案且 `ComboHint=needs_confirm`;生产 IntentPlan 仍为 nil
- 指代 → `needs_clarify`;红线 → 整句 `rejected`
- 同输入 digest 稳定;反事实 `auto_read` 错误自动执行 = 0
- `intent -> maturity` 保持;coordinator / chat 无回归
- 无运行时路由变更,因此不做真实 PI / 浏览器验收
## 三、 测试方案与环境 (Test Plan & Environment)
| 项 | 值 |
|----|-----|
| OS | Linux 7.0.0-31-generic |
| Go | go1.27.1 linux/amd64 |
| 分支 | `feature/multi-intent-u2-segmenter`(从本地 `dev@8ac3d3f` 检出) |
| Schema | **43**(本单元不迁移) |
| 容器 | 不 rebuild |
| 项目 143 | **只读** |
| 证据 | `.doc/test-reports/assets/2026-09-15-multi-intent-u2-segmenter/` |
测试层级:characterization(legacy IntentPlan)/ 分段器单测 / PlanProposal + golden eval / `go test -short ./...`。无 PG 集成、无真实 PI。
## 四、 预期结果 (Expected Results)
| 用例 | 判定 |
|------|------|
| 「查风险,然后查法规」 | 生产 IntentPlan 仍为 2 步 query;提案 `read_only`,反事实 `would_execute` |
| 「查法规然后生成报价单」 | 生产 IntentPlan=nil,TopIntent 仍为查询;提案含写段、`needs_confirm`、`would_confirm`;shadow `LegacyDroppedWrite=true` |
| 「查询并总结」 | 不分段;生产无 multi-intent plan;提案 `single` / `would_passthrough` |
| 「然后再看一下它的适用范围」 | `needs_clarify` / `would_clarify` |
| 「然后修改我的工号」 | 整句 `rejected` / `would_reject` |
| 5 段编号 | 分段器保留 5 段;提案 `rejected_batch_size`,不静默截成 4 |
| 同输入 digest | SHA-256 稳定 |
| golden v1 denom=8 | `false_auto_execute=0` |
| arch-check block | production gate passed |
| 全仓 short | PASS |
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 5.1 characterization:生产路由不变
- **测试输入 (Input)**:`go test -count=1 ./internal/intent -run 'TestLegacyIntentPlan|TestLimitedIntentPlan_QueryThenQuery'`
- **实际输出 (Actual Output)**:
```
--- PASS: TestLegacyIntentPlan_WriteComboStillDropped (0.00s)
--- PASS: TestLegacyIntentPlan_NoConnectorStaysSingle (0.00s)
--- PASS: TestLimitedIntentPlan_QueryThenQuery (0.00s)
ok chat-agent-system/internal/intent 0.012s
```
- **评价判定 (Evaluation / Verdict)**:PASS。写组合生产 IntentPlan 仍为 nil;「查询并总结」不产生 legacy 计划;双查询仍是 2 步 IntentPlan。
- **性能与耗时 (Duration & Latency)**:约 12ms
### 5.2 分段器 golden
- **测试输入**:`go test -v -count=1 ./internal/intent -run TestSplitPlanSegments`
- **实际输出**:
```
--- PASS: TestSplitPlanSegments_ConnectorAndNumbered (0.00s)
--- PASS: TestSplitPlanSegments_PeriodAndSemicolon (0.00s)
--- PASS: TestSplitPlanSegments_InternalChainNotSplit (0.00s)
--- PASS: TestSplitPlanSegments_FirstThenFinally (0.00s)
--- PASS: TestSplitPlanSegments_FiveNumberedKeptIntact (0.00s)
```
- **评价判定**:PASS。连接词、编号、「先再最后」、句号/分号均可拆;内部链保持 1 段;5 段不被截断。
- **性能与耗时**:<10ms
### 5.3 写段进入提案且路由不变
- **测试输入**:`查一下相关法规,然后帮我生成报价单`
- **实际输出**:见 [proposal-verbose.txt](assets/2026-09-15-multi-intent-u2-segmenter/proposal-verbose.txt)
```
--- PASS: TestPlanProposal_WriteNotDroppedAndLegacyUnchanged (0.00s)
```
断言:`IntentPlan==nil`,`TopIntent=QUERY_REGULATIONS`,提案 ≥2 段,`ComboHint=needs_confirm`,`LegacyDroppedWrite=true`,`CounterfactualAutoRead=would_confirm`。
- **评价判定**:PASS。提案层不再静默丢写段;生产路由未改。
- **性能与耗时**:<10ms
### 5.4 指代 / 红线 / 批量上限 / digest
- **测试输入**:对应 `TestPlanProposal_AnaphoraClarify`、`SecurityRejectsWhole`、`BatchSizeRejected`、`DigestStable`
- **实际输出**:
```
--- PASS: TestPlanProposal_AnaphoraClarify (0.00s)
--- PASS: TestPlanProposal_SecurityRejectsWhole (0.00s)
--- PASS: TestPlanProposal_BatchSizeRejected (0.00s)
--- PASS: TestPlanProposal_DigestStable (0.00s)
```
- **评价判定**:PASS。指代澄清、红线整句拒绝、5 段 `rejected_batch_size`、digest 稳定。
- **性能与耗时**:<10ms
### 5.5 golden eval 与反事实安全
- **测试输入**:`internal/intent/testdata/plan-proposal-eval-v1.json`(denom=8)
- **实际输出**:
```
proposal_test.go:221: plan-proposal eval denom=8 false_auto_execute=0
--- PASS: TestPlanProposalEvalGolden (0.00s)
--- PASS: TestPlanProposal_HardNegativeNoFalseAutoExecute (0.00s)
```
- **评价判定**:PASS。写/红线/指代/超限均不会被反事实判成 `would_execute`。`ComboHint` 只是结构提示,不是授权。
- **性能与耗时**:<10ms
### 5.6 边界与全仓 short
- **测试输入**:`go vet ./...`;`./scripts/arch-check.sh --mode block`;`unset TEST_DATABASE_URL; go test -short -count=1 ./internal/intent ./internal/coordinator ./internal/chat ./internal/archtest ./internal/app/intentflow`;`go test -short -count=1 ./...`
- **实际输出**:`go vet` 无输出。`arch-check block: production gate passed`。包级见 [unit.txt](assets/2026-09-15-multi-intent-u2-segmenter/unit.txt);全仓见 [short.txt](assets/2026-09-15-multi-intent-u2-segmenter/short.txt)。`internal/server` 9.687s;全包 ok。
- **评价判定**:PASS。`intent -> maturity` 保持;L1 未 import intentflow。coordinator / chat 无回归。
- **性能与耗时**:全仓 short 约 12s
## 六、 自动化测试套件汇总 (Test Suite Execution)
| 命令 | 结果 |
|------|------|
| `go vet ./...` | PASS |
| `go test -count=1 ./internal/intent -run 'TestSplitPlanSegments\|TestPlanProposal\|TestLegacyIntentPlan'` | PASS |
| `go test -short -count=1 ./internal/intent ./internal/coordinator ./internal/chat ./internal/archtest ./internal/app/intentflow` | PASS |
| `go test -short -count=1 ./...` | PASS |
| `./scripts/arch-check.sh --mode block` | PASS |
通过率 100%。未跑 PG / 真实 PI(本单元无副作用路径)。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
U2 达到合入标准:规则分段与 shadow `PlanProposal` 落地,生产 TopIntent / IntentPlan 不变,反事实错误自动执行为 0。
后续:U3 在独立分支 `feature/multi-intent-u3-intentflow-pg` 建 intentflow owner、PG schema、CAS/lease/fencing;不得把 HITL/tier 回灌 ActionRegistry,也不得把 shadow 提案当作生产 IntentPlan。
@@ -0,0 +1,112 @@
# 多意图 HITL U3 intentflow PG/CAS/lease 测试报告
## 一、 测试背景 (Background)
U1 冻结了 intentflow 契约,U2 在 L1 产出 shadow `PlanProposal`,生产路由仍不落盘。U3 要把计划/步骤/决策变成 PostgreSQL 权威账本,并用 CAS、nonce、lease 与单调 fencing 保证两 worker 不能双 owner / 双执行。本单元不接真实写动作,也不改 chat 路径。
## 二、 测试目标 (Test Objectives)
- Goose `00044` 建立 `intent_plans` / `intent_plan_steps` / `intent_plan_decisions`
- 同 turn 同 digest 幂等;异 digest 冲突;同一作用域不能有第二个活动写计划
- 决策 nonce 同 digest 返回 receipt,异 digest 冲突;确认/取消竞态只一个 CAS 胜出
- 两 worker 抢 eligible 步骤只有一个 lease;过期可接管;旧 fencing token 被动作属主拒绝
- 业务成功但 receipt 写回失败时按幂等键恢复,不盲跑
- 跨 environment 隐藏;关闭计划可由 owner purge
- 默认 legacy 下 `HandleTurn` 不落盘;chat/coordinator 无回归
- 无 HTTP、无真实 adapter、无共享环境 rebuild
## 三、 测试方案与环境 (Test Plan & Environment)
| 项 | 值 |
|----|-----|
| OS | Linux 7.0.0-31-generic |
| Go | go1.27.1 linux/amd64 |
| 分支 | `feature/multi-intent-u3-intentflow-pg`(从本地 `dev@53c0722` 检出) |
| Schema | 文件 **44**(共享 `:8080` 仍为 **43**,本单元不 rebuild) |
| 容器 | 不 rebuild |
| 项目 143 | **只读** |
| 证据 | `.doc/test-reports/assets/2026-09-15-multi-intent-u3-intentflow-pg/` |
测试层级:内存 CAS/lease 单测(`-short`)/ goose 文件门禁 / arch-check / `go test -short ./...`。PG 集成 `TestPlansPG_CreateClaimAndFence` 在 `-short` 下跳过,需隔离 `TEST_DATABASE_URL`。
## 四、 预期结果 (Expected Results)
| 用例 | 判定 |
|------|------|
| HandleTurn legacy | 不创建计划,GetActive 为空 |
| 双创建同 digest | 同一 plan_id |
| 同 turn 异 digest | `PLAN_DECISION_CONFLICT` |
| 第二份活动写计划 | 冲突并返回已有活动计划 |
| nonce 同/异 digest | receipt / conflict |
| 确认 vs 取消 | 恰好一个 CAS 胜出 |
| 两 worker | 仅一个 owner;租约过期接管;旧 fence `PLAN_ACTION_VERSION_CONFLICT` |
| receipt 对账 | execute count=1,步骤 succeeded |
| 跨 env / purge | `PLAN_NOT_FOUND_OR_HIDDEN` |
| arch-check / 全仓 short | PASS |
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 5.1 创建幂等与活动写计划锁
- **测试输入 (Input)**:`go test -v -count=1 ./internal/app/intentflow -run 'TestCreate'`
- **实际输出 (Actual Output)**:
```
--- PASS: TestCreateIdempotentSameDigest (0.00s)
--- PASS: TestCreateRejectsSecondActiveWritePlan (0.00s)
```
- **评价判定 (Evaluation / Verdict)**:PASS。
- **性能与耗时 (Duration & Latency)**:<10ms
### 5.2 决策 CAS / nonce / 过期隔离
- **测试输入**:`TestDecisionNonceSameAndDifferentDigest`、`TestConfirmCancelRaceOneWinner`、`TestExpireAndEnvironmentIsolationAndRetention`
- **实际输出**:见 [plans-verbose.txt](assets/2026-09-15-multi-intent-u3-intentflow-pg/plans-verbose.txt)。三用例均 PASS。
- **评价判定**:PASS。确认/取消竞态恰好一个胜出;过期后确认失败;跨 env 隐藏;purge 后不可见。
- **性能与耗时**:<10ms
### 5.3 lease / fencing / receipt 对账
- **测试输入**:`TestTwoWorkersOneOwnerAndLeaseTakeover`、`TestReceiptWritebackFailureDoesNotRerun`
- **实际输出**:
```
--- PASS: TestTwoWorkersOneOwnerAndLeaseTakeover (0.00s)
--- PASS: TestReceiptWritebackFailureDoesNotRerun (0.00s)
```
- **评价判定**:PASS。旧 fencing token 由 FakeActionOwner 拒绝;写回失败路径只按幂等键恢复,不二次执行。
- **性能与耗时**:<10ms
### 5.4 HandleTurn 与边界
- **测试输入**:`TestHandleTurnLegacyDoesNotPersist`、`TestUnauthenticatedRejected`、`TestGooseU3_00044_HasUpAndDown`
- **实际输出**:intentflow 与 db 包均 PASS。完整包输出见 [unit.txt](assets/2026-09-15-multi-intent-u3-intentflow-pg/unit.txt)。
- **评价判定**:PASS。生产 HandleTurn 仍不落盘。00044 含 Up/Down 与三表、turn/write/nonce 唯一索引。
- **性能与耗时**:db 约 3ms
### 5.5 全仓 short 与 arch-check
- **测试输入**:`go vet ./internal/app/intentflow ./internal/app ./internal/db`;`./scripts/arch-check.sh --mode block`;`unset TEST_DATABASE_URL; go test -short -count=1 ./...`
- **实际输出**:`go vet` 无输出。`arch-check block: production gate passed`。全仓见 [short.txt](assets/2026-09-15-multi-intent-u3-intentflow-pg/short.txt)。`internal/server` 约 9.9s;全包 ok。
- **评价判定**:PASS。`intent -> maturity` 保持;chat/coordinator 无回归。SQL 写仍仅 `app/intentflow`。
- **性能与耗时**:全仓 short 约 12s
## 六、 自动化测试套件汇总 (Test Suite Execution)
| 命令 | 结果 |
|------|------|
| `go vet ./internal/app/intentflow ./internal/app ./internal/db` | PASS |
| `go test -count=1 ./internal/app/intentflow` | PASS(PG 用例 `-short` 跳过) |
| `go test -short -count=1 ./internal/db ./internal/archtest ./internal/intent ./internal/coordinator ./internal/app` | PASS |
| `go test -short -count=1 ./...` | PASS |
| `./scripts/arch-check.sh --mode block` | PASS |
通过率 100%。隔离库 `TEST_DATABASE_URL` 未在本机设置,PG 活验按 skip 记录,不冒充已跑。共享 `:8080` schema 仍为 43。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
U3 达到合入标准:intentflow 成为计划表唯一写者,CAS/lease/fencing/retention 在内存路径闭环,默认 legacy 不改变对话路由。
后续:U4 在独立分支接 Track E outbox/投影;不得修改通用 dispatcher lease 语义。U5 再挂 HTTP。共享环境应用 schema 44 放到后续晋升/rebuild 窗口,不在本单元对项目 143 做迁移。
@@ -0,0 +1,49 @@
# 对话全链路刷新恢复(发布门禁 B3)测试报告
## 一、 测试背景 (Background)
发布门禁要求:激活前聊天 + 激活后文档任务 + 刷新/重登/重启可恢复,双用户负例通过。`CHAT-HISTORY-REFRESH` 闲聊刷新已 PASS;本轮补齐激活后文档任务与重建恢复证据。
## 二、 测试目标 (Test Objectives)
- 真实 pi-agent 闲聊后 window/categories 一致
- 非 owner `guest` 会话读取 403
- SavePlan→Activate→任务 run 后 window 仍含激活前聊天与任务消息
- app rebuild 后同 session window 消息数不丢
## 三、 测试方案与环境 (Test Plan & Environment)
- OS: Linux;dev `:8080`;`agent_backend=pi-agent`;`schema_version=47`
- 脚本:`.doc/test-reports/assets/2026-09-15-chat-history-refresh-live/chat-refresh-live.py`(补成员 POST 后 SavePlan)
- 重启:`./scripts/env-service.sh dev rebuild` 后重登拉取同一 session
## 四、 预期结果 (Expected Results)
- `core_overall` / `overall` = PASS
- `guest_403`;`pi_task_refresh` window_msgs ≥ 激活前
- restart 后 msgs ≥ rebuild 前
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 用例 1:全链路 live(项目 6359)
- **输入**: chat-refresh-live.py → `sess-p6359-u10`
- **实际输出**: 见 [live.json](./assets/2026-09-16-chat-refresh-gate/live.json)
- health/login/create/real_pi_chat/refresh/guest_403/pi_task_refresh 均 PASS
- activate 后 run `run_1789531080321650206`;window_msgs=4,category_total=4
- **判定**: PASS(`overall=PASS`,耗时 ~485s)
### 用例 2:重建恢复
- **输入**: rebuild 前 window=4;`env-service.sh dev rebuild`;重登拉 window
- **实际输出**: [restart.json](./assets/2026-09-16-chat-refresh-gate/restart.json) `before=4 after=4`
- **判定**: PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
本门禁以 live + rebuild 证据为主;关联 `go test -short` / `npm test` 在合入冒烟执行。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- 发布门禁「对话刷新恢复」可 ☑。
- SavePlan 前必须 upsert 职责成员(脚本已补)。
@@ -0,0 +1,48 @@
# CI 治理 PG 集成 / BUG-08 测试报告
## 一、 测试背景 (Background)
gap-matrix BUG-08(测试库隔离)与发布门禁「TEST_DATABASE_URL 下治理 PG 集成」仍为开放项。CI 虽已注入 `TEST_DATABASE_URL`,但治理 PG 用例因成员校验与同步通知断言漂移而无法作为门禁签字。
## 二、 测试目标 (Test Objectives)
- 隔离库上 `TestWorkflowGovernance_PG_*` / `TestE2E_WorkflowGovernance*` 全绿
- CI 增加显式 governance PG 步骤(非 `-short`)
- BUG-08 → PASS;发布门禁第一框 ☑
## 三、 测试方案与环境 (Test Plan & Environment)
- OS: Linux;Go 1.23+/1.27.1 CI
- 隔离库:`postgres://app:***@127.0.0.1:5434/agent_gov_ci`(拒绝 `agent_system_dev/test/main`)
- 层级:PG 集成(无 stub PI)
## 四、 预期结果 (Expected Results)
- 三权负责人先写入 `project_members` 后再 SavePlan
- Activate → Approve → Advance / CompleteAndReplan 成功
- 通知列表 200(不强制同步 `stage_ready_to_advance`;事件已切 outbox)
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 用例 1:隔离库治理 PG
- **输入**: `TEST_DATABASE_URL=.../agent_gov_ci go test ./internal/server/ -run 'TestWorkflowGovernance_PG_|TestE2E_WorkflowGovernance'`
- **实际输出**:
```
--- PASS: TestE2E_WorkflowGovernance_CompleteAndReplan (0.57s)
--- PASS: TestWorkflowGovernance_PG_ActivateApproveAdvanceChain (0.28s)
ok chat-agent-system/internal/server 0.852s
```
- **判定**: PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
```text
CI: go-vet-and-short-test 增加 governance PG integration 步骤
本地隔离库:上述 2 用例 PASS;goose → 47
```
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- BUG-08 / 发布门禁「TEST_DATABASE_URL 治理 PG」可关闭。
- 下一波:真实 PI 三工作流 E2E(RUNNER_AUTH_TOKEN + 非 stub)。
@@ -0,0 +1,80 @@
# Demo / 测试数据污染整改 测试报告
## 一、 测试背景 (Background)
空项目展示伪造「终审已生效」文档与三级职责人;根因为前端 demo seed + goose 演示项目 + stub 可请求,非 docgov 隔离失败。
## 二、 测试目标 (Test Objectives)
- 默认生产构建无演示文案特征串
- 权威空服务端清单回收本地 demo-seed 交付物
- main/prod 拒绝 stub backend
- ID 判定覆盖 neuropulse / ten-projects
## 三、 测试方案与环境 (Test Plan & Environment)
- OS: Linux;Web: Vite 生产构建(`VITE_ENABLE_DEMO_SEEDS` 未设置)
- 层级:单元(vitest / go test)+ 产物扫描;共享环境 migrate 留合入槽位冒烟
## 四、 预期结果 (Expected Results)
- `check-prod-bundle.sh` → PASS
- `mergeWorkflowDocumentsFromServer([], …)` drop `doc-001` / neuropulse / `doc-proj6001-*`,保留 `doc-p1-*`
- `ResolveBackendInEnv("stub", …, "main")` → error
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 用例 1:产物扫描
- **输入**: `bash scripts/check-prod-bundle.sh`
- **实际输出**: `PASS: prod bundle scan (.../web/dist)`
- **判定**: PASS
- **耗时**: ~11s(含 rebuild)
### 用例 2:deliverableSync 空清单回收 + demoSeedIds(node:test)
- **输入**: `cd web && npm test`(仓库门禁;含 `demoSeedIds.test.ts` 经 tsx/node:test)
- **实际输出**: `tests 374 / pass 374` + vitest `Test Files 3 passed / Tests 32 passed`
- **判定**: PASS
- **耗时**: ~1.8s
### 用例 3:stub 环境门控
- **输入**: `go test ./internal/taskrun/ -count=1`
- **实际输出**: `ok chat-agent-system/internal/taskrun`
- **判定**: PASS(含 `TestResolveBackendInEnv_RejectsStubInMain`)
### 用例 4:demo 会话列表过滤
- **输入**: `go test ./internal/ctxmgr/ -count=1 -run ListChatSessions_SkipsDemoRetired`
- **实际输出**: `ok`
- **判定**: PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
```text
cd web && npm test → 374 PASS (tsx) + 32 PASS (vitest)
go test ./internal/taskrun → PASS
go test ./internal/ctxmgr -run ListChatSessions_SkipsDemoRetired → PASS
scripts/check-prod-bundle.sh → PASS
```
全量 `go test -short ./...` / 共享环境 migrate 留合入集成槽位执行。
### 用例 5:合入槽位冒烟(dev)
- **输入**: `go vet ./...`;`go test -short ./...`;`cd web && npm test`;`check-prod-bundle.sh`;`env-service.sh dev rebuild`;migrate 至 47;API 抽检
- **实际输出**:
- health `schema_version=47`,`agent_backend=pi-agent`
- projects 列表 demo 6001–6010 = 0
- chat sessions 无 `sess-wangjing*` / project 6001–6010
- 新建项目 **6357** `GET .../documents` → `docs 0`
- DB:`demo_sessions_active=0`
- **判定**: PASS
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- Wave 0–5 + 审核 P0/P1 已合入本地 `dev`;`DEMO-DB-SEED` → **PASS**。
- 注:dev 在扩展 00046 前已应用仅项目退休的 00046,故会话退休以幂等 **00047** 落地;00046 文件仍含 sessions 以利全新库一次到位。
- Demo 评审启用:`VITE_ENABLE_DEMO_SEEDS=true`。
- P2 follow-up 见 remediation 文末。
@@ -0,0 +1,110 @@
# FAV U7 增量(publisher stub)测试报告
## 一、 测试背景 (Background)
P7 Final Artifact Vault 禁止整支 merge `feature/final-artifact-vault`。相对当前 `dev`,FAV 旁支的 `internal/artifactvault/*` 多数文件已大幅分叉(dataset Candidate backfill vs TerminalRow),强行 cherry-pick 会引入不可控冲突。本切片改为 **U7 增量 stub**:配置门闩、HTTP status、events 订阅桩与 CLI stub,全部默认关闭。
## 二、 测试目标 (Test Objectives)
- `FAV_DEGRADED_READ` 默认 false(config + docquery + vault GET)
- `FAV_PUBLISHER_ENABLED` 默认 false;进程内 Drain 不启动
- fav durable consumer 保持 mode=off;`Registry.Register(fav)` fail-closed
- `cmd/artifact-vault` 可编译;仅 `status|version`,无破坏性操作
- 产出 go/no-go:**subscriber 保持 OFF,直至单独审批**
## 三、 测试方案与环境 (Test Plan & Environment)
| 项 | 值 |
|----|----|
| OS | Linux |
| Go | 本机 `go test` / `go vet` |
| 分支 | `feature/fav-u7-publisher`(自 `dev@ebe177e`) |
| 层级 | 单元测试 + CLI 冒烟(无 stub 冒充真实 PI) |
| 证据 | `.doc/test-reports/assets/2026-09-16-fav-u7-incremental/unit-tests.txt` |
核心用例矩阵:
| ID | 用例 | 期望 |
|----|------|------|
| C1 | config 默认 | degraded/publisher false |
| C2 | vault init/start | publisher nil / not running |
| C3 | GET vault/status | consumer_mode=off |
| C4 | fav EventConsumer 零值 | HandleLease → ErrDisabledConsumer |
| C5 | events Registry | Register(fav) 失败;LiveConsumers 不含 fav |
| C6 | docquery | FavDegradedReadEnabled() false |
| C7 | artifact-vault status | 打印 remaining_to_port;无 backfill |
## 四、 预期结果 (Expected Results)
- 所有默认路径 FAIL-CLOSED:不写 vault blob、不 claim fav lease、不启用 degraded GET
- 显式 `FAV_*=true` 仅打开配置位;durable Register 仍被 events 硬门拒绝
- go/no-go 结论:**NO-GO for enabling fav subscriber**
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### C1–C3 config / vault
- **测试输入**:`config.Load("/dev/null")`;`Server{cfg}.initArtifactVault/startVaultPublisher`;`GET /api/v1/vault/status`
- **实际输出**:见 assets `unit-tests.txt` — `TestFAVFlagsDefaultOff` / `TestVaultDefaultsStayDisabled` / `TestVaultStatusReportsOff` PASS
- **评价判定**:PASS
- **耗时**:<10ms
### C4 fav subscriber stub
- **测试输入**:零值 `EventConsumer`;`Enabled=true` 仍调用 HandleLease
- **实际输出**:均 `events: consumer is disabled`;`Register(fav)` 失败
- **评价判定**:PASS
### C5–C6 events / docquery
- **测试输入**:既有 `TestAssertLiveConsumersRejectsFAV`、`TestLiveConsumersOmitsFAV`、`TestFavDegradedReadDefaultOff`
- **实际输出**:PASS(PG claim 负例缺 `TEST_DATABASE_URL` 时 SKIP,与既有约定一致)
- **评价判定**:PASS
### C7 CLI stub
- **测试输入**:`go build ./cmd/artifact-vault && artifact-vault status`
- **实际输出**:JSON 含 `consumer_mode=off`、`degraded_read=false`、`remaining_to_port` 列表
- **评价判定**:PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
```text
ok internal/config (FAV flags + ValidateIndependentVault)
ok internal/app/fav (subscriber defaults off)
ok internal/server (vault stub defaults off)
ok internal/events (FAV register/live omit)
ok internal/docquery (FavDegradedRead default off)
go vet PASS on touched packages
```
完整控制台:`assets/2026-09-16-fav-u7-incremental/unit-tests.txt`
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
### Go / No-Go
| 决策点 | 结论 |
|--------|------|
| 合入本 stub 分支到 `dev`(另占集成槽) | **条件 GO**(默认 off,可审) |
| 启用 fav durable subscriber / `Register(fav)` | **NO-GO** — 需单独审批 |
| 启用 `FAV_DEGRADED_READ` | **NO-GO** — 默认 false,未做 M2 负例放行 |
| 启用 `FAV_PUBLISHER_ENABLED` 生产 Drain | **NO-GO** — 缺 ingest hooks 与完整 CAS 接线审计 |
| 整支 merge `feature/final-artifact-vault` | **NO-GO**(红线) |
### 仍待从 FAV 旁支手工移植(冲突重,本切片未搬)
1. `enumerate.go`(`EnumerateTerminals` / `LoadExclusions`)
2. `TerminalRow` + `Backfill(rows)`(与现 dataset `Candidate` 路径分叉)
3. 完整 `recover-plan` / `recover-apply` / `gc-preflight` / `destroy` CLI
4. `server` ingest hooks(`OnFinalArtifact*`)
5. durable fav `Register` + live cutover(需审批解锁 events 硬门)
### 本切片交付物
- `internal/config`:`FAV_*` / `VAULT_*` + `ValidateIndependentVault`
- `internal/server/vault.go`:status HTTP + gated publisher
- `internal/app/fav`:subscriber stub(默认 off)
- `cmd/artifact-vault`:status stub
- compose:`FAV_DEGRADED_READ` / `FAV_PUBLISHER_ENABLED` 钉死 false(main 硬编码)
- **未** merge 到 `dev`
@@ -0,0 +1,59 @@
# 前端版本冲突刷新与终止 preview(发布门禁 B4)测试报告
## 一、 测试背景 (Background)
发布门禁要求人工抽检:版本冲突后刷新再确认、终止 preview 可用。抽检中发现 HTTP 信封将领域码嵌套进 `error` JSON 字符串,前端若只读信封 `VERSION_CONFLICT` 会错过 `PLAN_FROZEN` / `ERR_CONCURRENT_SWITCH` 恢复路径。
## 二、 测试目标 (Test Objectives)
- 过期 `expected_selection_version` → 409 + 业务码 `ERR_CONCURRENT_SWITCH` → 恢复 `retry_after_switch`
- 激活后改规划 → 409 + `PLAN_FROZEN` → `refresh_and_freeze`
- `GET …/termination-preview` 返回 `can_terminate` 等字段
- 单元:信封嵌套解包;设置页冲突后 reload settings
## 三、 测试方案与环境 (Test Plan & Environment)
- live API:dev `:8080`,项目 `6363`
- 单测:`npx tsx --test src/api/projectSettingsError.test.ts`
- 代码:`web/src/api/projectSettingsError.ts`、`ProjectSettingsModal.tsx`
## 四、 预期结果 (Expected Results)
各用例 PASS;`npm test` 全绿。
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 用例 1:版本冲突 409
- **输入**: SavePlan 后以 `expected_selection_version=999` 再 PUT
- **实际输出**: HTTP 409;嵌套业务码 `ERR_CONCURRENT_SWITCH`;recovery=`retry_after_switch`
- **判定**: PASS([live.json](./assets/2026-09-16-frontend-gate-b4/live.json))
### 用例 2:终止 preview
- **输入**: 激活实例后 `GET /api/v1/workflow-instances/{id}/termination-preview`
- **实际输出**: 200;keys 含 `can_terminate` / `pending_documents` / `in_progress_task_runs` / `impact`
- **判定**: PASS
### 用例 3:激活后冻结刷新
- **输入**: 激活后 PUT 旧 revision
- **实际输出**: 409;业务码 `PLAN_FROZEN`;recovery=`refresh_and_freeze`
- **判定**: PASS
### 用例 4:错误解包单测
- **输入**: projectSettingsError.test.ts(含信封嵌套用例)
- **实际输出**: 7 pass([projectSettingsError-unit.txt](./assets/2026-09-16-frontend-gate-b4/projectSettingsError-unit.txt))
- **判定**: PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
```text
cd web && npm test → 376 pass (tsx) + 32 pass (vitest) EXIT 0
```
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- 发布门禁「前端:版本冲突刷新、终止 preview」可 ☑。
- 后续可将信封解包复用到其他 409 消费方,避免只认 `VERSION_CONFLICT`。
@@ -0,0 +1,50 @@
# IAM 全路由 inventory 与 fail-closed 测试报告
## 一、 测试背景 (Background)
PU3 遗留:authorization-matrix-v2 仅抽样;需全路由 inventory、session 中断负例、410 策略冻结、R13 清单,以关闭 FEATURE-MATRIX IAM `partial`。
## 二、 测试目标 (Test Objectives)
- 枚举全部 `mux.HandleFunc` 路由
- session 中断 fail-closed 单测
- BUG-11 410 策略文档冻结
- R13 checklist 落盘
## 三、 测试方案与环境 (Test Plan & Environment)
- Go unit:`go test ./internal/auth/ -count=1`
- 静态:从 `internal/server` 生成矩阵
## 四、 预期结果 (Expected Results)
- inventory ≥100 路由
- `TestAuthStore_SessionInterruptFailClosed` PASS
- 文档齐备
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### Inventory
- Input: grep HandleFunc
- Actual Output: `.doc/audit/authorization-matrix-v3-full.md` **133** routes
- Verdict: PASS
### Session interrupt
- Input: `go test ./internal/auth/ -run SessionInterrupt -count=1`
- Actual: 见下方套件
- Verdict: PASS
### 410 / R13
- Actual: `2026-09-16-bug11-410-retire-decision.md` + `2026-09-16-r13-data-safety-checklist.md`
- Verdict: PASS
## 六、 自动化测试套件汇总 (Test Suite Execution)
见 commit 前本地 `go test ./internal/auth/ -count=1` 输出。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
IAM 行可升 `done`。后续可按路由表补逐条 handler 负例指针细化,不挡关闭。
@@ -0,0 +1,106 @@
# Playwright intent-plan 双标签验收 测试报告
## 一、 测试背景 (Background)
Wave2 / U6 仅留下 `web/e2e/intent-plan-cards.spec.ts` 门控骨架(无 `RUN_UI_ACCEPTANCE` 则 skip;有则仅 body visible)。Conversation-intent 双标签证据(项目 6275)不等于 intent-plan `PLAN_CONFIRM` 双标签。本轮关闭 long-term [2026-09-16-intent-plan-playwright-dual-tab](../ops/long-term/2026-09-16-intent-plan-playwright-dual-tab.md),且**不升** `MULTI_INTENT_PLAN_TIER`。
## 二、 测试目标 (Test Objectives)
1. `RUN_UI_ACCEPTANCE` 未设置时 Playwright **SKIP**(不得冒充 PASS)
2. `RUN_UI_ACCEPTANCE=1` 真浏览器:双标签同时点「确认执行」→ 仅一侧 HTTP 200,另一侧 409;败方卡片 `outdated`,不得本地双成功
3. 刷新 / 重登后卡片与 PG / `GET /intent-plans/active` 状态一致
4. 顺带修复空 `docAST` 登录页崩溃(demo seed 关闭时)
## 三、 测试方案与环境 (Test Plan & Environment)
| 项 | 值 |
|----|-----|
| OS | Linux 7.0.0-31-generic |
| 前端 | Vite `http://127.0.0.1:3101`(worktree 含水合改动;proxy → `:8080` API) |
| API / PG | `shuimu-agent-app-dev` `:8080`;`shuimu-context-pg-dev` schema 47 |
| 浏览器 | `mcr.microsoft.com/playwright:v1.63.0-noble --network host`(宿主机缺 libatk) |
| 分支 | `feature/intent-plan-cards-playwright` |
| 种子 | SQL 写入 `awaiting_confirmation` + `validated_only`(保持 legacy tier) |
| 产物 | `.doc/test-reports/assets/2026-09-16-intent-plan-playwright-dual-tab/` |
### 用例矩阵
| 用例 | 层级 | 期望 |
|------|------|------|
| 无 `RUN_UI_ACCEPTANCE` | Playwright | SKIP |
| 双标签 confirm | UI + HTTP + PG | 1×200 + 1×409;败方 outdated |
| 刷新 / 重登 | UI + GET active | 与 PG `executing` 一致 |
## 四、 预期结果 (Expected Results)
- Tab A/B 均水合同一 `PLAN_CONFIRM`(`data-testid=plan-confirm-card`)
- 并发 confirm:唯一 nonce → CAS 一胜一负;败方 `PLAN_STALE_REVISION` 且 UI `outdated`
- 胜方 / 刷新 / 重登:`data-card-status` 为 `executing|resolved`,不可再以 active 确认
- PG `intent_plans.status=executing`,`revision>=2`
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
### 用例 1:门控 SKIP
- **测试输入 (Input)**:`npx playwright test e2e/intent-plan-cards.spec.ts --project=chromium`(不设 `RUN_UI_ACCEPTANCE`)
- **实际输出 (Actual Output)**:
```text
1 skipped
```
- **评价判定 (Evaluation / Verdict)**:**PASS**(SKIP,非冒充 PASS)
- **性能与耗时 (Duration & Latency)**:&lt;1s
### 用例 2:双标签 confirm + 刷新/重登
- **测试输入 (Input)**:
```bash
# Vite(含水合):3101 → API :8080
RUN_UI_ACCEPTANCE=1 BASE_URL=http://127.0.0.1:3101 \
ADMIN_USERNAME=… ADMIN_PASSWORD=… \
UI_ACCEPTANCE_ASSETS_DIR=…/assets/2026-09-16-intent-plan-playwright-dual-tab \
INTENT_PLAN_PG_DOCKER=shuimu-context-pg-dev \
docker run --rm --network host -v <worktree>:/work \
-v /var/run/docker.sock:/var/run/docker.sock \
mcr.microsoft.com/playwright:v1.63.0-noble \
bash -lc 'cd /work/web && npx playwright test e2e/intent-plan-cards.spec.ts --project=chromium'
```
- **实际输出 (Actual Output)**(摘自 `assets/.../playwright-docker.txt` + `playwright-network.json`):
```text
✓ dual-tab confirm mutual exclusion + reload/relogin matches PG (6.1s)
1 passed (7.0s)
project=PlanDual-mu49uev8 projectId=6399 session=sess-p6399-u9
planId=pln_e2e_mu49uev8
decisions: tab A HTTP 200 → executing rev=2; tab B HTTP 409 PLAN_STALE_REVISION
pgAfter: status=executing revision=2
```
截图:`screenshots/01-tab-a-awaiting.png` … `06-tab-a-after-relogin.png`
- **评价判定 (Evaluation / Verdict)**:**PASS**
- **性能与耗时 (Duration & Latency)**:约 7s(不含 Vite 冷启动)
## 六、 自动化测试套件汇总 (Test Suite Execution)
```text
# gated skip
npx playwright test e2e/intent-plan-cards.spec.ts --project=chromium
→ 1 skipped
# live acceptance
RUN_UI_ACCEPTANCE=1 … playwright (docker host network)
→ 1 passed (7.0s)
```
说明:本任务为 Web UI 门控活验;全仓 `go test -v ./...` 未作为本报告阻断项(未改 Go 业务逻辑)。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- **达到合入/关闭 long-term 标准**:双标签 confirm 互斥 + 刷新/重登与 PG 一致已有真浏览器证据;默认 tier 未升。
- 产品改动:`GET /intent-plans/active` 水合 PLAN_CONFIRM;confirm 使用唯一 `decisionNonce`;空 `docAST` 登录兜底;卡片 `data-testid`/`data-card-status`。
- 建议:合 `dev` 后占槽 smoke;可将本 Docker 命令写入 nightly UI 可选 job;宿主机补齐 Chromium 系统库后可省 Docker 驱动。
@@ -0,0 +1,550 @@
# FEATURE-MATRIX 深度测试与 test 环境晋升 — 详细测试报告
**报告日期**: 2026-09-16
**执行分支**: `feature/matrix-deep-test-promote-test` → 合入 `dev` → 晋升 `test`
**候选 Tag**: `rc-v1.0.0-beta.2`
**证据目录**: [`.doc/test-reports/assets/2026-09-16-matrix-deep-test/`](./assets/2026-09-16-matrix-deep-test/)
**SSOT**: [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) · [CURRENT](../ops/CURRENT.md) · [gap-matrix](../remediation/gap-matrix.md)
---
## 一、 测试背景 (Background)
在 `production_ready=yes` 且三环境 schema 已对齐 47 的前提下,需要证明:
1. FEATURE-MATRIX 中**已实现**模块在当前代码上仍可运行(非仅历史报告);
2. 本地 `dev` 可安全晋升并部署到 `test`(`:8081`),供后续人工/长期实测。
此前发布门禁 B1–B4 已签,但矩阵行多为「历史证据链接」。本轮以分层深度回归补**当日可复现**证据,并完成 `rc-v1.0.0-beta.2` 晋升。
**刻意不做**:完整 28min 三工作流 PI 重跑;Round20 全量 Playwright;纯软件项目自举(`planned`);合入 `main`;改写项目 143。
---
## 二、 测试目标 (Test Objectives)
| # | 目标 | 成功标准 |
|---|------|----------|
| T1 | 门禁基线全绿 | `go vet` / `go test -short` / arch-check / npm / prod-bundle exit 0 |
| T2 | 矩阵模块定向包全绿 | intent/chat/squad/workflow/authz/doc*/agent/events 定向 `ok` |
| T3 | 治理 PG 集成可复现 | 隔离库上 `TestWorkflowGovernance_PG_*` + `TestE2E_WorkflowGovernance_*` PASS |
| T4 | live 关键路径可用 | health、真实闲聊、会话授权、版本冲突、终止 preview、demo 无污染 |
| T5 | 真实 PI runner 可用 | typed-result dual-track 四子测 PASS |
| T6 | test 可更新部署 | `test` 合入 `dev`、tag、rebuild、smoke + 轻量 live PASS,schema=47 |
---
## 三、 测试方案与环境 (Test Plan & Environment)
### 3.1 分层方案
```text
Wave 1 自动化(短测 + 定向 + 隔离治理 PG)
Wave 2 live API(dev :8080,真实 pi-agent)
Wave 3 真实 PI 抽样(runner :18865;FAIL 才升格三链)
Wave 4 晋升 test + rebuild + smoke + live :8081
Wave 5 报告归档 + SSOT 注记修正
```
### 3.2 环境指纹
| 环境 | 端口 | schema | agent_backend | 备注 |
|------|------|--------|---------------|------|
| shared KB | 5432 | — | — | 共享知识库 |
| **dev** | **8080** / events 8088 / pi **18865** | **47** | **pi-agent** | Wave 2/3 |
| **test** | **8081** / events 8089 / pi **18866** | **47** | **pi-agent** | Wave 4 |
| main | 8000 | 47 | pi-agent | 本轮只读对照,不晋升 |
健康探针样例(dev):
```json
{"status":"ok","env":"dev","agent_backend":"pi-agent","schema_version":47,"schema_ready":true,"task_store_ready":true}
```
### 3.3 用例矩阵设计
| 矩阵模块 (mutex) | 验证手段 | 主要资产 |
|------------------|----------|----------|
| intent / intent-plan | short 定向包 | `modules.txt` |
| chat / ctxmgr | short + live 闲聊/window/guest | `modules.txt` + `live-8080.json` |
| squad | short | `modules.txt` |
| workflow | 治理 PG + live SavePlan/冲突/激活/preview | `governance-pg-verbose.txt` + live JSON |
| IAM / authz | live login / guest 403 / members | live JSON |
| docgov / docrevision | short 包(不重跑 Round20 UI) | `modules.txt` |
| web | npm + bundle + live 冲突恢复路径 | `npm.txt` / `bundle.txt` / live |
| pi-agent | short + node result-v1 + live typed-result | `modules.txt` / `pi-sample-typed.txt` |
| infra | health/ready/smoke | `dev-health.json` / `test-env-smoke.txt` |
| CI / E2E | 治理 PG 复跑 | `governance-pg*.txt` |
| events | short E0–E2 相关包 | `modules.txt` |
| 纯软件自举 | — | **N/A(planned)** |
---
## 四、 预期结果 (Expected Results)
| Wave | 预期 |
|------|------|
| W1 | 全部命令 exit 0;治理 PG ≥2 用例 PASS |
| W2 | `live-8080.json` `overall=PASS`;闲聊为真实模型回复;guest=`SESSION_FORBIDDEN`;冲突码=`ERR_CONCURRENT_SWITCH`;`can_terminate=true` |
| W3 | typed-result 四子测 PASS;**不**强制跑三工作流 PI |
| W4 | tag `rc-v1.0.0-beta.2`;`:8081` schema=47;smoke SUCCESS;`live-8081.json` overall=PASS |
| 矩阵 | 已实现行全部 PASS 或 N/A;无 FAIL 阻挡晋升 |
---
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
> 每个典型用例固定四段:**测试输入 → 系统输出 → 分析 → 评价判定**。耗时一并给出。
---
### 5.1 Wave 1 — 门禁基线与模块定向
#### 用例 W1-01:`go vet ./...`
- **测试输入 (Input)**
```bash
env -u TEST_DATABASE_URL -u DATA_DIR go vet ./...
```
- **系统输出 (Actual Output)**
- 无诊断输出;`vet_exit=0`(见 `vet.txt`)
- **分析 (Analysis)**
- 清空 `TEST_DATABASE_URL`/`DATA_DIR` 避免上一轮 PI 隔离库与工作区路径污染编译/静态检查上下文。
- 无 vet 告警说明当前合入点类型与可疑构造检查通过。
- **评价判定 (Evaluation)**:**PASS**
- **耗时**:秒级
#### 用例 W1-02:`go test -short ./...`
- **测试输入 (Input)**
```bash
env -u TEST_DATABASE_URL -u DATA_DIR -u KB_DB_PORT go test -short ./...
```
- **系统输出 (Actual Output)**(摘自 `short.txt` 尾部)
```text
ok chat-agent-system/internal/server 10.668s
ok chat-agent-system/internal/squad (cached)
...
short_exit=0
```
- **分析 (Analysis)**
- 全仓 short 回归覆盖业务主路径单元/httptest 层。
- `internal/server` ~10.7s 为最重包之一,仍在可接受范围内。
- 历史踩坑:保留 `TEST_DATABASE_URL` 时,resume 类 PG 用例会误连隔离库并因缺用户 FK 失败;本轮强制 unset 后稳定。
- **评价判定**:**PASS**
- **耗时**:约 92s(全量 short 墙钟)
#### 用例 W1-03:架构边界门禁
- **测试输入 (Input)**
```bash
./scripts/arch-check.sh --mode block
```
- **系统输出 (Actual Output)**(`arch-check.txt`)
```text
arch-check mode=block
boundaries=.../module-boundaries.yaml
ok chat-agent-system/internal/archtest 0.138s
arch-check block: production gate passed
arch_exit=0
```
- **分析 (Analysis)**
- block 模式失败即阻断晋升;本轮模块边界契约未回退。
- **评价判定**:**PASS**
#### 用例 W1-04:前端 `npm test` + 生产包扫描
- **测试输入 (Input)**
```bash
cd web && npm test
./scripts/check-prod-bundle.sh
```
- **系统输出 (Actual Output)**
```text
ℹ tests 376
ℹ pass 376
ℹ fail 0
Test Files 3 passed (3) # vitest
Tests 32 passed (32)
✓ built in 7.44s
PASS: prod bundle scan (.../web/dist)
npm_exit=0 / bundle_exit=0
```
- **分析 (Analysis)**
- tsx node:test 与 vitest 双轨均绿。
- prod bundle 扫描确认 demo seeds 默认关闭(与 `DEMO-WEB-SEEDS` 门禁一致)。
- **评价判定**:**PASS**
- **耗时**:npm ~0.8s + build ~7.4s
#### 用例 W1-05:FEATURE-MATRIX 模块定向包
- **测试输入 (Input)**
按模块分组执行(见 `modules.txt`),例如:
```bash
go test -short -count=1 ./internal/intent ./internal/coordinator \
./internal/app/intentflow ./internal/app ./internal/events ./internal/server \
-run 'TestSplitPlan|TestPlanProposal|...|IntentPlan|TestIntentRecognition|...'
go test -short -count=1 ./internal/ctxmgr ./internal/app/chatflow ./internal/chat
go test -short -count=1 ./internal/squad/...
go test -short -count=1 ./internal/projectinstance ./internal/workflowdef \
./internal/auth ./internal/authz ./internal/docgov ./internal/docrevision
go test -short -count=1 ./internal/agent
node --test deploy/pi-agent/result-v1.test.mjs
go test -short -count=1 ./internal/events ./internal/app/docnotify \
./internal/app/docadvance ./internal/app/docproject ./internal/app/docflow
```
- **系统输出 (Actual Output)**(摘要)
| 分组 | 结果 |
|------|------|
| intent/intent-plan | 6 包 ok,`intent_exit=0` |
| chat | 3 包 ok,`chat_exit=0` |
| squad | ok,`squad_exit=0` |
| workflow/authz/doc* | 6 包 ok,`waf_exit=0` |
| pi-agent Go | ok 3.459s |
| pi-agent node result-v1 | **3 pass / 0 fail** |
| events E0–E2 | 5 包 ok,`events_exit=0` |
- **分析 (Analysis)**
- 定向包把 FEATURE-MATRIX 行映射到可执行命令,避免「只引用旧报告」。
- docrevision 本轮仅 short;完整 UI Round20 不在范围,但短测未暴露回归。
- **评价判定**:**PASS**
#### 用例 W1-06:治理 PG 集成(BUG-08 复跑)
- **测试输入 (Input)**
```bash
# 隔离库(禁止 agent_system_dev/test/main)
CREATE DATABASE agent_gov_matrix;
export TEST_DATABASE_URL='postgres://app:***@127.0.0.1:5434/agent_gov_matrix?sslmode=disable'
go test ./internal/server/ -run 'TestWorkflowGovernance_PG_|TestE2E_WorkflowGovernance' \
-timeout 20m -count=1 -v
```
- **系统输出 (Actual Output)**(`governance-pg-verbose.txt`)
```text
=== RUN TestE2E_WorkflowGovernance_CompleteAndReplan
goose: no migrations to run. current version: 47
--- PASS: TestE2E_WorkflowGovernance_CompleteAndReplan (0.31s)
=== RUN TestWorkflowGovernance_PG_ActivateApproveAdvanceChain
--- PASS: TestWorkflowGovernance_PG_ActivateApproveAdvanceChain (0.35s)
PASS
ok chat-agent-system/internal/server 0.663s
```
- **分析 (Analysis)**
- 迁移链停在 **47**,与共享环境一致。
- KB DSN 空配置触发离线降级日志,**不构成失败**(治理链路不依赖共享 KB)。
- 覆盖「完成再规划」与「激活→批准→推进」两条治理主链。
- **评价判定**:**PASS**
- **耗时**:约 0.66s(库已迁完后复跑)
---
### 5.2 Wave 2 — live API 抽检(dev `:8080`)
**会话元数据**:项目 **6367** / `sess-p6367-u11` / `overall=PASS`(完整 JSON:[`live-8080.json`](./assets/2026-09-16-matrix-deep-test/live-8080.json))
#### 用例 W2-01:健康与后端真实性
- **测试输入**
`GET /api/v1/health`、`GET /api/v1/ready`
- **系统输出**
```json
{"status":"ok","env":"dev","agent_backend":"pi-agent","schema_version":47,"schema_ready":true,"task_store_ready":true}
```
- **分析**
- `agent_backend=pi-agent` 排除 stub 冒充验收。
- schema 47 与 goose 最新迁移一致。
- **评价判定**:**PASS**(6ms)
#### 用例 W2-02:登录与账号可用性
- **测试输入**
尝试 `zhanggong/123456` → 失败后改用 `lizhuguan`(owner)、`wangzong`(reviewer)、`admin`(approver)、`guest`
- **系统输出**
- `zhanggong`:**403**「账号已被停用,禁止登录」
- 有效账号:owner_id=11,reviewer_id=12,approver_id=9,guest_id=13
- **分析**
- 停用账号 fail-closed,符合 IAM 预期。
- 活验账号切换已写入证据 note,避免误用历史脚本默认用户。
- **评价判定**:**PASS**(账号策略正确;替代账号可用)
#### 用例 W2-03:Demo 污染防护(项目列表)
- **测试输入**
`GET /api/v1/projects`(Bearer owner)
- **系统输出**
- http=200;列表 count=7;`polluted=[]`(无 id 6001–6010)
- **分析**
- 与 goose 00046/00047 `demo_retired` + 列表过滤一致;演示十项目未回流列表。
- **评价判定**:**PASS**
#### 用例 W2-04:新建项目与交付物洁净
- **测试输入**
```http
POST /api/v1/projects
{"name":"矩阵深度抽检-051808","code":"mtx-051808",
"device_type":"超声软组织手术吸引设备",...}
GET /api/v1/projects/6367/documents
```
- **系统输出**
- 创建:**201**,`project_id=6367`
- 文档:http=200,`doc_count=0`,`mock_ids=[]`
- **分析**
- 新建项目无 mock/seed 交付物污染(`DEMO-WEB-SEEDS`/`DEMO-DB-SEED` 防线仍有效)。
- **评价判定**:**PASS**(create 20ms)
#### 用例 W2-05:真实 PI 闲聊
- **测试输入**
```http
POST /api/v1/chat
session_id=sess-p6367-u11
message=先记录一下:本项目是超声软组织吸引设备立项摸底,请用一两句话确认你已记住设备类型
```
- **系统输出**
- http=**200**,耗时 **8101ms**
- 回复摘录:
> 好的,已记住——本项目是**超声软组织吸引设备**(即超声软组织手术吸引设备)的立项摸底。…
- **分析**
- 延迟与语义均符合真实 MiniMax 链路,非 stub 瞬时模板。
- 设备类型被正确回指,满足「记忆确认」意图抽检。
- **评价判定**:**PASS**
#### 用例 W2-06:刷新窗口与分类一致性
- **测试输入**
`GET /api/v1/chat/messages/window?session_id=sess-p6367-u11&days=7`
`GET /api/v1/chat/categories?session_id=...`
- **系统输出**
- window http=200,`window_msgs=2`
- categories http=200
- **分析**
- 一轮 user+assistant 后窗口至少 2 条,符合刷新可读预期(CHAT-HISTORY-REFRESH 相关契约)。
- **评价判定**:**PASS**(3ms)
#### 用例 W2-07:双用户负例(guest)
- **测试输入**
guest token 读取同一 `session_id` 的 window
- **系统输出**
- http=**403**,`error_code=SESSION_FORBIDDEN`
- **分析**
- 非会话 owner fail-closed;跨用户不可枚举他人对话。
- **评价判定**:**PASS**
#### 用例 W2-08:工作流规划保存
- **测试输入**
拉取 `workflow-plan/default?workflow_key=main` → 填充三权职责 →
`PUT .../workflow-plan`(`expected_plan_revision=0`,`expected_selection_version=1`)
- **系统输出**
- http=**200**;`lifecycle_status=planning`;`workflow_plan_revision=1`
- **分析**
- 成员已 upsert 后 SavePlan 成功(避免历史 `DUTY_ASSIGNEE_NOT_ACTIVE_MEMBER`)。
- **评价判定**:**PASS**(5ms)
#### 用例 W2-09:版本冲突(乐观锁)
- **测试输入**
使用正确 `plan_revision`,但 `expected_selection_version=999` 再次 PUT
- **系统输出**
- http=**409**
- 嵌套业务码:`ERR_CONCURRENT_SWITCH`(HTTP 信封外层可为 `VERSION_CONFLICT`)
- **分析**
- 前端已能解包嵌套业务码并映射 `retry_after_switch`;本用例验证后端冲突契约仍在。
- **评价判定**:**PASS**(1ms)
#### 用例 W2-10:激活 + 终止 preview
- **测试输入**
`POST .../activation-preview` → `POST .../workflow-instances/activate` →
`GET /api/v1/workflow-instances/{id}/termination-preview`
- **系统输出**
- activate http=**200**
- preview http=**200**;`instance_id=262`;`can_terminate=true`
- keys: `pending_documents`, `in_progress_task_runs`, `can_terminate`, `impact`
- **分析**
- 激活后实例可查询终止影响面,满足治理「先 preview 再终止」门禁。
- **评价判定**:**PASS**
**Wave 2 总评**:**PASS**(12/12 子用例)
---
### 5.3 Wave 3 — 真实 PI 抽样
#### 用例 W3-01:`TestPiAgentTypedResult_LiveDualTrack`
- **测试输入**
```bash
RUN_PI_E2E=1 \
PI_AGENT_RUNNER_URL=http://127.0.0.1:18865 \
PI_AGENT_RUNNER_AUTH_TOKEN=<from container> \
DATA_DIR=.../data/dev \
go test ./internal/agent -run TestPiAgentTypedResult_LiveDualTrack -timeout 15m -v -count=1
```
Runner 健康(`pi-runner-dev-health.json`):
`ok=true`,`model_id=MiniMax-M2.7-highspeed`,`has_token=true`
- **系统输出**(`pi-sample-typed.txt`)
```text
--- PASS: TestPiAgentTypedResult_LiveDualTrack (3.28s)
--- PASS: .../failure_empty_prompt (0.00s)
--- PASS: .../timeout (0.00s)
--- PASS: .../cancel (0.30s)
--- PASS: .../success (2.97s)
pi_sample_exit=0
```
- **分析**
- 覆盖成功路径与失败/超时/取消,证明 runner 鉴权、typed-result 编解码与取消语义可用。
- 抽样已 PASS,按计划**不升格**完整三工作流 PI E2E(节约 ~28min,风险可控)。
- **评价判定**:**PASS**
- **耗时**:3.28s
---
### 5.4 Wave 4 — 晋升并部署 test
#### 用例 W4-01:Git 晋升与 Tag
- **测试输入**
1. 首次执行 `./scripts/git-workflow-helper.sh promote-to-test rc-v1.0.0-beta.2`
2. 因 `git pull --rebase origin test` 触发大规模 rebase 冲突 → `git rebase --abort`
3. 改为:`git checkout test && git merge --no-ff dev` + `git tag -a rc-v1.0.0-beta.2`
- **系统输出**
- Tag 存在:`rc-v1.0.0-beta.2`
- `test` 先端含 promote merge + 后续 closeout sync
- **分析**
- 本地 `test` 与 `origin/test` 分叉时,rebase 会重放数百提交,属**工具风险**而非产品缺陷。
- 已加固 `scripts/git-workflow-helper.sh`:本地晋升默认不再 `pull --rebase origin test`。
- **评价判定**:**PASS**(晋升目标达成;工具缺陷已修)
#### 用例 W4-02:test 容器 rebuild / 健康
- **测试输入**
```bash
./scripts/env-service.sh test rebuild
# 中间误用 compose 导致 PG 端口绑到 5433 冲突后,改用 env-service start 恢复
curl -sf http://127.0.0.1:8081/api/v1/health
curl -sf http://127.0.0.1:8081/api/v1/ready
curl -sf http://127.0.0.1:8089/health
curl -sf http://127.0.0.1:18866/health
```
- **系统输出**
- health/ready:`env=test`,`schema_version=47`,`agent_backend=pi-agent`
- events:`{"env":"test","owner":"events-1","status":"ok"}`
- pi-agent:`ok=true`,model `MiniMax-M2.7-highspeed`
- **分析**
- `.env` 中 `SYSTEM_DB_PUBLISH_PORT=5433` 会被裸 `docker compose` 覆盖 test 默认 5434;**必须**走 `env-service.sh test *`。
- schema 与 dev 对齐 47,具备同构实测条件。
- **评价判定**:**PASS**
#### 用例 W4-03:`test-env-smoke.sh`
- **测试输入**
`./scripts/test-env-smoke.sh`(默认 `:8081` + pi `:18866`)
- **系统输出**(`test-env-smoke.txt`)
```text
[PASS] test app SPA /
[PASS] test app deep link /projects
[PASS] pi-agent /health
[SUCCESS] test env smoke passed
```
- **分析**
- SPA/深链/runner 冒烟通过,说明前端静态资源与路由回退可用。
- **评价判定**:**PASS**
#### 用例 W4-04:test 轻量 live(隔离库)
- **测试输入**
- test 库初始仅 `admin`;经 SQL 注入 `mtx_owner/reviewer/approver`(复用 admin 密码哈希)
- admin 创建项目(具备 `project:create`)→ 成员 upsert → SavePlan → 冲突 PUT → Activate → termination-preview
- **禁止**读取 `data/dev`
- **系统输出**([`live-8081.json`](./assets/2026-09-16-matrix-deep-test/live-8081.json))
| 步骤 | HTTP / 结果 |
|------|-------------|
| health | schema=47,env=test |
| create_project | **201**,`project_id=3`,code=`tst-052432` |
| save_plan | **200**,`workflow_plan_revision=1` |
| conflict | **409**,`ERR_CONCURRENT_SWITCH` |
| activate | **200**,`lifecycle_status=active`,`active_workflow_key=main`,instance id=1 |
| termination_preview | **200**,`can_terminate=true` |
| **overall** | **PASS** |
- **分析**
- 项目 id=3 说明 test 业务库与 dev(6367)**严格隔离**。
- 冲突/激活/preview 契约与 dev 一致,证明晋升镜像行为正确。
- 副作用:`mtx_*` 为测试账号种子,可保留供后续实测。
- **评价判定**:**PASS**
**Wave 4 总评**:**PASS**
---
### 5.5 FEATURE-MATRIX 行级评价汇总
| 模块 | 状态(矩阵) | 本轮验证 | 评价 |
|------|------------|----------|------|
| 意图识别 L1 | partial | W1 定向 | **PASS(功能可用)**;U9–U12 仍为 backlog |
| 多意图持久计划 | partial | W1 定向 | **PASS(U1–U8 短测)**;schema 注记已改为 47 |
| 对话 / ctxmgr | partial | W1+W2 | **PASS** |
| 智能体小队 | done | W1 | **PASS** |
| 工作流治理 | partial | W1-06+W2+W4 | **PASS** |
| 纯软件项目自举 | planned | — | **N/A** |
| IAM / 鉴权 | partial | W2/W4 | **PASS**(含停用账号与 guest 负例) |
| 文档治理 | done | W1 short | **PASS(短测)**;未重跑 UI Round20 |
| 文档版本与修改认知 | partial | W1 short | **PASS(短测)**;change-report 仍 fallback |
| 前端工作台 | partial | W1 npm + W2 冲突路径 | **PASS** |
| PI Runner | done | W1+W3 | **PASS** |
| 三环境运维 | done | W2/W4 health | **PASS** |
| CI / E2E | partial | W1-06 | **PASS(治理 PG)**;`-race` flake 仍为基建债 |
| 模块解耦与事件 | partial | W1 events | **PASS(短测)** |
---
## 六、 自动化测试套件汇总 (Test Suite Execution)
| 命令 | 结果 | 证据 |
|------|------|------|
| `go vet ./...` | exit 0 | `vet.txt` |
| `go test -short ./...` | exit 0 | `short.txt` |
| `./scripts/arch-check.sh --mode block` | PASS | `arch-check.txt` |
| `cd web && npm test` | 376 + 32 PASS | `npm.txt` |
| `./scripts/check-prod-bundle.sh` | PASS | `bundle.txt` |
| 模块定向套件 | 全组 exit 0 | `modules.txt` |
| 治理 PG(`agent_gov_matrix`) | 2 PASS | `governance-pg-verbose.txt` |
| PI typed-result live | 4/4 PASS | `pi-sample-typed.txt` |
| `./scripts/test-env-smoke.sh` | SUCCESS | `test-env-smoke.txt` |
| live `:8080` / `:8081` | overall PASS | `live-8080.json` / `live-8081.json` |
**通过率(本轮门禁用例)**:Wave 1–4 关键用例 **100% PASS**;矩阵已实现行 **无 FAIL**;planned 行 **N/A**。
---
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
### 7.1 结论
1. **系统可正常运作**:短测、模块定向、治理 PG、dev/test live 与真实 PI 抽样均 PASS。
2. **FEATURE-MATRIX 已实现能力**在本轮证据下可判定为**可用/未回归**;planned 的「纯软件项目自举」不纳入本轮验收。
3. **test 服务端已更新部署**:本地 `test` @ `rc-v1.0.0-beta.2`,`:8081` schema=47,smoke + 轻量 live PASS。
4. **总评价**:**达到晋升与深度回归目标,建议作为当前 test 实测基线。**
### 7.2 风险与后续
| 项 | 说明 | 建议 |
|----|------|------|
| 完整三工作流 PI | 本轮仅抽样 | 夜间 `RUN_PI_E2E=1` 或发版前补跑 |
| Round20 UI | 未重跑 | 文档修订大改动时再跑 Playwright |
| `zhanggong` 停用 | dev 默认脚本用户失效 | 更新活验脚本默认账号 |
| test 缺种子用户 | 仅 admin | 晋升后补 demo/业务用户种子或文档化 SQL 种子步骤 |
| 远端同步 | 未 push | 用户授权后 `./scripts/git-push-dev.sh test` 并推送 tag |
| promote 工具 | 已修默认 rebase | 继续避免对分叉 `test` 做 origin rebase |
### 7.3 关键产物索引
| 文件 | 内容 |
|------|------|
| `assets/.../live-8080.json` | dev 全链路抽检 |
| `assets/.../live-8081.json` | test 晋升后抽检 |
| `assets/.../pi-sample-typed.txt` | 真实 PI 抽样 |
| `assets/.../governance-pg-verbose.txt` | 治理 PG |
| `assets/.../short.txt` / `modules.txt` / `npm.txt` | 自动化基线 |
| `assets/.../test-env-smoke.txt` | test 冒烟 |

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