@r5n/ariadne 0.3.0 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +35 -7
  2. package/dist/cli.js +241 -191
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -27,7 +27,7 @@ bun --filter @r5n/ariadne build
27
27
  ln -s "$PWD/packages/ariadne/dist/cli.js" ~/.local/bin/ari
28
28
  ```
29
29
 
30
- `ari install` shows what is already set up, finds the agents on your `PATH` and asks what to install for each: `.ari/config.json` and a short managed block in `AGENTS.md` that teaches any agent the loop below, agent hooks, the MCP server, the `ariadne` skill, git hooks and, optionally, which agents implement and review tasks. It warns before anything would run twice or clash with lefthook or husky, shows every file it will create or update, writes only after you confirm, then checks the result by starting `ari mcp serve`. Running it again is a status screen: when everything is current it asks nothing.
30
+ `ari install` shows what is already set up, finds the agents on your `PATH` and asks what to install for each: `.ari/config.json` and a short managed block in `AGENTS.md` that teaches any agent the loop below, agent hooks, the MCP server, six `ariadne` skills that agents load on demand, git hooks and, optionally, which agents implement and review tasks. It warns before anything would run twice or clash with lefthook or husky, shows every file it will create or update, writes only after you confirm, then checks the result by starting `ari mcp serve`. Running it again is a status screen: when everything is current it asks nothing.
31
31
 
32
32
  Without a terminal, or in a script, pass the choices as flags; `--yes` takes the recommended defaults and `--dry-run` prints the plan without writing:
33
33
 
@@ -35,6 +35,8 @@ Without a terminal, or in a script, pass the choices as flags; `--yes` takes the
35
35
  ari install --init --agent claude,codex --yes
36
36
  ```
37
37
 
38
+ After it writes, `ari install` prints what changed with the command that undoes each part, and the commands that lead back to your tasks. `ari doctor` checks the whole setup later without changing anything and names the fix for each problem; `ari install --check` does the same for a pipeline; `ari uninstall` removes hooks, MCP servers, skills and git hooks again and gives every file back byte for byte, leaving `.ari/` and your tasks alone.
39
+
38
40
  `ari install` is built from smaller commands you can also run yourself: `ari init` creates the configuration and the `AGENTS.md` block, and `ari hooks install`, `ari mcp install`, `ari skills install` and `ari agents add` set up one target each.
39
41
 
40
42
  Create a task and write its contract:
@@ -50,6 +52,18 @@ ari ready add-profile-inheritance
50
52
  ari start add-profile-inheritance
