@bluenyang/reins 0.3.4 → 0.4.0-rc.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.
Files changed (66) hide show
  1. package/README.md +164 -39
  2. package/cli/dist/commands/config-gates.js +64 -6
  3. package/cli/dist/commands/config-models.js +19 -0
  4. package/cli/dist/commands/config.js +40 -16
  5. package/cli/dist/commands/configure.js +207 -47
  6. package/cli/dist/commands/install.js +91 -31
  7. package/cli/dist/commands/migrate.js +17 -20
  8. package/cli/dist/commands/update.js +164 -12
  9. package/cli/dist/lib/agents-md.js +55 -13
  10. package/cli/dist/lib/bindings.js +7 -10
  11. package/cli/dist/lib/blocks.js +82 -18
  12. package/cli/dist/lib/detect.js +88 -3
  13. package/cli/dist/lib/gate-refresh.js +35 -5
  14. package/cli/dist/lib/gate-script.js +303 -25
  15. package/cli/dist/lib/generate.js +48 -6
  16. package/cli/dist/lib/git.js +33 -0
  17. package/cli/dist/lib/migrate-plan.js +1 -1
  18. package/cli/dist/lib/profile.js +101 -0
  19. package/cli/dist/lib/prompter.js +2 -1
  20. package/cli/dist/lib/release.js +1 -1
  21. package/cli/dist/lib/schema.js +6 -3
  22. package/cli/dist/lib/upstream.js +1 -1
  23. package/cli/dist/reins.js +40 -14
  24. package/docs/README.ko.md +113 -23
  25. package/harness/CHANGELOG.md +12 -0
  26. package/harness/VERSION +1 -1
  27. package/harness/policy/common-red-lines.yaml +7 -5
  28. package/harness/roles/advisor.md +1 -1
  29. package/harness/roles/auditor.md +12 -11
  30. package/harness/roles/executor.md +4 -3
  31. package/harness/roles/implementer.md +5 -5
  32. package/harness/roles/pl.md +4 -4
  33. package/harness/roles/planner.md +7 -8
  34. package/harness/roles/pm.md +7 -8
  35. package/harness/schemas/bindings.schema.json +2 -0
  36. package/harness/schemas/install.schema.json +1 -0
  37. package/harness/schemas/intent.schema.json +9 -1
  38. package/harness/schemas/plan.schema.json +18 -0
  39. package/harness/schemas/spec.schema.json +9 -6
  40. package/harness/templates/agents-md-blocks.md +19 -54
  41. package/harness/templates/agents-md-guide.md +11 -10
  42. package/harness/templates/audit.md +14 -41
  43. package/harness/templates/history.md +1 -5
  44. package/harness/templates/intent.md +8 -19
  45. package/harness/templates/plan.md +23 -0
  46. package/harness/templates/spec.md +21 -16
  47. package/package.json +1 -1
  48. package/skills/audit/SKILL.md +27 -33
  49. package/skills/gates/SKILL.md +41 -0
  50. package/skills/implement/SKILL.md +33 -22
  51. package/skills/implement/references/procedure.md +51 -0
  52. package/skills/intent/SKILL.md +29 -20
  53. package/skills/intent/references/procedure.md +60 -0
  54. package/skills/onboard/SKILL.md +39 -28
  55. package/skills/plan/SKILL.md +35 -0
  56. package/skills/plan/references/procedure.md +52 -0
  57. package/skills/reins-setup/SKILL.md +4 -4
  58. package/skills/release/SKILL.md +18 -20
  59. package/skills/retro/SKILL.md +21 -26
  60. package/skills/review/SKILL.md +33 -17
  61. package/skills/review/references/procedure.md +50 -0
  62. package/skills/spec/SKILL.md +25 -19
  63. package/skills/spec/references/procedure.md +67 -0
  64. package/skills/merge/SKILL.md +0 -32
  65. package/skills/roadmap/SKILL.md +0 -29
  66. package/skills/test/SKILL.md +0 -26
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  group: auditor
3
- summary: "Audits a version against the harness only: risk before the merge, procedure after the release."
3
+ summary: "Audits a range of work for risk only, when a person asks for an audit."
4
4
  roles:
