@ps-neko/nekowork 0.2.0-alpha.1 → 0.2.0-alpha.3

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
@@ -10,18 +10,18 @@ pushes, or deploys on its own.
10
10
 
11
11
  ## Status
12
12
 
13
- **Phase A skeleton** (2026-05-27). The 4 public verbs work via delegation to
14
- `@ps-neko/nekowork-cli` in the monorepo. To publish this package
15
- independently, the verify-pr code path needs to be moved into this package —
16
- see [HANDOFF-PACKAGE-SPLIT.md](./HANDOFF-PACKAGE-SPLIT.md).
17
-
18
- For the full alpha-stage product today, install:
13
+ **Published alpha** (`@ps-neko/nekowork`, alpha dist-tag). This package is the
14
+ published slim verification gate. Install with:
19
15
 
20
16
  ```bash
21
- npm i -g @ps-neko/nekowork-cli@alpha
17
+ npm i -g @ps-neko/nekowork
22
18
  ```
23
19
 
24
- ## Quickstart (once Phase A is complete)
20
+ The fuller legacy and power-user surface lives in the internal
21
+ `@ps-neko/nekowork-harness` package (not separately published). See
22
+ [HANDOFF-PACKAGE-SPLIT.md](./HANDOFF-PACKAGE-SPLIT.md) for the split history.
23
+
24
+ ## Quickstart
25
25
 
26
26
  ```bash
27
27
  # right after your AI tool changes some files:
@@ -39,7 +39,7 @@ whether the change is safe to merge.
39
39
  | `check` | Probe environment readiness (Node version, git repo, etc.) |
40
40
  | `verify-pr` | Scan working-tree diff. Produce REPORT.md + .nekowork/decision.json |
41
41
  | `report` | Render an existing decision.json to a human-readable REPORT.md |
42
- | `apply` | Apply a stored .diff iff decision.json says `apply_allowed: true` |
42
+ | `apply` | Session-based compatibility apply. Requires a completed work cycle (SHIP_READY marker + cleared Human Gate). NOT driven by verify-pr's decision.json. See [ADVANCED.md](../nekowork-cli/docs/ADVANCED.md). |
43
43
 
44
44
  Anything else (`ask`, `plan`, `team`, `work`, `ship`, `build`, `auto`,
45
45
  `pr-prep`, `review`, ...) belongs to `@ps-neko/nekowork-harness` (legacy and
@@ -50,9 +50,16 @@ power-user surface). The slim package rejects those verbs with a redirect.
50
50
  1. Your AI tool writes the code. `nekowork` never writes it for you.
51
51
  2. `verify-pr` runs a fixed set of risk rules over the diff — same diff, same
52
52
  verdict, every time. **No LLM gets to "vote" the result.**
53
- 3. It saves the evidence into a `REPORT.md` you can read.
53
+ 3. It saves the evidence into a `REPORT.md` you can read, and writes
54
+ `.nekowork/decision.json` with informational verdict fields (`merge_allowed`,
55
+ `apply_allowed`). **verify-pr itself does not apply changes.**
54
56
  4. You decide at the Human Gate — approve, or don't.
55
- 5. Only then can `apply` apply the diff. No auto-commit. No auto-push.
57
+
58
+ > verify-pr itself does not apply changes. Session-based apply is part of the
59
+ > compatibility workflow and requires SHIP_READY and a cleared Human Gate.
60
+
61
+ No auto-commit. No auto-push. `apply` is a separate, session-based compatibility
62
+ step — it is not triggered by `decision.json`.
56
63
 
57
64
  ## Docs
58
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ps-neko/nekowork",
3
- "version": "0.2.0-alpha.1",
3
+ "version": "0.2.0-alpha.3",
4
4
  "description": "Local verification gate for AI-written code diffs. Deterministic rules decide the verdict, never the LLM. No auto-commit, push, or deploy — you decide at the Human Gate.",
5
5
  "keywords": [
6
6
  "ai-code-review",
package/scripts/cli.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // All 4 public verbs run LOCALLY in this package. No delegation to any other package.
5
5
  //
6
6
  // Public verbs: check, verify-pr, report, apply
7
- // Anything else → error with hint to install @ps-neko/nekowork-harness.
7
+ // Anything else → error: harness verbs live in the internal (unpublished) @ps-neko/nekowork-harness; use a source checkout.
8
8
 
9
9
  import fs from 'node:fs';
10
10
  import path from 'node:path';
@@ -25,14 +25,7 @@ const META_FLAGS = new Set(['--version', '-v', '--help', '-h']);
25
25
  const args = process.argv.slice(2);
26
26
  const verb = args[0];
27
27
 
28
- if (args.length === 0 || META_FLAGS.has(verb)) {
29
- if (verb === '--version' || verb === '-v') {
30
- const pkgPath = path.resolve(__dirname, '..', 'package.json');
31
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
32
- console.log(pkg.version);
33
- process.exit(0);
34
- }
35
- console.log(`@ps-neko/nekowork — local verification gate for AI-written code
28
+ const USAGE = `@ps-neko/nekowork local verification gate for AI-written code
36
29
 
37
30
  Usage:
38
31
  nekowork check Probe environment readiness
@@ -52,13 +45,23 @@ verify-pr options:
52
45
  --no-write don't write REPORT.md / decision.json
53
46
 
54
47
  Need legacy / harness commands (ask / plan / team / work / ship / build / auto / ...)?
55
- npm i -g @ps-neko/nekowork-harness
56
- nekowork-harness <verb>
48
+ They live in the internal @ps-neko/nekowork-harness runtime, which is NOT
49
+ published to npm. Run them from a source checkout:
50
+ https://github.com/Ps-Neko/NEKOWORK
57
51
 
58
52
  Docs:
59
53
  https://github.com/Ps-Neko/NEKOWORK/blob/main/packages/nekowork-cli/docs/QUICKSTART.md
60
54
  https://github.com/Ps-Neko/NEKOWORK/blob/main/packages/nekowork-cli/docs/SCOPE-1.0.md
61
- https://github.com/Ps-Neko/NEKOWORK/blob/main/packages/nekowork-cli/docs/BENCHMARK.md`);
55
+ https://github.com/Ps-Neko/NEKOWORK/blob/main/packages/nekowork-cli/docs/BENCHMARK.md`;
56
+
57
+ if (args.length === 0 || META_FLAGS.has(verb)) {
58
+ if (verb === '--version' || verb === '-v') {
59
+ const pkgPath = path.resolve(__dirname, '..', 'package.json');
60
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
61
+ console.log(pkg.version);
62
+ process.exit(0);
63
+ }
64
+ console.log(USAGE);
62
65
  process.exit(0);
63
66
  }
