archik 0.16.1 → 0.17.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,84 @@
1
+ ---
2
+ description: Finish a migration — back-fill the artifacts the migrator flagged
3
+ ---
4
+
5
+ # /archik:migrate — back-fill what the deterministic migration couldn't
6
+
7
+ `archik upgrade --migrate` already ran the **deterministic** migration:
8
+ it archived the old project, moved files into the current layout,
9
+ validated, and advanced `.archik/.version`. It then flagged the parts
10
+ that need **judgment** — usually: *the project has an architecture but no
11
+ use cases / sequence diagrams.* Your job is to back-fill those, grounded
12
+ in **both** the current model and the **archived original**.
13
+
14
+ The deterministic steps are done. Do NOT redo them. You author the
15
+ missing artifacts; `archik validate` is your gate.
16
+
17
+ ## CLI-only for architecture; direct-write for the Jacobson files
18
+
19
+ Interact with the architecture diagram only through `npx archik`. Actors,
20
+ use cases, and sequence diagrams are **direct-write** files (no sidecar) —
21
+ author them with `Write`, then `npx archik validate`. Never edit
22
+ `.archik/main.archik.yaml` by hand. **Never delete `.archik.archive/`** —
23
+ it is the developer's only copy of the pre-migration project.
24
+
25
+ ## Steps
26
+
27
+ 1. **See exactly what's missing.** The migrator's `needsJudgment` hint is
28
+ printed once and not re-derivable, so check the project directly:
29
+ ```bash
30
+ npx archik q usecases # empty → use cases need back-filling
31
+ npx archik q actors # empty → actors needed first (use cases reference them)
32
+ npx archik q sequences # which flows already have a seq diagram
33
+ ```
34
+
35
+ 2. **Read the archived original — this is the migration's whole point.**
36
+ Find the newest archive and read the old project's intent (descriptions,
37
+ any notes, the old structure) so the back-fill reflects what the
38
+ developer actually built, not a generic guess:
39
+ ```bash
40
+ ls -t .archik.archive/ # newest timestamp dir is the pre-migration copy
41
+ ```
42
+ Read the files under that dir with the `Read` tool (the archive is a
43
+ plain backup, not a live archik doc — reading it directly is correct).
44
+
45
+ 3. **Ground the use cases in the current model.** Combine the archive's
46
+ intent with the live structure:
47
+ ```bash
48
+ npx archik q stats
49
+ npx archik q list
50
+ npx archik q edges
51
+ ```
52
+
53
+ 4. **Author actors first** (if `q actors` was empty). Use cases reference
54
+ actors by id, and validate rejects a use case whose `primaryActor`
55
+ isn't in the actor index. Direct-write `.archik/actors.archik.actors.yaml`
56
+ (schema: `npx archik schema actors`), then `npx archik validate`.
57
+
58
+ 5. **Author one use case per real flow.** Direct-write
59
+ `.archik/usecases/<id>.archik.uc.yaml` (schema: `npx archik schema uc`).
60
+ Mark each slice `status: proposed` and give it `tests:` paths only if
61
+ those files exist on disk — otherwise omit `tests` (active slices
62
+ require on-disk tests). Validate after each:
63
+ `npx archik validate .archik/main.archik.yaml`.
64
+
65
+ 6. **Author a sequence diagram per primary slice.** Direct-write
66
+ `.archik/<usecase>.<slice>.archik.seq.yaml` (schema: `npx archik schema seq`).
67
+ Every participant `nodeId` must be a real node; add a `realizes` block
68
+ AND point the slice's `realization.seqFile` back at the file
69
+ (bidirectional). Add the seq to each participating node's `seqFiles`
70
+ via the normal `suggest set` → `accept` workflow.
71
+
72
+ 7. **Verify and report.** Then propose the natural next step (write the
73
+ tests the slices name, flip them to `active`), don't end on "done":
74
+ ```bash
75
+ npx archik validate .archik/main.archik.yaml
76
+ npx archik trace
77
+ npx archik drift
78
+ ```
79
+
80
+ ## Done when
81
+
82
+ `archik validate` is clean and `archik q usecases` lists the back-filled
83
+ use cases, each primary slice realising a sequence diagram. The archive
84
+ stays untouched as the developer's rollback.