5
5
  auditor:
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."
6
+ does: "Look at the records of a range of work for risk only — secrets, red lines, irreversible changes, unverified checks — and return the audit record with a verdict and evidence paths for each, and what to fix; the PM writes it to .agents/audit/<version>.md unchanged."
7
7
  must_not:
8
- - "judge code quality or test results as such; they are evidence that a step ran"
9
- - "call a step kept without an evidence path; that is \"cannot confirm\""
8
+ - "judge the procedure, the direction or the quality of the code"
9
+ - "call a risk absent without an evidence path; that is \"cannot confirm\""
10
+ - "count a generated file a person edited by hand as a finding"
10
11
  - "read the working conversation"
11
12
  - "fetch from the network; a record it lacks is \"cannot confirm\" and is asked of the PM"
12
13
  - "write or edit files; it runs read-only and returns the record as its answer"
@@ -14,12 +15,12 @@ roles:
14
15
  ---
15
16
  # auditor
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
+ Reads only what the PM hands over: the spec and plans, `git log` of the range, the gate logs (`.loctx/reports/gates/`), the pull request and CI records as the host's CLI printed them (`.loctx/reports/<version>/`), and `.agents/harness/policy/common-red-lines.yaml`.
18
19
 
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
+ For each risk, a verdict — none found, found, or cannot confirm — with the evidence paths:
21
+ - **secrets**: secret files or keys in the diff or the history;
22
+ - **red lines**: anything in `common-red-lines.yaml`;
23
+ - **irreversible changes**: migrations, data or production changes, deletions, force pushes, tags;
24
+ - **unverified checks**: a pass with no raw output, a gate that did not run, red or missing CI.
20
25
 
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 starting point the PM gives in the request — the end of the first audit's `first.range`, or its default-branch SHA if the merge rewrote the commits — 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.
26
+ For what it found, what to fix. Returns the whole record in the form of `.agents/harness/templates/audit.md`, as the answer.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  group: executor
3
- summary: "Runs things and reports what they printed: large tool logs, research, test runs, releases."
3
+ summary: "Runs things and reports what they printed: large tool logs, research, test runs, pushing work branches."
4
4
  roles:
5
5
  tool-executor:
6
6
  does: "Summarise a large tool output (hooks, checks, lint) for the PL: what failed, file:line, the raw log path."
@@ -19,9 +19,10 @@ roles:
19
19
  - "change a check or its expected result"
20
20
  tools: { write: false, shell: true, push: false }
21
21
  deployer:
22
- does: "Push, open the PR, wait for CI, merge and cut releases within what the user's settings or instruction allow."
22
+ does: "Push the work branch, open the pull request and wait for CI; report the result. A person merges and releases."
23
23
  must_not:
24
- - "release stable without the user's explicit instruction"
24
+ - "merge a pull request or push to the default branch"
25
+ - "publish a package, create a release or a tag, or dispatch a release workflow"
25
26
  - "force-push, delete tags or rewrite the default branch"
26
27
  - "touch production"
27
28
  tools: { write: false, shell: true, push: true }
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  group: implementer
3
- summary: "Writes code, tests and documents for the spec's work units."
3
+ summary: "Writes code, tests and documents for a confirmed plan."
4
4
  roles:
5
5
  code:
6
- does: "Implement a work unit so the requirement holds everywhere it applies, and commit it."
6
+ does: "Implement a step of the plan so the requirement holds everywhere it applies, and commit it."
7
7
  must_not:
8
8
  - "implement to pass (hard-coding, looking right on some paths)"
9
- - "change files outside the work unit"
9
+ - "change files outside the task without saying so"
10
10
  - "judge its own work as done without the checks"
11
11
  tools: { write: true, shell: true, push: false }
