@bluenyang/reins 0.3.1 → 0.3.2

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 CHANGED
@@ -15,7 +15,7 @@ knowledge lost in gitignored space, copies that drift apart. The full list is in
15
15
 
16
16
  ## Status
17
17
 
18
- **0.3.1-rc.2 is the release candidate** (intent 021): `npx @bluenyang/reins@0.3.1-rc.2`. **0.3.0 is the latest release** (intents 019, 020): `npx @bluenyang/reins install`. Up to 0.2.0, skills and hooks called `npx @bluenyang/reins` during work; 0.3 removes that, and `reins update` moves a 0.1.x or 0.2.0 install over. What changed in each version is in [CHANGELOG.md](CHANGELOG.md); what comes next is in the [roadmap](docs/ROADMAP.md).
18
+ **0.3.2-rc.1 is the release candidate** (intent 022): `npx @bluenyang/reins@0.3.2-rc.1`. **0.3.1 is the latest release** (intents 019, 020, 021): `npx @bluenyang/reins install`. Up to 0.2.0, skills and hooks called `npx @bluenyang/reins` during work; 0.3 removes that, and `reins update` moves a 0.1.x or 0.2.0 install over. What changed in each version is in [CHANGELOG.md](CHANGELOG.md); what comes next is in the [roadmap](docs/ROADMAP.md).
19
19
 
20
20
  ## How it works
21
21
 
@@ -25,12 +25,13 @@ knowledge lost in gitignored space, copies that drift apart. The full list is in
25
25
  without a model is done by the PM. The basis is Anthropic's
