@dungle-scrubs/harness-cli-normalizer 0.3.1 → 0.4.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/README.md +64 -86
  2. package/dist/cli/args.d.ts +11 -0
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +23 -5
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/config.d.ts +25 -0
  7. package/dist/cli/config.d.ts.map +1 -0
  8. package/dist/cli/config.js +139 -0
  9. package/dist/cli/config.js.map +1 -0
  10. package/dist/cli/inspect.d.ts.map +1 -1
  11. package/dist/cli/inspect.js +35 -1
  12. package/dist/cli/inspect.js.map +1 -1
  13. package/dist/cli/render.d.ts.map +1 -1
  14. package/dist/cli/render.js +10 -1
  15. package/dist/cli/render.js.map +1 -1
  16. package/dist/cli/run.d.ts.map +1 -1
  17. package/dist/cli/run.js +134 -4
  18. package/dist/cli/run.js.map +1 -1
  19. package/dist/execution/failure.d.ts +21 -4
  20. package/dist/execution/failure.d.ts.map +1 -1
  21. package/dist/execution/failure.js +26 -3
  22. package/dist/execution/failure.js.map +1 -1
  23. package/dist/execution/stream-turn.d.ts +4 -0
  24. package/dist/execution/stream-turn.d.ts.map +1 -1
  25. package/dist/execution/stream-turn.js +28 -4
  26. package/dist/execution/stream-turn.js.map +1 -1
  27. package/dist/interpretation/argv.d.ts +1 -0
  28. package/dist/interpretation/argv.d.ts.map +1 -1
  29. package/dist/interpretation/argv.js +13 -19
  30. package/dist/interpretation/argv.js.map +1 -1
  31. package/dist/interpretation/hints.d.ts +22 -0
  32. package/dist/interpretation/hints.d.ts.map +1 -0
  33. package/dist/interpretation/hints.js +59 -0
  34. package/dist/interpretation/hints.js.map +1 -0
  35. package/dist/interpretation/refusal.d.ts +25 -4
  36. package/dist/interpretation/refusal.d.ts.map +1 -1
  37. package/dist/interpretation/refusal.js +16 -0
  38. package/dist/interpretation/refusal.js.map +1 -1
  39. package/dist/interpretation/resolve-options.d.ts +42 -0
  40. package/dist/interpretation/resolve-options.d.ts.map +1 -0
  41. package/dist/interpretation/resolve-options.js +140 -0
  42. package/dist/interpretation/resolve-options.js.map +1 -0
  43. package/dist/interpretation/support.d.ts +32 -0
  44. package/dist/interpretation/support.d.ts.map +1 -0
  45. package/dist/interpretation/support.js +107 -0
  46. package/dist/interpretation/support.js.map +1 -0
  47. package/dist/interpretation/tool-selection.d.ts +29 -0
  48. package/dist/interpretation/tool-selection.d.ts.map +1 -0
  49. package/dist/interpretation/tool-selection.js +122 -0
  50. package/dist/interpretation/tool-selection.js.map +1 -0
  51. package/dist/interpretation/turn-options.d.ts.map +1 -1
  52. package/dist/interpretation/turn-options.js +4 -0
  53. package/dist/interpretation/turn-options.js.map +1 -1
  54. package/dist/knowledge/claude-code.d.ts.map +1 -1
  55. package/dist/knowledge/claude-code.js +34 -1
  56. package/dist/knowledge/claude-code.js.map +1 -1
  57. package/dist/knowledge/codex.d.ts.map +1 -1
  58. package/dist/knowledge/codex.js +19 -0
  59. package/dist/knowledge/codex.js.map +1 -1
  60. package/dist/knowledge/descriptor.d.ts +32 -0
  61. package/dist/knowledge/descriptor.d.ts.map +1 -1
  62. package/dist/knowledge/muse.d.ts.map +1 -1
  63. package/dist/knowledge/muse.js +19 -0
  64. package/dist/knowledge/muse.js.map +1 -1
  65. package/dist/knowledge/pi.d.ts.map +1 -1
  66. package/dist/knowledge/pi.js +21 -0
  67. package/dist/knowledge/pi.js.map +1 -1
  68. package/dist/knowledge/profile.d.ts +13 -0
  69. package/dist/knowledge/profile.d.ts.map +1 -0
  70. package/dist/knowledge/profile.js +31 -0
  71. package/dist/knowledge/profile.js.map +1 -0
  72. package/package.json +2 -23
  73. package/src/cli/args.ts +31 -1
  74. package/src/cli/config.ts +166 -0
  75. package/src/cli/inspect.ts +34 -1
  76. package/src/cli/render.ts +10 -1
  77. package/src/cli/run.ts +161 -5
  78. package/src/execution/failure.ts +44 -5
  79. package/src/execution/stream-turn.ts +33 -3
  80. package/src/interpretation/argv.ts +14 -19
  81. package/src/interpretation/hints.ts +99 -0
  82. package/src/interpretation/refusal.ts +32 -3
  83. package/src/interpretation/resolve-options.ts +190 -0
  84. package/src/interpretation/support.ts +119 -0
  85. package/src/interpretation/tool-selection.ts +161 -0
  86. package/src/interpretation/turn-options.ts +4 -0
  87. package/src/knowledge/claude-code.ts +34 -1
  88. package/src/knowledge/codex.ts +19 -0
  89. package/src/knowledge/descriptor.ts +32 -0
  90. package/src/knowledge/muse.ts +19 -0
  91. package/src/knowledge/pi.ts +21 -0
  92. package/src/knowledge/profile.ts +33 -0
  93. package/dist/index.d.ts +0 -8
  94. package/dist/index.d.ts.map +0 -1
  95. package/dist/index.js +0 -8
  96. package/dist/index.js.map +0 -1
  97. package/src/index.ts +0 -7
@@ -340,4 +340,36 @@ export interface HarnessDescriptor {
340
340
  * harness; a call passing them must refuse. Discovery is a table of
341
341
  * per-facet specs rather than a single flag. */
342
342
  readonly turnOptions: Readonly<Partial<Record<TurnOptionKey, TurnOptionSpec>>>;
343
+ /** Tool-selection surface, grounded in test/fixtures/phase0/ evidence.
344
+ * `includeFlag`/`excludeFlag` are the per-tool NAME-LIST flags (null when
345
+ * the harness has none - codex/muse). `includeIsStrictAllowlist` records
346
+ * the claude asymmetry: claude's include flag pre-approves without
347
+ * restricting the visible set, so an exact allowlist must render as a
348
+ * disallow-complement there; pi's include IS strict (over built-ins).
349
+ * `composable`: both flags legal at once (pi: exclude subtracts from
350
+ * include). `builtins`: curated names + default-enabled state - grep/find/
351
+ * ls ship off on pi, everything ships on elsewhere. `categories`:
352
+ * non-list switches (muse disable flags, codex config booleans).
353
+ * `denySemantics`: whether a deny removes the tool from the model-visible
354
+ * set (claude/pi), policy-gates execution while the tool stays listed
355
+ * (muse), or there are no lists to deny with (codex). Extension and MCP
356
+ * tools register at runtime and are NEVER enumerated here - name
357
+ * validation is a default, not a refusal authority (same stance as the
358
+ * pi model registry, D-008). */
359
+ readonly tools: {
360
+ readonly includeFlag: string | null;
361
+ readonly excludeFlag: string | null;
362
+ readonly includeIsStrictAllowlist: boolean;
363
+ readonly composable: boolean;
364
+ readonly builtins: ReadonlyArray<{
365
+ readonly name: string;
366
+ readonly defaultEnabled: boolean;
367
+ }>;
368
+ readonly categories: ReadonlyArray<{
369
+ readonly key: "shell" | "write" | "web" | "exec" | "view-image";
370
+ readonly disableFlag: string | null;
371
+ readonly configKey: string | null;
372
+ }>;
373
+ readonly denySemantics: "remove-from-set" | "policy-gate" | "no-lists";
374
+ };
343
375
  }
@@ -110,4 +110,23 @@ export const museCode: HarnessDescriptor = deepFreeze({
110
110
  render: { kind: "flag-value", flag: "--max-model-steps" },
111
111
  },
112
112
  },
113
+ // Phase 0 fixtures: muse-category-flags.md. No name lists; category
114
+ // switches are enforcement gates - tools stay listed in the catalog but
115
+ // calls are denied per session policy (unlike claude's set removal).
116
+ // Tool names follow muse.<name> (write_file, edit_file, bash, bash_input,
117
+ // add_memory, edit_memory, web_search). --disable-web-tools has no
118
+ // normalized turnOption yet - candidate for a web toggle or passthrough.
119
+ tools: {
120
+ includeFlag: null,
121
+ excludeFlag: null,
122
+ includeIsStrictAllowlist: false,
123
+ composable: false,
124
+ builtins: [],
125
+ categories: [
126
+ { key: "write", disableFlag: "--disable-write", configKey: null },
127
+ { key: "shell", disableFlag: "--disable-shell", configKey: null },
128
+ { key: "web", disableFlag: "--disable-web-tools", configKey: null },
129
+ ],
130
+ denySemantics: "policy-gate",
131
+ },
113
132
  });
@@ -118,4 +118,25 @@ export const piCli: HarnessDescriptor = deepFreeze({
118
118
  },
119
119
  },
120
120
  },
121
+ // Phase 0 fixtures: pi-both-tool-flags.md. Both list flags legal at once;
122
+ // exclude subtracts from include. --tools is strict over BUILT-INS but
123
+ // does not strip MCP/extension registrations (additive over them);
124
+ // -nbt (built-ins only off) exists but has no normalized spelling yet.
125
+ tools: {
126
+ includeFlag: "--tools",
127
+ excludeFlag: "--exclude-tools",
128
+ includeIsStrictAllowlist: true,
129
+ composable: true,
130
+ builtins: [
131
+ { name: "read", defaultEnabled: true },
132
+ { name: "bash", defaultEnabled: true },
133
+ { name: "edit", defaultEnabled: true },
134
+ { name: "write", defaultEnabled: true },
135
+ { name: "grep", defaultEnabled: false },
136
+ { name: "find", defaultEnabled: false },
137
+ { name: "ls", defaultEnabled: false },
138
+ ],
139
+ categories: [],
140
+ denySemantics: "remove-from-set",
141
+ },
121
142
  });
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The built-in default turn profile: hcn's curated defaults for a bare run,
3
+ * decided in review (2026-08-18) and applied LAUNCH-ONLY, before user config
4
+ * and args. Every entry here is a ratified dimension; unratified dimensions
5
+ * stay absent and defer to the harness.
6
+ *
7
+ * effort: "medium" - the only value present in all four effort ladders
8
+ * (claude/pi/muse/codex-per-model). Live probe on claude 2.1.233 showed the
9
+ * internal default is above medium and nondeterministic (599-1482 thinking
10
+ * tokens on identical tasks vs 436 at medium); pinning makes bare runs
11
+ * cheaper on claude, uniform everywhere, and knowable from the outside.
12
+ */
13
+ import { deepFreeze } from "./descriptor.js";
14
+
15
+ export const DEFAULT_TURN_PROFILE = deepFreeze({
16
+ effort: "medium",
17
+ // codex-only (the only harness with a sandbox dimension). Promotes the
18
+ // descriptor's implicit workspace-write default into the visible
19
+ // profile tier. On the other three the dimension is unrenderable and
20
+ // reports as divergence.
21
+ sandbox: "workspace-write",
22
+ // Ratified: discovery fully ON. The harnesses' bare runs already
23
+ // discover instruction files, skills, and extensions; the profile makes
24
+ // that a stated contract. The off-spellings exist per harness
25
+ // (-ns/-nc/-ne on pi, --setting-sources on claude) for callers who want
26
+ // less.
27
+ discovery: { tools: true, instructionFiles: true, extensions: true, skills: true },
28
+ // Ratified: autonomy OFF. No bare run is unattended; --autonomy or a
29
+ // config must say so deliberately.
30
+ autonomy: false,
31
+ } as const);
32
+
33
+ export type ProfileKey = keyof typeof DEFAULT_TURN_PROFILE;
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Public package surface. The three architectural layers remain available as
3
- * explicit subpath exports for consumers that want the narrowest dependency.
4
- */
5
- export * from "./execution/index.js";
6
- export * from "./interpretation/index.js";
7
- export * from "./knowledge/index.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Public package surface. The three architectural layers remain available as
3
- * explicit subpath exports for consumers that want the narrowest dependency.
4
- */
5
- export * from "./execution/index.js";
6
- export * from "./interpretation/index.js";
7
- export * from "./knowledge/index.js";
8
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
package/src/index.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Public package surface. The three architectural layers remain available as
3
- * explicit subpath exports for consumers that want the narrowest dependency.
4
- */
5
- export * from "./execution/index.js";
6
- export * from "./interpretation/index.js";
7
- export * from "./knowledge/index.js";