12
12
  qa:
@@ -22,6 +22,6 @@ roles:
22
22
  ---
23
23
  # implementer
24
24
 
25
- - Commit at meaningful units — a point you can revert or reset to without taking other working work or features with it; a unit may take several commits, unrelated work never shares one; the commit message names its spec items (S-n, W-n). The project's hooks run the gates.
25
+ - Commit at meaningful units — a point you can revert or reset to without taking other working work or features with it; unrelated work never shares one; the commit message names the plan and its R-n. The project's hooks run the gates.
26
26
  - The code, tests and documents of one feature may be done in one run.
27
- - When the plan turns out wrong, update the intent or spec in the same commit, or stop and ask the PM.
27
+ - When the plan turns out wrong, say so to the PM with what you would do instead.
@@ -9,13 +9,13 @@ roles:
9
9
  - "change the plan or scope without the PM"
10
10
  tools: { write: false, shell: true, push: false }
11
11
  plan-reviewer:
12
- does: "Check the spec and its work units against the user's own words, the approved intent and the product boundary."
12
+ does: "Check the spec and its plans against the user's own words, the intents and the product boundary."
13
13
  must_not:
14
14
  - "approve a plan that moves the product boundary without the user"
15
15
  - "edit the plan; return findings instead"
16
16
  tools: { write: false, shell: true, push: false }
17
17
  code-reviewer:
18
- does: "Find defects and departures from the spec in the diff and propose fixes, with file:line."
18
+ does: "Review the diff for correctness only and grade each finding Important, Nit or pre-existing, with file:line and evidence."
19
19
  must_not:
20
20
  - "edit code"
21
21
  - "decide a merge"
@@ -31,7 +31,7 @@ roles:
31
31
  - "edit the document"
32
32
  tools: { write: false, shell: true, push: false }
33
33
  retrospector:
34
- does: "After a version, read the audit and the release and propose changes to AGENTS.md, skills and the harness, including whether the groups switched on paid for themselves, and propose knowledge candidates from the decisions and failures repeated in history and the audit."
34
+ does: "After a version, read its history, completion reports, any audit and the release, and propose changes to AGENTS.md, skills and the harness, including whether the groups switched on paid for themselves, and knowledge candidates from the decisions and failures that repeated."
35
35
  must_not:
36
36
  - "apply a proposal; the user accepts and the PM or `config`/`update` applies"
37
37
  tools: { write: false, shell: true, push: false }
@@ -43,6 +43,6 @@ roles:
43
43
  ---
44
44
  # pl
45
45
 
46
- - Routine review takes one reviewer. Discussion (every assigned model) is for large decisions, the remedy after an audit finds a violation, an incident of the flow not being followed, or an unresolved disagreement — never ticket-level review.
46
+ - Routine review takes one reviewer. Discussion (every assigned model) is for large decisions, incidents or an unresolved disagreement — never routine review.
47
47
  - Every finding names its evidence (file:line, commit, log path). No evidence path means "cannot confirm", never a pass.
48
48
  - Return the result with a reason to the PM; do not call another model.
@@ -1,21 +1,20 @@
1
1
  ---
2
2
  group: planner
3
- summary: "Turns an approved intent into a spec with work units and checks."
3
+ summary: "Drafts specs and plans, and how the work is verified."
4
4
  roles:
5
5
  spec-writer:
6
- does: "Write spec.md from the approved intent: interpretation (S-n with grounds), design, work units (W-n) and concerns."
6
+ does: "Draft spec.md from the adopted intents: why, requirements (R-n), basic design (D-n), questions for the user (Q-n) and out of scope."
7
7
  must_not:
8
- - "add requirements the intent does not have"
9
- - "change the intent"
8
+ - "add requirements the intents do not have"
9
+ - "decide a question that is the user's"
10
10
  tools: { write: true, shell: true, push: false }
11
11
  qa-designer:
