yarramate 0.3.2 → 0.4.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.
@@ -0,0 +1,273 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://yarramate.org/schema/status-result/v1",
4
+ "title": "YarraMate workspace status result",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "format",
9
+ "workspace",
10
+ "ok",
11
+ "check",
12
+ "inventory"
13
+ ],
14
+ "properties": {
15
+ "format": {
16
+ "const": "yarramate/status-result/v1"
17
+ },
18
+ "workspace": {
19
+ "type": "string",
20
+ "minLength": 1
21
+ },
22
+ "ok": {
23
+ "type": "boolean"
24
+ },
25
+ "check": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "ok",
30
+ "diagnostics"
31
+ ],
32
+ "properties": {
33
+ "ok": {
34
+ "type": "boolean"
35
+ },
36
+ "diagnostics": {
37
+ "type": "array",
38
+ "items": {
39
+ "$ref": "#/$defs/diagnostic"
40
+ }
41
+ },
42
+ "counted": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": [
46
+ "documents",
47
+ "concepts",
48
+ "relationships",
49
+ "states"
50
+ ],
51
+ "properties": {
52
+ "documents": {
53
+ "type": "integer",
54
+ "minimum": 0
55
+ },
56
+ "concepts": {
57
+ "type": "integer",
58
+ "minimum": 0
59
+ },
60
+ "relationships": {
61
+ "type": "integer",
62
+ "minimum": 0
63
+ },
64
+ "states": {
65
+ "type": "integer",
66
+ "minimum": 0
67
+ }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "reconciliation": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": [
76
+ "evidenceDocuments",
77
+ "observations",
78
+ "confirmed",
79
+ "findings",
80
+ "contradicted",
81
+ "unknown",
82
+ "notObserved"
83
+ ],
84
+ "properties": {
85
+ "evidenceDocuments": {
86
+ "type": "integer",
87
+ "minimum": 0
88
+ },
89
+ "observations": {
90
+ "type": "integer",
91
+ "minimum": 0
92
+ },
93
+ "confirmed": {
94
+ "type": "integer",
95
+ "minimum": 0
96
+ },
97
+ "findings": {
98
+ "type": "integer",
99
+ "minimum": 0
100
+ },
101
+ "contradicted": {
102
+ "type": "integer",
103
+ "minimum": 0
104
+ },
105
+ "unknown": {
106
+ "type": "integer",
107
+ "minimum": 0
108
+ },
109
+ "notObserved": {
110
+ "type": "integer",
111
+ "minimum": 0
112
+ }
113
+ }
114
+ },
115
+ "inventory": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "documents",
120
+ "profiles",
121
+ "states",
122
+ "projections",
123
+ "evidence",
124
+ "adapterMappings",
125
+ "contracts"
126
+ ],
127
+ "properties": {
128
+ "documents": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": [
134
+ "id",
135
+ "path"
136
+ ],
137
+ "properties": {
138
+ "id": {
139
+ "type": "string",
140
+ "minLength": 1
141
+ },
142
+ "path": {
143
+ "type": "string",
144
+ "minLength": 1
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "profiles": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string",
153
+ "minLength": 1
154
+ }
155
+ },
156
+ "states": {
157
+ "type": "array",
158
+ "items": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "id",
163
+ "type"
164
+ ],
165
+ "properties": {
166
+ "id": {
167
+ "type": "string",
168
+ "minLength": 1
169
+ },
170
+ "type": {
171
+ "enum": [
172
+ "baseline",
173
+ "transition",
174
+ "target"
175
+ ]
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "projections": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": [
186
+ "id",
187
+ "path"
188
+ ],
189
+ "properties": {
190
+ "id": {
191
+ "type": "string",
192
+ "minLength": 1
193
+ },
194
+ "path": {
195
+ "type": "string",
196
+ "minLength": 1
197
+ },
198
+ "title": {
199
+ "type": "string",
200
+ "minLength": 1
201
+ }
202
+ }
203
+ }
204
+ },
205
+ "evidence": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "string",
209
+ "minLength": 1
210
+ }
211
+ },
212
+ "adapterMappings": {
213
+ "type": "array",
214
+ "items": {
215
+ "type": "string",
216
+ "minLength": 1
217
+ }
218
+ },
219
+ "contracts": {
220
+ "type": "array",
221
+ "items": {
222
+ "type": "string",
223
+ "minLength": 1
224
+ }
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "$defs": {
230
+ "diagnostic": {
231
+ "type": "object",
232
+ "additionalProperties": false,
233
+ "required": [
234
+ "severity",
235
+ "code",
236
+ "message",
237
+ "path",
238
+ "pointer",
239
+ "line",
240
+ "column"
241
+ ],
242
+ "properties": {
243
+ "severity": {
244
+ "const": "error"
245
+ },
246
+ "code": {
247
+ "type": "string",
248
+ "pattern": "^YM[0-9]{3}$"
249
+ },
250
+ "message": {
251
+ "type": "string",
252
+ "minLength": 1
253
+ },
254
+ "path": {
255
+ "type": "string",
256
+ "minLength": 1
257
+ },
258
+ "pointer": {
259
+ "type": "string",
260
+ "pattern": "^/"
261
+ },
262
+ "line": {
263
+ "type": "integer",
264
+ "minimum": 1
265
+ },
266
+ "column": {
267
+ "type": "integer",
268
+ "minimum": 1
269
+ }
270
+ }
271
+ }
272
+ }
273
+ }
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: yarramate-architecture
3
- description: Discover architecture in an existing repository or design a new solution before implementation using native YarraMate documents and the stable CLI. Use when an agent needs to map a codebase, propose an evidence-backed architecture model, brainstorm solution alternatives, define current/transition/target architecture, reconcile intent with evidence, or provide bounded architecture context to implementation work.
3
+ description: Discover, design, or maintain repository architecture using native YarraMate documents and the stable CLI. Use when an agent needs to map a codebase, propose an evidence-backed architecture model, brainstorm solution alternatives, evolve a model that already validates, rename or replace semantic subjects safely, define current/transition/target architecture, reconcile intent with evidence, or provide bounded architecture context to implementation work.
4
4
  ---
