@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.
Files changed (97) hide show
  1. package/dist/bin.js +18 -1
  2. package/dist/bin.js.map +1 -1
  3. package/dist/cli-contract.d.ts.map +1 -1
  4. package/dist/cli-contract.js +10 -1
  5. package/dist/cli-contract.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +206 -25
  8. package/dist/cli.js.map +1 -1
  9. package/dist/vendor/harness/artifacts/validate-verification-run.d.ts +18 -0
  10. package/dist/vendor/harness/artifacts/validate-verification-run.d.ts.map +1 -0
  11. package/dist/vendor/harness/artifacts/validate-verification-run.js +160 -0
  12. package/dist/vendor/harness/artifacts/validate-verification-run.js.map +1 -0
  13. package/dist/vendor/harness/artifacts/verification-run.d.ts +2 -0
  14. package/dist/vendor/harness/artifacts/verification-run.d.ts.map +1 -0
  15. package/dist/vendor/harness/artifacts/verification-run.js +12 -0
  16. package/dist/vendor/harness/artifacts/verification-run.js.map +1 -0
  17. package/dist/vendor/harness/artifacts/work-event.d.ts +2 -0
  18. package/dist/vendor/harness/artifacts/work-event.d.ts.map +1 -0
  19. package/dist/vendor/harness/artifacts/work-event.js +9 -0
  20. package/dist/vendor/harness/artifacts/work-event.js.map +1 -0
  21. package/dist/vendor/harness/bin/harness.d.ts +3 -0
  22. package/dist/vendor/harness/bin/harness.d.ts.map +1 -0
  23. package/dist/vendor/harness/bin/harness.js +5 -0
  24. package/dist/vendor/harness/bin/harness.js.map +1 -0
  25. package/dist/vendor/harness/branch-md/parse.d.ts +9 -0
  26. package/dist/vendor/harness/branch-md/parse.d.ts.map +1 -0
  27. package/dist/vendor/harness/branch-md/parse.js +100 -0
  28. package/dist/vendor/harness/branch-md/parse.js.map +1 -0
  29. package/dist/vendor/harness/checks/branch-check.d.ts +15 -0
  30. package/dist/vendor/harness/checks/branch-check.d.ts.map +1 -0
  31. package/dist/vendor/harness/checks/branch-check.js +23 -0
  32. package/dist/vendor/harness/checks/branch-check.js.map +1 -0
  33. package/dist/vendor/harness/checks/scope-check.d.ts +22 -0
  34. package/dist/vendor/harness/checks/scope-check.d.ts.map +1 -0
  35. package/dist/vendor/harness/checks/scope-check.js +34 -0
  36. package/dist/vendor/harness/checks/scope-check.js.map +1 -0
  37. package/dist/vendor/harness/cli/args.d.ts +8 -0
  38. package/dist/vendor/harness/cli/args.d.ts.map +1 -0
  39. package/dist/vendor/harness/cli/args.js +32 -0
  40. package/dist/vendor/harness/cli/args.js.map +1 -0
  41. package/dist/vendor/harness/cli/mechanical-verbs.d.ts +7 -0
  42. package/dist/vendor/harness/cli/mechanical-verbs.d.ts.map +1 -0
  43. package/dist/vendor/harness/cli/mechanical-verbs.js +124 -0
  44. package/dist/vendor/harness/cli/mechanical-verbs.js.map +1 -0
  45. package/dist/vendor/harness/cli/method-verbs.d.ts +18 -0
  46. package/dist/vendor/harness/cli/method-verbs.d.ts.map +1 -0
  47. package/dist/vendor/harness/cli/method-verbs.js +174 -0
  48. package/dist/vendor/harness/cli/method-verbs.js.map +1 -0
  49. package/dist/vendor/harness/cli/run.d.ts +10 -0
  50. package/dist/vendor/harness/cli/run.d.ts.map +1 -0
  51. package/dist/vendor/harness/cli/run.js +101 -0
  52. package/dist/vendor/harness/cli/run.js.map +1 -0
  53. package/dist/vendor/harness/cli/scope.d.ts +9 -0
  54. package/dist/vendor/harness/cli/scope.d.ts.map +1 -0
  55. package/dist/vendor/harness/cli/scope.js +31 -0
  56. package/dist/vendor/harness/cli/scope.js.map +1 -0
  57. package/dist/vendor/harness/index.d.ts +13 -0
  58. package/dist/vendor/harness/index.d.ts.map +1 -0
  59. package/dist/vendor/harness/index.js +23 -0
  60. package/dist/vendor/harness/index.js.map +1 -0
  61. package/dist/vendor/harness/profile/profile.d.ts +2 -0
  62. package/dist/vendor/harness/profile/profile.d.ts.map +1 -0
  63. package/dist/vendor/harness/profile/profile.js +10 -0
  64. package/dist/vendor/harness/profile/profile.js.map +1 -0
  65. package/dist/vendor/harness/profile/sentropic.d.ts +8 -0
  66. package/dist/vendor/harness/profile/sentropic.d.ts.map +1 -0
  67. package/dist/vendor/harness/profile/sentropic.js +12 -0
  68. package/dist/vendor/harness/profile/sentropic.js.map +1 -0
  69. package/dist/vendor/harness/profile/stub.d.ts +8 -0
  70. package/dist/vendor/harness/profile/stub.d.ts.map +1 -0
  71. package/dist/vendor/harness/profile/stub.js +13 -0
  72. package/dist/vendor/harness/profile/stub.js.map +1 -0
  73. package/dist/vendor/harness/run/emit.d.ts +22 -0
  74. package/dist/vendor/harness/run/emit.d.ts.map +1 -0
  75. package/dist/vendor/harness/run/emit.js +32 -0
  76. package/dist/vendor/harness/run/emit.js.map +1 -0
  77. package/dist/vendor/harness/run/work-event.d.ts +20 -0
  78. package/dist/vendor/harness/run/work-event.d.ts.map +1 -0
  79. package/dist/vendor/harness/run/work-event.js +27 -0
  80. package/dist/vendor/harness/run/work-event.js.map +1 -0
  81. package/dist/vendor/harness/scope/scope-boundary.d.ts +17 -0
  82. package/dist/vendor/harness/scope/scope-boundary.d.ts.map +1 -0
  83. package/dist/vendor/harness/scope/scope-boundary.js +50 -0
  84. package/dist/vendor/harness/scope/scope-boundary.js.map +1 -0
  85. package/dist/vendor/harness/skills/manifest.d.ts +16 -0
  86. package/dist/vendor/harness/skills/manifest.d.ts.map +1 -0
  87. package/dist/vendor/harness/skills/manifest.js +25 -0
  88. package/dist/vendor/harness/skills/manifest.js.map +1 -0
  89. package/package.json +4 -3
  90. package/schema/harness/verification-run.schema.json +154 -0
  91. package/skills/harness/adopt/SKILL.md +32 -0
  92. package/skills/harness/brainstorm/SKILL.md +39 -0
  93. package/skills/harness/debug/SKILL.md +33 -0
  94. package/skills/harness/plan/SKILL.md +35 -0
  95. package/skills/harness/review/SKILL.md +33 -0
  96. package/skills/harness/test/SKILL.md +44 -0
  97. package/skills/harness/using-harness/SKILL.md +46 -0
