Tracing Input Semantics
pipelex-dev trace-input-semantics is an internal capture harness that answers one question with evidence instead of code-reading: what does each hop of the input-schema emission chain do to every fact a method author writes? Given one or more .mthds bundle files, it loads them through the validation library and dumps per-hop captures of the chain that turns authored structure syntax into the json_schema emitted on pipe_io_contracts.
.venv/bin/pipelex-dev trace-input-semantics path/to/bundle.mthds -o output_dir
What it captures
Each hop of the chain writes its captures into the output directory, so a lost or mangled fact is localized to exactly one hop:
hop1_bundle_blueprints.json— parse: thePipelexBundleBlueprintdumps, i.e. what survived TOML.hop2_structure_classes/— resolve + build: one JSON file per traced concept describing the structure class the loaded library holds for it, read off the class itself:class_name,bases,doc, the class's own docstring cleaned withinspect.cleandocas pydantic writes it to the schema'sdescription, so it reads as hop 3 does (nullfor a class without a docstring of its own), and underfields, for each field,annotation(itsrepr),required,admits_none,default,default_factoryanddescription. A required field'sdefault, and that of a field with a default factory, is pydantic'sPydanticUndefinedsentinel, written as"PydanticUndefined".default_factorynames the factory by its module and qualified name, such aspipelex.tools.typing.pydantic_utils.empty_list_factory_of.<locals>._factory, and isnullfor a field without one: the factory is never called, and its name holds no memory address, so the capture is the same on every run and two traces diff cleanly. The class is the one the runtime built from the concept's structure at load time, or the class astructure = "ClassName"concept names, and concepts coming fromPIPELEXPATHor a dependency are traced like any other. The manifest maps every traced concept to its file, andnative.Anything, which declares no structure class, tonull.hop2_python_structures.py.txt— the module thepython-structurescodegen emitter renders for the loaded library's crate, which is the filepipelex build structureswould give a user, with every class named as the runtime names it (domain__Code). It is secondary evidence: it agrees with the runtime's class only for a concept with a structure table within that crate, and renders a structureless concept, a class-backed concept, a refinement of a concept outside the crate and anative.Anythingfield differently (see Codegen Projections). The.txtsuffix keeps the capture inert to linters.hop3_raw_pydantic_schemas/— rawmodel_json_schema()per structure class, before any Pipelex render wrapping.hop4_schema_renders/— theSCHEMArepresentation per pipe input: the{"concept", "content"}envelope, with array wrapping when the input is multiple.hop5_pipe_io_contracts.json— the final wire contracts frombuild_pipe_io_contracts.hop5_input_form.json— the input-form descriptors frombuild_input_form, the sibling projection that reads the authored blueprints directly instead of the emitted schema (see Input-Form Descriptor). Captured beside the contracts so a fact can be checked on both sides: lost in the schema, stated in the descriptor.trace_manifest.json— the capture inventory plus the wire framing per pipe input: authored ref string, resolved concept ref, multiplicity, presence marker.
The tool is a tracer, not a report generator: it never mutates the loaded library, and any analysis of the captures (diffing hops, building a survival table) stays with the caller. Rerunning into the same output directory replaces the hop2_structure_classes/, hop3_raw_pydantic_schemas/, and hop4_schema_renders/ capture directories and the hop2_python_structures.py.txt module wholesale, so no artifact from a removed or renamed concept, pipe, or input lingers from an earlier trace.
When to reach for it
Use it whenever a change touches the emission chain — the structure blueprint, the structure generator, the schema render, the contract builder, or the input-form deriver — and you want to see what actually reaches the wire rather than reason about it. The committed probe bundle at tests/data/input_semantics/probe_bundle.mthds exercises every construct the language accepts (all field types, choices, defaults, required both ways, nesting, refinements, native concepts, and the ? / ! / [] / [N] input markers), and tests/data/input_semantics/rejected/ holds deliberately-invalid fixtures pinning what the language refuses:
.venv/bin/pipelex-dev trace-input-semantics tests/data/input_semantics/probe_bundle.mthds -o /tmp/probe-trace
The harness was built for the S1 input-semantics audit of the input-form program. The integration test at tests/integration/pipelex/cli/test_trace_input_semantics_cmd.py keeps the per-hop capture format honest.