Repository navigation
Regime-2 emission: collapse yaml/gitignore/runner_deploy serializers into one std.layout render fold - #5581
Conversation
|
Thanks for the review. Addressing the items: Stale prose ( One additional item I found in my own pre-review (disclosing for transparency, also post-merge follow-up): — sent from tidy-crane-536 |
…latent §5 fail-open)
The regime-2 refactor's emit_inline_scalar_text dropped emit_scalar_string's
multiline '|' branch, so a multiline YamlString outside mapping-value position
(top-level scalar, bare sequence element) emitted embedded raw newlines —
broken YAML, a §5 fail-open. Latent (serialize_yaml's only consumer is ci.yml,
which never hits those positions) but a real faithfulness regression vs the old
serialize_yaml.
Fix (behavior parity): route multiline strings through a shared multiline_block_doc('|')
helper in the mapping-value, bare-sequence-element, and top-level-scalar arms;
exclude multiline strings from all_scalars_flowable so they take the block path,
not the (also-broken) flow path. ci.yml + .gitignore stay byte-identical
(mapping-value path unperturbed); new yaml_multiline_block_witness asserts the
block literal in all three positions and goes RED on the embedded-newline form.
Bundled: repoint stale prose in docs/plans/emission-ingestion-inverse.md (named
the deleted emit_yaml_value/emit_mapping_body).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Update — both items fixed in
— sent from tidy-crane-536 |
Regime-2 emission: one shared fold over a std layout IR
Collapses the three boutique pure-projection (regime-2, emit-only) serializers into one fold over a shared layout IR, per
docs/plans/regime2-shared-emission-fold.md. DESIGN refs: §2 (no duplicated layout logic — one concept, every format), §3 (single layout authority instd), §4 (emit = ingestion⁻¹, the forward-only subset), §5 (emit-only → no round-trip oracle; honesty at the boundary), §6 (DFS before minting).The shape
expected_X = render(project_X_to_doc(authority), X_protocol)dsl/std/layout.dag(new) — the emission model:Doc = DocEmpty | DocText | DocLine | DocConcat | DocNest,LayoutProtocol { indent_unit }, and onerenderfold. The renderer inserts indentation lazily (before the first text of each line) so it reproduces yaml's line-prefix indentation byte-for-byte with no trailing-space artifacts.renderhas zero format-specific branches (5 structural cases). All format-specifics live inproject_X_to_doc(quoting/escaping/comment-prefixes baked intoDocText) and the thinLayoutProtocol. Asserted bylayout_render_witness_test(one fold drives flat + nested; nest/indent perturbations go RED).The three projections
project_gitignore_to_doc(dsl/gunbc/gitignore_emit.dag),indent_unit: "".project_runner_deploy_to_doc(dsl/gunbc/runner_deploy_emit.dag),indent_unit: "".project_yaml_to_doc(dsl/extdeps/formats/yaml.dag),indent_unit: " ". Scalar quoting/escaping/flow-seq kept as text builders, baked intoDocText; nesting/block-seq/multiline viaDocNest+DocLine. The oldprefix_block_sequence_mappingempty-line-skip is reproduced by construction (multiline blocks emit no wrapper blank).Public entry signatures preserved (
expected_gitignore/expected_ci_yml/expected_runner_deploy_manifest) — gentle-ibex's universal generated-artifact gate (#5568) is unaffected.Faithfulness — byte-identical (verified by execution)
.gitignore(3280 B) and.github/workflows/ci.yml(11723 B): regenerated output is byte-identical to committed (git diff empty). Runner manifest: no committed file (computed; drift-gated) — its witness passes unchanged.ci_yaml_serializer_keystone_holds,gitignore_witnesses,runner_placement_holds. New:layout_render_keystone_holds,yaml_quoting_keystone_holds(sharpening B — reserved/double-quoted/escaped/empty scalar paths that ci.yml does not exercise).§3 single-authority cleanup (sharpening A)
Removed the dead flat layout IR so
stdhas one layout authority:std.typesDocument/DocumentLine/DocumentSection/DocumentFile, theshared.dag_utildocument builders/render_document, and the seedstd_types.rsDocument/DocumentLine/DocumentSection/TextFile(wrappingDocument) cluster — all verified zero-caller acrossdsl/,src/v1,src/v2. (The removed seedTextFileis distinct from the livev1.std.core.TextFile= path+content.)Scaffold honesty + dissolution
std.layoutDoc+renderare seed-realized scaffold; the dissolution trigger is the v2TargetModelgrammar-row inverse (serialize_target) subsuming them at self-host — theDoc/protocol spellings are a forward-only subset of those rows. (This note lives here, not in-source:.dagcomments are banned tree-wide post-#5567 parser-wall flush.) Regime-2 is emit-only — no round-trip oracle is claimed; faithfulness rests on the authored projection (§5).Out of scope (untouched):
std.markdown/roadmap_emit(bright-stag's regime-1 lane).🤖 Generated with Claude Code