@bluenyang/reins 0.1.4 → 0.1.5-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.
- package/README.md +84 -6
- package/cli/dist/commands/check.js +1 -1
- package/cli/dist/commands/configure.js +32 -5
- package/cli/dist/commands/gate.js +1 -1
- package/cli/dist/commands/install.js +7 -5
- package/cli/dist/commands/knowledge.js +1 -1
- package/cli/dist/commands/migrate.js +3 -2
- package/cli/dist/commands/new.js +3 -6
- package/cli/dist/commands/stages.js +70 -10
- package/cli/dist/commands/status.js +8 -0
- package/cli/dist/commands/update.js +5 -1
- package/cli/dist/lib/bindings.js +243 -0
- package/cli/dist/lib/enforcement.js +125 -0
- package/cli/dist/lib/fsx.js +16 -2
- package/cli/dist/lib/generate.js +24 -5
- package/cli/dist/lib/git.js +2 -2
- package/cli/dist/lib/metrics.js +1 -1
- package/cli/dist/lib/release.js +48 -0
- package/cli/dist/lib/retro.js +1 -1
- package/cli/dist/reins.js +29 -4
- package/cli/dist/scripts/enforcement.js +24 -0
- package/cli/dist/scripts/sync-version.js +2 -2
- package/docs/README.ko.md +83 -6
- package/harness/policy/enforcement.yaml +98 -0
- package/harness/roles/deploy.md +5 -1
- package/harness/schemas/bindings-local.schema.json +20 -0
- package/harness/schemas/enforcement.schema.json +22 -0
- package/harness/schemas/install.schema.json +11 -1
- package/package.json +7 -3
- package/skills/reins-loop/SKILL.md +2 -0
- package/skills/reins-loop/references/vendor-cli.md +1 -0
- package/skills/reins-release/SKILL.md +2 -1
- package/skills/reins-setup/SKILL.md +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Run by the `version` lifecycle script (npm/pnpm version), after package.json is bumped.
|
|
3
3
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
|
-
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
6
|
/** Replaces only the first `"version": "<x>"` value; every other byte stays. Null when there is no such key. */
|
|
7
7
|
export function replaceVersion(text, version) {
|
|
8
8
|
const re = /("version"\s*:\s*")[^"]*(")/;
|
|
@@ -11,7 +11,7 @@ export function replaceVersion(text, version) {
|
|
|
11
11
|
: null;
|
|
12
12
|
}
|
|
13
13
|
// compiled to cli/dist/scripts/: the repository root is three levels up (or the first argument)
|
|
14
|
-
const root = pathToFileURL(`${resolve(process.argv[2] ?? new URL('../../../', import.meta.url)
|
|
14
|
+
const root = pathToFileURL(`${resolve(process.argv[2] ?? fileURLToPath(new URL('../../../', import.meta.url)))}/`);
|
|
15
15
|
const read = (p) => readFileSync(new URL(p, root), 'utf8');
|
|
16
16
|
const write = (p, s) => writeFileSync(new URL(p, root), s);
|
|
17
17
|
export function sync() {
|
package/docs/README.ko.md
CHANGED
|
@@ -14,10 +14,13 @@ BlueNyang과 Team Croffle의 저장소 열두 곳이 같은 하네스 계보를
|
|
|
14
14
|
|
|
15
15
|
## 상태
|
|
16
16
|
|
|
17
|
-
0.1.
|
|
17
|
+
0.1.4가 npm에 있습니다: `npx @bluenyang/reins <command>`. 계획의 1차(round one)로, graph 단계이며
|
|
18
18
|
생성되는 벤더 파일은 Claude Code만 검증했습니다. loop와 harness 단계는 0.2에서 graph로부터 깎아
|
|
19
|
-
냅니다.
|
|
20
|
-
|
|
19
|
+
냅니다. 0.1.3에서 루프를 단계 스킬로 나누고 PR → CI → rc 릴리스 흐름을 넣었고, 0.1.4에서 큰 저장소
|
|
20
|
+
적용을 준비했습니다(릴리스 설정, 모노레포 게이트, migrate 수정). rc 단계인 0.1.5는 어떤 규칙이 강제되고
|
|
21
|
+
어떤 규칙이 권고인지 밝히고, 모델 할당을 팀과 사용자 두 층으로 나누며, CI를 Ubuntu·Windows·macOS와
|
|
22
|
+
Node 22·24에서 돌립니다. 버전마다 바뀐 것은
|
|
23
|
+
[CHANGELOG.md](../CHANGELOG.md)에, 다음 계획은 로드맵에 있습니다.
|
|
21
24
|
|
|
22
25
|
reins는 자기 루프로 자기 자신을 개발합니다. intent 001(`reins status`), 002(`reins metrics`),
|
|
23
26
|
003(위반 시나리오)이 각각 intent → spec → plan → ticket 순서를 거쳤고, T1~T5 검사를 통과했으며 코드
|
|
@@ -46,10 +49,11 @@ qa-run, deploy, docs, advisor. 역할 파일마다 해서는 안 되는 일이
|
|
|
46
49
|
모델을 정합니다. 설계상 감지되지 않은 벤더에 묶인 역할은 fallback으로, 그것도 없으면 pm의 모델로
|
|
47
50
|
돌아가므로 열두 역할 모두 Claude만으로 돌 수 있습니다.
|
|
48
51
|
|
|
49
|
-
**레드라인.** 모든 역할에
|
|
52
|
+
**레드라인.** 모든 역할에 적용되는 규칙이 열 개(C1–C10) 있습니다. 몇 가지를 들면
|
|
50
53
|
이렇습니다. 통과만 시키는 구현 금지(C1), 관리 블록·정책·역할 파일 수정 금지(C2), 자기 권한 파일 수정
|
|
51
54
|
금지(C3), 시크릿 읽기 금지(C4), 훅 우회 금지(C5), deploy 역할 밖의 push·PR·merge·릴리스 금지(C6).
|
|
52
|
-
전체 목록은 [design.ko.md](design.ko.md) 2절에 있습니다.
|
|
55
|
+
전체 목록은 [design.ko.md](design.ko.md) 2절에 있습니다. 규칙마다 실제로 어떻게 지켜지는지는 아래
|
|
56
|
+
[강제와 권고](#강제와-권고)에 있습니다. 막는 것, 전이 지점에서 검사하는 것, 역할과 스킬에 적혀만 있는 것이 섞여 있습니다.
|
|
53
57
|
|
|
54
58
|
**검증기.** `reins check`는 전환 지점마다 돌아 판정을 하나 출력합니다. 모델을 호출하지 않습니다.
|
|
55
59
|
역할이 판단을 인수인계 파일에 쓰면 검증기가 그것을 적용할 뿐입니다.
|
|
@@ -78,6 +82,79 @@ qa-run, deploy, docs, advisor. 역할 파일마다 해서는 안 되는 일이
|
|
|
78
82
|
| `.claude/` | 합니다 | `.agents/`에서 생성한 파일, 직접 고치지 않습니다 |
|
|
79
83
|
| `.loctx/` | 안 합니다 (gitignore) | ticket, 보고서, 인수인계 `bus/`, `history/`, 로컬 로드맵 |
|
|
80
84
|
|
|
85
|
+
## 강제와 권고
|
|
86
|
+
|
|
87
|
+
모든 규칙이 강제되는 것은 아닙니다. 규칙은 세 가지 중 하나로 지켜지고, `harness/policy/enforcement.yaml`이 규칙마다 한 줄로 어느 쪽인지 적습니다.
|
|
88
|
+
|
|
89
|
+
- **차단**(blocked): 스크립트·훅·권한 deny가 실행 전에 막습니다.
|
|
90
|
+
- **검사**(checked): 전이 지점 검사, drift 검사, CI가 사후에 잡습니다.
|
|
91
|
+
- **권고**(advised): 역할이나 스킬 문서에만 적혀 있습니다. 코드로는 잡히지 않습니다.
|
|
92
|
+
|
|
93
|
+
등급은 실제로 지켜지는 부분 가운데 가장 강한 것으로 매기고, 빈 곳은 `빈틈` 열에 적습니다. 훅은 설치했을 때만 적용되고, deny 규칙과 에이전트 도구 제한은 Claude Code에만 있습니다. 규칙 id는 [design.ko.md](design.ko.md) 2·3절에, 근거는 [violations.ko.md](violations.ko.md)에 있습니다. 권고에 머문 규칙은 [0.2](ROADMAP.ko.md)의 입력입니다. 표의 `빈틈` 열은 영어 원문 그대로입니다.
|
|
94
|
+
|
|
95
|
+
<!-- enforcement:begin -->
|
|
96
|
+
| id | 지킴 | 수단 | 빈틈 |
|
|
97
|
+
|---|---|---|---|
|
|
98
|
+
| C1 | 권고 | `role` | judged by reviewers only; nothing detects a hard-coded pass |
|
|
99
|
+
| C2 | 차단 | `hook:pre-commit`, `check:drift` | only when the hook is installed; the edit itself is not prevented |
|
|
100
|
+
| C3 | 차단 | `hook:pre-commit`, `check:drift` | only when the hook is installed; no deny rule covers .claude/settings.json itself |
|
|
101
|
+
| C4 | 차단 | `deny`, `hook:pre-commit` | Claude Code only; .env.* is a finite list, so names such as .env.custom have no deny rule; the hook sees staged paths, not reads |
|
|
102
|
+
| C5 | 차단 | `deny`, `gate`, `check:verdict` | combined or later-position forms such as git commit -nm are not denied |
|
|
103
|
+
| C6 | 권고 | `role` | pre-push holds pushes to the default branch (A4) and the deny rules stop force and --no-verify pushes; any other push, PR, merge, release or tag is not blocked |
|
|
104
|
+
| C7 | 권고 | `role` | — |
|
|
105
|
+
| C8 | 권고 | `role` | — |
|
|
106
|
+
| C9 | 권고 | `role` | — |
|
|
107
|
+
| C10 | 권고 | `role` | T2 lists it but the pre-commit check does not compare the diff with plan.md |
|
|
108
|
+
| A1 | 차단 | `deny`, `hook:pre-push` | moving a published tag forward to a descendant passes the ancestry test |
|
|
109
|
+
| A2 | 권고 | `role` | — |
|
|
110
|
+
| A3 | 권고 | `role` | — |
|
|
111
|
+
| A4 | 차단 | `hook:pre-push` | only a push to the default branch is held; other ways of leaving the machine are not detected |
|
|
112
|
+
| B1 | 검사 | `check:ticket-start` | — |
|
|
113
|
+
| B2 | 권고 | `role` | — |
|
|
114
|
+
| B3 | 권고 | `role`, `check:ticket-start` | the scope conflict is a role's judgement; ticket-start checks only the approval chain |
|
|
115
|
+
| B4 | 권고 | `role` | — |
|
|
116
|
+
| B5 | 권고 | `role` | — |
|
|
117
|
+
| P1 | 권고 | `role` | — |
|
|
118
|
+
| P2 | 검사 | `check:ticket-start`, `check:rc-close` | only ticket-in-plan; a diff is not compared with plan.md |
|
|
119
|
+
| D1 | 검사 | `check:verdict` | does not tell a ticket before rc.1 from an rc after |
|
|
120
|
+
| D2 | 권고 | `role` | no memory across runs |
|
|
121
|
+
| D3 | 권고 | `role` | no alone-versus-full-run comparison |
|
|
122
|
+
| D4 | 차단 | `gate`, `check:verdict` | an empty gate output is only a WARN |
|
|
123
|
+
| D5 | 검사 | `check:verdict` | — |
|
|
124
|
+
| E1 | 권고 | `role` | nothing reads a budget or a token count |
|
|
125
|
+
| E2 | 권고 | `role` | nothing reads a budget or a token count |
|
|
126
|
+
| E3 | 권고 | `role` | T5 lists it but nothing reads a budget or a token count |
|
|
127
|
+
| F1 | 권고 | `role` | the deny rules stop some attempts in Claude Code, but no stop is recorded |
|
|
128
|
+
| F2 | 차단 | `hook:pre-commit`, `check:drift`, `check:ticket-start`, `check:rc-close` | — |
|
|
129
|
+
| F3 | 권고 | `role` | — |
|
|
130
|
+
| G1 | 권고 | `role` | no signal handler and no resume record on an interrupt |
|
|
131
|
+
| G2 | 권고 | `role` | — |
|
|
132
|
+
| T1 | 검사 | `check:ticket-start` | budget-left is not implemented |
|
|
133
|
+
| T2 | 차단 | `hook:pre-commit` | only when the hook is installed; the P2 and C10 diff checks do not exist |
|
|
134
|
+
| T3 | 검사 | `check:verdict` | — |
|
|
135
|
+
| T4 | 차단 | `hook:pre-push` | implements A1 and the default-branch push (A4); A2, A3, C6 and the loop-step check do not exist |
|
|
136
|
+
| T5 | 검사 | `check:rc-close` | E3 is not implemented |
|
|
137
|
+
| T6 | 권고 | `role` | no code runs on an interrupt or a violation signal |
|
|
138
|
+
|
|
139
|
+
| 역할 | 차단 | 검사 | 권고 | 차단되는 항목 |
|
|
140
|
+
|---|---|---|---|---|
|
|
141
|
+
| advisor | 0 | 0 | 2 | — |
|
|
142
|
+
| code-review | 1 | 0 | 2 | edit code |
|
|
143
|
+
| deploy | 1 | 0 | 2 | force-push, delete or move tags, rewrite main |
|
|
144
|
+
| docs | 0 | 0 | 3 | — |
|
|
145
|
+
| implementer | 0 | 0 | 5 | — |
|
|
146
|
+
| lookup | 3 | 0 | 0 | write any file; produce reports or context files; run gates or tests |
|
|
147
|
+
| planner | 0 | 0 | 3 | — |
|
|
148
|
+
| pl | 0 | 0 | 3 | — |
|
|
149
|
+
| pm | 0 | 1 | 2 | — |
|
|
150
|
+
| qa-design | 0 | 0 | 3 | — |
|
|
151
|
+
| qa-run | 0 | 0 | 2 | — |
|
|
152
|
+
| verify-tool | 0 | 2 | 1 | — |
|
|
153
|
+
| 예산 범위 | 0 | 0 | 6 | — |
|
|
154
|
+
<!-- enforcement:end -->
|
|
155
|
+
|
|
156
|
+
표는 `pnpm docs:enforcement`로 만들고, 테스트가 YAML과 같은지 확인합니다.
|
|
157
|
+
|
|
81
158
|
## 시작하기
|
|
82
159
|
|
|
83
160
|
Claude Code에서는 플러그인을 설치하면 저장소 설정까지 맡길 수 있습니다.
|
|
@@ -88,7 +165,7 @@ Claude Code에서는 플러그인을 설치하면 저장소 설정까지 맡길
|
|
|
88
165
|
/reins:reins-setup
|
|
89
166
|
```
|
|
90
167
|
|
|
91
|
-
Codex, Antigravity, Cursor나 터미널에서는 CLI를 씁니다. Node
|
|
168
|
+
Codex, Antigravity, Cursor나 터미널에서는 CLI를 씁니다. Node 22 이상이 필요합니다. 설치하려는 저장소의 루트에서 실행하며, 저장소에 커밋이 하나 이상 있어야
|
|
92
169
|
합니다(0.1.0의 `check`는 커밋이 없는 저장소에서 실패합니다).
|
|
93
170
|
|
|
94
171
|
```sh
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
schema: reins/policy/enforcement@1
|
|
2
|
+
# How each rule is held today (design §2·§3). One line per rule; this is a statement of fact, not of intent:
|
|
3
|
+
# `stops.yaml` `detect:` says what the design wants, `held:` says what the code does.
|
|
4
|
+
# held: blocked a script, hook or permission deny stops the action before it happens
|
|
5
|
+
# checked a transition check, the drift check or CI catches it afterwards
|
|
6
|
+
# advised written in a role or skill only; nothing in code catches it
|
|
7
|
+
# The grade is the strongest part that really holds; what is left open goes in `gap:`.
|
|
8
|
+
# by: deny · hook:pre-commit · hook:pre-push · check:<stage> · check:drift · gate · ci · agent-tools · role
|
|
9
|
+
# Keys: C1–C10, A1–G2, T1–T6, `<role>#<n>` (n counts the role's `must_not` items from 1), `budget:<scope>`.
|
|
10
|
+
# The tables in README.md, docs/README.ko.md and docs/design*.md are rendered from this file (`pnpm docs:enforcement`).
|
|
11
|
+
rules:
|
|
12
|
+
# common red lines
|
|
13
|
+
- { id: C1, held: advised, by: [role], gap: "judged by reviewers only; nothing detects a hard-coded pass" }
|
|
14
|
+
- { id: C2, held: blocked, by: [hook:pre-commit, check:drift], gap: "only when the hook is installed; the edit itself is not prevented" }
|
|
15
|
+
- { id: C3, held: blocked, by: [hook:pre-commit, check:drift], gap: "only when the hook is installed; no deny rule covers .claude/settings.json itself" }
|
|
16
|
+
- { id: C4, held: blocked, by: [deny, hook:pre-commit], gap: "Claude Code only; .env.* is a finite list, so names such as .env.custom have no deny rule; the hook sees staged paths, not reads" }
|
|
17
|
+
- { id: C5, held: blocked, by: [deny, gate, check:verdict], gap: "combined or later-position forms such as git commit -nm are not denied" }
|
|
18
|
+
- { id: C6, held: advised, by: [role], gap: "pre-push holds pushes to the default branch (A4) and the deny rules stop force and --no-verify pushes; any other push, PR, merge, release or tag is not blocked" }
|
|
19
|
+
- { id: C7, held: advised, by: [role] }
|
|
20
|
+
- { id: C8, held: advised, by: [role] }
|
|
21
|
+
- { id: C9, held: advised, by: [role] }
|
|
22
|
+
- { id: C10, held: advised, by: [role], gap: "T2 lists it but the pre-commit check does not compare the diff with plan.md" }
|
|
23
|
+
# stop conditions
|
|
24
|
+
- { id: A1, held: blocked, by: [deny, hook:pre-push], gap: "moving a published tag forward to a descendant passes the ancestry test" }
|
|
25
|
+
- { id: A2, held: advised, by: [role] }
|
|
26
|
+
- { id: A3, held: advised, by: [role] }
|
|
27
|
+
- { id: A4, held: blocked, by: [hook:pre-push], gap: "only a push to the default branch is held; other ways of leaving the machine are not detected" }
|
|
28
|
+
- { id: B1, held: checked, by: [check:ticket-start] }
|
|
29
|
+
- { id: B2, held: advised, by: [role] }
|
|
30
|
+
- { id: B3, held: advised, by: [role, check:ticket-start], gap: "the scope conflict is a role's judgement; ticket-start checks only the approval chain" }
|
|
31
|
+
- { id: B4, held: advised, by: [role] }
|
|
32
|
+
- { id: B5, held: advised, by: [role] }
|
|
33
|
+
- { id: P1, held: advised, by: [role] }
|
|
34
|
+
- { id: P2, held: checked, by: [check:ticket-start, check:rc-close], gap: "only ticket-in-plan; a diff is not compared with plan.md" }
|
|
35
|
+
- { id: D1, held: checked, by: [check:verdict], gap: "does not tell a ticket before rc.1 from an rc after" }
|
|
36
|
+
- { id: D2, held: advised, by: [role], gap: "no memory across runs" }
|
|
37
|
+
- { id: D3, held: advised, by: [role], gap: "no alone-versus-full-run comparison" }
|
|
38
|
+
- { id: D4, held: blocked, by: [gate, check:verdict], gap: "an empty gate output is only a WARN" }
|
|
39
|
+
- { id: D5, held: checked, by: [check:verdict] }
|
|
40
|
+
- { id: E1, held: advised, by: [role], gap: "nothing reads a budget or a token count" }
|
|
41
|
+
- { id: E2, held: advised, by: [role], gap: "nothing reads a budget or a token count" }
|
|
42
|
+
- { id: E3, held: advised, by: [role], gap: "T5 lists it but nothing reads a budget or a token count" }
|
|
43
|
+
- { id: F1, held: advised, by: [role], gap: "the deny rules stop some attempts in Claude Code, but no stop is recorded" }
|
|
44
|
+
- { id: F2, held: blocked, by: [hook:pre-commit, check:drift, check:ticket-start, check:rc-close] }
|
|
45
|
+
- { id: F3, held: advised, by: [role] }
|
|
46
|
+
- { id: G1, held: advised, by: [role], gap: "no signal handler and no resume record on an interrupt" }
|
|
47
|
+
- { id: G2, held: advised, by: [role] }
|
|
48
|
+
# transition points
|
|
49
|
+
- { id: T1, held: checked, by: [check:ticket-start], gap: "budget-left is not implemented" }
|
|
50
|
+
- { id: T2, held: blocked, by: [hook:pre-commit], gap: "only when the hook is installed; the P2 and C10 diff checks do not exist" }
|
|
51
|
+
- { id: T3, held: checked, by: [check:verdict] }
|
|
52
|
+
- { id: T4, held: blocked, by: [hook:pre-push], gap: "implements A1 and the default-branch push (A4); A2, A3, C6 and the loop-step check do not exist" }
|
|
53
|
+
- { id: T5, held: checked, by: [check:rc-close], gap: "E3 is not implemented" }
|
|
54
|
+
- { id: T6, held: advised, by: [role], gap: "no code runs on an interrupt or a violation signal" }
|
|
55
|
+
# role must_not items, in file order
|
|
56
|
+
- { id: "advisor#1", held: advised, by: [role] }
|
|
57
|
+
- { id: "advisor#2", held: advised, by: [role] }
|
|
58
|
+
- { id: "code-review#1", held: blocked, by: [agent-tools], gap: "Claude agent files only (disallowedTools); shell stays open, so a shell write is not stopped" }
|
|
59
|
+
- { id: "code-review#2", held: advised, by: [role] }
|
|
60
|
+
- { id: "code-review#3", held: advised, by: [role] }
|
|
61
|
+
- { id: "deploy#1", held: advised, by: [role], gap: "the stable dispatch line is only printed on request, nothing refuses it" }
|
|
62
|
+
- { id: "deploy#2", held: blocked, by: [deny, hook:pre-push], gap: "see A1" }
|
|
63
|
+
- { id: "deploy#3", held: advised, by: [role] }
|
|
64
|
+
- { id: "docs#1", held: advised, by: [role] }
|
|
65
|
+
- { id: "docs#2", held: advised, by: [role] }
|
|
66
|
+
- { id: "docs#3", held: advised, by: [role] }
|
|
67
|
+
- { id: "implementer#1", held: advised, by: [role], gap: "see C10" }
|
|
68
|
+
- { id: "implementer#2", held: advised, by: [role] }
|
|
69
|
+
- { id: "implementer#3", held: advised, by: [role], gap: "see C1" }
|
|
70
|
+
- { id: "implementer#4", held: advised, by: [role], gap: "see C6" }
|
|
71
|
+
- { id: "implementer#5", held: advised, by: [role] }
|
|
72
|
+
- { id: "lookup#1", held: blocked, by: [agent-tools], gap: "Claude agent files only" }
|
|
73
|
+
- { id: "lookup#2", held: blocked, by: [agent-tools], gap: "Claude agent files only" }
|
|
74
|
+
- { id: "lookup#3", held: blocked, by: [agent-tools], gap: "Claude agent files only" }
|
|
75
|
+
- { id: "planner#1", held: advised, by: [role] }
|
|
76
|
+
- { id: "planner#2", held: advised, by: [role], gap: "see C10" }
|
|
77
|
+
- { id: "planner#3", held: advised, by: [role], gap: "ticket-start checks that the spec is accepted, not who accepted it" }
|
|
78
|
+
- { id: "pl#1", held: advised, by: [role], gap: "see C6" }
|
|
79
|
+
- { id: "pl#2", held: advised, by: [role] }
|
|
80
|
+
- { id: "pl#3", held: advised, by: [role] }
|
|
81
|
+
- { id: "pm#1", held: advised, by: [role] }
|
|
82
|
+
- { id: "pm#2", held: checked, by: [check:ticket-start], gap: "needs a user entry in approvals and an Approved-by commit trailer; the trailer text can be written by anyone" }
|
|
83
|
+
- { id: "pm#3", held: advised, by: [role], gap: "see C6" }
|
|
84
|
+
- { id: "qa-design#1", held: advised, by: [role] }
|
|
85
|
+
- { id: "qa-design#2", held: advised, by: [role] }
|
|
86
|
+
- { id: "qa-design#3", held: advised, by: [role] }
|
|
87
|
+
- { id: "qa-run#1", held: advised, by: [role] }
|
|
88
|
+
- { id: "qa-run#2", held: advised, by: [role] }
|
|
89
|
+
- { id: "verify-tool#1", held: advised, by: [role] }
|
|
90
|
+
- { id: "verify-tool#2", held: checked, by: [check:verdict], gap: "evidence is text a role writes; the check reads its command line and exit code" }
|
|
91
|
+
- { id: "verify-tool#3", held: checked, by: [check:verdict], gap: "evidence is text a role writes; the check reads its command line and exit code" }
|
|
92
|
+
# budget scopes (budget.yaml)
|
|
93
|
+
- { id: "budget:project", held: advised, by: [role], gap: "no defaults and no reader" }
|
|
94
|
+
- { id: "budget:version", held: advised, by: [role], gap: "no reader" }
|
|
95
|
+
- { id: "budget:rc", held: advised, by: [role], gap: "no reader" }
|
|
96
|
+
- { id: "budget:ticket", held: advised, by: [role], gap: "no reader" }
|
|
97
|
+
- { id: "budget:session", held: advised, by: [role], gap: "no reader" }
|
|
98
|
+
- { id: "budget:role", held: advised, by: [role], gap: "no reader" }
|
package/harness/roles/deploy.md
CHANGED
|
@@ -29,6 +29,10 @@ The merge target is the repository's default branch (`gh repo view --json defaul
|
|
|
29
29
|
5. If any check is red, do not merge. Return it to the PL (D2: a red check twice).
|
|
30
30
|
6. Without `release:` in `.agents/harness/install.yaml` the work ends here: report "no release settings".
|
|
31
31
|
|
|
32
|
+
## Release documents (before T5, rc and stable)
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
32
36
|
## rc procedure (design §4)
|
|
33
37
|
|
|
34
38
|
1. Run `reins check --stage rc-close --release <V>`. Anything but CONTINUE (open `release: planned` or `release: stabilization` tickets, F2) means no dispatch.
|
|
@@ -36,7 +40,7 @@ The merge target is the repository's default branch (`gh repo view --json defaul
|
|
|
36
40
|
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.
|
|
37
41
|
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.
|
|
38
42
|
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.
|
|
39
|
-
6. Stable only on the user's explicit instruction (A2): the
|
|
43
|
+
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.
|
|
40
44
|
|
|
41
45
|
### `approval: npm-staged` (added steps, only for workflows with this value)
|
|
42
46
|
|
|
@@ -0,0 +1,20 @@
|
|
|
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", "required": ["model"],
|
|
16
|
+
"properties": { "model": { "type": "string", "minLength": 1 } }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
} }
|
|
@@ -9,8 +9,18 @@
|
|
|
9
9
|
"language": { "type": "string" },
|
|
10
10
|
"release": {
|
|
11
11
|
"type": "object",
|
|
12
|
-
"required": ["workflows"],
|
|
13
12
|
"properties": {
|
|
13
|
+
"docs": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"required": ["file", "check"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"file": { "type": "string", "minLength": 1 },
|
|
20
|
+
"check": { "enum": ["roadmap-row", "changelog-section", "mentions-version"] }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
14
24
|
"workflows": {
|
|
15
25
|
"type": "array",
|
|
16
26
|
"items": {
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluenyang/reins",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5-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": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/bluenyang/reins.git"
|
|
9
9
|
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"registry": "https://registry.npmjs.org"
|
|
12
|
+
},
|
|
10
13
|
"type": "module",
|
|
11
14
|
"bin": {
|
|
12
15
|
"reins": "cli/dist/reins.js"
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
"docs/README.ko.md"
|
|
20
23
|
],
|
|
21
24
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
25
|
+
"node": ">=22"
|
|
23
26
|
},
|
|
24
27
|
"packageManager": "pnpm@12.15.0",
|
|
25
28
|
"scripts": {
|
|
@@ -30,12 +33,13 @@
|
|
|
30
33
|
"fmt:check": "oxfmt --check cli/src cli/test test",
|
|
31
34
|
"test": "vitest run",
|
|
32
35
|
"check": "pnpm lint && pnpm fmt:check && pnpm typecheck && pnpm test",
|
|
36
|
+
"docs:enforcement": "pnpm -s build && node cli/dist/scripts/enforcement.js",
|
|
33
37
|
"version": "pnpm -s build && node cli/dist/scripts/sync-version.js && git add .claude-plugin/plugin.json skills/reins-setup/SKILL.md",
|
|
34
38
|
"prepare": "husky"
|
|
35
39
|
},
|
|
36
40
|
"dependencies": {
|
|
37
41
|
"ajv": "^8.20.0",
|
|
38
|
-
"commander": "^
|
|
42
|
+
"commander": "^14.0.0",
|
|
39
43
|
"yaml": "^2.9.1"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
@@ -17,6 +17,8 @@ Exit codes 0/10/20/30. Run the CLI as `npx @bluenyang/reins@<v>` where `<v>` is
|
|
|
17
17
|
|
|
18
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
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
|
+
|
|
20
22
|
**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.
|
|
21
23
|
|
|
22
24
|
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,6 +1,7 @@
|
|
|
1
1
|
# Vendor CLI recipes
|
|
2
2
|
|
|
3
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.
|
|
4
5
|
Report tokens with `reins metrics record --role <r> --tokens <n> --ticket <id>`; no count, no record.
|
|
5
6
|
|
|
6
7
|
## code-review — codex
|
|
@@ -7,9 +7,10 @@ description: Release a finished version as the deploy role — T5 rc-close check
|
|
|
7
7
|
|
|
8
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
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".
|
|
10
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.
|
|
11
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.
|
|
12
|
-
3. Stable is always the user's explicit call (A2); then set the intent `status: released` as deploy.md says.
|
|
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.
|
|
13
14
|
4. Anything in stop group A → stop and report.
|
|
14
15
|
|
|
15
16
|
Next: `reins-retro`.
|
|
@@ -6,7 +6,7 @@ description: Install reins in this repository, or move an existing harness onto
|
|
|
6
6
|
# reins-setup
|
|
7
7
|
|
|
8
8
|
You act as the **pm** role (`.agents/harness/roles/pm.md` once installed). The CLI does the work; you collect
|
|
9
|
-
the answers only the user can give and report what happened. Run the CLI as `npx @bluenyang/reins@0.1.
|
|
9
|
+
the answers only the user can give and report what happened. Run the CLI as `npx @bluenyang/reins@0.1.5-rc.2 …`
|
|
10
10
|
(the version is pinned to this skill's release; inside the reins repository itself: `node cli/dist/reins.js …`).
|
|
11
11
|
|
|
12
12
|
Defaults from the plugin settings: language `${user_config.language}`, install mode `${user_config.default_mode}`.
|