@@ -0,0 +1,13 @@
1
+ // A deliberately-different 2nd profile that PROVES the engine is profile-generic.
2
+ // It differs from `sentropic` on dimensions C2 actually consumes — a different
3
+ // exception-id grammar, a different forbidden-default set, and conditional-without-
4
+ // exception allowed — so the Lot 4 genericity test can assert DIVERGENT outcomes on the
5
+ // same BRANCH.md + staged-file input (not "both pass", which would prove nothing).
6
+ export const stubProfile = {
7
+ id: 'stub',
8
+ forbiddenPathDefaults: ['secret/**'],
9
+ exceptionIdPattern: /^EXC-\d+$/,
10
+ conditionalRequiresException: false,
11
+ branchMatch: 'prefix',
12
+ };
13
+ //# sourceMappingURL=stub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stub.js","sourceRoot":"","sources":["../../../../src/vendor/harness/profile/stub.js"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+EAA+E;AAC/E,oFAAoF;AACpF,wFAAwF;AACxF,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,EAAE,EAAE,MAAM;IACV,qBAAqB,EAAE,CAAC,WAAW,CAAC;IACpC,kBAAkB,EAAE,WAAW;IAC/B,4BAA4B,EAAE,KAAK;IACnC,WAAW,EAAE,QAAQ;CACxB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Assemble a NEUTRAL `VerificationRun` from check results. harness EMITS this artifact and
3
+ * never writes into `@sentropic/track` — a track-side adapter ingests it (no track import here).
4
+ */
5
+ export function toVerificationRun(checks: any, ctx: any): {
6
+ schemaVersion: number;
7
+ runId: any;
8
+ commit: any;
9
+ branch: any;
10
+ env: any;
11
+ runner: any;
12
+ category: any;
13
+ command: any;
14
+ result: string;
15
+ startedAt: any;
16
+ finishedAt: any;
17
+ checks: any;
18
+ violations: any;
19
+ artifactLocator: any;
20
+ artifacts: any;
21
+ };
22
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/run/emit.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;;;;;;;;;;;;;;;EA0BC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Assemble a NEUTRAL `VerificationRun` from check results. harness EMITS this artifact and
3
+ * never writes into `@sentropic/track` — a track-side adapter ingests it (no track import here).
4
+ */
5
+ export function toVerificationRun(checks, ctx) {
6
+ const verificationChecks = checks.map((c) => ({
7
+ code: c.code,
8
+ category: c.category,
9
+ pass: c.result.pass,
10
+ violations: c.result.violations,
11
+ }));
12
+ const violations = checks.flatMap((c) => c.result.violations);
13
+ const pass = verificationChecks.every((c) => c.pass);
14
+ return {
15
+ schemaVersion: 1,
16
+ runId: ctx.runId,
17
+ commit: ctx.commit,
18
+ branch: ctx.branch,
19
+ env: ctx.env,
20
+ runner: ctx.runner,
21
+ category: ctx.category,
22
+ command: ctx.command,
23
+ result: pass ? 'pass' : 'fail',
24
+ startedAt: ctx.startedAt,
25
+ finishedAt: ctx.finishedAt,
26
+ checks: verificationChecks,
27
+ violations,
28
+ artifactLocator: ctx.artifactLocator ?? `verification-run:${ctx.runId}`,
29
+ artifacts: ctx.artifacts ?? [],
30
+ };
31
+ }
32
+ //# sourceMappingURL=emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.js","sourceRoot":"","sources":["../../../../src/vendor/harness/run/emit.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAM,EAAE,GAAG;IACzC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;QACnB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU;KAClC,CAAC,CAAC,CAAC;IACJ,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO;QACH,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC9B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,MAAM,EAAE,kBAAkB;QAC1B,UAAU;QACV,eAAe,EAAE,GAAG,CAAC,eAAe,IAAI,oBAAoB,GAAG,CAAC,KAAK,EAAE;QACvE,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE;KACjC,CAAC;AACN,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Assemble a NEUTRAL `WorkEvent` from a method/branch act. harness EMITS this artifact and never
3
+ * writes into `@sentropic/track` — a track-side adapter ingests it (no track import here). Pure and
4
+ * deterministic: `subject`/`skill` are dropped when absent so the JSON stays minimal and stable.
5
+ */
6
+ export function toWorkEvent(input: any, ctx: any): {
7
+ schemaVersion: number;
8
+ kind: string;
9
+ verb: any;
10
+ status: any;
11
+ refs: any;
12
+ detail: any;
13
+ runId: any;
14
+ commit: any;
15
+ branch: any;
16
+ env: any;
17
+ runner: any;
18
+ at: any;
19
+ };
20
+ //# sourceMappingURL=work-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-event.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/run/work-event.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;;;;;;;;EAoBC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Assemble a NEUTRAL `WorkEvent` from a method/branch act. harness EMITS this artifact and never
3
+ * writes into `@sentropic/track` — a track-side adapter ingests it (no track import here). Pure and
4
+ * deterministic: `subject`/`skill` are dropped when absent so the JSON stays minimal and stable.
5
+ */
6
+ export function toWorkEvent(input, ctx) {
7
+ const event = {
8
+ schemaVersion: 1,
9
+ kind: 'work-event',
10
+ verb: input.verb,
11
+ status: input.status,
12
+ refs: input.refs ?? {},
13
+ detail: input.detail ?? {},
14
+ runId: ctx.runId,
15
+ commit: ctx.commit,
16
+ branch: ctx.branch,
17
+ env: ctx.env,
18
+ runner: ctx.runner,
19
+ at: ctx.at,
20
+ };
21
+ if (input.subject !== undefined)
22
+ event.subject = input.subject;
23
+ if (input.skill !== undefined)
24
+ event.skill = input.skill;
25
+ return event;
26
+ }
27
+ //# sourceMappingURL=work-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-event.js","sourceRoot":"","sources":["../../../../src/vendor/harness/run/work-event.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAK,EAAE,GAAG;IAClC,MAAM,KAAK,GAAG;QACV,aAAa,EAAE,CAAC;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;QAC1B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,EAAE,EAAE,GAAG,CAAC,EAAE;KACb,CAAC;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAC3B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAClC,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QACzB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9B,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Translate a path glob into an anchored RegExp. `**` spans `/`; `*` stays within a segment. */
2
+ export function globToRegExp(glob: any): RegExp;
3
+ export function matchGlob(glob: any, path: any): boolean;
4
+ /**
5
+ * Classify a repo-relative path against a branch ScopeBoundary + the profile's default
6
+ * forbidden globs (C2 scope-check core).
7
+ *
8
+ * Precedence (first match wins):
9
+ * explicit allowed > explicit forbidden > explicit conditional > profile default-forbidden > unknown
10
+ *
11
+ * `allowed` wins over `forbidden` so an explicitly-granted subtree (e.g. `packages/harness/**`)
12
+ * is `allowed` even when a broader `packages/**` is forbidden — the Allowed list is the granted
13
+ * implementation scope. `conditional` is checked before profile defaults so a Conditional listing
14
+ * (e.g. `Makefile` with an exception) overrides the profile's default-forbidden classification.
15
+ */
16
+ export function classifyPath(path: any, boundary: any, profile: any): "unknown" | "forbidden" | "conditional" | "allowed";
17
+ //# sourceMappingURL=scope-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-boundary.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/scope/scope-boundary.js"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,gDAqBC;AACD,yDAEC;AACD;;;;;;;;;;;GAWG;AACH,0HAUC"}
@@ -0,0 +1,50 @@
1
+ /** Translate a path glob into an anchored RegExp. `**` spans `/`; `*` stays within a segment. */
2
+ export function globToRegExp(glob) {
3
+ let re = '';
4
+ for (let i = 0; i < glob.length; i++) {
5
+ const c = glob[i];
6
+ if (c === '*') {
7
+ if (glob[i + 1] === '*') {
8
+ re += '.*';
9
+ i++;
10
+ }
11
+ else {
12
+ re += '[^/]*';
13
+ }
14
+ }
15
+ else if ('\\^$+?.()|[]{}/'.includes(c)) {
16
+ re += '\\' + c;
17
+ }
18
+ else {
19
+ re += c;
20
+ }
21
+ }
22
+ return new RegExp('^' + re + '$');
23
+ }
24
+ export function matchGlob(glob, path) {
25
+ return globToRegExp(glob).test(path);
26
+ }
27
+ /**
28
+ * Classify a repo-relative path against a branch ScopeBoundary + the profile's default
29
+ * forbidden globs (C2 scope-check core).
30
+ *
31
+ * Precedence (first match wins):
32
+ * explicit allowed > explicit forbidden > explicit conditional > profile default-forbidden > unknown
33
+ *
34
+ * `allowed` wins over `forbidden` so an explicitly-granted subtree (e.g. `packages/harness/**`)
35
+ * is `allowed` even when a broader `packages/**` is forbidden — the Allowed list is the granted
36
+ * implementation scope. `conditional` is checked before profile defaults so a Conditional listing
37
+ * (e.g. `Makefile` with an exception) overrides the profile's default-forbidden classification.
38
+ */
39
+ export function classifyPath(path, boundary, profile) {
40
+ if (boundary.allowed.some((g) => matchGlob(g, path)))
41
+ return 'allowed';
42
+ if (boundary.forbidden.some((g) => matchGlob(g, path)))
43
+ return 'forbidden';
44
+ if (boundary.conditional.some((g) => matchGlob(g, path)))
45
+ return 'conditional';
46
+ if (profile.forbiddenPathDefaults.some((g) => matchGlob(g, path)))
47
+ return 'forbidden';
48
+ return 'unknown';
49
+ }
50
+ //# sourceMappingURL=scope-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-boundary.js","sourceRoot":"","sources":["../../../../src/vendor/harness/scope/scope-boundary.js"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,UAAU,YAAY,CAAC,IAAI;IAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACZ,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACtB,EAAE,IAAI,IAAI,CAAC;gBACX,CAAC,EAAE,CAAC;YACR,CAAC;iBACI,CAAC;gBACF,EAAE,IAAI,OAAO,CAAC;YAClB,CAAC;QACL,CAAC;aACI,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;QACnB,CAAC;aACI,CAAC;YACF,EAAE,IAAI,CAAC,CAAC;QACZ,CAAC;IACL,CAAC;IACD,OAAO,IAAI,MAAM,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,SAAS,CAAC,IAAI,EAAE,IAAI;IAChC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AACD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO;IAChD,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAChD,OAAO,SAAS,CAAC;IACrB,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,WAAW,CAAC;IACvB,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACpD,OAAO,aAAa,CAAC;IACzB,IAAI,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC7D,OAAO,WAAW,CAAC;IACvB,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export function isHostId(s: any): boolean;
2
+ export const HARNESS_SKILLS: ({
3
+ name: string;
4
+ summary: string;
5
+ supersedes: string;
6
+ } | {
7
+ name: string;
8
+ summary: string;
9
+ supersedes?: undefined;
10
+ })[];
11
+ export namespace HOST_SKILL_DIR {
12
+ let claude: string;
13
+ let codex: string;
14
+ let gemini: string;
15
+ }
16
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/vendor/harness/skills/manifest.js"],"names":[],"mappings":"AAqBA,0CAEC;AAjBD;;;;;;;;KAQE"}
@@ -0,0 +1,25 @@
1
+ // Canonical inventory of the harness skill pack — the NATIVE superpowers-surface replacement.
2
+ //
3
+ // `harness skills install --host <h>` reports this plan; the pack ships in the npm tarball under
4
+ // `skills/<name>/SKILL.md` (see `package.json` `files`). The host loads each as `harness/<name>`.
5
+ // `using-harness` MUST be loaded first — it carries the supersede directive that makes `harness/*`
6
+ // take precedence over the superpowers skills it replaces.
7
+ export const HARNESS_SKILLS = [
8
+ { name: 'using-harness', summary: 'index + supersede directive (load FIRST)', supersedes: 'using-superpowers' },
9
+ { name: 'brainstorm', summary: 'spec-ladder STUDY→VOL→EVOL + ≥2-peer review + batched decisions', supersedes: 'brainstorming' },
10
+ { name: 'test', summary: 'test-pyramid + scoped-test loop (not "tdd")', supersedes: 'test-driven-development' },
11
+ { name: 'debug', summary: 'generic root-cause loop', supersedes: 'systematic-debugging' },
12
+ { name: 'review', summary: '≥2-peer consensus review', supersedes: 'requesting-code-review' },
13
+ { name: 'plan', summary: 'spec-ladder + BRANCH.md lots; completes with track', supersedes: 'writing-plans' },
14
+ { name: 'adopt', summary: 'adapt the harness method to ANY repo (profile)' },
15
+ ];
16
+ /** Host → the skills directory `skills install` copies the pack into. */
17
+ export const HOST_SKILL_DIR = {
18
+ claude: '.claude/skills',
19
+ codex: '.codex/skills',
20
+ gemini: '.gemini/skills',
21
+ };
22
+ export function isHostId(s) {
23
+ return s === 'claude' || s === 'codex' || s === 'gemini';
24
+ }
25
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../../src/vendor/harness/skills/manifest.js"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,iGAAiG;AACjG,kGAAkG;AAClG,mGAAmG;AACnG,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,0CAA0C,EAAE,UAAU,EAAE,mBAAmB,EAAE;IAC/G,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,iEAAiE,EAAE,UAAU,EAAE,eAAe,EAAE;IAC/H,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,6CAA6C,EAAE,UAAU,EAAE,yBAAyB,EAAE;IAC/G,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,sBAAsB,EAAE;IACzF,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,wBAAwB,EAAE;IAC7F,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oDAAoD,EAAE,UAAU,EAAE,eAAe,EAAE;IAC5G,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gDAAgD,EAAE;CAC/E,CAAC;AACF,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;CAC3B,CAAC;AACF,MAAM,UAAU,QAAQ,CAAC,CAAC;IACtB,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,QAAQ,CAAC;AAC7D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentropic/h2a",
3
- "version": "0.83.0",
3
+ "version": "0.85.0",
4
4
  "description": "h2a — the unified CLI + core for human-to-agent coordination.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,8 @@
