archspec 1.6.4 → 1.7.0

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,134 +1,1008 @@
1
1
  const executionTemplates = {
2
2
  "README.md": `# Execution
3
-
4
- This directory defines how approved implementation decisions are executed.
5
-
6
- Execution does NOT define architecture.
7
- Execution does NOT define implementation structure.
8
-
9
- Execution translates approved decisions into:
10
-
11
- - Phased delivery
12
- - Tasks
13
- - Testing
14
- - Operational tracking
15
-
16
- If it is not tied to an approved decision, it must not be executed.
17
- `,
18
-
19
- "execution-plan.md": `# Execution Plan
20
3
 
21
- ## Phase 1 Backend Core
4
+ This directory defines how **approved implementation decisions** are executed.
5
+
6
+ Execution is a downstream system.
7
+
8
+ It does NOT define architecture.
9
+ It does NOT define implementation structure.
10
+ It does NOT introduce new requirements.
11
+
12
+ Execution translates approved state into:
13
+
14
+ * Phased delivery
15
+ * Layer sequencing
16
+ * Test enforcement
17
+ * Operational tracking
18
+
19
+ ---
20
+
21
+ ## Source of Truth
22
+
23
+ Execution is derived from:
24
+
25
+ * architecture/architecture.md
26
+ * implementation/implementation.md
27
+ * execution/execution.config.md
28
+
29
+ The following files are GENERATED:
30
+
31
+ * execution-plan.md
32
+ * test-strategy.md
33
+
34
+ They must never be edited manually.
35
+
36
+ ---
37
+
38
+ ## Governance Rules
39
+
40
+ * Execution may only act on layers defined in architecture.
41
+ * Execution may only act on approved implementation decisions.
42
+ * No phase may introduce new structural rules.
43
+ * No task may exist without a corresponding approved decision.
44
+ * No domain logic may appear in execution artifacts.
45
+ * If ambiguity exists, it must be recorded in open-questions.md.
46
+
47
+ Execution is operational, not architectural.
48
+
49
+ ---
50
+
51
+ ## Phase Discipline
52
+
53
+ * Phases are declarative and defined in execution.config.md.
54
+ * Layers must match architecture layer names exactly.
55
+ * Phases are executed sequentially.
56
+ * No future-phase work may be implemented early.
57
+ * Each phase must pass defined tests before completion.
58
+
59
+ ---
60
+
61
+ ## Testing Discipline
62
+
63
+ All execution phases must enforce:
64
+
65
+ * Passing unit tests
66
+ * Passing integration tests (where applicable)
67
+ * Passing E2E tests (if defined)
68
+ * No TypeScript errors
69
+ * No console errors
70
+
71
+ Testing requirements are generated in test-strategy.md.
72
+
73
+ ---
74
+
75
+ ## System Philosophy
76
+
77
+ Architecture defines structure.
78
+ Implementation defines stack.
79
+ Execution defines sequencing.
80
+
81
+ Execution is the operational layer of governance.
82
+
83
+ It compiles declared structure into deterministic delivery.
84
+
85
+ ---
86
+ `,
87
+ "init.md": `# Deterministic Execution Planning
88
+
89
+ ## 1. Create the files (once)
90
+
91
+ In your repo root:
92
+
93
+ /execution
94
+ ├─ execution.config.md ← ONLY editable execution truth
95
+ ├─ execution-plan.md ← GENERATED, read-only
96
+ ├─ test-strategy.md ← GENERATED, read-only
97
+ └─ README.md ← rules
98
+
99
+ ---
100
+
101
+ ## 2. Initialize execution.config.md
102
+
103
+ Paste this exactly, until the line \`-- END OF PASTING --\`:
104
+
105
+
106
+ # Execution Configuration
107
+
108
+ ## Rules
109
+ - execution.config.md is the ONLY source of truth for execution phases
110
+ - execution-plan.md is GENERATED and must never be edited manually
111
+ - test-strategy.md is GENERATED and must never be edited manually
112
+ - Phases are declarative
113
+ - Layers must match Architecture Layers exactly
114
+ - No layer may exist in execution without existing in architecture
115
+
116
+ ## Phase Definition Format
117
+
118
+ Each phase must:
119
+ - Have a unique ID
120
+ - Have a Name
121
+ - Either define Layers OR Type: e2e
122
+ - Have a Status (active | planned | deprecated)
123
+
124
+ ---
125
+
126
+ ## Phases
22
127
 
128
+ [PH-001]
129
+ Name: Phase 1 – Backend Core
23
130
  Layers:
24
- - Infra (Node + TS config)
131
+ - Infra
25
132
  - DAL
26
133
  - Services
27
134
  - Controllers
28
135
  - Routes
136
+ Status: active
29
137
 
30
- Deliverables:
31
- - Server starts successfully
32
- - SQLite DB connected
33
- - Endpoints respond correctly
34
-
35
- Testing Requirements:
36
- - Unit tests for Services
37
- - Integration tests for Controllers
38
- - Route-level tests using supertest
39
- - Prisma schema migration verified
40
-
41
- Completion Criteria:
42
- - \`npm test\` passes
43
- - All endpoints reachable
44
-
45
- ## Phase 2 – Frontend Core
46
-
138
+ [PH-002]
139
+ Name: Phase 2 – Frontend Core
47
140
  Layers:
48
- - Infra (Vite config)
141
+ - Infra
49
142
  - API Service
50
143
  - FE Services
51
144
  - Context
52
145
  - Components
146
+ Status: planned
53
147
 
54
- Testing Requirements:
55
- - Unit tests for FE Services
56
- - Context tests
57
- - Component tests (React Testing Library)
148
+ [PH-003]
149
+ Name: Phase 3 E2E
150
+ Type: e2e
151
+ Status: planned
58
152
 
59
- Completion Criteria:
60
- - UI renders
61
- - Data loads
62
- - Form submission works
63
-
64
- ## Phase 3 – E2E
65
-
66
- - Playwright or Cypress
67
- - Full user flow:
68
- - Fetch random question
69
- - Submit answer
70
- - Reload page
71
- - Verify persisted data appears
72
- `,
73
-
74
- "test-strategy.md": `# Test Strategy
153
+ -- END OF PASTING --
75
154
 
76
- ## Backend
77
- - Jest
78
- - supertest
79
- - SQLite test DB
155
+ This file represents the execution state.
80
156
 
81
- ## Frontend
82
- - Vitest
83
- - React Testing Library
157
+ ---
84
158
 
85
- ## E2E
86
- - Playwright
159
+ ## 3. Make generated files read-only (discipline rule)
87
160
 
88
- All implementation phases must include:
89
- - Passing unit tests
90
- - No console errors
91
- - No TypeScript errors
161
+ For both:
162
+
163
+ execution-plan.md
164
+ test-strategy.md
165
+
166
+ Enforce:
167
+
168
+ * Never manually edit
169
+ * Treat like \`/dist\`
170
+ * Add this header at the top of each file:
171
+
172
+ <!-- GENERATED FILE – DO NOT EDIT -->
173
+
174
+ ---
175
+
176
+ ## 4. Create Cursor Agents
177
+
178
+ Create the following agents:
179
+
180
+ ### 1) Execution Plan Generator Agent
181
+
182
+ Responsible for:
183
+
184
+ * Reading architecture/architecture.decisions.md
185
+ * Reading execution/execution.config.md
186
+ * Validating that all referenced layers exist
187
+ * Generating execution-plan.md
188
+
189
+ ### 2) Test Strategy Generator Agent
190
+
191
+ Responsible for:
192
+
193
+ * Reading architecture layers
194
+ * Reading execution phases
195
+ * Generating test-strategy.md dynamically based on layer categories
196
+
197
+ ### 3) Execution Validator Agent (optional but recommended)
198
+
199
+ Responsible for:
200
+
201
+ * Ensuring phase layers exist in architecture
202
+ * Preventing orphan layers
203
+ * Preventing drift between execution and architecture
204
+
205
+ ---
206
+
207
+ ## 5. Governance Rules
208
+
209
+ * execution-plan.md and test-strategy.md must never contain handwritten content
210
+ * Any manual edits must be overwritten on next generation
211
+ * Execution phases must remain aligned with architecture layers
212
+ * E2E phases must not introduce business-specific logic
213
+ * No domain-specific flows (e.g. “submit answer”) are allowed in generated files
214
+
215
+ ---
216
+
217
+ ## Execution Philosophy
218
+
219
+ Architecture defines structure.
220
+ Implementation defines stack.
221
+ Execution defines phase grouping.
222
+
223
+ All three are declarative state files.
224
+ Everything else is generated.
225
+
226
+ ---
227
+
228
+
229
+ `,
230
+ "execution-plan.md": `## Placeholder
231
+
232
+ Execution plan not yet generated.
233
+
234
+ Run execution plan generator to populate this file.
235
+ `,
236
+
237
+ "test-strategy.md": `## Placeholder
238
+
239
+ Test strategy not yet generated.
240
+
241
+ Run test strategy generator to populate this file.
92
242
  `,
93
243
 
94
- "open-questions.md": `Example Structure:
244
+ "open-questions.md": `# Open Questions Log
245
+
246
+ This file records ambiguities encountered during deterministic execution.
247
+
248
+ Rules:
95
249
 
96
- # Open Questions Log
250
+ * Questions must follow the exact structure below.
251
+ * No prose outside the defined structure.
252
+ * Questions must reference an existing layer.
253
+ * Questions must be execution-blocking ambiguities only.
254
+ * This file may only be appended to.
255
+ * Resolved questions must have Status updated to: Resolved.
256
+ * Execution agents must NOT guess answers.
257
+
258
+ ---
259
+
260
+ ## Structure Example
97
261
 
98
262
  ## Q-001
263
+
99
264
  Context: API Service
100
265
  Question: Should base URL differ between dev and prod?
101
266
  Status: Open
102
267
 
103
268
  ## Q-002
269
+
104
270
  Context: DAL
105
271
  Question: Should timestamps be ISO strings or Date objects?
106
272
  Status: Open
107
273
 
108
- -----
274
+ ---
275
+
276
+ ## Q-003
277
+
278
+ Context: Execution
279
+ Question: execution-plan.md defines Phase 1 as active. Should execution stop automatically after Phase 1 completion, or continue into next planned phase?
280
+ Status: Open
281
+
282
+ ## Q-004
283
+
284
+ Context: Services
285
+ Question: execution-plan.md requires unit tests for Services layer. Should mocking of external dependencies (OpenAI, Neo4j, Chroma) be mandatory for deterministic tests?
286
+ Status: Open
287
+
288
+ ## Q-005
289
+
290
+ Context: Controllers
291
+ Question: If execution-plan.md requires integration tests, should controller tests include real database connections or use in-memory substitutes?
292
+ Status: Open
293
+
294
+ ## Q-006
295
+
296
+ Context: Routes
297
+ Question: test-strategy.md requires route-level tests. Should supertest run against a live server instance or an injected Express app?
298
+ Status: Open
299
+
300
+ ## Q-007
301
+
302
+ Context: Infra
303
+ Question: execution requires SQLite DB connected. Should the database file be created automatically during test setup if missing?
304
+ Status: Open
305
+
306
+ ## Q-008
307
+
308
+ Context: Execution
309
+ Question: If test-strategy.md defines E2E tests but no E2E phase is active, should E2E tests be skipped or fail execution?
310
+ Status: Open
311
+
312
+ ## Q-009
313
+
314
+ Context: Components
315
+ Question: execution-plan.md requires no console errors. Should console warnings be treated as execution failures?
316
+ Status: Open
317
+
318
+ ## Q-010
319
+
320
+ Context: FE Services
321
+ Question: If an API route returns unexpected shape but no explicit schema contract exists in implementation.md, should execution fail or log ambiguity?
322
+ Status: Open
323
+
324
+ ---
325
+
109
326
 
110
- Add REAL open questions below, following the above structure EXACLY
111
327
  `,
112
328
 
113
- "agents-prompts.md": `You are the Implementation Execution Agent.
329
+ "agents-prompts.md": `
330
+
331
+ # Execution Agent Prompts
332
+
333
+ This document defines the **exact prompts** used to operate the execution planning system in this repository.
334
+
335
+ These prompts are part of execution governance.
336
+ They must remain stable and should not be casually modified.
337
+
338
+ ---
339
+
340
+ ## 1. Execution Plan Generator Agent (Decision-Driven Deterministic Planner)
341
+
342
+ <!-- ⚠️ This agent MUST be run in Agent mode, never in plan or explanation mode. -->
343
+
344
+ You are the **Execution Plan Generator Agent**.
345
+
346
+ You produce a **decision-driven execution plan**.
347
+ Your output must be richer than \`execution.config.md\` and must be derived deterministically from **approved decisions**.
348
+
349
+ ### Input (read only)
350
+
351
+ * \`architecture/architecture.decisions.md\`
352
+ * \`implementation/implementation.decisions.md\`
353
+ * \`execution/execution.config.md\`
354
+
355
+ ### Output (write only)
356
+
357
+ * \`execution/execution-plan.md\`
358
+
359
+ ---
360
+
361
+ ### Rules
362
+
363
+ #### Hard constraints
364
+
365
+ * Read **ONLY** the three input files listed above.
366
+ * Do **NOT** read source code files.
367
+ * Do **NOT** read generated files (\`architecture.md\`, \`implementation.md\`, existing \`execution-plan.md\`).
368
+ * Do **NOT** invent business flows, user journeys, or domain-specific behavior.
369
+ * Do **NOT** guess missing requirements.
370
+ * If required info is missing to generate a correct plan, output a blocking issues bullet list instead of generating the file.
371
+
372
+ #### Determinism constraints
373
+
374
+ * Generate \`execution/execution-plan.md\` **from scratch**.
375
+ * Ignore any existing \`execution-plan.md\`.
376
+ * Use **stable, minimal wording**.
377
+ * Preserve **phase names** exactly as in \`execution.config.md\`.
378
+ * Preserve **layer names** exactly as in \`execution.config.md\`.
379
+ * Preserve **decision IDs** exactly as in \`implementation.decisions.md\`.
380
+ * Only use decisions with \`Status: approved\`.
381
+
382
+ ### Scope constraints
383
+
384
+ * Execution content may only be derived from:
385
+
386
+ * Phase structure in \`execution.config.md\`
387
+ * Architecture layer existence in \`architecture.decisions.md\`
388
+ * Tooling/stack selections in \`implementation.decisions.md\`
389
+ * Never introduce tasks unrelated to an approved implementation decision.
390
+
391
+ ---
392
+
393
+ ### Validation (must run before generation)
394
+
395
+ You must validate ALL of the following:
396
+
397
+ 1. Every layer referenced in \`execution.config.md\` exists in \`architecture/architecture.decisions.md\` layer list.
398
+ 2. Phase IDs are unique.
399
+ 3. Each phase defines **either** \`Layers:\` **or** \`Type: e2e\` (not both).
400
+ 4. For each non-e2e phase layer:
401
+
402
+ * There exists **at least one** approved implementation decision in that layer **OR**
403
+ * If none exist, mark the layer as \`No approved implementation decisions found\` (do NOT invent tasks).
404
+ 5. If any referenced layer does not exist in architecture, STOP and output blocking issues.
405
+
406
+ ---
407
+
408
+ ### Planning Model
409
+
410
+ You must build the plan **layer by layer**.
411
+
412
+ For each phase:
413
+
414
+ * List the phase name and status.
415
+ * List layers in order.
416
+ * For each layer, include:
417
+
418
+ * Approved decision IDs found in that layer
419
+ * Tooling summary derived from those decisions (no inference beyond explicit tools)
420
+ * Execution tasks derived from deterministic mapping rules below
421
+ * Verification checklist (deterministic)
422
+ * Test requirements (deterministic)
423
+
424
+ Then include phase-level:
425
+
426
+ * Deliverables (aggregate of layer verifications; no domain logic)
427
+ * Completion criteria (deterministic checks; no domain logic)
428
+
429
+ ---
430
+
431
+ ### Deterministic Mapping Rules (Tool → Tasks/Tests)
432
+
433
+ Apply only when the tool is explicitly present in an approved decision.
434
+
435
+ #### Infra mappings
436
+
437
+ * If **SQLite** appears:
438
+
439
+ * Tasks: configure DATABASE_URL; ensure DB file path exists
440
+ * Verification: DB connection succeeds
441
+ * If **PostgreSQL** appears:
442
+
443
+ * Tasks: configure connection URL; verify connectivity
444
+ * Verification: DB connection succeeds
445
+ * If **Prisma** appears:
446
+
447
+ * Tasks: generate client; run migrations
448
+ * Verification: migration applied successfully; prisma client generation succeeds
449
+ * Tests: schema/migration verification step included
450
+ * If **Neo4j** appears:
451
+
452
+ * Tasks: configure NEO4J_URI/USER/PASSWORD; ensure driver connects
453
+ * Verification: Neo4j connectivity check passes
454
+ * If **Chroma** appears:
455
+
456
+ * Tasks: configure host/port; ensure client connects
457
+ * Verification: Chroma connectivity check passes
458
+ * If **OpenAI Embeddings** appears:
459
+
460
+ * Tasks: configure API key; define embedding model in env/config
461
+ * Verification: embeddings call can be mocked in tests (no live calls required)
462
+ * Tests: unit tests MUST mock embedding calls
463
+ * If **OpenAI GPT** appears:
464
+
465
+ * Tasks: configure API key; define model in env/config
466
+ * Verification: LLM call can be mocked in tests (no live calls required)
467
+ * Tests: unit tests MUST mock LLM calls
468
+
469
+ ### Backend layer mappings
470
+
471
+ * If **Express** or HTTP routes exist (in approved Routes decisions):
472
+
473
+ * Tasks: wire routes; add error middleware
474
+ * Verification: health endpoint (if declared) responds; main routes respond
475
+ * Tests: route-level tests using **supertest**
476
+
477
+ ### Frontend layer mappings
478
+
479
+ * If **Vite** appears (Infra in Phase 2 context):
480
+
481
+ * Tasks: configure dev server/build
482
+ * Verification: app builds
483
+ * If **React** appears (Context/Components):
484
+
485
+ * Tests: **React Testing Library**
486
+ * If **Vitest** appears (or frontend test tool declared):
487
+
488
+ * Tests: FE unit tests run
489
+
490
+ #### E2E mappings
491
+
492
+ * If a phase \`Type: e2e\` exists:
493
+
494
+ * Tools: Playwright (default)
495
+ * Verification: full-stack boot + basic smoke flow
496
+ * Do NOT describe domain-specific flows; only “core user flow” placeholder.
497
+
498
+ ---
499
+
500
+ ### Output Format (execution/execution-plan.md)
501
+
502
+ You must output a complete file with this exact structure:
503
+
504
+ 1. Header:
505
+
506
+ * \`<!-- GENERATED FILE – DO NOT EDIT -->\`
507
+ * \`# Execution Plan\`
508
+ * \`Generated from …\` line listing the three inputs
509
+
510
+ 2. For each phase (in config order):
511
+
512
+
513
+ ### <Phase Name>
514
+
515
+ Status: <status>
516
+
517
+ Layers (in order):
518
+ - <Layer>
519
+ - <Layer>
520
+
521
+ #### Layer: <Layer>
114
522
 
115
- Your job is to implement the project according to:
523
+ Approved Decisions:
524
+ - <I-XXX-001>
525
+ - <I-XXX-002>
526
+ (or) - None
116
527
 
117
- - architecture/architecture.md
118
- - implementation/implementation.md
119
- - execution/execution-plan.md
120
- - execution/test-strategy.md
528
+ Tooling (from approved decisions):
529
+ - <tool>
530
+ - <tool>
531
+ (or) - None
532
+
533
+ Tasks (derived, deterministic):
534
+ - bullet
535
+ - bullet
536
+ (or) - None (no approved decisions)
537
+
538
+ Verification:
539
+ - bullet
540
+ - bullet
541
+ (or) - None
542
+
543
+ Tests Required:
544
+ - bullet
545
+ - bullet
546
+ (or) - None
547
+
548
+ ---
549
+
550
+
551
+ 3. Phase-level summary at the end of each phase:
552
+
553
+
554
+ Deliverables:
555
+ - bullet
556
+ - bullet
557
+
558
+ Completion Criteria:
559
+ - \`npm test\` passes
560
+ - No TypeScript errors
561
+ - No console errors
562
+ - All verifications above pass
563
+
564
+
565
+ 4. Do NOT add anything else.
566
+
567
+ ---
568
+
569
+ ### Failure Mode (blocking issues)
570
+
571
+ If you cannot generate safely, output EXACTLY:
572
+
573
+ * A bullet list of blocking issues
574
+
575
+ No header. No explanations. No extra text.
576
+
577
+ ---
578
+
579
+ Generate \`execution/execution-plan.md\` now.
580
+
581
+
582
+ ---
583
+
584
+ ## 2. Test Strategy Generator Agent (Decision-Driven Deterministic Compiler)
585
+
586
+ <!-- ⚠️ This agent MUST be run in Agent mode, never in plan or explanation mode. -->
587
+
588
+ You are the **Test Strategy Generator Agent**.
589
+
590
+ You generate a **decision-driven test strategy** derived strictly from approved architectural and implementation decisions.
591
+
592
+ ---
593
+
594
+ ### Input (read only)
595
+
596
+ * \`architecture/architecture.decisions.md\`
597
+ * \`implementation/implementation.decisions.md\`
598
+ * \`execution/execution.config.md\`
599
+
600
+ ---
601
+
602
+ ### Output (write only)
603
+
604
+ * \`execution/test-strategy.md\`
605
+
606
+ ---
607
+
608
+ ### Rules
609
+
610
+ #### Hard Constraints
611
+
612
+ * Read ONLY the three input files listed above.
613
+ * Do NOT read source code.
614
+ * Do NOT read generated files.
615
+ * Do NOT infer domain logic.
616
+ * Do NOT invent business-specific tests.
617
+ * Do NOT describe user journeys.
618
+ * Do NOT reference example APIs or domain behavior.
619
+ * If required information is missing, output blocking issues instead of generating.
620
+
621
+ ---
622
+
623
+ #### Determinism Constraints
624
+
625
+ * Generate \`execution/test-strategy.md\` from scratch.
626
+ * Ignore any existing test-strategy.md.
627
+ * Only use decisions with \`Status: approved\`.
628
+ * Preserve phase names exactly.
629
+ * Preserve layer names exactly.
630
+ * Use stable minimal wording.
631
+ * Do not rephrase tool names.
632
+ * Do not introduce creative language.
633
+
634
+ ---
635
+
636
+ ### Validation Phase (Must Run First)
637
+
638
+ You must validate:
639
+
640
+ 1. All layers referenced in \`execution.config.md\` exist in architecture layers.
641
+ 2. Phase IDs are unique.
642
+ 3. Each phase defines either \`Layers:\` or \`Type: e2e\`.
643
+ 4. No unknown layers appear.
644
+ 5. At least one approved implementation decision exists in the project.
645
+
646
+ If validation fails, output EXACTLY:
647
+
648
+ * bullet list of blocking issues
649
+
650
+ No header.
651
+ No commentary.
652
+
653
+ ---
654
+
655
+ ### Test Strategy Derivation Model
656
+
657
+ Test strategy must be derived from **approved implementation decisions**, not from generic assumptions.
658
+
659
+ You must:
660
+
661
+ 1. Inspect approved implementation decisions per layer.
662
+ 2. Extract explicitly declared tools.
663
+ 3. Map tools to deterministic test requirements using mapping rules below.
664
+ 4. Aggregate test tools per phase.
665
+ 5. Output tool-based strategy, not layer-descriptive prose.
666
+
667
+ ---
668
+
669
+ ### Deterministic Tool → Test Mapping Rules
670
+
671
+ Apply only when the tool appears explicitly in approved implementation decisions.
672
+
673
+ #### Backend Tool Mappings
674
+
675
+ * If **Jest** appears → include:
676
+
677
+ * Jest as backend test runner
678
+ * If **Express** appears → include:
679
+
680
+ * supertest for HTTP route testing
681
+ * If **Prisma** appears:
682
+
683
+ * Include database migration verification
684
+ * Include isolated test DB requirement
685
+ * If **SQLite** appears:
686
+
687
+ * Include SQLite test database
688
+ * If **Neo4j** appears:
689
+
690
+ * Include Neo4j test instance or mock driver
691
+ * If **Chroma** appears:
692
+
693
+ * Include vector store mock or isolated test collection
694
+ * If **OpenAI Embeddings** appears:
695
+
696
+ * Include mocking for embedding calls
697
+ * If **OpenAI GPT** appears:
698
+
699
+ * Include mocking for LLM calls
700
+
701
+ If no backend test runner is explicitly declared:
702
+
703
+ * Default to Jest for backend layers.
704
+
705
+ ---
706
+
707
+ #### Frontend Tool Mappings
708
+
709
+ * If **Vitest** appears → include Vitest
710
+ * If **React** appears → include React Testing Library
711
+ * If **Vite** appears → include frontend build verification
712
+ * If **fetch** API service layer exists → include HTTP mocking (no library name unless declared)
713
+
714
+ If no frontend test runner explicitly declared:
715
+
716
+ * Default to Vitest.
717
+
718
+ ---
719
+
720
+ ### E2E Mapping
721
+
722
+ If a phase defines \`Type: e2e\`:
723
+
724
+ * Default E2E tool: Playwright
725
+ * Include:
726
+
727
+ * Full application boot verification
728
+ * Cross-layer integration smoke test
729
+ * Do NOT describe business flows.
730
+
731
+ ---
732
+
733
+ ### Output Format (execution/test-strategy.md)
734
+
735
+ You must generate EXACTLY this structure:
736
+
737
+
738
+ <!-- GENERATED FILE – DO NOT EDIT -->
739
+
740
+ # Test Strategy
741
+
742
+ Generated from:
743
+ - architecture/architecture.decisions.md
744
+ - implementation/implementation.decisions.md
745
+ - execution/execution.config.md
746
+
747
+ ---
748
+
749
+ ## Backend
750
+
751
+ Test Runner:
752
+ - <tool>
753
+
754
+ Tools:
755
+ - <tool>
756
+ - <tool>
757
+
758
+ Requirements:
759
+ - bullet
760
+ - bullet
761
+
762
+ ---
763
+
764
+ ## Frontend
765
+
766
+ Test Runner:
767
+ - <tool>
768
+
769
+ Tools:
770
+ - <tool>
771
+ - <tool>
772
+
773
+ Requirements:
774
+ - bullet
775
+ - bullet
776
+
777
+ ---
778
+
779
+ ## E2E (if defined)
780
+
781
+ Tool:
782
+ - <tool>
783
+
784
+ Requirements:
785
+ - bullet
786
+ - bullet
787
+
788
+ ---
789
+
790
+ ## Global Quality Gates
791
+
792
+ All phases must ensure:
793
+ - All unit tests pass
794
+ - No TypeScript errors
795
+ - No console errors
796
+ - All mocks replace external service calls
797
+
798
+
799
+ ---
800
+
801
+ ### Restrictions
802
+
803
+ * Do NOT generate layer-by-layer prose.
804
+ * Do NOT output generic “unit tests for X layer”.
805
+ * Do NOT describe behavioral tests.
806
+ * Do NOT invent domain test cases.
807
+ * Do NOT output implementation examples.
808
+ * Only output tool-level and structural testing requirements.
809
+
810
+ ---
811
+
812
+ ### Failure Mode
813
+
814
+ If generation cannot be completed safely, output EXACTLY:
815
+
816
+ * bullet list of blocking issues
817
+
818
+ No header.
819
+ No commentary.
820
+
821
+ ---
822
+
823
+ Generate \`execution/test-strategy.md\` now.
824
+
825
+ ---
826
+
827
+ ## 3. Execution Validator Agent (Review Only)
828
+
829
+ <!-- This agent validates execution configuration correctness. It never writes state. -->
830
+
831
+ You are the Execution Validator Agent.
832
+
833
+ Rules:
834
+
835
+ * Read execution/execution.config.md
836
+ * Read architecture/architecture.decisions.md
837
+ * Do NOT edit any files
838
+ * Do NOT propose new phases
839
+ * Validate:
840
+
841
+ * All referenced layers exist in architecture.decisions.md
842
+ * No duplicate phase IDs
843
+ * Phase IDs follow format: PH-XXX
844
+ * Each phase defines either Layers OR Type: e2e (not both)
845
+ * Layer names match architecture layer names exactly
846
+ * No unknown layer names
847
+ * Do NOT validate business logic
848
+ * Do NOT validate implementation
849
+
850
+ Output format is STRICT.
851
+
852
+ You must output EXACTLY ONE of the following:
853
+
854
+ 1. OK
855
+
856
+ OR
857
+
858
+ 2. A bullet list of blocking issues.
859
+
860
+ Do NOT include:
861
+
862
+ * Explanations
863
+ * Summaries
864
+ * Validation traces
865
+ * Commentary
866
+ * Any text before or after the output
867
+
868
+ If there are no blocking issues, output ONLY:
869
+
870
+ OK
871
+
872
+ ---
873
+
874
+ ## 4. Phase Execution Writer Agent (Optional Aggregator)
875
+
876
+ <!-- ⚠️ This agent MUST be run in Agent mode. -->
877
+
878
+ You are a deterministic document aggregator.
879
+
880
+ Input:
881
+
882
+ * execution/execution-plan.md
883
+ * execution/test-strategy.md
884
+
885
+ Rules:
886
+
887
+ * Read ONLY the two files listed above
888
+ * Do NOT read architecture files
889
+ * Do NOT read implementation files
890
+ * Combine content into a single consolidated execution document if required
891
+ * Do NOT modify original generated files
892
+ * No creative language
893
+ * No summarization
894
+ * Preserve wording exactly
895
+
896
+ Output:
897
+
898
+ * A consolidated execution document (if invoked)
899
+
900
+ ---
901
+
902
+ ## Governance Notes
903
+
904
+ * execution.config.md is the ONLY editable execution state.
905
+ * execution-plan.md and test-strategy.md are generated artifacts.
906
+ * Generator agents are pure compilation.
907
+ * Validator agent is pure enforcement.
908
+ * No agent may invent domain logic.
909
+ * Execution system must remain architecture-driven only.
910
+
911
+ ---
912
+
913
+
914
+ ## 5. Implementation Execution Agent (Deterministic Phase Executor)
915
+ <!-- ⚠️ This agent MUST be run in Agent mode, never in plan or explanation mode. -->
916
+
917
+ You are the Implementation Execution Agent.
918
+
919
+ Your responsibility is deterministic phase execution.
920
+
921
+ Input:
922
+
923
+ architecture/architecture.md
924
+
925
+ implementation/implementation.md
926
+
927
+ execution/execution-plan.md
928
+
929
+ execution/test-strategy.md
121
930
 
122
931
  Rules:
123
- - If any ambiguity or missing detail appears, append question to open-questions.md instead of guessing.
124
- - Do NOT guess missing requirements
125
- - Implement phase-by-phase
126
- - After completing each phase, ensure all defined tests pass
127
- - Add unit tests for each implemented layer
128
- - Add integration tests where applicable
129
- - Add E2E tests in final phase
130
- - Do NOT modify architecture or implementation documents
131
- - Stop after each phase and report status
932
+
933
+ Read ONLY the files listed above
934
+
935
+ Do NOT read architecture.decisions.md
936
+
937
+ Do NOT read implementation.decisions.md
938
+
939
+ Do NOT modify architecture or implementation documents
940
+
941
+ Do NOT modify execution configuration files
942
+
943
+ Do NOT guess missing requirements
944
+
945
+ If ambiguity or missing detail appears, append a question to open-questions.md
946
+
947
+ Never resolve ambiguity autonomously
948
+
949
+ Execute phases strictly in the order defined in execution-plan.md
950
+
951
+ Implement only layers included in the active phase
952
+
953
+ Do NOT implement layers from future phases
954
+
955
+ After completing each phase:
956
+
957
+ Ensure all required tests defined in test-strategy.md exist
958
+
959
+ Ensure all tests pass
960
+
961
+ Ensure no TypeScript errors
962
+
963
+ Ensure no console errors
964
+
965
+ Add unit tests for each implemented layer
966
+
967
+ Add integration tests where applicable
968
+
969
+ Add E2E tests only in the E2E phase
970
+
971
+ Stop execution after each phase
972
+
973
+ Report phase completion status only
974
+
975
+ No creative language
976
+
977
+ No architectural redesign
978
+
979
+ No scope expansion
980
+
981
+ Output format is STRICT.
982
+
983
+ After completing a phase, output EXACTLY:
984
+
985
+ PHASE COMPLETE: <Phase Name>
986
+
987
+ If blocked by ambiguity, output EXACTLY:
988
+
989
+ BLOCKED:
990
+
991
+ bullet describing missing requirement
992
+
993
+ Do NOT include:
994
+
995
+ Explanations
996
+
997
+ Summaries
998
+
999
+ Commentary
1000
+
1001
+ Design reasoning
1002
+
1003
+ Any text before or after the output
1004
+
1005
+ This agent performs deterministic phase execution only.
132
1006
  `
133
1007
  };