26
26
  [Building agents: When to fold subagents into your main agent loop](https://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop) (2026-10-22).
27
27
  - **A flow written down, not enforced at run time.** `docs/ROADMAP.md` → intent → spec → implement →
28
- review → test → merge → audit → release → retro. Each stage is a skill in `.agents/skills/`; `AGENTS.md`
28
+ review → test → PR and CI → first audit → merge → release → second audit → retro. Each stage is a skill in `.agents/skills/`; `AGENTS.md`
29
29
  holds the order and the rules for stopping and asking.
30
30
  - **The user approves.** The intent and every spec summary wait for the user; the PM records approvals by
31
31
  quoting the user. A step the user tells the agent to skip is recorded once.
32
- - **An audit for every version.** After the merge and before the rc, an audit reads the records (intent, spec,
33
- git history, logs) and judges each stage; it is mandatory unless the user switches it off. Its record is
32
+ - **Two audits for every version.** After CI and before the merge, a first audit reads the records (intent,
33
+ spec, git history, logs) and looks for risk; after the release a second audit looks at procedure only and
34
+ hands its result to the retro. They are mandatory unless the user switches them off, and their record is
34
35
  committed to `.agents/audit/`.
35
36
  - **Onboarding.** After installation, the first conversation reads the project, asks the user, and writes the
36
37
  project sections of `AGENTS.md`.
@@ -48,7 +48,6 @@ export function knownModels(vendor, current) {
48
48
  out.push(b.model);
49
49
  };
50
50
  for (const d of current) {
51
- take(d.default);
52
51
  for (const g of Object.values(d.groups ?? {})) {
53
52
  if (!g)
54
53
  continue;
@@ -100,7 +99,6 @@ export async function modelsScreen(o) {
100
99
  value: 'scope',
101
100
  label: `scope: ${scope === 'local' ? 'local | project' : 'project | local'}`,
102
101
  },
103
- { value: 'default', label: `${'PM'.padEnd(12)} ${show(doc.default)}` },
104
102
  ...GROUPS.map((g) => ({ value: g, label: groupLine(g, doc.groups?.[g], doc.mode) })),
105
103
  ];
106
104
  const v = await prompter.select({
@@ -130,14 +128,6 @@ export async function modelsScreen(o) {
130
128
  scope = s;
131
129
  continue;
132
130
  }
133
- if (v === 'default') {
134
- const b = await pickModel(o, 'PM', doc.default);
135
- if (b === EXIT)
136
- return 'exit';
137
- if (b)
138
- await write({ set: [`default=${b.vendor}:${b.model}`] }, `PM → ${show(b)}`);
139
- continue;
140
- }
141
131
  const r = await groupScreen(o, v, doc.groups?.[v], write, doc.mode);
142
132
  if (r === 'exit')
143
133
  return 'exit';
@@ -6,13 +6,13 @@ import { groupLine, modelsScreen } from './config-models.js';
6
6
  import { configureBindings } from './configure.js';
7
7
  import { LOCAL_DELEGATION_NOTE } from '../lib/local-delegation.js';
8
8
  import { clackPrompter, isInteractive } from '../lib/prompter.js';
9
- export const CONFIG_HINT = 'change with: reins config bindings --set <default|group|group.role>=<model> [--fallback <group|group.role>=<model|none>] [--local] (see: reins config bindings --help)';
10
- /** The effective settings as text: mode, audit, the PM, each role that is on. */
9
+ export const CONFIG_HINT = 'change with: reins config bindings --set <group|group.role>=<model> [--fallback <group|group.role>=<model|none>] [--local] (see: reins config bindings --help)';
10
+ /** The effective settings as text: mode, audit, each role that is on. */
11
11
  export function formatBindings(doc) {
12
12
  const lines = [
13
13
  ` mode: ${doc.mode ?? 'single'}`,
14
14
  ` audit: ${doc.audit?.required === false ? 'off (switched off by the user)' : 'required every version'}`,
15
- ` PM: ${doc.default ? `${doc.default.vendor} ${doc.default.model}` : 'claude claude-opus-5-5'}`,
15
+ ' PM: the model in the conversation',
16
16
  ];
17
17
  const on = resolveRoles(doc).filter((r) => r.on);
18
18
  if (on.length === 0)
@@ -11,6 +11,17 @@ import { repoRoot } from '../lib/git.js';
11
11
  import { writeGenerated } from '../lib/vendor-write.js';
12
12
  import { packageHarness } from '../lib/upstream.js';
13
13
  import { syncLocalDelegation } from '../lib/local-delegation.js';
14
+ /**
15
+ * The generated files of one `config` call as report lines: `+` a path that did not exist before the call,
16
+ * `~` one that was rewritten, `-` one removed, and what was left alone and why.
17
+ */
18
+ export function formatGenerated(g) {
19
+ return [
20
+ ...g.written.map((p) => ` ${g.created.includes(p) ? '+' : '~'} ${p}`),
21
+ ...g.removed.map((p) => ` - ${p}`),
22
+ ...g.refused.map((x) => `• left alone ${x.path}: ${x.why}`),
23
+ ];
24
+ }
14
25
  /** A model given alone, or `vendor:model`. */
15
26
  export function parseBinding(v) {
16
27
  const s = v.trim();
@@ -80,31 +91,28 @@ export async function configureBindings(o) {
80
91
  const b = eq > 0 ? parseBinding(pair.slice(eq + 1)) : null;
81
92
  if (!target || !b)
82
93
  return refuse(`"${pair}" is not target=model`);
83
- if (target === 'default') {
84
- next.default = b;
94
+ if (target === 'default')
95
+ return refuse('the PM is the model in the conversation — there is nothing to set; assign models to the groups that need another one');
96
+ const [g, role] = target.split('.');
97
+ const group = groupOf(g ?? '');
98
+ if (!group)
99
+ return refuse(`unknown group "${g}" — groups: ${GROUPS.join(', ')}`);
100
+ const roles = GROUP_ROLES[group];
101
+ next.groups = { ...next.groups };
102
+ const spec = { ...next.groups[group] };
103
+ if (role) {
104
+ if (!roles.includes(role))
105
+ return refuse(`unknown role "${role}" in ${group} — roles: ${roles.join(', ') || group}`);
106
+ // a new model keeps the role's fallback; the check below refuses it when they are now the same
107
+ const kept = spec.roles?.[role]?.fallback;
108
+ spec.roles = { ...spec.roles, [role]: kept ? { ...b, fallback: kept } : b };
85
109
  }
86
110
  else {
87
- const [g, role] = target.split('.');
88
- const group = groupOf(g ?? '');
89
- if (!group)
90
- return refuse(`unknown group "${g}" — groups: default, ${GROUPS.join(', ')}`);
91
- const roles = GROUP_ROLES[group];
92
- next.groups = { ...next.groups };
93
- const spec = { ...next.groups[group] };
94
- if (role) {
95
- if (!roles.includes(role))
96
- return refuse(`unknown role "${role}" in ${group} — roles: ${roles.join(', ') || group}`);
97
- // a new model keeps the role's fallback; the check below refuses it when they are now the same
98
- const kept = spec.roles?.[role]?.fallback;
99
- spec.roles = { ...spec.roles, [role]: kept ? { ...b, fallback: kept } : b };
100
- }
101
- else {
102
- delete spec.models;
103
- spec.vendor = b.vendor;
104
- spec.model = b.model;
105
- }
106
- next.groups[group] = spec;
111
+ delete spec.models;
112
+ spec.vendor = b.vendor;
113
+ spec.model = b.model;
107
114
  }
115
+ next.groups[group] = spec;
108
116
  changed.push(target);
109
117
  }
110
118
  for (const pair of o.models ?? []) {
@@ -221,6 +229,11 @@ export async function configureBindings(o) {
221
229
  if (problems.length)
222
230
  return refuse(`the result would not be valid: ${problems.join('; ')}`);
223
231
  const wrote = JSON.stringify(next) !== JSON.stringify(base);
232
+ // a file from an earlier reins may still name a PM model; it goes when the file is written (design §5)
233
+ if (wrote && next.default) {
234
+ delete next.default;
235
+ changed.push('default removed (the PM is the model in the conversation)');
236
+ }
224
237
  if (!wrote) {
225
238
  const doc = effective();
226
239
  return { changed: [], doc, roles: resolveRoles(doc) };
@@ -12,7 +12,7 @@ import { generateVendorFiles } from '../lib/generate.js';
12
12
  import { hookLine, requiredGates } from '../lib/gate-script.js';
13
13
  import { defaultBindings, readTeam } from '../lib/bindings.js';
14
14
  import { overlayReader, workTreeReader } from '../lib/reader.js';
15
- import { LOCAL_DELEGATION, onboardingNote, placeNote, renderBlocks } from '../lib/agents-md.js';
15
+ import { LOCAL_DELEGATION, ONBOARDING_PENDING, RECONCILE_PENDING, onboardingNote, placeNote, renderBlocks, tidyNote, } from '../lib/agents-md.js';
16
16
  import { syncLocalDelegation } from '../lib/local-delegation.js';
17
17
  import { writeGenerated } from '../lib/vendor-write.js';
18
18
  /** Upstream harness files installed into `.agents/harness/` (design §1): everything but seeds and the changelog. */
@@ -327,6 +327,15 @@ export async function runInstall(o) {
327
327
  // a reconcile note already sends the PM to `onboard`; one note is enough
328
328
  if (!/<!-- reins:onboarding done -->/.test(agents) && !agents.includes('<!-- reins:reconcile'))
329
329
  agents = placeNote(agents, onboardingNote(tool === null), 'onboarding');
330
+ // an install from before the AGENTS.md guide gets its note once; a pending onboarding or reconcile
331
+ // follows the guide anyway (design §5)
332
+ if (o.tidy &&
333
+ !agents.includes('<!-- reins:tidy') &&
334
+ !agents.includes(ONBOARDING_PENDING) &&
335
+ !agents.includes(RECONCILE_PENDING)) {
336
+ agents = placeNote(agents, tidyNote(), 'tidy');
337
+ notes.push('AGENTS.md has a note about the AGENTS.md guide — the PM sorts the project sections with the user in the next conversation');
338
+ }
330
339
  if (agents !== before)
331
340
  add('AGENTS.md', agents, `managed blocks: ${[...br.inserted, ...br.replaced].join(', ') || 'onboarding'}`);
332
341
  for (const s of br.skipped)
@@ -369,7 +378,13 @@ export async function runInstall(o) {
369
378
  : workTreeReader(root);
370
379
  const generated = writeGenerated(root, generateVendorFiles(root, rd), !!o.dryRun, !!o.force);
371
380
  if (generated) {
372
- applied.created.push(...generated.written.filter((p) => !applied.created.includes(p)));
381
+ // a generated file that was there before this run is a changed one, not a new one (022 S-28)
382
+ const fresh = new Set(generated.created);
383
+ for (const p of generated.written) {
384
+ const into = fresh.has(p) ? applied.created : applied.changed;
385
+ if (!applied.created.includes(p) && !applied.changed.includes(p))
386
+ into.push(p);
387
+ }
373
388
  applied.removed.push(...generated.removed);
374
389
  for (const r of generated.refused)
375
390
  notes.push(`left alone ${r.path}: ${r.why}`);
@@ -10,6 +10,11 @@ import { BACK, EXIT } from '../lib/prompter.js';
10
10
  import { harnessVersion, packageHarness, packageVersion } from '../lib/upstream.js';
11
11
  import { RUNS_REINS, runInstall } from './install.js';
12
12
  /** Numeric dotted-version compare; pre-release suffixes are ignored. */
13
+ /** A 0.3 harness from before the AGENTS.md guide (0.3.0, 0.3.1 and their rcs); 0.x installs are reconciled instead. */
14
+ export function beforeGuide(version) {
15
+ const [major, minor, patch] = version.split(/[.-]/).map((x) => Number.parseInt(x, 10) || 0);
16
+ return major === 0 && minor === 3 && (patch ?? 0) < 2;
17
+ }
13
18
  export function newer(a, b) {
14
19
  const pa = a.split(/[.-]/).map((x) => Number.parseInt(x, 10) || 0);
15
20
  const pb = b.split(/[.-]/).map((x) => Number.parseInt(x, 10) || 0);
@@ -257,6 +262,7 @@ async function updateNow(o) {
257
262
  force: o.force,
258
263
  pending,
259
264
  pendingDeletes: o.dryRun ? legacy.deletes : [],
265
+ tidy: beforeGuide(pin.version),
260
266
  });
261
267
  res.handEdited = (res.install.generated?.refused ?? [])
262
268
  .filter((r) => r.why.startsWith('edited by hand'))
@@ -1,7 +1,7 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { parseBlocks } from './blocks.js';
4
- import { KNOWN_TOOLS, auditBinding, auditFallback, pmBinding, resolveRoles, } from './bindings.js';
4
+ import { KNOWN_TOOLS, auditBinding, auditFallback, resolveRoles, } from './bindings.js';
5
5
  /**
6
6
  * AGENTS.md managed blocks for 0.3 (design §5): the static blocks from the template plus the delegation
7
7
  * table, resolved from the team bindings when `config`, `install` or `update` writes — never at work time.
@@ -56,15 +56,14 @@ function fallbackHow(doc, r) {
56
56
  * itself, and a Claude role names its `rs-*` file only when the team generated that file with the same model.
57
57
  */
58
58
  export function renderDelegation(doc, local) {
59
- const pm = pmBinding(doc);
60
59
  const lines = ['## Delegation', ''];
61
60
  if (!local)
62
61
  lines.push(`If \`${LOCAL_DELEGATION}\` exists, follow it instead of this section (your personal settings; \`reins config --local\` writes it).`, '');
63
62
  if (doc.mode !== 'multi') {
64
- lines.push(`Mode: **single** — you are the PM (${pm.vendor} ${pm.model}) and do every role yourself, stage by stage. You may use subagents of your own model for read-heavy work (research, large log summaries, review, audit) and, when urgent, for parallel work on independent units; keep connected work (plan and implementation of one feature) in one run. Switching to multi is the user's choice.`);
63
+ lines.push(`Mode: **single** — you are the PM — the model in this conversation — and do every role yourself, stage by stage. You may use subagents of your own model for read-heavy work (research, large log summaries, review, audit) and, when urgent, for parallel work on independent units; keep connected work (plan and implementation of one feature) in one run. Switching to multi is the user's choice.`);
65
64
  }
66
65
  else {
67
- lines.push(`Mode: **multi** — you are the PM (${pm.vendor} ${pm.model}). Hand a role its work with the list of files and decisions it needs; every report comes back to you, and a role never calls another model itself. Roles not listed are yours.`, '', '| role | model | how to call |', '|---|---|---|');
66
+ lines.push(`Mode: **multi** — you are the PM — the model in this conversation. Hand a role its work with the list of files and decisions it needs; every report comes back to you, and a role never calls another model itself. Roles not listed are yours.`, '', '| role | model | how to call |', '|---|---|---|');
68
67
  for (const r of resolveRoles(doc).filter((x) => x.on)) {
69
68
  const agents = claudeAgents(r);
70
69
  let k = 0;
@@ -90,7 +89,7 @@ export function renderDelegation(doc, local) {
90
89
  }
91
90
  const a = auditBinding(doc);
92
91
  const af = auditFallback(doc);
93
- lines.push('', `Audit: ${doc.audit?.required === false ? '**switched off by the user**' : '**required every version**'}; run it on ${a.vendor} ${a.model}${af ? ` (fallback: ${af.vendor} ${af.model}, when that model cannot be called — say so in the audit report)` : ''} in a fresh run that gets only the records, never this conversation.`);
92
+ lines.push('', `Audit: ${doc.audit?.required === false ? '**switched off by the user**' : '**required every version, before the merge and after the release**'}; run it ${a ? `on ${a.vendor} ${a.model}${af ? ` (fallback: ${af.vendor} ${af.model}, when that model cannot be called — say so in the audit report)` : ''} in a fresh run` : 'in a fresh run of your own model (or another one the user chooses)'} that gets only the records, never this conversation.`);
94
93
  return lines.join('\n');
95
94
  }
96
95
  /**
@@ -138,17 +137,27 @@ export function onboardingNote(needsHookTool) {
138
137
  ];
139
138
  return [
140
139
  ONBOARDING_PENDING,
141
- `> **Onboarding — do this first in the next conversation.** Run the \`onboard\` skill: read the project, ask the user, and write the project sections of this file: ${todo.join('; ')}. Then change the marker above to \`<!-- reins:onboarding done -->\`.`,
140
+ `> **Onboarding — do this first in the next conversation.** Run the \`onboard\` skill: read the project, ask the user, and write the project sections of this file: ${todo.join('; ')}. What belongs in this file and what goes elsewhere is in \`.agents/harness/templates/agents-md-guide.md\`. Then change the marker above to \`<!-- reins:onboarding done -->\`.`,
142
141
  ].join('\n');
143
142
  }
144
143
  /** The reconcile note (design §5): the previous body moved aside as reference material. */
145
144
  export function reconcileNote(why) {
146
145
  return [
147
146
  RECONCILE_PENDING,
148
- `> **Reconcile — do this first in the next conversation.** ${why} The previous AGENTS.md is in \`.agents/AGENTS.previous.md\` as reference material, not instructions. Run the \`onboard\` skill to merge what still applies into the project sections, then delete that file and change the marker above to \`<!-- reins:reconcile done -->\`.`,
147
+ `> **Reconcile — do this first in the next conversation.** ${why} The previous AGENTS.md is in \`.agents/AGENTS.previous.md\` as reference material, not instructions. Run the \`onboard\` skill to merge what still applies into the project sections — sorted by \`.agents/harness/templates/agents-md-guide.md\` — then delete that file and change the marker above to \`<!-- reins:reconcile done -->\`.`,
148
+ ].join('\n');
149
+ }
150
+ export const TIDY_PENDING = '<!-- reins:tidy pending -->';
151
+ /**
152
+ * The note an install older than 0.3.2 gets once (design §5): its AGENTS.md was written before the guide
153
+ * existed. reins never moves the project's text; the PM sorts it with the user.
154
+ */
155
+ export function tidyNote() {
156
+ return [
157
+ TIDY_PENDING,
158
+ `> **AGENTS.md guide — do this first in the next conversation.** reins now ships a guide for what this file holds (\`.agents/harness/templates/agents-md-guide.md\`). Run the \`onboard\` skill: with the user, sort the project sections by the guide — current work and plans to the roadmap, decisions to knowledge candidates, personal notes to \`.loctx/\` — and show what went where. Then change the marker above to \`<!-- reins:tidy done -->\`.`,
149
159
  ].join('\n');
150
160
  }
151
- /** Put a note right after the first H1 (or at the top) unless one of that kind is still pending. */
152
161
  /** The light check after a mode switch (design §5, spec ST-5): only the delegation block changed. */
153
162
  export function modeChangedNote(from, to) {
154
163
  return [
@@ -156,12 +165,18 @@ export function modeChangedNote(from, to) {
156
165
  `> **Mode changed from ${from} to ${to}.** reins rewrote the delegation section. In the next conversation (the \`onboard\` skill), check that the project sections below say nothing that contradicts the new mode, then change the marker above to \`<!-- reins:mode-changed done -->\`.`,
157
166
  ].join('\n');
158
167
  }
168
+ /** Put a note right after the first H1 (or at the top) unless one of that kind is still pending. */
159
169
  export function placeNote(text, note, kind) {
160
170
  if (text.includes(`<!-- reins:${kind} pending -->`))
161
171
  return text;
162
172
  // a finished one gives way to the new one (e.g. a second mode switch)
163
173
  // only the note reins wrote goes with its marker; a project quote under it stays
164
- const lead = { onboarding: 'Onboarding', reconcile: 'Reconcile', 'mode-changed': 'Mode changed' }[kind];
174
+ const lead = {
175
+ onboarding: 'Onboarding',
176
+ reconcile: 'Reconcile',
177
+ 'mode-changed': 'Mode changed',
178
+ tidy: 'AGENTS.md guide',
179
+ }[kind];
165
180
  text = text.replace(new RegExp(`<!-- reins:${kind} done -->\\n(?:> \\*\\*${lead}[^\\n]*\\n)?\\n?`), '');
166
181
  const m = /^# .*\n/m.exec(text);
167
182
  if (!m)
@@ -30,8 +30,6 @@ const PL_REVIEWERS = new Set([
30
30
  'doc-reviewer',
31
31
  'retrospector',
32
32
  ]);
33
- /** Used when a file names no default. */
34
- export const DEFAULT_BINDING = { vendor: 'claude', model: 'claude-opus-5-5' };
35
33
  const pair = (b) => ({ vendor: b.vendor, model: b.model });
36
34
  /** The group's models in order: `models`, else the single `vendor`/`model`. */
37
35
  function groupModels(spec) {
@@ -88,18 +86,16 @@ export function resolveRoles(doc) {
88
86
  }
89
87
  return out;
90
88
  }
91
- /** The PM's model. */
92
- export function pmBinding(doc) {
93
- return doc.default ? pair(doc.default) : { ...DEFAULT_BINDING };
94
- }
95
- /** The model an audit should run on: the auditor group's, else the PM's (design §3-3). */
89
+ /**
90
+ * The model an audit should run on: the auditor group's. Without one the audit is a fresh run of the PM's
91
+ * own model — the model in the conversation, which no file names (design §3-3, §5).
92
+ */
96
93
  export function auditBinding(doc) {
97
94
  const a = doc.groups?.auditor;
98
95
  const own = a?.roles?.auditor;
99
96
  if (own)
100
97
  return pair(own);
101
- const ms = a ? groupModels(a) : [];
102
- return ms[0] ?? pmBinding(doc);
98
+ return a ? groupModels(a)[0] : undefined;
103
99
  }
104
100
  /** The fallback of the model `auditBinding` names, if the file gives one. */
105
101
  export function auditFallback(doc) {
@@ -135,17 +131,16 @@ export function fallbackProblems(doc) {
135
131
  }
136
132
  /** Whether the per-version audit is mandatory (design §3-3): true unless the file says false. */
137
133
  export const auditRequired = (doc) => doc.audit?.required !== false;
138
- /** The local override wins per key: mode, audit, default, each tool and each group as a whole. */
134
+ /** The local override wins per key: mode, audit, each tool and each group as a whole. `default` is read from neither. */
139
135
  export function mergeLocal(team, local) {
140
136
  if (!local)
141
137
  return team;
142
138
  const out = { ...team, schema: 'reins/bindings@2' };
139
+ delete out.default;
143
140
  if (local.mode)
144
141
  out.mode = local.mode;
145
142
  if (local.audit)
146
143
  out.audit = { ...team.audit, ...local.audit };
147
- if (local.default)
148
- out.default = pair(local.default);
149
144
  if (local.tools)
150
145
  out.tools = { ...team.tools, ...local.tools };
151
146
  if (local.groups)
@@ -162,7 +157,7 @@ export function validateBindings(doc) {
162
157
  .errors;
163
158
  return (errs ?? []).map((e) => `${e.instancePath || '(root)'} ${e.message ?? 'invalid'}`);
164
159
  }
165
- /** Where each version-1 role goes in version 2 (design §7). `pm` becomes `default`. */
160
+ /** Where each version-1 role goes in version 2 (design §7). `pm` has no place: the PM is the model in the conversation. */
166
161
  export const V1_ROLE_MAP = {
167
162
  planner: { group: 'planner', role: 'spec-writer' },
168
163
  pl: { group: 'pl' },
@@ -204,9 +199,8 @@ export function convertV1(v1) {
204
199
  : 'claude';
205
200
  return { vendor, model: m };
206
201
  };
207
- const pm = bindingOf(roles['pm']);
208
- if (pm)
209
- doc.default = pm;
202
+ if (roles['pm'] !== undefined)
203
+ notes.push('role pm: not moved — the PM is the model in the conversation, no setting names it');
210
204
  for (const [name, raw] of Object.entries(roles)) {
211
205
  if (name === 'pm')
212
206
  continue;
@@ -311,13 +305,12 @@ export function writeBindings(root, doc, scope) {
311
305
  mkdirSync(dirname(p), { recursive: true });
312
306
  writeFileSync(p, `${HEADER}${stringify({ ...doc, schema: 'reins/bindings@2' })}`);
313
307
  }
314
- /** A fresh file for install: single mode, the audit required, the PM on Claude, the detected tools. */
308
+ /** A fresh file for install: single mode, the audit required, the detected tools. */
315
309
  export function defaultBindings(tools) {
316
310
  return {
317
311
  schema: 'reins/bindings@2',
318
312
  mode: 'single',
319
313
  audit: { required: true },
320
- default: { ...DEFAULT_BINDING },
321
314
  tools: Object.fromEntries(tools.map((t) => [t.name, { cli: t.cli, use: t.use }])),
322
315
  };
323
316
  }
@@ -68,6 +68,7 @@ function settingsDeny(text) {
68
68
  export function writeGenerated(root, gen, dryRun, force = false) {
69
69
  const res = {
70
70
  written: [],
71
+ created: [],
71
72
  removed: [],
72
73
  unchanged: [],
73
74
  refused: [],
@@ -118,6 +119,7 @@ export function writeGenerated(root, gen, dryRun, force = false) {
118
119
  writeFileSync(abs, w.content);
119
120
  }
120
121
  res.written.push(w.path);
122
+ res.created.push(w.path);
121
123
  after[w.path] = next;
122
124
  continue;
123
125
  }
package/cli/dist/reins.js CHANGED
@@ -4,7 +4,7 @@ import { Command } from 'commander';
4
4
  import { runInstall } from './commands/install.js';
5
5
  import { runMigrate } from './commands/migrate.js';
6
6
  import { formatUpdate, runUpdate } from './commands/update.js';
7
- import { configureBindings, configureGates } from './commands/configure.js';
7
+ import { configureBindings, configureGates, formatGenerated } from './commands/configure.js';
8
8
  import { refreshGates } from './commands/config-gates.js';
9
9
  import { applicable, formatGateDiff } from './lib/gate-refresh.js';
10
10
  import { NotARepository, repoRoot } from './lib/git.js';
@@ -153,7 +153,7 @@ config
153
153
  config
154
154
  .command('bindings')
155
155
  .description('change the model assignment without a screen')
156
- .option('--set <pairs...>', 'default|<group>|<group>.<role>=<model> or =<vendor>:<model>')
156
+ .option('--set <pairs...>', '<group>|<group>.<role>=<model> or =<vendor>:<model>')
157
157
  .option('--models <pairs...>', '<pl|advisor>=<model>,<model>,… (several models)')
158
158
  .option('--off <groups...>', 'switch groups off (the PM does their work)')
159
159
  .option('--fallback <pairs...>', '<group>|<group>.<role>=<model>|none — what to call when that model cannot be called')
@@ -201,15 +201,9 @@ config
201
201
  process.stdout.write(`• ${LOCAL_DELEGATION_NOTE(r.localDelegation)}\n`);
202
202
  if (r.modeChanged)
203
203
  process.stdout.write('• AGENTS.md has a mode-changed note — the PM checks the project sections in the next conversation\n');
204
- const g = r.generated;
205
- if (g) {
206
- for (const p of g.written)
207
- process.stdout.write(` ~ ${p}\n`);
208
- for (const p of g.removed)
209
- process.stdout.write(` - ${p}\n`);
210
- for (const x of g.refused)
211
- process.stdout.write(`• left alone ${x.path}: ${x.why}\n`);
212
- }
204
+ if (r.generated)
205
+ for (const line of formatGenerated(r.generated))
206
+ process.stdout.write(`${line}\n`);
213
207
  });
214
208
  config
215
209
  .command('gates')
package/docs/README.ko.md CHANGED
@@ -8,14 +8,14 @@ BlueNyang과 Team Croffle의 저장소 열두 곳이 같은 하네스 계통을
8
8
 
9
9
  ## 상태
10
10
 
11
- **0.3.1-rc.2가 릴리스 후보입니다**(intent 021): `npx @bluenyang/reins@0.3.1-rc.2`. **0.3.0이 최신 릴리스입니다**(intent 019, 020): `npx @bluenyang/reins install`. 0.2.0까지는 스킬과 훅이 작업 중에 `npx @bluenyang/reins`를 불렀습니다. 0.3은 그것을 없애고, `reins update`가 0.1.x·0.2.0 설치를 옮깁니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 앞으로의 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
11
+ **0.3.2-rc.1이 릴리스 후보입니다**(intent 022): `npx @bluenyang/reins@0.3.2-rc.1`. **0.3.1이 최신 릴리스입니다**(intent 019, 020, 021): `npx @bluenyang/reins install`. 0.2.0까지는 스킬과 훅이 작업 중에 `npx @bluenyang/reins`를 불렀습니다. 0.3은 그것을 없애고, `reins update`가 0.1.x·0.2.0 설치를 옮깁니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 앞으로의 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
12
12
 
13
13
  ## 동작 방식
14
14
 
15
15
  - **기본은 단일 에이전트입니다.** 에이전트 하나(PM)가 모든 단계를 수행합니다. 조사, 리뷰, 감사처럼 읽기 위주의 일이나 급한 병렬 작업에는 같은 모델의 서브에이전트를 쓸 수 있습니다. 멀티는 역할군(PM, PL, Planner, Implementer, Executor, Advisor, Auditor)에 모델을 할당해 켭니다. 모델이 없는 역할군의 일은 PM이 합니다. 근거는 Anthropic의 [Building agents: When to fold subagents into your main agent loop](https://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop)(2026-10-22)입니다.
16
- - **흐름은 실행 중 차단이 아니라 문서로 적습니다.** `docs/ROADMAP.md` → intent → spec → 구현 → 리뷰 → 테스트 → 머지 → 감사 → 릴리스 → 회고. 단계마다 `.agents/skills/`에 스킬이 있고, 순서와 멈추고 물을 때는 `AGENTS.md`에 있습니다.
16
+ - **흐름은 실행 중 차단이 아니라 문서로 적습니다.** `docs/ROADMAP.md` → intent → spec → 구현 → 리뷰 → 테스트 → PR·CI → 1차 감사 → 머지 → 릴리스 → 2차 감사 → 회고. 단계마다 `.agents/skills/`에 스킬이 있고, 순서와 멈추고 물을 때는 `AGENTS.md`에 있습니다.
17
17
  - **승인은 사용자가 합니다.** intent와 매번의 spec 요약은 사용자를 기다립니다. PM은 사용자의 말을 인용해 승인을 기록합니다. 사용자가 건너뛰라고 한 단계는 한 번만 적용됩니다.
18
- - **버전마다 감사합니다.** 머지 뒤, rc 전에 감사가 기록(intent, spec, git 이력, 로그)을 읽고 단계마다 판정합니다. 사용자가 끄지 않는 한 필수이고, 결과는 `.agents/audit/`에 커밋됩니다.
18
+ - **버전마다 두 번 감사합니다.** CI 뒤 머지 전에 1차 감사가 기록(intent, spec, git 이력, 로그)을 읽고 위험을 봅니다. 배포 뒤에는 2차 감사가 절차만 보고 결과를 회고로 넘깁니다. 사용자가 끄지 않는 한 필수이고, 기록은 `.agents/audit/`에 커밋됩니다.
19
19
  - **온보딩.** 설치 뒤 첫 대화에서 PM이 프로젝트를 파악하고 사용자에게 물어 `AGENTS.md`의 프로젝트 절을 씁니다.
20
20
  - **파일마다 수명이 있습니다.** 작업 중 파일은 회고 뒤에 요약하고 지웁니다.
21
21
 
@@ -2,7 +2,19 @@
2
2
 
3
3
  Read by `reins update`: it lists the entries newer than a project's pinned version.
4
4
 
5
+ ## 0.3.2
6
+ - The PM is the model in the conversation. The delegation block no longer names a PM model, roles without a model are done by that same model, and so is the audit when the auditor has no model (a fresh run, or another model the user chooses). `default` in `bindings.yaml` (and the personal file) is no longer read: files that hold it keep loading, `config` drops the key when it writes the file, and `config bindings --set default=…` is refused. `update` no longer carries a 0.2.0 `pm` role over.
7
+ - The report of `update` (and of `install` and `config`) marks a generated file it rewrote as changed (`~`); only a path that did not exist before the run is new (`+`).
8
+ - One flow after the approvals: once the spec is accepted, implementation, review, test, push, PR and CI follow without asking, with one report at the end. "Anything that leaves the machine" is no longer a stop for a branch of the work in progress; a merge (every PR) and a stable release still wait for the user's instruction.
9
+ - Adjusting the spec while working: only a work unit added, dropped or rescoped stops for approval. A smaller adjustment (another method inside a unit, a small fix from a review, an audit or an rc check, another order, a change with a precedent) goes on, is recorded in the spec's new adjustment record (`A-n`) and is reported at the end of the flow. The audit keeps a recorded adjustment and names an unrecorded one.
10
+ - Two audits per version. The first audit runs after CI and before the merge, on the PR branch, and looks for risk; its record is committed on that branch and the merge follows on the user's instruction. The second audit runs after the stable release, looks at procedure only and hands its result to the retro. Fixing records or documents does not call for another audit. `.agents/audit/<version>.md` holds both (`## 1차 감사`, `## 2차 감사`); the template changed.
11
+ - Accepted findings: an audit finding the user accepted three times or more is proposed by the retro as a knowledge entry of `kind: accepted-finding` (a new value in the knowledge schema). Both audits read those entries and list such a finding as a known acceptance instead of a violation.
12
+ - Where a loop ends: the retro ends the loop — the PM reports that it is closed and stops, and the next intent is written when the user starts the next work (or the user named another end for that run). While a release approval, a merge or a stable instruction is awaited, the PM reports and waits and does not start another unit's work. Naming a version is not an instruction to start it; ideas go to the roadmap whenever they come.
13
+ - Merge, review and retro: the PM judges which PR a merge instruction means (the named one, what it proposed, or the PR just spoken of) and asks when it cannot tell; the merged branch is deleted at the merge; when a merge rewrites commits, later records name the default branch's SHAs and a SHA table is kept in the audit record. Every work unit is reviewed, also one that changes tests or documents only, or the spec records that it was not and why. The retro lists apart the proposals that are about the harness itself.
14
+ - New `.agents/harness/templates/agents-md-guide.md`: what the project sections of AGENTS.md hold (the project, its overall goals, structure, commands, common rules, red lines) and where everything else goes (roadmap, knowledge, `.loctx/`, CONTRIBUTING). The `onboard` skill sorts existing content by it and shows the user what goes where. `update` from 0.3.0 or 0.3.1 leaves a `reins:tidy pending` note in AGENTS.md once, so the PM sorts the file with the user; reins itself does not touch the project's text.
15
+
5
16
  ## 0.3.1
17
+ - Stable 2026-11-11 (same harness as rc.2).
6
18
  - The `retro` skill and the retrospector propose knowledge candidates from decisions and failures repeated in history and the audit.
7
19
  - `.claude/settings.json` is merged: reins changes only the deny rules it wrote (listed under `owned:` in `generated.yaml`) and keeps the user's entries, also with `--force` and in a file it never wrote. The audit counts only those rules as drift.
8
20
  - The auditor is read-only: its call line no longer asks for write access, it returns the audit record as its answer and the PM writes it unchanged.
package/harness/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  group: auditor
3
- summary: "Audits a finished version against the harness only."
3
+ summary: "Audits a version against the harness only: risk before the merge, procedure after the release."
4
4
  roles:
5
5
  auditor:
6
- does: "Judge whether the version followed the flow in AGENTS.md, from the records alone, and return the full text of the audit record; the PM writes it to .agents/audit/<version>.md unchanged."
6
+ does: "Judge whether the version followed the flow in AGENTS.md, from the records alone — in the first audit, before the merge, the risk in the work; in the second, after the release, the procedure only — and return the full text of the audit record; the PM writes it to .agents/audit/<version>.md unchanged."
7
7
  must_not:
8
8
  - "judge code quality or test results as such; they are evidence that a step ran"
9
9
  - "call a step kept without an evidence path; that is \"cannot confirm\""
@@ -16,6 +16,10 @@ roles:
16
16
 
17
17
  Reads: AGENTS.md and the harness settings as they were, the intent, spec, `docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`, git history, history, gate and test logs, the gate log of each commit (`.loctx/reports/gates/<tree>.log`, where `<tree>` is `git rev-parse <commit>^{tree}`), and the PR and CI records the PM collected (`.loctx/reports/<version>/`): PR number, who merged it and when, merge and head SHA, CI checks and results, the gate output in the PR body, as the host's CLI printed them.
18
18
 
19
- For each step of the flow (local roadmap → roadmap → intent → approval → spec → approval → implementation and commits → review → test → merge): kept, violated, cannot confirm, or skipped on the user's instruction (recorded in `waivers:`). Judge against the rules in force at the time. Commits: each commit is a meaningful unit — a point you can revert or reset to without taking other working work or features with it; several commits for one work unit (implementation, review fixes) are fine, and small units that may be reverted together may share one. A commit that mixes unrelated work, so one part cannot be reverted alone, is a violation. Gates: the log of each commit's tree holds a run with `worktree: clean` and `exit: 0`; say whether it was left at commit time or filled in before the audit (`stage: audit`). No such run is "cannot confirm"; a clean run that ends with another `exit:` is a violation. Changing the spec's work units themselves (adding, dropping, scope, order) without approval is a violation. A generated or harness file changed by a commit that is not an `update`/`config` commit is a violation. In `.claude/settings.json` only reins' deny rules count (listed under `owned:` in `.agents/harness/generated.yaml`); the user's own entries there are not drift. For each violation: the criticism, and a remedy (by severity, with PL or Advisor opinions).
19
+ An audit goes through the history, finds what went wrong and says what to put right; it does not check every commit against every sentence of the rules. It still catches everything, and it reads the `kind: accepted-finding` entries of `.agents/knowledge/`: a finding inside what such an entry accepts is listed as a known acceptance, naming the entry's file, and not as a violation; outside it, it is a violation as before.
20
20
 
21
- Returns: the whole record in the form of `.agents/harness/templates/audit.md`, as the answer. The PM keeps that answer as it came under `.loctx/reports/<version>/`, writes it to `.agents/audit/<version>.md` without changing or shortening a verdict, and adds only the user's decision in its own section.
21
+ **First audit** (after CI, before the merge; the PR branch). For each step of the flow (local roadmap → roadmap → intent → approval → spec → approval → implementation and commits → review → test → PR and CI): kept, violated, cannot confirm, or skipped on the user's instruction (recorded in `waivers:`). Judge against the rules in force at the time. Look for risk: an approval that is missing or was not given by the user, scope beyond the intent and spec, a red line, a work unit that was not reviewed (unless the spec's adjustment record says so and why), a check that failed or cannot be confirmed, a generated or harness file changed by hand. Commits: each commit is a meaningful unit — a point you can revert or reset to without taking other working work or features with it; several commits for one work unit (implementation, review fixes) are fine, and small units that may be reverted together may share one. A commit that mixes unrelated work, so one part cannot be reverted alone, is a violation. Gates: the log of each commit's tree holds a run with `worktree: clean` and `exit: 0`; say whether it was left at commit time or filled in before the audit (`stage: audit`). No such run is "cannot confirm"; a clean run that ends with another `exit:` is a violation. A work unit added, dropped or rescoped without approval is a violation; an adjustment recorded in the spec is kept; an adjustment made without a record is a violation whose remedy is the record. A generated or harness file changed by a commit that is not an `update`/`config` commit is a violation. In `.claude/settings.json` only reins' deny rules count (listed under `owned:` in `.agents/harness/generated.yaml`); the user's own entries there are not drift. For each violation: the criticism, and a remedy (by severity, with PL or Advisor opinions).
22
+
23
+ **Second audit** (after the stable release, before the retro; from the first audit's head to the version's last commit). Procedure only: whether each merge had the user's instruction and how it was merged, the CI and release records, the release documents, and whether the records are complete (the user's decisions on the first audit, waivers, the spec's adjustment record, the reason line of each PR that went without a first audit). It does not tell anyone to fix anything: it lists what is handed to the retro.
24
+
25
+ Returns: the whole record in the form of `.agents/harness/templates/audit.md`, as the answer. The PM keeps that answer as it came under `.loctx/reports/<version>/`, writes it to `.agents/audit/<version>.md` without changing or shortening a verdict — the first audit under `## 1차 감사`, the second under `## 2차 감사` — and adds only its own sections: the user's decision on the first audit, and under the second the SHA table and what the retro decided.
@@ -2,7 +2,7 @@
2
2
  "required": ["id", "kind", "status", "topics", "decisions", "applies_to", "source"],
3
3
  "properties": {
4
4
  "id": { "type": "string" },
5
- "kind": { "enum": ["decision", "failure"] },
5
+ "kind": { "enum": ["decision", "failure", "accepted-finding"] },
6
6
  "status": { "enum": ["active", "superseded"] },
7
7
  "supersedes": { "type": ["string", "null"] },
8
8
  "topics": { "type": "array", "items": { "type": "string" } },
@@ -14,7 +14,7 @@
14
14
  ## Settings
15
15
 
16
16
  - `.agents/harness/bindings.yaml` — the mode (`single` or `multi`), which model does which role group, and `audit.required`. A personal override may sit in `.loctx/bindings.local.yaml`; when it exists, it wins, and when it changes who does what, `.loctx/delegation.local.md` holds that person's delegation table.
17
- - **When `audit.required` is true (the default), every version ends with an audit (skill `audit`). It is mandatory: never skip it; only the user switches it off.**
17
+ - **When `audit.required` is true (the default), every version is audited twice (skill `audit`): a first audit before the merge and a second audit after the release. Both are mandatory: never skip one; only the user switches them off.**
18
18
  - `.agents/harness/gates.yaml` — the project's own check commands; the hooks and the `test` skill run them as they are.
19
19
  - `.agents/harness/roles/<group>.md` — what each role does, must not do, and which tools it may use.
20
20
  <!-- reins:end settings -->
@@ -27,10 +27,12 @@ Follow these steps in order; each has a skill in `.agents/skills/`, and each ski
27
27
  1. `roadmap` — ideas go to `.loctx/ROADMAP.local.md`; once settled with the user, to `docs/ROADMAP.md`.
28
28
  2. `intent` — the PM writes the direction and the plan; **the user approves**.
29
29
  3. `spec` — the spec, its work units (W-n) and checks (V-n); **the user answers 진행 or 수정 on its summary, every time**.
30
- 4. `implement` → `review` — commit at meaningful units (a point you can revert or reset to without taking other working work or features with it), each naming its spec items; changing the spec's work units needs the spec changed and approved first.
31
- 5. `test` → `merge` → **`audit`** (after the merge, before the rc) → `release` → `retro` (after stable), then delete the version's working files.
30
+ 4. `implement` → `review` — commit at meaningful units (a point you can revert or reset to without taking other working work or features with it), each naming its spec items. Adding, dropping or rescoping a work unit needs the spec changed and approved first; a smaller adjustment goes on, is recorded in the spec (`A-n`) and is reported at the end of the flow.
31
+ 5. `test` → `merge` (push, PR, CI) → **`audit`** (the first audit: risk, before the merge) — from the accepted spec to the first audit this is **one flow without asking**: do not stop for permission between these steps; report once at its end. Then the merge on the user's instruction → `release` (the rc the way the repository releases; stable on the user's instruction) → **`audit`** (the second audit: procedure only, handed to the retro) → `retro`, then delete the version's working files.
32
32
 
33
- The first conversation after installation (or after a reconcile or mode-changed marker appears in this file) starts with `onboard`.
33
+ A loop is the work the user started — usually one version — up to its retro. **The retro ends the loop**: report that it is closed and stop; the next `intent` is written when the user starts the next work. If the user named another end ("go on to …", "do not stop"), follow it for that instruction only and quote it in `.loctx/ROADMAP.local.md`; the intent's approval, the spec's 진행 or 수정, every merge and the stable release still wait for the user. Ideas for later work go to the roadmap whenever they come. Naming a version is not an instruction to start it.
34
+
35
+ The first conversation after installation, and any conversation that finds a pending `reins:` marker in this file (onboarding, reconcile, mode-changed, tidy), starts with `onboard`.
34
36
  <!-- reins:end flow -->
35
37
 
36
38
  <!-- reins:begin delegation v=0.3.0 -->
@@ -43,12 +45,15 @@ The first conversation after installation (or after a reconcile or mode-changed
43
45
  - Record an approval by quoting the user in the intent's or spec's `approvals:` — `{ role: user, by, at, words, rev }` — and commit it. Never record an approval the user did not give.
44
46
  - A step or approval the user tells you to skip goes to the intent's `waivers:` — `{ step, words, at, scope: once }` — at that moment. It applies once; next time, follow the flow.
45
47
  - Every file you create has an owner and a deletion point (each skill lists them). Working files under `.loctx/reports/<version>/` are summarised in history and the audit, then deleted after the retro.
48
+ - `.agents/audit/<version>.md` holds both audits of a version; an adjustment made while working is a line in the spec's adjustment record (`A-n`).
46
49
  <!-- reins:end records -->
47
50
 
48
51
  <!-- reins:begin stops v=0.3.0 -->
49
52
  ## When to stop and ask
50
53
 
51
- - **Ask the user and stop:** an irreversible action (force push, deleting a tag, rewriting the default branch, data or production changes); a stable release; anything that leaves the machine (push, PR, release) unless the settings or the user allow it; scope moving outside the intent and spec; a conflict with a past decision; a next step that needs an approval not yet given.
54
+ - **Ask the user and stop:** an irreversible action (force push, deleting a tag, rewriting the default branch, data or production changes); a merge; a stable release; work that would touch a red line; a work unit that has to be added, dropped or rescoped; scope moving outside the intent and spec; a conflict with a past decision; a next step that needs an approval not yet given. Pushing a branch of the work in progress and opening its PR is part of the flow (an accepted spec's work units, their records, release documents); taking anything else out of the machine still needs the user's word.
55
+ - **While you wait for the user** — a release approval, a merge instruction, a stable instruction — report and wait; do not start another unit's work. Stabilising the same version is this loop's work.
56
+ - **The retro ends the loop:** report that it is closed and stop.
52
57
  - **Stop and find the cause:** two failures in the same work unit; empty or doubtful check output; a pass without evidence (a pass needs the raw output's path).
53
58
  - **When the user interrupts** (chat, Ctrl+C, session end): stop and write the resume point in `.loctx/history/<version>.md`.
54
59
  - What no role does: `.agents/harness/policy/common-red-lines.yaml`.
@@ -0,0 +1,32 @@
1
+ # What AGENTS.md holds
2
+
3
+ AGENTS.md is read by every agent at the start of every session, and by everyone who takes the project's source. Keep it short and slow to change: it describes the project and its standing rules, not the work of the day. This guide is for the project sections — everything outside the `reins:` blocks, which reins writes.
4
+
5
+ ## What belongs
6
+
7
+ - What the project is, in a few lines.
8
+ - Its goals and scope — the overall ones, the reason the project exists.
9
+ - Its structure: where things are.
10
+ - The stack and the commands to build, check and run it.
11
+ - Common rules and conventions that hold for all work (branches, commits, documents, review).
12
+ - Red lines: paths not to touch, secret files, actions never taken.
13
+ - The important instructions that must keep being followed.
14
+
15
+ ## What does not, and where it goes
16
+
17
+ | It is | It goes to |
18
+ |---|---|
19
+ | the current work, progress, what is done and what is next | the roadmap: `docs/ROADMAP.md` when settled, `.loctx/ROADMAP.local.md` for ideas |
20
+ | a plan for one version | the roadmap, then that version's intent and spec |
21
+ | a decision and its reason | a knowledge candidate for `.agents/knowledge/` — proposed, written when the user accepts it |
22
+ | a decision made once, for one piece of work | that work's intent or spec, or `.loctx/history/<version>.md` |
23
+ | personal notes, this machine's settings | `.loctx/` |
24
+ | how to contribute | `CONTRIBUTING.md` |
25
+ | a long explanation of the design | a document under `docs/`, linked from AGENTS.md in one line |
26
+
27
+ ## Rules of thumb
28
+
29
+ - If a line will be wrong next month, it does not belong here.
30
+ - An instruction the user gave once for one item is not a rule. Write a rule only when the user said it is one.
31
+ - Prefer a pointer to a file over a copy of its content.
32
+ - When you move something out, tell the user what went where; knowledge is only proposed, never written without their word.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  version: 0.0.0
3
- range: "<base>..<head>"
4
- at: 0000-00-00
5
- auditor: { vendor: —, model: —, independence: — }
3
+ first: { range: "<base>..<head>", at: 0000-00-00, auditor: { vendor: —, model: —, independence: — } }
4
+ second: { range: "<first head>..<last>", at: 0000-00-00, auditor: { vendor: —, model: —, independence: — } }
6
5
  ---
7
- ## 읽은 것
6
+ ## 1차 감사
7
+ <!-- CI 뒤, 머지 전. 위험을 본다. 감사자의 답을 고치지 않고 쓴다. -->
8
+ ### 읽은 것
8
9
  —
9
- ## 단계별 판정
10
+ ### 단계별 판정
10
11
  | 단계 | 판정 | 근거 |
11
12
  |---|---|---|
12
13
  | local 로드맵 → 로드맵 | — | — |
@@ -15,11 +16,34 @@ auditor: { vendor: —, model: —, independence: — }
15
16
  | 구현·커밋 | — | — |
16
17
  | 리뷰 | — | — |
17
18
  | 테스트 | — | — |
18
- | 머지 | — | — |
19
+ | PR·CI | — | — |
19
20
  | 생성 파일·하네스 손 수정 | — | — |
20
- ## 비판
21
+ ### 비판
21
22
  —
22
- ## 해결 방법
23
+ ### 알려진 수용
24
+ <!-- knowledge의 accepted-finding 항목 범위 안의 지적: 위반이 아니라 여기에, 항목 파일과 함께 -->
23
25
  —
24
- ## 사용자 처리
26
+ ### 해결 방법
27
+ —
28
+ ### 사용자 처리
29
+ —
30
+ ## 2차 감사
31
+ <!-- stable 뒤, 회고 직전. 절차만 본다. 감사자의 답을 고치지 않고 쓴다. -->
32
+ ### 읽은 것
33
+ —
34
+ ### 절차 판정
35
+ | 절차 | 판정 | 근거 |
36
+ |---|---|---|
37
+ | 머지 지시와 방식 | — | — |
38
+ | CI·배포 기록 | — | — |
39
+ | 릴리스 문서 | — | — |
40
+ | 기록의 완결성 | — | — |
41
+ ### 알려진 수용
42
+ —
43
+ ### 회고로 넘길 것
44
+ —
45
+ ### SHA 대응
46
+ <!-- PM이 붙인다: 머지가 커밋을 다시 만들었을 때 브랜치 SHA ↔ 기본 브랜치 SHA -->
47
+ —
48
+ ### 회고에서의 처리
25
49
  —
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  id: YYYY-MM-DD_slug
3
- kind: decision
3
+ kind: decision # decision | failure | accepted-finding (an audit finding the user accepts every time; the audit lists it as a known acceptance)
4
4
  status: active
5
5
  supersedes: null
6
6
  topics: []
@@ -13,6 +13,9 @@ summary_for_user: |
13
13
  - [ ] W-1 —
14
14
  ## 검증 기준
15
15
  - V-1 —
16
+ ## 조정 기록
17
+ <!-- - A-n (YYYY-MM-DD, W-n) 무엇을 · 왜 · 커밋 -->
18
+ —
16
19
  ## 우려
17
20
  —
18
21
  ## 범위 밖
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluenyang/reins",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Installs, migrates and updates an agent harness (harness → loop → graph) that keeps coding agents inside their permitted roles.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,31 +1,39 @@
1
1
  ---
2
2
  name: audit
3
- description: Audit a merged version against the flow in AGENTS.md, from the records alone, and commit the audit record under .agents/audit/. Use after the merge and before the rc; mandatory while audit.required is true.
3
+ description: Audit a version against the flow in AGENTS.md, from the records alone — a first audit of risk before the merge and a second of procedure after the release — and commit the record under .agents/audit/. Mandatory while audit.required is true.
4
4
  ---
5
5
 
6
6
  # audit
7
7
 
8
8
  ## 1. When
9
- After the merge, before the rc. While `audit.required` in `.agents/harness/bindings.yaml` is true, this is mandatory — never skip it.
9
+ Twice in a version. The **first audit** comes after CI passes and before the merge. The **second audit** comes after the stable release (or when the user closes a version that has none), right before the retro. While `audit.required` in `.agents/harness/bindings.yaml` is true, both are mandatory — never skip one.
10
10
 
11
11
  ## 2. Procedure
12
- 1. Before handing the audit over, the PM collects for every PR merged in the version — its number, who merged it and when, the merge commit and head SHA, each CI check and its result, and the gate output in the PR body — as the repository host's CLI prints them, unedited (e.g. `gh pr view <n> --json number,mergedBy,mergedAt,mergeCommit,headRefOid,body`, `gh pr checks <n>`), into files under `.loctx/reports/<version>/`, and passes their paths to the audit. Do not summarise or rewrite them. Then fill in the gate logs: for every commit of the version on the default branch, `.loctx/reports/gates/<tree>.log` (`<tree>` is `git rev-parse <commit>^{tree}`) should hold a run with `worktree: clean` and `exit: 0`. Hooks leave these logs as you commit, but a commit made again by a rebase, on another machine or past the hook has none. For each commit without one, with a clean work tree: `git checkout --detach <commit>`, prepare it as the project needs (install dependencies), run `sh .agents/harness/run-gates.sh audit`, and return to your branch. Do not fix a run that fails; pass it on as it is. If the project has no `run-gates.sh`, say so instead.
13
- 2. Run in a fresh context that gets only the records, never the working conversation (auditor if switched on; in single mode, a new run — another vendor, or the same vendor's top model — chosen by the user).
14
- 3. Read: AGENTS.md and the harness settings as they were, the intent, spec, `docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`, git history, history, gate and test logs, the gate logs per commit (`.loctx/reports/gates/<tree>.log`), the PR and CI records the PM collected (`.loctx/reports/<version>/`). The audit runs without a network; a record it lacks is "cannot confirm" and is asked of the PM.
15
- 4. Judge each step: local roadmap → roadmap → intent → approval → spec → approval → implementation and commits → review → test → merge. Kept, violated, cannot confirm (no evidence path), or skipped on the user's instruction (recorded in `waivers:`). Judge against the rules in force at the time. Commits: each commit is a meaningful unit — a point you can revert or reset to without taking other working work or features with it; several commits for one work unit (implementation, review fixes) are fine, and small units that may be reverted together may share one. A commit that mixes unrelated work, so one part cannot be reverted alone, is a violation. Gates: for each commit, the log of its tree holds a run with `worktree: clean` and `exit: 0` — say whether it was left at commit time (`stage: pre-commit`, `pre-push`) or filled in before the audit (`stage: audit`); no such run is "cannot confirm", and a clean run whose last `exit:` is not 0 is a violation. Changing the spec's work units themselves (adding, dropping, scope, order) without approval is a violation. A generated or harness file changed by a commit that is not an `update`/`config` commit is a violation. In `.claude/settings.json` only reins' deny rules count (listed under `owned:` in `.agents/harness/generated.yaml`); the user's own entries there are not drift.
16
- 5. The audit run is read-only: it returns the record as its answer, in the form of `.agents/harness/templates/audit.md`, criticising each violation precisely and giving a remedy (pl or advisor opinions by severity). The PM keeps that answer as it came under `.loctx/reports/<version>/` and writes it unchanged to `.agents/audit/<version>.md` — never rewording, shortening or dropping a verdict.
17
- 6. The PM reports to the user: fix it, or the user accepts it. Add the user's decision in its own section of the record and commit.
12
+ Both audits run in a fresh context that gets only the records, never the working conversation (auditor if switched on; without one, a new run of your own model, or another one the user chooses). The audit runs without a network; a record it lacks is "cannot confirm" and is asked of the PM. The audit run is read-only: it returns the record as its answer, in the form of `.agents/harness/templates/audit.md`. The PM keeps that answer as it came under `.loctx/reports/<version>/` and writes it unchanged to `.agents/audit/<version>.md` — never rewording, shortening or dropping a verdict. An audit goes through the history, finds what went wrong and says what to put right; it does not check every commit against every sentence of the rules. An audit still catches everything. It reads the `kind: accepted-finding` entries of `.agents/knowledge/`: a finding inside what such an entry accepts is listed as a **known acceptance**, naming the entry's file, and not as a violation; outside it, it is a violation as before.
13
+
14
+ ### First audit — before the merge
15
+ 1. It audits the PR that carries the accepted spec's work units (units added with approval too), on its branch. A PR of records, documents or release documents only, and the PR of a small fix made as an adjustment after the first audit, go without one: say so and why in one line of the PR body. The second audit looks at those merged before it.
16
+ 2. Before handing the audit over, the PM collects the PR and its CI checks as the repository host's CLI prints them, unedited (e.g. `gh pr view <n> --json number,headRefOid,body`, `gh pr checks <n>`), into files under `.loctx/reports/<version>/`, and passes their paths to the audit. Do not summarise or rewrite them. Then fill in the gate logs: for every commit of the branch, `.loctx/reports/gates/<tree>.log` (`<tree>` is `git rev-parse <commit>^{tree}`) should hold a run with `worktree: clean` and `exit: 0`. Hooks leave these logs as you commit, but a commit made again by a rebase, on another machine or past the hook has none. For each commit without one, with a clean work tree: `git checkout --detach <commit>`, prepare it as the project needs (install dependencies), run `sh .agents/harness/run-gates.sh audit`, and return to your branch. Do not fix a run that fails; pass it on as it is. If the project has no `run-gates.sh`, say so instead.
17
+ 3. Read: AGENTS.md and the harness settings as they were, the intent, spec, `docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`, `.agents/knowledge/`, git history, history, gate and test logs, the gate logs per commit (`.loctx/reports/gates/<tree>.log`), the PR and CI records the PM collected (`.loctx/reports/<version>/`).
18
+ 4. Look for **risk**, step by step: local roadmap → roadmap → intent → approval → spec → approval → implementation and commits → review → test → PR and CI. Kept, violated, cannot confirm (no evidence path), or skipped on the user's instruction (recorded in `waivers:`). Judge against the rules in force at the time. What counts as risk: an approval that is missing or was not given by the user; scope beyond the intent and spec; a red line; a work unit that was not reviewed (unless the spec's adjustment record says so and why); a check that failed or cannot be confirmed; a generated or harness file changed by hand. Commits: each commit is a meaningful unit — a point you can revert or reset to without taking other working work or features with it; several commits for one work unit (implementation, review fixes) are fine, and small units that may be reverted together may share one. A commit that mixes unrelated work, so one part cannot be reverted alone, is a violation. Gates: for each commit, the log of its tree holds a run with `worktree: clean` and `exit: 0` — say whether it was left at commit time (`stage: pre-commit`, `pre-push`) or filled in before the audit (`stage: audit`); no such run is "cannot confirm", and a clean run whose last `exit:` is not 0 is a violation. A work unit added, dropped or rescoped without approval is a violation; an adjustment recorded in the spec is kept; an adjustment made without a record is a violation whose remedy is the record. A generated or harness file changed by a commit that is not an `update`/`config` commit is a violation. In `.claude/settings.json` only reins' deny rules count (listed under `owned:` in `.agents/harness/generated.yaml`); the user's own entries there are not drift.
19
+ 5. Criticise each violation precisely and give a remedy (pl or advisor opinions by severity); list each known acceptance apart from the violations. The PM writes the answer under `## 1차 감사` and commits the record on the PR branch, so that it is merged with the work. Push it: that commit moves the PR's head, so wait for CI again.
20
+ 6. The PM reports to the user — this is the one report of the flow (`merge`): fix a violation before the merge, or the user accepts it. Write the user's decision under `### 사용자 처리`, commit and push; a fix goes the same way, and the merge waits until CI is green on the last of these commits. A fix made after the audit is not audited again; only a high-risk violation whose fix is a large change is, and the PM writes there which it was and why.
21
+
22
+ ### Second audit — after the release
23
+ 1. Before handing the audit over, the PM collects for every PR merged in the version — its number, who merged it and when, the merge commit and head SHA, each CI check and its result — as the host's CLI prints them, unedited (e.g. `gh pr view <n> --json number,mergedBy,mergedAt,mergeCommit,headRefOid,body`, `gh pr checks <n>`); the user's words for each merge; the records of the releases (the workflow runs, the tags); the table of branch SHAs and default-branch SHAs, when a merge rewrote the commits; and the gate logs of the commits made after the first audit's head, filled in as above.
24
+ 2. It looks at **procedure only**, from the first audit's head to the version's last commit: whether each merge had the user's instruction and how it was merged; the CI and release records; the release documents; and whether the records are complete — the user's decisions on the first audit, waivers, the spec's adjustment record, the reason line of each PR that went without a first audit.
25
+ 3. It does not tell anyone to fix anything: it lists what is handed to the retro, with each known acceptance apart. The PM writes the answer under `## 2차 감사` and, beneath it, the SHA table under `### SHA 대응`. It has no user-decision section: the retro reads it, and what the user decides there goes under `### 회고에서의 처리`. The record is committed with the retro's commits, in one PR. That closing PR — this record, the retro's changes — is audited by neither audit.
18
26
 
19
27
  ## 3. Delegation
20
28
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. The audit never runs inside the working conversation.
21
29
 
22
30
  ## 4. Files and lifetime
23
- - `.agents/audit/<version>.md` — committed, kept.
31
+ - `.agents/audit/<version>.md` — one file per version with both audits; committed, kept.
24
32
  - `.loctx/reports/<version>/` PR and CI records, and the audit run's answer as it came — deleted after the retro, once summarised in the audit record.
25
- - `.loctx/reports/gates/<tree>.log` — written by the hooks and by step 1; deleted in the retro.
33
+ - `.loctx/reports/gates/<tree>.log` — written by the hooks and by the PM before each audit; deleted in the retro.
26
34
 
27
35
  ## 5. Next
28
- `release`.
36
+ After the first audit: `merge` (the merge itself). After the second: `retro`.
29
37
 
30
38
  ## 6. Stop and ask
31
39
  - A passing audit does not vouch for direction or code quality; say so in the report.
@@ -12,8 +12,8 @@ The spec is accepted and has open work units.
12
12
  1. Work on a feature branch (`type/topic`), never the default branch.
13
13
  2. Take the next open work unit. Implement it so the requirement holds everywhere it applies — never to pass.
14
14
  3. Run the project's gates (`.agents/harness/gates.yaml`; the hooks run them too). Keep the raw output under `.loctx/reports/<version>/`.
15
- 4. Commit at meaningful units: each commit is a point you can revert or reset to without taking other working work or features with it. One work unit may take several commits (implementation, review fixes); small units that may be reverted together may share one; never mix unrelated work in one commit. If the spec's work units themselves must change (added, dropped, rescoped, reordered), stop: change the spec with the reason, get the user's 진행 or 수정 on the summary, then go on.
16
- 5. Commit: `type(scope): title` naming the spec items (S-n, W-n). Tick the work unit in `spec.md` with the commit.
15
+ 4. Commit at meaningful units: each commit is a point you can revert or reset to without taking other working work or features with it. One work unit may take several commits (implementation, review fixes); small units that may be reverted together may share one; never mix unrelated work in one commit. Adding, dropping or rescoping a work unit is a change of the spec: stop, change the spec with the reason, and get the user's 진행 or 수정 on the summary. Anything smaller is an adjustment — another method inside the same unit, a small fix that a review, an audit or the check of an rc asks for, another order of the units, a change with a similar precedent in `.agents/knowledge/` or history: go on, record it in the spec's adjustment record as `- A-n (date, W-n) what · why · commit`, and list the adjustments in the report at the end of the flow. If you cannot tell which it is, stop and ask.
16
+ 5. Commit: `type(scope): title` naming the spec items (S-n, W-n); a commit that makes an adjustment names its `A-n`. Tick the work unit in `spec.md` with the commit.
17
17
  6. When the plan turns out wrong, update the intent or spec in the same commit, or stop and ask.
18
18
 
19
19
  ## 3. Delegation
@@ -28,5 +28,5 @@ Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table
28
28
 
29
29
  ## 6. Stop and ask
30
30
  - Two failures in the same work unit: stop, find the cause (pl or advisor opinions by severity), or bring options to the user.
31
- - A change outside the spec's approved work units (working across approved units that may be reverted together is fine).
32
- - The spec's work units need to change (added, dropped, rescoped, reordered): the spec changes and is approved first.
31
+ - A work unit has to be added, dropped or rescoped: the spec changes and is approved first. A smaller adjustment does not stop the work (2.4); working across approved units that may be reverted together is fine.
32
+ - A user who does not accept an adjustment when it is reported: treat it as a change of the spec — revert it or get it approved.
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: intent
3
- description: Write the intent of one piece of work — the direction and the plan in the user's words — and record the user's approval. Use when a roadmap item is settled and has no approved intent yet.
3
+ description: Write the intent of one piece of work — the direction and the plan in the user's words — and record the user's approval. Use when the user starts work on a settled roadmap item that has no approved intent yet.
4
4
  ---
5
5
 
6
6
  # intent
7
7
 
8
8
  ## 1. When
9
- A settled roadmap item has no approved intent.
9
+ A settled roadmap item has no approved intent, the user started this work, and the previous loop is closed (its retro is done). An intent added to the version in work belongs to the same loop. If the user asks for the next intent before the retro, record a waiver and write it.
10
10
 
11
11
  ## 2. Procedure
12
12
  1. Create `.agents/intent/<NNN>_<slug>/intent.md` from `.agents/harness/templates/intent.md` (next free number).
@@ -25,4 +25,5 @@ Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table
25
25
 
26
26
  ## 6. Stop and ask
27
27
  - Never record an approval the user did not give.
28
+ - The user named a version, answered a question about the plan, or a release is waiting for them: none of these starts an intent. Write the idea to the roadmap and wait for the user to start the work.
28
29
  - The user tells you to skip a step: record it in `waivers:` (`{ step, words, at, scope: once }`) now; it applies once.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: merge
3
- description: Bring the tested branch into the default branch — PR, CI, merge — as the user's settings or instruction allow. Use when the version is tested.
3
+ description: Bring the tested branch into the default branch — push, PR and CI without asking, the first audit, then the merge on the user's instruction. Use when the version is tested.
4
4
  ---
5
5
 
6
6
  # merge
@@ -9,18 +9,24 @@ description: Bring the tested branch into the default branch — PR, CI, merge
9
9
  The version is tested.
10
10
 
11
11
  ## 2. Procedure
12
- 1. Leaving the machine (push, PR) needs the user's instruction or a setting that allows it; otherwise ask.
13
- 2. Push the branch, open the PR (body: the intent, the spec summary, the checks), wait for CI.
14
- 3. Merge only when the required checks pass, the way the repository merges (rebase, squash …). Red CI goes back to `implement`.
12
+ 1. Push the branch and open the PR without asking: for a branch of the work in progress (an accepted spec's work units, their records, release documents) this is part of the flow. Taking anything else out of the machine still needs the user's word.
13
+ 2. The PR body: the intent, the spec summary, the checks. Wait for CI. Red CI goes back to `implement`.
14
+ 3. When CI is green, go on to the first audit (`audit`) without asking; a PR that goes without one says why in a line of its body. After the first audit — its record is committed on the branch and CI is green again — report once: what was done, the adjustments recorded in the spec (`A-n`), the results of the checks and of CI, what the audit found, and the instruction you are waiting for (the merge). Before that point, do not stop to report unless a stop condition applies.
15
+ 4. Every merge needs the user's instruction — the PR of the work, and a PR of records or release documents alike. When the first audit found no violation, or its violations are fixed or accepted, and the user says to merge, merge at once. Merge only when the required checks pass, the way the repository merges (rebase, squash …).
16
+ 5. Which PR: the PM judges which PR the instruction means — the PR it names; without a name, what the PM proposed to merge (one PR or several together) or the PR just spoken of. If you cannot tell, ask. A general "go on" is not a merge instruction. Keep the user's words with the PR's record; the second audit reads them.
17
+ 6. Delete the merged branch, remote and local, in this step.
18
+ 7. When the merge made the commits again (rebase, squash), a record written after the merge names the default branch's SHAs. Do not rewrite the first audit's record: right after the merge, write the table of branch SHAs and default-branch SHAs under `.loctx/reports/<version>/`, hand it to the second audit and commit it under `### SHA 대응` of the audit record. Correct the spec's ticks to the default branch's SHAs in the next record commit.
15
19
 
16
20
  ## 3. Delegation
17
21
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Executor (deployer) does this when switched on, within the same limits.
18
22
 
19
23
  ## 4. Files and lifetime
20
24
  - The PR — on the forge, kept.
25
+ - The work branch — deleted at the merge, remote and local.
26
+ - The SHA table under `.loctx/reports/<version>/` — deleted after the retro; kept in the audit record.
21
27
 
22
28
  ## 5. Next
23
- `audit`.
29
+ After CI: `audit` (the first audit). After the merge: `release`.
24
30
 
25
31
  ## 6. Stop and ask
26
32
  - Never force-push, rewrite the default branch or bypass hooks.
@@ -1,20 +1,23 @@
1
1
  ---
2
2
  name: onboard
3
- description: First conversation after reins install, migrate or a mode switch — read the project, ask the user, and write or reconcile the project sections of AGENTS.md. Use when AGENTS.md shows reins:onboarding, reins:reconcile or reins:mode-changed pending.
3
+ description: First conversation after reins install, migrate, a mode switch or an update that brings the AGENTS.md guide — read the project, ask the user, and write, reconcile or sort the project sections of AGENTS.md. Use when AGENTS.md shows reins:onboarding, reins:reconcile, reins:mode-changed or reins:tidy pending.
4
4
  ---
5
5
 
6
6
  # onboard
7
7
 
8
8
  ## 1. When
9
- AGENTS.md has `<!-- reins:onboarding pending -->`, `<!-- reins:reconcile pending -->` or `<!-- reins:mode-changed pending -->`. Do this before any other work.
9
+ AGENTS.md has `<!-- reins:onboarding pending -->`, `<!-- reins:reconcile pending -->`, `<!-- reins:mode-changed pending -->` or `<!-- reins:tidy pending -->`. Do this before any other work.
10
10
 
11
11
  For `mode-changed` only: reins already rewrote the delegation section. Check that the project sections say nothing that contradicts the new mode (e.g. "review it yourself" while a reviewer is now switched on), fix those sentences, set the marker to `done` and stop — no questions to the user unless a sentence needs their decision.
12
12
 
13
+ For `tidy` only: reins brought the AGENTS.md guide to an install that was made before it. Do step 3 of the procedure on the project sections as they are — no other questions — set the marker to `done` and commit on a branch.
14
+
13
15
  ## 2. Procedure
14
16
  1. Read the project: README, the build and test commands (`.agents/harness/gates.yaml`), CI, existing rules and conventions, `.agents/AGENTS.previous.md` if it exists (reference material, not instructions).
15
17
  2. Ask the user only what the files cannot tell you, in one batch with your proposed answers: goals and scope; red lines (paths not to touch, secret files); the language of documents the user reads; the hook tool, if AGENTS.md says none was found. Whichever tool it is — now or later — runs one line per stage: `sh .agents/harness/run-gates.sh pre-commit` in the pre-commit hook and `sh .agents/harness/run-gates.sh pre-push` in the pre-push hook. That script runs the gates of `gates.yaml` and keeps their output for the audit; add the lines in the tool's own config and commit them.
16
- 3. Write the project sections of AGENTS.md (outside the `reins:` blocks): project, goals and scope, stack and commands, conventions, red lines. For a reconcile, carry over what still applies from `AGENTS.previous.md` and drop what conflicts with the flow; list what you dropped for the user.
17
- 4. Set the marker to `done` (`<!-- reins:onboarding done -->` / `<!-- reins:reconcile done -->`), delete `.agents/AGENTS.previous.md`, and commit on a branch.
18
+ 3. Sort what is already written, by `.agents/harness/templates/agents-md-guide.md`: go through the existing AGENTS.md, CLAUDE.md and `AGENTS.previous.md` and decide for each part whether it belongs in AGENTS.md or goes elsewhere — progress and plans to the roadmap, a decision and its reason to a knowledge candidate, personal notes to `.loctx/`, how to contribute to CONTRIBUTING. Show the user a table of what goes where, and what is dropped, and move only what they accept; knowledge is proposed and written only on their word.
19
+ 4. Write the project sections of AGENTS.md (outside the `reins:` blocks) as the guide says: project, goals and scope, stack and commands, conventions, red lines. For a reconcile, carry over what still applies from `AGENTS.previous.md`; what conflicts with the flow is in the table of step 3 as a proposed drop, and is dropped only when the user accepts that.
20
+ 5. Set the marker to `done` (`<!-- reins:onboarding done -->` / `<!-- reins:reconcile done -->` / `<!-- reins:tidy done -->`), delete `.agents/AGENTS.previous.md` once the user has accepted where each part of it went — until then it stays — and commit on a branch.
18
21
 
19
22
  ## 3. Delegation
20
23
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Onboarding itself stays with the PM.
@@ -15,10 +15,10 @@ If either still starts with `${` (unsubstituted — this copy lives in a project
15
15
  1. **Look.** Is there an `.agents/harness/` (reins installed), an `.ai/` workspace, or an older harness
16
16
  (`.claude/commands/`, many skills)? Say which.
17
17
  2. **Show the user the command** for their terminal, with the version pinned to this skill's release:
18
- - nothing installed: `npx @bluenyang/reins@0.3.1 install --mode <mode>`
19
- - an older harness or `.ai/`: `npx @bluenyang/reins@0.3.1 migrate --dry-run`, then without `--dry-run`
20
- - reins already installed: `npx @bluenyang/reins@0.3.1 update`
21
- - to change models, the mode or the audit later: `npx @bluenyang/reins@0.3.1 config` (the user can run `reins config`)
18
+ - nothing installed: `npx @bluenyang/reins@0.3.2 install --mode <mode>`
19
+ - an older harness or `.ai/`: `npx @bluenyang/reins@0.3.2 migrate --dry-run`, then without `--dry-run`
20
+ - reins already installed: `npx @bluenyang/reins@0.3.2 update`
21
+ - to change models, the mode or the audit later: `npx @bluenyang/reins@0.3.2 config` (the user can run `reins config`)
22
22
  Run it yourself only when the user asks you to, and only that command.
23
23
  3. **Explain what follows.** reins writes AGENTS.md blocks with an onboarding note; the next conversation starts
24
24
  with the `onboard` skill, which reads the project, asks the user, and writes AGENTS.md's project sections.
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  name: release
3
- description: Cut the rc and, on the user's explicit instruction only, the stable release, as the repository's release setup allows. Use when the version is audited.
3
+ description: Cut the rc and, on the user's explicit instruction only, the stable release, as the repository's release setup allows. Use when the version is merged after its first audit.
4
4
  ---
5
5
 
6
6
  # release
7
7
 
8
8
  ## 1. When
9
- The version is audited (or the user accepted its findings).
9
+ The first audit is done (its findings fixed or accepted by the user) and the work is merged.
10
10
 
11
11
  ## 2. Procedure
12
12
  1. Update the release documents (changelog, roadmap state, README status) in the release PR.
13
13
  2. Cut the rc the way the repository releases (its workflow, tags). Never stable without the user's explicit instruction.
14
- 3. After the rc, fixes are stabilisation work units; then the next rc.
14
+ 3. When a release waits for the user — an approval of the published package, the instruction for stable — report and wait. Do not start the work of another unit meanwhile; stabilising this version is this loop's work.
15
+ 4. After the rc, a defect found while checking it is fixed in the same version, then the next rc. A small fix is an adjustment recorded in the spec (`A-n`); one that needs a new work unit changes the spec first and is approved.
15
16
 
16
17
  ## 3. Delegation
17
18
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Executor (deployer) does this when switched on, within the same limits.
@@ -20,7 +21,8 @@ Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table
20
21
  - Tags, release notes — on the forge, kept.
21
22
 
22
23
  ## 5. Next
23
- `retro` (after stable, or when the user declares the version closed).
24
+ `audit` (the second audit — after stable, or when the user declares the version closed), then `retro`.
24
25
 
25
26
  ## 6. Stop and ask
26
27
  - Stable, force-pushing, deleting tags: ask the user every time.
28
+ - A release that waits for the user is not idle time to fill: no intent, spec or code of the next version before this one's retro, unless the user says so (then record a waiver).
@@ -6,15 +6,16 @@ description: Look back on a released version — the audit and the release — p
6
6
  # retro
7
7
 
8
8
  ## 1. When
9
- After stable, or when the user declares a version without stable closed.
9
+ After the second audit — that is, after stable, or when the user declares a version without stable closed.
10
10
 
11
11
  ## 2. Procedure
12
- 1. Read the audit record, the release, and history. Find repeats: the same violation, the same failure, the same question asked twice.
13
- 2. Propose changes to AGENTS.md, skills and the harness, and whether the role groups switched on paid for themselves (pl/retrospector if switched on).
14
- 3. Propose knowledge candidates: decisions and failures repeated (twice or more) in history and the audit. For each one give a title, how often and where it appeared (file paths), and a draft of the decision, the reason and where it applies. First look for an entry that already covers it (`grep -l 'decisions:.*<keyword>' .agents/knowledge/*`); if there is one, propose updating that entry instead of a new one. If nothing repeated, write "knowledge candidates: none" so that an empty list is not mistaken for a skipped step.
12
+ 1. Read the audit record — both audits, and above all what the second audit handed to the retro — the release, and history. Put what the user decides about the handed-over items under `### 회고에서의 처리` of the audit record. Find repeats: the same violation, the same failure, the same question asked twice.
13
+ 2. Propose changes to AGENTS.md, skills and the harness, and whether the role groups switched on paid for themselves (pl/retrospector if switched on). Mark each proposal that is about the harness itself — the flow and stop blocks, a skill, a role — rather than about this project: another project would meet the same problem, so list those apart for the user to take to reins (harness sources are never edited by hand).
14
+ 3. Propose knowledge candidates: decisions and failures repeated (twice or more) in history and the audit. For each one give a title, how often and where it appeared (file paths), and a draft of the decision, the reason and where it applies. First look for an entry that already covers it (`grep -l 'decisions:.*<keyword>' .agents/knowledge/*`); if there is one, propose updating that entry instead of a new one. If nothing repeated, write "knowledge candidates: none" so that an empty list is not mistaken for a skipped step. Count the accepted findings too: the same audit finding accepted three times or more by the user — in the audit records' `사용자 처리` and `회고에서의 처리`, across versions — is proposed as an entry of `kind: accepted-finding`: which finding is accepted, how often and where it was accepted (file paths and the user's words), and where the acceptance ends and a violation begins.
15
15
  4. Apply only what the user accepts: project sections of AGENTS.md and `.agents/knowledge/` entries (`approved: {by, at, words}`) by you; harness sources by the user with `reins config` / `reins update`.
16
16
  5. Write `.loctx/history/<version>.md` from `.agents/harness/templates/history.md`: decisions, verdicts, skipped steps, the audit and retro summary, and a summary of the logs about to be deleted (commits, check commands and results, exceptions).
17
17
  6. Delete `.loctx/reports/<version>/`, and the gate logs in `.loctx/reports/gates/` last written before the version's stable tag was made (logs of later work stay).
18
+ 7. Report that the loop is closed and stop. The retro ends the loop; the next work begins when the user starts it — unless the user named another end for this run (quoted in `.loctx/ROADMAP.local.md`).
18
19
 
19
20
  ## 3. Delegation
20
21
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you.
@@ -26,7 +27,7 @@ Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table
26
27
  - `.loctx/reports/gates/<tree>.log` — those written before the stable tag are deleted here.
27
28
 
28
29
  ## 5. Next
29
- `roadmap`.
30
+ `roadmap` — when the user starts the next work.
30
31
 
31
32
  ## 6. Stop and ask
32
33
  - Never edit harness sources or generated files by hand.
@@ -9,10 +9,11 @@ description: Review finished work units — one reviewer (or a self-review table
9
9
  Work units are done and not reviewed.
10
10
 
11
11
  ## 2. Procedure
12
- 1. Review the diff against the spec: does each S-n hold, with which commit and which evidence (test, log path)? Look for defects, not only for the checklist.
13
- 2. Multi mode: one reviewer (pl/code-reviewer, doc-reviewer …). Single mode: fill the table spec item ↔ commit ↔ evidence path yourself and state that it is not an independent review.
14
- 3. Findings go back to the PM, who sends fixes to `implement`.
15
- 4. A large decision or an unresolved disagreement: pl/discussion (every assigned model, without seeing each other); combine with the originals attached, keeping minority views.
12
+ 1. Every work unit is reviewed, including one that changes tests or documents only. If a unit is not reviewed, record that and why in the spec's adjustment record; a unit left unreviewed without that record is a finding of the first audit.
13
+ 2. Review the diff against the spec: does each S-n hold, with which commit and which evidence (test, log path)? Look for defects, not only for the checklist.
14
+ 3. Multi mode: one reviewer (pl/code-reviewer, doc-reviewer …). Single mode: fill the table spec item ↔ commit ↔ evidence path yourself and state that it is not an independent review.
15
+ 4. Findings go back to the PM, who sends fixes to `implement`. A small fix is an adjustment: it goes on and is recorded in the spec (`A-n`); a finding that needs a work unit added, dropped or rescoped changes the spec first.
16
+ 5. A large decision or an unresolved disagreement: pl/discussion (every assigned model, without seeing each other); combine with the originals attached, keeping minority views.
16
17
 
17
18
  ## 3. Delegation
18
19
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you.
@@ -9,10 +9,10 @@ description: Keep the roadmaps — ideas go to .loctx/ROADMAP.local.md, and only
9
9
  The user brings an idea, a change of plan, or asks what comes next.
10
10
 
11
11
  ## 2. Procedure
12
- 1. Write ideas as they come into `.loctx/ROADMAP.local.md` under the version they may belong to, marked as ideas.
13
- 2. Talk them through with the user until they are settled: what, why, which version, what is out. Ask what only the user can decide.
14
- 3. Only what the user settled goes into `docs/ROADMAP.md` (and its other language edition, if the project keeps one). Never put an unsettled idea there.
15
- 4. Name the version of the next work and hand over to `intent`.
12
+ 1. Write ideas as they come into `.loctx/ROADMAP.local.md` under the version they may belong to, marked as ideas — also while another version is being worked on. An idea is never lost and never starts work by itself.
13
+ 2. Talk them through with the user until they are settled: what, why, which version, what is out. Ask what only the user can decide. A version name alone is not a settlement, and naming a version says where an item belongs — it is not an instruction to start it.
14
+ 3. Only what the user settled goes into `docs/ROADMAP.md` (and its other language edition, if the project keeps one). Never put an unsettled idea there. A settled item may be entered while another version is still in work.
15
+ 4. Name the version of the next work. Hand over to `intent` when the user starts that work and the previous loop is closed (its retro is done).
16
16
 
17
17
  ## 3. Delegation
18
18
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you.
@@ -22,7 +22,7 @@ Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table
22
22
  - `docs/ROADMAP.md` — committed, kept.
23
23
 
24
24
  ## 5. Next
25
- `intent`.
25
+ `intent` — when the user starts the work.
26
26
 
27
27
  ## 6. Stop and ask
28
28
  - The idea changes a past decision or the product boundary.
@@ -13,6 +13,7 @@ The intent is approved and has no accepted spec.
13
13
  2. Review it against the user's own words, the intent and the product boundary (pl/plan-reviewer and pl/qa-plan-reviewer if switched on; else review it yourself and say so).
14
14
  3. Write `summary_for_user` (3–5 lines) and show it. Wait for 진행 or 수정 — every time, no auto-accept.
15
15
  4. On 진행: add `{ role: user, by, at, words, rev, kind: summary }` to `approvals:`, set `status: accepted`, commit.
16
+ 5. After acceptance the spec may still move while the work goes on. A work unit added, dropped or rescoped comes back here: change the spec, show the summary, wait for 진행 or 수정. A smaller adjustment is recorded by `implement` under the spec's adjustment record (`A-n`) without stopping.
16
17
 
17
18
  ## 3. Delegation
18
19
  Check `.loctx/delegation.local.md` if it exists, otherwise the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Planner (spec-writer, qa-designer) does steps 1 when switched on.