@sentropic/h2a 0.83.0 → 0.85.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/dist/bin.js +18 -1
- package/dist/bin.js.map +1 -1
- package/dist/cli-contract.d.ts.map +1 -1
- package/dist/cli-contract.js +10 -1
- package/dist/cli-contract.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +206 -25
- package/dist/cli.js.map +1 -1
- package/dist/vendor/harness/artifacts/validate-verification-run.d.ts +18 -0
- package/dist/vendor/harness/artifacts/validate-verification-run.d.ts.map +1 -0
- package/dist/vendor/harness/artifacts/validate-verification-run.js +160 -0
- package/dist/vendor/harness/artifacts/validate-verification-run.js.map +1 -0
- package/dist/vendor/harness/artifacts/verification-run.d.ts +2 -0
- package/dist/vendor/harness/artifacts/verification-run.d.ts.map +1 -0
- package/dist/vendor/harness/artifacts/verification-run.js +12 -0
- package/dist/vendor/harness/artifacts/verification-run.js.map +1 -0
- package/dist/vendor/harness/artifacts/work-event.d.ts +2 -0
- package/dist/vendor/harness/artifacts/work-event.d.ts.map +1 -0
- package/dist/vendor/harness/artifacts/work-event.js +9 -0
- package/dist/vendor/harness/artifacts/work-event.js.map +1 -0
- package/dist/vendor/harness/bin/harness.d.ts +3 -0
- package/dist/vendor/harness/bin/harness.d.ts.map +1 -0
- package/dist/vendor/harness/bin/harness.js +5 -0
- package/dist/vendor/harness/bin/harness.js.map +1 -0
- package/dist/vendor/harness/branch-md/parse.d.ts +9 -0
- package/dist/vendor/harness/branch-md/parse.d.ts.map +1 -0
- package/dist/vendor/harness/branch-md/parse.js +100 -0
- package/dist/vendor/harness/branch-md/parse.js.map +1 -0
- package/dist/vendor/harness/checks/branch-check.d.ts +15 -0
- package/dist/vendor/harness/checks/branch-check.d.ts.map +1 -0
- package/dist/vendor/harness/checks/branch-check.js +23 -0
- package/dist/vendor/harness/checks/branch-check.js.map +1 -0
- package/dist/vendor/harness/checks/scope-check.d.ts +22 -0
- package/dist/vendor/harness/checks/scope-check.d.ts.map +1 -0
- package/dist/vendor/harness/checks/scope-check.js +34 -0
- package/dist/vendor/harness/checks/scope-check.js.map +1 -0
- package/dist/vendor/harness/cli/args.d.ts +8 -0
- package/dist/vendor/harness/cli/args.d.ts.map +1 -0
- package/dist/vendor/harness/cli/args.js +32 -0
- package/dist/vendor/harness/cli/args.js.map +1 -0
- package/dist/vendor/harness/cli/mechanical-verbs.d.ts +7 -0
- package/dist/vendor/harness/cli/mechanical-verbs.d.ts.map +1 -0
- package/dist/vendor/harness/cli/mechanical-verbs.js +124 -0
- package/dist/vendor/harness/cli/mechanical-verbs.js.map +1 -0
- package/dist/vendor/harness/cli/method-verbs.d.ts +18 -0
- package/dist/vendor/harness/cli/method-verbs.d.ts.map +1 -0
- package/dist/vendor/harness/cli/method-verbs.js +174 -0
- package/dist/vendor/harness/cli/method-verbs.js.map +1 -0
- package/dist/vendor/harness/cli/run.d.ts +10 -0
- package/dist/vendor/harness/cli/run.d.ts.map +1 -0
- package/dist/vendor/harness/cli/run.js +101 -0
- package/dist/vendor/harness/cli/run.js.map +1 -0
- package/dist/vendor/harness/cli/scope.d.ts +9 -0
- package/dist/vendor/harness/cli/scope.d.ts.map +1 -0
- package/dist/vendor/harness/cli/scope.js +31 -0
- package/dist/vendor/harness/cli/scope.js.map +1 -0
- package/dist/vendor/harness/index.d.ts +13 -0
- package/dist/vendor/harness/index.d.ts.map +1 -0
- package/dist/vendor/harness/index.js +23 -0
- package/dist/vendor/harness/index.js.map +1 -0
- package/dist/vendor/harness/profile/profile.d.ts +2 -0
- package/dist/vendor/harness/profile/profile.d.ts.map +1 -0
- package/dist/vendor/harness/profile/profile.js +10 -0
- package/dist/vendor/harness/profile/profile.js.map +1 -0
- package/dist/vendor/harness/profile/sentropic.d.ts +8 -0
- package/dist/vendor/harness/profile/sentropic.d.ts.map +1 -0
- package/dist/vendor/harness/profile/sentropic.js +12 -0
- package/dist/vendor/harness/profile/sentropic.js.map +1 -0
- package/dist/vendor/harness/profile/stub.d.ts +8 -0
- package/dist/vendor/harness/profile/stub.d.ts.map +1 -0
- package/dist/vendor/harness/profile/stub.js +13 -0
- package/dist/vendor/harness/profile/stub.js.map +1 -0
- package/dist/vendor/harness/run/emit.d.ts +22 -0
- package/dist/vendor/harness/run/emit.d.ts.map +1 -0
- package/dist/vendor/harness/run/emit.js +32 -0
- package/dist/vendor/harness/run/emit.js.map +1 -0
- package/dist/vendor/harness/run/work-event.d.ts +20 -0
- package/dist/vendor/harness/run/work-event.d.ts.map +1 -0
- package/dist/vendor/harness/run/work-event.js +27 -0
- package/dist/vendor/harness/run/work-event.js.map +1 -0
- package/dist/vendor/harness/scope/scope-boundary.d.ts +17 -0
- package/dist/vendor/harness/scope/scope-boundary.d.ts.map +1 -0
- package/dist/vendor/harness/scope/scope-boundary.js +50 -0
- package/dist/vendor/harness/scope/scope-boundary.js.map +1 -0
- package/dist/vendor/harness/skills/manifest.d.ts +16 -0
- package/dist/vendor/harness/skills/manifest.d.ts.map +1 -0
- package/dist/vendor/harness/skills/manifest.js +25 -0
- package/dist/vendor/harness/skills/manifest.js.map +1 -0
- package/package.json +4 -3
- package/schema/harness/verification-run.schema.json +154 -0
- package/skills/harness/adopt/SKILL.md +32 -0
- package/skills/harness/brainstorm/SKILL.md +39 -0
- package/skills/harness/debug/SKILL.md +33 -0
- package/skills/harness/plan/SKILL.md +35 -0
- package/skills/harness/review/SKILL.md +33 -0
- package/skills/harness/test/SKILL.md +44 -0
- package/skills/harness/using-harness/SKILL.md +46 -0
|
@@ -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
|
+
//# sourceMappingUR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OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IACD,wEAAwE;IACxE,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,GAAG,CAAC,mCAAmC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,CAAC;IACb,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM;QACzB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QAC9D,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function isMethodVerb(v: any): boolean;
|
|
2
|
+
/** Pure work-event context — the caller injects commit/branch/env; the driver passes placeholders. */
|
|
3
|
+
export function workContext(flags: any): {
|
|
4
|
+
runId: string;
|
|
5
|
+
commit: string;
|
|
6
|
+
branch: string;
|
|
7
|
+
env: string;
|
|
8
|
+
runner: string;
|
|
9
|
+
at: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Handle a method/recorder verb. Returns the exit code; emits a `WorkEvent` (JSON with `--json`)
|
|
13
|
+
* or human-readable guidance via `out`. `null` is returned when `verb` is not a method verb.
|
|
14
|
+
*/
|
|
15
|
+
export function handleMethodVerb(positionals: any, flags: any, out: any): number | null;
|
|
16
|
+
/** The recorder verbs handled here (not the `check`/`verify`/`init`/`audit` producers). */
|
|
17
|
+
export const METHOD_VERBS: string[];
|
|
18
|
+
//# sourceMappingURL=method-verbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-verbs.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/method-verbs.js"],"names":[],"mappings":"AAaA,8CAEC;AACD,sGAAsG;AACtG;;;;;;;EASC;AA4HD;;;GAGG;AACH,wFAkBC;AAjKD,2FAA2F;AAC3F,oCAAkG"}
|
|
@@ -0,0 +1,174 @@
|
|
|
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 category = str(flags.category);
|
|
96
|
+
if (category !== undefined && category !== 'unit' && category !== 'integration' && category !== 'e2e') {
|
|
97
|
+
return { lines: ['usage: harness test [<scope>] [--category unit|integration|e2e] [--watch]'], code: 2 };
|
|
98
|
+
}
|
|
99
|
+
const detail = prune({ category, watch: flags.watch === true });
|
|
100
|
+
return {
|
|
101
|
+
input: { verb, status: 'requested', subject, skill: 'harness/test', detail },
|
|
102
|
+
lines: [
|
|
103
|
+
header('test', 'requested', 'harness/test'),
|
|
104
|
+
' load harness/test: test-pyramid + scoped loop; run `make test-<area> SCOPE=… ENV=test-<slug>`.',
|
|
105
|
+
],
|
|
106
|
+
code: 0,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
case 'branch': {
|
|
110
|
+
const sub = positionals[1];
|
|
111
|
+
if (sub !== 'init' && sub !== 'close') {
|
|
112
|
+
return { lines: ['usage: harness branch <init|close> [<slug>]'], code: 2 };
|
|
113
|
+
}
|
|
114
|
+
const slug = positionals[2];
|
|
115
|
+
const status = sub === 'init' ? 'opened' : 'closed';
|
|
116
|
+
const recipe = sub === 'init'
|
|
117
|
+
? ' recipe: git worktree add -b feat/<slug> tmp/<slug> origin/main; scaffold BRANCH.md from plan/BRANCH_TEMPLATE.md.'
|
|
118
|
+
: ' recipe: run the lot-gate roll-up, scope-check staged files, then open/refresh the PR from BRANCH.md.';
|
|
119
|
+
return {
|
|
120
|
+
input: { verb, status, subject: slug, detail: { sub } },
|
|
121
|
+
lines: [header(`branch ${sub}`, status), recipe],
|
|
122
|
+
code: 0,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
case 'skills': {
|
|
126
|
+
const sub = positionals[1];
|
|
127
|
+
const host = str(flags.host);
|
|
128
|
+
if (sub !== 'install' || !isHostId(host)) {
|
|
129
|
+
return { lines: ['usage: harness skills install --host <claude|codex|gemini>'], code: 2 };
|
|
130
|
+
}
|
|
131
|
+
const dir = HOST_SKILL_DIR[host];
|
|
132
|
+
const lines = [
|
|
133
|
+
header('skills install', 'requested', 'harness/using-harness'),
|
|
134
|
+
` install plan → ${dir} (host: ${host}); harness/using-harness supersedes superpowers:`,
|
|
135
|
+
...HARNESS_SKILLS.map((s) => ` ${dir}/harness-${s.name}/SKILL.md${s.supersedes ? ` (supersedes superpowers:${s.supersedes})` : ''}`),
|
|
136
|
+
];
|
|
137
|
+
return {
|
|
138
|
+
input: {
|
|
139
|
+
verb,
|
|
140
|
+
status: 'requested',
|
|
141
|
+
subject: 'install',
|
|
142
|
+
skill: 'harness/using-harness',
|
|
143
|
+
detail: { host, dir, skills: HARNESS_SKILLS.map((s) => s.name) },
|
|
144
|
+
},
|
|
145
|
+
lines,
|
|
146
|
+
code: 0,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Handle a method/recorder verb. Returns the exit code; emits a `WorkEvent` (JSON with `--json`)
|
|
153
|
+
* or human-readable guidance via `out`. `null` is returned when `verb` is not a method verb.
|
|
154
|
+
*/
|
|
155
|
+
export function handleMethodVerb(positionals, flags, out) {
|
|
156
|
+
const verb = positionals[0];
|
|
157
|
+
if (!isMethodVerb(verb))
|
|
158
|
+
return null;
|
|
159
|
+
const built = build(verb, positionals, flags);
|
|
160
|
+
if (built.code !== 0 || !built.input) {
|
|
161
|
+
for (const l of built.lines)
|
|
162
|
+
out(l);
|
|
163
|
+
return built.code;
|
|
164
|
+
}
|
|
165
|
+
if (flags.json === true) {
|
|
166
|
+
out(JSON.stringify(toWorkEvent(built.input, workContext(flags)), null, 2));
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
for (const l of built.lines)
|
|
170
|
+
out(l);
|
|
171
|
+
}
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=method-verbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-verbs.js","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/method-verbs.js"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,8FAA8F;AAC9F,oEAAoE;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAClG,MAAM,UAAU,YAAY,CAAC,CAAC;IAC1B,OAAO,CAA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AAC;QACX,OAAO,KAAK,CAAC,IAAI,CAAC;IACtB,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACtB,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;SACI,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK;YACvB,GAAG,CAAC,CAAC,CAAC,CAAC;IACf,CAAC;IACD,OAAO,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
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`, no fs writes.
|
|
4
|
+
* Advisory (D5 Layer A): a failing check returns 0; only a usage error returns non-zero.
|
|
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`).
|
|
8
|
+
*/
|
|
9
|
+
export function runHarnessCli(argv: any, out: any): number;
|
|
10
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/run.js"],"names":[],"mappings":"AA6EA;;;;;;;GAOG;AACH,2DAcC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { checkBranch } from '../checks/branch-check.js';
|
|
2
|
+
import { toVerificationRun } from '../run/emit.js';
|
|
3
|
+
import { sentropicProfile } from '../profile/sentropic.js';
|
|
4
|
+
import { stubProfile } from '../profile/stub.js';
|
|
5
|
+
import { parseFlags, str } from './args.js';
|
|
6
|
+
import { scopeFromFlags } from './scope.js';
|
|
7
|
+
import { handleMethodVerb } from './method-verbs.js';
|
|
8
|
+
import { handleMechanicalVerb } from './mechanical-verbs.js';
|
|
9
|
+
const USAGE = [
|
|
10
|
+
'usage: harness check <scope|branch> [--current-branch <b>] [--expected-branch <b>] ' +
|
|
11
|
+
'[--staged-files <list>] [--branch-md <path>] [--profile sentropic|stub] [--json]',
|
|
12
|
+
' harness verify [--category static|unit|integration|e2e|ci|uat] [--staged-files <list>] ' +
|
|
13
|
+
'[--current-branch <b>] [--expected-branch <b>] [--branch-md <path>] [--profile sentropic|stub] [--json]',
|
|
14
|
+
' harness init [--profile sentropic|stub] [--json]',
|
|
15
|
+
' harness audit [--staged-files <list>] [--branch-md <path>] [--profile sentropic|stub] [--json]',
|
|
16
|
+
' harness brainstorm [<topic>] [--peers <n>] [--ladder study|vol|evol] [--json]',
|
|
17
|
+
' harness test [<scope>] [--category unit|integration|e2e] [--watch] [--json]',
|
|
18
|
+
' harness debug [<symptom>] [--json]',
|
|
19
|
+
' harness review [<target>] [--consensus] [--peers <n>] [--json]',
|
|
20
|
+
' harness plan [<spec>] [--lots <n>] [--json]',
|
|
21
|
+
' harness branch <init|close> [<slug>] [--json]',
|
|
22
|
+
' harness skills install --host <claude|codex|gemini> [--json]',
|
|
23
|
+
].join('\n');
|
|
24
|
+
/** The `check scope|branch` static checks (C2/C1) — emit a neutral VerificationRun. */
|
|
25
|
+
function handleCheck(positionals, flags, out) {
|
|
26
|
+
const sub = positionals[1];
|
|
27
|
+
if (sub !== 'scope' && sub !== 'branch') {
|
|
28
|
+
out(USAGE);
|
|
29
|
+
return 2;
|
|
30
|
+
}
|
|
31
|
+
const profile = str(flags.profile) === 'stub' ? stubProfile : sentropicProfile;
|
|
32
|
+
const category = 'static';
|
|
33
|
+
let result;
|
|
34
|
+
let code;
|
|
35
|
+
let commandLabel;
|
|
36
|
+
if (sub === 'scope') {
|
|
37
|
+
code = 'C2';
|
|
38
|
+
commandLabel = 'harness check scope';
|
|
39
|
+
const outcome = scopeFromFlags(flags, profile);
|
|
40
|
+
if (outcome.unreadable !== undefined) {
|
|
41
|
+
out(`harness: cannot read plan file: ${outcome.unreadable}`);
|
|
42
|
+
return 2;
|
|
43
|
+
}
|
|
44
|
+
result = outcome.result;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
code = 'C1';
|
|
48
|
+
commandLabel = 'harness check branch';
|
|
49
|
+
result = checkBranch({
|
|
50
|
+
currentBranch: str(flags['current-branch']) ?? '',
|
|
51
|
+
expectedBranch: str(flags['expected-branch']) ?? '',
|
|
52
|
+
profile,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (flags.json === true) {
|
|
56
|
+
// Pure: a deterministic placeholder timestamp; a real run injects commit/env/clock context.
|
|
57
|
+
const ts = '1970-01-01T00:00:00.000Z';
|
|
58
|
+
const run = toVerificationRun([{ code, category, result }], {
|
|
59
|
+
runId: 'cli',
|
|
60
|
+
commit: str(flags.commit) ?? 'unknown',
|
|
61
|
+
branch: str(flags['current-branch']) ?? 'unknown',
|
|
62
|
+
env: str(flags.env) ?? 'cli',
|
|
63
|
+
runner: 'harness',
|
|
64
|
+
category,
|
|
65
|
+
command: commandLabel,
|
|
66
|
+
startedAt: ts,
|
|
67
|
+
finishedAt: ts,
|
|
68
|
+
});
|
|
69
|
+
out(JSON.stringify(run, null, 2));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
out(`${result.pass ? 'PASS' : 'FAIL'} ${code} (${profile.id})`);
|
|
73
|
+
for (const v of result.violations)
|
|
74
|
+
out(` - ${v.severity}: ${v.message}`);
|
|
75
|
+
}
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Pure, arg-based CLI driver — reads everything from `argv`, writes via `out`, returns an exit code.
|
|
80
|
+
* No internal git calls (the caller supplies branch + staged files), no `process.exit`, no fs writes.
|
|
81
|
+
* Advisory (D5 Layer A): a failing check returns 0; only a usage error returns non-zero.
|
|
82
|
+
*
|
|
83
|
+
* Verb families: `check` (C1/C2 → VerificationRun); method/recorder verbs (brainstorm/test/debug/
|
|
84
|
+
* review/plan/branch/skills → WorkEvent + skill pointer, see `method-verbs.ts`).
|
|
85
|
+
*/
|
|
86
|
+
export function runHarnessCli(argv, out) {
|
|
87
|
+
const { positionals, flags } = parseFlags(argv);
|
|
88
|
+
const command = positionals[0];
|
|
89
|
+
if (command === 'check') {
|
|
90
|
+
return handleCheck(positionals, flags, out);
|
|
91
|
+
}
|
|
92
|
+
const mechanicalCode = handleMechanicalVerb(positionals, flags, out);
|
|
93
|
+
if (mechanicalCode !== null)
|
|
94
|
+
return mechanicalCode;
|
|
95
|
+
const methodCode = handleMethodVerb(positionals, flags, out);
|
|
96
|
+
if (methodCode !== null)
|
|
97
|
+
return methodCode;
|
|
98
|
+
out(USAGE);
|
|
99
|
+
return command === undefined ? 0 : 2;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/run.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,MAAM,KAAK,GAAG;IACV,qFAAqF;QACjF,kFAAkF;IACtF,gGAAgG;QAC5F,yGAAyG;IAC7G,yDAAy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AC,CAAC;IAChD,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACtB,OAAO,WAAW,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAChD,CAAC;IACD,MAAM,cAAc,GAAG,oBAAoB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACrE,IAAI,cAAc,KAAK,IAAI;QACvB,OAAO,cAAc,CAAC;IAC1B,MAAM,UAAU,GAAG,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,IAAI,UAAU,KAAK,IAAI;QACnB,OAAO,UAAU,CAAC;IACtB,GAAG,CAAC,KAAK,CAAC,CAAC;IACX,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Resolve `--branch-md` + `--staged-files` into a C2 scope CheckResult (pure but for the file read). */
|
|
2
|
+
export function scopeFromFlags(flags: any, profile: any): {
|
|
3
|
+
unreadable: string;
|
|
4
|
+
result?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
result: import("../index.js").CheckResult;
|
|
7
|
+
unreadable?: undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/scope.js"],"names":[],"mappings":"AAMA,yGAAyG;AACzG;;;;;;EAsBC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Shared scope-check input resolution — used by `check scope`, `verify`, and `audit` so the
|
|
2
|
+
// BRANCH.md parsing + boundary wiring lives in ONE place (no duplicated file IO).
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { parseBranchMd } from '../branch-md/parse.js';
|
|
5
|
+
import { checkScope } from '../checks/scope-check.js';
|
|
6
|
+
import { list, str } from './args.js';
|
|
7
|
+
/** Resolve `--branch-md` + `--staged-files` into a C2 scope CheckResult (pure but for the file read). */
|
|
8
|
+
export function scopeFromFlags(flags, profile) {
|
|
9
|
+
const branchMdPath = str(flags['branch-md']);
|
|
10
|
+
let parsed;
|
|
11
|
+
if (branchMdPath) {
|
|
12
|
+
try {
|
|
13
|
+
parsed = parseBranchMd(readFileSync(branchMdPath, 'utf8'));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return { unreadable: branchMdPath };
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const result = checkScope({
|
|
20
|
+
stagedFiles: list(flags['staged-files']),
|
|
21
|
+
boundary: {
|
|
22
|
+
allowed: parsed?.allowedPaths ?? [],
|
|
23
|
+
forbidden: parsed?.forbiddenPaths ?? [],
|
|
24
|
+
conditional: parsed?.conditionalPaths ?? [],
|
|
25
|
+
},
|
|
26
|
+
profile,
|
|
27
|
+
declaredExceptions: parsed?.exceptions ?? [],
|
|
28
|
+
});
|
|
29
|
+
return { result };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../../src/vendor/harness/cli/scope.js"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,kFAAkF;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtC,yGAAyG;AACzG,MAAM,UAAU,cAAc,CAAC,KAAK,EAAE,OAAO;IACzC,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC;IACX,IAAI,YAAY,EAAE,CAAC;QACf,IAAI,CAAC;YACD,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,MAAM,CAAC;YACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;QACxC,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC;QACtB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACxC,QAAQ,EAAE;YACN,OAAO,EAAE,MAAM,EAAE,YAAY,IAAI,EAAE;YACnC,SAAS,EAAE,MAAM,EAAE,cAAc,IAAI,EAAE;YACvC,WAAW,EAAE,MAAM,EAAE,gBAAgB,IAAI,EAAE;SAC9C;QACD,OAAO;QACP,kBAAkB,EAAE,MAAM,EAAE,UAAU,IAAI,EAAE;KAC/C,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const HARNESS_PACKAGE: "@sentropic/harness";
|
|
2
|
+
export { toWorkEvent } from "./run/work-event.js";
|
|
3
|
+
export { sentropicProfile } from "./profile/sentropic.js";
|
|
4
|
+
export { stubProfile } from "./profile/stub.js";
|
|
5
|
+
export { parseBranchMd } from "./branch-md/parse.js";
|
|
6
|
+
export { checkBranch } from "./checks/branch-check.js";
|
|
7
|
+
export { checkScope } from "./checks/scope-check.js";
|
|
8
|
+
export { toVerificationRun } from "./run/emit.js";
|
|
9
|
+
export { runHarnessCli } from "./cli/run.js";
|
|
10
|
+
export { validateVerificationRunV0, deriveVerdict, VERIFICATION_CATEGORIES, VIOLATION_SEVERITIES } from "./artifacts/validate-verification-run.js";
|
|
11
|
+
export { classifyPath, matchGlob, globToRegExp } from "./scope/scope-boundary.js";
|
|
12
|
+
export { HARNESS_SKILLS, HOST_SKILL_DIR, isHostId } from "./skills/manifest.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vendor/harness/index.js"],"names":[],"mappings":"AAIA,8BAA+B,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @sentropic/harness — neutral, host-agnostic code-work / PR-workflow tooling.
|
|
2
|
+
//
|
|
3
|
+
// Tooling-only: no product-runtime imports (no Drizzle/Hono/Svelte/Mistral), no
|
|
4
|
+
// `@sentropic/*` deps, and NO track import — harness only EMITS neutral artifacts.
|
|
5
|
+
export const HARNESS_PACKAGE = '@sentropic/harness';
|
|
6
|
+
// Dependency-free runtime validator + frozen verdict-derivation predicate for the v0 seam.
|
|
7
|
+
export { validateVerificationRunV0, deriveVerdict, VERIFICATION_CATEGORIES, VIOLATION_SEVERITIES, } from './artifacts/validate-verification-run.js';
|
|
8
|
+
export { toWorkEvent } from './run/work-event.js';
|
|
9
|
+
export { sentropicProfile } from './profile/sentropic.js';
|
|
10
|
+
export { stubProfile } from './profile/stub.js';
|
|
11
|
+
// BRANCH.md parser.
|
|
12
|
+
export { parseBranchMd } from './branch-md/parse.js';
|
|
13
|
+
// Scope classification.
|
|
14
|
+
export { classifyPath, matchGlob, globToRegExp } from './scope/scope-boundary.js';
|
|
15
|
+
// Checks (C1 branch, C2 scope) + neutral run assembly.
|
|
16
|
+
export { checkBranch } from './checks/branch-check.js';
|
|
17
|
+
export { checkScope } from './checks/scope-check.js';
|
|
18
|
+
export { toVerificationRun } from './run/emit.js';
|
|
19
|
+
// Harness skill-pack inventory — the native superpowers-surface replacement.
|
|
20
|
+
export { HARNESS_SKILLS, HOST_SKILL_DIR, isHostId } from './skills/manifest.js';
|
|
21
|
+
// Pure, arg-based CLI driver (the `harness` bin is a thin wrapper over this).
|
|
22
|
+
export { runHarnessCli } from './cli/run.js';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vendor/harness/index.js"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,2FAA2F;AAC3F,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,uBAAuB,EAAE,oBAAoB,GAAG,MAAM,0CAA0C,CAAC;AACpJ,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,wBAAwB;AACxB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAClF,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,6EAA6E;AAC7E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChF,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/profile.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// HarnessProfile — the policy SPI.
|
|
2
|
+
//
|
|
3
|
+
// The engine (parser, C1/C2 checks) is generic; all Sentropic-specific policy is data in a
|
|
4
|
+
// profile module. This slice exposes ONLY the fields C1/C2 actually consume — deferred
|
|
5
|
+
// checks (C4/C5/C6/C8) add their fields with their lots, so there is no dead config.
|
|
6
|
+
//
|
|
7
|
+
// Genericity is proven, not asserted: a second `stub` profile differs on a C2-consumed
|
|
8
|
+
// dimension and the Lot 4 test asserts DIVERGENT outcomes on the same input.
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/profile.js"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,2FAA2F;AAC3F,uFAAuF;AACvF,qFAAqF;AACrF,EAAE;AACF,uFAAuF;AACvF,6EAA6E;AAC7E,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentropic.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/sentropic.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The Sentropic policy, as data (from rules/MASTER.md). The engine never branches on
|
|
2
|
+
// `id` — it only reads these fields.
|
|
3
|
+
export const sentropicProfile = {
|
|
4
|
+
id: 'sentropic',
|
|
5
|
+
// MASTER.md "Default forbidden": Makefile, docker-compose*.yml, .cursor/rules/**.
|
|
6
|
+
forbiddenPathDefaults: ['Makefile', 'docker-compose*.yml', '.cursor/rules/**'],
|
|
7
|
+
// Scope exceptions look like `BR42h-EX1` / `BR04-EX2` (MASTER.md `BRxx-EXn`).
|
|
8
|
+
exceptionIdPattern: /^BR\d+[a-z]?-EX\d+$/,
|
|
9
|
+
conditionalRequiresException: true,
|
|
10
|
+
branchMatch: 'exact',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=sentropic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentropic.js","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/sentropic.js"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qCAAqC;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,EAAE,EAAE,WAAW;IACf,kFAAkF;IAClF,qBAAqB,EAAE,CAAC,UAAU,EAAE,qBAAqB,EAAE,kBAAkB,CAAC;IAC9E,8EAA8E;IAC9E,kBAAkB,EAAE,qBAAqB;IACzC,4BAA4B,EAAE,IAAI;IAClC,WAAW,EAAE,OAAO;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/stub.js"],"names":[],"mappings":""}
|