@bluenyang/reins 0.1.4 → 0.1.5-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 same workflows whose `stages` include stable, with `{version}` = `<V>`. Then set the intent's `status: released` in its intent.md and commit it.
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.4",
3
+ "version": "0.1.5-rc.1",
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": ">=20"
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": "^15.0.0",
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.4 …`
9
+ the answers only the user can give and report what happened. Run the CLI as `npx @bluenyang/reins@0.1.5-rc.1 …`
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}`.