5
5
 
6
6
  # YarraMate architecture
7
7
 
8
- Use one repository-native lifecycle for discovery and design:
8
+ Use one repository-native lifecycle for discovery, design, and maintenance:
9
9
 
10
10
  ```text
11
11
  evidence or design conversation
@@ -22,11 +22,23 @@ automatically.
22
22
 
23
23
  ## Choose the journey
24
24
 
25
+ When a workspace already exists, orient first with one call before choosing:
26
+
27
+ ```sh
28
+ yarramate status <workspace.yaml> --json
29
+ ```
30
+
31
+ It reports the check verdict, the reconciliation summary, and a titled
32
+ inventory of documents, states, projections, evidence, and contracts.
33
+
25
34
  - Existing implementation is the starting point: follow **Discover an
26
35
  existing project**.
27
36
  - Intent and a not-yet-built solution are the starting point: follow **Design
28
37
  a new solution**.
29
- - Declared architecture and implementation both exist: begin with discovery,
38
+ - A validating native model must change: follow **Maintain an existing
39
+ model**.
40
+ - Declared architecture and implementation both exist but no model change is
41
+ requested: begin with discovery,
30
42
  preserve the declared model, then report supported, contradicted, unknown,
31
43
  and unobserved claims without silently rewriting it.
32
44
 
@@ -67,6 +79,7 @@ yarramate evidence .yarramate/evidence/<evidence>.yaml .yarramate/workspace.yaml
67
79
  yarramate reconcile .yarramate/workspace.yaml
68
80
  yarramate context .yarramate/projections/<projection>.yaml .yarramate/workspace.yaml
69
81
  yarramate view .yarramate/projections/<projection>.yaml .yarramate/workspace.yaml
82
+ yarramate-likec4 check .yarramate/integrations/likec4/project.yaml --json .yarramate/workspace.yaml
70
83
  yarramate-likec4 map --sync .yarramate/integrations/likec4/subject-mapping.yaml .yarramate/workspace.yaml
71
84
  yarramate-likec4 export-project .yarramate/integrations/likec4/project.yaml .yarramate-out/likec4 .yarramate/workspace.yaml
72
85
  ```
