From 2bceaff466b266b28c5212364f362c2dfcf06c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh?= Date: Wed, 23 Sep 2026 13:17:27 +0700 Subject: [PATCH 1/6] =?UTF-8?q?chore(acceptance):=20kh=C3=B4i=20ph?= =?UTF-8?q?=E1=BB=A5c=20t1=5Fskip=5Fglobs=20khai=20t=E1=BB=87p=20kit=20l?= =?UTF-8?q?=C3=A0m=20d=C3=B2ng=20l=E1=BB=8Bch=20s=E1=BB=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #129 xoá bản kit đã chép và gỡ luôn các dòng t1_skip_globs khai chúng. Luật stale đếm tệp đổi từ verified_commit ngoài t1_skip_globs, nên chính việc xoá thành «code đổi sau verify» cho hồ sơ ký trước đó (kit GUIDE §5.3 mục 3). Khôi phục nguyên các dòng từ 8ca36b5 và khai thêm lib/lop-nhin-thay.cjs: tệp này chép vào ở a282fed nhưng chưa từng được khai, #129 cũng xoá nó. Đo bằng kit 8a4ea88 (= KIT_SHA của CI), lượt không --base (cả cây): 8ca36b5 (trước #129): 39 hồ sơ stale 9fbe0d6 (sau #129): 40 (thêm roadmap-drift-guard) commit này: 39, cùng tập slug với 8ca36b5 Lượt --base origin/main: clean. Co-Authored-By: Claude Fable 5.1 --- _acceptance/config.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/_acceptance/config.yaml b/_acceptance/config.yaml index c2ddaf5c..220ec635 100644 --- a/_acceptance/config.yaml +++ b/_acceptance/config.yaml @@ -831,6 +831,30 @@ risk_tiers: - "_acceptance/**" - "public/**" - "src/i18n/messages/**" + # lịch sử — tệp đã xoá ở #129; giữ để luật stale không đếm việc xoá là code + # đổi sau verify (kit GUIDE §5.3 mục 3, 23/09). Luật stale đếm tệp đổi từ + # verified_commit ngoài t1_skip_globs, nên gỡ các dòng này biến chính việc + # xoá bản kit đã chép thành «code đổi sau verify» cho mọi hồ sơ ký trước #129. + # Giữ cả hai bộ tên `.js`/`.cjs`: cửa sổ diff từ verified_commit cũ còn thấy + # đường `.js` (kit 1.40.0 đổi đuôi). Gỡ chỉ khi không hồ sơ sống nào có + # verified_commit trước #129. + - "scripts/pre-merge-check.sh" + - "lib/eval-yaml.cjs" + - "scripts/recheck-evidence.cjs" + - "scripts/recheck-evidence.js" + - "lib/evidence-core.cjs" + - "lib/evidence-core.js" + - "lib/gap-probe.cjs" + - "lib/gap-probe.js" + - "lib/ac-line.cjs" + - "lib/ac-line.js" + - "lib/md-section.cjs" + - "lib/md-section.js" + - "lib/workspace-record.cjs" + # Bản chép lop-nhin-thay.cjs vào ở a282fed (kit 2.14.0) nhưng chưa từng được + # khai ở đây; #129 xoá nó nên nó cũng phải là dòng lịch sử, nếu không mọi hồ + # sơ có verified_commit từ a282fed tới trước #129 hết hạn vì chính việc xoá. + - "lib/lop-nhin-thay.cjs" # Lint configuration only — it constrains how source is written, never what # the product does at runtime, so a change here cannot invalidate evidence. - "biome.json" From e670c63f52b93e0b64b6c5896ce187b810475a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh?= Date: Wed, 23 Sep 2026 13:37:28 +0700 Subject: [PATCH 2/6] =?UTF-8?q?fix(acceptance):=20guard=20c=E1=BB=A7a=20kh?= =?UTF-8?q?o=20g=E1=BB=8Di=20c=E1=BB=95ng=20kit,=20needle=20b=E1=BA=A3n=20?= =?UTF-8?q?=C4=91=E1=BB=93=20tr=E1=BB=8F=20b=C6=B0=E1=BB=9Bc=20kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #129 xoá bản chép scripts/pre-merge-check.sh; ba script của kho vẫn gọi đường cũ nên đỏ vì «No such file» chứ không vì vật lệch: - check-resign-wave.sh, check-gate-residual.sh, check-repin-eval-coverage.sh (mode readers) nay gọi "$CLAUDE_PLUGIN_ROOT/scripts/pre-merge-check.sh" (kit GUIDE §5.3 mục 5), thiếu biến thì đỏ to tiếng. - check-gate-guards-job.sh: needle check-product-map.mjs (bước CI đã đổi sang thước kit ở #128) thành CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs; bỏ RED_TOKEN và nhiễu loạn bản đồ của thước riêng; vế đỏ khai trong TEETH_SKIP có lý do (thước của kit, kit tự canh răng). Đo ở HEAD với kit 8a4ea88: 7 eval resign-wave/gate-residual/readers đỏ -> xanh; shape/teeth/reachable/no-softening/job-count đều xanh (teeth: KÊ=13 · PHÁ=7 · BỎ QUA=6 có tên). Co-Authored-By: Claude Fable 5.1 --- scripts/acceptance/check-gate-residual.sh | 7 ++++++- scripts/acceptance/check-resign-wave.sh | 7 ++++++- scripts/ci/check-gate-guards-job.sh | 10 ++++------ scripts/ci/check-repin-eval-coverage.sh | 5 ++++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/scripts/acceptance/check-gate-residual.sh b/scripts/acceptance/check-gate-residual.sh index aaa86eaa..f90afd70 100755 --- a/scripts/acceptance/check-gate-residual.sh +++ b/scripts/acceptance/check-gate-residual.sh @@ -39,7 +39,12 @@ fail() { echo "FAIL: $*" >&2; exit 1; } if [ -n "${GATE_RESIDUAL_INPUT:-}" ]; then out=$(cat "$GATE_RESIDUAL_INPUT") else - out=$(bash scripts/pre-merge-check.sh . --base "$BASE" 2>&1) || true + # The gate runs from the kit pinned at KIT_SHA since #129 (23/09), not from a + # vendored copy (kit GUIDE §5.3 step 5). Unset CLAUDE_PLUGIN_ROOT is a loud + # error, never a silent empty verdict. + gate="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT unset: the gate lives in the kit (GUIDE §5.3)}/scripts/pre-merge-check.sh" + [ -f "$gate" ] || fail "kit gate not found at $gate" + out=$(bash "$gate" . --base "$BASE" 2>&1) || true fi # A run that never reached its own summary line crashed; refuse to read silence diff --git a/scripts/acceptance/check-resign-wave.sh b/scripts/acceptance/check-resign-wave.sh index 7628224f..ed54bbae 100755 --- a/scripts/acceptance/check-resign-wave.sh +++ b/scripts/acceptance/check-resign-wave.sh @@ -35,7 +35,12 @@ fail() { echo "FAIL: $*" >&2; exit 1; } if [ -n "${GATE_RESIDUAL_INPUT:-}" ]; then out=$(cat "$GATE_RESIDUAL_INPUT") else - out=$(bash scripts/pre-merge-check.sh . --base "$BASE" 2>&1) || true + # The gate runs from the kit pinned at KIT_SHA since #129 (23/09), not from a + # vendored copy (kit GUIDE §5.3 step 5). Unset CLAUDE_PLUGIN_ROOT is a loud + # error, never a silent empty verdict. + gate="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT unset: the gate lives in the kit (GUIDE §5.3)}/scripts/pre-merge-check.sh" + [ -f "$gate" ] || fail "kit gate not found at $gate" + out=$(bash "$gate" . --base "$BASE" 2>&1) || true fi # A run that never reached its own summary line crashed; refuse to read silence diff --git a/scripts/ci/check-gate-guards-job.sh b/scripts/ci/check-gate-guards-job.sh index a96b8a23..59113a76 100755 --- a/scripts/ci/check-gate-guards-job.sh +++ b/scripts/ci/check-gate-guards-job.sh @@ -38,7 +38,9 @@ job_block() { # needle: three steps run the same script with different modes. GUARD_NEEDLES=( check-roadmap-fresh.sh - check-product-map.mjs + # The kit's own map reader since #128 (owner decision 23/09); the home-made + # scripts/ci/check-product-map.mjs no longer runs in CI. + CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs check-plan-freeze.mjs check-plan-freeze-teeth.sh check-plan-docs.sh @@ -62,6 +64,7 @@ TEETH_SKIP=( "check-plan-freeze-teeth.sh|ve do cua no CHINH LA no; pha no de chung minh no biet do la vong tron" "check-plan-docs-teeth.sh|ve do cua no CHINH LA no; pha no de chung minh no biet do la vong tron" "check-fork-identity-teeth.sh|ve do cua no CHINH LA no; pha no de chung minh no biet do la vong tron" + "CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs|thuoc cua kit ghim KIT_SHA; ve do do kit tu canh, cay tham do khong co evidence cua ho so nen se do vi thieu tep chu khong vi lech" ) teeth_skipped() { local n="$1" e @@ -238,7 +241,6 @@ teeth) # from the real red output of the probe tree, not guessed. RED_TOKEN=( "check-roadmap-fresh.sh|roadmap drift" - "check-product-map.mjs|vắng trên bản đồ" "check-plan-freeze.mjs|teeth-probe-freeze mở ngoài kế hoạch" "check-plan-docs.sh|FAIL: STATUS.md đề ngày" "check-eval-filters.mjs|KHÔNG ca thử nào khớp" @@ -325,10 +327,6 @@ teeth) python3 - "$probe/t" <<'PERTURB' import sys, pathlib root = pathlib.Path(sys.argv[1]) -# Drop one signed slug from the delivered block of the map. -m = root / "PRODUCT-MAP.md" -m.write_text("".join(l for l in m.read_text(encoding="utf-8").splitlines(keepends=True) - if "(`roadmap-drift-guard`)" not in l), encoding="utf-8") # Duplicate one ledger row INSIDE the marker block. r = root / "docs" / "roadmap.md" lines = r.read_text(encoding="utf-8").splitlines(keepends=True) diff --git a/scripts/ci/check-repin-eval-coverage.sh b/scripts/ci/check-repin-eval-coverage.sh index b84596a4..392c0da7 100755 --- a/scripts/ci/check-repin-eval-coverage.sh +++ b/scripts/ci/check-repin-eval-coverage.sh @@ -101,7 +101,10 @@ readers) [ -n "$target" ] || fail "khong tim thay run-log nao co dong repin duoc mot section ### Re-pin trich dan" echo "muc tieu: ${target#"$W"/} (dong repin duoc ### Re-pin trich dan)" - run_pmc() { (cd "$W" && bash scripts/pre-merge-check.sh . --base origin/main 2>&1); } + # Gate from the kit pinned at KIT_SHA since #129 (23/09): kit GUIDE §5.3 step 5. + gate="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT unset: the gate lives in the kit (GUIDE §5.3)}/scripts/pre-merge-check.sh" + [ -f "$gate" ] || fail "kit gate not found at $gate" + run_pmc() { (cd "$W" && bash "$gate" . --base origin/main 2>&1); } with="$(run_pmc)" node -e ' From 15da97772dc43c88617077a0e6781b98cc7c7f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh?= Date: Wed, 23 Sep 2026 14:52:35 +0700 Subject: [PATCH 3/6] =?UTF-8?q?fix(acceptance):=20test-own-range=20=C4=91?= =?UTF-8?q?=E1=BB=8Dc=20front=5Ffield=20t=E1=BB=AB=20c=E1=BB=95ng=20kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ca malformed rút front_field() từ scripts/pre-merge-check.sh chép vào kho, đã xoá ở #129. Nay rút từ "$CLAUDE_PLUGIN_ROOT/scripts/pre-merge-check.sh" (kit GUIDE §5.3 mục 5); kit 8a4ea88 vẫn có front_field(). 8/8 ca xanh. Co-Authored-By: Claude Fable 5.1 --- scripts/acceptance/test-own-range.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/acceptance/test-own-range.sh b/scripts/acceptance/test-own-range.sh index d5806006..b770fd88 100755 --- a/scripts/acceptance/test-own-range.sh +++ b/scripts/acceptance/test-own-range.sh @@ -124,7 +124,10 @@ case_malformed() { # decoy in the body, a trailing comment, and quotes. printf -- '---\nslug: bad\nlanded_merge: "%s" # PR #99\n---\n\nlanded_merge: cafebabe\n' \ "$plain" > "$d/_acceptance/bad/contract.md" - ff_src="$(sed -n '/^front_field()/,/^}/p' "$ROOT/scripts/pre-merge-check.sh")" + # The gate runs from the kit pinned at KIT_SHA since #129 (23/09), not from a + # vendored copy (kit GUIDE §5.3 step 5), so its twin reader lives there. + gate="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT unset: the gate lives in the kit (GUIDE §5.3)}/scripts/pre-merge-check.sh" + ff_src="$(sed -n '/^front_field()/,/^}/p' "$gate")" [ -n "$ff_src" ] || fail malformed "could not extract front_field() from pre-merge-check.sh" eval "$ff_src" twin="$(front_field "$d/_acceptance/bad/contract.md" landed_merge)" From 825e6cd533e944a4ea7118af431433efc6cd75dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh?= Date: Wed, 23 Sep 2026 14:52:36 +0700 Subject: [PATCH 4/6] =?UTF-8?q?chore(acceptance):=20ngh=E1=BB=89=204=20h?= =?UTF-8?q?=E1=BB=93=20s=C6=A1=20th=C6=B0=E1=BB=9Bc=20=3D=20kit,=20xo?= =?UTF-8?q?=C3=A1=20th=C6=B0=E1=BB=9Bc=20ri=C3=AAng=20v=C3=A0=20guard=20ch?= =?UTF-8?q?=E1=BA=BFt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner (manh) gật lối A ngày 23/09. Bốn dòng nghỉ theo công thức kit GUIDE «Cho một hồ sơ nghỉ», người «manh», lý do «thước = kit từ 23/09»: - cong-tu-canh-minh: bản đồ nay do scripts/product-map.mjs của kit canh (#128); suite-keys đã đỏ từ khi owner gộp lại build+typecheck (4d8dd32). - gate-tooling-t1, stale-scope-by-paths: canh staleness theo paths của cổng fork đã xoá ở #129; kit tính trên cả cây, lời hứa không còn ai thực thi. - gate-scope-anchors: nửa namespace chết theo cổng fork; nửa own-range vẫn xanh nhưng thôi được hồ sơ đã ký bảo chứng. contract/evidence/run-log của các hồ sơ này không đổi byte nào. Xoá: scripts/ci/check-product-map.mjs + -teeth.sh; tám guard chỉ canh cổng fork (check-stale-scoping, check-scoping-all-cases, check-golden-dead-code-absent, check-fork-scope-teeth, check-t1-escape-path, check-no-stale-empty-diff, check-stale-real-repo, test-scope-namespace) và fixtures.sh chỉ hai trong số đó dùng; 35 khoá config chỉ hồ sơ nghỉ dùng. lcm_pmap và mhb_existing_guards trỏ sang bộ đọc bản đồ của kit (cùng lệnh bước CI). PRODUCT-MAP.md sinh lại bằng kit: bốn mục mang nhãn «đã nghỉ». Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 8 +- PRODUCT-MAP.md | 8 +- _acceptance/config.yaml | 68 +- _acceptance/cong-tu-canh-minh/decisions.jsonl | 1 + .../gate-scope-anchors/decisions.jsonl | 1 + _acceptance/gate-tooling-t1/decisions.jsonl | 1 + .../stale-scope-by-paths/decisions.jsonl | 1 + scripts/acceptance/check-fork-scope-teeth.sh | 132 --- .../check-golden-dead-code-absent.sh | 54 -- .../acceptance/check-no-stale-empty-diff.sh | 59 -- scripts/acceptance/check-scoping-all-cases.sh | 62 -- scripts/acceptance/check-stale-real-repo.sh | 98 -- scripts/acceptance/check-stale-scoping.sh | 759 ---------------- scripts/acceptance/check-t1-escape-path.sh | 101 --- scripts/acceptance/fixtures.sh | 839 ------------------ scripts/acceptance/test-scope-namespace.sh | 223 ----- scripts/ci/check-product-map-teeth.sh | 325 ------- scripts/ci/check-product-map.mjs | 337 ------- 18 files changed, 28 insertions(+), 3049 deletions(-) delete mode 100755 scripts/acceptance/check-fork-scope-teeth.sh delete mode 100755 scripts/acceptance/check-golden-dead-code-absent.sh delete mode 100755 scripts/acceptance/check-no-stale-empty-diff.sh delete mode 100755 scripts/acceptance/check-scoping-all-cases.sh delete mode 100755 scripts/acceptance/check-stale-real-repo.sh delete mode 100755 scripts/acceptance/check-stale-scoping.sh delete mode 100755 scripts/acceptance/check-t1-escape-path.sh delete mode 100644 scripts/acceptance/fixtures.sh delete mode 100755 scripts/acceptance/test-scope-namespace.sh delete mode 100755 scripts/ci/check-product-map-teeth.sh delete mode 100755 scripts/ci/check-product-map.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd34a388..ae65899e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,10 +161,10 @@ jobs: run: bash scripts/roadmap/check-roadmap-fresh.sh # The kit's own reader, not a home-made one: owner decision 23/09. The - # home-made scripts/ci/check-product-map.mjs (0d9f5ac, 31/08) describes a - # different state model and cannot be green at the same time as the kit's - # map. It stays on disk only because signed evidence (cong-tu-canh-minh) - # names it as a verifier; it no longer runs in CI. + # home-made scripts/ci/check-product-map.mjs (0d9f5ac, 31/08) described a + # different state model and could not be green at the same time as the + # kit's map. It was deleted on 23/09 once cong-tu-canh-minh, the signed + # dossier naming it as a verifier, was retired (owner: manh). - name: Product map freshness run: node "$CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs" --root . --check diff --git a/PRODUCT-MAP.md b/PRODUCT-MAP.md index 757e7a8f..bb560408 100644 --- a/PRODUCT-MAP.md +++ b/PRODUCT-MAP.md @@ -40,11 +40,11 @@ flowchart TD - CI-a — vitest vào CI + gỡ ghim SDK cứng của guard overlay (khử mìn hạ tầng verify) (`ci-vitest-sdk-pin`) - slot dán chữ/khung giá/logo/safe-zone lên ảnh & video (Phase 1.2) (`compose-overlay`) - Conformance L0 — pluginRev, node_cached contract, TS↔Python conformance suite (`conformance-l0`) -- Cổng tự canh mình — hai guard vào CI, và suite verify thôi tự đốt vòng (`cong-tu-canh-minh`) +- Cổng tự canh mình — hai guard vào CI, và suite verify thôi tự đốt vòng (`cong-tu-canh-minh`) — đã giao — đã nghỉ, giữ sử liệu - Đăng ký fork oneflow-api-openai vào manifest chính thức (`dang-ky-fork-openai`) - Dependency refresh — five pending dependabot updates (`dependency-refresh-2026-07`) -- Gate 0.6 — cùng-không-gian cho scope paths + neo lịch sử cho eval per-PR (`gate-scope-anchors`) -- Gate tooling × t1_skip_globs — đường hợp lệ để sửa guard, và trả ba nợ 0.8 (`gate-tooling-t1`) +- Gate 0.6 — cùng-không-gian cho scope paths + neo lịch sử cho eval per-PR (`gate-scope-anchors`) — đã giao — đã nghỉ, giữ sử liệu +- Gate tooling × t1_skip_globs — đường hợp lệ để sửa guard, và trả ba nợ 0.8 (`gate-tooling-t1`) — đã giao — đã nghỉ, giữ sử liệu - Hai đường chạy, một venv — engine Python dùng venv per-plugin như bên TypeScript, thôi nuốt lỗi cấp phát (`hai-duong-chay-mot-venv`) - Hàng rào thôi đọc nhầm "không đo được" thành "không có gì sai" (`hang-rao-doc-nham-loi-thanh-khong-co-gi`) - Kho khoá toàn vẹn — đọc không cắt bớt âm thầm, ghi không để lại file cụt (`kho-khoa-toan-ven`) @@ -64,7 +64,7 @@ flowchart TD - Plugin scanner reads imports by scope boundary, and says why a slot was skipped (`scan-with-block-imports`) - Publish the SDK as oneflow-sdk while keeping the tongflow import package (`sdk-distribution-rename`) - Skill system v1 — manifest tham số, template, orchestrator v1, ngăn skill và xem/sửa kế hoạch; skill thứ hai không đụng engine (`skill-system-v1`) -- Scope evidence staleness by declared eval paths (`stale-scope-by-paths`) +- Scope evidence staleness by declared eval paths (`stale-scope-by-paths`) — đã giao — đã nghỉ, giữ sử liệu - Per-task metering columns and measured plugin duration (`task-metering`) ## Đã nghiệm thu giá trị diff --git a/_acceptance/config.yaml b/_acceptance/config.yaml index 220ec635..06d2abed 100644 --- a/_acceptance/config.yaml +++ b/_acceptance/config.yaml @@ -387,20 +387,11 @@ executors: # ---- hai-duong-chay-mot-venv (B4) ---- hdc_layout_constant_pinned: "bash scripts/plugins/check-venv-layout-pinned.sh" hdc_layout_constant_teeth: "bash scripts/plugins/check-venv-layout-teeth.sh" - # --- cong-tu-canh-minh (31/08) --- - # Bo kiem ban do + rang cua no. Dat o scripts/ci/ chu khong scripts/roadmap/ - # hay scripts/acceptance/ vi gia re-pin: 0 vs 1 vs 2 ho so (do tren paths da - # khai cua 29 ho so). + # --- cong-tu-canh-minh (31/08) --- khoa pmap_* (thuoc ban do rieng + # scripts/ci/check-product-map*.{mjs,sh}) da go 23/09: ho so nghi (thuoc = + # kit, #128/#129), ban do nay do scripts/product-map.mjs cua kit canh. kkt_seam_signature: "bash scripts/settings/check-env-store-teeth.sh --case seam-signature" kkt_teeth_all: "bash scripts/settings/check-env-store-teeth.sh" - pmap_check: "node scripts/ci/check-product-map.mjs" - pmap_teeth_all: "bash scripts/ci/check-product-map-teeth.sh" - pmap_teeth_missing_slug: "bash scripts/ci/check-product-map-teeth.sh --case missing-slug" - pmap_teeth_count: "bash scripts/ci/check-product-map-teeth.sh --case count-mismatch" - pmap_teeth_opportunity: "bash scripts/ci/check-product-map-teeth.sh --case opportunity-mismatch" - pmap_teeth_unreadable: "bash scripts/ci/check-product-map-teeth.sh --case artifact-missing --case artifact-unreadable" - pmap_teeth_extra_slug: "bash scripts/ci/check-product-map-teeth.sh --case extra-slug --case status-downgraded" - pmap_teeth_source_buckets: "bash scripts/ci/check-product-map-teeth.sh --case contract-unparsable --case status-unknown --case dir-empty" # Lo mu cua guard lo trinh: no so TAP slug trong khoi marker nen dong trung # vo hinh. Do 31/08: so cai CO dong trung normalize-text-vi ma guard van xanh. roadmap_fresh: "bash scripts/roadmap/check-roadmap-fresh.sh" @@ -430,7 +421,11 @@ executors: # ho so nay (do tren cay eb175ed). Ve «la mot suite key» cua AC-9 do bang # phep khang dinh truc tiep ben duoi. Phat hien ngoai hop dong -> Cong 2. lcm_wiring: "bash scripts/ci/check-gate-guards-job.sh shape && bash scripts/ci/check-gate-guards-job.sh reachable && bash scripts/ci/check-gate-guards-job.sh teeth && bash scripts/roadmap/check-plan-suite-key.sh" - lcm_pmap: "node scripts/ci/check-product-map.mjs && bash scripts/ci/check-product-map-teeth.sh --case parked-opportunity" + # 23/09: tro sang bo doc ban do cua kit ghim KIT_SHA (cung lenh buoc CI + # «Product map freshness»); thuoc rieng check-product-map.mjs va case rang + # parked-opportunity cua no da xoa — rang do kit tu canh. Ban do kit van in + # «Xep lai sau 3 viec» dung ba co hoi park cua AC-11. + lcm_pmap: "node \"$CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs\" --root . --check" # --- mo-hoa-b01 (05/09) --- guard dinh danh fork + rang, MOT khoa moi ca (khuon lcm_*). fork_identity: "bash scripts/fork/check-fork-identity.sh" mhb_teeth_all: "bash scripts/fork/check-fork-identity-teeth.sh" @@ -443,7 +438,7 @@ executors: mhb_teeth_notice: "bash scripts/fork/check-fork-identity-teeth.sh --case notice-dist-gone && bash scripts/fork/check-fork-identity-teeth.sh --case notice-unchanged-back && bash scripts/fork/check-fork-identity-teeth.sh --case notice-attribution-gone" mhb_prototype_lane: "bash scripts/fork/check-prototype-lane.sh mo-hoa-b01 && bash scripts/fork/check-fork-identity-teeth.sh --case debt-table-missing && bash scripts/fork/check-fork-identity-teeth.sh --case debt-table-duplicate" mhb_wiring: "bash scripts/ci/check-gate-guards-job.sh shape && bash scripts/ci/check-gate-guards-job.sh reachable && bash scripts/ci/check-gate-guards-job.sh teeth && bash scripts/fork/check-suite-key.sh fork_identity check-fork-identity.sh && bash scripts/fork/check-fork-identity-teeth.sh --case suite-key-dangling" - mhb_existing_guards: "bash scripts/plugins/check-live-docs-manifest-synced.sh readme && bash scripts/plugins/check-live-docs-manifest-synced.sh claude && bash scripts/plugins/check-live-docs-manifest-synced.sh orphans origin/main && bash scripts/plugins/check-manifest-doc-synced.sh && bash scripts/plugins/check-prefix-docs.sh && bash scripts/ci/check-action-pins.sh && bash scripts/ci/check-docker-dryrun.sh && node scripts/roadmap/check-plan-freeze.mjs && bash scripts/roadmap/check-plan-docs.sh && bash scripts/roadmap/check-roadmap-fresh.sh && node scripts/ci/check-product-map.mjs" + mhb_existing_guards: "bash scripts/plugins/check-live-docs-manifest-synced.sh readme && bash scripts/plugins/check-live-docs-manifest-synced.sh claude && bash scripts/plugins/check-live-docs-manifest-synced.sh orphans origin/main && bash scripts/plugins/check-manifest-doc-synced.sh && bash scripts/plugins/check-prefix-docs.sh && bash scripts/ci/check-action-pins.sh && bash scripts/ci/check-docker-dryrun.sh && node scripts/roadmap/check-plan-freeze.mjs && bash scripts/roadmap/check-plan-docs.sh && bash scripts/roadmap/check-roadmap-fresh.sh && node \"$CLAUDE_PLUGIN_ROOT/scripts/product-map.mjs\" --root . --check" # Job CI: rut lenh RA TU ci.yml roi CHAY no, theo khuon check-vitest-job.sh. # Doc YAML la do chi dan; chay lenh rut ra moi la do hanh vi. # o-do-chay-0-ca-van-xanh: mot o do loc theo ten ca ma khong ca nao khop @@ -528,39 +523,11 @@ executors: # conformance-l0 Gate 1 (2026-07-28). conformance_discriminating: bash scripts/conformance/check-suite-discriminating.sh plugin_rev_joined_path: pnpm tsx scripts/plugins/check-rev-joined-path.ts - # stale-scope-by-paths Gate 1 (2026-07-28): every file below lands during - # implementation. These live under scripts/acceptance/ on purpose — the - # t1_skip_globs exemption for the gate tooling lists EXACT paths, so a guard - # in a new subdirectory is gated and the gate applies to itself. - # One key per eval, same guard with a different --case: nine evals behind one - # command collapse nine criteria into one exit code, and a case that was - # never implemented then looks identical to a case that passed. - stale_scope_in_scope: bash scripts/acceptance/check-stale-scoping.sh --case in-scope - stale_scope_out_of_scope: bash scripts/acceptance/check-stale-scoping.sh --case out-of-scope - stale_scope_partial: bash scripts/acceptance/check-stale-scoping.sh --case partial - stale_scope_under_declared: bash scripts/acceptance/check-stale-scoping.sh --case under-declared - stale_scope_malformed: bash scripts/acceptance/check-stale-scoping.sh --case malformed - stale_scope_indent_drift: bash scripts/acceptance/check-stale-scoping.sh --case indent-drift - stale_scope_merged_halves: bash scripts/acceptance/check-stale-scoping.sh --case merged-halves - stale_scope_suppression: bash scripts/acceptance/check-stale-scoping.sh --case suppression - stale_scope_two_bases: bash scripts/acceptance/check-stale-scoping.sh --case two-bases - stale_scope_announce: bash scripts/acceptance/check-stale-scoping.sh --case announce - stale_scope_mutation: bash scripts/acceptance/check-stale-scoping.sh --case mutation - stale_scope_case_completeness: bash scripts/acceptance/check-stale-scoping.sh --case case-completeness - stale_scope_guard_not_exempt: bash scripts/acceptance/check-stale-scoping.sh --case guard-not-exempt - stale_scope_no_kill_switch: bash scripts/acceptance/check-stale-scoping.sh --case no-kill-switch - stale_scope_real_repo: bash scripts/acceptance/check-stale-real-repo.sh - # gate-tooling-t1 (item 0.8). Ba case MỚI của check-stale-scoping.sh giữ - # tiền tố stale_scope_* vì chúng là case của guard đó; các guard mới đứng - # riêng mang tiền tố gt1_. Một key cho một eval — xem đầu evals.yaml. - stale_scope_fork_undeclared: bash scripts/acceptance/check-stale-scoping.sh --case fork-undeclared - stale_scope_fork_declared_in_union: bash scripts/acceptance/check-stale-scoping.sh --case fork-declared-in-union - stale_scope_undeclared: bash scripts/acceptance/check-stale-scoping.sh --case undeclared - gt1_t1_escape_path: bash scripts/acceptance/check-t1-escape-path.sh - gt1_all_scoping_cases: bash scripts/acceptance/check-scoping-all-cases.sh - gt1_dead_code_absent: bash scripts/acceptance/check-golden-dead-code-absent.sh - gt1_fork_teeth: bash scripts/acceptance/check-fork-scope-teeth.sh - gt1_no_stale_on_empty_diff: bash scripts/acceptance/check-no-stale-empty-diff.sh + # stale-scope-by-paths / gate-tooling-t1 / gate-scope-anchors: cac khoa + # stale_scope_*, gt1_* (5 khoa) va scope_ns_*/gate_ns_* da go 23/09 cung + # guard cua chung — chung canh co che staleness theo paths cua cong fork da + # xoa o #129, ca ba ho so nghi (thuoc = kit). Khoa con lai ben duoi tro vao + # script con song. gt1_no_golden_claim: bash scripts/acceptance/check-no-golden-claim.sh gt1_landed_merge_repinned: bash scripts/acceptance/check-landed-merge-repinned.sh # roadmap-drift-guard Gate 1 (2026-08-27). MỘT khoá cho MỖI case: bộ răng cũ @@ -577,12 +544,9 @@ executors: roadmap_teeth_supersede_source_single: bash scripts/roadmap/check-roadmap-guard-teeth.sh --case supersede-source-single roadmap_teeth_case_isolation: bash scripts/roadmap/check-roadmap-guard-teeth.sh --case case-isolation own_range_case_completeness: bash scripts/acceptance/test-own-range.sh case-completeness - scope_ns_case_completeness: bash scripts/acceptance/test-scope-namespace.sh case-completeness - # gate-scope-anchors (0.6): same-universe scope check + historical anchors. + # gate-scope-anchors (0.6): historical anchors (own-range); the scope + # namespace half died with the fork gate (#129). # b2_* and ghcr_anchored hit the network (gh) — local verify only, not CI. - gate_ns_exempt_refused: bash scripts/acceptance/test-scope-namespace.sh exempt-refused - gate_ns_variants_red: bash scripts/acceptance/test-scope-namespace.sh variants-discriminating - gate_ns_legit_granted: bash scripts/acceptance/test-scope-namespace.sh legit-granted own_range_anchored: bash scripts/acceptance/test-own-range.sh anchored own_range_unlanded: bash scripts/acceptance/test-own-range.sh unlanded own_range_malformed: bash scripts/acceptance/test-own-range.sh malformed diff --git a/_acceptance/cong-tu-canh-minh/decisions.jsonl b/_acceptance/cong-tu-canh-minh/decisions.jsonl index 6d372ad0..bea3dd86 100644 --- a/_acceptance/cong-tu-canh-minh/decisions.jsonl +++ b/_acceptance/cong-tu-canh-minh/decisions.jsonl @@ -17,3 +17,4 @@ {"id":"d-20260831T140000Z-2093","type":"approach","stage":"gate2","at":"2026-08-31T14:00:00Z","decision":"Ngoai-1 (guard nuot tham so la) — owner chon ghi Known limits, nhan ban sua vao goi nay","impact":"tiet kiem: mot dong lenh go sai trong ci.yml khong con doc ra thanh da-kiem-sach · rui ro: khong tieu chi nao do truc tiep hanh vi tu choi do, no duoc giu gian tiep boi ve guard-of-the-guard cua E8"} {"id":"d-20260831T140100Z-7746","type":"approach","stage":"gate2","at":"2026-08-31T14:01:00Z","decision":"Ngoai-2 (nghi van cong bo qua staleness) — owner chon mo ho so moi staleness-ho-so-thieu-paths","impact":"tiet kiem: khong sua mu mot chot chan CI · rui ro: neu dung la fail-open thi no van mo cho toi khi ho so moi chay xong"} {"id": "d-20260831T150000Z-3382", "type": "fix", "stage": "S5", "at": "2026-08-31T15:00:00Z", "decision": "Them dong so cai lo trinh cho chinh ho so nay, va viet no KHONG dung nhay nguoc", "impact": "tiet kiem: CI xanh · rui ro: so cai doc MOI tu trong nhay nguoc la mot slug, nen dong nao chua ten lenh trong nhay se sinh slug ma — gioi han co san cua guard, khong phai loi goi nay"} +{"id":"d-20260923T074315Z-20","type":"nghi","stage":"gate2","at":"2026-09-23T07:43:15Z","by":"manh","decision":"thước = kit từ 23/09","impact":"hồ sơ thôi hứa: bản đồ PRODUCT-MAP.md khớp hồ sơ theo thước riêng scripts/ci/check-product-map.mjs (AC-1..4, 10..12; nay bước CI Product map freshness chạy bộ đọc của kit ở KIT_SHA, #128) và suite_keys tách build/typecheck (AC-8; owner gộp lại 02/09 ở 4d8dd32). Guard sổ cái, nối dây job và a11y-dist-dir vẫn chạy nhưng không còn hồ sơ này bảo chứng"} diff --git a/_acceptance/gate-scope-anchors/decisions.jsonl b/_acceptance/gate-scope-anchors/decisions.jsonl index 39f85c6b..e36b0d25 100644 --- a/_acceptance/gate-scope-anchors/decisions.jsonl +++ b/_acceptance/gate-scope-anchors/decisions.jsonl @@ -16,3 +16,4 @@ {"id":"d-20260804T220000Z-11216","type":"fix","stage":"S4-r3","at":"2026-08-04T22:00:00Z","decision":"Dong finding HIGH vong 3: cua so registry cua check-ghcr-untouched khoa theo CO-SLUG thay vi CO-HA-CANH. Feature da neo nhung chua merge -> anchor_tip tra HEAD -> UNTIL = ngay commit hom nay, som hon SINCE (createdAt cua run dispatch) -> cua so RONG -> jq khong chon gi -> in ok va exit 0, nuot mat mot ban publish that. Da repro bang so lieu that truoc khi sua","impact":"tiet kiem: dong lo fail-open trong chinh nua doi chung ma Task 5 vua them; them anchor_landed (hoi DA-HA-CANH-CHUA, khac han anchor_tip hoi CAY-NAO) va assert_window_sane (cua so ket thuc truoc khi bat dau = cau hoi khong tra loi duoc = exit 2). Doi lai: mot ham nua trong gh-run-lib","serves":["AC-9"]} {"id":"d-20260804T220001Z-11217","type":"revisit","stage":"S4-r3","at":"2026-08-04T22:00:01Z","decision":"Ba vong nghiem thu lien tiep, moi vong tim dung MOT loi that trong code cua toi, va ca ba deu cung mot loi tu duy: gan mot cau hoi vao DIEU KIEN GAN DUNG thay vi dieu kien that (exit trong subshell; slug-co-mat thay cho neo-giai-duoc; slug-co-mat thay cho da-ha-canh)","impact":"chi phi: ~2.8M token/vong. Gia tri bien van duong nhung dang giam dan va deu roi vao MOT ho loi da co ten","revisit":"Trinh Manh o Cong 2: chay vong 4 hay dung lai. Lap luan de dung: ho loi da duoc dat ten va nay co guard thi hanh (assert_window_sane, set -e invariant, ba poison value); lap luan de chay tiep: ba vong deu khong rong"} {"id":"d-20260804T221500Z-11218","type":"fix","stage":"S4-r3","at":"2026-08-04T22:15:00Z","decision":"Dong finding LOW nhung TRONG hop dong: scope_has_any_match doc ls-files KHONG co core.quotePath=false, trong khi stale_files doc diff CO — git mac dinh quote path phi-ASCII, nen hai ben danh van khac nhau (\"src/lib/caf\\303\\251.ts\" vs src/lib/cafe.ts). Da xac minh bang fixture that","impact":"huong lech la fail-CLOSED (tu choi scope oan) chu khong phai lo hong; nhung chinh chu thich toi viet khang dinh hai ben hoi cung mot khong gian — khang dinh do phai dung. Sua mot co, them ca kiem vao E3, mutation-test", "serves":["AC-1","AC-3"]} +{"id":"d-20260923T074315Z-19","type":"nghi","stage":"gate2","at":"2026-09-23T07:43:15Z","by":"manh","decision":"thước = kit từ 23/09","impact":"hồ sơ thôi hứa cả hai nửa: AC-1..3 không gian tên paths của cổng fork (đã xoá ở #129, kit không đọc paths); AC-4..12 neo own-range vẫn có script sống và test-own-range.sh vẫn xanh nhưng không còn hồ sơ đã ký bảo chứng"} diff --git a/_acceptance/gate-tooling-t1/decisions.jsonl b/_acceptance/gate-tooling-t1/decisions.jsonl index ba5c65cc..3b7508c2 100644 --- a/_acceptance/gate-tooling-t1/decisions.jsonl +++ b/_acceptance/gate-tooling-t1/decisions.jsonl @@ -1,3 +1,4 @@ {"id":"d-20260828T031500Z-scope","type":"descope","stage":"gate2","at":"2026-08-28T03:15:00Z","decision":"Thu hẹp phạm vi gate-tooling-t1: hồ sơ đóng vế (i) của nợ 0.8 (PR sửa guard không còn nổ VIOLATION [PR] t1-escape) và KHÔNG đóng vế (ii) (PR đó vẫn làm cũ pin đã ký). Đo 28/08: PR chỉ sửa scripts/acceptance/** kèm artifact sinh 3 violation staleness — measure-harness, task-metering (đều khai scripts/**), stale-scope-by-paths (khai chính scripts/acceptance/**). Phát hiện bởi gap-probe P0-1, xác minh lại trên cây thật bởi orchestrator (critic nêu 2 slug, thực tế 3).","impact":"Câu 'nợ 0.8 đã đóng' bị thu hẹp trong Context và khai vào Out of scope. KHÔNG AC nào đổi, KHÔNG eval nào nới — 13 eval vẫn khẳng định đúng thứ chúng vẫn khẳng định. Vế (ii) thành nợ có tên, cần contract kế; đường ra đã biết (bỏ khai paths ở 3 eval thường trực của measure-harness/task-metering) nhưng chạm _acceptance// của hai feature khác nên phải đi kèm wave của chúng."} {"id":"d-20260828T032000Z-ac12","type":"approach","stage":"gate2","at":"2026-08-28T03:20:00Z","decision":"AC-12 (giữ / thu hẹp / bỏ khai paths cho measure-harness và task-metering): hướng được chọn là BỎ KHAI, theo phán quyết PASS của blind judge. Căn cứ đo được trên cửa sổ a788985..d919b5e: 81 file gated đổi, union loại ra đúng 9, 72 file còn lại rơi trong union và vẫn làm hai feature stale — lời khai paths tiết kiệm 0 vòng re-verify; quét 33 commit first-parent không commit nào có toàn bộ file gated ngoài union. Union sai cả hai chiều: scripts/** khai thừa mọi guard shell (biome Checked 0 files), sdk/** khai thiếu dù eval biome đọc sdk/**/*.json.","impact":"Ghi lại để khuyến nghị của judge có nơi hạ cánh thay vì mất trong một đoạn văn (gap-probe P1-4). CHƯA THI HÀNH trong hồ sơ này: thực thi chạm _acceptance/measure-harness/ và _acceptance/task-metering/, tức mở lại phép soi staleness của chúng, nên phải đi ké wave của hai feature đó. Việc thi hành thuộc contract kế, cùng chỗ với vế (ii) của d-20260828T031500Z-scope."} {"id":"d-20260828T032500Z-amend","type":"amendment","stage":"gate2","at":"2026-08-28T03:25:00Z","decision":"Amendment 1 (AC-5 bỏ con số cứng '14 case') được duyệt tại chỗ bởi Manh ngày 28/08, cùng lượt duyệt Amendment 2. Amendment 1 viết ngày 27/08 sau vòng verify 1 mà chưa có dòng người duyệt — gap-probe P1-5 bắt được.","impact":"Frontmatter thêm amended_at: 2026-08-28 để phân biệt bản trước và sau sửa. Khoảng hở còn lại, khai thẳng: AC-5 nay lấy phạm vi từ chính vật bị đo (KNOWN_CASES) và KHÔNG có sàn, nên tập case có thể CO lại mà E6 vẫn xanh (gap-probe P0-3) — nợ chuyển contract kế, không vá ở đây."} +{"id":"d-20260923T074315Z-4","type":"nghi","stage":"gate2","at":"2026-09-23T07:43:15Z","by":"manh","decision":"thước = kit từ 23/09","impact":"hồ sơ thôi hứa về fork STALE-DIFF-SCOPE-GUARD và staleness theo paths trong scripts/pre-merge-check.sh chép vào kho; bản chép đã xoá ở #129, cổng nay là kit ghim sha và kit tính staleness trên cả cây, không đọc paths"} diff --git a/_acceptance/stale-scope-by-paths/decisions.jsonl b/_acceptance/stale-scope-by-paths/decisions.jsonl index f0170064..8c25c475 100644 --- a/_acceptance/stale-scope-by-paths/decisions.jsonl +++ b/_acceptance/stale-scope-by-paths/decisions.jsonl @@ -17,3 +17,4 @@ {"id":"d-20260729T095807Z-19845","type":"descope","stage":"gate2","at":"2026-07-29T09:58:07Z","decision":"KHÔNG vá lỗi 'scope toàn glob t1-exempt thì vĩnh viễn rỗng' trong feature này — mở contract riêng, gộp cùng chiều 'ngữ nghĩa không gian tên + coverage-set' mà hợp đồng hiện thiếu","impact":"human quyết ở Cổng 2. Vá lẻ 4 lần trước đều lòi biến thể kế tiếp, nên trục đúng là mở AC cho chính chiều đó chứ không thêm AC lẻ thứ 5. Đổi lại: ship bản này với một fail-open HIGH đã biết — một feature docs-only khai paths trung thực vẫn tự miễn nhiễm cảnh báo cũ","revisit":"Contract riêng ngay sau khi feature này merge"} {"id":"d-20260729T095807Z-29062","type":"descope","stage":"gate2","at":"2026-07-29T09:58:07Z","decision":"KHÔNG dịch ~265 dòng tiếng Việt + ≥14 thông điệp CI trong feature này — mở contract riêng","impact":"human quyết ở Cổng 2. Chúng thuộc file vendor của kit nên sửa tay sẽ bị ghi đè ở lần bump sau; việc thật là quyết định chính sách (xin upstream dịch, hay ghi ngoại lệ vendor vào CLAUDE.md/CONTRIBUTING.md). Đổi lại repo AGPL hướng contributor ngoài vẫn in thông điệp CI hai thứ tiếng cho tới lúc đó","revisit":"Contract riêng"} {"id": "d-20260805T190000Z-31447", "type": "descope", "stage": "gate2", "at": "2026-08-05T19:00:00Z", "decision": "Gỡ E3 (stale_scoping_golden) khỏi bộ eval. Golden của nó đóng băng PHÁN QUYẾT staleness của 7 feature khai 0 paths, không phải HÀNH VI scoping — nên nó không có trạng thái ổn định nào: để nguyên thì đỏ sau mọi wave re-pin thành công (đo được: exit 0 trước khi ghim, exit 1 sau khi ghim, cùng một cây); regen về 7 dòng OK thì đỏ ở nhánh sau khi 7 feature đó stale trở lại. Phát hiện trong wave của ci-vitest-sdk-pin, 05/08.", "impact": "AC-3 mất eval máy trực tiếp cho MỆNH ĐỀ (a) (khai 0 paths + thay đổi gated → vẫn báo stale). Hai mệnh đề còn lại (b) không thêm dòng output, (c) không được cấp narrow scope — vẫn được E15 (announce) khẳng định thẳng trên fixture mode `none` (zero paths). Bản đầu của entry này nói quá khoảng hở; sửa lại sau vòng verify context sạch 05/08. Vá = một dòng grep vào $d2 sẵn có trong case_announce, không cần case mới. check-stale-golden.sh, fixture của nó, và key executor stale_scoping_golden trong config.yaml được GIỮ LẠI ở lượt này (xoá là chạm scripts/** và kích lại treadmill staleness) — code chết, và guard đó chạy tay sẽ ĐỎ, đừng nhầm là gate hỏng. SỬA 27/08: cả ba mảnh đã được xoá ở PR #76 dưới hồ sơ gate-tooling-t1 (item 0.8b); lý do hoãn nói trên hết hiệu lực từ 97b5b12 (17/08) — đo được là commit chỉ chạm scripts/** sinh 0 stale violation."} +{"id":"d-20260923T074315Z-20","type":"nghi","stage":"gate2","at":"2026-09-23T07:43:15Z","by":"manh","decision":"thước = kit từ 23/09","impact":"hồ sơ thôi hứa staleness theo paths đã khai: cổng fork mang cơ chế này đã xoá ở #129; kit ghim sha tính staleness trên cả cây ngoài t1_skip_globs, nên lời hứa này không còn ai thực thi, không phải do kit canh thay"} diff --git a/scripts/acceptance/check-fork-scope-teeth.sh b/scripts/acceptance/check-fork-scope-teeth.sh deleted file mode 100755 index 4b790924..00000000 --- a/scripts/acceptance/check-fork-scope-teeth.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env bash -# E9 / AC-8 of gate-tooling-t1 — teeth for the STALE-DIFF-SCOPE-GUARD fork. -# -# WHY THIS EXISTS. The fork lives inside scripts/pre-merge-check.sh, which -# risk_tiers.t1_skip_globs exempts BY NAME. The exemption is there so upgrading -# the measuring stick does not stale signed evidence — but it also means a -# change to this fork's semantics touches no gated file, stales nothing, and -# trips no t1-escape. It is the one place in the gate where behaviour can change -# without any acceptance artifact being required. Measured cost of that hole: -# the fork landed on 2026-08-17 and silently disabled five of check-stale- -# scoping.sh's fourteen cases for ten days, including the one the E3 descope -# decision was relying on. -# -# WHAT IT PINS. Two perturbations, each on a COPY of the tree (the working tree -# is never edited, and the shipped gate carries no knob — AC-13): -# (1) revert the narrowing → the fork wraps the WHOLE staleness block again -# for every slug outside the diff. `fork-declared-in-union` must go RED: -# that is AC-2 of stale-scope-by-paths losing its only observable form. -# (2) remove the fork entirely (`if false`) → every merged feature is examined -# again. `fork-undeclared` must go RED: that is the treadmill re-opening -# for the 19 features that never declared `paths`. -# Each perturbation must be shown to have actually changed the file, and each -# must go green again when reverted — a patch whose target moved would otherwise -# make this guard quietly stop testing anything, which is the exact failure mode -# it is built to rule out. -set -euo pipefail -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"; cd "$ROOT" -GATE_REL=scripts/pre-merge-check.sh -MARKER='# STALE-DIFF-SCOPE-GUARD' -WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT -fails=0 - -echo "check-fork-scope-teeth:" - -# ── Anti-vacuous layer ────────────────────────────────────────────────────── -# The perturbations below rewrite the two lines around a single marker. If the -# marker moved, vanished, or multiplied, every patch becomes a no-op and this -# guard reports OK having proved nothing. -# The OPENING condition is the only line that ENDS with the marker; the closing -# `fi` carries it mid-line ("# đóng STALE-...") and is deliberately not counted. -# Measured, not assumed: `grep -c 'STALE-DIFF-SCOPE-GUARD'` is 2, `grep -c -# '# STALE-DIFF-SCOPE-GUARD$'` is 1. -open_n="$(grep -c "$MARKER\$" "$GATE_REL" || true)" -any_n="$(grep -c 'STALE-DIFF-SCOPE-GUARD' "$GATE_REL" || true)" -if [ "$open_n" -ne 1 ] || [ "$any_n" -lt 2 ]; then - echo "FAIL anti-vacuous: expected exactly ONE line ending in '$MARKER' (the opening condition) and at least two mentions overall in $GATE_REL; found open=$open_n any=$any_n — the perturbation targets have moved, so nothing below would test anything" - exit 1 -fi -gate_sha_before="$(git hash-object "$GATE_REL")" -echo " ok anti-vacuous: opening marker unique, fork block still present" - -# ── Build a pristine mini-root the scoping guard can run inside ───────────── -# scripts/ + lib/ + _acceptance/config.yaml is everything check-stale-scoping.sh -# reads from ROOT; its fixtures build their own git repos under TMPDIR. -PRISTINE="$WORK/pristine" -mkdir -p "$PRISTINE/_acceptance" -cp -R scripts "$PRISTINE/scripts" -cp -R lib "$PRISTINE/lib" -cp _acceptance/config.yaml "$PRISTINE/_acceptance/config.yaml" - -# Replace the two-line fork condition with a single given line. Pure awk, using -# a one-line lookbehind: the marker sits on the CONTINUATION line, so the line -# before it (ending in a backslash) is part of the same condition and must go -# with it. -patch_condition() { # - awk -v repl="$3" ' - $0 ~ /# STALE-DIFF-SCOPE-GUARD$/ && prev ~ /\\$/ && !done { - print repl; done = 1; prev = ""; next - } - prev != "" { print prev } - { prev = $0 } - END { if (prev != "") print prev } - ' "$1" > "$2" -} - -run_case() { # -> exit code - bash "$1/scripts/acceptance/check-stale-scoping.sh" --case "$2" >/dev/null 2>&1 && echo 0 || echo 1 -} - -probe() { #