64
67
 
@@ -70,13 +73,18 @@ if (VERBS_INTERNAL.has(verb)) {
70
73
  The slim @ps-neko/nekowork supports:
71
74
  check, verify-pr, report, apply
72
75
 
73
- For \`${verb}\` (a harness command), install @ps-neko/nekowork-harness:
74
- npm i -g @ps-neko/nekowork-harness
75
- nekowork-harness ${verb} ${args.slice(1).join(' ')}`);
76
+ \`${verb}\` is a harness command. The harness runtime (@ps-neko/nekowork-harness)
77
+ is internal and NOT published to npm run harness verbs from a source checkout:
78
+ https://github.com/Ps-Neko/NEKOWORK`);
76
79
  process.exit(1);
77
80
  }
78
81
 
79
82
  async function runInternal(verb, rest) {
83
+ if (rest.includes('--help') || rest.includes('-h')) {
84
+ console.log(USAGE);
85
+ process.exit(0);
86
+ }
87
+
80
88
  if (verb === 'check') {
81
89
  const { spawnSync } = await import('node:child_process');
82
90
  const r = spawnSync(process.execPath, [path.resolve(__dirname, 'check.js'), ...rest], { stdio: 'inherit' });
@@ -208,7 +208,7 @@ export function getGitDiff(opts = {}) {
208
208
  if (ls.status !== 0) {
209
209
  throw new Error(`git ls-files exited ${ls.status}: ${ls.stderr || ''}`);
210
210
  }
211
- const tracked = (ls.stdout || '').split('\n').map(s => s.trim()).filter(Boolean);
211
+ const tracked = (ls.stdout || '').split('\n').map(s => s.trim()).filter(Boolean).filter(p => !isSelfOutput(p));
212
212
  let stdout = synthesizeFilesAsDiff(cwd, tracked);
213
213
  if (includeUntracked) stdout += synthesizeUntrackedDiff(cwd);
214
214
  return parseDiff(appendIncluded(stdout));
@@ -248,10 +248,20 @@ export function getGitDiff(opts = {}) {
248
248
  return parseDiff(appendIncluded(stdout));
249
249
  }
250
250
 
251
+ /**
252
+ * verify-pr writes its own output to `REPORT.md` and `.nekowork/**`. Those are
253
+ * the tool's product, not "changes to verify" — scanning them would re-flag the
254
+ * secret/risk text stored in its own evidence on the next run (self-
255
+ * contamination). Exclude them from every synthesized diff.
256
+ */
257
+ function isSelfOutput(relPath) {
258
+ return relPath === 'REPORT.md' || relPath.startsWith('.nekowork/');
259
+ }
260
+
251
261
  function synthesizeUntrackedDiff(cwd) {
252
262
  const ls = spawnSync('git', ['ls-files', '--others', '--exclude-standard'], { cwd, encoding: 'utf8', windowsHide: true });
253
263
  if (ls.status !== 0 || !ls.stdout) return '';
254
- const files = ls.stdout.split('\n').map(s => s.trim()).filter(Boolean);
264
+ const files = ls.stdout.split('\n').map(s => s.trim()).filter(Boolean).filter(p => !isSelfOutput(p));
255
265
  return synthesizeFilesAsDiff(cwd, files);
256
266
  }
257
267
 
@@ -441,7 +441,7 @@ export function parseVerifyPrArgs(rest = []) {
441
441
  else if (a === '--no-write') opts.write = false;
442
442
  else if (a === '--comment-file') { opts.commentFile = nextArg(rest, ++i, '--comment-file'); }
443
443
  else if (a === '--ci-exit-soft') opts.ciExitSoft = true;
444
- else if (a === '--run-checks') process.stderr.write('warning: --run-checks is not supported in the slim @ps-neko/nekowork gate; install @ps-neko/nekowork-harness for this feature\n');
444
+ else if (a === '--run-checks') process.stderr.write('warning: --run-checks is not supported in the slim @ps-neko/nekowork gate; use the @ps-neko/nekowork-harness runtime from a source checkout for this feature\n');
445
445
  else if (a === '--include') { (opts.includePaths = opts.includePaths || []).push(nextArg(rest, ++i, '--include')); }
446
446
  }
447
447
  return opts;