@@ -112,6 +125,7 @@ yarramate context .yarramate/projections/<target>.yaml .yarramate/workspace.yaml
112
125
  yarramate view .yarramate/projections/<target>.yaml .yarramate/workspace.yaml
113
126
  yarramate view .yarramate/projections/<flow>.yaml .yarramate/workspace.yaml
114
127
  yarramate compare <document-id>#<baseline-state> <document-id>#<target-state> .yarramate/workspace.yaml
128
+ yarramate-likec4 check .yarramate/integrations/likec4/project.yaml --json .yarramate/workspace.yaml
115
129
  yarramate-likec4 map --sync .yarramate/integrations/likec4/subject-mapping.yaml .yarramate/workspace.yaml
116
130
  yarramate-likec4 export-project .yarramate/integrations/likec4/project.yaml .yarramate-out/likec4 .yarramate/workspace.yaml
117
131
  ```
@@ -125,10 +139,64 @@ yarramate-likec4 export-project .yarramate/integrations/likec4/project.yaml .yar
125
139
  implementation context. Do not generate code until the requested design
126
140
  decision is reviewable.
127
141
 
142
+ ## Maintain an existing model
143
+
144
+ Use this journey for a deliberate change to a model that already passes its
145
+ checks, including a renamed subject, resolved gap, changed relationship, or
146
+ retired concept.
147
+
148
+ 1. Discover the authored layout before assuming paths:
149
+ - read the workspace `documents`, `projections`, `adapterMappings`, and
150
+ `evidence` entries;
151
+ - locate any `yarramate/likec4-project/v1` document and follow its `mapping`
152
+ field;
153
+ - treat paths shown below as examples, not required repository layout.
154
+ Discover the repository’s authored paths instead of assuming these examples.
155
+ 2. Establish a passing baseline with Core and every configured read-only
156
+ adapter check. If the baseline already fails, separate those pre-existing
157
+ diagnostics from the requested maintenance change.
158
+ 3. Before changing an identity, search its local and globally qualified forms
159
+ across every workspace input. Account for:
160
+ - `references[].ref` citations;
161
+ - relationship `from` and `to` endpoints;
162
+ - evidence `subject` entries and stable claim targets;
163
+ - adapter mapping `native` entries;
164
+ - projection selectors, architecture states, ownership, and constraints.
165
+ 4. Make the smallest coherent edit and update all referring authored inputs.
166
+ Do not rewrite unrelated architectural intent.
167
+ 5. Run the read-only checks before any repair command so drift remains
168
+ observable:
169
+
170
+ ```sh
171
+ yarramate check .yarramate/workspace.yaml --json
172
+ yarramate-likec4 check .yarramate/integrations/likec4/project.yaml --json .yarramate/workspace.yaml
173
+ ```
174
+
175
+ 6. If the adapter check reports intended mapping drift, repair it locally,
176
+ inspect the tracked diff, then verify again. Use `--prune` only after
177
+ confirming that stale native subjects were intentionally renamed or
178
+ removed:
179
+
180
+ ```sh
181
+ yarramate-likec4 map --sync --prune .yarramate/integrations/likec4/subject-mapping.yaml .yarramate/workspace.yaml
182
+ git diff -- .yarramate
183
+ yarramate check .yarramate/workspace.yaml --json
184
+ yarramate-likec4 check .yarramate/integrations/likec4/project.yaml --json .yarramate/workspace.yaml
185
+ yarramate-likec4 export-project .yarramate/integrations/likec4/project.yaml .yarramate-out/likec4 .yarramate/workspace.yaml
186
+ ```
187
+
188
+ 7. Require both configured read-only checks to exit successfully after the
189
+ edit. The maintained model must pass before handoff. Report changed
190
+ identities, updated dependants, mapping repairs, generated output, and any
191
+ intentionally deferred architecture work.
192
+
128
193
  ## Correctness and authority
129
194
 
130
195
  - Treat `check` as deterministic correctness, never as architecture approval,
131
196
  completeness, or quality scoring.
197
+ - A repair command cannot serve as verification. Run read-only adapter checks
198
+ before `map --sync`, use sync only while authoring, and never put sync in a
199
+ CI verification gate.
132
200
  - Keep LikeC4 optional. Default to visual output for these guided journeys,
133
201
  but respect an explicit request for tool-neutral semantic output only.
134
202
  - Keep adapter fields outside native documents.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "YarraMate Architecture"
3
- short_description: "Discover and design repository architecture"
4
- default_prompt: "Use $yarramate-architecture to discover or design this project architecture with native YarraMate documents."
3
+ short_description: "Discover, design, and maintain architecture"
4
+ default_prompt: "Use $yarramate-architecture to discover, design, or safely maintain this project architecture."
@@ -60,3 +60,11 @@ Design is minimally useful when:
60
60
  - intended projections are rendered through a current LikeC4 project;
61
61
  - rendering coverage gaps are stated, including intentional omissions;
62
62
  - missing detail is visible without becoming a Core correctness error.
63
+
64
+ Maintenance is complete only when:
65
+
66
+ - all references to a changed identity were found before editing;
67
+ - native documents and configured adapters pass their read-only checks;
68
+ - any mapping sync or prune was reviewed as an authored Git change;
69
+ - generated views are current;
70
+ - changed identities and updated dependants are reported at handoff.
@@ -15,8 +15,10 @@ adapterMappings: []
15
15
  evidence: [evidence/*.yaml]
16
16
  ```
