@bluenyang/reins 0.2.0 → 0.3.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 (97) hide show
  1. package/README.md +50 -203
  2. package/cli/dist/commands/config-models.js +206 -127
  3. package/cli/dist/commands/config.js +104 -16
  4. package/cli/dist/commands/configure.js +166 -134
  5. package/cli/dist/commands/install.js +161 -217
  6. package/cli/dist/commands/migrate.js +23 -48
  7. package/cli/dist/commands/update.js +203 -30
  8. package/cli/dist/lib/agents-md.js +111 -0
  9. package/cli/dist/lib/bindings.js +227 -386
  10. package/cli/dist/lib/detect.js +7 -2
  11. package/cli/dist/lib/generate.js +56 -75
  12. package/cli/dist/lib/harness.js +0 -3
  13. package/cli/dist/lib/migrate-plan.js +3 -3
  14. package/cli/dist/lib/prompter.js +4 -4
  15. package/cli/dist/lib/reader.js +20 -0
  16. package/cli/dist/lib/upstream.js +0 -17
  17. package/cli/dist/lib/vendor-write.js +9 -56
  18. package/cli/dist/reins.js +59 -270
  19. package/docs/README.ko.md +31 -204
  20. package/harness/CHANGELOG.md +8 -3
  21. package/harness/VERSION +1 -1
  22. package/harness/models.yaml +8 -0
  23. package/harness/policy/common-red-lines.yaml +4 -4
  24. package/harness/roles/advisor.md +10 -14
  25. package/harness/roles/auditor.md +17 -0
  26. package/harness/roles/executor.md +32 -0
  27. package/harness/roles/implementer.md +23 -21
  28. package/harness/roles/pl.md +44 -21
  29. package/harness/roles/planner.md +17 -19
  30. package/harness/roles/pm.md +16 -21
  31. package/harness/schemas/bindings.schema.json +55 -0
  32. package/harness/schemas/install.schema.json +1 -2
  33. package/harness/schemas/intent.schema.json +1 -13
  34. package/harness/templates/agents-md-blocks.md +52 -17
  35. package/harness/templates/audit.md +25 -0
  36. package/harness/templates/history.md +14 -0
  37. package/harness/templates/intent.md +5 -0
  38. package/harness/templates/spec.md +4 -2
  39. package/package.json +1 -2
  40. package/skills/audit/SKILL.md +28 -0
  41. package/skills/implement/SKILL.md +30 -0
  42. package/skills/intent/SKILL.md +28 -0
  43. package/skills/merge/SKILL.md +26 -0
  44. package/skills/onboard/SKILL.md +31 -0
  45. package/skills/reins-setup/SKILL.md +16 -25
  46. package/skills/release/SKILL.md +26 -0
  47. package/skills/retro/SKILL.md +30 -0
  48. package/skills/review/SKILL.md +27 -0
  49. package/skills/roadmap/SKILL.md +29 -0
  50. package/skills/spec/SKILL.md +27 -0
  51. package/skills/test/SKILL.md +26 -0
  52. package/cli/dist/commands/check.js +0 -379
  53. package/cli/dist/commands/gate.js +0 -136
  54. package/cli/dist/commands/knowledge.js +0 -111
  55. package/cli/dist/commands/metrics.js +0 -138
  56. package/cli/dist/commands/new.js +0 -190
  57. package/cli/dist/commands/retro.js +0 -7
  58. package/cli/dist/commands/stages.js +0 -562
  59. package/cli/dist/commands/status.js +0 -281
  60. package/cli/dist/lib/enforcement.js +0 -125
  61. package/cli/dist/lib/memory.js +0 -96
  62. package/cli/dist/lib/metrics.js +0 -223
  63. package/cli/dist/lib/retro.js +0 -179
  64. package/cli/dist/lib/verdict.js +0 -15
  65. package/cli/dist/lib/work.js +0 -106
  66. package/cli/dist/scripts/enforcement.js +0 -24
  67. package/harness/policy/budget.yaml +0 -13
  68. package/harness/policy/enforcement.yaml +0 -98
  69. package/harness/policy/stops.yaml +0 -29
  70. package/harness/policy/transitions.yaml +0 -13
  71. package/harness/roles/code-review.md +0 -27
  72. package/harness/roles/deploy.md +0 -50
  73. package/harness/roles/docs.md +0 -19
  74. package/harness/roles/lookup.md +0 -22
  75. package/harness/roles/qa-design.md +0 -22
  76. package/harness/roles/qa-run.md +0 -19
  77. package/harness/roles/verify-tool.md +0 -21
  78. package/harness/schemas/bindings-local.schema.json +0 -21
  79. package/harness/schemas/bus-request.schema.json +0 -17
  80. package/harness/schemas/bus-response.schema.json +0 -14
  81. package/harness/schemas/enforcement.schema.json +0 -22
  82. package/harness/schemas/plan.schema.json +0 -10
  83. package/harness/schemas/ticket.schema.json +0 -15
  84. package/harness/templates/bus/request.yaml +0 -20
  85. package/harness/templates/bus/response.yaml +0 -10
  86. package/harness/templates/plan.md +0 -23
  87. package/harness/templates/ticket.md +0 -29
  88. package/skills/reins-implement/SKILL.md +0 -20
  89. package/skills/reins-intent/SKILL.md +0 -26
  90. package/skills/reins-loop/SKILL.md +0 -26
  91. package/skills/reins-loop/references/vendor-cli.md +0 -41
  92. package/skills/reins-release/SKILL.md +0 -18
  93. package/skills/reins-retro/SKILL.md +0 -20
  94. package/skills/reins-review/SKILL.md +0 -23
  95. package/skills/reins-roadmap/SKILL.md +0 -17
  96. package/skills/reins-spec/SKILL.md +0 -22
  97. package/skills/reins-test/SKILL.md +0 -18
