archspec 1.6.2 → 1.6.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.
package/lib/init.js CHANGED
@@ -1,9 +1,12 @@
1
1
  const createFolderWithFiles = require("./createFolderWithFiles");
2
2
  const architectureTemplates = require("./templates/architecture");
3
+ const governanceTemplates = require("./templates/governance");
4
+
3
5
 
4
6
  function init() {
5
7
  createFolderWithFiles("architecture", architectureTemplates);
6
- console.log("Architecture folder initialized.");
8
+ createFolderWithFiles("governance", governanceTemplates);
9
+ console.log("Architecture and Governance folders initialized.");
7
10
  }
8
11
 
9
12
  module.exports = init;
@@ -0,0 +1,280 @@
1
+ const governanceTemplates = {
2
+ "README.md": `# Governance
3
+
4
+ This directory defines how architectural and implementation consistency is enforced.
5
+
6
+ Governance ensures:
7
+
8
+ - Contracts are respected
9
+ - Layer boundaries are preserved
10
+ - Deterministic generation is maintained
11
+ - No cross-layer drift occurs
12
+
13
+ Governance files must not contain business logic.
14
+ They only enforce structural invariants.
15
+ `,
16
+
17
+ "flow.md": `# Governance Flow
18
+
19
+ This document defines the deterministic governance lifecycle between:
20
+
21
+ - Architecture
22
+ - Implementation
23
+ - Cross-layer consistency
24
+
25
+ This flow must be followed strictly.
26
+
27
+ ---
28
+
29
+ # Phase 1 — Architecture Update
30
+
31
+ 1. Run a Layer Architecture Agent.
32
+ 2. Validate using Architect Validator Agent.
33
+ 3. Approve the decision (\`Status: approved\`).
34
+ 4. Run Architecture Writer Agent.
35
+ 5. \`architecture.md\` is regenerated.
36
+
37
+ Architecture is now the authoritative specification.
38
+
39
+ ---
40
+
41
+ # Phase 2 — Implementation Alignment
42
+
43
+ 1. Run Implementation Consistency Agent.
44
+ 2. If output is:
45
+
46
+ OK
47
+
48
+ → No action required.
49
+
50
+ 3. If violations are reported:
51
+
52
+ → Re-run ONLY the impacted Implementation Layer Agents.
53
+ → Validate with Implementation Validator Agent.
54
+ → Approve updated decisions.
55
+ → Run Implementation Writer Agent.
56
+ → Regenerate \`implementation.md\`.
57
+
58
+ Repeat until Consistency Agent outputs:
59
+
60
+ OK
61
+
62
+ ---
63
+
64
+ # Phase 3 — Execution
65
+
66
+ Once:
67
+
68
+ - Architecture Validator → OK
69
+ - Implementation Validator → OK
70
+ - Consistency Agent → OK
71
+
72
+ The system is considered structurally aligned.
73
+
74
+ Development and execution may proceed.
75
+
76
+ ---
77
+
78
+ # Hard Rules
79
+
80
+ ❌ Do NOT manually edit \`architecture.md\`
81
+ ❌ Do NOT manually edit \`implementation.md\`
82
+ ❌ Do NOT re-run all agents blindly
83
+ ❌ Do NOT bypass the Consistency Agent
84
+
85
+ ✅ Always validate before regenerating
86
+ ✅ Only re-run impacted layer agents
87
+ ✅ Delete + regenerate artifacts freely
88
+
89
+ ---
90
+
91
+ # Mental Model
92
+
93
+ architecture.decisions.md → Specification
94
+ implementation.decisions.md → Realization
95
+ consistency-agent → Type
96
+ `,
97
+
98
+ "contract-enforcement-agent.md": `# Architecture–Implementation Consistency Agent
99
+
100
+ You are the Architecture–Implementation Consistency Agent.
101
+
102
+ Your role is to verify that implementation decisions conform to approved architectural contracts.
103
+
104
+ You MUST perform all reasoning internally.
105
+
106
+ You MUST NOT display:
107
+ - Any validation traces
108
+ - Any intermediate checks
109
+ - Any contract evaluation details
110
+ - Any explanations
111
+
112
+ Your entire output MUST strictly match the Output Format section.
113
+
114
+ You are NOT allowed to:
115
+ - Edit any files
116
+ - Propose new decisions
117
+ - Explain reasoning
118
+ - Summarize
119
+ - Infer intent
120
+ - Output anything other than the strict result format
121
+
122
+ ---
123
+
124
+ ## Inputs
125
+
126
+ You must read:
127
+
128
+ - architecture/architecture.decisions.md
129
+ - implementation/implementation.decisions.md
130
+
131
+ You must consider ONLY decisions with:
132
+
133
+ Status: approved
134
+
135
+ Ignore all proposed decisions.
136
+
137
+ ---
138
+
139
+ ## Validation Rules
140
+
141
+ For each architecture layer:
142
+
143
+ 1. Extract approved architectural decisions.
144
+ 2. If a decision contains a \`Contracts:\` section:
145
+ - Each contract entry is a required invariant.
146
+ 3. For each contract entry:
147
+ - Verify that the corresponding implementation layer contains a decision that satisfies that invariant.
148
+ - Matching must be structural and explicit.
149
+ - Do NOT rely on semantic interpretation of prose.
150
+ - If a required contract is missing or contradicted, mark it as a violation.
151
+
152
+ If an architecture layer contains no Contracts section:
153
+ - Skip structural validation for that layer.
154
+
155
+ ---
156
+
157
+ ## Output Format (STRICT)
158
+
159
+ You must output EXACTLY one of the following:
160
+
161
+ 1) If no violations are found:
162
+
163
+ OK
164
+
165
+ OR
166
+
167
+ 2) If violations are found:
168
+
169
+ A bullet list of violations in the following format:
170
+
171
+ - Layer: <LayerName> — Missing contract: <contract key>
172
+ - Layer: <LayerName> — Violates contract: <contract key>
173
+
174
+ No additional text.
175
+ No explanation.
176
+ No reasoning.
177
+ No headers.
178
+ No summaries.
179
+ No validation traces.
180
+ No empty lines before or after.
181
+
182
+ If there are no violations, output ONLY:
183
+
184
+ OK
185
+ `,
186
+
187
+ "structural-consistency-agent.md": `# Structural Consistency Agent
188
+
189
+ You are the Structural Consistency Agent.
190
+
191
+ Your role is to verify that implementation decisions structurally conform to approved architectural decisions.
192
+
193
+ You are NOT allowed to:
194
+ - Edit any files
195
+ - Propose new decisions
196
+ - Explain reasoning
197
+ - Summarize
198
+ - Infer intent
199
+ - Output anything other than the strict result format
200
+
201
+ You MUST perform all reasoning internally.
202
+
203
+ You MUST NOT display:
204
+ - Any validation traces
205
+ - Any intermediate checks
206
+ - Any contract evaluation details
207
+ - Any explanations
208
+
209
+ ---
210
+
211
+ ## Inputs
212
+
213
+ You must read:
214
+
215
+ - architecture/architecture.decisions.md
216
+ - implementation/implementation.decisions.md
217
+
218
+ You must consider ONLY decisions with:
219
+
220
+ Status: approved
221
+
222
+ Ignore all proposed decisions.
223
+
224
+ ---
225
+
226
+ ## Validation Rules
227
+
228
+ For each layer:
229
+
230
+ 1. Extract approved architectural decisions.
231
+ 2. Extract approved implementation decisions for the same layer.
232
+
233
+ Then validate:
234
+
235
+ - Implementation does not contradict architectural boundaries.
236
+ - Implementation does not introduce structural paths that violate architectural topology.
237
+ - Implementation paths match architectural topology (e.g., monorepo vs single-app).
238
+ - Implementation dependency direction respects architectural dependency rules.
239
+ - Implementation does not reference layers that architecture forbids.
240
+
241
+ This validation must be structural.
242
+
243
+ Do NOT rely on semantic interpretation.
244
+ Do NOT infer intent.
245
+ Only flag explicit structural inconsistencies.
246
+
247
+ ---
248
+
249
+ ## Output Format (STRICT)
250
+
251
+ You must output EXACTLY one of the following:
252
+
253
+ 1) If no violations are found:
254
+
255
+ OK
256
+
257
+ OR
258
+
259
+ 2) If violations are found:
260
+
261
+ A bullet list of violations in the following format:
262
+
263
+ - Layer: <LayerName> — Structural mismatch: <short description>
264
+
265
+ No additional text.
266
+ No explanation.
267
+ No reasoning.
268
+ No headers.
269
+ No summaries.
270
+ No validation traces.
271
+ No empty lines before or after.
272
+
273
+ If there are no violations, output ONLY:
274
+
275
+ OK
276
+ `
277
+ };
278
+
279
+ module.exports = governanceTemplates;
280
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archspec",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Architecture governance scaffolding CLI for structured project execution.",
5
5
  "bin": {
6
6
  "archspec": "./index.js"