Skip to content

Commit cb6ea2b

Browse files
committed
docs(governance): expand boundary quick cues for ROUTE-003
Add ROUTE-003 adversarial traps to the top-of-cheatsheet boundary summary in EN and zh-TW, with anti-drift tests scoped to that block.
1 parent 0501f26 commit cb6ea2b

4 files changed

Lines changed: 79 additions & 2 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""Anti-drift checks for boundary quick-cue summary in EN/zh-TW cheatsheets."""
2+
3+
import sys
4+
from pathlib import Path
5+
6+
import pytest
7+
8+
sys.path.insert(0, str(Path(__file__).parent))
9+
10+
from test_validate_route_fixture import ( # noqa: E402
11+
BOUNDARY_QUICK_CUE_EN_MARKERS,
12+
BOUNDARY_QUICK_CUE_ZH_MARKERS,
13+
)
14+
15+
SKILLS = Path(__file__).parent.parent.parent / "skills"
16+
EN_CHEATSHEET = SKILLS / "SKILL_TRIGGER_CHEATSHEET.md"
17+
ZH_CHEATSHEET = SKILLS / "SKILL_TRIGGER_CHEATSHEET.zh-TW.md"
18+
DISPATCH_HEADER = "## `reflective-dispatch`"
19+
20+
21+
def _boundary_quick_cues_block(text: str, header: str) -> str:
22+
start = text.find(header)
23+
assert start != -1, f"missing boundary quick-cue header: {header!r}"
24+
end = text.find(DISPATCH_HEADER, start)
25+
assert end != -1, f"missing {DISPATCH_HEADER!r} after boundary quick-cue header"
26+
return text[start:end]
27+
28+
29+
@pytest.fixture(scope="module")
30+
def en_boundary_quick_cues() -> str:
31+
return _boundary_quick_cues_block(EN_CHEATSHEET.read_text(encoding="utf-8"), BOUNDARY_QUICK_CUE_EN_MARKERS[0])
32+
33+
34+
@pytest.fixture(scope="module")
35+
def zh_boundary_quick_cues() -> str:
36+
return _boundary_quick_cues_block(ZH_CHEATSHEET.read_text(encoding="utf-8"), BOUNDARY_QUICK_CUE_ZH_MARKERS[0])
37+
38+
39+
@pytest.mark.parametrize("marker", BOUNDARY_QUICK_CUE_EN_MARKERS)
40+
def test_boundary_quick_cues_present_in_english_summary(en_boundary_quick_cues: str, marker: str):
41+
assert marker in en_boundary_quick_cues, f"English boundary quick-cue summary missing: {marker!r}"
42+
43+
44+
@pytest.mark.parametrize("marker", BOUNDARY_QUICK_CUE_ZH_MARKERS)
45+
def test_boundary_quick_cues_present_in_zh_tw_summary(zh_boundary_quick_cues: str, marker: str):
46+
assert marker in zh_boundary_quick_cues, f"zh-TW boundary quick-cue summary missing: {marker!r}"

reflective-prompt-library/plans/tests/test_validate_route_fixture.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@ def test_round_51_boundary_probes():
116116
# One canonical phrase per ROUTE-003 adversarial group (excluding implement_not_plan_trap / R11).
117117
ROUTE_003_ADVERSARIAL_CHEATSHEET_CUES = tuple(text for text, _ in ROUTE_003_ADVERSARIAL_BOUNDARY_PROBES)
118118

119+
# Top-of-cheatsheet boundary quick-cue summary markers (ROUTE-002 holdout + ROUTE-003 adversarial).
120+
BOUNDARY_QUICK_CUE_EN_MARKERS = (
121+
"Boundary quick cues (ROUTE-002 holdout + ROUTE-003 adversarial):",
122+
"**Plan-only (no code)**",
123+
"**Plain review (non-production)**",
124+
"**Approved spec delivery**",
125+
"**Brief before plan**",
126+
"**Research not brief**",
127+
"**Trivial fix not review**",
128+
"**Production risk not plain review**",
129+
)
130+
131+
BOUNDARY_QUICK_CUE_ZH_MARKERS = (
132+
"邊界速查(ROUTE-002 holdout + ROUTE-003 adversarial):",
133+
"**僅規劃不寫程式**",
134+
"**非正式環境審查**",
135+
"**已核准規格落地**",
136+
"**規劃前先釐清**",
137+
"**研究不是釐清**",
138+
"**小修不是審查**",
139+
"**正式環境風險不是一般審查**",
140+
)
141+
119142

120143
def test_route_003_adversarial_boundary_probes():
121144
"""Anti-drift: ROUTE-003 adversarial boundaries route as fixture expects."""

reflective-prompt-library/skills/SKILL_TRIGGER_CHEATSHEET.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ Routing fairness note:
2121
- When a task uses external content, tool outputs, entity-like records, or side-effectful actions, apply `04-agent/runtime-trust-boundary.md` as a supporting lens with the selected skill.
2222

2323

24-
Boundary quick cues (ROUTE-002 holdout):
24+
Boundary quick cues (ROUTE-002 holdout + ROUTE-003 adversarial):
2525
- **Plan-only (no code)**`reflective-spec-plan` — tickets, rollout plans, or acceptance criteria with explicit no-code context.
2626
- **Plain review (non-production)**`reflective-review` — diff/PR review for readability or regressions when production risk is out of scope.
2727
- **Approved spec delivery**`reflective-implement` — implement or land an approved spec in the repository; not plan-only.
28+
- **Brief before plan**`reflective-brief` — narrow scope or stakeholder alignment before PRD/tickets.
29+
- **Research not brief**`reflective-research` — multi-voice debates or source-backed comparisons, not goal clarification.
30+
- **Trivial fix not review**`reflective-implement` — small code patches in the repo, not diff review.
31+
- **Production risk not plain review**`reflective-risk` — auth/production/billing changes need a risk gate, not readability review.
2832

2933
## `reflective-dispatch`
3034

reflective-prompt-library/skills/SKILL_TRIGGER_CHEATSHEET.zh-TW.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ Skill 契約語言:
2222
若任務包含外部內容、工具輸出、entity-like records 或有副作用的行動,請把 `04-agent/runtime-trust-boundary.md` 作為所選 skill 的輔助檢查鏡頭。
2323

2424

25-
邊界速查(ROUTE-002 holdout):
25+
邊界速查(ROUTE-002 holdout + ROUTE-003 adversarial):
2626
- **僅規劃不寫程式**`reflective-spec-plan` — 工單、驗收標準或 rollout 計畫且明確不要改程式。
2727
- **非正式環境審查**`reflective-review` — 審查 PR/diff 可讀性或 regression,且明確排除正式環境風險評估。
2828
- **已核准規格落地**`reflective-implement` — 在 repository 實作或落地已核准 spec;不是僅規劃。
29+
- **規劃前先釐清**`reflective-brief` — 在 PRD/工單前先收窄 scope 或對齊利害關係人。
30+
- **研究不是釐清**`reflective-research` — 多視角辯論或來源查證,不是 goal clarification。
31+
- **小修不是審查**`reflective-implement` — repo 內小 patch,不是 diff review。
32+
- **正式環境風險不是一般審查**`reflective-risk` — auth/production/billing 變更需要 risk gate。
2933

3034
## `reflective-dispatch`
3135

0 commit comments

Comments
 (0)