archik 0.14.0 → 0.15.1
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/README.md +28 -0
- package/commands/self-evolving.md +67 -0
- package/dist/cli/archik.mjs +535 -389
- package/dist/ui/assets/index-CAPTCctF.js +226 -0
- package/dist/ui/assets/index-CV6lgiRK.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +2 -1
- package/patterns/evolution-loop.blueprint.yaml +69 -0
- package/patterns/evolution-loop.md +64 -0
- package/patterns/feedback-pipeline.md +52 -0
- package/patterns/learned-overlay.md +52 -0
- package/patterns/sidecar-approval-gate.md +52 -0
- package/patterns/truth-chain.md +54 -0
- package/skills/archik/SKILL.md +28 -1
- package/dist/ui/assets/index-Cd7sGYmr.js +0 -226
- package/dist/ui/assets/index-EA4oKR1S.css +0 -1
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ Actor → Use case → Slice → Tests on disk → Seq diagram → Nodes → Sou
|
|
|
44
44
|
- 🌿 **Git-aware** — `archik diff origin/main` shows what a branch changes architecturally; `archik affected` maps changed files to nodes, slices, and tests (`--run` executes them); `archik hooks install` gates every commit
|
|
45
45
|
- 🤝 **Team-ready** — semantic merge driver for YAML, node ownership with CODEOWNERS sync, and governance constraints (architecture fitness rules)
|
|
46
46
|
- 🔬 **Verified at every altitude** — `validate` proves the model is consistent, `drift --edges` proves it matches the code's import graph, `otel check` proves it matches production traffic
|
|
47
|
+
- 🧬 **Self-evolving** — opt-in `archik evolution` loop (observe → reflect → propose → validate → apply → measure) learns from your accepts, rejects, and failures and proposes its own upgrades behind a human approval gate; `archik patterns` ships the same design patterns for your systems
|
|
47
48
|
- 🚀 **Fast adoption** — `archik import compose` / `import mermaid` bootstrap a diagram from what you already have; `/archik:spawn` mirrors an existing source tree
|
|
48
49
|
- 📦 **Zero runtime dependencies** in the published package
|
|
49
50
|
|
|
@@ -216,6 +217,31 @@ npx archik otel check --graph deps.json
|
|
|
216
217
|
|
|
217
218
|
Undeclared production calls — traffic the diagram doesn't admit to — fail the check; declared wire edges that saw no traffic are reported informationally. That completes the truth chain: `validate` proves the model is consistent, `drift --edges` proves it matches the code, `otel check` proves it matches production.
|
|
218
219
|
|
|
220
|
+
## Self-evolution
|
|
221
|
+
|
|
222
|
+
Archik can learn from how you use it. Everything is opt-in, local-only, and human-gated:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
archik evolution enable # start observing (events stay on your machine)
|
|
226
|
+
# ... normal work: suggestions accepted/rejected, validate/drift runs ...
|
|
227
|
+
archik evolution reflect # recurring friction → pending proposals with evidence
|
|
228
|
+
archik evolution proposals # read them
|
|
229
|
+
archik evolution approve <id># apply: a learned.md note, or a sidecar diff you still review
|
|
230
|
+
archik evolution report # did it help? last 7 days vs the 7 before
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Approved lessons land in `.archik/evolution/learned.md` — the Claude skill reads it at session start (and MCP agents via `archik://learned`), so the AI gets smarter across sessions without anyone editing prompts. Rejecting a proposal is recorded too; the loop learns from "no".
|
|
234
|
+
|
|
235
|
+
Building a self-evolving system of your own? The same patterns ship as a library:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
archik patterns list # evolution-loop, sidecar-approval-gate,
|
|
239
|
+
archik patterns show evolution-loop # learned-overlay, truth-chain, feedback-pipeline
|
|
240
|
+
archik patterns apply evolution-loop # stage the blueprint into YOUR diagram (gated)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Deep dives in [docs/advanced-topics](./docs/advanced-topics/README.md). In Claude Code: `/archik:self-evolving <your idea>`.
|
|
244
|
+
|
|
219
245
|
## CI
|
|
220
246
|
|
|
221
247
|
Plain commands:
|
|
@@ -267,6 +293,8 @@ Every command supports `--help`; agent-facing commands support `--json`.
|
|
|
267
293
|
| `archik otel check --graph <f>` | Verify edges against a production service-dependency graph |
|
|
268
294
|
| `archik suggest <sub>` | Suggestion sidecar lifecycle: `show` `set` `accept` `reject` |
|
|
269
295
|
| `archik alpha <sub>` | Essence alphas: `show`, `promote` (machine-checked), `demote` |
|
|
296
|
+
| `archik evolution <sub>` | Self-evolution loop: `enable` `status` `reflect` `proposals` `propose` `approve` `reject` `report` |
|
|
297
|
+
| `archik patterns <sub>` | Self-evolution pattern library: `list` `show <id>` `apply <id>` |
|
|
270
298
|
| `archik import compose\|mermaid [file]` | Bootstrap a document from docker-compose or a Mermaid flowchart |
|
|
271
299
|
| `archik merge-driver --install` | Semantic git merge for `*.archik.yaml` |
|
|
272
300
|
| `archik hooks install` | Pre-commit hook running `archik validate` (`--with-drift` optional) |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Design a self-evolving architecture for an idea, using the pattern library
|
|
3
|
+
argument-hint: <the system idea, e.g. "a code-review bot that learns">
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /archik:self-evolving — from vague idea to self-evolving architecture
|
|
7
|
+
|
|
8
|
+
The user wants a system that **improves itself over time**, and they
|
|
9
|
+
gave you the idea in `$ARGUMENTS`. Your job: guide them from that idea
|
|
10
|
+
to a concrete architecture with an evolution loop — designs, use
|
|
11
|
+
cases, and a staged diagram they can accept or reject.
|
|
12
|
+
|
|
13
|
+
If `$ARGUMENTS` is empty, ask for the idea in one sentence first.
|
|
14
|
+
|
|
15
|
+
## CLI-only — do not touch archik files directly
|
|
16
|
+
|
|
17
|
+
All diagram reads go through `npx archik q`, all diagram writes
|
|
18
|
+
through `npx archik suggest set` or `npx archik patterns apply`.
|
|
19
|
+
Never `Read`/`Write`/`Edit` files under `.archik/`.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
1. **Load the pattern library** — this is your design vocabulary:
|
|
24
|
+
```
|
|
25
|
+
npx archik patterns list
|
|
26
|
+
npx archik patterns show evolution-loop
|
|
27
|
+
```
|
|
28
|
+
Read the other patterns (`sidecar-approval-gate`, `learned-overlay`,
|
|
29
|
+
`truth-chain`, `feedback-pipeline`) as they become relevant.
|
|
30
|
+
|
|
31
|
+
2. **Interview briefly** (3 questions max, one at a time):
|
|
32
|
+
- Who corrects the system today? (those corrections = the feedback signal)
|
|
33
|
+
- What change should the system be able to make to itself?
|
|
34
|
+
- Who must approve a self-change before it lands?
|
|
35
|
+
No feedback signal = no evolution loop; help them find one first.
|
|
36
|
+
|
|
37
|
+
3. **Ground in the current diagram** (`npx archik q stats`, `q list`).
|
|
38
|
+
If the project is empty, model the *base system* first — actors,
|
|
39
|
+
then one use case to ship, per the normal archik opening move.
|
|
40
|
+
|
|
41
|
+
4. **Map the idea onto the loop.** For each stage, name the concrete
|
|
42
|
+
component in THEIR system:
|
|
43
|
+
| Stage | Their component |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| observe | what gets logged, where |
|
|
46
|
+
| reflect | which rules find patterns |
|
|
47
|
+
| propose | where proposals live, who reads them |
|
|
48
|
+
| validate | what check keeps a bad self-change out |
|
|
49
|
+
| apply | the approval gate (use sidecar-approval-gate) |
|
|
50
|
+
| measure | the one metric that proves improvement |
|
|
51
|
+
|
|
52
|
+
5. **Stage the architecture.** Two routes, both gated:
|
|
53
|
+
- Generic start: `npx archik patterns apply evolution-loop`
|
|
54
|
+
(stages the blueprint as `status: proposed` nodes), then refine
|
|
55
|
+
ids/names with a follow-up `suggest set`.
|
|
56
|
+
- Tailored: author the full end-state and stage via
|
|
57
|
+
`npx archik suggest set --note '…' - <<'YAML' … YAML`.
|
|
58
|
+
|
|
59
|
+
6. **Wire the requirements.** Author a use case for the loop itself
|
|
60
|
+
(`/archik:usecase` conventions): slices like "corrections are
|
|
61
|
+
recorded", "insights become proposals", "approved change applies",
|
|
62
|
+
each naming test paths.
|
|
63
|
+
|
|
64
|
+
7. **Hand over.** Show the canvas URL, summarize which patterns you
|
|
65
|
+
used and why, and point at `npx archik evolution enable` if they
|
|
66
|
+
want archik's own loop watching this project too. **Wait for the
|
|
67
|
+
user to accept/reject — never accept the sidecar yourself.**
|