feature/Large-text-corpus · L-261115-8703f2

Merged
LC
11d ago
+3364-704

TL;DR

  • The committed projection corpus is now the one pipelex dev generates after large Text, Html and JSON values became storable, and the client's compact inputs template for a JSON slot is now the bare object, as pipelex's reference projection renders it.
  • The corpus pins the shapes that may hold a url (standard 9.0.0), and the copy here was behind pipelex even before that change.
  • ⚠️ A caller reading a compact template's JSON slot now receives {} instead of the {concept, content: {json_obj}} envelope.

Behaviour changes

  • A native.JSON slot, a slot of a concept refining it, and each element of a JSON[] slot in a compact template: {"concept": "native.JSON", "content": {"json_obj": {}}} → {}. The explicit shape is unchanged.

Breaking changes

  • A consumer of project_inputs_template or render_inputs_template with explicit=False that read the envelope at a JSON slot now reads the object itself; the runtime's input shaper reads a bare object at a JSON position literally.

Changes

Corpus

  • tests/fixtures/protocol/ (input_form.json, output_form.json, pipe_io_contracts.json, inputs_template/**) copied byte for byte from pipelex-dev generate-projection-corpus at pipelex dev 5c8f298a0, the same bytes as the mthds-js twin. Text, Html and JSON contract schemas carry optional text / inner_html / json_obj beside optional url, size, mime_type and preview; scaffold_stored_natives, scaffold_verdict_natives and output_native_yes_no are new; scaffold_anything_slot is folded into scaffold_open_natives; the manifest's unshapeable record now holds only the nested-list gap.
  • tests/fixtures/protocol/README.md: provenance, the standard 9.0.0 shapes, and the unshapeable record updated.

Client projection

  • mthds/protocol/inputs_template.py: JSON leaves the envelope-keeping set; keeps_envelope returns false for a JSON node (lists included), and the compact value of a JSON node is the projection of its json_obj, mirroring projection_reference.py in pipelex.

Tests

  • tests/unit/test_inputs_template_rendering.py: the JSON compact rule held by name, for a single slot, a refining concept and a JSON[] slot.
  • tests/unit/test_protocol_pipe_io_contracts.py: every captured single Text, Markdown, Html or JSON slot states its inline value and a stored value's fields, requiring neither.
  • tests/unit/test_data.py: the cases, and the hand-written _TEXT_SCHEMA probe no longer requires text.

How it was verified

  • DO_NOT_TRACK=1 make agent-check: > done: agent-check (ruff, pyright 0 errors, mypy no issues, error registry agrees).
  • DO_NOT_TRACK=1 make agent-test: All tests passed.
  • Before the client fix, byte parity failed on the compact JSON and TOML of scaffold_open_natives and scaffold_stored_natives, and nowhere else.
  • diff -r of the generated corpus (without engine/) against tests/fixtures/protocol/: only README.md and .gitattributes differ, as intended.

Documentation

  • docs/inputs-template.md: the JSON compact rule, and why the storable natives need no rule of their own.
  • tests/fixtures/protocol/README.md: provenance and the new shapes.
  • CHANGELOG.md: one ### Changed entry under [Unreleased].

Not done

  • No release: it ships with the next mthds-python release.
  • The mthds-js twin of this step is its own pull request (L-261115-f52808).
  • conformance/tests/mthds/fixtures/protocol_corpus_census.json still lists scaffold_anything_slot and lacks the new pipes; that census belongs to conformance.

Closes L-261115-8703f2
Advances L-261113-38f717

🤖 Generated with Claude Code


Summary by cubic

Updates the compact inputs template so a JSON slot renders as the bare object it carries — for a single slot, a concept refining native.JSON, and each element of a JSON[] slot — and re-commits the projection corpus from pipelex dev at the change that made Text, Html and JSON values storable.

This is breaking: a consumer of project_inputs_template or render_inputs_template with explicit=False that read the {"concept": "native.JSON", "content": {"json_obj": {}}} envelope at a JSON slot now reads the object itself, which the runtime's input shaper accepts literally. The explicit shape is unchanged.

Corpus

  • Regenerated from pipelex dev, adding scaffold_stored_natives, scaffold_verdict_natives and output_native_yes_no, and folding scaffold_anything_slot into scaffold_open_natives.
  • Text, Html and JSON contract schemas now state their inline value beside optional url, size, mime_type and preview stored-value fields, none required.