@bluenyang/reins 0.3.0-rc.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ knowledge lost in gitignored space, copies that drift apart. The full list is in
15
15
 
16
16
  ## Status
17
17
 
18
- **0.3.0-rc.3 is the release candidate** (intents 019, 020): `npx @bluenyang/reins@0.3.0-rc.3`. 0.2.0, the latest stable, still installs the older design, in which skills and hooks called `npx @bluenyang/reins` during work; 0.3 removes that, and `reins update` moves a 0.1.x or 0.2.0 install over. What changed in each version is in [CHANGELOG.md](CHANGELOG.md); what comes next is in the [roadmap](docs/ROADMAP.md).
18
+ **0.3.0-rc.4 is the release candidate** (intents 019, 020): `npx @bluenyang/reins@0.3.0-rc.4`. 0.2.0, the latest stable, still installs the older design, in which skills and hooks called `npx @bluenyang/reins` during work; 0.3 removes that, and `reins update` moves a 0.1.x or 0.2.0 install over. What changed in each version is in [CHANGELOG.md](CHANGELOG.md); what comes next is in the [roadmap](docs/ROADMAP.md).
19
19
 
20
20
  ## How it works
21
21
 
@@ -36,8 +36,36 @@ export function isAncestor(ancestor, descendant, cwd) {
36
36
  return false;
37
37
  }
38
38
  }
39
+ /**
40
+ * Why a command cannot find its repository (spec 019 ST-8): every command stops with this one line instead of
41
+ * a stack trace. Only a folder outside a repository is told to run git init; any other git failure keeps git's
42
+ * own words (dubious ownership, permissions, a broken config).
43
+ */
44
+ export class NotARepository extends Error {
45
+ constructor(message) {
46
+ super(message);
47
+ this.name = 'NotARepository';
48
+ }
49
+ }
39
50
  export function repoRoot(cwd) {
40
- return git(['rev-parse', '--show-toplevel'], cwd);
51
+ try {
52
+ return execFileSync('git', ['rev-parse', '--show-toplevel'], {
53
+ cwd,
54
+ encoding: 'utf8',
55
+ stdio: ['ignore', 'pipe', 'pipe'],
56
+ // git's own messages in English, so "not a git repository" can be recognised
57
+ env: { ...process.env, LC_ALL: 'C', LANGUAGE: 'C' },
58
+ }).trim();
59
+ }
60
+ catch (e) {
61
+ const err = e;
62
+ if (err.code === 'ENOENT')
63
+ throw new NotARepository('git is not installed or not on PATH');
64
+ const said = String(err.stderr ?? '').trim();
65
+ if (/not a git repository/i.test(said))
66
+ throw new NotARepository('not a git repository — run git init here first');
67
+ throw new NotARepository(`git cannot read this repository: ${said.split(/\r?\n/)[0] || 'unknown error'}`);
68
+ }
41
69
  }
42
70
  /** Subjects of the commits an update of an existing ref adds: `remote..local`. */
43
71
  export function pushedSubjects(remoteSha, localSha, cwd) {
package/cli/dist/reins.js CHANGED
@@ -5,6 +5,7 @@ import { runInstall } from './commands/install.js';
5
5
  import { runMigrate } from './commands/migrate.js';
6
6
  import { formatUpdate, runUpdate } from './commands/update.js';
7
7
  import { configureBindings, configureGates } from './commands/configure.js';
8
+ import { NotARepository } from './lib/git.js';
8
9
  import { LOCAL_DELEGATION_NOTE } from './lib/local-delegation.js';
9
10
  import { formatBindings, runConfig } from './commands/config.js';
10
11
  import { defaultsAsker, stdinAsker } from './lib/ask.js';
@@ -228,4 +229,10 @@ config
228
229
  for (const g of r.available)
229
230
  process.stdout.write(` ${g.name} ${g.cmd} (${g.from})\n`);
230
231
  });
231
- program.parseAsync(process.argv);
232
+ program.parseAsync(process.argv).catch((e) => {
233
+ if (!(e instanceof NotARepository))
234
+ throw e;
235
+ // no stack trace for a folder that is not a repository: say what to do (spec 019 ST-8)
236
+ process.stderr.write(`reins ${process.argv[2] ?? ''}: ${e.message}\n`.replace(/^reins : /, 'reins: '));
237
+ process.exit(2);
238
+ });
package/docs/README.ko.md CHANGED
@@ -8,7 +8,7 @@ BlueNyang과 Team Croffle의 저장소 열두 곳이 같은 하네스 계통을
8
8
 
9
9
  ## 상태
10
10
 
11
- **0.3.0-rc.3가 릴리스 후보입니다**(intent 019, 020): `npx @bluenyang/reins@0.3.0-rc.3`. 최신 stable인 0.2.0은 아직 이전 설계를 설치합니다. 그 설계에서는 스킬과 훅이 작업 중에 `npx @bluenyang/reins`를 불렀습니다. 0.3은 그것을 없애고, `reins update`가 0.1.x·0.2.0 설치를 옮깁니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 앞으로의 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
11
+ **0.3.0-rc.4가 릴리스 후보입니다**(intent 019, 020): `npx @bluenyang/reins@0.3.0-rc.4`. 최신 stable인 0.2.0은 아직 이전 설계를 설치합니다. 그 설계에서는 스킬과 훅이 작업 중에 `npx @bluenyang/reins`를 불렀습니다. 0.3은 그것을 없애고, `reins update`가 0.1.x·0.2.0 설치를 옮깁니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 앞으로의 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
12
12
 
13
13
  ## 동작 방식
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluenyang/reins",
3
- "version": "0.3.0-rc.3",
3
+ "version": "0.3.0",
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": {
@@ -15,10 +15,10 @@ If either still starts with `${` (unsubstituted — this copy lives in a project
15
15
  1. **Look.** Is there an `.agents/harness/` (reins installed), an `.ai/` workspace, or an older harness
16
16
  (`.claude/commands/`, many skills)? Say which.
17
17
  2. **Show the user the command** for their terminal, with the version pinned to this skill's release:
18
- - nothing installed: `npx @bluenyang/reins@0.3.0-rc.3 install --mode <mode>`
19
- - an older harness or `.ai/`: `npx @bluenyang/reins@0.3.0-rc.3 migrate --dry-run`, then without `--dry-run`
20
- - reins already installed: `npx @bluenyang/reins@0.3.0-rc.3 update`
21
- - to change models, the mode or the audit later: `npx @bluenyang/reins@0.3.0-rc.3 config` (the user can run `reins config`)
18
+ - nothing installed: `npx @bluenyang/reins@0.3.0 install --mode <mode>`
19
+ - an older harness or `.ai/`: `npx @bluenyang/reins@0.3.0 migrate --dry-run`, then without `--dry-run`
20
+ - reins already installed: `npx @bluenyang/reins@0.3.0 update`
21
+ - to change models, the mode or the audit later: `npx @bluenyang/reins@0.3.0 config` (the user can run `reins config`)
22
22
  Run it yourself only when the user asks you to, and only that command.
23
23
  3. **Explain what follows.** reins writes AGENTS.md blocks with an onboarding note; the next conversation starts
24
24
  with the `onboard` skill, which reads the project, asks the user, and writes AGENTS.md's project sections.