17
17
 
18
- Paths are relative to the manifest. Keep canonical inputs under `.yarramate/`
19
- and generated artifacts under `.yarramate-out/`.
18
+ Paths are relative to the manifest. `.yarramate/` for canonical inputs and
19
+ `.yarramate-out/` for generated artifacts are recommended examples, not fixed
20
+ CLI paths. In an existing repository, read its workspace and project documents
21
+ and preserve the authored layout.
20
22
 
21
23
  ## Native document
22
24
 
@@ -196,6 +198,9 @@ Give every ordered flow its own focused projection and dynamic view. A dynamic
196
198
  view takes its title and description from its projection; reusing one broad
197
199
  projection for several flows makes their rendered identities ambiguous.
198
200
  Ensure every intended projection is listed in the project.
201
+ In an existing repository, locate the project by its
202
+ `yarramate/likec4-project/v1` format and follow its `mapping` field instead of
203
+ assuming the example paths below.
199
204
 
200
205
  Start the referenced mapping as a valid empty mapping, then let sync populate
201
206
  it:
@@ -231,6 +236,10 @@ yarramate view <projection.yaml> .yarramate/workspace.yaml
231
236
  yarramate compare <from-state> <to-state> .yarramate/workspace.yaml
232
237
  yarramate evidence <evidence.yaml> .yarramate/workspace.yaml
233
238
  yarramate reconcile .yarramate/workspace.yaml
239
+ yarramate-likec4 check \
240
+ .yarramate/integrations/likec4/project.yaml \
241
+ --json \
242
+ .yarramate/workspace.yaml
234
243
  yarramate-likec4 map --sync \
235
244
  .yarramate/integrations/likec4/subject-mapping.yaml \
236
245
  .yarramate/workspace.yaml
@@ -240,6 +249,12 @@ yarramate-likec4 export-project \
240
249
  .yarramate/workspace.yaml
241
250
  ```
242
251
 
252
+ `yarramate-likec4 check` is read-only verification and belongs in CI.
253
+ Run it before sync when checking an existing mapping so missing or stale
254
+ entries remain observable. `map --sync [--prune]` is an authoring repair: it
255
+ mutates a tracked mapping, so review and commit its diff. Never use a repair
256
+ command as a CI gate.
257
+
243
258
  Sync preserves and reports mappings for native subjects that no longer exist.
244
259
  After confirming that those subjects were intentionally removed or renamed,
245
260
  delete the stale entries while adding missing mappings with: