-
Notifications
You must be signed in to change notification settings - Fork 0
chore(openspec): align ship-cycle merge contract with lifecycle ancestry (#451) #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
bccf251
chore(openspec): align ship-cycle merge contract wording with ancestr…
monkey1sai 3c94d28
chore(openspec): add lifecycle-ledger row for align-ship-cycle-merge-…
monkey1sai 9839d2b
Merge branch 'main' into chore/451-align-ship-merge-ancestry-v2
monkey1sai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
openspec/changes/archive/2026-08-11-align-ship-cycle-merge-ancestry/proposal.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ## Why | ||
|
|
||
| GitHub issue #451 回報 spec 與可執行 workflow 之間的 merge 契約矛盾:`openspec/specs/agent-operability-governance/spec.md`(`Agent SHALL 對每個完成的 work item 走 buffered ship-cycle 自動化` requirement,第 47 行與第 53 行)寫官方 gate 全綠時 SHALL **squash-merge**;但可執行的 `.claude/workflows/ship-item.md`(第 19 行、第 125 行)與 enforcing test `scripts/tests/test-agent-governance-check.ps1`(~875 行)都要求 `gh pr merge ... --merge --match-head-commit <preparedHead>`——即 non-squash merge commit,用以保留 lifecycle `subject_commit` 的 ancestry 可追溯性。三方對照下 spec 是過時、與現況行為不符的一方:workflow 與 enforcing test 互相一致,且 test 直接斷言 ship-item.md 不得含 `--squash --match-head-commit`。 | ||
|
|
||
| 本 change 僅把 spec 的措辭改回與可執行行為一致,不改變任何 runtime / workflow / test 行為。 | ||
|
|
||
| ## What Changes | ||
|
|
||
| - `openspec/specs/agent-operability-governance/spec.md`:修訂 `Agent SHALL 對每個完成的 work item 走 buffered ship-cycle 自動化` requirement 內兩處 `squash-merge` 措辭(requirement 本文一處、`完成 work item 後自動 ship 並守 buffered gate` scenario 一處)為 `merge`(merge commit、non-squash、保留 lifecycle ancestry),其餘措辭(官方 gate all-green 條件、不 merge 過 production 真 P1/P2、不偽裝 CI 綠、buffer cycle 規則)維持不變。 | ||
|
|
||
| ## Non-goals | ||
|
|
||
| - 不修改 `.claude/workflows/ship-item.md`(已正確,是可執行行為權威)。 | ||
| - 不修改 `scripts/tests/test-agent-governance-check.ps1`(enforcing test,已正確;此檔屬 `scripts/lib/self-referential-bootstrap.ps1` 分類的驗證機制路徑,不在本 change 編輯範圍)。 | ||
| - 不修改任何 production runtime 行為;本 change 純粹是 spec 文字對齊,修正 spec 落後於已落地行為的漂移。 | ||
|
|
||
| ## Impact | ||
|
|
||
| - Affected capabilities:`agent-operability-governance`(MODIFIED requirement)。 | ||
| - Affected files:`openspec/specs/agent-operability-governance/spec.md`(經由本 change 的 spec delta 於 archive 時套用)。 | ||
| - Product / runtime / deploy behavior:無。 | ||
| - Git / PR workflow:無新行為;本 change 消除 spec 與既有 ship-cycle 執行/驗證行為之間的文字矛盾。 | ||
19 changes: 19 additions & 0 deletions
19
...8-11-align-ship-cycle-merge-ancestry/specs/agent-operability-governance/spec.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # agent-operability-governance — Spec Delta (align-ship-cycle-merge-ancestry) | ||
|
|
||
| ## MODIFIED Requirements | ||
|
|
||
| ### Requirement: Agent SHALL 對每個完成的 work item 走 buffered ship-cycle 自動化 | ||
|
|
||
| Agent 完成一個可驗證的 work item 後 SHALL 依 `.claude/workflows/ship-item.md` 定義的 ship-cycle 自動 commit → push → 開 PR → 觀測 CI 與 reviewer comment → 在官方 gate(pr-review-agent + CodeRabbit)全綠且當前 head 無新 substantive P1/P2 時 merge(merge commit、non-squash,保留 lifecycle `subject_commit` ancestry)並 closeout。Agent SHALL NOT merge 過 production code 的真 P1/P2,SHALL NOT 偽裝 CI 綠;non-production 產物(evidence/docs scaffolding)的 advisory nit 在官方 gate 全綠時 MAY judgment-merge。 | ||
|
|
||
| #### Scenario: 完成 work item 後自動 ship 並守 buffered gate | ||
|
|
||
| - **WHEN** agent 完成一個 work item 並 commit 到 feature branch | ||
| - **THEN** agent SHALL push、開 PR、`gh pr checks --watch` 等 CI、再留 ~90-120s reviewer buffer | ||
| - **AND** 僅在官方 gate 全綠且當前 head 無新 substantive P1/P2 時 SHALL merge(merge commit、non-squash,保留 lifecycle ancestry)並 closeout | ||
| - **AND** 有新 substantive 發現時 SHALL 修復並對每個 push 重跑 buffer cycle,SHALL NOT 只看 check 狀態就 merge | ||
|
|
||
| #### Scenario: 不 merge 過 production code 真 P1/P2 | ||
|
|
||
| - **WHEN** reviewer 在 CI 變綠後對 production code 貼出新的 P1/P2 | ||
| - **THEN** agent SHALL NOT merge,SHALL 先修復再重跑 ship-cycle |
13 changes: 13 additions & 0 deletions
13
openspec/changes/archive/2026-08-11-align-ship-cycle-merge-ancestry/tasks.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Tasks — align-ship-cycle-merge-ancestry | ||
|
|
||
| ## 1. Spec delta | ||
|
|
||
| - [x] 1.1 於 `openspec/changes/align-ship-cycle-merge-ancestry/specs/agent-operability-governance/spec.md` 寫 `## MODIFIED Requirements`,完整重寫 `Agent SHALL 對每個完成的 work item 走 buffered ship-cycle 自動化` requirement 全文(含兩個既有 Scenario),把兩處 `squash-merge` 改為 `merge`(merge commit、non-squash、保留 lifecycle ancestry),其餘措辭不變。 | ||
| - [x] 1.2 確認未觸碰 `.claude/workflows/ship-item.md`、`scripts/tests/test-agent-governance-check.ps1`、`openspec/changes/archive/` 既有內容。 | ||
|
|
||
| ## 2. 驗證與 archive | ||
|
|
||
| - [x] 2.1 `npx openspec validate align-ship-cycle-merge-ancestry --strict` 通過。 | ||
| - [x] 2.2 `npx openspec archive align-ship-cycle-merge-ancestry` 落地 spec,確認 `openspec/specs/agent-operability-governance/spec.md` 兩處已改為 `merge`、grep 該 requirement 無 `squash-merge` 殘留。 | ||
| - [x] 2.3 更新 `openspec/lifecycle-ledger.json` 新增本 change 的 archived row(欄位形狀比照既有 archived 範例)。 | ||
| - [x] 2.4 跑 `node --test scripts/tests/test-openspec-machine-truth.mjs`、`node --test scripts/tests/test-ai-coding-metrics.mjs`、`scripts/tests/verify-openspec-lifecycle.ps1 -BaseRef origin/main`、`scripts/tests/test-openspec-lifecycle-archive-diff.ps1`、`scripts/tests/test-openspec-ledger-reconciliation.ps1`、`scripts/tests/test-agent-governance-check.ps1`,全綠或誠實回報。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.