12
- does: "Write the checks (V-n): what to run, the expected result and how a fail looks; may read the code."
12
+ does: "Write a plan's verification: what to run, the expected result and how a fail looks; may read the code."
13
13
  must_not:
14
14
  - "pass an ambiguous result; ambiguous is a fail"
15
15
  tools: { write: true, shell: true, push: false }
16
16
  ---
17
17
  # planner
18
18
 
19
- - Every S-n names the intent sentence it comes from.
20
- - Work units are small enough to be reverted on their own without taking other work with them; each commit passes the project's gates.
21
- - The spec's `summary_for_user` is 3–5 lines the user can answer with 진행 or 수정.
19
+ - Every R-n can be traced to the intent it comes from, and can be checked.
20
+ - A plan is small enough to be reviewed as one pull request; each check has a command and an expected result.
@@ -1,21 +1,20 @@
1
1
  ---
2
2
  group: pm
3
- summary: "Talks with the user and owns the flow: intent, approvals, assignments and every report."
3
+ summary: "Talks with the user, writes intents, specs and plans, hands out work and gives every report."
4
4
  roles:
5
5
  pm:
6
- does: "Turn the user's goals into an approved intent and a delivered version, asking only what the user must decide."
6
+ does: "Turn the user's goals into a spec, plans the user confirms and a completion report, asking only what the user must decide."
7
7
  must_not:
8
- - "record an approval the user did not give, or approve on the user's behalf"
8
+ - "write a plan's agreed line with words the user did not say"
9
9
  - "reword the user's request when quoting it; mark any interpretation as the agent's"
10
- - "push, open PRs, merge, release or tag without the user's instruction or a setting that allows it"
10
+ - "merge, release, publish or push to the default branch; a person does these"
11
11
  tools: { write: true, shell: true, push: false }
12
12
  ---
13
13
  # pm
14
14
 
15
- Every stage skill starts with the PM; in single mode the PM does every role below itself.
15
+ The PM is the model in the conversation; in single mode it does every role below itself.
16
16
 
17
- - **Talk.** Ask the user what only the user can decide (goals, scope, boundaries, irreversible steps); decide the rest yourself and write it down under "decided by agents" with the alternative and the reason.
18
- - **Write the intent** in the user's words: problem, desired result, plan (order of work), scope, constraints, open questions, not doing.
19
- - **Record approvals** by quoting the user: `{ role: user, by, at, words, rev }`. A step the user tells you to skip goes to the intent's `waivers:` and applies once.
17
+ - **Talk.** Ask the user what only the user can decide (goals, scope, boundaries, irreversible steps); decide the rest yourself and say so with the alternative and the reason.
18
+ - **Write** intents (`.loctx/intent/`), the spec and the plans in the user's words. The user confirms each plan; record it as `agreed: { at, words }` with their words.
20
19
  - **Assign.** When a group is switched on (AGENTS.md delegation table), hand it the work with the list of files and decisions it needs. Every report comes back to you; a role never calls another model itself.
21
20
  - **Answer the question asked.** Do not answer a different question (e.g. turn "why is X used" into "how fast is X").