51
53
  ```
52
54
 
55
+ ### Design a feature
56
+
57
+ To design before you build, create the task with the `feature` pack. Write its contract first, because the design has to list exactly the contract's criteria (`AC-1`, `AC-2` and so on):
58
+
59
+ ```sh
60
+ ari new "Add profile inheritance" --pack feature --scope "src/profiles/**"
61
+ ari ready add-profile-inheritance
62
+ ari start add-profile-inheritance
63
+ ```
64
+
65
+ `ari new` also writes the design template to `.ari/designs/add-profile-inheritance.md`. The agent fills its sections, guided by the `ariadne-design` skill, and `ari check` lists every section that is still empty and every criterion that differs from the contract's. `ari snapshot --reason "design ready"` saves the plan, and then a person reads the design and runs `ari approve add-profile-inheritance`. `ari done` moves on to the implement and review stages.
66
+
53
67
  ## The loop
54
68
 
55
69
  | Step | Command | What happens |
@@ -77,9 +91,12 @@ A pack is a methodology written as data: an ordered list of stages, each with an
77
91
  | `spec-driven` | specify (approved), implement |
78
92
  | `refactor` | refactor (tests unchanged) |
79
93
  | `spike` | explore (a write-up in `.ari/designs/`) |
94
+ | `feature` | design (a structured design whose acceptance criteria match the contract's, and an approval), implement, review |
80
95
 
81
96
  Choose the default with `ari init --pack tdd`, or per task with `ari new --pack bugfix`. A project can add its own packs in `.ari/packs/<name>.yaml`.
82
97
 
98
+ For a pack whose design stage lists required `sections`, such as `feature`, `ari new` also writes `.ari/designs/<id>.md` from a template, and `ari check` names every section that is still empty and every criterion id that the design and the contract do not share. The check is structural: a person's approval is what judges the design.
99
+
83
100
  ## Memory
84
101
 
85
102
  Memory is tiered by how often it changes:
@@ -90,7 +107,9 @@ Memory is tiered by how often it changes:
90
107
  | Task notes | the task record | with the task |
91
108
  | Knowledge | `.ari/knowledge/*.md` | until archived |
92
109
 
93
- `ari sleep` consolidates memory: it runs after every finished task and before an agent compacts its context. It prunes journals, archives duplicates and stale entries, keeps the knowledge within its byte budget and reports what needs judgement.
110
+ `ari sleep` consolidates memory: it runs after every finished task and before an agent compacts its context. It prunes journals, archives duplicates and stale entries, keeps the knowledge within its byte budget and reports what needs judgement. Every pass is logged, `ari sleep --dry-run` shows what would change, and `ari sleep --undo` gives archived entries back byte for byte.
111
+
112
+ `ari snapshot` saves a task's plan (contract, stage, design files, notes) and its context pack in the worktree's git directory, so an agent whose context was reset or compacted can read back what it knew. `ari snapshot restore <id>` writes the design files back byte for byte and refuses when the contract changed or the task is done.
94
113
 
95
114
  ## Integrations
96
115
 
@@ -102,14 +121,15 @@ Memory is tiered by how often it changes:
102
121
  | Git hooks | every agent and person | `ari hooks install --agent git` (`pre-commit` runs `ari scope --staged`, `pre-push` runs `ari verify`) |
103
122
  | CI | everything merged | `ari verify --base <ref>` as a required check, on a checkout with the full history |
104
123
  | Agent hooks | Claude Code, Codex CLI, Gemini CLI; Cursor and GitHub Copilot CLI in part | `ari hooks install --agent <name>` |
105
- | MCP tools | Claude Code, Codex CLI, Gemini CLI, Cursor | `ari mcp install --agent <name>` registers `ari mcp serve` |
106
- | Skill | Claude Code, Codex CLI, Gemini CLI, Cursor | `ari skills install --agent <name>` |
124
+ | MCP tools | Claude Code, Codex CLI, Gemini CLI, Cursor | `ari mcp install --agent <name>` registers `ari mcp serve`; fifteen tools, among them `ari_snapshot`, `ari_snapshot_list` and `ari_snapshot_show` |
125
+ | Skills | Claude Code, Codex CLI, Gemini CLI, Cursor | `ari skills install --agent <name>` writes six skills that load on demand; `ari skills list` shows which are current |
107
126
  | Headless runs | agents with a non-interactive mode | `ari agents add <preset>`, then `ari run`, with `routing` choosing the agent per stage |
108
127
  | Review agents | agents with a read-only mode | `ari review`, and `review.agent` for the `review` gate |
128
+ | Snapshots | every agent with a shell | `ari snapshot`; also saved before a compaction (the `pre-compact` hook), after `ari approve` and when `ari done` advances a stage, unless `snapshots.auto` is `false` |
109
129
 
110
- Agent hooks give early feedback: they deny edits and plain shell writes outside the scope, inside locked files or to ari's own records, refuse `ari approve` and commits that skip git hooks, keep the agent working until `ari done` has passed, and load the context pack when a session starts. The shell hook catches common mistakes. It [does not resolve shell code](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/design.md#what-the-shell-hook-is-for), so an agent can get past it; `ari done`, `ari verify`, the git hooks and CI decide. `ari hooks uninstall --agent <name>` removes the hooks again. Ariadne never adds permission-bypass flags to an agent command.
130
+ Agent hooks give early feedback: they deny edits and plain shell writes outside the scope, inside locked files or to ari's own records, refuse `ari approve`, `ari trust`, `ari uninstall` and commits that skip git hooks, keep the agent working until `ari done` has passed, and load the context pack when a session starts (with no active task, a short brief of the tasks that can start, the latest snapshot and the project's constraints and decisions, up to `context.briefBytes`; `hooks.brief` turns it off). The shell hook catches common mistakes. It [does not resolve shell code](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/design.md#what-the-shell-hook-is-for), so an agent can get past it; `ari done`, `ari verify`, the git hooks and CI decide. `ari hooks uninstall --agent <name>` removes the hooks again. Ariadne never adds permission-bypass flags to an agent command.
111
131
 
112
- The MCP server gives the loop to agents as tools (`ari_next`, `ari_check`, `ari_done` and more) that return the same JSON documents as the commands; approving, amending and resolving stay with people. The skill teaches the loop, contract writing, the gates and the memory commands, and loads whenever a repository has `.ari/`.
132
+ The MCP server gives the loop to agents as tools (`ari_next`, `ari_check`, `ari_done`, `ari_snapshot` and more) that return the same JSON documents as the commands; approving, amending, resolving and restoring a snapshot stay with people. The six skills load on demand by their descriptions: `ariadne` (the loop and the gates, whenever a repository has `.ari/`), `ariadne-design`, `ariadne-contract`, `ariadne-implement`, `ariadne-review` and `ariadne-memory`. A skill is text that guides an agent and an agent may ignore it; the gates, the ledgers and the MCP tools are what is deterministic. Approving, amending, resolving and trusting stay with people, and so does restoring a snapshot over an approved design.
113
133
 
114
134
  Every command that reports data accepts the global `--json` flag and then writes exactly one JSON document to stdout. Exit code 1 means a failure, including failing gates; exit code 2 means a usage error such as an unknown option.
115
135
 
@@ -132,12 +152,20 @@ ari agents add gemini --role review
132
152
 
133
153
  `ari run` then drives a task with Claude Code, the `review` gate (as in the `sdlc` pack's review stage) asks Codex, and `ari review` asks Gemini CLI for its verdict without recording anything. A review agent works in a temporary copy of the change and must answer one JSON verdict; anything else, a timeout or a changed file fails the review.
134
154
 
155
+ A review can also see what [Argus](https://github.com/r5n-labs/clis/blob/develop/packages/argus/README.md) flags. Set `review.argus` to the path of an argus config that lives outside the repository, and the prompt gains a section "Candidates from a decision model (not verified defects)" with the answers that argus flagged in the files of the change, most confident first and cut to a byte cap. They are leads for the reviewer, never a verdict: the answer format and the fail-closed rules do not change, and if argus is missing or fails, the review runs without the section and says why. `mode: "cached"` (the default) reads answers that argus already holds and sends nothing anywhere; `mode: "run"` lets argus ask its model about the changed files, which sends their source to the model endpoint. `ari review --argus` insists on it and `--no-argus` skips it. With `review.argus.verdicts` (or `--argus-verdicts`) each candidate also gets a short ID, and the reviewer may answer the leads that it checked with `confirmed`, `false_positive`, `deferred` or `uncertain` and a rationale; ari sends only those explicit answers to `argus verify --import`, never changes its own verdict because of them and leaves every unanswered candidate unreviewed. See [the command reference](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/reference.md#argus-candidates-as-evidence).
156
+
157
+ An agent starts with a small base environment (`HOME`, `PATH` and the locale, terminal and `XDG_*` variables) plus the variables that its `env` names, so name an API key there: `"env": ["ANTHROPIC_API_KEY"]`. `"inheritEnv": true` passes everything instead and is an explicit choice.
158
+
159
+ ## Trust
160
+
161
+ `.ari/config.json` and the project packs in `.ari/packs/` can start processes: agent commands, `review.command`, `review.argus`, `regression.setup` and `command` gates. Like direnv with an `.envrc`, ari starts them only after you trust them on this machine: `ari trust` shows the exact commands and records the SHA-256 of that configuration in `~/.ari/trust/`, and any change to those commands asks again. In CI, set `ARI_TRUST_CONFIG=1` for a repository that you control. Reading commands, `ari verify`, the git and agent hooks, the MCP read tools and gates that only run a contract's checks never need it. `ari init`, `ari install` and `ari agents add` keep trust for the configuration that they write themselves. See [the command reference](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/reference.md#trust) and the [security policy](https://github.com/r5n-labs/clis/blob/develop/SECURITY.md).
162
+
135
163
  ## Documentation
136
164
 
137
165
  - [Command reference](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/reference.md): every command, its options, JSON output, exit codes and the hook adapters
138
166
  - [Design](https://github.com/r5n-labs/clis/blob/develop/packages/ariadne/docs/design.md): contracts, gates, packs, memory and verification in detail
139
167
 
140
- Checks, invariants and review commands are shell commands from the repository, run with the same trust as package scripts. Review a repository's `.ari/` before running `ari done` inside it.
168
+ The `checks` and `invariants` of a task contract are shell commands from the repository, run with the same trust as package scripts, and the trust record does not cover them. Review a repository's `.ari/` before running `ari done` inside it. To report a vulnerability, read the [security policy](https://github.com/r5n-labs/clis/blob/develop/SECURITY.md).
141
169
 
142
170
  ## Licence
143
171