Skip to content

Block generation output

Generation reads a source module and writes four documents. Together they say what was discovered: the block's identity, its governed metadata, the keys it declared, and the interface it implements.

xratu capability generate ./billing.py --out-dir ./.xratu/generated
.xratu/generated/
  billing_reusable_capability_block_env_intent.json
  billing_reusable_capability_block_manifest.json
  billing_reusable_capability_block_adapter_manifest.json
  billing_reusable_capability_block_interface_seed.json
Document Carries
Interface seed Identity, compiled interface, XCI source digest, declared auth, exports, ordinals, dependency intent, generated sources
Manifest The governed description: metadata, execution contracts, export surface
Adapter manifest The dispatch view: symbol, ordinal, entrypoint, engine, IO profile
Environment intent The resolver's view of dependency, environment and provenance facts

The interface seed

{
  "contract_version": "reusable_capability_block.interface_seed.v1",
  "produced_by": "reusable_capability_block_generation",
  "reusable_capability_block_id": "billing",
  "interface_id": "billing.Billing",
  "interface_version": "1.0.0",
  "interface_hash": "xci-sha256:4c1f...",
  "compiled_interface": { "...": "..." },
  "xci_source": { "path": "billing.xci.json", "digest": "sha256:9ab3..." },
  "declared_auth": { "...": "..." },
  "exports": ["Billing.charge", "Billing.refund"],
  "export_ordinals": { "Billing.charge": 0, "Billing.refund": 1 },
  "dependency_intent": { "...": "..." },
  "generated_sources": [{ "path": "...", "kind": "adapter" }]
}

The field set is exact: a seed carrying more or fewer fields is refused.

Field Constraint
interface_hash xci-sha256:<64 lowercase hex>, and matches compiled_interface
xci_source.path Project-relative and normalised
xci_source.digest sha256:<64 lowercase hex>
exports Non-empty, no repeats
export_ordinals Covers every export exactly, with distinct non-negative integers
generated_sources The binding and adapter files generation wrote, by path and kind

generated_sources is declared rather than rediscovered, so bake seals the exact adapter that dispatches into the block rather than a filename computed from the block id.

Ordinals come from the compiled interface and are checked against it:

export_ordinals must carry exactly the method ordinals admitted by
compiled_interface

The adapter manifest

{
  "reusable_capability_block_id": "billing",
  "interface_id": "billing.Billing",
  "exports": [
    {
      "symbol": "Billing.charge",
      "export_ordinal": 0,
      "entrypoint": "billing_capabilities:charge",
      "engine": "python",
      "io_profile": "generic"
    }
  ]
}

The seed and the manifest agree

Generation compares the two before writing, on identity and on the export set:

generated reusable capability block manifest disagrees with its interface seed

An export discovered in source that the compiled interface does not admit is refused by name:

discovered export Billing.settle is absent from the admitted XCI interface

Generating one manifest interactively

xratu capability wizard ./billing.py --out ./billing_manifest.json

The wizard writes the manifest alone, at a path you choose. generate writes all four documents into the output directory, defaulting to ./.xratu/generated.

Flag Applies to Effect
--module Both An explicit Python module path
--manifest-id Both Overrides the default <module>-manifest
--version Both Overrides the default 1.0.0
--include-private Both Includes callables whose names begin with an underscore
--out wizard The manifest path
--out-dir generate The output directory
--probe generate Runs the optional probe step
--force generate Overwrites the generated adapters file

Next: Generation boundaries covers what these documents are refused from carrying.