Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/agent-governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
fetch-depth: 0

- name: Setup Node.js for PNG recomputation tests
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
Expand All @@ -41,6 +42,10 @@ jobs:
shell: pwsh
run: pwsh -NoProfile -NonInteractive -File scripts/tests/test-agent-governance-check.ps1

- name: Verify OpenSpec lifecycle state
shell: pwsh
run: pwsh -NoProfile -NonInteractive -File scripts/tests/verify-openspec-lifecycle.ps1 -BaseRef '${{ github.event.pull_request.base.sha }}'

- name: Run PR body evidence tests
shell: pwsh
run: pwsh -NoProfile -NonInteractive -File scripts/tests/test-pr-body-evidence.ps1
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/structured-log-schema.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Structured Log Schema — Contract

> **Source of truth** for the cross-service structured log baseline.
> Capability spec: `openspec/specs/cross-service-structured-log-baseline/` (post-archive).
> Capability spec: `openspec/specs/cross-service-structured-log-baseline/`(已同步 canonical;active change 只剩 deferred runtime-evidence closeout)。
> Design rationale: `docs/superpowers/specs/2026-05-26-cross-service-structured-log-baseline-design.md`.
> JSON Schema artifact: `tests/contracts/structured-log/schema.json` (draft-07).

Expand Down
8 changes: 4 additions & 4 deletions docs/plans/AI-BIM 前後端設計文件.dc.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
<span style="font-size:10.5px;color:#e6b23e">現行防護=blocklist(FORBIDDEN_KEYS+USDC magic/長度啟發),可被非黑名單 key 繞過;強化為 allowlist=follow-up metadata-allowlist:planned(class: in-repo-fullstack-pending);鐵律語意不變。</span>
</div>
<div data-canon-id="c4-contract-lineage-publication" style="grid-column:1 / -1;background:#0a1220;border:1px solid rgba(230,178,62,.3);border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:8px">
<div style="display:flex;align-items:center;gap:8px"><span style="font-family:'JetBrains Mono',monospace;font-size:10px;color:#e6b23e">CLOUD API ONLY</span><span style="font-size:12.5px;font-weight:700">lineage-publication · cloud-lineage-publication/v1</span><span style="margin-left:auto;font-family:'JetBrains Mono',monospace;font-size:9px;color:#5a7089">deferred archive · openspec/changes/archive/2026-07-22-rvt-ifc-usdc-lineage/contracts/(--skip-specs、non-canonical)</span></div>
<div style="display:flex;align-items:center;gap:8px"><span style="font-family:'JetBrains Mono',monospace;font-size:10px;color:#e6b23e">CLOUD API ONLY</span><span style="font-size:12.5px;font-weight:700">lineage-publication · cloud-lineage-publication/v1</span><span style="margin-left:auto;font-family:'JetBrains Mono',monospace;font-size:9px;color:#5a7089">frozen deferred · openspec/changes/rvt-ifc-usdc-lineage/contracts/(non-canonical、non-owner)</span></div>
<pre style="margin:0;background:#070d15;border:1px solid rgba(120,160,210,.1);border-radius:8px;padding:12px;font-family:'JetBrains Mono',monospace;font-size:10px;line-height:1.7;color:#8aa0b8;overflow:auto">edge bim-review-coordinator → [external] company-cloud bim-control → cloud MySQL
POST /api/v1/lineage-publications
events: lineage_result_published | lineage_result_health_changed
Expand Down Expand Up @@ -544,7 +544,7 @@
</div>
<div data-canon-id="c6-callback-outbox-lineage-outbox" style="background:#0a1220;border:1px solid rgba(230,178,62,.2);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:5px">
<span style="font-size:12px;font-weight:700;color:#e6b23e">CallbackOutbox / LineagePublicationOutbox</span>
<span style="font-family:'JetBrains Mono',monospace;font-size:9.5px;line-height:1.9;color:#8aa0b8">workflow: conversion_result_ready|conversion_failed · metadata-only · pending→sent|dead-letter <span style="color:#4fd68a">— 已實作</span><br>lineage: lineage_result_published|lineage_result_health_changed · stable event/digest · DISABLED|PENDING|RETRYING|DELIVERED|DEAD_LETTER|CONFLICT <span style="color:#e6b23e">— planned(class: in-repo-fullstack-pending)——coordinator 現況僅 3 態 outbox,六態契約僅保留於 deferred archive openspec/changes/archive/2026-07-22-rvt-ifc-usdc-lineage/(--skip-specs、non-canonical、未實作);若要實作,須以當時 main 現況新開/調和 lineage-outbox-impl change</span><br>兩者contract/ACK分離;cloud delivery不阻擋edge READY/AVAILABLE</span>
<span style="font-family:'JetBrains Mono',monospace;font-size:9.5px;line-height:1.9;color:#8aa0b8">workflow: conversion_result_ready|conversion_failed · metadata-only · pending→sent|dead-letter <span style="color:#4fd68a">— 已實作</span><br>lineage: lineage_result_published|lineage_result_health_changed · stable event/digest · DISABLED|PENDING|RETRYING|DELIVERED|DEAD_LETTER|CONFLICT <span style="color:#e6b23e">— planned(class: in-repo-fullstack-pending)——coordinator 現況僅 3 態 outbox,六態契約保留於 frozen deferred change openspec/changes/rvt-ifc-usdc-lineage/(non-canonical、non-owner、未實作);若要實作,須先依 current main 完成 predecessor/successor crosswalk 並拆成不重疊 slices</span><br>兩者contract/ACK分離;cloud delivery不阻擋edge READY/AVAILABLE</span>
</div>
</div>
<div style="display:flex;flex-wrap:wrap;gap:6px;font-family:'JetBrains Mono',monospace;font-size:10px;color:#8aa0b8">
Expand Down Expand Up @@ -625,7 +625,7 @@
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">A5–A10:僅 Concept 路由 + 概念稿,不做假後端;每一模組落地前先補 governance-service 對應 API 與契約測試</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">變更守則:gitnexus_impact → 修改 → 契約測試綠 → 變更留痕(OpenSpec change 目錄 openspec/changes/&lt;id&gt;/ + PR body 的 AI Coding Governance 表)</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">CH-C 殘留:selectPrimsRequest/composeStageRequest 已於 Window.tsx 實作(fakeKit.ts harness 佐證);commandRejected(spectator / 權威拒絕回饋)仍待補,詳見 §04</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">OpenSpec change align-frontend-design-system-reference 已於 2026-07-22 以 --skip-specs deferred archive;archive 中未完成 tasks/delta 僅為歷史留存、非現行權威。動前端視覺前應依本設計文件、canonical specs 與 manifest;若需補齊雙閘,先以當時 main 現況新開/調和 change。</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">OpenSpec change align-frontend-design-system-reference 已於 2026-07-24 historical correction 恢復為 frozen deferred;未完成 tasks/delta 仍是 non-canonical、non-owner。動前端視覺前應依本設計文件、canonical specs 與 manifest;若需補齊雙閘,須先與 migrate-console-to-hifi-design 完成 requirement/successor crosswalk,不得平行 coding。</span>
</div>
</div>