31
31
  "files": [
32
32
  "dist",
33
33
  "fixtures",
34
- "skills"
34
+ "skills",
35
+ "schema"
35
36
  ],
36
37
  "publishConfig": {
37
38
  "access": "public"
@@ -46,7 +47,7 @@
46
47
  "@hono/mcp": "^0.3.0",
47
48
  "@hono/node-server": "^2.0.4",
48
49
  "@modelcontextprotocol/sdk": "^1.29.0",
49
- "@sentropic/track": "^0.83.0",
50
+ "@sentropic/track": "^0.85.0",
50
51
  "hono": "^4.12.23"
51
52
  },
52
53
  "peerDependencies": {
@@ -0,0 +1,154 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/rhanka/sentropic/packages/harness/schema/verification-run.schema.json",
4
+ "title": "VerificationRun (harness↔track seam v0)",
5
+ "description": "Neutral verification artifact emitted by @sentropic/harness checks and ingested by a track-side adapter. Frozen v0 per spec/SPEC_DECISION_SEAM_HARNESS_TRACK_V0.md. harness EMITS this artifact and never imports @sentropic/track; the adapter is 100% track-side. Versioning: unknown major/schemaVersion ⇒ fail-closed reject; minor ⇒ additive OPTIONAL fields only; consumers ignore unknown optional fields but MUST NOT route an unknown target-kind / enum value silently.",
6
+ "type": "object",
7
+ "$comment": "VERDICT-DERIVATION INVARIANT (DEC-S3, frozen cross-contract): the track-side adapter DERIVES the scope verdict from violations+severity, NEVER from `result`. Predicate: any violation with severity='blocking' ⇒ verdict='violation'; else any violation with severity='advisory' ⇒ verdict='conditional'; else verdict='clean'. The harness does NOT derive the verdict; this predicate is frozen here so it holds cross-contract, not on trust. `acceptance.run.result` uses VerificationRun.result / the check pass flag directly (binary pass|fail).",
8
+ "additionalProperties": false,
9
+ "required": [
10
+ "schemaVersion",
11
+ "runId",
12
+ "commit",
13
+ "branch",
14
+ "env",
15
+ "runner",
16
+ "category",
17
+ "command",
18
+ "result",
19
+ "startedAt",
20
+ "finishedAt",
21
+ "checks",
22
+ "violations",
23
+ "artifactLocator",
24
+ "artifacts"
25
+ ],
26
+ "properties": {
27
+ "schemaVersion": {
28
+ "const": 1,
29
+ "description": "v0 freeze. Unknown schemaVersion ⇒ fail-closed reject."
30
+ },
31
+ "runId": {
32
+ "type": "string",
33
+ "description": "Stable id per invocation. The track adapter MINTS a globally-unique runId PER EMITTED VERDICT (a per-check/per-target projection id ≠ this physical run id — DEC §7 M1). This physical id lives in the artifact behind artifactLocator."
34
+ },
35
+ "commit": { "type": "string" },
36
+ "branch": { "type": "string" },
37
+ "env": { "type": "string" },
38
+ "runner": { "type": "string" },
39
+ "category": { "$ref": "#/definitions/VerificationCategory" },
40
+ "command": { "type": "string" },
41
+ "result": {
42
+ "enum": ["pass", "fail"],
43
+ "description": "Run-level binary outcome. NEVER the source of the scope verdict (see the verdict-derivation invariant)."
44
+ },
45
+ "startedAt": { "type": "string", "format": "date-time" },
46
+ "finishedAt": { "type": "string", "format": "date-time" },
47
+ "checks": {
48
+ "type": "array",
49
+ "items": { "$ref": "#/definitions/VerificationCheck" }
50
+ },
51
+ "violations": {
52
+ "type": "array",
53
+ "description": "Flattened union of all check violations (convenience for ingesters).",
54
+ "items": { "$ref": "#/definitions/Violation" }
55
+ },
56
+ "artifactLocator": {
57
+ "type": "string",
58
+ "description": "Immutable locator for the full VerificationRun JSON — the CANONICAL evidence (DEC-S2). Immutability is a PRODUCER guarantee the adapter RECORDS, never verifies (OQ-3). REQUIRED."
59
+ },
60
+ "artifacts": {
61
+ "type": "array",
62
+ "description": "Opaque references to OTHER produced artifacts (paths/urls).",
63
+ "items": { "type": "string" }
64
+ }
65
+ },
66
+ "definitions": {
67
+ "VerificationCategory": {
68
+ "enum": [
69
+ "none",
70
+ "static",
71
+ "unit",
72
+ "integration",
73
+ "e2e",
74
+ "ci",
75
+ "uat",
76
+ "security"
77
+ ],
78
+ "description": "BR25 D3 verification taxonomy. `security` is a frozen v0 slot reserved NOW (adding an enum value post-freeze would be a major bump); it stays schema-artifact-only / OFF-WIRE in v0 (OQ-7). An unknown category MUST NOT route silently."
79
+ },
80
+ "ViolationSeverity": {
81
+ "enum": ["advisory", "blocking"],
82
+ "description": "FROZEN v0 enum (DEC §7 SHOULD-FIX). Feeds the verdict-derivation invariant; the freeze pins the predicate cross-contract."
83
+ },
84
+ "Violation": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": ["code", "message", "severity"],
88
+ "properties": {
89
+ "code": { "type": "string" },
90
+ "path": {
91
+ "type": "string",
92
+ "description": "Offending path, when the violation is path-scoped (e.g. C2)."
93
+ },
94
+ "message": { "type": "string" },
95
+ "severity": { "$ref": "#/definitions/ViolationSeverity" }
96
+ }
97
+ },
98
+ "VerificationTarget": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "description": "Structured evidence target (DEC-S1, freeze keystone). Carried per-check. The adapter routes from the target, never from category/branch/commit/path globs (DEC-S4). At least one of `scope`|`acceptance` should be present for a track-ingested check; a check with no target FAILS CLOSED at the adapter.",
102
+ "minProperties": 1,
103
+ "properties": {
104
+ "scope": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["wpRef"],
108
+ "description": "present ⇒ adapter emits scope.verification (verdict derived from violations+severity).",
109
+ "properties": {
110
+ "wpRef": {
111
+ "type": "string",
112
+ "description": "Exact scope.declare itemId / stable scope key (no inference)."
113
+ }
114
+ }
115
+ },
116
+ "acceptance": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["evidenceId", "kind"],
120
+ "description": "present ⇒ adapter emits acceptance.run (+ one acceptance.link per criterionId).",
121
+ "properties": {
122
+ "evidenceId": {
123
+ "type": "string",
124
+ "description": "Caller-supplied DETERMINISTIC evidence key (DEC §7 M2=B) — NOT a server-minted id."
125
+ },
126
+ "kind": { "enum": ["unit", "integration", "e2e", "manual"] },
127
+ "criterionIds": {
128
+ "type": "array",
129
+ "items": { "type": "string" }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "VerificationCheck": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": ["code", "category", "pass", "violations"],
139
+ "properties": {
140
+ "code": { "type": "string" },
141
+ "category": { "$ref": "#/definitions/VerificationCategory" },
142
+ "pass": { "type": "boolean" },
143
+ "violations": {
144
+ "type": "array",
145
+ "items": { "$ref": "#/definitions/Violation" }
146
+ },
147
+ "target": {
148
+ "$ref": "#/definitions/VerificationTarget",
149
+ "description": "≥1 of scope|acceptance required for a track-ingested check; absent ⇒ adapter fail-closed (never auto-itemized, never glob-routed). Optional so producer-local checks stay representable."
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: adopt
3
+ description: Use when bringing the harness method to a NEW or non-sentropic repo — maps the repo's conventions into a harness profile so the same scope/branch/verify kernel applies anywhere.
4
+ ---
5
+
6
+ # harness/adopt
7
+
8
+ Native repo-onboarding. The harness engine (parser, C1/C2 checks, verify) is generic; all repo-specific
9
+ policy is DATA in a profile. `adopt` maps a foreign repo onto that SPI so the method runs unchanged.
10
+
11
+ ## Steps
12
+
13
+ 1. **Scaffold** — `harness init [--profile sentropic|stub] [--json]` prints a profile descriptor. Save it
14
+ as `harness.profile.json` at the repo root and edit it to fit:
15
+ - `forbiddenPathDefaults` — globs forbidden unless a BRANCH.md explicitly Allows them.
16
+ - `exceptionIdPattern` — the grammar of a valid scope-exception id (e.g. `^BR\d+-EX\d+$`).
17
+ - `conditionalRequiresException` — whether a Conditional path needs a matching declared exception.
18
+ - `branchMatch` — `exact` or `prefix` for the C1 branch check.
19
+ 2. **Map the repo's reality** — translate the repo's conventions, not sentropic's: which paths are
20
+ off-limits, what its BRANCH.md grammar is (or whether one must be introduced), the command runner
21
+ (`make` vs `npm`/`nx`), and the environment data-lifecycle (which envs are disposable vs protected).
22
+ 3. **Audit** — `harness audit --staged-files "<changed files>" --branch-md <path> --json` diffs the repo
23
+ against the active profile and emits a `VerificationRun (static)` listing drift: forbidden touches,
24
+ undeclared (unknown) paths, missing scope declaration.
25
+ 4. **Wire** — add a `scope-check`/`verify` step to the repo's pre-commit or CI using the profile, so the
26
+ method is enforced, not just documented.
27
+
28
+ ## Principle
29
+
30
+ A second `stub` profile diverging from `sentropic` on a checked dimension is the proof-of-genericity:
31
+ the same kernel yields different, correct verdicts per profile. Adoption succeeds when a third repo can
32
+ declare its OWN profile and the unchanged engine governs it.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: brainstorm
3
+ description: Use before any creative/design work (a feature, a package, an evolution) — explores intent and design via the spec-ladder with multi-peer adversarial review BEFORE implementation.
4
+ ---
5
+
6
+ # harness/brainstorm
7
+
8
+ Native sentropic ideation. Stronger than a single-pass brainstorm: it climbs the **spec-ladder** and
9
+ gates each design step with **≥2 independent adversarial peers** and **batched** owner decisions.
10
+
11
+ Open the act: `harness brainstorm "<topic>" [--peers <n>] [--ladder study|vol|evol]` (records a WorkEvent).
12
+
13
+ ## The spec-ladder
14
+
15
+ Pick the rung that matches the uncertainty, write the artifact under `spec/`:
16
+
17
+ - **STUDY** (`SPEC_STUDY_<TOPIC>.md`) — open question, options, trade-offs. No commitment yet.
18
+ - **VOL** (volition) — the chosen direction + rationale, still reversible.
19
+ - **EVOL** (`SPEC_EVOL_<TOPIC>.md`) — the committed design with numbered decisions (D1…Dn) ready to plan.
20
+
21
+ Don't skip rungs for a genuinely open problem; don't over-ceremony a reversible one.
22
+
23
+ ## Multi-peer adversarial review (the differentiator)
24
+
25
+ Before presenting decisions, get **≥2 independent reviews from distinct angles** (e.g. Opus 4.8 + Codex
26
+ 5.5-xhigh, or distinct lenses: correctness / risk / user-value). Reconcile divergences explicitly — a
27
+ lone reviewer rationalises; a panel surfaces failure modes. Reversible calls: decide solo. Blocking /
28
+ irreversible calls: escalate.
29
+
30
+ ## Batched decisions
31
+
32
+ Present owner decisions as a **clean full dossier (never a delta)**, THEN ask in **lots of ≤4** questions.
33
+ Each question carries its own context inline (source + stakes + consequence) — an id like "D5" alone
34
+ carries no meaning. Once answered, treat all answers final; do re-examination in prose, don't re-poll.
35
+
36
+ ## Done
37
+
38
+ A ladder artifact exists, peers reconciled, decisions captured. Hand off to `harness/plan` to turn the
39
+ EVOL decisions into BRANCH.md lots.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: debug
3
+ description: Use on any bug, test failure, or unexpected behaviour BEFORE proposing a fix — runs the generic evidence-first root-cause loop.
4
+ ---
5
+
6
+ # harness/debug
7
+
8
+ Native sentropic debugging. Open it with `harness debug "<symptom>"` (records a WorkEvent), then run the
9
+ loop. No fix is proposed before the root cause is proven by evidence.
10
+
11
+ ## The loop
12
+
13
+ 1. **Reproduce** — a deterministic, minimal repro. If you can't reproduce it, you can't fix it.
14
+ 2. **Evidence** — gather facts with the tools, never assume: `make logs-<service>`, `make db-query
15
+ QUERY="…"`, container state (`make ps`), `grep`/`diff`. Read the actual error, the actual state.
16
+ 3. **One hypothesis** — the single most-likely cause that the evidence supports. Write it down.
17
+ 4. **One fix** — the smallest change that addresses THAT cause. No shotgun edits, no "while I'm here".
18
+ 5. **Re-observe** — rerun the repro. Confirm the symptom is gone AND the evidence changed as predicted.
19
+ 6. **Regression test** — promote the repro into a test (`harness/test`) so it can't silently return.
20
+
21
+ ## Rules
22
+
23
+ - No "probably" / "maybe" / "should be" — verify with a tool before asserting. A claim without evidence
24
+ is a guess.
25
+ - Change ONE thing at a time; if the symptom persists, revert it before trying the next.
26
+ - A failing assertion is data, not noise — read the diff, don't loosen the assertion.
27
+ - Live surfaces (UI/stream/API/extension) have a dev-lane bootstrap (Playwright/probe targets); use it to
28
+ observe the real behaviour rather than reasoning in the abstract.
29
+
30
+ ## Done
31
+
32
+ Root cause named + evidenced, minimal fix in place, repro green as a regression test, no collateral
33
+ change. Hand verification to `harness verify`.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: plan
3
+ description: Use when you have a spec/decisions and need an executable plan — writes a lot-based BRANCH.md from the template and completes with track for realization state.
4
+ ---
5
+
6
+ # harness/plan
7
+
8
+ Native sentropic planning. Turns an EVOL spec's decisions into an executable, scoped `BRANCH.md`. Open it
9
+ with `harness plan "<spec>" [--lots <n>]` (records a WorkEvent; harness writes BRANCH.md, then
10
+ `track branch import` indexes it).
11
+
12
+ ## Write BRANCH.md from the template
13
+
14
+ Use `plan/BRANCH_TEMPLATE.md` strictly — checkboxes only, no prose, no `###`. First iteration must be
15
+ detailed:
16
+
17
+ - **Objective** + **Scope / Guardrails**.
18
+ - **Branch Scope Boundaries**: `Allowed` / `Forbidden` / `Conditional` paths (default forbidden: `Makefile`,
19
+ `docker-compose*.yml`, `.cursor/rules/**`). Exceptions via `BRxx-EXn` (reason + impact + rollback).
20
+ - **Lot-based plan**: each lot is one logical change with a file-level test list and a lot gate.
21
+ - **Feedback Loop** for blockers/decisions.
22
+
23
+ ## Lots & commit discipline
24
+
25
+ - One logical change per lot/commit; max ~10–15 files and **under 150 lines** per commit.
26
+ - Selective staging (`git add <files>` — never `git add .`); commit via `make commit MSG="type: …"`.
27
+ - Update `BRANCH.md` checkboxes WITHIN each commit.
28
+ - Multi-need work → multi-branch with a root `PLAN.md` (waves ≤4 orthogonal branches).
29
+
30
+ ## Completes with track
31
+
32
+ harness OWNS the BRANCH.md (the master plan artifact) and EMITS `WorkEvent`s; **track** ingests them and
33
+ owns the realization state — Items, links, Decisions, acceptance, and the AWAITED / DROPPED / DONE / TO-DO
34
+ projections. Don't duplicate status in BRANCH.md prose — let track project it. Execute lots in order
35
+ autonomously; only interrupt for a real fork or blocker.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: review
3
+ description: Use when completing a feature, a design step, or before merging — runs a ≥2-peer consensus review and reconciles the findings, instead of a single rubber-stamp pass.
4
+ ---
5
+
6
+ # harness/review
7
+
8
+ Native sentropic code/design review. Stronger than a single review: **≥2 independent peers**, distinct
9
+ lenses, reconciled. Open it with `harness review "<target>" --consensus [--peers <n>]` (records a
10
+ WorkEvent).
11
+
12
+ ## Consensus protocol
13
+
14
+ 1. **Dispatch ≥2 independent peers** on the SAME diff/design — ideally different models or angles
15
+ (e.g. Opus 4.8 + Codex 5.5-xhigh), each blind to the others.
16
+ 2. **Distinct lenses** when a finding can fail in more than one way: correctness · security · performance ·
17
+ does-it-actually-reproduce. Diversity catches what redundancy can't.
18
+ 3. **Refute by default** — each peer tries to REFUTE the change / a claimed finding. A finding survives
19
+ only if it withstands the skeptics; a kill needs a majority.
20
+ 4. **Reconcile** — merge findings, surface disagreements explicitly, classify accept / reject / defer with
21
+ a one-line rationale each. Don't average; adjudicate.
22
+
23
+ ## Receiving review (technical rigor, not performative agreement)
24
+
25
+ Before implementing a suggestion, verify it. If feedback is unclear or technically questionable, push back
26
+ with evidence rather than complying blindly. Apply what's correct; refute what's wrong; ask when genuinely
27
+ ambiguous.
28
+
29
+ ## Severity & gate
30
+
31
+ Findings that gate a lot escalate to a `VerificationRun` (`harness verify --category static`). Narrative
32
+ findings stay a `WorkEvent`. Blocking findings must be resolved before merge; non-blocking are logged in
33
+ `BRANCH.md` `## Feedback Loop` with owner + status.