archik 0.2.0 → 0.3.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.
@@ -20,16 +20,71 @@ can talk about the system without re-explaining it every time.
20
20
  1. **Before** answering structural questions — *"what does X do?",
21
21
  "what depends on Y?", "where does data flow when …?"* — read
22
22
  `architecture.archik.yaml`. Don't guess from filenames or memory.
23
- 2. **When** work introduces, removes, or rewires components, propose
24
- an update to the YAML alongside the implementation. The user owns
25
- the file — suggest, don't silently apply.
26
- 3. **After** every edit to the YAML, run `archik validate`. Fix any
23
+ 2. **When** work introduces, removes, or rewires components, write
24
+ the proposed end-state to `architecture.archik.suggested.yaml`
25
+ (same schema, plus a `metadata.suggestion` block — see "Suggesting
26
+ changes" below). Don't edit `architecture.archik.yaml` directly;
27
+ the user reviews and accepts in the canvas or via
28
+ `archik suggest accept`.
29
+ 3. **After** every edit to a YAML, run `archik validate`. Fix any
27
30
  reported errors before declaring the change done.
28
31
 
29
32
  The sections below are the detailed reference behind these three
30
33
  rules — *when* to consult, *when* to propose, schema, taxonomy,
31
34
  relationship vocabulary, and CLI.
32
35
 
36
+ ## Suggesting changes (the sidecar workflow)
37
+
38
+ The `archik.yaml` is the user's source of truth. You don't get to
39
+ mutate it directly. Instead, write your proposed end-state to a
40
+ sidecar file:
41
+
42
+ ```
43
+ architecture.archik.yaml ← truth — user owns it
44
+ architecture.archik.suggested.yaml ← your draft proposal
45
+ ```
46
+
47
+ The sidecar is a complete, valid Archik document — same schema as the
48
+ main file, plus a `metadata.suggestion` block that marks it as a
49
+ proposal:
50
+
51
+ ```yaml
52
+ version: "1.0"
53
+ name: My Architecture
54
+ metadata:
55
+ suggestion:
56
+ from: architecture.archik.yaml
57
+ at: 2026-04-26T17:00:00Z
58
+ note: add Stripe payment flow # optional one-liner
59
+ nodes:
60
+ # ... entire proposed end-state, not just the delta
61
+ edges:
62
+ # ...
63
+ ```
64
+
65
+ Once you've written the sidecar:
66
+
67
+ * The canvas shows a **📝 Suggestion pending** banner with `Review`,
68
+ `Accept`, `Reject` buttons. Review opens a colour-coded SVG diff in
69
+ a new tab; Accept renames the sidecar over the main file; Reject
70
+ deletes the sidecar.
71
+ * From the terminal: `archik suggest show | accept | reject`.
72
+
73
+ If the user has no canvas open and asks "apply it", run
74
+ `archik suggest accept` for them (only after they've explicitly
75
+ asked).
76
+
77
+ **Key rules:**
78
+
79
+ * Write the *full proposed document*, not a patch. The diff is
80
+ computed by archik between the main file and the sidecar.
81
+ * Run `archik validate architecture.archik.suggested.yaml` after
82
+ writing. The schema enforces cross-references (no dangling edges,
83
+ no parent cycles, no duplicate ids); silent failures are not OK.
84
+ * If a suggestion sidecar already exists, treat it as your previous
85
+ proposal — extend or replace it. Don't write a new sidecar with a
86
+ different name.
87
+
33
88
  ## When to consult the YAML
34
89
 
35
90
  Read it **before answering** any of these:
@@ -296,6 +351,11 @@ archik validate # schema check (run after every edit)
296
351
  archik validate path/to/file.yaml
297
352
  archik render --out diagram.svg # headless layout → SVG
298
353
  archik render --theme light --out diagram-light.svg
354
+ archik diff a.yaml b.yaml # text + colour-coded SVG diff
355
+ archik diff a.yaml b.yaml --out diff.svg
356
+ archik suggest show # summary of pending sidecar (default)
357
+ archik suggest accept # apply the sidecar over the main file
358
+ archik suggest reject # discard the sidecar
299
359
  archik watch # re-render SVG on save
300
360
  archik check # drift: nodes vs source dirs
301
361
  archik dev # open the live editor in the browser (foreground)