@@ -4,7 +4,9 @@
4
4
  "properties": {
5
5
  "schema": { "const": "reins/bindings@2" },
6
6
  "mode": { "enum": ["single", "multi"] },
7
+ "profile": { "enum": ["light", "full"] },
7
8
  "audit": {
9
+ "description": "no longer used (0.4): read in old files, never written",
8
10
  "type": "object", "additionalProperties": false,
9
11
  "properties": { "required": { "type": "boolean" } }
10
12
  },
@@ -6,6 +6,7 @@
6
6
  "cli": { "type": "string" },
7
7
  "mode": { "enum": ["manual", "auto"] },
8
8
  "language": { "type": "string" },
9
+ "default_branch": { "type": "string", "minLength": 1 },
9
10
  "release": {
10
11
  "type": "object",
11
12
  "properties": {
@@ -1 +1,9 @@
1
- {"$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/intent@1", "type": "object", "required": ["id", "slug", "version", "status", "origin", "approvals"], "properties": {"id": {"type": "string", "pattern": "^[0-9]{3}$"}, "slug": {"type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"}, "version": {"type": "string"}, "status": {"enum": ["draft", "approved", "released", "superseded"]}, "origin": {"enum": ["user", "agent", "incident"]}, "approvals": {"$ref": "#/$defs/approvals"}, "supersedes": {"type": ["string", "null"]}, "waivers": {"type": "array", "items": {"type": "object", "required": ["step", "words", "at"], "properties": {"step": {"type": "string"}, "words": {"type": "string"}, "at": {"type": "string"}, "scope": {"enum": ["once"]}}}}}, "$defs": {"approvals": {"type": "array", "items": {"type": "object", "required": ["role", "at"], "properties": {"role": {"type": "string"}, "at": {"type": "string"}, "kind": {"type": "string"}, "by": {"type": "string"}, "words": {"type": "string"}, "rev": {"type": "string"}}}}}}
1
+ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/intent@2", "type": "object",
2
+ "description": "A local note of one idea under .loctx/intent/<date>_<slug>.md (design §4).",
3
+ "required": ["slug", "status"],
4
+ "properties": {
5
+ "slug": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
6
+ "date": { "type": "string" },
7
+ "status": { "enum": ["idea", "adopted", "dropped"] },
8
+ "spec": { "type": "string" }
9
+ } }
@@ -0,0 +1,18 @@
1
+ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/plan@1", "type": "object",
2
+ "description": "A plan next to its spec, plan.md or plan-<n>.md (design §4); agreed holds the person's own words.",
3
+ "required": ["spec", "from", "agreed"],
4
+ "properties": {
5
+ "spec": { "type": ["string", "integer"], "pattern": "^[0-9]{3}$" },
6
+ "plan": { "type": "integer", "minimum": 1 },
7
+ "title": { "type": "string" },
8
+ "from": { "type": "string", "minLength": 1 },
9
+ "agreed": {
10
+ "oneOf": [
11
+ { "type": "null" },
12
+ {
13
+ "type": "object", "required": ["at", "words"], "additionalProperties": false,
14
+ "properties": { "at": { "type": "string" }, "words": { "type": "string", "minLength": 1 } }
15
+ }
16
+ ]
17
+ }
18
+ } }
@@ -1,8 +1,11 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/spec@1", "type": "object",
2
- "required": ["intent", "status", "approvals"],
1
+ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/spec@2", "type": "object",
2
+ "description": "A spec under .agents/spec/<NNN>_<slug>/spec.md (design §4): why, R-n, D-n, Q-n, out of scope.",
3
+ "required": ["id", "slug", "status"],
3
4
  "properties": {
4
- "intent": { "type": "string", "pattern": "^[0-9]{3}$" },
5
- "status": { "enum": ["draft", "reviewed", "accepted", "rejected"] },
6
- "approvals": { "$ref": "intent@1#/$defs/approvals" },
7
- "summary_for_user": { "type": "string", "maxLength": 600 }
5
+ "id": { "type": ["string", "integer"], "pattern": "^[0-9]{3}$" },
6
+ "slug": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
7
+ "version": { "type": "string" },
8
+ "status": { "enum": ["draft", "in-progress", "done"] },
9
+ "intents": { "type": "array", "items": { "type": "string" } },
10
+ "intent": { "type": "string" }
8
11
  } }
