Skip to content

fountain: emit map list items in inline-dash form so parseManifest can read its own output - #1287

Merged
jhgaylor merged 1 commit into
mainfrom
fountain-serializer-inline-dash
Aug 1, 2026
Merged

jhgaylor merged 1 commit into
mainfrom
fountain-serializer-inline-dash

Conversation

@jhgaylor

@jhgaylor jhgaylor commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #1286.

Problem

toYaml in the fountain serializer wrote a map list item as a bare - on its own line with the map indented beneath it. Spec-legal YAML, but chant's parseYAML can't read that form: the list collapses to {}, the item's keys leak to the top level, and a later spec.metadata (the managed-by: chant marker every chant-managed resource carries) overwrites the document-level metadata. parseManifest then extracts name: "" for every resource and bulk POST /api/apply 422s on the serializer's own chant build output — every real manifest has a list-of-maps field, so 0.33.1's apply path is broken end to end.

Fix

Fold the item's first line onto the dash (- key: value), the idiomatic block-sequence form. - is exactly one indent level wide, so the recursive body's continuation lines already align — the fold is a same-width replacement of the first line's indentation, no re-indenting needed. Nested cases (list-of-lists) come out as - - x, which is valid.

Before / after:

  skills:
    -
      source: anthropics/skills
      name: frontend-design
  skills:
    - source: anthropics/skills
      name: frontend-design

Tests

  • A shape test asserting the inline-dash form (and that no bare-dash line is emitted).
  • A serialize → parseManifest round-trip test over the exact shape that collapsed (list-of-maps field + spec-level metadata key), asserting names, list contents, and spec.metadata all survive — so the emitter and parser can't drift apart silently again.

vitest run lexicons/fountain: the serializer and fountain-apply suites pass (28/28). The 10 pre-existing failures in the LSP/plugin/composites suites are identical on a clean checkout of main and untouched by this change.

An alternative (or complement) is teaching parseYAML the dash-alone form — happy to do that as a follow-up if you want the parser hardened too, but fixing the emitter both repairs the round-trip and makes the output match what standard YAML tooling emits.

🤖 Generated with Claude Code

toYaml wrote a map list item as a bare `-` on its own line with the map
indented beneath it. That form is spec-legal, but chant's parseYAML
can't read it: the list collapses to {}, the item's keys leak to the
top level, and a later spec.metadata overwrites the document metadata —
so parseManifest returns every resource with an empty name and bulk
apply 422s on the serializer's own output (#1286).

Fold the item's first line onto the dash instead (`- key: value`).
`- ` is exactly one indent level wide, so the body's continuation
lines already align and the substitution is a same-width replacement
of the first line's indentation.

Adds a shape test and a serialize→parseManifest round-trip test over
the exact shape that collapsed (a list-of-maps field plus a spec-level
metadata key), so the emitter and parser can't drift apart silently
again.

Fixes #1286

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jhgaylor
jhgaylor merged commit dce186c into main Aug 1, 2026
5 checks passed
@jhgaylor
jhgaylor deleted the fountain-serializer-inline-dash branch August 1, 2026 03:14
jhgaylor added a commit to jhgaylor/agent-specs that referenced this pull request Aug 1, 2026
INTENTIUS/chant#1287 (released in 0.34.1) makes the fountain serializer
emit map list items in inline-dash form, so parseManifest can read the
serializer's own output again and the direct POST /api/apply workaround
in apply.mjs is no longer needed. Drop it and the yaml devDependency;
apply.mjs calls fountainApply({manifestContent}) with the infisical://
URIs resolved by text substitution on the manifest.

Verified against live fountain: 27 resources updated, 38 secrets
upserted, matching the workaround-era applies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fountain: parseManifest can't parse fountainSerializer's own output — every bulk apply 422s with empty resource names

1 participant