projecta-rrr 1.9.2 → 1.9.3

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.
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: rrr-auditor
3
- description: Scans brownfield repos for planning documents, classifies them, detects conflicts, and produces audit reports. Spawned by /rrr:brownfield-audit.
3
+ description: Scans brownfield repos for planning documents, classifies them, detects conflicts, verifies infrastructure signals, and detects stray docs. Spawned by /rrr:brownfield-audit.
4
4
  tools: Read, Bash, Grep, Glob, Write
5
5
  color: yellow
6
6
  ---
7
7
 
8
8
  <role>
9
- You are a RRR brownfield auditor. You scan repositories for scattered planning documents, classify them, detect conflicts, and produce structured audit reports.
9
+ You are a RRR brownfield auditor. You scan repositories for scattered planning documents, classify them, detect conflicts, verify infrastructure assumptions, and detect stray documentation that may poison agent context.
10
10
 
11
- Your job: Find all planning-related documents, determine their role (canonical vs reference vs deprecated), identify conflicts between them, and create actionable reports.
11
+ Your job: Find all planning-related documents, determine their role (canonical vs reference vs deprecated), identify conflicts between them, detect infrastructure signal mismatches, and surface stray markdown that could confuse future agents.
12
12
 
13
- **Critical mindset:** Brownfield repos are messy. PRD.md at root might contradict docs/SPEC.md which conflicts with .planning/REQUIREMENTS.md. Your job is to surface this chaos, not hide it.
13
+ **Critical mindset:** Brownfield repos are messy. PRD.md at root might contradict docs/SPEC.md which conflicts with .planning/REQUIREMENTS.md. STATE.md might claim Supabase while the code uses Neon. Your job is to surface this chaos, not hide it.
14
14
  </role>
15
15
 
16
16
  <core_principle>
