@windyroad/architect 0.20.3 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/package.json +6 -2
  4. package/agents/test/architect-codex-eval-contract.bats +0 -33
  5. package/agents/test/architect-needs-direction-verdict.bats +0 -64
  6. package/agents/test/architect-output-formatting.bats +0 -26
  7. package/agents/test/architect-performance-review.bats +0 -76
  8. package/agents/test/architect-pre-edit-review-mode.bats +0 -50
  9. package/agents/test/architect-unratified-dependency-verdict.bats +0 -55
  10. package/hooks/test/architect-compendium-update-entry.bats +0 -299
  11. package/hooks/test/architect-detect-once-per-session.bats +0 -106
  12. package/hooks/test/architect-detect-scope.bats +0 -56
  13. package/hooks/test/architect-enforce-scope.bats +0 -124
  14. package/hooks/test/architect-gate.bats +0 -102
  15. package/hooks/test/architect-mark-reviewed-verdict-grep.bats +0 -113
  16. package/hooks/test/architect-mark-reviewed.bats +0 -26
  17. package/hooks/test/architect-marker-only-exempt.bats +0 -183
  18. package/hooks/test/architect-no-stop-hook.bats +0 -17
  19. package/hooks/test/architect-oversight-marker-discipline.bats +0 -245
  20. package/hooks/test/architect-oversight-nudge.bats +0 -75
  21. package/hooks/test/architect-project-root.bats +0 -81
  22. package/hooks/test/architect-readme-pairing-check.bats +0 -126
  23. package/hooks/test/architect-slide-marker.bats +0 -92
  24. package/hooks/test/codex-agent-completion.bats +0 -64
  25. package/hooks/test/slide-marker-on-subprocess-return.bats +0 -118
  26. package/hooks/test/substance-aware-drift.bats +0 -243
  27. package/scripts/test/check-amends-backreference.bats +0 -68
  28. package/scripts/test/codex-pack-and-agent.bats +0 -86
  29. package/scripts/test/detect-unoversighted.bats +0 -139
  30. package/scripts/test/generate-decisions-compendium.bats +0 -210
  31. package/scripts/test/is-decision-unconfirmed.bats +0 -143
  32. package/skills/capture-adr/test/capture-adr.bats +0 -362
  33. package/skills/create-adr/test/create-adr-adr-044-contract.bats +0 -185
  34. package/skills/create-adr/test/create-adr-codex-eval-contract.bats +0 -34
  35. package/skills/create-adr/test/create-adr-decision-boundary.bats +0 -49
  36. package/skills/create-adr/test/create-adr-id-collision-guard.bats +0 -35
  37. package/skills/create-adr/test/create-adr-next-id-origin-lookup.bats +0 -45
  38. package/skills/create-adr/test/create-adr-rename-restage-reminder.bats +0 -38
  39. package/skills/create-adr/test/create-adr-substance-confirm-pattern.bats +0 -169
  40. package/skills/review-design/test/review-design-codex-contract.bats +0 -22
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: create-adr SKILL.md Step 3 origin-max lookup must use
3
- # `git ls-tree --name-only` to avoid false-matching blob SHA digits (P056).
4
- #
5
- # Structural assertion — Permitted Exception to the source-grep ban
6
- # (ADR-005 / P011). Same defect as manage-problem: default `git ls-tree`
7
- # output carries a 40-char blob SHA that can contain three-digit runs,
8
- # which `grep -oE '[0-9]{3}'` picks up as a false origin_max. `--name-only`
9
- # restores the invariant ADR-019 presumes.
10
- #
11
- # Cross-reference:
12
- # P056: docs/problems/056-ticket-creator-next-id-lookup-blob-sha-false-match.*.md
13
- # P043 (closed): next-ID collision guard in ticket-creator skills
14
- # ADR-019: docs/decisions/019-afk-orchestrator-preflight.*.md
15
- # @jtbd JTBD-002 (ship with confidence — audit trail)
16
-
17
- setup() {
18
- TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
19
- REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
20
- SKILL_FILE="${REPO_ROOT}/packages/architect/skills/create-adr/SKILL.md"
21
- }
22
-
23
- @test "create-adr SKILL.md exists (P056 precondition)" {
24
- [ -f "$SKILL_FILE" ]
25
- }
26
-
27
- @test "create-adr SKILL.md origin-max lookup uses git ls-tree --name-only (P056)" {
28
- # The fix: `git ls-tree --name-only` drops mode/type/SHA columns so the
29
- # digit-extraction regex cannot match SHA hex runs.
30
- run grep -nE "git ls-tree --name-only .* docs/decisions" "$SKILL_FILE"
31
- [ "$status" -eq 0 ]
32
- }
33
-
34
- @test "create-adr SKILL.md does not keep the buggy bare git ls-tree pattern (P056)" {
35
- # Regression guard: `git ls-tree <ref> docs/decisions/` without `--name-only`
36
- # piped directly into a digit regex is the bug.
37
- run grep -nE "git ls-tree [^-].* docs/decisions/ .*\| *grep -oE '\[0-9\]\{3\}'" "$SKILL_FILE"
38
- [ "$status" -ne 0 ]
39
- }
40
-
41
- @test "create-adr SKILL.md cites P056 on the origin-max fix (P056)" {
42
- # Traceability.
43
- run grep -n "P056" "$SKILL_FILE"
44
- [ "$status" -eq 0 ]
45
- }
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: create-adr SKILL.md must document the re-stage-after-Edit
3
- # requirement for ADR supersession renames (Step 6).
4
- #
5
- # Structural assertion — Permitted Exception to the source-grep ban
6
- # (ADR-005 / P011). The test asserts that the supersession step either
7
- # warns authors that `git mv` stages only the rename, or instructs them
8
- # to re-stage the file after editing frontmatter + "Superseded by" section.
9
- #
10
- # Cross-reference:
11
- # P057: docs/problems/057-git-mv-plus-edit-staging-ordering-trap.*.md
12
- # ADR-014: docs/decisions/014-governance-skills-commit-their-own-work.proposed.md
13
- # @jtbd JTBD-002 (ship with confidence — audit trail)
14
-
15
- setup() {
16
- TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
17
- REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
18
- SKILL_FILE="${REPO_ROOT}/packages/architect/skills/create-adr/SKILL.md"
19
- }
20
-
21
- @test "create-adr SKILL.md exists (P057 precondition)" {
22
- [ -f "$SKILL_FILE" ]
23
- }
24
-
25
- @test "create-adr SKILL.md instructs re-staging the renamed ADR file after Edit (P057)" {
26
- # Authors must be told to run `git add <new>` (or equivalent) after editing
27
- # the renamed file (supersession adds a `Superseded by` section and a status
28
- # frontmatter update).
29
- run grep -inE "re-stage|re‑stage|\`git add\`.*after|after.*\`git add\`|git add <new>|git add .*\.superseded\.md|stages only the rename" "$SKILL_FILE"
30
- [ "$status" -eq 0 ]
31
- }
32
-
33
- @test "create-adr SKILL.md cites P057 on the re-stage requirement (P057)" {
34
- # Traceability: the new guidance must cite P057 so reviewers can chase
35
- # the fix back to the incident that motivated it.
36
- run grep -n "P057" "$SKILL_FILE"
37
- [ "$status" -eq 0 ]
38
- }
@@ -1,169 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Substance-confirmation interaction pattern at create-adr Step 5
3
- # (P339 + P340 / user direction 2026-05-31).
4
- #
5
- # tdd-review: structural-permitted (justification: SKILL.md prose contract
6
- # assertions for an interaction-pattern that has no behavioural skill-runtime
7
- # harness yet — P012 + P081 Phase 2 bridge window. Will migrate to
8
- # behavioural form once the harness exists. Isomorphic precedent in this
9
- # directory: create-adr-adr-044-contract.bats and
10
- # create-adr-decision-boundary.bats.)
11
- #
12
- # @problem P339 (create-adr Step 5 bundles substance with draft-acceptance)
13
- # @problem P340 (born-confirmed marker writes on draft-acceptance answer)
14
- # @adr ADR-064 (review-and-confirm-every-ADR; amended for 5 interaction-pattern requirements)
15
- # @adr ADR-066 (born-confirmed marker; amended to gate marker on substantive-answer)
16
- # @adr ADR-074 (substance-confirm-before-build framework; create-adr-surface instance)
17
- # @adr ADR-013 (structured user interaction — AskUserQuestion is the surface)
18
- # @adr ADR-052 (behavioural-by-default with structural bridge window)
19
- # @jtbd JTBD-001 (enforce governance without slowing down — primary)
20
- # @jtbd JTBD-202 (run pre-flight governance checks before release or handover)
21
-
22
- setup() {
23
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
24
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
25
- [ -f "$SKILL_FILE" ]
26
- }
27
-
28
- # ----------------------------------------------------------------------
29
- # Step 5 substance-confirm fire — separate from draft-quality fire.
30
- # ----------------------------------------------------------------------
31
-
32
- @test "SKILL.md Step 5 names a substance-confirm fire distinct from draft-quality review (P339)" {
33
- # P339 root cause: Step 5 currently fires ONE bundled AskUserQuestion that
34
- # confounds substance-of-decision (which option was chosen) with
35
- # draft-quality (is the prose well-written). The amend SHOULD prescribe
36
- # TWO separate firings: substance-confirm first; draft-quality optional.
37
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
38
- [ "$status" -eq 0 ]
39
- [[ "$output" == *"substance-confirm"* ]] || [[ "$output" == *"substance confirm"* ]]
40
- [[ "$output" == *"draft-quality"* ]] || [[ "$output" == *"draft quality"* ]] || [[ "$output" == *"draft review"* ]]
41
- }
42
-
43
- @test "SKILL.md Step 5 prescribes prose briefing in main-turn text BEFORE the substance-confirm AskUserQuestion fires (P340)" {
44
- # User direction 2026-05-31: long AskUserQuestion text is NOT readable on
45
- # some devices (mobile clients, accessibility tooling, certain notification
46
- # surfaces). Long prose + short question IS readable across the full
47
- # device matrix. The split is load-bearing — the briefing MUST live in
48
- # main-turn prose, NOT inside AskUserQuestion text.
49
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
50
- [ "$status" -eq 0 ]
51
- [[ "$output" == *"main-turn"* ]] || [[ "$output" == *"main turn"* ]] || [[ "$output" == *"prose briefing"* ]]
52
- [[ "$output" == *"before"* ]] || [[ "$output" == *"BEFORE"* ]]
53
- }
54
-
55
- @test "SKILL.md Step 5 prescribes each-considered-option as a selectable option (not yes/no shape) (P340)" {
56
- # User direction 2026-05-31: the AskUserQuestion MUST NOT be a yes/no
57
- # shape. It MUST present each considered option as a selectable option in
58
- # the AskUserQuestion options array. The user picks the substantive
59
- # direction positively (chooses an option), not by clicking "yes" on a
60
- # bundled "is this OK?" question.
61
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
62
- [ "$status" -eq 0 ]
63
- [[ "$output" == *"selectable option"* ]] || [[ "$output" == *"each considered option"* ]] || [[ "$output" == *"each option"* ]]
64
- [[ "$output" == *"not yes/no"* ]] || [[ "$output" == *"not a yes/no"* ]] || [[ "$output" == *"NOT yes/no"* ]] || [[ "$output" == *"NOT a yes/no"* ]]
65
- }
66
-
67
- @test "SKILL.md Step 5 prescribes no-IDs-as-explainers in briefing prose or option labels (P340)" {
68
- # User direction 2026-05-31: the briefing prose, the question, and the
69
- # options MUST NOT use IDs as explainers. The user does NOT have access
70
- # to those IDs on all devices. Every option's substance MUST be
71
- # self-contained in the prose + the option label/description.
72
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
73
- [ "$status" -eq 0 ]
74
- [[ "$output" == *"no IDs as explainers"* ]] || [[ "$output" == *"NOT use IDs"* ]] || [[ "$output" == *"without IDs"* ]] || [[ "$output" == *"no ID"* ]] || [[ "$output" == *"self-contained"* ]]
75
- }
76
-
77
- @test "SKILL.md Step 5 prescribes informed-decision-without-external-document-lookup (P340)" {
78
- # User direction 2026-05-31: the user MUST be able to make an informed
79
- # decision without looking up other documents. The briefing +
80
- # AskUserQuestion is a self-contained surface.
81
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
82
- [ "$status" -eq 0 ]
83
- [[ "$output" == *"without external"* ]] || [[ "$output" == *"without looking up"* ]] || [[ "$output" == *"self-contained"* ]] || [[ "$output" == *"without document lookup"* ]]
84
- }
85
-
86
- # ----------------------------------------------------------------------
87
- # Born-confirmed marker write — gated on substantive-answer.
88
- # ----------------------------------------------------------------------
89
-
90
- @test "SKILL.md Step 5 gates born-confirmed marker write on substance-confirm answer specifying a substantive option (P340)" {
91
- # P340 mechanism fix: the marker MUST be written ONLY in response to an
92
- # AskUserQuestion answer that selects ONE specific substantive option from
93
- # the considered-options set. NOT on draft-acceptance / problem-statement-
94
- # OK / bundled answers.
95
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
96
- [ "$status" -eq 0 ]
97
- [[ "$output" == *"human-oversight: confirmed"* ]] || [[ "$output" == *"born-confirmed"* ]] || [[ "$output" == *"oversight marker"* ]]
98
- [[ "$output" == *"ONLY"* ]] || [[ "$output" == *"only when"* ]] || [[ "$output" == *"only if"* ]]
99
- [[ "$output" == *"substantive"* ]] || [[ "$output" == *"substance-confirm"* ]] || [[ "$output" == *"considered options"* ]] || [[ "$output" == *"considered-options"* ]]
100
- }
101
-
102
- @test "SKILL.md Step 5 prescribes re-draft + re-fire when user picks a different option than the draft authored (P340)" {
103
- # User direction 2026-05-31: if the substance-confirm answer selects a
104
- # DIFFERENT option than the one the draft was authored against, the SKILL
105
- # MUST re-draft Decision Outcome (+ Consequences + Confirmation +
106
- # Pros and Cons) against the new choice and re-fire substance-confirm.
107
- # NOT a soft "warn and proceed" — the marker only ever writes when the
108
- # draft authored matches the user's substantive pick.
109
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
110
- [ "$status" -eq 0 ]
111
- shopt -s nocasematch
112
- [[ "$output" == *"re-draft"* ]] || [[ "$output" == *"redraft"* ]] || [[ "$output" == *"re-author"* ]]
113
- [[ "$output" == *"re-fire"* ]] || [[ "$output" == *"refire"* ]] || [[ "$output" == *"re-run"* ]]
114
- shopt -u nocasematch
115
- }
116
-
117
- @test "SKILL.md Step 5 names draft-quality review fire as OPTIONAL and not gating the marker (P340)" {
118
- # The draft-quality review fire (prose quality, consulted/informed list,
119
- # edge cases) is a follow-up to the substance-confirm fire. It MUST NOT
120
- # gate the born-confirmed marker write — that gate sits on the
121
- # substance-confirm answer alone.
122
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
123
- [ "$status" -eq 0 ]
124
- [[ "$output" == *"does NOT gate"* ]] || [[ "$output" == *"does not gate"* ]] || [[ "$output" == *"NOT gate the marker"* ]] || [[ "$output" == *"not gate the marker"* ]]
125
- }
126
-
127
- # ----------------------------------------------------------------------
128
- # No-IDs-as-explainers regression guard — Step 5 prose itself MUST NOT
129
- # require the user to look up IDs to understand the prescribed interaction.
130
- # The PRESCRIPTIVE Step 5 prose is allowed to cite IDs as audit-trail
131
- # annotations (ADR-064, ADR-066, ADR-074, P339, P340 etc.), but the
132
- # EXAMPLE briefing the SKILL prescribes for the agent to emit MUST be
133
- # ID-free. This test checks the prescription, not the prose itself.
134
- # ----------------------------------------------------------------------
135
-
136
- @test "SKILL.md Step 5 prescribes example briefing shape is ID-free (P340 — load-bearing for device matrix)" {
137
- # The Step 5 prose MUST explicitly prescribe that the BRIEFING the agent
138
- # emits (the prose surfacing options + selected option + rationale) is
139
- # ID-free. This is the prescription, not a check on the SKILL prose
140
- # itself.
141
- run awk '/^### 5\. /,/^### 6\. /' "$SKILL_FILE"
142
- [ "$status" -eq 0 ]
143
- # Must call out at least one banned ID-shape in the prescription so the
144
- # contract is unambiguous.
145
- [[ "$output" == *"ADR-"* ]] || [[ "$output" == *"P-NNN"* ]] || [[ "$output" == *"JTBD-"* ]] || [[ "$output" == *"RFC-"* ]] || [[ "$output" == *"identifier"* ]]
146
- }
147
-
148
- # ----------------------------------------------------------------------
149
- # Cross-reference to P339 + P340 and ADR-074 for audit trail.
150
- # ----------------------------------------------------------------------
151
-
152
- @test "SKILL.md cites P339 + P340 in Step 5 amend prose or Related section (audit trail)" {
153
- run grep -nE "P339|P340" "$SKILL_FILE"
154
- [ "$status" -eq 0 ]
155
- }
156
-
157
- @test "SKILL.md cites ADR-074 in Step 5 amend prose (substance-confirm-before-build framework)" {
158
- run grep -nE "ADR-074" "$SKILL_FILE"
159
- [ "$status" -eq 0 ]
160
- }
161
-
162
- # ----------------------------------------------------------------------
163
- # P081 + P132 bridge marker
164
- # ----------------------------------------------------------------------
165
-
166
- @test "bats file carries the tdd-review: structural-permitted marker" {
167
- run grep -nE "tdd-review:[[:space:]]+structural-permitted" "${BATS_TEST_FILENAME}"
168
- [ "$status" -eq 0 ]
169
- }
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- setup() {
4
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
5
- SKILL="$REPO_ROOT/packages/architect/skills/review-design/SKILL.md"
6
- }
7
-
8
- @test "review-design documents Claude and Codex architect invocation paths" {
9
- run grep -n "Claude Code invocation" "$SKILL"
10
- [ "$status" -eq 0 ]
11
- run grep -n "subagent_type: wr-architect:agent" "$SKILL"
12
- [ "$status" -eq 0 ]
13
- run grep -n "Codex invocation" "$SKILL"
14
- [ "$status" -eq 0 ]
15
- run grep -nE "^agent: wr-architect:agent$" "$SKILL"
16
- [ "$status" -eq 0 ]
17
- }
18
-
19
- @test "review-design names generated Codex agent config" {
20
- run grep -n ".codex/agents/wr-architect.toml" "$SKILL"
21
- [ "$status" -eq 0 ]
22
- }