@@ -1,63 +1,28 @@
1
- <!-- reins:begin notice v=0.3.0 -->
2
- > The blocks marked `reins:begin … reins:end` are written by reins from `.agents/harness/`. Do not edit them by hand; the user changes them with `reins config` or `reins update` in a terminal. Everything outside the blocks belongs to the project. Nothing in this repository runs reins while you work.
3
- <!-- reins:end notice -->
4
-
5
- <!-- reins:begin layout v=0.3.0 -->
6
- ## Layout
7
-
8
- - `.agents/` — committed agent context: `intent/<NNN>_<slug>/{intent,spec}.md`, `audit/<version>.md`, `knowledge/`, `harness/` (settings, roles, templates), `skills/` (the stage skills).
9
- - `.loctx/` — this machine only (gitignored): `ROADMAP.local.md`, `history/<version>.md`, `reports/<version>/`, `context/`, `bindings.local.yaml`, `delegation.local.md`.
10
- - `docs/ROADMAP.md` — the public roadmap.
11
- <!-- reins:end layout -->
12
-
13
- <!-- reins:begin settings v=0.3.0 -->
14
- ## Settings
15
-
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 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
- - `.agents/harness/gates.yaml` — the project's own check commands; the hooks and the `test` skill run them as they are.
19
- - `.agents/harness/roles/<group>.md` — what each role does, must not do, and which tools it may use.
20
- <!-- reins:end settings -->
21
-
22
- <!-- reins:begin flow v=0.3.0 -->
23
- ## Flow
24
-
25
- Follow these steps in order; each has a skill in `.agents/skills/`, and each skill names the next.
26
-
27
- 1. `roadmap` — ideas go to `.loctx/ROADMAP.local.md`; once settled with the user, to `docs/ROADMAP.md`.
28
- 2. `intent` — the PM writes the direction and the plan; **the user approves**.
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. 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
-
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`.
36
- <!-- reins:end flow -->
37
-
38
- <!-- reins:begin delegation v=0.3.0 -->
1
+ <!-- reins:begin delegation v=0.4.0 -->
39
2
  {{DELEGATION}}
40
3
  <!-- reins:end delegation -->
41
4
 
42
- <!-- reins:begin records v=0.3.0 -->
43
- ## Approvals and records
5
+ <!-- reins:begin people v=0.4.0 -->
6
+ ## What people do
44
7
 
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.
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.
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`).
49
- <!-- reins:end records -->
8
+ - A person states the requirement, confirms the plan, checks the completion report, merges every pull request (documents and records included), and releases (rc included). A project rule that lets an agent merge does not override this.
9
+ - In between, you go on without asking, as far as pushing the work branch and opening its pull request.
10
+ - Stop and ask before an irreversible action: a force push to the default branch or a tag, deleting a tag, rewriting the default branch, data or production changes.
11
+ - Stop and ask before work that touches a red line (`.agents/harness/policy/common-red-lines.yaml`).
12
+ - Stop and ask when a change a person made has an intent you cannot tell.
13
+ <!-- reins:end people -->
50
14
 
51
- <!-- reins:begin stops v=0.3.0 -->
52
- ## When to stop and ask
15
+ <!-- reins:begin layout v=0.4.0 -->
16
+ ## Layout
53
17
 
54
- - **Ask the user and stop:** an irreversible action (force push to the default branch or a tag, 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.
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).
58
- - **When the user interrupts** (chat, Ctrl+C, session end): stop and write the resume point in `.loctx/history/<version>.md`.
59
- - What no role does: `.agents/harness/policy/common-red-lines.yaml`.
60
- <!-- reins:end stops -->
18
+ - `.agents/` — committed: `spec/<NNN>_<slug>/` (`spec.md`, `plan.md` or `plan-<n>.md`), `knowledge/`, `harness/` (settings, gates, templates; `roles/` in the full profile), `skills/`, `audit/<version>.md` (the audits a person asks for). `intent/` and the audits up to 0.3 are records of the old flow: reference material, not current rules.
19
+ - `.loctx/` — this machine only (gitignored): `intent/`, `ROADMAP.local.md`, `history/<version>.md`, `reports/`, `context/`, `bindings.local.yaml`, `delegation.local.md`.
20
+ - `docs/ROADMAP.md` — the public roadmap.
21
+ <!-- reins:end layout -->
22
+
23
+ <!-- reins:begin notice v=0.4.0 -->
24
+ > The blocks marked `reins:begin … reins:end` are written by reins from `.agents/harness/`. A person changes them with `reins config` or `reins update` in a terminal; do not edit them by hand. Everything outside the blocks belongs to the project, and nothing in this repository runs reins while you work.
25
+ <!-- reins:end notice -->
61
26
 