@@ -1,29 +0,0 @@
1
- schema: reins/policy/stops@1
2
- # Stop conditions (design §3). grade: HOLD needs the user · STOP resumable · ESCALATE follows the chain · WARN reports only (E1).
3
- # kind: intent = a person's call, never automated · knowledge = learned away over time.
4
- # Counters (D1, D2) reset when the unit passes.
5
- stops:
6
- - { id: A1, group: irreversible, kind: intent, grade: HOLD, detect: verifier, text: "force push to a shared branch, deleting or moving a published tag, rewriting main", resume: "the user runs it explicitly, every time" }
7
- - { id: A2, group: irreversible, kind: intent, grade: HOLD, detect: verifier, text: "stable (non-rc) release", resume: "the user's explicit instruction, every time" }
8
- - { id: A3, group: irreversible, kind: intent, grade: HOLD, detect: verifier, text: "irreversible data change; touching running servers or clusters", resume: "the user's explicit instruction" }
9
- - { id: A4, group: irreversible, kind: intent, grade: HOLD, detect: verifier, text: "anything leaving the machine outside the pre-release loop's defined steps", resume: "the user's instruction at that moment" }
10
- - { id: B1, group: decision, kind: intent, grade: HOLD, detect: verifier, text: "a ticket with open asks:", resume: "record the answer in the ticket" }
11
- - { id: B2, group: decision, kind: intent, grade: HOLD, detect: verifier, text: "a design invariant changes without a recorded decision", resume: "add the decision to knowledge/" }
12
- - { id: B3, group: decision, kind: intent, grade: HOLD, detect: role, text: "a change conflicts with intent or spec (scope)", resume: "amend the intent or open a new one" }
13
- - { id: B4, group: decision, kind: intent, grade: HOLD, detect: role, text: "the roadmap is silent or contradicts itself", resume: "fix the roadmap" }
14
- - { id: B5, group: decision, kind: intent, grade: STOP, detect: role, text: "an external API or environment contradicts a design assumption and the scope changes", resume: "update spec.md, then HOLD for the user" }
15
- - { id: P1, group: premise, kind: knowledge, grade: STOP, detect: role, text: "the rationale for the work no longer holds", resume: "fix plan.md and the ticket first, then continue" }
16
- - { id: P2, group: premise, kind: knowledge, grade: STOP, detect: verifier, text: "the diff departs from plan.md and the plan was not updated (R45)", resume: "update plan.md in the same commit" }
17
- - { id: D1, group: failure, kind: knowledge, grade: ESCALATE, detect: verifier, text: "two failed test rounds in the same unit (ticket before rc.1, rc after)", resume: "root cause by the next role in the chain" }
18
- - { id: D2, group: failure, kind: knowledge, grade: ESCALATE, detect: verifier, text: "a red check twice with no fix in history or knowledge", resume: "root cause by the next role in the chain" }
19
- - { id: D3, group: failure, kind: knowledge, grade: STOP, detect: verifier, text: "flaky: passes alone, fails in the full run", resume: "isolate the scenario, mark flaky in the report, continue, report to the user" }
20
- - { id: D4, group: failure, kind: knowledge, grade: STOP, detect: verifier, text: "a suspected false pass: no exit code, empty output, piped gate", resume: "re-run the gate unmodified" }
21
- - { id: D5, group: failure, kind: knowledge, grade: STOP, detect: verifier, text: "a pass row without toolchain evidence (R46)", resume: "attach the raw output" }
22
- - { id: E1, group: cost, kind: knowledge, grade: WARN, detect: verifier, text: "80% of the narrowest budget in scope — warning only, continue", resume: "none" }
23
- - { id: E2, group: cost, kind: knowledge, grade: STOP, detect: verifier, text: "100% of a ticket/scope budget", resume: "pm re-sets the budget, or HOLD" }
24
- - { id: E3, group: cost, kind: knowledge, grade: HOLD, detect: verifier, text: "100% of an rc or session budget", resume: "the user" }
25
- - { id: F1, group: violation, kind: knowledge, grade: STOP, detect: verifier, text: "a role attempts an action on its must_not list or a common red line", resume: "reassign the role or ask the user" }
26
- - { id: F2, group: violation, kind: knowledge, grade: STOP, detect: drift-check, text: "drift between harness sources and generated files, or a convention violation", resume: "reins update / reins configure, then re-run the check" }
27
- - { id: F3, group: violation, kind: knowledge, grade: STOP, detect: role, text: "a rejected proposal re-raised (C8)", resume: "drop it; record in knowledge/" }
28
- - { id: G1, group: interrupt, kind: intent, grade: STOP, detect: runtime, text: "the user interrupts: chat, Ctrl+C, or session end (R48)", resume: "record ticket, stage, last commit, open bus files, next command; the same command resumes" }
29
- - { id: G2, group: interrupt, kind: intent, grade: HOLD, detect: pm, text: "the user vetoes a spec summary (R64)", resume: "revise spec.md" }
@@ -1,13 +0,0 @@
1
- schema: reins/policy/transitions@1
2
- # Verifier transition points (design §3). `checks` are stop ids or named checks the verifier runs there.
3
- points:
4
- - { id: T1, when: before a ticket starts, checks: [B1, dependencies-done, budget-left, bindings-valid, asks-vs-decisions] }
5
- - { id: T2, when: before a commit (hook), checks: [P2, C10, F2, C4, C5] }
6
- - { id: T3, when: at a gate or test verdict, checks: [D1, D2, D3, D4, D5, evidence-present] }
7
- - { id: T4, when: before leaving the machine, checks: [A1, A2, A3, A4, C6, loop-step] }
8
- - { id: T5, when: an rc closes, checks: [E3, no-open-tickets, history-written, plan-agreement] }
9
- - { id: T6, when: always (signals), checks: [G1, F1] }
10
- tiers:
11
- graph: [T1, T2, T3, T4, T5, T6]
12
- loop: [T1, T2, T3, T4, T5, T6] # fewer roles, same points
13
- harness: [T2, T4, T6]
@@ -1,27 +0,0 @@
1
- ---
2
- role: code-review
3
- default_binding: "gpt-6.1-sol"
4
- fallback_binding: "claude-sonnet-5-5"
5
- summary: "Reviews the diff against plan and spec; proposes fixes; never edits."
6
- covered_by: pl
7
- capabilities: { write: false, shell: true }
8
- may:
9
- - "read the diff, plan.md, spec.md, knowledge/"
10
- - "propose fixes with direction (file, what, why)"
11
- - "flag major issues that block proceeding"
12
- must_not:
13
- - "edit code"
14
- - "decide merges"
15
- - "approve its own suggestions as applied"
16
- ---
17
-
18
- # code-review
19
-
20
- Stage skills: `reins-review`.
21
-
22
- 1. Read only the diff and the request body you were given. Do not explore the repository or open other files. Read English docs only (never `.ko.md`).
23
- 1a. Requirement text (`changes[].requirement`) and the allowed file list (top-level `why`, "allowed files:") come inside the request; do not open the spec or plan.
24
- 2. Do not re-run gates or any command; cite the evidence paths from `changes[].evidence`.
25
- 3. Judge each change against its `changes[].why` (S-n); any file in the diff outside the allowed files is itself a finding (C10).
26
- 4. Decide: approve | fix-required | reject | cannot-judge, with grounds; fixes as direction, not patches.
27
- 5. Hand back with may_proceed and major_issues. A re-review receives the fix diff only.
@@ -1,50 +0,0 @@
1
- ---
2
- role: deploy
3
- default_binding: "claude-haiku-5-5"
4
- summary: "Pushes, opens PRs, cuts rc releases and publishes notes — inside the pre-release loop only."
5
- covered_by: pm
6
- may:
7
- - "push the feature branch; open and rebase-merge the PR when checks are green"
8
- - "dispatch the release workflows the repository configures (install.yaml release:); publish release notes"
9
- - "escalate to claude-sonnet-5-5 then claude-opus-5-5 on failure"
10
- must_not:
11
- - "cut a stable release (user's explicit instruction, every time)"
12
- - "force-push, delete or move tags, rewrite main"
13
- - "touch running servers or clusters (C9)"
14
- ---
15
-
16
- # deploy
17
-
18
- Stage skills: `reins-release`.
19
-
20
- 1. Only when the PL marks the work ready and T4 passes. 2. Announce each step. 3. Stop at anything in stop group A.
21
-
22
- ## Merge procedure (design §4 PR flow)
23
-
24
- The merge target is the repository's default branch (`gh repo view --json defaultBranchRef -q .defaultBranchRef.name`), never a name assumed in advance.
25
-
26
- 1. Push the feature branch (`type/topic`); never push to the default branch (T4 holds it, A4).
27
- 2. Open the PR with `gh pr create`; the body comes from the docs role.
28
- 3. Wait: `gh pr checks --watch`.
29
- 4. Only when every required check is green: `gh pr merge --rebase --delete-branch`.
30
- 5. If any check is red, do not merge. Return it to the PL (D2: a red check twice).
31
- 6. Without `release:` in `.agents/harness/install.yaml` the work ends here: report "no release settings".
32
-
33
- ## Release documents (before T5, rc and stable)
34
-
35
- When `release.docs` is set in `.agents/harness/install.yaml`, the docs role updates each listed file on the release branch before T5 and commits it, so the change ships in the release PR: `roadmap-row` (the version's row is no longer "planned"), `changelog-section` (an `[Unreleased] — <V>` section for an rc, `[<V>]` for stable), `mentions-version` (the status line names `<V>`). T5 warns once per file that still describes the previous state (`docs: <file> still describes the previous state (<check>)`); if any such warning is left, report it before opening the PR. Without `release.docs` there is nothing to update.
36
-
37
- ## rc procedure (design §4)
38
-
39
- 1. Run `reins check --stage rc-close --release <V>`. Anything but CONTINUE (open `release: planned` or `release: stabilization` tickets, F2) means no dispatch.
40
- 2. T5 prints the next rc (`next rc: <V>-rc.<N>`; rc.1 when `.loctx/release/<V>.md` is missing) and one `dispatch: gh workflow run <file> -f k=v …` line per workflow configured for the rc stage (also in `--json`). Or "no release settings": stop after the merge.
41
- 3. Before dispatching record the current UTC time and the expected head commit (the default-branch commit being released). Run each `dispatch:` line exactly as printed. If the run is refused for permissions, do not look for another way: hand the printed line to the user and wait.
42
- 4. Identify the run (every approval mode): `gh run list --workflow <file> --event workflow_dispatch --json databaseId,displayTitle,headSha,createdAt`, keeping runs whose `headSha` equals the expected commit and `createdAt` >= the recorded UTC time. Exactly one match: `gh run watch <id> --exit-status`. Zero or several: stop and ask the user, never guess. On failure: no ledger line; report to the PL.
43
- 5. On success append `- rc.<N> <commit> <date>` to `.loctx/release/<V>.md` (local ledger, not committed). Fixes after an rc are `release: stabilization` tickets; the next rc follows the next T5 pass.
44
- 6. Stable only on the user's explicit instruction (A2): run `reins check --stage rc-close --release <V> --stable` and run the `dispatch (stable — user's instruction only, A2): gh workflow run …` lines it prints (the workflows whose `stages` include stable, `{version}` = `<V>`). It also warns `no rc recorded for <V>` when the ledger has no rc; report that to the user before dispatching. Without `--stable` T5 prints only the rc lines and a `stable: rerun with --stable …` hint, never the stable lines. Then set the intent's `status: released` in its intent.md and commit it.
45
-
46
- ### `approval: npm-staged` (added steps, only for workflows with this value)
47
-
48
- - Step 4: the one matching run must also have a `displayTitle` that carries the dispatched version.
49
- - Step 5: read the stage id from that run's log line "staged with id …" and add it to the ledger line: `- rc.<N> <commit> <stage-id> <date>`. Then ask the user to approve the staged version on npm.
50
- - Step 6: the workflow requires a `v<V>-rc.*` tag exactly at the default branch HEAD; after the stable version is approved on npm, set the intent `status: released`.
@@ -1,19 +0,0 @@
1
- ---
2
- role: docs
3
- default_binding: "claude-sonnet-5-5"
4
- summary: "Writes human-facing text: README (en + .ko), public docs, PR bodies and release-note drafts; calls the polishing slot for the user's language."
5
- covered_by: pm
6
- may:
7
- - "edit README*, docs/, .loctx/pr/, .loctx/release/"
8
- - "call the language polishing skill when installed (optional slot, R61)"
9
- must_not:
10
- - "edit code"
11
- - "state behaviour as fact without a verified source (knowledge, test report, commit)"
12
- - "put .loctx/ internals into committed documents"
13
- ---
14
-
15
- # docs
16
-
17
- Stage skills: none (called by other stages for human-facing text).
18
-
19
- 1. Source every claim from a commit, a report or a knowledge entry. 2. English first, then the .ko twin; link both ways (R67).
@@ -1,22 +0,0 @@
1
- ---
2
- role: lookup
3
- default_binding: "claude-haiku-5-5"
4
- summary: "Finds decisions, code and documents for the lead role. Returns information only."
5
- covered_by: caller
6
- capabilities: { write: false, shell: false }
7
- may:
8
- - "read anything readable in the repository"
9
- - "run `reins recall`"
10
- - "answer through the bus"
11
- must_not:
12
- - "write any file"
13
- - "produce reports or context files"
14
- - "run gates or tests"
15
- ---
16
-
17
- # lookup
18
-
19
- Stage skills: none (called by any stage for lookups).
20
-
21
- 1. Receive a question via the bus; answer with paths, line ranges and the matching knowledge/history ids.
22
- 2. If nothing matches, say so — do not guess.
@@ -1,22 +0,0 @@
1
- ---
2
- role: qa-design
3
- default_binding: "gemini-4-argon-high"
4
- fallback_binding: "claude-opus-5-5"
5
- summary: "Designs test scenarios from intent, roadmap and architecture — never from code. Gives the first review of spec and a light review of plan."
6
- covered_by: pm
7
- may:
8
- - "read intent.md, spec.md, docs/, AGENTS.md"
9
- - "write scenarios (paths, expected results, how to verify: script, screenshot, static analysis)"
10
- - "approve or send back spec.md (first review); light-review plan.md"
11
- must_not:
12
- - "read source code (the reviewer does that)"
13
- - "implement or edit code"
14
- - "run the scenarios (qa-run does)"
15
- ---
16
-
17
- # qa-design
18
-
19
- Stage skills: `reins-spec`, `reins-test`.
20
-
21
- 1. From spec.md: one scenario per S-n plus the risky paths the spec names.
22
- 2. Each scenario: steps, expected, verification method, pass criterion. Ambiguous expected results are a spec defect — send spec back.
@@ -1,19 +0,0 @@
1
- ---
2
- role: qa-run
3
- default_binding: "gemini-3.8-flash-medium"
4
- fallback_binding: "claude-haiku-5-5"
5
- summary: "Runs the designed scenarios and judges them; anything ambiguous fails."
6
- covered_by: verify-tool
7
- may:
8
- - "run scenarios and the scripts they name"
9
- - "write .loctx/reports/ with raw output"
10
- must_not:
11
- - "pass a result that is ambiguous or near the threshold (R17)"
12
- - "edit scenarios or code"
13
- ---
14
-
15
- # qa-run
16
-
17
- Stage skills: `reins-test`.
18
-
19
- 1. Run each scenario as written. 2. Record raw output. 3. pass only when the criterion is met exactly; otherwise fail with the observed value.
@@ -1,21 +0,0 @@
1
- ---
2
- role: verify-tool
3
- default_binding: "claude-haiku-5-5"
4
- summary: "Runs the declared gates and scenarios, attaches raw tool output, summarises failures so the PL can act."
5
- covered_by: none
6
- may:
7
- - "run gates from gates.yaml and scenarios from the plan's test checklist"
8
- - "write .loctx/reports/ with raw output (R46)"
9
- - "summarise a failure in a few lines for the PL (R51)"
10
- must_not:
11
- - "edit code"
12
- - "report a failure as a pass, or summarise away a failure"
13
- - "claim a run that did not happen; mark a scenario passed without running it"
14
- ---
15
-
16
- # verify-tool
17
-
18
- Stage skills: `reins-review`, `reins-test`.
19
-
20
- 1. Run `reins gate --ticket <id> --respond` — the declared order, stopping at the first failure (`--all` when asked). One call runs the gates, keeps each gate's raw output in `.loctx/reports/<ticket>_<gate>.log` (`$ cmd`, output untouched, `exit N`) and writes the bus response `<ticket>_<nn>.response.yaml` for the newest open `kind: verify` request (verdict pass|fail, `evidence:` the report paths, may_proceed). Never run a gate through a pipe or a chain; never trim its output (C5). Stdout is only a summary line per gate and, for a failure, its signature and file:line — judge from the report files, not from stdout. No open verify request: nothing is written and the call exits 1; report that to the PL.
21
- 2. Run `reins check --stage verdict --ticket <id>` (T3): a pass without raw evidence is D5, a non-zero exit or a massaged gate is D4. Add matching knowledge ids from `reins recall` to the hand-back only when asked.
@@ -1,21 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/bindings-local@1", "type": "object",
2
- "required": ["schema"],
3
- "properties": {
4
- "schema": { "const": "reins/bindings-local@1" },
5
- "vendors": {
6
- "type": "object",
7
- "additionalProperties": {
8
- "type": "object", "required": ["detected"],
9
- "properties": { "detected": { "type": "boolean" }, "at": { "type": "string" } }
10
- }
11
- },
12
- "roles": {
13
- "type": "object",
14
- "additionalProperties": {
15
- "type": "object",
16
- "anyOf": [{ "required": ["model"] }, { "required": ["enabled"] }],
17
- "properties": { "model": { "type": "string", "minLength": 1 }, "enabled": { "type": "boolean" } }
18
- }
19
- }
20
- }
21
- }
@@ -1,17 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/bus/request@1", "type": "object",
2
- "required": ["schema", "id", "from", "to", "ticket", "intent", "kind", "changes", "why", "revert"],
3
- "properties": {
4
- "schema": { "const": "reins/bus/request@1" },
5
- "id": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "string" },
6
- "ticket": { "type": "string" }, "intent": { "type": "string" },
7
- "kind": { "enum": ["review", "verify", "implement", "question", "stop-report"] },
8
- "changes": { "type": "array", "items": { "type": "object", "required": ["path", "what"] } },
9
- "why": { "type": "string" },
10
- "tried": { "type": "array", "items": { "type": "string" } },
11
- "not_tried": { "type": "array", "items": { "type": "string" } },
12
- "deadline": { "type": ["string", "null"] },
13
- "revert": { "type": "string" },
14
- "errors": { "type": "string" },
15
- "budget_left": { "type": "object" },
16
- "notes": { "type": "string" }
17
- }, "additionalProperties": false }
@@ -1,14 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/bus/response@1", "type": "object",
2
- "required": ["schema", "request", "from", "verdict", "grounds", "may_proceed"],
3
- "properties": {
4
- "schema": { "const": "reins/bus/response@1" },
5
- "request": { "type": "string" }, "from": { "type": "string" },
6
- "verdict": { "enum": ["approve", "fix-required", "reject", "cannot-judge", "pass", "fail"] },
7
- "grounds": { "type": "string" },
8
- "fixes": { "type": "array", "items": { "type": "object", "required": ["path", "what"] } },
9
- "may_proceed": { "type": "boolean" },
10
- "major_issues": { "type": "array", "items": { "type": "string" } },
11
- "evidence": { "type": "string" },
12
- "suggested_next": { "type": "string" },
13
- "notes": { "type": "string" }
14
- }, "additionalProperties": false }
@@ -1,22 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/policy/enforcement@1", "type": "object",
2
- "required": ["schema", "rules"],
3
- "properties": {
4
- "schema": { "const": "reins/policy/enforcement@1" },
5
- "rules": {
6
- "type": "array",
7
- "items": {
8
- "type": "object",
9
- "required": ["id", "held", "by"],
10
- "additionalProperties": false,
11
- "properties": {
12
- "id": { "type": "string", "minLength": 1 },
13
- "held": { "enum": ["blocked", "checked", "advised"] },
14
- "by": {
15
- "type": "array", "minItems": 1,
16
- "items": { "type": "string", "pattern": "^(deny|hook:pre-commit|hook:pre-push|check:(ticket-start|pre-commit|verdict|pre-push|rc-close|drift)|gate|ci|agent-tools|role)$" }
17
- },
18
- "gap": { "type": "string", "minLength": 1 }
19
- }
20
- }
21
- }
22
- } }
@@ -1,10 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/plan@1", "type": "object",
2
- "required": ["intent", "status", "agents"],
3
- "properties": {
4
- "intent": { "type": "string", "pattern": "^[0-9]{3}$" },
5
- "status": { "enum": ["draft", "reviewed", "active", "done"] },
6
- "approvals": { "$ref": "intent@1#/$defs/approvals" },
7
- "agents": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } },
8
- "budget": { "type": "object", "properties": { "tokens": { "type": "integer", "minimum": 0 } } },
9
- "tickets": { "type": "array", "items": { "type": "string", "pattern": "^[0-9]{3}-[0-9]+$" } }
10
- } }
@@ -1,15 +0,0 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/ticket@1", "type": "object",
2
- "required": ["id", "intent", "plan_step", "title", "status", "release", "role"],
3
- "properties": {
4
- "id": { "type": "string", "pattern": "^[0-9]{3}-[0-9]+$" },
5
- "intent": { "type": "string", "pattern": "^[0-9]{3}$" },
6
- "plan_step": { "type": "integer", "minimum": 1 },
7
- "title": { "type": "string", "minLength": 1 },
8
- "status": { "enum": ["todo", "doing", "blocked", "done"] },
9
- "depends": { "type": "array", "items": { "type": "string" } },
10
- "release": { "enum": ["planned", "stabilization"] },
11
- "role": { "type": "string" },
12
- "budget": { "type": "object", "properties": { "tokens": { "type": "integer", "minimum": 0 } } },
13
- "asks": { "type": "array", "items": { "type": "string" } },
14
- "branch": { "type": "string" }
15
- } }
@@ -1,20 +0,0 @@
1
- # Quoting: wrap any value that contains ": " or " #", or starts with one of - [ { * & ! | > ' " % @, in double quotes.
2
- schema: reins/bus/request@1
3
- id: 000-1_01
4
- from: pl
5
- to: implementer
6
- ticket: 000-1
7
- intent: "000"
8
- kind: implement
9
- changes:
10
- - path: "cli/src/example.ts"
11
- what: "one line: what changed"
12
- why: "S-1"
13
- requirement: "S-1: requirement text quoted from the spec, one line"
14
- evidence: ".loctx/reports/<gate>.log"
15
- why: "allowed files: <the plan's file list for the ticket, comma separated>"
16
- tried: []
17
- not_tried: []
18
- deadline: null
19
- revert: ""
20
- errors: ""
@@ -1,10 +0,0 @@
1
- # Quoting: wrap any value that contains ": " or " #", or starts with one of - [ { * & ! | > ' " % @, in double quotes.
2
- schema: reins/bus/response@1
3
- request: 000-1_01
4
- from: implementer
5
- verdict: pass
6
- grounds: ""
7
- fixes: []
8
- may_proceed: true
9
- major_issues: []
10
- evidence: ""
@@ -1,23 +0,0 @@
1
- ---
2
- intent: "000"
3
- status: draft
4
- approvals: []
5
- agents:
6
- implement: [implementer]
7
- verify: [verify-tool]
8
- review: [code-review]
9
- budget: {}
10
- tickets: []
11
- ---
12
- ## 바뀌는 파일
13
- —
14
- ## 작업 순서
15
- 1. — (S-1)
16
- ## 위험
17
- —
18
- ## 증명
19
- —
20
- ## 테스트 체크리스트
21
- —
22
- ## 이탈 기록
23
- —
@@ -1,29 +0,0 @@
1
- ---
2
- id: 000-1
3
- intent: "000"
4
- plan_step: 1
5
- title: —
6
- status: todo
7
- depends: []
8
- release: planned
9
- role: implementer
10
- budget: {}
11
- asks: []
12
- branch: feat/000-example
13
- ---
14
- ## 목적
15
- —
16
- ## 현재 코드
17
- —
18
- ## 작업
19
- - [ ] —
20
- ## 결정
21
- —
22
- ## 기대 결과
23
- —
24
- ## 예상 오류 / 주의
25
- —
26
- ## 검증
27
- - [ ] 게이트
28
- - [ ] 시나리오
29
- - [ ] 사용자 확인 필요
@@ -1,20 +0,0 @@
1
- ---
2
- name: reins-implement
3
- description: Implement one ticket as the implementer role — runs the T1 ticket-start check, then implements on the feature branch with one commit per finished unit (the hook runs T2). Use when a ticket is ready, the user says implement, next ticket or continue, or to resume a stopped ticket. Does not verify or review (reins-review).
4
- ---
5
-
6
- # reins-implement
7
-
8
- implementer role. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is `cli` in `.agents/harness/install.yaml` (no `cli` line: installed before 0.1.3, run `npx @bluenyang/reins@latest update` once) (inside the reins repository: `node cli/dist/reins.js`). Verdicts: CONTINUE (exit 0) go on · HOLD (10) ask the user, one line: reason id + what you need · STOP (20) do what `resume` says, then re-run the same check · ESCALATE (30) next role in the chain (pl → pm → advisor → user).
9
-
10
- 1. **Check first (T1).** `reins check --stage ticket-start --ticket <id>`. Not CONTINUE → stop and follow the verdict; do not start. Open `asks:` hold for the user; the check also names recorded decisions that may already answer them.
11
- 2. Branch `type/<NNN>-<slug>` from the default branch (never commit on it). Launch the `reins-implementer` subagent: ticket → plan section → `reins recall` → implement.
12
- 3. **One commit per finished unit** (a coherent change that builds on its own). The hook runs **T2** on every commit; never bypass it.
13
- 4. A diff outside the plan updates plan.md's departure log in the same commit (P2), or opens a new ticket (C10).
14
- 5. Tick the ticket checklist. Do not judge your own work or declare tests passed.
15
-
16
- Interrupted (G1): write ticket, step, last commit, open bus files and the next command into the ticket, so the same command resumes.
17
-
18
- Next: `reins-review`.
19
-
20
- **Metrics.** After each role run, report what it cost with one call: `reins metrics record --role <role> --tokens <n> --intent <id> [--ticket <id>] --vendor <v> --model <m>`. No token count from the vendor → record nothing, never guess.
@@ -1,26 +0,0 @@
1
- ---
2
- name: reins-intent
3
- description: Turn a request into an approved intent — runs the questionnaire with the user, writes .agents/intent/NNN_slug/intent.md and holds for the user's approval. Use when the user brings a new feature, change or problem, says new intent, or before any spec, plan or code exists for the work. Stops at the approved intent; the spec is reins-spec.
4
- ---
5
-
6
- # reins-intent
7
-
8
- The point where a person decides (design §4): **the intent is approved by the user.** Never cross it alone. pm role. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is `cli` in `.agents/harness/install.yaml` (no `cli` line: installed before 0.1.3, run `npx @bluenyang/reins@latest update` once) (inside the reins repository: `node cli/dist/reins.js`). Verdicts: CONTINUE (exit 0) go on · HOLD (10) ask the user, one line: reason id + what you need · STOP (20) do what `resume` says, then re-run the same check · ESCALATE (30) next role in the chain (pl → pm → advisor → user).
9
-
10
- 1. **Check first.** `reins check --drift`. HOLD or STOP → follow it.
11
- 2. Search what was already decided or rejected: `reins recall <keywords>` (until it ships:
12
- `grep -l 'decisions:.*<keyword>' .loctx/history/*` and `.agents/knowledge/`). A rejected proposal is not
13
- raised again (C8).
14
- 3. **Questionnaire — ask only what only the user knows**, in one batch: the problem, the desired outcome,
15
- constraints, what not to do. State your defaults for everything else instead of asking.
16
- 4. `reins new intent <slug> [--version <v>] [--origin user]` creates `.agents/intent/<NNN>_<slug>/intent.md` from the template with the next id. Write it in the
17
- user's words and language; record the questions and answers under the questionnaire section;
18
- `status: draft`, `origin: user`, `version:` the release it targets.
19
- 5. Show it and **ask for approval. Never set `approved` yourself.** On the user's explicit yes:
20
- `status: approved`, `approvals: [{role: user, at: <date>}]`, and commit only that change with the trailer
21
- `Approved-by: <the user's name>` (`git commit -m "docs(intent): approve <NNN> <slug>" -m "Approved-by: …"`).
22
-
23
- Next: `reins-spec`.
24
-
25
- **Metrics.** After each role run, report what it cost with one call: `reins metrics record --role <role> --tokens <n> --intent <id> [--ticket <id>] --vendor <v> --model <m>`. No token count from the vendor → record nothing, never guess.
26
- A role bound to a vendor with no generated files yet runs on Claude with its role file as instructions; say so in the history line.
@@ -1,26 +0,0 @@
1
- ---
2
- name: reins-loop
3
- description: Conduct an accepted spec through the reins loop by calling the stage skills in order — reins-spec, reins-implement, reins-review, reins-test, reins-release, reins-retro — and stopping where a check says. Use when an intent is approved, when the user says continue, next ticket or run the loop, or to resume where reins status points. Holds only the common rules; each stage's procedure lives in its skill.
4
- ---
5
-
6
- # reins-loop
7
-
8
- Roles judge, scripts enforce. Each stage skill starts with its own check, and **its verdict decides what happens next**:
9
- CONTINUE → go on · HOLD → ask the user (one line: reason id + what you need) · STOP → do what `resume` says,
10
- then re-run the same check · ESCALATE → the next role in the chain (pl → pm → advisor → user).
11
- Exit codes 0/10/20/30. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is `cli` in `.agents/harness/install.yaml` (no `cli` line: installed before 0.1.3, run `npx @bluenyang/reins@latest update` once) (inside the reins repository: `node cli/dist/reins.js`).
12
-
13
- ## Order
14
- 1. `reins-roadmap` (when the roadmap changes) → `reins-intent` → `reins-spec`
15
- 2. For each ticket: `reins-implement` → `reins-review` (back to implement on a failed verdict; next ticket until none is left)
16
- 3. `reins-test` → `reins-release` → `reins-retro`
17
-
18
- Resume: `reins status` names the stage; call that stage's skill again. Stop on any HOLD or STOP and report; never cross the user's two decisions (intent approval, spec summary veto) alone.
19
-
20
- **Models.** Take the model a role runs on from `reins status --json` (`bindings`: `{role, vendor, model, source}`) — your own override, else the team binding, else its fallback, else pm's model. Never read `bindings.yaml` for it and never use the default from the role file.
21
-
22
- **Off roles.** A role whose `bindings` entry has `enabled: false` is switched off for this user: do not call it. Its `covered_by` does the work (`caller`: the role that needs the lookup searches itself; `user`: ask the user), keeps the off role's `must_not`, and hands a judgement on its own work to the next role of the chain (pl → pm → advisor → user). A role with `enabled: true` but no `.claude/agents/reins-<role>.md` is on only through the user's local file (the team switched it off): call it on its resolved `model` from `reins status --json` — on Claude, a general subagent given the role file's body (`.agents/harness/roles/<role>.md`).
23
-
24
- **Metrics.** After each role run, report what it cost with one call: `reins metrics record --role <role> --tokens <n> --intent <id> [--ticket <id>] --vendor <v> --model <m>`. No token count from the vendor → record nothing, never guess. Tokens come from the vendor — Claude subagent: the Agent result's token count · `codex exec`: the "tokens used" line · `agy`, `cursor-agent` with `--output-format json`: the usage field when present. `reins check` and `reins gate` log themselves to `.loctx/reports/metrics.jsonl`; `reins metrics` summarises it.
25
-
26
- On an interruption (G1) write where you are — ticket, step, last commit, open bus files, next command — to the ticket, so the same command resumes.
@@ -1,41 +0,0 @@
1
- # Vendor CLI recipes
2
-
3
- How to call each role through its vendor CLI: read-only mode, output location, token source.
4
- Take `<model>` and the vendor from `reins status --json` (`bindings`), not from `bindings.yaml`: the resolved entry already applies your local override and the fallback.
5
- Report tokens with `reins metrics record --role <r> --tokens <n> --ticket <id>`; no count, no record.
6
-
7
- ## code-review — codex
8
-
9
- ```
10
- codex exec -m <model> -s read-only --ephemeral -C <repo> -o <response.yaml> - < prompt.md
11
- ```
12
-
13
- - Read-only sandbox (`-s read-only`), no session kept (`--ephemeral`); the answer is written to `-o`.
14
- - `prompt.md` = the role's `must_not` + its procedure (the body of code-review.md) + the bus request + the COMPLETE
15
- `git diff <range> -- . ":!.agents/harness" ":!.agents/skills" ":!.agents/SKILLS.md" ":!.claude"` inlined (all other files, not filtered to `changes[]` paths) followed by `git diff --stat <range> -- .agents/harness .agents/skills .agents/SKILLS.md .claude`; installed copies
16
- are always allowed to change) + "do not run commands, do not re-run checks".
17
- - Output lands in the `-o` file.
18
- - Re-review: inline only the fix commit's diff.
19
- - Tokens: the line after `tokens used` in the output.
20
-
21
- ## qa-design — agy
22
-
23
- ```
24
- agy -p "<prompt>" --model <model> --mode plan
25
- ```
26
-
27
- - Plan mode is read-only. Inline the spec and plan text in the prompt; the reviewer reads no files.
28
- - Output: redirect stdout to a file (`> response.yaml`).
29
- - Tokens: the usage field when present.
30
-
31
- ## lookup — cursor-agent
32
-
33
- ```
34
- cursor-agent -p --plan --model <model> "<prompt>"
35
- ```
36
-
37
- - Output: redirect stdout to a file. `--plan` is read-only. With `--output-format json`, tokens come from the usage field when present.
38
-
39
- ## Claude roles
40
-
41
- Call the `reins-<role>` subagent. It returns text; the pl writes it to the response file. Tokens: the Agent result's token count.
@@ -1,18 +0,0 @@
1
- ---
2
- name: reins-release
3
- description: Release a finished version as the deploy role — T5 rc-close check, then branch → PR → green CI → merge, then the configured release dispatch and ledger. Stable only on the user's explicit instruction. Use when the version is tested and the user says release, open the PR or cut the rc. Never pushes to the default branch directly.
4
- ---
5
-
6
- # reins-release
7
-
8
- deploy role, inside the pre-release loop only. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is `cli` in `.agents/harness/install.yaml` (no `cli` line: installed before 0.1.3, run `npx @bluenyang/reins@latest update` once) (inside the reins repository: `node cli/dist/reins.js`). Verdicts: CONTINUE (exit 0) go on · HOLD (10) ask the user, one line: reason id + what you need · STOP (20) do what `resume` says, then re-run the same check · ESCALATE (30) next role in the chain (pl → pm → advisor → user).
9
-
10
- 0. **Release documents.** If `.agents/harness/install.yaml` has `release.docs`, the docs role updates those files (roadmap row, CHANGELOG section, README status line) on the release branch and commits them before T5, so they ship in the release PR, for an rc and for stable. Details in deploy.md, "Release documents".
11
- 1. **Check first (T5).** `reins check --stage rc-close --release <version>`. Not CONTINUE → no dispatch; follow the verdict. T4 runs in the pre-push hook and holds a direct push to the default branch.
12
- 2. Follow the deploy role's procedures in `.agents/harness/roles/deploy.md`: **Merge procedure** (push the feature branch, `gh pr create`, `gh pr checks --watch`, `gh pr merge --rebase --delete-branch` on green only) and **rc procedure** (run the `dispatch:` lines T5 prints, watch the run, ledger line; a workflow with `approval: npm-staged` adds the steps deploy.md lists for it). The merge target is the repository's default branch. With no `release:` in `install.yaml`, stop after the merge and report "no release settings". If a dispatch is refused for permissions, hand the printed line to the user. Do not restate the procedures here; announce each step.
13
- 3. Stable is always the user's explicit call (A2): only then run `reins check --stage rc-close --release <version> --stable` and the stable `dispatch (stable — …)` lines it prints; then set the intent `status: released` as deploy.md says.
14
- 4. Anything in stop group A → stop and report.
15
-
16
- Next: `reins-retro`.
17
-
18
- **Metrics.** After each role run, report what it cost with one call: `reins metrics record --role <role> --tokens <n> --intent <id> [--ticket <id>] --vendor <v> --model <m>`. No token count from the vendor → record nothing, never guess.
@@ -1,20 +0,0 @@
1
- ---
2
- name: reins-retro
3
- description: Entry point for the retrospective of a released version, as the pm role — reads the state and proposes what to learn and promote. Use after a release, or when the user says retro or retrospective. Aggregates repeats, proposes knowledge promotions and accepts only what the user approves; this skill does not release or plan.
4
- ---
5
-
6
- # reins-retro
7
-
8
- pm role. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is `cli` in `.agents/harness/install.yaml` (no `cli` line: installed before 0.1.3, run `npx @bluenyang/reins@latest update` once) (inside the reins repository: `node cli/dist/reins.js`). Verdicts: CONTINUE (exit 0) go on · HOLD (10) ask the user, one line: reason id + what you need · STOP (20) do what `resume` says, then re-run the same check · ESCALATE (30) next role in the chain (pl → pm → advisor → user).
9
-
10
- 1. **Check first.** `reins status`. HOLD or STOP → follow it.
11
- 2. **Aggregate.** `reins retro --release <v>` after an rc (or with no flag, any time). It counts repeats across units (a ticket counts once): stop ids, review reasons, decisions, failed rounds (HOLD/STOP), tokens by role, and promotion candidates (a key seen in 2+ units not yet in active knowledge). `--json` for machine reading.
12
- 3. **Summarise for the user in their language**: stops, review findings, failed rounds, tokens, and the candidate list. Short; no raw dump.
13
- 4. **Propose.** For each candidate: `reins knowledge propose <key> --from <history pages>`. A key seen once but named by the user is proposed the same way, with its evidence in `--from`. This writes drafts to `.loctx/knowledge-proposals/` and records no approval. Show every draft to the user. A candidate you judge not to be a lesson: `reins knowledge dismiss <key> --reason <why>`, and tell the user; it comes back if it repeats in more units.
14
- 5. **Approval gate.** Only after the user explicitly approves a draft, run `reins knowledge accept <draft>`, and commit the new `.agents/knowledge/` file with the trailer `Approved-by: user`. Declined or silent drafts are not accepted; never accept on your own, and no agent message counts as approval. An entry without `approved` stops the verifier.
15
- 6. **Carry forward.** A generic lesson (not specific to one ticket) also becomes one line in `docs/ROADMAP.md` as a next-intent candidate.
16
- 7. **Record.** Write a history page in `.loctx/history/` with a `decisions:` line (accepted keys) and a `reasons:` line (why declined or deferred).
17
-
18
- Next: `reins-roadmap`, or the next intent via `reins-intent`.
19
-
20
- **Metrics.** After each role run, report what it cost with one call: `reins metrics record --role <role> --tokens <n> --intent <id> [--ticket <id>] --vendor <v> --model <m>`. No token count from the vendor → record nothing, never guess.