Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3942eec
chore(backlog): commit BKL-001 分流定案段 (2026-07-02) as manifest precond…
arcobaleno64 Jul 3, 2026
16e887b
CHG-001 remove: delete zero-consumer STATE_REQUIRED_ARTIFACTS dead co…
arcobaleno64 Jul 3, 2026
f506b23
CHG-002 tighten: upgrade legacy status schema warning to DEPRECATED (…
arcobaleno64 Jul 3, 2026
17c4468
CHG-007 tighten: escalate premortem banned phrases per R-block
arcobaleno64 Jul 3, 2026
85594b1
CHG-008 fix-doc: align workflow-gates.md to HEAD + retract Environmen…
arcobaleno64 Jul 3, 2026
b1d520b
CHG-003 tighten: re-sync drifted twins + bring 5 twin-not-guarded doc…
arcobaleno64 Jul 3, 2026
bc59faa
CHG-004 merge: single-source the RACI table (direction a) and fix drift
arcobaleno64 Jul 3, 2026
9ab1118
CHG-005 fix-bug: RACI_MATRIX_V2 Codex CLI += workflow_contract_docs (…
arcobaleno64 Jul 3, 2026
6db33f8
CHG-006 tighten: wire RACI audit into wrapper post-dispatch (primary)…
arcobaleno64 Jul 3, 2026
b72e420
CHG-009 tighten: workflow_state_machine.md §5.1 add (c) abandoned-via…
arcobaleno64 Jul 3, 2026
5dd2972
CHG-010 fix-bug: clarify PROCESS_LEDGER fill-in trigger
arcobaleno64 Jul 3, 2026
38c7179
CHG-011 tighten: red_team_backlog.md add BKL-005 (cross-file referenc…
arcobaleno64 Jul 3, 2026
aff2ae5
CHG-013 collapse: archive 4 zero-dispatch templates (adr/debug/rtm/srs)
arcobaleno64 Jul 3, 2026
d9267b0
CHG-012 tighten: HC-1 A2 — force ## Diff Evidence for guard/EXACT_SYN…
arcobaleno64 Jul 6, 2026
18bfcac
chore(release): single end-of-run release-manifest regen (CHG-001..013)
arcobaleno64 Jul 6, 2026
6c2bbc6
TASK-1102 fix-bug: clarify wrapper -AutoRestore is Claude's explicit …
arcobaleno64 Jul 7, 2026
0986deb
TASK-1103 add: independent premortem challenge for high-risk plans
arcobaleno64 Jul 7, 2026
ca62ed5
TASK-1104 add: rule lifecycle audit cycle (Occam pass + Chesterton gate)
arcobaleno64 Jul 7, 2026
fe49862
TASK-1105 fix-bug: pytest context-dependent BOM/skip drift — conftest…
arcobaleno64 Jul 8, 2026
7a2a2ed
TASK-1106 add: governance lenses — Goodhart / Normalization of Devian…
arcobaleno64 Jul 8, 2026
db431ca
TASK-1108 add: governance lenses — Hyrum's Law / Reversibility & Blas…
arcobaleno64 Jul 10, 2026
a8542d1
TASK-1109 add: governance lens Lucas Critique + Campbell's Law fold-i…
arcobaleno64 Jul 10, 2026
48b2d4f
fix(task-1107): close CHG-012 bypasses and RACI sync
arcobaleno64 Jul 17, 2026
a611b79
chore(task-1107): record final commit hash
arcobaleno64 Jul 17, 2026
94d77c6
chore(task-1107): fix dispatch conflict fallout, close AC-8 self-caus…
arcobaleno64 Jul 17, 2026
4b92442
chore(task-1107): add CHG-012 Diff Evidence and complete Files Change…
arcobaleno64 Jul 17, 2026
d93454c
chore(task-1107): pin Diff Evidence Head Commit to latest chore commit
arcobaleno64 Jul 17, 2026
b0c5014
chore(task-1107): record final Build Guarantee commit hash
arcobaleno64 Jul 17, 2026
23d4fb5
fix(task-1107): correct Diff Evidence Snapshot SHA256 (leading-dot no…
arcobaleno64 Jul 17, 2026
9f957ff
chore(task-1107): mark done, record Gate E evidence
arcobaleno64 Jul 17, 2026
4859604
TASK-1112 add: dispatch timeout re-dispatch + log-redirect-path SOP h…
arcobaleno64 Jul 17, 2026
b75c43f
chore(task-1112): regen release manifest after template edits, add ve…
arcobaleno64 Jul 17, 2026
cd1f7ef
chore(task-1112): complete Files Changed/Likely Affected lifecycle se…
arcobaleno64 Jul 17, 2026
64bbf26
chore(task-1112): add code.md/status.json self-references to Files Ch…
arcobaleno64 Jul 17, 2026
50e950e
chore(task-1112): mark done, backfill verification_readiness
arcobaleno64 Jul 17, 2026
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
9 changes: 7 additions & 2 deletions .github/memory-bank/project-facts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ Protected: 禁止本地特性分支進入此目錄
| 變數 | 用途 | 示例 | 必需 |
|---|---|---|---|
| GITHUB_TOKEN | 驗證 GitHub API | ghp_xxx... | 否(fallback 為唯讀) |
| PYTHONPATH | Import artifacts/scripts | C:\...\CLI | 用於 guard scripts |
| PYTHONPATH | Import artifacts/scripts | C:\\...\\CLI | 用於 guard scripts |

## 執行環境

Python 3.11 venv(`.venv/`):在執行 guard scripts 前必須啟動。

## pytest 語境慣例

- 以 repo root 執行 `python -m pytest artifacts/scripts -q` 作為 wrapper / guard / regression 的標準測試入口。
- `artifacts/scripts/conftest.py` 的 fake exe fixtures 以 raw stdin bytes 驗證 stdin pipe,不做字串容錯。

## 構建和部署

本地開發安裝:
Expand All @@ -66,7 +71,7 @@ python -m pip install -r requirements-dev.txt
git submodule update --init --recursive

本地測試:
python -m pytest artifacts/scripts/test_guard_units.py artifacts/scripts/test_security_scans.py -q
python -m pytest artifacts/scripts -q

執行 guard:
python artifacts/scripts/guard_status_validator.py --task-id TASK-900
Expand Down
4 changes: 4 additions & 0 deletions .github/memory-bank/raci-violations-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ This is an append-only log maintained by the Gemini RACI Auditor. It tracks all

- 2026-04-26T19:46:51+08:00 | Agent: Codex | File: docs/orchestration.md | Violation: code (實檔修改) vs code (實檔修改)
- 2026-05-03T18:29:39+08:00 | Agent: Codex CLI | File: docs/orchestration.md | Category: workflow_contract_docs

## Reconciliation Notes

- 2026-07-03 | CHG-005 (HC-7 方向 a): 上列 2 條 Codex/`docs/orchestration.md` (workflow_contract_docs) 違規之 root cause 為 routing↔RACI 矛盾——routing matrix 鼓勵 Codex 撰寫 workflow contract docs,但 `RACI_MATRIX_V2['Codex CLI']` 未授權該類。已由 CHG-005 於 `RACI_MATRIX_V2['Codex CLI']` 增列 `workflow_contract_docs` reconcile。此為承認現行實務之政策修正,**非對既有違規之追溯豁免**(歷史記錄保留不動)。
14 changes: 8 additions & 6 deletions .github/memory-bank/workflow-gates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Workflow Gates — Guard Validator 觸發條件

**Reference**: artifacts/scripts/guard_status_validator.py
**Last Verified**: 2026-04-25 +08:00
**Last Verified**: 2026-07-03 +08:00

## Intake 自 Research 轉換

Expand All @@ -13,7 +13,7 @@

- Research artifact 必須包含 `## Sources`(至少 2 條來源)
- 每個源必須附 URL 或 internal reference
- 若只有摘述,缺少原始連結,guard 會警告但不擋
- 缺少 `## Sources` 段或來源少於 2 條會 hard fail(CRITICAL,直接擋,見 gsv `validate_research`);個別來源的 citation 格式問題依放寬後的 CITATION_PATTERN 才可能僅警告

## Planning 自 Coding 轉換

Expand All @@ -28,6 +28,8 @@ ELSE:
BLOCK with "incomplete_premortem"
ELSE IF any risk lacks Trigger/Detection/Mitigation:
WARN but allow (can fix in code phase)
# CHG-007: 若某 R-block 同時含 banned/vague phrase 且缺任一必填欄位,
# 在 coding state 升級為 ERROR(stub-dismissal escalation),非僅警告
```

## Pre-Coding Context Review(可選)
Expand All @@ -46,12 +48,12 @@ ELSE:

- Code artifact 存在且包含 Files Changed
- Plan 的 Files Likely Affected 包含 Code 的 Files Changed
- 若 code 改了未計劃的檔案,設 status = scope-drift-detected
- 可用 decision 的 Guard Exception override
- 若 code 改了未列於 plan Files Likely Affected 的檔案,git-backed scope check 會 hard fail(validation error)
- 可用帶 `## Guard Exception` 的 decision artifact 搭配 `--allow-scope-drift` waiver override

## Review 自 Verification 轉換

- Verify artifact 必須包含 `## Environment` 和 `## Build Guarantee`
- Verify artifact 必須包含 `## Build Guarantee`(guard-enforced,見 gsv `validate_verify`);`## Environment` 為建議欄位,非 guard enforced
- Build Guarantee 至少 1 條:commit hash、CI log URL、binary checkpoint

## Blocked 自 Recovery 轉換(Gate E — PDCA Act → Plan 回灌)
Expand All @@ -77,7 +79,7 @@ ELSE:
- 不要求 premortem(完整門檻見 docs/premortem_rules.md §7 之 min_risks 表)
- 需要 basic plan with objectives
- 需要 code artifact with Files Changed
- 需要 verify with Environment
- 需要 verify artifact(依 resolved policy;`## Environment` 為建議欄位,非 guard enforced,低風險時 required fields 較少)

重量級標準(預設):
- 需要完整 premortem(numbered risks,min_risks 依 task_type,見 docs/premortem_rules.md §7)
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/workflow-guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# CHG-012 (HC-1 A2): full history so commit-range ## Diff Evidence replay and the
# RACI aux changed-files scan can resolve the diff base (shallow clone breaks both).
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
Expand Down Expand Up @@ -84,3 +87,38 @@ jobs:

- name: Repo Health Dashboard
run: python artifacts/scripts/repo_health_dashboard.py --root .

- name: RACI Path Classification (aux, changed governance files)
# CHG-006 auxiliary layer (secondary to the dispatch-wrapper RACI guard, which is
# the primary enforcement). CI has no agent identity, so this only classifies
# changed files under the governance dirs and fails closed if any is UNKNOWN.
# classify_path is directory-based, so files correctly placed under these prefixes
# always resolve to a known category -- this step is therefore a fail-closed
# structural invariant / defense-in-depth, not a per-agent judgment.
# Diff base unavailable (shallow checkout) -> skip with a warning. NOTE: full
# history is provided by fetch-depth: 0 on the checkout above (added by CHG-012).
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE="${{ github.event.pull_request.base.sha }}"
else
BASE="${{ github.event.before }}"
fi
if [ -z "${BASE:-}" ] || ! git cat-file -e "${BASE}^{commit}" 2>/dev/null; then
echo "[RACI-CI] diff base unavailable (shallow checkout?); skipping aux scan (dispatch wrappers are authoritative)."
exit 0
fi
CHANGED="$(git diff --name-only "$BASE" HEAD -- artifacts/tasks/ artifacts/plans/ artifacts/decisions/ artifacts/status/ docs/ || true)"
CHANGED="$CHANGED" python - <<'PY'
import os, sys
sys.path.insert(0, "artifacts/scripts")
import workflow_constants as wc
paths = [p for p in os.environ.get("CHANGED", "").splitlines() if p.strip()]
unknown = [p for p in paths if wc.classify_path(p) == "unknown"]
if unknown:
print("[RACI-CI] changed governance files with UNKNOWN RACI category (fail-closed):")
for p in unknown:
print(f" - {p}")
sys.exit(1)
print(f"[RACI-CI] {len(paths)} changed governance file(s); all classify to a known category.")
PY
Loading