@windyroad/architect 0.9.1 → 0.9.2-preview.430

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.
@@ -123,5 +123,5 @@
123
123
  }
124
124
  },
125
125
  "name": "wr-architect",
126
- "version": "0.9.1"
126
+ "version": "0.9.2"
127
127
  }
package/agents/agent.md CHANGED
@@ -156,6 +156,17 @@ Emit **NEEDS DIRECTION** only when ALL of the following hold:
156
156
 
157
157
  Do NOT emit Needs Direction for the "obvious choice" / only-one-viable-option case (see "When NOT to flag" above) — over-firing on obvious choices is the over-ask trap CLAUDE.md P132 warns against. Needs Direction is the architect-surface instance of ADR-044 category 1 (direction-setting); `AskUserQuestion` remains a primary-agent affordance — you name the question + options, the main agent owns the ask.
158
158
 
159
+ ### When to flag [Unratified Dependency] (ADR-074 (Confirm a decision's substance before building dependent work) surface 3)
160
+
161
+ When the change or plan under review **explicitly cites or implements** a specific ADR (e.g. the diff/prose says "per ADR-072", a `Refs: ADR-NNN`, or it is authoring the work the ADR governs), check whether that ADR has been **ratified** before letting the change stand. You have Read/Glob/Grep (no Bash), so perform the **read-only equivalent** of `packages/architect/scripts/is-decision-unconfirmed.sh` — mirror BOTH halves of its "unconfirmed" definition:
162
+
163
+ 1. **Frontmatter-scoped marker check.** Read the cited ADR file and inspect ONLY its YAML frontmatter (the block between the leading `---` and the next `---`). The ADR is **ratified** iff that frontmatter contains a line matching `human-oversight: confirmed` — case-insensitive, tolerating trailing whitespace (the canonical predicate greps `-iE '^human-oversight:[[:space:]]*confirmed[[:space:]]*$'`). A body mention of that string does NOT count — it must be in frontmatter.
164
+ 2. **Superseded skip.** A `*.superseded.md` ADR is retired — treat it as ratified-equivalent (do NOT flag); a newer ADR replaced it.
165
+
166
+ Emit **ISSUES FOUND / [Unratified Dependency]** only when the cited ADR's frontmatter lacks the marker AND it is not superseded — action: "ratify ADR-NNN via `/wr-architect:review-decisions` before this lands."
167
+
168
+ **Key the flag on the oversight marker, NEVER on `status:`.** `status: proposed`/`accepted` and `human-oversight:` are orthogonal axes (ADR-066). Building on a **ratified** ADR is fine even when its `status` is still `proposed` — do NOT flag it. Only the *unratified* (marker-absent, non-superseded) case flags. In steady state almost every ADR is ratified (born-confirmed via `create-adr` + the review-decisions drain), so this fires on essentially nothing — do not over-scan or flag transitive/ambient dependence on governed code, only an explicit cite/implement of a specific unratified ADR (the inverse-P078 / P132 over-fire guard).
169
+
159
170
  Issue types:
160
171
  - **[Decision Conflict]**: Change conflicts with an accepted/proposed decision
161
172
  - **[Undocumented Decision]**: Change represents an architectural choice not covered by any existing decision
@@ -163,6 +174,7 @@ Issue types:
163
174
  - **[Decision Format]**: A decision file doesn't follow MADR 4.0 format
164
175
  - **[Missing Supersession]**: A new decision should supersede an old one but doesn't
165
176
  - **[Confirmation Violation]**: New code violates a confirmation criterion of an existing decision