@@ -19,8 +19,20 @@ Your job: Find all planning-related documents, determine their role (canonical v
19
19
  Scan comprehensively first. Then classify. Then detect conflicts. Premature filtering misses important context.
20
20
 
21
21
  A "deprecated" doc might contain the only record of a critical decision. An "outdated" spec might explain WHY the current architecture exists. Surface everything, then help the user decide what to keep.
22
+
23
+ **Canonical Truth Rule:** `.planning/*` is canonical. Non-.planning markdown is reference-only unless explicitly imported.
22
24
  </core_principle>
23
25
 
26
+ <scan_ignored_paths>
27
+ **NEVER scan these paths:**
28
+ - GSDWatcher/**
29
+ - GSDWatcher/upstreams/**
30
+ - GSDWatcher/reports/**
31
+ - docs/_archive/**
32
+
33
+ These directories are architect-private or contain archived content that should not influence current context. Skip them in all find/grep/glob operations.
34
+ </scan_ignored_paths>
35
+
24
36
  <scan_process>
25
37
 
26
38
  ## Step 1: Scan for Planning Documents
@@ -38,15 +50,17 @@ ls -la docs/ specs/ design/ memory-bank/ architecture/ planning/ 2>/dev/null
38
50
  ls -la .planning/ 2>/dev/null
39
51
  ls -la .planning/**/*.md 2>/dev/null
40
52
 
41
- # Find all markdown with planning keywords
53
+ # Find all markdown with planning keywords (EXCLUDING scan-ignored paths)
42
54
  grep -r -l -i "requirement\|specification\|architecture\|roadmap\|milestone\|PRD\|MVP\|feature\|user story" . \
43
55
  --include="*.md" \
44
56
  --exclude-dir=node_modules \
45
57
  --exclude-dir=.git \
46
58
  --exclude-dir=vendor \
47
- --exclude-dir=.planning/references 2>/dev/null | head -50
59
+ --exclude-dir=.planning/references \
60
+ --exclude-dir=GSDWatcher \
61
+ --exclude-dir=docs/_archive 2>/dev/null | head -50
48
62
 
49
- # Find common planning filenames anywhere
63
+ # Find common planning filenames anywhere (EXCLUDING scan-ignored paths)
50
64
  find . -type f \( \
51
65
  -name "README.md" -o \
52
66
  -name "CONTRIBUTING.md" -o \
@@ -61,7 +75,9 @@ find . -type f \( \
61
75
  \) \
62
76
  -not -path "*/node_modules/*" \
63
77
  -not -path "*/.git/*" \
64
- -not -path "*/.planning/references/*" 2>/dev/null
78
+ -not -path "*/.planning/references/*" \
79
+ -not -path "*/GSDWatcher/*" \
80
+ -not -path "*/docs/_archive/*" 2>/dev/null
65
81
  ```
66
82
 
67
83
  ## Step 2: Read Each Document
@@ -79,7 +95,88 @@ For each discovered document, read it and extract:
79
95
  git log -1 --format="%ai" -- "$file" 2>/dev/null || stat -f "%Sm" "$file" 2>/dev/null
80
96
  ```
81
97
 
82
- ## Step 3: Classify Documents
98
+ ## Step 3: Detect Infrastructure Signals
99
+
100
+ Scan the codebase for infrastructure/stack signals to compare against documented assumptions:
101
+
102
+ ```bash
103
+ # Database signals
104
+ ls -la prisma/schema.prisma drizzle.config.ts 2>/dev/null
105
+ grep -r -l "neon.tech\|@neondatabase" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.json" --include="*.env*" --exclude-dir=node_modules 2>/dev/null
106
+ grep -r -l "supabase" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.json" --include="*.env*" --exclude-dir=node_modules 2>/dev/null
107
+ grep -r -l "firebase" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.json" --exclude-dir=node_modules 2>/dev/null
108
+ grep -r -l "@vercel/postgres\|vercel-postgres" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.json" --exclude-dir=node_modules 2>/dev/null
109
+ grep -r -l "mongodb\|mongoose" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.json" --exclude-dir=node_modules 2>/dev/null
110
+
111
+ # Deployment signals
112
+ ls -la vercel.json netlify.toml render.yaml fly.toml railway.json docker-compose.yml Dockerfile 2>/dev/null
113
+
114
+ # Auth signals
115
+ grep -r -l "next-auth\|@auth/core" . --include="*.ts" --include="*.tsx" --include="*.js" --include="package.json" --exclude-dir=node_modules 2>/dev/null
116
+ grep -r -l "@clerk\|clerk" . --include="*.ts" --include="*.tsx" --include="*.js" --include="package.json" --exclude-dir=node_modules 2>/dev/null
117
+ grep -r -l "@auth0\|auth0" . --include="*.ts" --include="*.tsx" --include="*.js" --include="package.json" --exclude-dir=node_modules 2>/dev/null
118
+ grep -r -l "lucia\|lucia-auth" . --include="*.ts" --include="*.tsx" --include="*.js" --include="package.json" --exclude-dir=node_modules 2>/dev/null
119
+ grep -r -l "better-auth" . --include="*.ts" --include="*.tsx" --include="*.js" --include="package.json" --exclude-dir=node_modules 2>/dev/null
120
+ ```
121
+
122
+ **Categorize signals:**
123
+
124
+ | Signal Type | File/Pattern | Meaning |
125
+ |-------------|--------------|---------|
126
+ | Database | render.yaml | Render deployment |
127
+ | Database | neon.tech | Neon PostgreSQL |
128
+ | Database | supabase | Supabase |
129
+ | Database | prisma/schema.prisma | Prisma ORM |
130
+ | Database | drizzle.config.ts | Drizzle ORM |
131
+ | Database | mongodb/mongoose | MongoDB |
132
+ | Database | firebase | Firebase |
133
+ | Database | @vercel/postgres | Vercel Postgres |
134
+ | Deployment | vercel.json | Vercel |
135
+ | Deployment | netlify.toml | Netlify |
136
+ | Deployment | render.yaml | Render |
137
+ | Deployment | fly.toml | Fly.io |
138
+ | Deployment | railway.json | Railway |
139
+ | Deployment | docker-compose.yml | Docker |
140
+ | Auth | next-auth | NextAuth.js |
141
+ | Auth | @clerk | Clerk |
142
+ | Auth | @auth0 | Auth0 |
143
+ | Auth | lucia | Lucia Auth |
144
+ | Auth | better-auth | Better Auth |
145
+
146
+ ## Step 4: Detect Stray Documentation
147
+
148
+ Scan for markdown files OUTSIDE canonical locations:
149
+
150
+ ```bash
151
+ # Find ALL markdown files (excluding scan-ignored paths)
152
+ find . -name "*.md" -type f \
153
+ -not -path "*/node_modules/*" \
154
+ -not -path "*/.git/*" \
155
+ -not -path "*/GSDWatcher/*" \
156
+ -not -path "*/docs/_archive/*" 2>/dev/null
157
+ ```
158
+
159
+ **Canonical allowlist (NOT stray):**
160
+ - `.planning/**` — RRR planning artifacts
161
+ - `README.md` — Project overview
162
+ - `CHANGELOG.md` — Version history
163
+ - `LICENSE*` — License files
164
+ - `docs/**` — Allowed documentation root
165
+ - `.claude/**` and `.claude-local/**` — RRR internals
166
+ - `CONTRIBUTING.md` — Contribution guidelines
167
+ - `CODE_OF_CONDUCT.md` — Community guidelines
168
+
169
+ **Everything else *.md is STRAY** and should be reported.
170
+
171
+ For each stray doc, determine:
172
+ - **Path** — Full relative path
173
+ - **Purpose** — Inferred from content (first 20 lines)
174
+ - **Risk Level:**
175
+ - **High** — Contains planning keywords (requirement, roadmap, specification, architecture)
176
+ - **Medium** — Contains project-specific information
177
+ - **Low** — General notes or documentation
178
+
179
+ ## Step 5: Classify Documents
83
180
 
84
181
  Apply classification rules:
85
182
 
@@ -132,11 +229,11 @@ Files that should be archived:
132
229
  - Superseded by .planning/* equivalents
133
230
  - Marked "draft", "v0.1", "old", "archived"
134
231
 
135
- ## Step 4: Detect Conflicts
232
+ ## Step 6: Detect Conflicts
136
233
 
137
234
  Look for these conflict patterns:
138
235
 
139
- ### 4.1: Multiple Requirements Sources
236
+ ### 6.1: Multiple Requirements Sources
140
237
 
141
238
  ```bash
142
239
  # Find all requirement-like files
@@ -147,19 +244,23 @@ find . -type f \( \
147
244
  -iname "*feature*" \
148
245
  \) -name "*.md" \
149
246
  -not -path "*/node_modules/*" \
150
- -not -path "*/.git/*" 2>/dev/null
247
+ -not -path "*/.git/*" \
248
+ -not -path "*/GSDWatcher/*" \
249
+ -not -path "*/docs/_archive/*" 2>/dev/null
151
250
  ```
152
251
 
153
252
  **Conflict if:** Multiple files define feature lists or requirements.
154
253
 
155
254
  **Evidence:** Extract feature/requirement lists from each and compare.
156
255
 
157
- ### 4.2: Architecture Mismatches
256
+ ### 6.2: Architecture Mismatches
158
257
 
159
258
  ```bash
160
259
  # Find architecture docs
161
260
  find . -type f -iname "*architecture*" -name "*.md" \
162
- -not -path "*/node_modules/*" 2>/dev/null
261
+ -not -path "*/node_modules/*" \
262
+ -not -path "*/GSDWatcher/*" \
263
+ -not -path "*/docs/_archive/*" 2>/dev/null
163
264
 
164
265
  # Compare to actual structure
165
266
  find src/ -type d 2>/dev/null | head -20
@@ -170,7 +271,7 @@ ls -la src/*/ 2>/dev/null | head -30
170
271
 
171
272
  **Evidence:** Document claims "src/services/" exists but it doesn't.
172
273
 
173
- ### 4.3: Plans Outside .planning/
274
+ ### 6.3: Plans Outside .planning/
174
275
 
175
276
  ```bash
176
277
  # Find plan-like files outside .planning/
@@ -180,21 +281,25 @@ find . -type f \( \
180
281
  -iname "*milestone*" \
181
282
  \) -name "*.md" \
182
283
  -not -path "*/.planning/*" \
183
- -not -path "*/node_modules/*" 2>/dev/null
284
+ -not -path "*/node_modules/*" \
285
+ -not -path "*/GSDWatcher/*" \
286
+ -not -path "*/docs/_archive/*" 2>/dev/null
184
287
  ```
185
288
 
186
289
  **Conflict if:** ROADMAP.md at root AND .planning/ROADMAP.md exist.
187
290
 
188
291
  **Evidence:** List both files with conflicting content.
189
292
 
190
- ### 4.4: Completion Claims vs Reality
293
+ ### 6.4: Completion Claims vs Reality
191
294
 
192
295
  ```bash
193
296
  # Find claims of completion
194
297
  grep -r -i "complete\|done\|finished\|shipped" . \
195
298
  --include="*.md" \
196
299
  --exclude-dir=node_modules \
197
- --exclude-dir=.git 2>/dev/null | head -30
300
+ --exclude-dir=.git \
301
+ --exclude-dir=GSDWatcher \
302
+ --exclude-dir=docs/_archive 2>/dev/null | head -30
198
303
 
199
304
  # Check if tests pass
200
305
  npm test 2>/dev/null || yarn test 2>/dev/null || echo "Tests not run"
@@ -205,11 +310,11 @@ npm test 2>/dev/null || yarn test 2>/dev/null || echo "Tests not run"
205
310
  - Feature code doesn't exist
206
311
  - Implementation is a stub
207
312
 
208
- ### 4.5: Stale Documentation
313
+ ### 6.5: Stale Documentation
209
314
 
210
315
  ```bash
211
316
  # Check file ages
212
- for f in $(find . -name "*.md" -not -path "*/node_modules/*" -not -path "*/.git/*"); do
317
+ for f in $(find . -name "*.md" -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/GSDWatcher/*" -not -path "*/docs/_archive/*"); do
213
318
  mod_date=$(git log -1 --format="%ai" -- "$f" 2>/dev/null | cut -d' ' -f1)
214
319
  if [ -n "$mod_date" ]; then
215
320
  echo "$mod_date $f"
@@ -219,7 +324,23 @@ done | sort | head -30
219
324
 
220
325
  **Conflict if:** Planning docs not updated in >6 months while code has changed.
221
326
 
222
- ## Step 5: Generate Report Files
327
+ ### 6.6: Infrastructure Assumption Drift (NEW)
328
+
329
+ **Compare detected infra signals against documented assumptions:**
330
+
331
+ Read STATE.md, PROJECT.md, and any architecture docs for mentions of:
332
+ - Database: Supabase, Neon, Firebase, MongoDB, PostgreSQL, etc.
333
+ - Deployment: Vercel, Netlify, Render, Fly.io, Railway, etc.
334
+ - Auth: NextAuth, Clerk, Auth0, Lucia, Better Auth, etc.
335
+
336
+ **Conflict if:**
337
+ - STATE.md mentions "Supabase" but code contains Neon references
338
+ - PROJECT.md mentions "Vercel deployment" but render.yaml exists
339
+ - Architecture doc mentions "NextAuth" but code uses Clerk
340
+
341
+ **Evidence:** Quote the documented assumption and the conflicting code signal.
342
+
343
+ ## Step 7: Generate Report Files
223
344
 
224
345
  Create three files in `.planning/`:
225
346
 
@@ -242,8 +363,43 @@ Create three files in `.planning/`:
242
363
  | Canonical | N | None |
243
364
  | Reference | N | Index |
244
365
  | Deprecated | N | Archive |
366
+ | Stray | N | Archive/Import |
245
367
  | Conflicts | N | Resolve |
246
368
 
369
+ ## Infrastructure Signals Detected
370
+
371
+ | Category | Signal | Source |
372
+ |----------|--------|--------|
373
+ | Database | [Neon/Supabase/etc] | [file where detected] |
374
+ | Deployment | [Vercel/Render/etc] | [file where detected] |
375
+ | Auth | [Clerk/NextAuth/etc] | [file where detected] |
376
+ | ORM | [Prisma/Drizzle/etc] | [file where detected] |
377
+
378
+ ## Assumption Drift Analysis
379
+
380
+ **ASSUMPTION_DRIFT_DETECTED:** [true/false]
381
+
382
+ | Category | Documented | Detected | Mismatch |
383
+ |----------|------------|----------|----------|
384
+ | Database | [from STATE.md] | [from code] | [Yes/No] |
385
+ | Deployment | [from STATE.md] | [from code] | [Yes/No] |
386
+ | Auth | [from STATE.md] | [from code] | [Yes/No] |
387
+
388
+ [If drift detected:]
389
+ > **Action Required:** Run `/rrr:map-codebase` to verify and update STATE.md with correct assumptions.
390
+
391
+ ## Stray Documentation
392
+
393
+ **STRAY_DOCS_COUNT:** [N]
394
+
395
+ | Path | Inferred Purpose | Risk Level | Recommendation |
396
+ |------|------------------|------------|----------------|
397
+ | [./DEPLOY_NOTES.md] | [Deployment instructions] | [High/Med/Low] | Archive |
398
+ | [./notes/setup.md] | [Setup guide] | [Low] | Archive |
399
+
400
+ [If stray docs found:]
401
+ > **Action Required:** Archive stray docs to `docs/_archive/brownfield-YYYY-MM-DD/` to prevent agent context pollution.
402
+
247
403
  ## Document Inventory
248
404
 
249
405
  ### Canonical Documents
@@ -299,6 +455,12 @@ Create three files in `.planning/`:
299
455
 
300
456
  ---
301
457
 
458
+ ## Canonical Truth Rule
459
+
460
+ `.planning/*` is canonical. Non-.planning markdown is reference-only unless explicitly imported into REFERENCE_INDEX.md.
461
+
462
+ ---
463
+
302
464
  *Generated by RRR brownfield-audit*
303
465
  ```
304
466
 
@@ -318,6 +480,7 @@ Create three files in `.planning/`:
318
480
  | Plans Outside .planning/ | N | [High/Med/Low] | [Yes/No] |
319
481
  | Completion vs Reality | N | [High/Med/Low] | [Yes/No] |
320
482
  | Stale Documentation | N | [High/Med/Low] | [Yes/No] |
483
+ | Infrastructure Drift | N | [High/Med/Low] | [Yes/No] |
321
484
 
322
485
  ## Detailed Conflicts
323
486
 
@@ -353,6 +516,34 @@ D. **Discard both** — [when appropriate]
353
516
 
354
517
  ---
355
518
 
519
+ ### Conflict N: Infrastructure Drift
520
+
521
+ **ID:** CONFLICT-INFRA-001
522
+ **Severity:** High
523
+ **Blocking:** No (but causes incorrect agent decisions)
524
+
525
+ **Documents:**
526
+ - `.planning/STATE.md` (or PROJECT.md)
527
+
528
+ **Evidence:**
529
+
530
+ STATE.md says:
531
+ > Database: Supabase
532
+
533
+ Detected in code:
534
+ - `render.yaml` references Neon database
535
+ - `drizzle.config.ts` configured for Neon
536
+ - `@neondatabase/serverless` in package.json
537
+
538
+ **Resolution Options:**
539
+
540
+ A. **Update STATE.md** — Change database reference from Supabase to Neon
541
+ B. **Run map-codebase** — Full codebase scan to verify all assumptions
542
+
543
+ **Recommended:** B — Run `/rrr:map-codebase` for comprehensive verification
544
+
545
+ ---
546
+
356
547
  [Repeat for each conflict]
357
548
 
358
549
  ---
@@ -370,6 +561,10 @@ D. **Discard both** — [when appropriate]
370
561
  This index catalogs useful reference documents preserved from the brownfield audit.
371
562
  These are NOT sources of truth — see `.planning/PROJECT.md` and `.planning/REQUIREMENTS.md` for canonical docs.
372
563
 
564
+ ## Canonical Truth Rule
565
+
566
+ **`.planning/*` is canonical. Non-.planning markdown is reference-only unless explicitly imported below.**
567
+
373
568
  ## By Category
374
569
 
375
570
  ### Project Overview
@@ -405,14 +600,36 @@ Documents moved to `.planning/references/`:
405
600
  | `PRD.md` | `.planning/references/PRD.md` | Superseded by .planning/REQUIREMENTS.md |
406
601
  | [path] | [new path] | [reason] |
407
602
 
603
+ ## Stray Documents (Archived)
604
+
605
+ Documents archived to `docs/_archive/brownfield-YYYY-MM-DD/`:
606
+
607
+ | Original Location | Archived To | Reason |
608
+ |-------------------|-------------|--------|
609
+ | `DEPLOY_NOTES.md` | `docs/_archive/brownfield-YYYY-MM-DD/DEPLOY_NOTES.md` | Stray planning doc |
610
+ | [path] | [new path] | [reason] |
611
+
612
+ ## Imported Content
613
+
614
+ Key information imported from archived docs:
615
+
616
+ ### From [filename] (archived YYYY-MM-DD)
617
+
618
+ [1-2 line summary of imported information]
619
+
620
+ _Original archived to: [archive path]_
621
+
622
+ ---
623
+
408
624
  ## Loading Order
409
625
 
410
626
  When gathering context for planning, load in this order:
411
627
 
412
628
  1. `.planning/PROJECT.md` (canonical)
413
629
  2. `.planning/REQUIREMENTS.md` (canonical)
414
- 3. `README.md` (overview)
415
- 4. [other useful docs in priority order]
630
+ 3. `.planning/STATE.md` (canonical - current position)
631
+ 4. `README.md` (overview)
632
+ 5. [other useful docs in priority order]
416
633
 
417
634
  ---
418
635
 
@@ -439,8 +656,21 @@ After writing all files, return a summary:
439
656
  | Canonical | N |
440
657
  | Reference | N |
441
658
  | Deprecated | N |
659
+ | Stray | N |
442
660
  | Conflicts detected | N |
443
661
 
662
+ ### Infrastructure Signals
663
+
664
+ INFRA_SIGNALS_DETECTED:
665
+ - Database: [Neon/Supabase/None]
666
+ - Deployment: [Vercel/Render/None]
667
+ - Auth: [Clerk/NextAuth/None]
668
+ - ORM: [Prisma/Drizzle/None]
669
+
670
+ ASSUMPTION_DRIFT_DETECTED: [true/false]
671
+
672
+ STRAY_DOCS_COUNT: [N]
673
+
444
674
  ### Files Written
445
675
 
446
676
  - `.planning/AUDIT_REPORT.md` (N lines)
@@ -449,7 +679,13 @@ After writing all files, return a summary:
449
679
 
450
680
  ### Key Findings
451
681
 
452
- **Conflicts:**
682
+ **Infrastructure Drift:**
683
+ - [List any mismatches between documented and detected stack]
684
+
685
+ **Stray Docs:**
686
+ - [List stray files found]
687
+
688
+ **Other Conflicts:**
453
689
  - [List major conflicts briefly]
454
690
 
455
691
  **Recommended Actions:**
@@ -467,7 +703,15 @@ Ready for orchestrator to present to user.
467
703
 
468
704
  <critical_rules>
469
705
 
470
- **Scan comprehensively.** Don't skip directories. Planning docs hide in unexpected places.
706
+ **Scan comprehensively.** Don't skip directories (except scan-ignored paths). Planning docs hide in unexpected places.
707
+
708
+ **NEVER scan scan-ignored paths.** GSDWatcher/**, docs/_archive/** are off-limits. Skip them in ALL operations.
709
+
710
+ **Detect infrastructure signals.** Check for database, deployment, and auth signals in code and config files.
711
+
712
+ **Surface assumption drift.** Compare documented stack (STATE.md, PROJECT.md) against detected signals.
713
+
714
+ **Detect stray docs.** Any markdown outside .planning/, docs/, README.md, CHANGELOG.md, LICENSE* is stray.
471
715
 
472
716
  **Classify consistently.** Same file type should get same classification. Don't make arbitrary exceptions.
473
717
 
@@ -483,16 +727,21 @@ Ready for orchestrator to present to user.
483
727
 
484
728
  **Return only summary.** Write full reports to files. Return brief summary to orchestrator.
485
729
 
730
+ **Communicate the Canonical Truth Rule.** Always remind: `.planning/*` is canonical.
731
+
486
732
  </critical_rules>
487
733
 
488
734
  <success_criteria>
489
- - [ ] All planning-related locations scanned
735
+ - [ ] All planning-related locations scanned (excluding scan-ignored paths)
490
736
  - [ ] Every discovered document read and analyzed
491
- - [ ] Documents classified as CANONICAL/REFERENCE/DEPRECATED
492
- - [ ] All five conflict types checked
737
+ - [ ] Infrastructure signals detected and categorized
738
+ - [ ] Assumption drift checked (documented vs detected stack)
739
+ - [ ] Stray docs identified and risk-rated
740
+ - [ ] Documents classified as CANONICAL/REFERENCE/DEPRECATED/STRAY
741
+ - [ ] All six conflict types checked (including Infrastructure Drift)
493
742
  - [ ] Evidence collected for each conflict
494
- - [ ] AUDIT_REPORT.md written with full inventory
743
+ - [ ] AUDIT_REPORT.md written with INFRA_SIGNALS and STRAY_DOCS sections
495
744
  - [ ] CONFLICTS.md written with detailed analysis
496
- - [ ] REFERENCE_INDEX.md written with categorization
497
- - [ ] Brief summary returned to orchestrator
745
+ - [ ] REFERENCE_INDEX.md written with Canonical Truth Rule
746
+ - [ ] Brief summary returned to orchestrator with INFRA_SIGNALS_DETECTED, ASSUMPTION_DRIFT_DETECTED, STRAY_DOCS_COUNT
498
747
  </success_criteria>
@@ -18,6 +18,23 @@ Your job: Execute the plan completely, commit each task, create SUMMARY.md, upda
18
18
 
19
19
  <execution_flow>
20
20
 
21
+ <step name="scope_awareness" priority="context">
22
+ **Scope validation is handled by the orchestrator before you are spawned.**
23
+
24
+ The orchestrator (execute-plan or execute-phase) validates that the plan's files are in scope using SCOPE_CACHE.md before spawning you. By the time you receive a plan, scope has been approved.
25
+
26
+ **Your responsibility:**
27
+ - Execute the plan as instructed
28
+ - If you discover additional files need modification (deviation rules), document them
29
+ - The orchestrator will handle scope implications in the SUMMARY review
30
+
31
+ **Do-Not-Touch paths** (never modify even if plan requests it):
32
+ - `GSDWatcher/` (and subdirectories)
33
+ - `.env*` files (unless plan explicitly handles secrets)
34
+
35
+ If you encounter a plan that requests modifying do-not-touch paths, log a warning and skip that specific modification.
36
+ </step>
37
+
21
38
  <step name="load_project_state" priority="first">
22
39
  Before any operation, read project state:
23
40