Expand Down Expand Up @@ -724,7 +724,7 @@
<div style="display:grid;grid-template-columns:28px 1fr;gap:8px;padding:8px 12px;border-top:1px solid rgba(120,160,210,.08)"><span style="font-family:'JetBrains Mono',monospace;color:#e6b23e">4</span><div style="display:flex;flex-direction:column;gap:2px"><span style="font-family:'JetBrains Mono',monospace;font-size:10.5px;color:#dbe6f3">web-viewer-sample/scripts/capture-design-system-reference.mjs</span><span style="font-size:10.5px;color:#8aa0b8"><span style="color:#e6b23e;font-weight:600">唯一</span>受認可的 rebaseline 手段——必須帶 <span style="font-family:'JetBrains Mono',monospace;font-size:10px;color:#b7a9ff">--rebaseline --confirm-rebaseline</span> 兩旗標(單一旗標會被腳本拒絕)。禁止手動覆寫 golden 圖或繞過此腳本「順手」更新基準。</span></div></div>
</div>
<span style="font-size:10.5px;color:#e6b23e;background:rgba(230,178,62,.08);border:1px solid rgba(230,178,62,.25);border-radius:6px;padding:4px 10px">Hi-Fi 驅動的前端改動,「verify」= 讓上面第 2–3 步綠燈,不是自己截圖比對覺得像;沒跑這條鏈就宣稱完成,不滿足 R4 definition of done 的「Playwright E2E 截圖證據」項</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">此驗證鏈的既有工具仍可使用;OpenSpec change <span style="font-family:'JetBrains Mono',monospace;font-size:10px">align-frontend-design-system-reference</span> 已於 2026-07-22 以 --skip-specs deferred archive,archive tasks/delta 是 non-canonical 歷史工件,並非現行 implementation authority。動前端視覺前,AI coding agent 應依本設計文件、canonical specs 與 manifest;不要預設 gate 已全線接通,若需補齊先新開/調和 change。</span>
<span style="font-size:10.5px;color:#8aa0b8;background:rgba(120,160,210,.05);border:1px solid rgba(120,160,210,.16);border-radius:6px;padding:4px 10px">此驗證鏈的既有工具仍可使用;OpenSpec change <span style="font-family:'JetBrains Mono',monospace;font-size:10px">align-frontend-design-system-reference</span> 已於 2026-07-24 historical correction 恢復為 frozen deferred,其 tasks/delta 是 non-canonical、non-owner,並非現行 implementation authority。動前端視覺前,AI coding agent 應依本設計文件、canonical specs 與 manifest;不要預設 gate 已全線接通,若需補齊須先與 migrate-console-to-hifi-design 完成 crosswalk。</span>
</div>

