@sentropic/harness 0.1.0 → 0.2.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 +32 -11
- package/dist/artifacts/work-event.d.ts +28 -0
- package/dist/artifacts/work-event.d.ts.map +1 -0
- package/dist/artifacts/work-event.js +9 -0
- package/dist/artifacts/work-event.js.map +1 -0
- package/dist/branch-md/parse.d.ts.map +1 -1
- package/dist/branch-md/parse.js +7 -2
- package/dist/branch-md/parse.js.map +1 -1
- package/dist/cli/args.d.ts +10 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +32 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/mechanical-verbs.d.ts +9 -0
- package/dist/cli/mechanical-verbs.d.ts.map +1 -0
- package/dist/cli/mechanical-verbs.js +124 -0
- package/dist/cli/mechanical-verbs.js.map +1 -0
- package/dist/cli/method-verbs.d.ts +14 -0
- package/dist/cli/method-verbs.d.ts.map +1 -0
- package/dist/cli/method-verbs.js +170 -0
- package/dist/cli/method-verbs.js.map +1 -0
- package/dist/cli/run.d.ts +4 -3
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +51 -66
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/scope.d.ts +12 -0
- package/dist/cli/scope.d.ts.map +1 -0
- package/dist/cli/scope.js +31 -0
- package/dist/cli/scope.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/run/work-event.d.ts +25 -0
- package/dist/run/work-event.d.ts.map +1 -0
- package/dist/run/work-event.js +27 -0
- package/dist/run/work-event.js.map +1 -0
- package/dist/skills/manifest.d.ts +14 -0
- package/dist/skills/manifest.d.ts.map +1 -0
- package/dist/skills/manifest.js +25 -0
- package/dist/skills/manifest.js.map +1 -0
- package/package.json +4 -3
- package/skills/adopt/SKILL.md +32 -0
- package/skills/brainstorm/SKILL.md +39 -0
- package/skills/debug/SKILL.md +33 -0
- package/skills/plan/SKILL.md +35 -0
- package/skills/review/SKILL.md +33 -0
- package/skills/test/SKILL.md +44 -0
- package/skills/using-harness/SKILL.md +46 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @sentropic/harness
|
|
2
2
|
|
|
3
|
-
Neutral, host-agnostic **code-work / PR-workflow** tooling for AI-driven development:
|
|
4
|
-
branch
|
|
3
|
+
Neutral, host-agnostic **code-work / PR-workflow** tooling for AI-driven development: a homogeneous
|
|
4
|
+
`harness <verb>` method layer (branch · scope · verify · test · debug · review · brainstorm · plan)
|
|
5
|
+
behind a pluggable **profile** SPI. The NATIVE sentropic replacement for superpowers.
|
|
5
6
|
|
|
6
7
|
- **Tooling-only**: zero product-runtime coupling (no Drizzle / Hono / Svelte / Mistral),
|
|
7
8
|
zero `@sentropic/*` deps. Node built-ins + TypeScript only.
|
|
@@ -31,14 +32,34 @@ harness check branch --current-branch "$(git branch --show-current)" --expected-
|
|
|
31
32
|
harness check scope --branch-md BRANCH.md --staged-files "$(git diff --cached --name-only | paste -sd,)" [--json]
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
`--json` emits a neutral
|
|
35
|
-
|
|
36
|
-
unstaged scope check; agents (Claude/Codex/Gemini) are told to use harness — not a generic
|
|
37
|
-
verification skill — for branch/scope discipline (see `AGENTS.md`/`GEMINI.md`).
|
|
35
|
+
`--json` emits a neutral artifact. `--profile sentropic|stub` selects the policy pack (default
|
|
36
|
+
`sentropic`). In an `@sentropic` repo, `make scope-check` wraps the staged+unstaged scope check.
|
|
38
37
|
|
|
39
|
-
##
|
|
40
|
-
`BRANCH.md` parser · `ScopeBoundary` · **C1** branch-check · **C2** scope-check (advisory,
|
|
41
|
-
BR25 **D5** Layer A) · neutral `VerificationRun`.
|
|
38
|
+
## Verbs
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
`harness <verb> [<subject>] [--<option>]`, homogeneous with the sibling CLIs (`stp harness <verb>`):
|
|
41
|
+
|
|
42
|
+
| Verb | Kind | Emits | Reasoning |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| `check scope\|branch` | producer | `VerificationRun` | — |
|
|
45
|
+
| `verify --category <c>` | producer | `VerificationRun` (roll-up) | — |
|
|
46
|
+
| `init` / `audit` | producer | profile descriptor / `VerificationRun` | skill `harness/adopt` |
|
|
47
|
+
| `brainstorm [--peers] [--ladder]` | recorder | `WorkEvent` | skill `harness/brainstorm` |
|
|
48
|
+
| `test [--category]` | recorder | `WorkEvent` | skill `harness/test` |
|
|
49
|
+
| `debug` | recorder | `WorkEvent` | skill `harness/debug` |
|
|
50
|
+
| `review --consensus [--peers]` | recorder | `WorkEvent` | skill `harness/review` |
|
|
51
|
+
| `plan [--lots]` | recorder | `WorkEvent` | skill `harness/plan` |
|
|
52
|
+
| `branch init\|close` | recorder | `WorkEvent` | — |
|
|
53
|
+
| `skills install --host <h>` | recorder | `WorkEvent` | installs the pack |
|
|
54
|
+
|
|
55
|
+
**Producers** compute a pass/fail verdict; **recorders** scaffold + record a narrative `WorkEvent` and
|
|
56
|
+
point to a `harness/*` skill that carries the LLM reasoning (the binary never does the thinking).
|
|
57
|
+
|
|
58
|
+
## Skill pack (superpowers replacement)
|
|
59
|
+
|
|
60
|
+
`harness skills install --host claude|codex|gemini` installs `harness/{using-harness,brainstorm,test,
|
|
61
|
+
debug,review,plan,adopt}`. `harness/using-harness` loads first and **supersedes** the superpowers skills
|
|
62
|
+
for those acts. superpowers is never a dependency; the user may opt to keep it per repo.
|
|
63
|
+
|
|
64
|
+
See `BRANCH.md` (branch root) for the lot plan and the design specs
|
|
65
|
+
(`SPEC_DECISION_SCOPE_OWNERSHIP_HARNESS_TRACK_STP.md`, `SPEC_STUDY_HARNESS_WORKFLOW_ARTICULATION.md`).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type WorkEventVerb = 'brainstorm' | 'debug' | 'review' | 'plan' | 'branch' | 'test' | 'skills';
|
|
2
|
+
export type WorkEventStatus = 'opened' | 'closed' | 'requested' | 'recorded';
|
|
3
|
+
/** A neutral detail value — primitives or string lists only (JSON-stable, ingester-friendly). */
|
|
4
|
+
export type WorkEventValue = string | number | boolean | string[];
|
|
5
|
+
export interface WorkEvent {
|
|
6
|
+
schemaVersion: 1;
|
|
7
|
+
kind: 'work-event';
|
|
8
|
+
/** The harness verb that produced this event. */
|
|
9
|
+
verb: WorkEventVerb;
|
|
10
|
+
/** Lifecycle marker of the act. */
|
|
11
|
+
status: WorkEventStatus;
|
|
12
|
+
/** Free-form subject of the act (topic, symptom, target, lot, slug). */
|
|
13
|
+
subject?: string;
|
|
14
|
+
/** The `harness/*` skill the host should load for the reasoning (method verbs). */
|
|
15
|
+
skill?: string;
|
|
16
|
+
/** Opaque references (spec path, decision id, thread, BRANCH.md path). */
|
|
17
|
+
refs: Record<string, string>;
|
|
18
|
+
/** Structured neutral detail bag (peers, category, host, recipe steps). */
|
|
19
|
+
detail: Record<string, WorkEventValue>;
|
|
20
|
+
runId: string;
|
|
21
|
+
commit: string;
|
|
22
|
+
branch: string;
|
|
23
|
+
env: string;
|
|
24
|
+
runner: string;
|
|
25
|
+
/** ISO-8601 timestamp. */
|
|
26
|
+
at: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=work-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-event.d.ts","sourceRoot":"","sources":["../../src/artifacts/work-event.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE7E,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC;AAElE,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,CAAC,CAAC;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,iDAAiD;IACjD,IAAI,EAAE,aAAa,CAAC;IACpB,mCAAmC;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Neutral work-event emitted by harness method/branch verbs.
|
|
2
|
+
//
|
|
3
|
+
// `WorkEvent` is the host-agnostic JSON a NON-pass/fail act produces — `brainstorm`, `debug`,
|
|
4
|
+
// `review`, `plan`, `branch`, `test`, `skills`. harness EMITS it and never writes into
|
|
5
|
+
// `@sentropic/track`; a track-side adapter ingests it (the same emit-only seam as
|
|
6
|
+
// `VerificationRun`). It records the NARRATIVE of an act (a session opened/closed, a request),
|
|
7
|
+
// NOT a verification verdict — cognition is not shoehorned into the verification taxonomy.
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=work-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-event.js","sourceRoot":"","sources":["../../src/artifacts/work-event.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,8FAA8F;AAC9F,uFAAuF;AACvF,kFAAkF;AAClF,+FAA+F;AAC/F,2FAA2F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/branch-md/parse.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAWD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/branch-md/parse.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAWD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CA4F1D"}
|
package/dist/branch-md/parse.js
CHANGED
|
@@ -47,12 +47,17 @@ export function parseBranchMd(text) {
|
|
|
47
47
|
currentLot = null;
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
// Prefix-match the bucket headings: the canonical BRANCH_TEMPLATE.md carries a
|
|
51
|
+
// parenthetical suffix (e.g. `**Allowed Paths (implementation scope)**`), so the
|
|
52
|
+
// closing `**` is NOT adjacent to "Paths". Match the prefix only (as Conditional
|
|
53
|
+
// already did) — otherwise Allowed/Forbidden silently parse to empty on every
|
|
54
|
+
// real BRANCH.md and in-scope files wrongly classify as `unknown`.
|
|
55
|
+
if (/\*\*Allowed Paths/i.test(line)) {
|
|
51
56
|
bucket = 'allowed';
|
|
52
57
|
pushBucket(backtickGlobs(line));
|
|
53
58
|
continue;
|
|
54
59
|
}
|
|
55
|
-
if (/\*\*Forbidden Paths
|
|
60
|
+
if (/\*\*Forbidden Paths/i.test(line)) {
|
|
56
61
|
bucket = 'forbidden';
|
|
57
62
|
pushBucket(backtickGlobs(line));
|
|
58
63
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/branch-md/parse.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,4FAA4F;AAC5F,8DAA8D;AAsB9D,MAAM,QAAQ,GAAG,YAAY,CAAC;AAC9B,MAAM,SAAS,GAAG,wBAAwB,CAAC;AAE3C,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAA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CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type FlagValue = string | boolean;
|
|
2
|
+
export interface ParsedArgs {
|
|
3
|
+
positionals: string[];
|
|
4
|
+
flags: Record<string, FlagValue>;
|
|
5
|
+
}
|
|
6
|
+
/** Split argv into positionals and `--key [value]` flags (a bare `--key` is boolean true). */
|
|
7
|
+
export declare function parseFlags(args: string[]): ParsedArgs;
|
|
8
|
+
export declare function str(v: FlagValue | undefined): string | undefined;
|
|
9
|
+
export declare function list(v: FlagValue | undefined): string[];
|
|
10
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAmBrD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEhE;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,CAGvD"}
|
package/dist/cli/args.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Shared, pure argv helpers for the harness CLI driver.
|
|
2
|
+
/** Split argv into positionals and `--key [value]` flags (a bare `--key` is boolean true). */
|
|
3
|
+
export function parseFlags(args) {
|
|
4
|
+
const positionals = [];
|
|
5
|
+
const flags = {};
|
|
6
|
+
for (let i = 0; i < args.length; i++) {
|
|
7
|
+
const a = args[i];
|
|
8
|
+
if (a.startsWith('--')) {
|
|
9
|
+
const key = a.slice(2);
|
|
10
|
+
const next = args[i + 1];
|
|
11
|
+
if (next === undefined || next.startsWith('--')) {
|
|
12
|
+
flags[key] = true;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
flags[key] = next;
|
|
16
|
+
i++;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
positionals.push(a);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { positionals, flags };
|
|
24
|
+
}
|
|
25
|
+
export function str(v) {
|
|
26
|
+
return typeof v === 'string' ? v : undefined;
|
|
27
|
+
}
|
|
28
|
+
export function list(v) {
|
|
29
|
+
const s = str(v);
|
|
30
|
+
return s ? s.split(/[\s,]+/).filter(Boolean) : [];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,wDAAwD;AASxD,8FAA8F;AAC9F,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,KAAK,GAA8B,EAAE,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACzB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChD,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBAClB,CAAC,EAAE,CAAC;YACN,CAAC;QACH,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,CAAwB;IAC1C,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,CAAwB;IAC3C,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FlagValue } from './args.js';
|
|
2
|
+
export declare const MECHANICAL_VERBS: readonly ["verify", "init", "audit"];
|
|
3
|
+
export type MechanicalVerb = (typeof MECHANICAL_VERBS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Handle a mechanical/producer verb. Returns the exit code (`null` when `verb` is not one of
|
|
6
|
+
* `verify`/`init`/`audit`). Emits a `VerificationRun` (`--json`) or a human summary via `out`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleMechanicalVerb(positionals: string[], flags: Record<string, FlagValue>, out: (s: string) => void): number | null;
|
|
9
|
+
//# sourceMappingURL=mechanical-verbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mechanical-verbs.d.ts","sourceRoot":"","sources":["../../src/cli/mechanical-verbs.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,gBAAgB,sCAAuC,CAAC;AACrE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAuE/D;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EAAE,EACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACvB,MAAM,GAAG,IAAI,CA+Cf"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Mechanical / producer verbs of the harness CLI.
|
|
2
|
+
//
|
|
3
|
+
// Unlike the method verbs (which record a WorkEvent), these COMPUTE a verdict and emit a neutral
|
|
4
|
+
// `VerificationRun`: `verify` is the category-level roll-up over the available static checks (the
|
|
5
|
+
// canonical VerificationRun producer); `audit` diffs the repo against the active profile; `init`
|
|
6
|
+
// scaffolds a profile descriptor so the same C1/C2 kernel can run against ANY repo. Pure: the only
|
|
7
|
+
// IO is reading the `--branch-md` file (shared with `check scope`); no git/docker/fs writes.
|
|
8
|
+
import { toVerificationRun } from '../run/emit.js';
|
|
9
|
+
import { checkBranch } from '../checks/branch-check.js';
|
|
10
|
+
import { sentropicProfile } from '../profile/sentropic.js';
|
|
11
|
+
import { stubProfile } from '../profile/stub.js';
|
|
12
|
+
import { scopeFromFlags } from './scope.js';
|
|
13
|
+
import { str } from './args.js';
|
|
14
|
+
const PLACEHOLDER_TS = '1970-01-01T00:00:00.000Z';
|
|
15
|
+
const CATEGORIES = ['none', 'static', 'unit', 'integration', 'e2e', 'ci', 'uat'];
|
|
16
|
+
export const MECHANICAL_VERBS = ['verify', 'init', 'audit'];
|
|
17
|
+
function isMechanicalVerb(v) {
|
|
18
|
+
return v !== undefined && MECHANICAL_VERBS.includes(v);
|
|
19
|
+
}
|
|
20
|
+
function isCategory(s) {
|
|
21
|
+
return CATEGORIES.includes(s);
|
|
22
|
+
}
|
|
23
|
+
function resolveProfile(flags) {
|
|
24
|
+
return str(flags.profile) === 'stub' ? stubProfile : sentropicProfile;
|
|
25
|
+
}
|
|
26
|
+
function runContext(flags, category, command) {
|
|
27
|
+
return {
|
|
28
|
+
runId: 'cli',
|
|
29
|
+
commit: str(flags.commit) ?? 'unknown',
|
|
30
|
+
branch: str(flags['current-branch']) ?? 'unknown',
|
|
31
|
+
env: str(flags.env) ?? 'cli',
|
|
32
|
+
runner: 'harness',
|
|
33
|
+
category,
|
|
34
|
+
command,
|
|
35
|
+
startedAt: PLACEHOLDER_TS,
|
|
36
|
+
finishedAt: PLACEHOLDER_TS,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Gather the static checks computable from supplied flags (C2 scope, C1 branch). */
|
|
40
|
+
function staticChecks(flags, profile, out) {
|
|
41
|
+
const checks = [];
|
|
42
|
+
if (flags['staged-files'] !== undefined || flags['branch-md'] !== undefined) {
|
|
43
|
+
const outcome = scopeFromFlags(flags, profile);
|
|
44
|
+
if (outcome.unreadable !== undefined) {
|
|
45
|
+
out(`harness: cannot read plan file: ${outcome.unreadable}`);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (outcome.result)
|
|
49
|
+
checks.push({ code: 'C2', category: 'static', result: outcome.result });
|
|
50
|
+
}
|
|
51
|
+
if (flags['current-branch'] !== undefined || flags['expected-branch'] !== undefined) {
|
|
52
|
+
const result = checkBranch({
|
|
53
|
+
currentBranch: str(flags['current-branch']) ?? '',
|
|
54
|
+
expectedBranch: str(flags['expected-branch']) ?? '',
|
|
55
|
+
profile,
|
|
56
|
+
});
|
|
57
|
+
checks.push({ code: 'C1', category: 'static', result });
|
|
58
|
+
}
|
|
59
|
+
return checks;
|
|
60
|
+
}
|
|
61
|
+
function emitRun(checks, flags, category, command, out) {
|
|
62
|
+
const run = toVerificationRun(checks, runContext(flags, category, command));
|
|
63
|
+
if (flags.json === true) {
|
|
64
|
+
out(JSON.stringify(run, null, 2));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
out(`${run.result === 'pass' ? 'PASS' : 'FAIL'} ${command} (${category}): ${checks.length} check(s)`);
|
|
68
|
+
for (const v of run.violations)
|
|
69
|
+
out(` - ${v.severity}: ${v.message}`);
|
|
70
|
+
}
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Handle a mechanical/producer verb. Returns the exit code (`null` when `verb` is not one of
|
|
75
|
+
* `verify`/`init`/`audit`). Emits a `VerificationRun` (`--json`) or a human summary via `out`.
|
|
76
|
+
*/
|
|
77
|
+
export function handleMechanicalVerb(positionals, flags, out) {
|
|
78
|
+
const verb = positionals[0];
|
|
79
|
+
if (!isMechanicalVerb(verb))
|
|
80
|
+
return null;
|
|
81
|
+
const profile = resolveProfile(flags);
|
|
82
|
+
if (verb === 'init') {
|
|
83
|
+
const descriptor = {
|
|
84
|
+
id: profile.id,
|
|
85
|
+
forbiddenPathDefaults: profile.forbiddenPathDefaults,
|
|
86
|
+
exceptionIdPattern: profile.exceptionIdPattern.source,
|
|
87
|
+
conditionalRequiresException: profile.conditionalRequiresException,
|
|
88
|
+
branchMatch: profile.branchMatch,
|
|
89
|
+
};
|
|
90
|
+
if (flags.json === true) {
|
|
91
|
+
out(JSON.stringify(descriptor, null, 2));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
out(`harness init — profile '${descriptor.id}' (edit and commit as harness.profile.json):`);
|
|
95
|
+
out(` forbiddenPathDefaults: ${descriptor.forbiddenPathDefaults.join(', ') || '(none)'}`);
|
|
96
|
+
out(` exceptionIdPattern: ${descriptor.exceptionIdPattern}`);
|
|
97
|
+
out(` conditionalRequiresException: ${descriptor.conditionalRequiresException}`);
|
|
98
|
+
out(` branchMatch: ${descriptor.branchMatch}`);
|
|
99
|
+
}
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
if (verb === 'verify') {
|
|
103
|
+
const cat = str(flags.category) ?? 'static';
|
|
104
|
+
if (!isCategory(cat)) {
|
|
105
|
+
out(`usage: harness verify [--category ${CATEGORIES.join('|')}] ...`);
|
|
106
|
+
return 2;
|
|
107
|
+
}
|
|
108
|
+
const checks = staticChecks(flags, profile, out);
|
|
109
|
+
if (checks === null)
|
|
110
|
+
return 2;
|
|
111
|
+
return emitRun(checks, flags, cat, 'harness verify', out);
|
|
112
|
+
}
|
|
113
|
+
// verb === 'audit' — repo-vs-profile drift as a static VerificationRun.
|
|
114
|
+
const outcome = scopeFromFlags(flags, profile);
|
|
115
|
+
if (outcome.unreadable !== undefined) {
|
|
116
|
+
out(`harness: cannot read plan file: ${outcome.unreadable}`);
|
|
117
|
+
return 2;
|
|
118
|
+
}
|
|
119
|
+
const checks = outcome.result
|
|
120
|
+
? [{ code: 'C2', category: 'static', result: outcome.result }]
|
|
121
|
+
: [];
|
|
122
|
+
return emitRun(checks, flags, 'static', 'harness audit', out);
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=mechanical-verbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mechanical-verbs.js","sourceRoot":"","sources":["../../src/cli/mechanical-verbs.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,iGAAiG;AACjG,kGAAkG;AAClG,iGAAiG;AACjG,mGAAmG;AACnG,6FAA6F;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAkB,MAAM,WA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AC,CAAC,EAAE,CAAC;IACP,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WorkEventContext } from '../run/work-event.js';
|
|
2
|
+
import { type FlagValue } from './args.js';
|
|
3
|
+
/** The recorder verbs handled here (not the `check`/`verify`/`init`/`audit` producers). */
|
|
4
|
+
export declare const METHOD_VERBS: readonly ["brainstorm", "debug", "review", "plan", "test", "branch", "skills"];
|
|
5
|
+
export type MethodVerb = (typeof METHOD_VERBS)[number];
|
|
6
|
+
export declare function isMethodVerb(v: string | undefined): v is MethodVerb;
|
|
7
|
+
/** Pure work-event context — the caller injects commit/branch/env; the driver passes placeholders. */
|
|
8
|
+
export declare function workContext(flags: Record<string, FlagValue>): WorkEventContext;
|
|
9
|
+
/**
|
|
10
|
+
* Handle a method/recorder verb. Returns the exit code; emits a `WorkEvent` (JSON with `--json`)
|
|
11
|
+
* or human-readable guidance via `out`. `null` is returned when `verb` is not a method verb.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleMethodVerb(positionals: string[], flags: Record<string, FlagValue>, out: (s: string) => void): number | null;
|
|
14
|
+
//# sourceMappingURL=method-verbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-verbs.d.ts","sourceRoot":"","sources":["../../src/cli/method-verbs.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAIhD,2FAA2F;AAC3F,eAAO,MAAM,YAAY,gFAAiF,CAAC;AAC3G,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,IAAI,UAAU,CAEnE;AAED,sGAAsG;AACtG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAgB,CAS9E;AAoID;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EAAE,EACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACvB,MAAM,GAAG,IAAI,CAgBf"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Method / recorder verbs of the harness CLI.
|
|
2
|
+
//
|
|
3
|
+
// These verbs do NOT compute a pass/fail verdict — they record a neutral `WorkEvent` and print
|
|
4
|
+
// guidance + the `harness/*` skill pointer that carries the LLM reasoning. They stay PURE: no
|
|
5
|
+
// git/docker/fs side-effects (a worktree, a test run, a skills copy are make/host recipes the
|
|
6
|
+
// verb PRINTS, never performs). The reasoning lives in the skill; the binary only scaffolds +
|
|
7
|
+
// records (see SPEC_DECISION_SCOPE_OWNERSHIP_HARNESS_TRACK_STP.md).
|
|
8
|
+
import { toWorkEvent } from '../run/work-event.js';
|
|
9
|
+
import { HARNESS_SKILLS, HOST_SKILL_DIR, isHostId } from '../skills/manifest.js';
|
|
10
|
+
import { str } from './args.js';
|
|
11
|
+
const PLACEHOLDER_TS = '1970-01-01T00:00:00.000Z';
|
|
12
|
+
/** The recorder verbs handled here (not the `check`/`verify`/`init`/`audit` producers). */
|
|
13
|
+
export const METHOD_VERBS = ['brainstorm', 'debug', 'review', 'plan', 'test', 'branch', 'skills'];
|
|
14
|
+
export function isMethodVerb(v) {
|
|
15
|
+
return v !== undefined && METHOD_VERBS.includes(v);
|
|
16
|
+
}
|
|
17
|
+
/** Pure work-event context — the caller injects commit/branch/env; the driver passes placeholders. */
|
|
18
|
+
export function workContext(flags) {
|
|
19
|
+
return {
|
|
20
|
+
runId: 'cli',
|
|
21
|
+
commit: str(flags.commit) ?? 'unknown',
|
|
22
|
+
branch: str(flags['current-branch']) ?? 'unknown',
|
|
23
|
+
env: str(flags.env) ?? 'cli',
|
|
24
|
+
runner: 'harness',
|
|
25
|
+
at: PLACEHOLDER_TS,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function num(v) {
|
|
29
|
+
const s = str(v);
|
|
30
|
+
if (s === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const n = Number(s);
|
|
33
|
+
return Number.isFinite(n) ? n : undefined;
|
|
34
|
+
}
|
|
35
|
+
function prune(detail) {
|
|
36
|
+
const out = {};
|
|
37
|
+
for (const [k, v] of Object.entries(detail))
|
|
38
|
+
if (v !== undefined)
|
|
39
|
+
out[k] = v;
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
function header(verb, status, skill) {
|
|
43
|
+
return `harness ${verb} — ${status}${skill ? ` (skill: ${skill})` : ''}`;
|
|
44
|
+
}
|
|
45
|
+
function build(verb, positionals, flags) {
|
|
46
|
+
const subject = positionals[1];
|
|
47
|
+
switch (verb) {
|
|
48
|
+
case 'brainstorm': {
|
|
49
|
+
const detail = prune({ peers: num(flags.peers), ladder: str(flags.ladder) });
|
|
50
|
+
return {
|
|
51
|
+
input: { verb, status: 'opened', subject, skill: 'harness/brainstorm', detail },
|
|
52
|
+
lines: [
|
|
53
|
+
header('brainstorm', 'opened', 'harness/brainstorm'),
|
|
54
|
+
' load harness/brainstorm: spec-ladder STUDY→VOL→EVOL, ≥2-peer adversarial review, batched decisions.',
|
|
55
|
+
],
|
|
56
|
+
code: 0,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
case 'debug': {
|
|
60
|
+
return {
|
|
61
|
+
input: { verb, status: 'opened', subject, skill: 'harness/debug', detail: {} },
|
|
62
|
+
lines: [
|
|
63
|
+
header('debug', 'opened', 'harness/debug'),
|
|
64
|
+
' load harness/debug: reproduce → evidence → one hypothesis → one fix → re-observe → regression test.',
|
|
65
|
+
],
|
|
66
|
+
code: 0,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
case 'review': {
|
|
70
|
+
const consensus = flags.consensus === true;
|
|
71
|
+
const detail = prune({ consensus, peers: num(flags.peers) ?? (consensus ? 2 : undefined) });
|
|
72
|
+
return {
|
|
73
|
+
input: { verb, status: 'requested', subject, skill: 'harness/review', detail },
|
|
74
|
+
lines: [
|
|
75
|
+
header('review', 'requested', 'harness/review'),
|
|
76
|
+
consensus
|
|
77
|
+
? ' load harness/review: ≥2 independent peers, distinct lenses, reconcile findings.'
|
|
78
|
+
: ' load harness/review (single pass; add --consensus for ≥2-peer reconciliation).',
|
|
79
|
+
],
|
|
80
|
+
code: 0,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case 'plan': {
|
|
84
|
+
const detail = prune({ lots: num(flags.lots) });
|
|
85
|
+
return {
|
|
86
|
+
input: { verb, status: 'opened', subject, skill: 'harness/plan', detail },
|
|
87
|
+
lines: [
|
|
88
|
+
header('plan', 'opened', 'harness/plan'),
|
|
89
|
+
' load harness/plan: spec-ladder + BRANCH.md lots; harness writes BRANCH.md, then `track branch import`.',
|
|
90
|
+
],
|
|
91
|
+
code: 0,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
case 'test': {
|
|
95
|
+
const detail = prune({ category: str(flags.category), watch: flags.watch === true });
|
|
96
|
+
return {
|
|
97
|
+
input: { verb, status: 'requested', subject, skill: 'harness/test', detail },
|
|
98
|
+
lines: [
|
|
99
|
+
header('test', 'requested', 'harness/test'),
|
|
100
|
+
' load harness/test: test-pyramid + scoped loop; run `make test-<area> SCOPE=… ENV=test-<slug>`.',
|
|
101
|
+
],
|
|
102
|
+
code: 0,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
case 'branch': {
|
|
106
|
+
const sub = positionals[1];
|
|
107
|
+
if (sub !== 'init' && sub !== 'close') {
|
|
108
|
+
return { lines: ['usage: harness branch <init|close> [<slug>]'], code: 2 };
|
|
109
|
+
}
|
|
110
|
+
const slug = positionals[2];
|
|
111
|
+
const status = sub === 'init' ? 'opened' : 'closed';
|
|
112
|
+
const recipe = sub === 'init'
|
|
113
|
+
? ' recipe: git worktree add -b feat/<slug> tmp/<slug> origin/main; scaffold BRANCH.md from plan/BRANCH_TEMPLATE.md.'
|
|
114
|
+
: ' recipe: run the lot-gate roll-up, scope-check staged files, then open/refresh the PR from BRANCH.md.';
|
|
115
|
+
return {
|
|
116
|
+
input: { verb, status, subject: slug, detail: { sub } },
|
|
117
|
+
lines: [header(`branch ${sub}`, status), recipe],
|
|
118
|
+
code: 0,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
case 'skills': {
|
|
122
|
+
const sub = positionals[1];
|
|
123
|
+
const host = str(flags.host);
|
|
124
|
+
if (sub !== 'install' || !isHostId(host)) {
|
|
125
|
+
return { lines: ['usage: harness skills install --host <claude|codex|gemini>'], code: 2 };
|
|
126
|
+
}
|
|
127
|
+
const dir = HOST_SKILL_DIR[host];
|
|
128
|
+
const lines = [
|
|
129
|
+
header('skills install', 'requested', 'harness/using-harness'),
|
|
130
|
+
` install plan → ${dir} (host: ${host}); harness/using-harness supersedes superpowers:`,
|
|
131
|
+
...HARNESS_SKILLS.map((s) => ` ${dir}/harness-${s.name}/SKILL.md${s.supersedes ? ` (supersedes superpowers:${s.supersedes})` : ''}`),
|
|
132
|
+
];
|
|
133
|
+
return {
|
|
134
|
+
input: {
|
|
135
|
+
verb,
|
|
136
|
+
status: 'requested',
|
|
137
|
+
subject: 'install',
|
|
138
|
+
skill: 'harness/using-harness',
|
|
139
|
+
detail: { host, dir, skills: HARNESS_SKILLS.map((s) => s.name) },
|
|
140
|
+
},
|
|
141
|
+
lines,
|
|
142
|
+
code: 0,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Handle a method/recorder verb. Returns the exit code; emits a `WorkEvent` (JSON with `--json`)
|
|
149
|
+
* or human-readable guidance via `out`. `null` is returned when `verb` is not a method verb.
|
|
150
|
+
*/
|
|
151
|
+
export function handleMethodVerb(positionals, flags, out) {
|
|
152
|
+
const verb = positionals[0];
|
|
153
|
+
if (!isMethodVerb(verb))
|
|
154
|
+
return null;
|
|
155
|
+
const built = build(verb, positionals, flags);
|
|
156
|
+
if (built.code !== 0 || !built.input) {
|
|
157
|
+
for (const l of built.lines)
|
|
158
|
+
out(l);
|
|
159
|
+
return built.code;
|
|
160
|
+
}
|
|
161
|
+
if (flags.json === true) {
|
|
162
|
+
out(JSON.stringify(toWorkEvent(built.input, workContext(flags)), null, 2));
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
for (const l of built.lines)
|
|
166
|
+
out(l);
|
|
167
|
+
}
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=method-verbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-verbs.js","sourceRoot":"","sources":["../../src/cli/method-verbs.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,8FAA8F;AAC9F,oEAAoE;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,GAAG,EAAkB,MAAM,WAAW,CAAC;AAEhD,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAElD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3G,MAAM,UAAU,YAAY,CAAC,CAAqB;IAChD,OAAO,CAAC,KAAK,SAAS,IAAK,YAAkC,CAAC,QAAQ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IAC7E,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK;YAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cli/run.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure, arg-based CLI driver — reads everything from `argv`, writes via `out`, returns an exit code.
|
|
3
|
-
* No internal git calls (the caller supplies branch + staged files), no `process.exit
|
|
3
|
+
* No internal git calls (the caller supplies branch + staged files), no `process.exit`, no fs writes.
|
|
4
4
|
* Advisory (D5 Layer A): a failing check returns 0; only a usage error returns non-zero.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Verb families: `check` (C1/C2 → VerificationRun); method/recorder verbs (brainstorm/test/debug/
|
|
7
|
+
* review/plan/branch/skills → WorkEvent + skill pointer, see `method-verbs.ts`).
|
|
7
8
|
*/
|
|
8
9
|
export declare function runHarnessCli(argv: string[], out: (s: string) => void): number;
|
|
9
10
|
//# sourceMappingURL=run.d.ts.map
|
package/dist/cli/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAuFA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,CAgB9E"}
|