archik 0.12.50 → 0.13.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.
@@ -14,7 +14,7 @@
14
14
  }
15
15
  } catch {}
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-Dl4i5i09.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-D08Zt2_n.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-DVBaG20X.css">
19
19
  </head>
20
20
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archik",
3
- "version": "0.12.50",
3
+ "version": "0.13.0",
4
4
  "description": "The shared vocabulary between you and Claude Code, at the engineering level. Plain-YAML architecture diagrams with a live browser canvas, headless SVG render in CI, and an installable Claude skill so the model treats the diagram as the spec.",
5
5
  "keywords": [
6
6
  "architecture",
@@ -49,13 +49,14 @@ These are the verbs you reach for during the loop. Default to `npx archik` (no g
49
49
  | Describe one use case | `npx archik q describe-usecase <id>` |
50
50
  | List actors | `npx archik q actors` |
51
51
  | Use case coverage matrix | `npx archik trace [--json] [--fail-on partial\|none]` |
52
+ | Map changed files onto the model | `npx archik affected [--since <ref>] [--files <list>] [--json]` |
52
53
  | Alpha state snapshot | `npx archik alpha show [--json]` |
53
54
  | Promote / demote an alpha state | `npx archik alpha promote\|demote <alpha> <state>` |
54
55
  | Validate a file | `npx archik validate <path>` |
55
56
  | Stage a proposed change | `npx archik suggest set --note '…' - <<'YAML' … YAML` |
56
57
  | Show / accept / reject pending | `npx archik suggest show \| accept \| reject` |
57
58
  | Render an SVG | `npx archik render --out diagram.svg` |
58
- | Diff two files | `npx archik diff a.yaml b.yaml` |
59
+ | Diff two files or git refs | `npx archik diff a.yaml b.yaml` / `npx archik diff origin/main` |
59
60
  | Detect drift vs source tree | `npx archik drift` |
60
61
  | Open the live canvas (foreground) | `npx archik dev` |
61
62
  | Open the canvas (detached) | `npx archik start` / `stop` / `status` |
@@ -104,7 +105,7 @@ Every structural change runs the loop. Don't skip phases; don't silently retry o
104
105
 
105
106
  | Phase | Driver | Tool you reach for |
106
107
  | -------- | ------------- | --------------------------------------------------- |
107
- | Discover | Claude | `npx archik q ...` + `q usecases` + `q actors` + `ls` |
108
+ | Discover | Claude | `npx archik q ...` + `q usecases` + `q actors` + `npx archik affected` + `ls` |
108
109
  | Design | Claude → User | actors / uc files (direct-write) + sidecar via `suggest set` |
109
110
  | Decide | User | `/archik:accept` or `/archik:reject` (HITL gate) |
110
111
  | Build | Claude → User | numbered plan (HITL approval), then small commits |
@@ -189,11 +190,17 @@ The CLI parses, schema-validates, checks cross-file references, stamps `metadata
189
190
  ### 3. Verify before declaring done
190
191
 
191
192
  ```bash
192
- npx archik validate .archik/main.archik.yaml # schema + cross-file checks
193
+ npx archik validate .archik/main.archik.yaml # schema + cross-file + constraints
193
194
  npx archik drift # diagram vs source tree
195
+ npx archik affected --json # what did this change touch? which tests?
194
196
  npx archik render --out docs/architecture.svg # if the project commits an SVG
195
197
  ```
196
198
 
199
+ `affected` is also the right opener in DISCOVER when work starts from
200
+ an existing branch: `npx archik affected --since origin/main --json`
201
+ tells you which nodes, use case slices, and tests the branch already
202
+ touches — ground your plan in that instead of re-deriving it.
203
+
197
204
  ### 4. Sub-architecture (a brand-new `archikFile`)
198
205
 
199
206
  If a node needs its own diagram, author both the parent change AND the new sub-file. **Order matters** — the parent's `archikFile:` pointer is validated against on-disk existence:
@@ -317,6 +324,45 @@ stereotype: entity # stores data; domain model
317
324
 
318
325
  The validator enforces the ECB transition rules on **seq diagrams that carry a `realizes` block**: actors call boundaries, boundaries call controls, controls call entities or other controls. Direct actor→entity or entity→boundary messages are errors. Untagged nodes are silently skipped so adoption is incremental.
319
326
 
327
+ ### Node owner — who to talk to
328
+
329
+ Nodes may carry `owner: <team-or-person>` (free text — match the
330
+ project's CODEOWNERS vocabulary). Surface it when answering "who owns
331
+ this?" (`q describe`, `q list --owner <t>`). Carry it forward like any
332
+ user-authored field. If the document declares a `requireOwner`
333
+ constraint, new nodes of the matching kinds MUST include an owner or
334
+ validation fails.
335
+
336
+ ### Governance constraints — document-level fitness rules
337
+
338
+ The root document may declare `constraints` — rules `archik validate`
339
+ enforces across the MERGED diagram (root + sub-files):
340
+
341
+ ```yaml
342
+ constraints:
343
+ - id: billing-isolation
344
+ description: Only billing-context nodes may write to billing-db.
345
+ forbidEdge:
346
+ relationship: writes
347
+ from: { notParent: billing }
348
+ to: { id: billing-db }
349
+ - id: services-owned
350
+ description: Every service and worker declares an owning team.
351
+ requireOwner: { kinds: [service, worker] }
352
+ ```
353
+
354
+ - Selectors: `{ id?, kind?, parent?, notParent?, stereotype? }` — all
355
+ set fields must match; `parent`/`notParent` walk the whole parentId
356
+ chain.
357
+ - Exactly one rule per constraint (`forbidEdge` or `requireOwner`).
358
+ - `except: [<id>, …]` grandfathers specific node/edge ids — when a
359
+ violation is intentional, add the id to `except` and say why in the
360
+ suggestion note rather than weakening the rule.
361
+ - When `suggest set` or `validate` rejects with a constraint
362
+ violation, treat the constraint as a hard design input: reroute the
363
+ edge (usually via the context's own service or a port), don't
364
+ delete the rule.
365
+
320
366
  ### Other rules worth pre-empting
321
367
 
322
368
  - **No duplicate edges by `(from, to, relationship)`.** The validator rejects the second occurrence and points at the first by id. If you genuinely need two concerns between the same pair (e.g. `service → db` for both `reads` and `writes`), use distinct relationships.
@@ -604,10 +650,14 @@ npx archik alpha show [--json] # alpha state snapshot with verification
604
650
  alpha promote <alpha> <state> [--note <text>] # runs machine check first
605
651
  alpha demote <alpha> <state>
606
652
 
607
- npx archik validate <path> [--json] # schema + cross-file check (CI-friendly)
653
+ npx archik validate <path> [--json] # schema + cross-file + governance constraints
608
654
  npx archik render --out diagram.svg --theme light|dark
609
655
  render --seq <path> --out seq.svg --theme light|dark
610
- npx archik diff a.yaml b.yaml [--out diff.svg] [--json]
656
+ npx archik diff <a> [b] [--out diff.svg] [--json]
657
+ # each side: YAML file OR git ref;
658
+ # one arg = that ref vs working tree
659
+ npx archik affected [--since <ref>] [--files <list>] [--json]
660
+ # changed files → nodes / slices / tests
611
661
  npx archik drift [--json] [--ignore <file>] # diagram vs source tree
612
662
 
613
663
  npx archik suggest show [--json]
@@ -621,6 +671,9 @@ npx archik suggest show [--json]
621
671
  npx archik dev | start | stop | status # canvas server lifecycle
622
672
  npx archik watch # re-render to SVG on save
623
673
  npx archik init # scaffold + install skill + slash commands
674
+ npx archik import compose [file] [--out <f>] # bootstrap a doc from docker-compose
675
+ npx archik merge-driver --install # semantic git merge for *.archik.yaml
676
+ npx archik mcp # MCP server (for non-Claude-Code agents)
624
677
  npx archik skill | commands # refresh the skill / slash commands
625
678
  ```
626
679