<!-- Task 順序 + 模組真實程度 -->
Expand Down
34 changes: 20 additions & 14 deletions docs/plans/NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

> 文件性質:working note;用於本週工作排序,不是 runtime/API contract 或完成證據。
> **AI / 人:只聽這份。** 與本檔衝突時,以使用者最新口令為準,其次本檔,再才是 OpenSpec / 設計正本。
> 維護規則:每完成一個 outcome 就改狀態;禁止同時推進 >2 個 active OpenSpec product change。
> 維護規則:每完成一個 outcome 就改狀態;禁止同時推進 >6 個 active OpenSpec product change。

## 本週三軌(你已選 1/2/3)

| 序 | 軌 | 目標 | 狀態 |
|---|---|---|---|
| **0** | 治理 WIP(#364) | active ≤2;defer 其餘;採納 throughput 預算 | ✅ #364 MERGED + `governance-throughput-budget` archived |
| **1** | 收口 | 把「code 已 merge、tasks 假開著」的 change archive | **已 archive 7 案**(2026-07-21/22) |
| **0** | 治理 WIP(#364) | active ≤6;defer 其餘;採納 throughput 預算 | ✅ #364 MERGED;2026-07-24 使用者將上限由 2 調整為 6 |
| **1** | 收口 | completed 才 archive;deferred 留在 changes 並 frozen | **4 個近期 completed 維持 archive;4 個 unfinished historical correction 恢復 deferred** |
| **2** | A4 | 只走切片 PR(先 #365,再下一刀) | **#365 + #380 + #382 + #383 + #386 MERGED**;current = S4-B PR #384 final gate,next = S4-C |

**並行規則:** 0 可與 1 同天;**2 與新功能不得再開第 3 條 active product change**。
**並行規則:** 0 可與 1 同天;所有軌與新功能合計不得超過 6 個 active product change;deferred/frozen 不因額度增加自動 thaw。
**本週不做:** A5–A10 全棧、`rvt-ifc-usdc-lineage` 實作、新 OpenSpec(除 archive/defer 註記)、整 repo 重掃。

---
Expand All @@ -21,15 +21,18 @@

| OQ | 題目 | **建議裁決** |
|---|---|---|
| OQ-1 | 收斂後保留哪個 ≤2 大 active | ✅ **已採納**:保留 `a4-semantic-search-model-qa` + `migrate-console-to-hifi-design`;`rvt-ifc-usdc-lineage` 已 deferred archive |
| OQ-1 | 收斂後保留哪個 active | ✅ 2026-07-21 原採納上限 2;2026-07-24 使用者調整為 ≤6。既有 `rvt-ifc-usdc-lineage` 仍為 `Status: deferred`、frozen/non-owner,須另行滿足 thaw 條件 |
| OQ-2 | docs+chore ≤30% | ✅ **已採納**:首月 40% → 次月 30% |
| OQ-3 | #364 自身是第 10 個 active | ✅ **已採納**:#364 merge 後 archive `governance-throughput-budget` |

已完成 deferred archive(與 #364 裁決一致;均以 `--skip-specs` 保留未落地 delta,不同步 canonical specs):
2026-07-24 historical correction:deferred 不再放 completed archive;下列 change 均恢復原 id、保留 `Status: deferred`,未落地 delta 仍不構成 canonical authority:

- `minio-folderview-and-baseline-disclosure` → `2026-07-22-minio-folderview-and-baseline-disclosure`
- `align-frontend-design-system-reference` → `2026-07-22-align-frontend-design-system-reference`(動視覺前再 thaw;本週 A4 切片以 `Full completion claimed: no` 可不綁 full design rebaseline)
- `rvt-ifc-usdc-lineage` → `2026-07-22-rvt-ifc-usdc-lineage`
- `openspec/changes/minio-folderview-and-baseline-disclosure/`(只允許 canonical closeout reconciliation,不重做 #259/#265 code)
- `openspec/changes/align-frontend-design-system-reference/`(與 migrate 的互斥需求完成 crosswalk 前不得 thaw)
- `openspec/changes/rvt-ifc-usdc-lineage/`(1/48;切片與 shared ownership 調和前不得 coding)
- `openspec/changes/cross-service-structured-log-baseline/`(只補 tasks 10.1–10.5 runtime evidence;不重套已同步 delta)

Archive lexical audit 在本次恢復後仍有 44 個歷史目錄、696 個 unchecked checkbox;三層交叉裁決未把它們判為獨立、可繼續執行的 unfinished owner(主要是已落地但 task bookkeeping 過時、已被 successor 承接,或已退役 service 的歷史工作),因此不批次搬移,也不改寫 archive 歷史。這批屬 legacy audit debt;新增 lifecycle gate 只對本次之後的新 archive fail closed,禁止再產生 unchecked/deferred archive。

---

Expand All @@ -43,18 +46,19 @@
| `minio-trigger-lifecycle-backend` | ✅ archived `2026-07-21-minio-trigger-lifecycle-backend` | done | #259 |
| `c-m4-runtime-command-bridge` | ✅ archived `2026-07-21-c-m4-runtime-command-bridge`(新建 capability spec) | done | #309 |
| `minio-watch-key-structure` | ✅ archived `2026-07-21-minio-watch-key-structure`(`--skip-specs`;主線 scenario 已在 main) | 選 A deferred-evidence | #237 |
| `minio-folderview-and-baseline-disclosure` | ✅ deferred archive `2026-07-22-minio-folderview-and-baseline-disclosure`(`--skip-specs`) | 未完成 tasks 保留在 archive,non-canonical | #265 |
| `align-frontend-design-system-reference` | ✅ deferred archive `2026-07-22-align-frontend-design-system-reference`(`--skip-specs`) | 未完成 tasks/delta 保留在 archive,non-canonical | #363 |
| `rvt-ifc-usdc-lineage` | ✅ deferred archive `2026-07-22-rvt-ifc-usdc-lineage`(`--skip-specs`) | 未完成 tasks/6 個 new capability delta 保留在 archive,non-canonical | #354 |
| `cross-service-structured-log-baseline` | ↩ restored deferred、evidence-only | 只補真 4-service runtime evidence;不改 pipeline/code/canonical spec | #126 |
| `minio-folderview-and-baseline-disclosure` | ↩ restored deferred、frozen | 對帳 code/tests/tasks/canonical spec;禁止重做 code | #265 |
| `align-frontend-design-system-reference` | ↩ restored deferred、frozen | 先與 migrate 做 requirement/successor crosswalk;禁止平行 design coding | #363 |
| `rvt-ifc-usdc-lineage` | ↩ restored deferred、frozen(1/48) | 先切片與調和 shared ownership;禁止直接 apply | #354 |

### minio-watch task 5

✅ **選 A 已執行**(2026-07-21):task 5 標 deferred-evidence 後 archive;不擋 A4。

### 收口 DoD(軌 1)

- [x] 7 個 closeout change 進入 `openspec/changes/archive/2026-07-21-*` 或 `2026-07-22-*`
- [x] deferred archive:lineage / minio-folderview / align-frontend(`--skip-specs`;不計 active WIP)
- [x] 4 個近期 completed closeout change 維持 archive;4 個 unfinished change 已於 2026-07-24 從 archive 恢復原 id
- [x] lineage / minio-folderview / align-frontend / structured-log 保留 `Status: deferred`、frozen/non-owner,不計 active WIP
- [x] #364 merge + `governance-throughput-budget` archive(OQ-3 出場)
- [x] 本週 WIP focus 只保留 **A4 + migrate-console**;`implement-runtime-command-authority-and-rejection` 與 `add-single-gpu-session-ai-review-mvp` 的 retain/defer 另案裁決,不在本次 archive 範圍
- [ ] 過期 worktree 刪到 ≤5(人工/下一切可選)
Expand Down Expand Up @@ -178,4 +182,6 @@ Done: 通過 DoD 所列測試;回報 verified / inferences / risks
| 2026-07-21 | 採納建議/A/全做:#365 merge;4 change archive;deferred 三案;S2 成當前 outcome |
| 2026-07-21 | #364 merge;archive governance-throughput-budget;OQ 全落地 |
| 2026-07-22 | 使用者確認 deferred archive:`minio-folderview-and-baseline-disclosure`、`align-frontend-design-system-reference`、`rvt-ifc-usdc-lineage` 均以 `--skip-specs` archive;#380 merged,下一刀改為 S3。 |
| 2026-07-24 | 使用者改採嚴格 terminal rule:archive 僅限 completed/完整 successor;三個 7/22 deferred change 與 structured-log evidence 缺口 historical correction 恢復原 id,維持 frozen/non-owner。 |
| 2026-07-24 | 使用者將 active OpenSpec WIP 上限由 2 調整為 6;新增額度不自動 thaw deferred/frozen change。 |
| 2026-07-23 | #382/#383/#386 merged;#386 先收斂 scoped A4 visible caller compatibility,S4-B coordinator session search proxy、安全 transport、host-kit dual-namespace seam 與 cold-scan timeout regression 由 PR #384 交付(狀態以 GitHub machine truth 為準),S4-C/D 仍 pending。 |
3 changes: 3 additions & 0 deletions openspec/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ OpenSpec 入口:`npx openspec`(list / validate / show / archive / new)。
- MUST 把每個 OpenSpec change 隔離到 `codex/openspec/<change-id>` branch + `.worktrees/<change-id>/` worktree;不得在 `main` 上開發 OpenSpec change。
- MUST 在 active change 寫好後 `npx openspec validate <id> --strict` 通過再開 PR。
- MUST 在 PR merge 後跑 `npx openspec archive <change-id>` 落地 spec;archive 後 active change 目錄消失、`specs/<capability>/spec.md` 出現。
- MUST 將 deferred change 保留在 `openspec/changes/<change-id>/`,並在 `proposal.md` 頂部使用 canonical `Status: deferred <日期>` 標記、理由與重啟條件;deferred 不構成 active capability owner,也不得為了 WIP 計數移入 archive。`--skip-specs` 只會跳過 canonical spec 同步,**不是** deferred state。
- MUST 僅 archive 已完成的 change:所有 task checkbox 均已結案;若原工作由明確、非重疊且已接受的 successor 完整承接,須先把原 checkbox 改成已勾選的 terminal disposition 並記錄 successor,不得留下 unchecked task。delta specs 已同步 canonical specs,或已由 successor 明確 supersede。單純 warning、known gap、使用者確認繼續或 `--skip-specs` 均不得把 unfinished/deferred change 重新分類為 completed。
- MUST 用繁體中文撰寫 proposal / design / tasks / spec;保留 OpenSpec parser 必要標頭(`## ADDED Requirements` / `## MODIFIED Requirements` / `### Requirement:` / `#### Scenario:` 等)為原文。
- MUST NOT 修改 `openspec/changes/archive/` 內任何檔案;歷史 correction 需獨立 PR 並在 PR 描述標示。
- MUST NOT 把 `openspec/AGENTS.md` 或 `openspec/CLAUDE.md` 視為 spec 或 change —— `npx openspec validate` scope 限 `changes/` 與 `specs/` 子目錄。
Expand All @@ -48,6 +50,7 @@ npx openspec validate --all --strict
## Done Criteria

- 改動沒有越過 archive 邊界。
- deferred change 不在 archive;archive 內沒有未被完整 successor 承接的 in-scope 未完成工作。
- `openspec validate --strict` 通過;新 capability 至少含一條 Requirement + 至少一個 Scenario。
- PR 描述附 `openspec validate` 輸出。
- 最終回覆列出 changed files、validation、known risks。
Loading
Loading