177
+ - **[Unratified Dependency]**: The change/plan explicitly cites or implements an ADR that is **unratified** (its frontmatter lacks `human-oversight: confirmed`, and it is not `*.superseded.md`) — building on it before a human ratifies its substance is the P315 failure mode (ADR-074 (Confirm a decision's substance before building dependent work) enforcement surface 3)
166
178
 
167
179
  ## Constraints
168
180
 
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bats
2
+ # Doc-lint guard: architect agent.md must carry the [Unratified Dependency]
3
+ # verdict (ADR-074 enforcement surface 3 / RFC-010 / P318) — flag a change or
4
+ # plan that explicitly cites/implements an ADR lacking `human-oversight:
5
+ # confirmed` (unratified, non-superseded), keyed on the oversight marker NOT
6
+ # `status:`. Closes the residual P315 foreground gap at the architect-review
7
+ # surface (the ITIL propose-fix surface is covered by RFC-008).
8
+ #
9
+ # tdd-review: structural-permitted (justification: P176 — agent behaviour is
10
+ # prompt-driven with no skill-invocation harness to exercise the verdict
11
+ # behaviourally; ADR-052 Surface 2 structural-justified case, NOT an ADR-005
12
+ # Permitted Exception). When P176 lands, upgrade to a behavioural test that
13
+ # feeds the agent a change citing an unratified ADR and asserts the verdict.
14
+ #
15
+ # Cross-reference:
16
+ # ADR-074 (Confirm a decision's substance before building dependent work — surface 3)
17
+ # ADR-066 (oversight marker; orthogonal status/oversight axes; the "unconfirmed" definition)
18
+ # RFC-010 / P318 (this enforcement surface)
19
+ # ADR-052 Surface 2 (structural-justified verdict) + P176 (harness gap)
20
+ # @jtbd JTBD-002 (ship with confidence) / JTBD-001 (enforce governance without slowing down)
21
+
22
+ setup() {
23
+ AGENT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
24
+ AGENT_FILE="${AGENT_DIR}/agent.md"
25
+ }
26
+
27
+ @test "agent.md lists [Unratified Dependency] as an issue/verdict type (ADR-074 surface 3)" {
28
+ run grep -n '\[Unratified Dependency\]' "$AGENT_FILE"
29
+ [ "$status" -eq 0 ]
30
+ }
31
+
32
+ @test "agent.md has a 'When to flag [Unratified Dependency]' section citing ADR-074" {
33
+ run grep -niE "When to flag \[Unratified Dependency\]" "$AGENT_FILE"
34
+ [ "$status" -eq 0 ]
35
+ run grep -n "ADR-074" "$AGENT_FILE"
36
+ [ "$status" -eq 0 ]
37
+ }
38
+
39
+ @test "agent.md keys the flag on the oversight marker, NOT on status (orthogonal axes)" {
40
+ # ADR-066 / user correction 2026-05-27: building on a ratified-but-proposed ADR is fine.
41
+ run grep -niE "NEVER on .?status|not .?\`?status|orthogonal" "$AGENT_FILE"
42
+ [ "$status" -eq 0 ]
43
+ }
44
+
45
+ @test "agent.md scopes the marker check to frontmatter + skips superseded (mirrors is-decision-unconfirmed.sh)" {
46
+ run grep -niE "frontmatter" "$AGENT_FILE"
47
+ [ "$status" -eq 0 ]
48
+ run grep -niE "superseded" "$AGENT_FILE"
49
+ [ "$status" -eq 0 ]
50
+ }
51
+
52
+ @test "agent.md guards against over-firing on transitive/ambient dependence (inverse-P078)" {
53
+ run grep -niE "explicit(ly)? cite|over-?(fire|scan)|transitive" "$AGENT_FILE"
54
+ [ "$status" -eq 0 ]
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/architect",
3
- "version": "0.9.1",
3
+ "version": "0.9.2-preview.430",
4
4
  "description": "Architecture decision enforcement for AI coding agents",
5
5
  "bin": {
6
6
  "windyroad-architect": "./bin/install.mjs"
@@ -67,6 +67,8 @@ Build a self-contained prompt for the architect subagent that includes:
67
67
  - Any explicit scope from the user
68
68
  - The request: "Review these proposed changes against the project's ADRs. Flag any violations, gaps that need a new ADR, or compliance questions."
69
69
 
70
+ The architect's verdict taxonomy includes **[Unratified Dependency]** (ADR-074 surface 3): if the plan/change explicitly cites or implements an ADR that lacks `human-oversight: confirmed` (unratified, non-superseded), the architect flags ISSUES FOUND with a "ratify via /wr-architect:review-decisions first" action. This applies to plan review exactly as to edit review — a plan built on an unratified decision should not proceed until that decision's substance is ratified. No extra prompt wiring is needed (the agent owns the check); this note records that the surface-3 check is in-scope for plan review.
71
+
70
72
  ### 5. Delegate to wr-architect:agent
71
73
 
72
74
  Invoke the architect subagent via the `Skill` tool: