behavior-contracts 0.8.15 → 0.8.17

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 (53) hide show
  1. package/README.md +12 -6
  2. package/cli-contract.yaml +59 -16
  3. package/dist/behavior.d.ts +28 -1
  4. package/dist/behavior.d.ts.map +1 -1
  5. package/dist/behavior.js +34 -9
  6. package/dist/behavior.js.map +1 -1
  7. package/dist/cli.js +66 -27
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/codegen.d.ts +8 -0
  10. package/dist/commands/codegen.d.ts.map +1 -1
  11. package/dist/commands/codegen.js +31 -0
  12. package/dist/commands/codegen.js.map +1 -1
  13. package/dist/generated/commands.d.ts.map +1 -1
  14. package/dist/generated/commands.js +4 -0
  15. package/dist/generated/commands.js.map +1 -1
  16. package/dist/generated/contract.d.ts.map +1 -1
  17. package/dist/generated/contract.js +2 -2
  18. package/dist/generated/contract.js.map +1 -1
  19. package/dist/generated/program.d.ts +2 -0
  20. package/dist/generated/program.d.ts.map +1 -1
  21. package/dist/generated/program.js +6 -4
  22. package/dist/generated/program.js.map +1 -1
  23. package/dist/generated/types.d.ts +3 -1
  24. package/dist/generated/types.d.ts.map +1 -1
  25. package/dist/generator/emit-shared-debox.d.ts +19 -5
  26. package/dist/generator/emit-shared-debox.d.ts.map +1 -1
  27. package/dist/generator/emit-shared-debox.js +30 -10
  28. package/dist/generator/emit-shared-debox.js.map +1 -1
  29. package/dist/generator/emit-shared-go-typed.d.ts.map +1 -1
  30. package/dist/generator/emit-shared-go-typed.js +6 -0
  31. package/dist/generator/emit-shared-go-typed.js.map +1 -1
  32. package/dist/generator/emit-shared-typescript.d.ts.map +1 -1
  33. package/dist/generator/emit-shared-typescript.js +15 -4
  34. package/dist/generator/emit-shared-typescript.js.map +1 -1
  35. package/dist/generator/emit-straightline-typed-typescript.d.ts.map +1 -1
  36. package/dist/generator/emit-straightline-typed-typescript.js +4 -0
  37. package/dist/generator/emit-straightline-typed-typescript.js.map +1 -1
  38. package/dist/generator/emit-typed-native-go.d.ts +6 -0
  39. package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
  40. package/dist/generator/emit-typed-native-go.js +34 -14
  41. package/dist/generator/emit-typed-native-go.js.map +1 -1
  42. package/dist/generator/emit-typed-native-rust.d.ts +12 -0
  43. package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
  44. package/dist/generator/emit-typed-native-rust.js +131 -23
  45. package/dist/generator/emit-typed-native-rust.js.map +1 -1
  46. package/dist/generator/index.d.ts +2 -2
  47. package/dist/generator/index.d.ts.map +1 -1
  48. package/dist/generator/index.js +2 -2
  49. package/dist/generator/index.js.map +1 -1
  50. package/dist/guard.d.ts.map +1 -1
  51. package/dist/guard.js +8 -0
  52. package/dist/guard.js.map +1 -1
  53. package/package.json +1 -1
@@ -4,6 +4,14 @@ import { type ComponentGraphIRDoc, type GenerateOptions } from "../index.js";
4
4
  * types package) are forwarded verbatim to the emitter options of the same name; other emitters ignore
5
5
  * them. Omitted → the emitter's default transport symbols / in-package wire types. */
6
6
  export declare function generateFromDoc(doc: ComponentGraphIRDoc, language: string, runtimeImport?: string, leafTransport?: GenerateOptions["leafTransport"], sharedTypesImport?: string): string;
7
+ /** A serialized IR doc → the BC-OWNED shared wire types module (the same one the covered module imports when
8
+ * generated with --shared-types-import). NO emit logic is reimplemented: this validates the emitter then
9
+ * dispatches to the EXISTING rustSharedWireTypesModule / goSharedWireTypesPackage over the SAME loadCompiledIR
10
+ * the covered path uses. Only go-typed-native / rust-typed-native own a shared module — any other --lang is a
11
+ * loud error. For go the package name is SSoT-derived from `sharedTypesImport` (goSharedTypesPackageName, the
12
+ * SAME normalization resolveGoWire uses to selector-qualify the hoisted types), so --shared-types-import is
13
+ * required; rust's shared module content needs no import. */
14
+ export declare function generateSharedTypesFromDoc(doc: ComponentGraphIRDoc, language: string, sharedTypesImport?: string): string;
7
15
  /** Read + parse a serialized ComponentGraphIRDoc from disk. */
8
16
  export declare function readDoc(inPath: string): ComponentGraphIRDoc;
9
17
  //# sourceMappingURL=codegen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAYA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB;;;sFAGsF;AACtF,wBAAgB,eAAe,CAC7B,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,EAChD,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,CAaR;AAED,+DAA+D;AAC/D,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAY3D"}
1
+ {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAYA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAUrB;;;sFAGsF;AACtF,wBAAgB,eAAe,CAC7B,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,EAChD,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,CAaR;AAKD;;;;;;6DAM6D;AAC7D,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,CAsBR;AAED,+DAA+D;AAC/D,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAY3D"}
@@ -11,6 +11,10 @@
11
11
  // ════════════════════════════════════════════════════════════════════════════
12
12
  import { readFileSync } from "node:fs";
13
13
  import { loadCompiledIR, generateModule, registeredLanguages, } from "../index.js";
14
+ // The BC-owned shared wire types emitters are package-INTERNAL (not part of the consumer-facing public API in
15
+ // ../index.ts): the CLI is the only supported entry to emit them (bc generate --shared-types-out), so they are
16
+ // imported from the internal generator barrel, not re-exported to consumers.
17
+ import { rustSharedWireTypesModule, goSharedWireTypesPackage, goSharedTypesPackageName, } from "../generator/index.js";
14
18
  /** A serialized IR doc → the native module source (same path as the in-process API).
15
19
  * `leafTransport` (native emitters only) + `sharedTypesImport` (go cross-package: BC-generated shared wire
16
20
  * types package) are forwarded verbatim to the emitter options of the same name; other emitters ignore
@@ -30,6 +34,33 @@ export function generateFromDoc(doc, language, runtimeImport, leafTransport, sha
30
34
  const module = generateModule(compiled, options);
31
35
  return module.code;
32
36
  }
37
+ /** The emitters that own a BC-generated shared wire types module (the cross-package / cross-crate layout). */
38
+ const SHARED_TYPES_LANGUAGES = ["go-typed-native", "rust-typed-native"];
39
+ /** A serialized IR doc → the BC-OWNED shared wire types module (the same one the covered module imports when
40
+ * generated with --shared-types-import). NO emit logic is reimplemented: this validates the emitter then
41
+ * dispatches to the EXISTING rustSharedWireTypesModule / goSharedWireTypesPackage over the SAME loadCompiledIR
42
+ * the covered path uses. Only go-typed-native / rust-typed-native own a shared module — any other --lang is a
43
+ * loud error. For go the package name is SSoT-derived from `sharedTypesImport` (goSharedTypesPackageName, the
44
+ * SAME normalization resolveGoWire uses to selector-qualify the hoisted types), so --shared-types-import is
45
+ * required; rust's shared module content needs no import. */
46
+ export function generateSharedTypesFromDoc(doc, language, sharedTypesImport) {
47
+ if (!registeredLanguages().includes(language)) {
48
+ throw new Error(`--lang '${language}' is not a registered emitter (registered: ${registeredLanguages().join(", ")})`);
49
+ }
50
+ if (!SHARED_TYPES_LANGUAGES.includes(language)) {
51
+ throw new Error(`--shared-types-out is only supported for ${SHARED_TYPES_LANGUAGES.join(" / ")} (got --lang '${language}')`);
52
+ }
53
+ const compiled = loadCompiledIR(doc); // same adopt path the covered module uses (recompute + mint provenance)
54
+ if (language === "rust-typed-native")
55
+ return rustSharedWireTypesModule(compiled);
56
+ // go: the shared package's Go identifier must be derived from --shared-types-import via the SAME
57
+ // normalization the covered module uses to reference it, so --shared-types-import is required.
58
+ if (sharedTypesImport === undefined) {
59
+ throw new Error("--shared-types-out for go-typed-native requires --shared-types-import (the shared package's Go import " +
60
+ "path — its last segment names the emitted package, matching what the covered module imports)");
61
+ }
62
+ return goSharedWireTypesPackage(goSharedTypesPackageName(sharedTypesImport), compiled);
63
+ }
33
64
  /** Read + parse a serialized ComponentGraphIRDoc from disk. */
34
65
  export function readDoc(inPath) {
35
66
  let raw;
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6DAA6D;AAC7D,EAAE;AACF,8EAA8E;AAC9E,yEAAyE;AACzE,4EAA4E;AAC5E,oDAAoD;AACpD,EAAE;AACF,gFAAgF;AAChF,sEAAsE;AACtE,+EAA+E;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,GAGpB,MAAM,aAAa,CAAC;AAErB;;;sFAGsF;AACtF,MAAM,UAAU,eAAe,CAC7B,GAAwB,EACxB,QAAgB,EAChB,aAAsB,EACtB,aAAgD,EAChD,iBAA0B;IAE1B,IAAI,CAAC,mBAAmB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,WAAW,QAAQ,8CAA8C,mBAAmB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrG,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,oEAAoE;IAC1G,MAAM,OAAO,GAAoB,EAAE,QAAQ,EAAE,CAAC;IAC9C,IAAI,aAAa,KAAK,SAAS;QAAE,OAAO,CAAC,aA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appings":"AAMA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,eAAe,CAAC,GACtD,OAAO,CAAC,UAAU,CAAC,CAuBrB;AAED,wBAAsB,OAAO,CAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,YAAY,CAAC,GACnD,OAAO,CAAC,UAAU,CAAC,CAuBrB"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/generated/commands.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,eAAe,CAAC,GACtD,OAAO,CAAC,UAAU,CAAC,CAwBrB;AAED,wBAAsB,OAAO,CAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,YAAY,CAAC,GACnD,OAAO,CAAC,UAAU,CAAC,CAwBrB"}
@@ -11,6 +11,8 @@ export async function bcGenerate(executable, options) {
11
11
  cmdArgs.push("--in", String(options.in));
12
12
  if (options.out !== undefined)
13
13
  cmdArgs.push("--out", String(options.out));
14
+ if (options.sharedTypesOut !== undefined)
15
+ cmdArgs.push("--shared-types-out", String(options.sharedTypesOut));
14
16
  if (options.runtimeImport !== undefined)
15
17
  cmdArgs.push("--runtime-import", String(options.runtimeImport));
16
18
  if (options.sharedTypesImport !== undefined)
@@ -42,6 +44,8 @@ export async function bcCheck(executable, options) {
42
44
  cmdArgs.push("--in", String(options.in));
43
45
  if (options.out !== undefined)
44
46
  cmdArgs.push("--out", String(options.out));
47
+ if (options.sharedTypesOut !== undefined)
48
+ cmdArgs.push("--shared-types-out", String(options.sharedTypesOut));
45
49
  if (options.runtimeImport !== undefined)
46
50
  cmdArgs.push("--runtime-import", String(options.runtimeImport));
47
51
  if (options.sharedTypesImport !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/generated/commands.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAQ1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAkB,EAClB,OAAuD;IAEvD,MAAM,OAAO,GAAa,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7E,IAAI,OAAO,CAAC,EAAE,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1E,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QACzG,IAAI,OAAO,CAAC,iBAAiB,KAAK,SAAS;Y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,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;YACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;SACvB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAA6nT,CAAC;AAE1pT,eAAO,MAAM,iBAAiB,EAAE,MAA2rX,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAAmzX,CAAC;AAEh1X,eAAO,MAAM,iBAAiB,EAAE,MAA4xb,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Auto-generated by cli-contracts. Do not edit.
2
2
  // Embedded contract for the extract subcommand.
3
- export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: behavior-contracts CLI\n version: 0.1.0\n description: >-\n bc — the build-time codegen CLI over behavior-contracts' public API.\n Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it\n via loadCompiledIR, and runs the same generateModule the in-process API runs\n to emit a runtime-free native module (data baked as literals). The IR doc is\n a build-time input only; nothing reads it at runtime.\n license:\n name: MIT\n contact:\n name: foo-ogawa\n url: https://github.com/foo-ogawa/behavior-contracts\n\nartifact_slots:\n ir-doc:\n direction: read\n description: Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\n generated-module:\n direction: write\n description: Generated native module source (baked-literal, runtime-free).\n\ncommand_sets:\n bc:\n summary: build-time codegen CLI over behavior-contracts' public API.\n executable: bc\n\n global_options:\n - name: version\n aliases: [V]\n description: Print version and exit.\n schema:\n type: boolean\n\n - name: help\n aliases: [h]\n description: Show help and exit.\n schema:\n type: boolean\n\n commands:\n # ── generate ─────────────────────────────────────────\n generate:\n summary: Emit a native module from a serialized IR doc.\n description: >-\n Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and\n runs generateModule for the --lang emitter. Writes the module source\n to --out if given, else to stdout. Rejects an unregistered --lang.\n usage:\n - bc generate --lang rust-typed-native --in ir-doc.json\n - bc generate --lang go-typed-native --in ir-doc.json --out gen.go\n - bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\n\n options:\n - name: lang\n required: true\n description: >-\n Target emitter (must be a registered language, e.g.\n rust-typed-native, go-typed-native, typescript-typed).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: Write the generated module here instead of stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native only) Go package path for the BC-GENERATED\n shared wire types (WireValue/WireRow/WireList). When set, BC emits\n those types into that shared package and the covered module imports +\n qualifies them, so a separate leaf-transport package can return them\n without an import cycle (cross-package layout). Absent → in-package.\n Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Module generated (written to --out, or printed to stdout).\n stdout:\n format: text\n '1':\n description: >-\n Generation failed (unreadable/invalid --in, or --lang is not a\n registered emitter).\n stderr:\n format: text\n '2':\n description: Usage error — a required option (--lang or --in) was omitted.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects:\n - file_write\n sideEffectNote: >-\n Writes to the filesystem only when --out is specified; otherwise\n output goes to stdout.\n\n # ── check ────────────────────────────────────────────\n check:\n summary: Verify a committed module matches a fresh generation (drift gate).\n description: >-\n Regenerates the module from --in for --lang and byte-compares it\n against the committed --out file. Exits non-zero on drift. This is the\n build's codegen drift gate.\n usage:\n - bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\n\n options:\n - name: lang\n required: true\n description: Target emitter (must be a registered language).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: true\n description: The committed module file to diff a fresh generation against.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native only) Go package path for the BC-GENERATED\n shared wire types (WireValue/WireRow/WireList). When set, BC emits\n those types into that shared package and the covered module imports +\n qualifies them, so a separate leaf-transport package can return them\n without an import cycle (cross-package layout). Absent → in-package.\n Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Up to date — the committed --out matches a fresh generation.\n stdout:\n format: text\n '1':\n description: >-\n Drift detected (--out differs or does not exist), or generation\n failed (unreadable/invalid --in, or unregistered --lang).\n stderr:\n format: text\n '2':\n description: Usage error — a required option (--lang or --in) was omitted.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n";
4
- export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"behavior-contracts CLI\",\n \"version\": \"0.1.0\",\n \"description\": \"bc — the build-time codegen CLI over behavior-contracts' public API. Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it via loadCompiledIR, and runs the same generateModule the in-process API runs to emit a runtime-free native module (data baked as literals). The IR doc is a build-time input only; nothing reads it at runtime.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-ogawa\",\n \"url\": \"https://github.com/foo-ogawa/behavior-contracts\"\n }\n },\n \"artifact_slots\": {\n \"ir-doc\": {\n \"direction\": \"read\",\n \"description\": \"Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\"\n },\n \"generated-module\": {\n \"direction\": \"write\",\n \"description\": \"Generated native module source (baked-literal, runtime-free).\"\n }\n },\n \"command_sets\": {\n \"bc\": {\n \"summary\": \"build-time codegen CLI over behavior-contracts' public API.\",\n \"executable\": \"bc\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Print version and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Show help and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"generate\": {\n \"summary\": \"Emit a native module from a serialized IR doc.\",\n \"description\": \"Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and runs generateModule for the --lang emitter. Writes the module source to --out if given, else to stdout. Rejects an unregistered --lang.\",\n \"usage\": [\n \"bc generate --lang rust-typed-native --in ir-doc.json\",\n \"bc generate --lang go-typed-native --in ir-doc.json --out gen.go\",\n \"bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"Write the generated module here instead of stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Module generated (written to --out, or printed to stdout).\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Generation failed (unreadable/invalid --in, or --lang is not a registered emitter).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"file_write\"\n ],\n \"sideEffectNote\": \"Writes to the filesystem only when --out is specified; otherwise output goes to stdout.\"\n }\n },\n \"check\": {\n \"summary\": \"Verify a committed module matches a fresh generation (drift gate).\",\n \"description\": \"Regenerates the module from --in for --lang and byte-compares it against the committed --out file. Exits non-zero on drift. This is the build's codegen drift gate.\",\n \"usage\": [\n \"bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": true,\n \"description\": \"The committed module file to diff a fresh generation against.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Up to date — the committed --out matches a fresh generation.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Drift detected (--out differs or does not exist), or generation failed (unreadable/invalid --in, or unregistered --lang).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n }\n }\n }\n}";
3
+ export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: behavior-contracts CLI\n version: 0.1.0\n description: >-\n bc — the build-time codegen CLI over behavior-contracts' public API.\n Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it\n via loadCompiledIR, and runs the same generateModule the in-process API runs\n to emit a runtime-free native module (data baked as literals). The IR doc is\n a build-time input only; nothing reads it at runtime.\n license:\n name: MIT\n contact:\n name: foo-ogawa\n url: https://github.com/foo-ogawa/behavior-contracts\n\nartifact_slots:\n ir-doc:\n direction: read\n description: Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\n generated-module:\n direction: write\n description: Generated native module source (baked-literal, runtime-free).\n\ncommand_sets:\n bc:\n summary: build-time codegen CLI over behavior-contracts' public API.\n executable: bc\n\n global_options:\n - name: version\n aliases: [V]\n description: Print version and exit.\n schema:\n type: boolean\n\n - name: help\n aliases: [h]\n description: Show help and exit.\n schema:\n type: boolean\n\n commands:\n # ── generate ─────────────────────────────────────────\n generate:\n summary: Emit a native module from a serialized IR doc.\n description: >-\n Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and\n runs generateModule for the --lang emitter. Writes the module source\n to --out if given, else to stdout. Rejects an unregistered --lang.\n usage:\n - bc generate --lang rust-typed-native --in ir-doc.json\n - bc generate --lang go-typed-native --in ir-doc.json --out gen.go\n - bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\n\n options:\n - name: lang\n required: true\n description: >-\n Target emitter (must be a registered language, e.g.\n rust-typed-native, go-typed-native, typescript-typed).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: Write the generated covered module here instead of stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Write the BC-OWNED\n shared wire types module (WireValue/WireRow/WireList + probe kinds,\n rust also the shared BehaviorError; plus the cross-package/-crate\n batch ports structs) here. This is the module a covered module built\n with --shared-types-import imports. Independent of --out: a build may\n emit the covered module, the shared module, or both. For go the\n emitted package name is derived from --shared-types-import (so\n --shared-types-import is required with go). Rejected for other\n emitters. A standalone --shared-types-out does NOT print the covered\n module to stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Module generated (written to --out, or printed to stdout).\n stdout:\n format: text\n '1':\n description: >-\n Generation failed (unreadable/invalid --in, or --lang is not a\n registered emitter).\n stderr:\n format: text\n '2':\n description: Usage error — a required option (--lang or --in) was omitted.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects:\n - file_write\n sideEffectNote: >-\n Writes to the filesystem only when --out is specified; otherwise\n output goes to stdout.\n\n # ── check ────────────────────────────────────────────\n check:\n summary: Verify a committed module matches a fresh generation (drift gate).\n description: >-\n Regenerates the module from --in for --lang and byte-compares it\n against the committed --out file. Exits non-zero on drift. This is the\n build's codegen drift gate.\n usage:\n - bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\n\n options:\n - name: lang\n required: true\n description: Target emitter (must be a registered language).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: >-\n The committed covered-module file to diff a fresh generation\n against. At least one of --out / --shared-types-out is required.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) The committed BC-OWNED\n shared wire types module to diff a fresh generation against (drift\n gate for the file emitted by `generate --shared-types-out`). May be\n checked together with --out in one invocation; at least one of\n --out / --shared-types-out is required. For go, --shared-types-import\n is required (it names the package). Rejected for other emitters.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Up to date — the committed --out matches a fresh generation.\n stdout:\n format: text\n '1':\n description: >-\n Drift detected (--out differs or does not exist), or generation\n failed (unreadable/invalid --in, or unregistered --lang).\n stderr:\n format: text\n '2':\n description: >-\n Usage error — a required option (--lang or --in) was omitted, or\n neither --out nor --shared-types-out was given.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n";
4
+ export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"behavior-contracts CLI\",\n \"version\": \"0.1.0\",\n \"description\": \"bc — the build-time codegen CLI over behavior-contracts' public API. Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it via loadCompiledIR, and runs the same generateModule the in-process API runs to emit a runtime-free native module (data baked as literals). The IR doc is a build-time input only; nothing reads it at runtime.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-ogawa\",\n \"url\": \"https://github.com/foo-ogawa/behavior-contracts\"\n }\n },\n \"artifact_slots\": {\n \"ir-doc\": {\n \"direction\": \"read\",\n \"description\": \"Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\"\n },\n \"generated-module\": {\n \"direction\": \"write\",\n \"description\": \"Generated native module source (baked-literal, runtime-free).\"\n }\n },\n \"command_sets\": {\n \"bc\": {\n \"summary\": \"build-time codegen CLI over behavior-contracts' public API.\",\n \"executable\": \"bc\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Print version and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Show help and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"generate\": {\n \"summary\": \"Emit a native module from a serialized IR doc.\",\n \"description\": \"Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and runs generateModule for the --lang emitter. Writes the module source to --out if given, else to stdout. Rejects an unregistered --lang.\",\n \"usage\": [\n \"bc generate --lang rust-typed-native --in ir-doc.json\",\n \"bc generate --lang go-typed-native --in ir-doc.json --out gen.go\",\n \"bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"Write the generated covered module here instead of stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Write the BC-OWNED shared wire types module (WireValue/WireRow/WireList + probe kinds, rust also the shared BehaviorError; plus the cross-package/-crate batch ports structs) here. This is the module a covered module built with --shared-types-import imports. Independent of --out: a build may emit the covered module, the shared module, or both. For go the emitted package name is derived from --shared-types-import (so --shared-types-import is required with go). Rejected for other emitters. A standalone --shared-types-out does NOT print the covered module to stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Module generated (written to --out, or printed to stdout).\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Generation failed (unreadable/invalid --in, or --lang is not a registered emitter).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"file_write\"\n ],\n \"sideEffectNote\": \"Writes to the filesystem only when --out is specified; otherwise output goes to stdout.\"\n }\n },\n \"check\": {\n \"summary\": \"Verify a committed module matches a fresh generation (drift gate).\",\n \"description\": \"Regenerates the module from --in for --lang and byte-compares it against the committed --out file. Exits non-zero on drift. This is the build's codegen drift gate.\",\n \"usage\": [\n \"bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"The committed covered-module file to diff a fresh generation against. At least one of --out / --shared-types-out is required.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) The committed BC-OWNED shared wire types module to diff a fresh generation against (drift gate for the file emitted by `generate --shared-types-out`). May be checked together with --out in one invocation; at least one of --out / --shared-types-out is required. For go, --shared-types-import is required (it names the package). Rejected for other emitters.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Up to date — the committed --out matches a fresh generation.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Drift detected (--out differs or does not exist), or generation failed (unreadable/invalid --in, or unregistered --lang).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted, or neither --out nor --shared-types-out was given.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n }\n }\n }\n}";
5
5
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,onTAAonT,CAAC;AAE1pT,MAAM,CAAC,MAAM,iBAAiB,GAAW,krXAAkrX,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,0yXAA0yX,CAAC;AAEh1X,MAAM,CAAC,MAAM,iBAAiB,GAAW,mxbAAmxb,CAAC"}
@@ -4,6 +4,7 @@ export interface CommandHandlers {
4
4
  lang?: string;
5
5
  in?: string;
6
6
  out?: string;
7
+ sharedTypesOut?: string;
7
8
  runtimeImport?: string;
8
9
  sharedTypesImport?: string;
9
10
  leafTransport?: string;
@@ -13,6 +14,7 @@ export interface CommandHandlers {
13
14
  lang?: string;
14
15
  in?: string;
15
16
  out?: string;
17
+ sharedTypesOut?: string;
16
18
  runtimeImport?: string;
17
19
  sharedTypesImport?: string;
18
20
  leafTransport?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClO,KAAK,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChO;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CAyHT"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3P,KAAK,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzP;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CA2HT"}
@@ -12,9 +12,10 @@ export function createProgram(handlers, version) {
12
12
  .description("Emit a native module from a serialized IR doc.")
13
13
  .option("--lang <emitter>", "Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).")
14
14
  .option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
15
- .option("--out <file>", "Write the generated module here instead of stdout.")
15
+ .option("--out <file>", "Write the generated covered module here instead of stdout.")
16
+ .option("--shared-types-out <file>", "(--lang go-typed-native / rust-typed-native) Write the BC-OWNED shared wire types module (WireValue/WireRow/WireList + probe kinds, rust also the shared BehaviorError; plus the cross-package/-crate batch ports structs) here. This is the module a covered module built with --shared-types-import imports. Independent of --out: a build may emit the covered module, the shared module, or both. For go the emitted package name is derived from --shared-types-import (so --shared-types-import is required with go). Rejected for other emitters. A standalone --shared-types-out does NOT print the covered module to stdout.")
16
17
  .option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
17
- .option("--shared-types-import <spec>", "(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.")
18
+ .option("--shared-types-import <spec>", "(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.")
18
19
  .option("--leaf-transport <mapping...>", "(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.")
19
20
  .option("--leaf-transport-import <module>", "(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.")
20
21
  .action(async (opts, cmd) => {
@@ -25,9 +26,10 @@ export function createProgram(handlers, version) {
25
26
  .description("Verify a committed module matches a fresh generation (drift gate).")
26
27
  .option("--lang <emitter>", "Target emitter (must be a registered language).")
27
28
  .option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
28
- .option("--out <file>", "The committed module file to diff a fresh generation against.")
29
+ .option("--out <file>", "The committed covered-module file to diff a fresh generation against. At least one of --out / --shared-types-out is required.")
30
+ .option("--shared-types-out <file>", "(--lang go-typed-native / rust-typed-native) The committed BC-OWNED shared wire types module to diff a fresh generation against (drift gate for the file emitted by `generate --shared-types-out`). May be checked together with --out in one invocation; at least one of --out / --shared-types-out is required. For go, --shared-types-import is required (it names the package). Rejected for other emitters.")
29
31
  .option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
30
- .option("--shared-types-import <spec>", "(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.")
32
+ .option("--shared-types-import <spec>", "(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.")
31
33
  .option("--leaf-transport <mapping...>", "(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.")
32
34
  .option("--leaf-transport-import <module>", "(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.")
33
35
  .action(async (opts, cmd) => {
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OA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AK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACL,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -2,6 +2,7 @@ export interface GenerateOptions {
2
2
  lang: string;
3
3
  in: string;
4
4
  out?: string;
5
+ sharedTypesOut?: string;
5
6
  runtimeImport?: string;
6
7
  sharedTypesImport?: string;
7
8
  leafTransport?: string[];
@@ -21,7 +22,8 @@ export type GenerateExitResult = {
21
22
  export interface CheckOptions {
22
23
  lang: string;
23
24
  in: string;
24
- out: string;
25
+ out?: string;
26
+ sharedTypesOut?: string;
25
27
  runtimeImport?: string;
26
28
  sharedTypesImport?: string;
27
29
  leafTransport?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEzC,MAAM,MAAM,kBAAkB,GAC5B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,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E,GAChC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtC,MAAM,MAAM,eAAe,GACzB;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -92,8 +92,10 @@ export type WirePlan = ({
92
92
  k: "map";
93
93
  value: WirePlan;
94
94
  } & DeBoxCommon);
95
- /** DeBoxPlan — alias for {@link WirePlan}. A de-box (OUT) plan never contains a `value` node (fail-closed
96
- * at plan build), so the de-box renderers carry an unreachable exhaustiveness guard for it. */
95
+ /** DeBoxPlan — alias for {@link WirePlan}. A de-box (OUT) plan contains a `value` node ONLY when built for
96
+ * an explicitly output-passthrough node (bc#164), at its top-level output or the direct element of a
97
+ * top-level `arr`; otherwise a `value` is fail-closed at plan build. The de-box renderers store a `value`
98
+ * node's wire AS-IS (no probe, no per-op re-box) and keep an exhaustiveness guard for the fail-closed case. */
97
99
  export type DeBoxPlan = WirePlan;
98
100
  /**
99
101
  * notationOfRef — the Portable Type Notation of a TypeRef (scp-error.md), resolving a named ref to its
@@ -115,18 +117,30 @@ export type WireDir = "in" | "out";
115
117
  * `dir` governs the one type that is direction-asymmetric: `value` (the opaque BC wire, INPUT-only) is a
116
118
  * `value` plan node on the IN (box = identity) path and a fail-closed codegen error on the OUT (de-box)
117
119
  * path — enforcing "value is input-only; a value in an output position is rejected".
120
+ *
121
+ * `passthrough` (bc#164) is the ONE guarded relaxation of that OUT fail-close: a covered node EXPLICITLY
122
+ * flagged output-passthrough carries an OPAQUE-WIRE output (`value` or `{arr:"value"}`) so its result stays
123
+ * `WireValue` / `Vec<WireValue>` and feeds a downstream op-agnostic leaf with NO per-op `typed→Value`
124
+ * re-box. When set, a `value` at the node's TOP-LEVEL output (or the direct element of a top-level `arr`)
125
+ * is admitted as a `value` plan node (the renderer stores the wire AS-IS). It does NOT propagate into a
126
+ * record field or a map value: a `value` nested inside a NON-passthrough position stays fail-closed
127
+ * (no blanket relaxation, no untyped escape into the typed covered plane). The legal passthrough shapes are
128
+ * exactly `value` and `{arr:"value"}` (validated at the flag's read sites — guard / interpreter / emitter).
118
129
  */
119
130
  export declare function buildWirePlan(ref: TypeRef, access: DeBoxAccess, ctx: {
120
131
  model: string;
121
132
  field: string;
122
133
  plan: TypePlan;
123
- }, dir: WireDir): WirePlan;
134
+ }, dir: WireDir, passthrough?: boolean): WirePlan;
124
135
  /** buildDeBoxPlan — the OUT (wire→typed) entry: {@link buildWirePlan} in the de-box direction. The
125
- * existing de-box call sites consume this; the walk is shared with the box (IN) direction. */
136
+ * existing de-box call sites consume this; the walk is shared with the box (IN) direction. `passthrough`
137
+ * (bc#164) admits an opaque `value` at the flagged node's top-level output (or top-level `arr` element) —
138
+ * the renderer stores that wire AS-IS. When unset (the default), a `value` in an output position stays
139
+ * fail-closed exactly as before. */
126
140
  export declare function buildDeBoxPlan(ref: TypeRef, access: DeBoxAccess, ctx: {
127
141
  model: string;
128
142
  field: string;
129
143
  plan: TypePlan;
130
- }): DeBoxPlan;
144
+ }, passthrough?: boolean): DeBoxPlan;
131
145
  export {};
132
146
  //# sourceMappingURL=emit-shared-debox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit-shared-debox.d.ts","sourceRoot":"","sources":["../../src/generator/emit-shared-debox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnE;2EAC2E;AAC3E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEnH;;;wGAGwG;AACxG,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB;mEAC+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd;iEAC6D;IAC7D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;gEAMgE;AAChE,MAAM,MAAM,QAAQ,GAChB,CAAC;IAAE,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,WAAW,CAAC,GACpD,CAAC;IAAE,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,WAAW,CAAC,GAC9B,CAAC;IAAE,CAAC,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAA;CAA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AAE,QAAQ,GAAG,MAAM,CAkBlE;AAYD;;iGAEiG;AACjG,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,EACrD,GAAG,EAAE,OAAO,EACZ,WAAW,UAAQ,GAClB,QAAQ,CAuDV;AAED;;;;oCAIoC;AACpC,wBAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,EACrD,WAAW,UAAQ,GAClB,SAAS,CAKX"}
@@ -73,8 +73,17 @@ function deBoxUnsupported(message) {
73
73
  * `dir` governs the one type that is direction-asymmetric: `value` (the opaque BC wire, INPUT-only) is a
74
74
  * `value` plan node on the IN (box = identity) path and a fail-closed codegen error on the OUT (de-box)
75
75
  * path — enforcing "value is input-only; a value in an output position is rejected".
76
+ *
77
+ * `passthrough` (bc#164) is the ONE guarded relaxation of that OUT fail-close: a covered node EXPLICITLY
78
+ * flagged output-passthrough carries an OPAQUE-WIRE output (`value` or `{arr:"value"}`) so its result stays
79
+ * `WireValue` / `Vec<WireValue>` and feeds a downstream op-agnostic leaf with NO per-op `typed→Value`
80
+ * re-box. When set, a `value` at the node's TOP-LEVEL output (or the direct element of a top-level `arr`)
81
+ * is admitted as a `value` plan node (the renderer stores the wire AS-IS). It does NOT propagate into a
82
+ * record field or a map value: a `value` nested inside a NON-passthrough position stays fail-closed
83
+ * (no blanket relaxation, no untyped escape into the typed covered plane). The legal passthrough shapes are
84
+ * exactly `value` and `{arr:"value"}` (validated at the flag's read sites — guard / interpreter / emitter).
76
85
  */
77
- export function buildWirePlan(ref, access, ctx, dir) {
86
+ export function buildWirePlan(ref, access, ctx, dir, passthrough = false) {
78
87
  const { plan } = ctx;
79
88
  const expectedType = notationOfRef(ref, plan);
80
89
  // Strip optional layers, counting depth; the presence logic is single-bit at the wire (a nested
@@ -97,15 +106,18 @@ export function buildWirePlan(ref, access, ctx, dir) {
97
106
  }
98
107
  case "value":
99
108
  // bc#156: the opaque BC-owned wire. IN (box) = identity (the datum is already a WireValue). OUT
100
- // (de-box) = fail-closed: `value` is an INPUT-only declared type; a `value` in an output position
101
- // is a codegen error (never a silent boxed escape into the typed covered plane).
102
- if (dir === "out")
103
- deBoxUnsupported(`wire out: '${ctx.field}' of '${ctx.model}' is a 'value' (opaque wire), which is INPUT-only and has no output de-box`);
109
+ // (de-box) = fail-closed by default: `value` is an INPUT-only declared type; a `value` in an output
110
+ // position is a codegen error (never a silent boxed escape into the typed covered plane). bc#164: the
111
+ // ONE guarded relaxation — an EXPLICITLY flagged output-passthrough node's top-level output (or the
112
+ // direct element of its top-level `arr`) admits the opaque wire, stored AS-IS by the renderer.
113
+ if (dir === "out" && !passthrough)
114
+ deBoxUnsupported(`wire out: '${ctx.field}' of '${ctx.model}' is a 'value' (opaque wire), which is INPUT-only and has no output de-box (a node needs the explicit output-passthrough flag to carry a 'value' output)`);
104
115
  return { k: "value", ...common };
105
116
  case "named": {
106
117
  const decl = findDecl(plan, base.name);
107
118
  if (decl === undefined)
108
119
  deBoxUnsupported(`wire ${dir}: named type '${base.name}' is not in the type plan`);
120
+ // A record field is NOT a passthrough position — a `value` nested in an obj stays fail-closed.
109
121
  const fields = decl.fields.map((f) => ({
110
122
  name: f.name,
111
123
  plan: buildWirePlan(f.type, { from: "field", key: f.name }, { model: base.name, field: f.name, plan }, dir),
@@ -113,10 +125,13 @@ export function buildWirePlan(ref, access, ctx, dir) {
113
125
  return { k: "record", typeName: base.name, fields, ...common };
114
126
  }
115
127
  case "arr": {
116
- const elem = buildWirePlan(base.elem, { from: "elem" }, { model: ctx.model, field: ctx.field, plan }, dir);
128
+ // bc#164: passthrough flows into the DIRECT element (so `{arr:"value"}` = `Vec<WireValue>` is admitted);
129
+ // the legal passthrough shape is only `value` / `{arr:"value"}` (enforced at the flag's read sites).
130
+ const elem = buildWirePlan(base.elem, { from: "elem" }, { model: ctx.model, field: ctx.field, plan }, dir, passthrough);
117
131
  return { k: "list", elem, ...common };
118
132
  }
119
133
  case "map": {
134
+ // A map value is NOT a passthrough position — a `value` map value stays fail-closed.
120
135
  const value = buildWirePlan(base.value, { from: "mapval" }, { model: ctx.model, field: ctx.field, plan }, dir);
121
136
  return { k: "map", value, ...common };
122
137
  }
@@ -126,9 +141,14 @@ export function buildWirePlan(ref, access, ctx, dir) {
126
141
  }
127
142
  }
128
143
  /** buildDeBoxPlan — the OUT (wire→typed) entry: {@link buildWirePlan} in the de-box direction. The
129
- * existing de-box call sites consume this; the walk is shared with the box (IN) direction. */
130
- export function buildDeBoxPlan(ref, access, ctx) {
131
- // "out" fail-closes a `value` node at plan build, so the result provably excludes `{k:"value"}`.
132
- return buildWirePlan(ref, access, ctx, "out");
144
+ * existing de-box call sites consume this; the walk is shared with the box (IN) direction. `passthrough`
145
+ * (bc#164) admits an opaque `value` at the flagged node's top-level output (or top-level `arr` element) —
146
+ * the renderer stores that wire AS-IS. When unset (the default), a `value` in an output position stays
147
+ * fail-closed exactly as before. */
148
+ export function buildDeBoxPlan(ref, access, ctx, passthrough = false) {
149
+ // Without passthrough, "out" fail-closes every `value` node at plan build, so the result provably
150
+ // excludes `{k:"value"}` (the renderers keep an exhaustiveness guard). With passthrough, a top-level
151
+ // `value` / `{arr:"value"}` survives as a `value` plan node the renderer stores raw.
152
+ return buildWirePlan(ref, access, ctx, "out", passthrough);
133
153
  }
134
154
  //# sourceMappingURL=emit-shared-debox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit-shared-debox.js","sourceRoot":"","sources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iBAAS,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAOhF;AAED,uCAAuC;AACvC,iBAAS,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAkB1C;AAID,iBAAS,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAMvD;AAED,6CAA6C;AAC7C,iBAAS,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAGlD;AAED,qFAAqF;AACrF,iBAAS,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAgD/C;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAyEvE;AAqBD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;uCAsBQ,SAAS;;;;;CAM7C,CAAC"}
@@ -2,6 +2,7 @@ import { deriveTypeRef, findDecl, inputPortTypeRef, } from "./typed.js";
2
2
  import { goStraightlineInternals, setGoForceRunPlanHelpers } from "./emit-shared-go.js";
3
3
  import { buildComponentPlan } from "./straightline.js";
4
4
  import { GeneratorFailure } from "./core.js";
5
+ import { nodeWirePassthrough } from "../behavior.js";
5
6
  /** runtime package alias(生成コード内)— straight-line と同じ `dslcontracts`。 */
6
7
  const PKG = "dslcontracts";
7
8
  // ── Go typed materializer(TypedMaterializer seam の Go 具体化 — 拡張 hook 実装)────
@@ -682,6 +683,11 @@ function emitArrOptNodeHelpers(ctx, plan) {
682
683
  const ot = n.outType;
683
684
  if (ot === undefined || !("component" in n))
684
685
  continue;
686
+ // bc#164: an output-passthrough node's result is opaque wire (value / value[]) stored AS-IS — it is
687
+ // NOT materialized from a boxed Value, so it needs no mustArr_*/mustOpt_* helper (and its `value`
688
+ // element has no materialization). Skip it (the terminal concrete node still gets its helper).
689
+ if (nodeWirePassthrough(n))
690
+ continue;
685
691
  const ref = deriveTypeRef(ot, plan);
686
692
  if (ref.kind === "arr" || ref.kind === "opt" || ref.kind === "map")
687
693
  need(ref);