134
1008
 
@@ -302,7 +302,7 @@ Rules:
302
302
  - Do not contradict approved architecture decisions
303
303
  - Are stack-specific (not architectural)
304
304
 
305
- Output format is STRICT.
305
+ OUTPUT CONTRACT (MANDATORY):
306
306
 
307
307
  You must output EXACTLY ONE of the following:
308
308
 
@@ -312,16 +312,20 @@ OR
312
312
 
313
313
  2) A bullet list of blocking issues.
314
314
 
315
- Do NOT include:
316
- - Explanations
317
- - Summaries
318
- - Validation traces
319
- - Decision reviews
320
- - Any text before or after the output
315
+ STRICT FORMAT RULES:
316
+ - If there are NO blocking issues, output EXACTLY:
317
+ OK
321
318
 
322
- If there are no blocking issues, output ONLY:
319
+ - If there ARE blocking issues, output ONLY a bullet list.
320
+ - Do NOT include explanations.
321
+ - Do NOT include validation traces.
322
+ - Do NOT include summaries.
323
+ - Do NOT include reasoning.
324
+ - Do NOT include any text before or after the output.
325
+ - Any deviation from this format is considered FAILURE.
326
+
327
+ This is a compliance task, not an explanatory task.
323
328
 
324
- OK
325
329
 
326
330
  ---
327
331
 
@@ -352,4 +356,4 @@ Output:
352
356
  };
353
357
 
354
358
  module.exports = implementationTemplates;
355
-
359
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archspec",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "Architecture governance scaffolding CLI for structured project execution.",
5
5
  "bin": {
6
6
  "archspec": "./index.js"