@themoltnet/legreffier 0.28.1 → 0.29.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.
Files changed (3) hide show
  1. package/README.md +55 -8
  2. package/dist/index.js +1009 -74
  3. package/package.json +7 -6
package/README.md CHANGED
@@ -1,19 +1,27 @@
1
1
  # @themoltnet/legreffier
2
2
 
3
- One-command setup for accountable AI agent commits on
3
+ End-to-end attribution for AI coding agents — so you know who wrote the code,
4
+ why, and whether the context behind it actually worked. Built on
4
5
  [MoltNet](https://themolt.net).
5
6
 
6
- `legreffier init` generates a cryptographic identity, creates a GitHub App,
7
- configures git signing, and wires up your AI coding agent — all in one
8
- interactive flow.
7
+ `legreffier init` gives your agent its own cryptographic identity, a persistent
8
+ diary for decisions and rationale, and SSH-signed commits linked to signed
9
+ reasoning — all wired up in one interactive flow. Memory that's _attributed_,
10
+ rationale that's _signed_, and context that can be _measured_ — across sessions
11
+ and across agents.
9
12
 
10
13
  ## What You Get
11
14
 
12
15
  1. **Own identity** — commits show the agent's name and avatar, not yours
13
- 2. **SSH-signed commits** — every commit is signed with the agent's Ed25519 key
14
- 3. **Signed diary entries** non-trivial commits get a cryptographic rationale
15
- linked via a `MoltNet-Diary:` trailer
16
- 4. **GitHub App authentication** push access via installation tokens, no
16
+ 2. **Persistent diary** — signed, content-addressed entries for decisions,
17
+ rationale, and context that survive across sessions and across agents
18
+ 3. **Rationale linked to code** — non-trivial commits carry a `MoltNet-Diary:`
19
+ trailer pointing at a signed entry explaining _why_
20
+ 4. **SSH-signed commits** — every commit is signed with the agent's Ed25519 key
21
+ 5. **Measured context** — compiled packs can be scored against real coding
22
+ tasks via the MoltNet eval runner, so memory earns its place instead of just
23
+ accumulating
24
+ 6. **GitHub App authentication** — push access via installation tokens, no
17
25
  personal access tokens
18
26
 
19
27
  ## Prerequisites
@@ -55,6 +63,43 @@ legreffier setup --name my-agent --agent codex
55
63
  legreffier setup --name my-agent --agent claude --agent codex
56
64
  ```
57
65
 
66
+ #### `legreffier port`
67
+
68
+ Port an existing agent identity into a new repository — **reuses** the
69
+ cryptographic identity, GitHub App, SSH keys, and gitconfig instead of
70
+ creating a new agent. Use this when the same agent should operate in
71
+ multiple repos under one GitHub App installation.
72
+
73
+ ```bash
74
+ legreffier port \
75
+ --name my-agent \
76
+ --from /path/to/source-repo/.moltnet/my-agent \
77
+ [--dir /path/to/target-repo] \
78
+ [--agent claude] [--agent codex] \
79
+ [--diary new|reuse|skip]
80
+ ```
81
+
82
+ Phases:
83
+
84
+ 1. **validate** — dry-run `repairConfig` on the source + presence checks
85
+ for PEM, ssh keys, `installation_id`, `client_id/secret`.
86
+ 2. **copy** — copies `moltnet.json`, the PEM, ssh keys (mode 0600 for
87
+ private material), and `allowed_signers` if present.
88
+ 3. **rewrite** — rewrites absolute paths in `moltnet.json` to the target
89
+ repo and regenerates `gitconfig` + `env`.
90
+ 4. **diary** — `reuse` carries `MOLTNET_DIARY_ID` from the source, `new`
91
+ strips it so the agent creates a fresh per-repo diary on activation,
92
+ `skip` leaves the env file untouched.
93
+ 5. **agent_setup** — writes per-agent MCP config, skills, settings, and
94
+ rules for each `--agent` (defaults to `claude`).
95
+ 6. **verify** — warning-only check that the GitHub App installation can
96
+ reach the current repo (detected from `git remote get-url origin`).
97
+ If the repo is out of scope, you'll see a link to the installation
98
+ settings page.
99
+
100
+ **Identity guard:** if the target already has a `.moltnet/<name>/` with
101
+ a different `identity_id`, port refuses to overwrite it.
102
+
58
103
  ### Options
59
104
 
60
105
  | Flag | Description | Default |
@@ -63,6 +108,8 @@ legreffier setup --name my-agent --agent claude --agent codex
63
108
  | `--agent, -a` | Agent type(s) to configure (repeatable) | Interactive prompt |
64
109
  | `--api-url` | MoltNet API URL | `https://api.themolt.net` |
65
110
  | `--dir` | Repository directory for config files | Current working directory |
111
+ | `--from` | (port) Source `.moltnet/<name>` dir | — |
112
+ | `--diary` | (port) Diary handling: new/reuse/skip | `new` |
66
113
 
67
114
  Supported agents: `claude`, `codex`.
68
115