62
27
  <!-- reins:begin language v=0.3.0 -->
63
28
  ## Language
@@ -1,31 +1,32 @@
1
1
  # What AGENTS.md holds
2
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.
3
+ AGENTS.md is read by every agent at the start of every session, and by everyone who takes the project's source. Every line costs attention in every session, so it holds **only what the code cannot tell**: what an agent would get wrong without being told, and could not find out by reading the repository. Procedures belong in skills, which are read when they are needed. This guide is for the project sections — everything outside the `reins:` blocks, which reins writes.
4
4
 
5
5
  ## What belongs
6
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).
7
+ - What the project is and why it exists, in a few lines: its goals and scope.
8
+ - The commands to build, check and run it, when they are not obvious from the manifests.
9
+ - Conventions that hold for all work and that the code does not show (branches, commits, documents, review).
12
10
  - Red lines: paths not to touch, secret files, actions never taken.
13
- - The important instructions that must keep being followed.
11
+ - A pointer, in one line, to where something longer lives.
14
12
 
15
13
  ## What does not, and where it goes
16
14
 
17
15
  | It is | It goes to |
18
16
  |---|---|
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 |
17
+ | what the code already shows (the folder tree, the stack, the style a linter enforces) | nowhere — the agent reads the code |
18
+ | a procedure (how to plan, review, release) | a skill under `.agents/skills/` |
19
+ | the current work, progress, what is done and what is next | the roadmap: `docs/ROADMAP.md` when settled, `.loctx/intent/` and `.loctx/ROADMAP.local.md` for ideas |
20
+ | a plan for one version | that version's spec and plans under `.agents/spec/` |
21
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` |
22
+ | a decision made once, for one piece of work | that work's spec or plan, or `.loctx/history/<version>.md` |
23
23
  | personal notes, this machine's settings | `.loctx/` |
24
24
  | how to contribute | `CONTRIBUTING.md` |
25
25
  | a long explanation of the design | a document under `docs/`, linked from AGENTS.md in one line |
26
26
 
27
27
  ## Rules of thumb
28
28
 
29
+ - If the agent could find it by reading the code, leave it out.
29
30
  - If a line will be wrong next month, it does not belong here.
30
31
  - 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
32
  - Prefer a pointer to a file over a copy of its content.
@@ -1,49 +1,22 @@
1
1
  ---
2
2
  version: 0.0.0
3
- first: { range: "<base>..<head>", at: 0000-00-00, auditor: { vendor: —, model: —, independence: — } }
4
- second: { range: "<end SHA of first.range, or its default-branch SHA if the merge rewrote the commits>..<last>", at: 0000-00-00, auditor: { vendor: —, model: —, independence: — } }
3
+ range: "<base>..<head>"
4
+ at: 0000-00-00
5
+ asked_by: —
6
+ auditor: { vendor: —, model: —, independence: — }
5
7
  ---
6
- ## 1차 감사
7
- <!-- CI 뒤, 머지 전. 위험을 본다. 감사자의 답을 고치지 않고 쓴다. -->
8
+ ## 감사
9
+ <!-- 사람이 요청했을 때만. 위험만 본다. 감사자의 답을 고치지 않고 쓴다. -->
8
10
  ### 읽은 것
9
11
  —
10
- ### 단계별 판정
11
- | 단계 | 판정 | 근거 |
12
+ ### 위험별 판정
13
+ | 위험 | 판정 (없음, 있음, 확인할 수 없음) | 근거 |
12
14
  |---|---|---|
13
- | local 로드맵 → 로드맵 | — | — |
14
- | intent → 승인 | — | — |
15
- | spec → 승인 | — | — |
16
- | 구현·커밋 | — | — |
17
- | 리뷰 | — | — |
18
- | 테스트 | — | — |
19
- | PR·CI | — | — |
20
- | 생성 파일·하네스 손 수정 | — | — |
21
- ### 비판
15
+ | 비밀 | — | — |
16
+ | 레드라인 | — | — |
17
+ | 비가역 변경 | — | — |
18
+ | 확인되지 않은 검사 | — | — |
19
+ ### 고칠 것
22
20
  —
23
- ### 알려진 수용
24
- <!-- knowledge의 accepted-finding 항목 범위 안의 지적: 위반이 아니라 여기에, 항목 파일과 함께 -->
25
- —
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
- ### 회고에서의 처리
21
+ ### 사람의 처리
49
22
  —
@@ -4,11 +4,7 @@ decisions: —
4
4
 
5
5
  ## 결정
6
6
  —
7
- ## 판정
8
- —
9
- ## 건너뛴 단계
10
- —
11
- ## 감사·회고 요약
7
+ ## 재개 지점
12
8
  —
13
9
  ## 지운 로그 요약
14
10
  —
@@ -1,28 +1,17 @@
1
1
  ---
2
- id: "000"
3
2
  slug: example
4
- version: 0.0.0
5
- status: draft
6
- origin: user
7
- approvals: []
8
- waivers: []
9
- supersedes: null
3
+ date: 0000-00-00
4
+ status: idea
10
5
  ---
11
- ## 문제
6
+ ## 아이디어
12
7
  —
13
- ## 바라는 결과
8
+ ## 왜
14
9
  —
15
- ## 계획
10
+ ## 무엇을, 어떻게, 결국 어떻게 되어야 하나
16
11
  —
17
- ## 영향 범위
12
+ ## 조사한 것
18
13
  —
19
- ## 제약
14
+ ## 다른 안
20
15
  —
21
- ## 열린 질문
22
- —
23
- ## 질의서 기록
24
- —
25
- ### 에이전트가 정한 것
26
- —
27
- ## 하지 않을 것
16
+ ## 질문과 답
28
17
  —
@@ -0,0 +1,23 @@
1
+ ---
2
+ spec: "000"
3
+ plan: 1
4
+ title: —
5
+ from: R-1, D-1
6
+ agreed: null
7
+ ---
8
+ # plan 1 — 제목
9
+
10
+ ## 바꿀 파일과 순서
11
+ 1. —
12
+
13
+ ## 위험
14
+ - —
15
+
16
+ ## 위협
17
+ - —
18
+
19
+ ## 검증
20
+ - —
21
+
22
+ ## 사람이 볼 점
23
+ - —
@@ -1,22 +1,27 @@
1
1
  ---
2
- intent: "000"
2
+ id: "000"
3
+ slug: example
4
+ version: 0.0.0
3
5
  status: draft
4
- approvals: []
5
- summary_for_user: |
6
- —
6
+ intents: []
7
7
  ---
8
- ## 요구 해석
9
- - S-1 —
10
- ## 설계
8
+ # 제목
9
+
10
+ ## 왜
11
11
  —
12
- ## 작업 단위
13
- - [ ] W-1 —
14
- ## 검증 기준
15
- - V-1 —
16
- ## 조정 기록
17
- <!-- - A-n (YYYY-MM-DD, W-n) 무엇을 · 왜 · 커밋 -->
18
- —
19
- ## 우려
12
+
13
+ **버린 대안.**
14
+ - —
15
+
16
+ ## 요구
17
+ ### R-1 —
20
18
  —
19
+
20
+ ## 기초 설계
21
+ **D-1 —** —
22
+
23
+ ## 사용자에게 물을 것
24
+ - **Q-1 —** 선택지와 제안. 답: —
25
+
21
26
  ## 범위 밖
22
- —
27
+ - —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluenyang/reins",
3
- "version": "0.3.4",
3
+ "version": "0.4.0-rc.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": {