Skip to content

fix(gen-skill-docs): quote YAML inline scalars containing '...' (strict parsers reject bare ellipsis) - #2589

Closed
sneakygriff wants to merge 1 commit into
garrytan:mainfrom
sneakygriff:fix/yaml-inline-scalar-ellipsis
Closed

sneakygriff wants to merge 1 commit into
garrytan:mainfrom
sneakygriff:fix/yaml-inline-scalar-ellipsis

Conversation

@sneakygriff

Copy link
Copy Markdown
Contributor

Problem

toYamlInlineScalar doesn't quote scalars containing ... — a YAML document-end marker that strict parsers (including Bun.YAML) reject mid-scalar. The catalog-trim path appends ... to any >200-char description lead, so the first skill whose description gets truncated generates a SKILL.md with unparseable frontmatter.

Fix

One condition added to needsQuote (/\.\.\./ ), plus a toYamlInlineScalar unit-test describe in test/catalog-trim.test.ts covering ellipsis quoting, interior-colon quoting (#1778), plain-scalar passthrough, leading-indicator, and trailing-whitespace cases.

Verification

bun test test/catalog-trim.test.ts test/gen-skill-docs.test.ts: 426/426 pass. gen:skill-docs --host all --dry-run: 0 STALE (no current description truncates, so generated output is byte-identical — the fix is prophylactic until the first long description lands).

🤖 Generated with Claude Code

…strict parser breaks on bare ellipsis)

A bare ... inside a plain YAML scalar is a document-end marker that strict
YAML parsers (Bun.YAML among them) reject mid-scalar. catalog-trim truncation
appends '...' to any description whose lead exceeds 200 chars, so any
truncated description would generate a SKILL.md with unparseable frontmatter.
Add the ellipsis test to toYamlInlineScalar's needsQuote so such scalars are
emitted double-quoted, plus unit coverage for the quoting rules.

Co-Authored-By: Claude Fable 5 <[email protected]>
@trunk-io

trunk-io Bot commented Aug 15, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

sneakygriff added a commit to sneakygriff/gstack that referenced this pull request Aug 16, 2026
…y preamble sections, Claude host only

Full port of the shared-preamble carve (5422e28, preserved on
local-fixes-pre-1.64) per the restoration audit's file map. Upstream
v1.62-v1.64.1 never built an equivalent: main still composed the full
inline preamble per skill.

Mechanism: tier-2+ Claude-host skills get a '## Preamble Section Index'
pointing at shared preamble/sections/{onboarding,ask-user-questions,
artifacts-sync}.md (one copy for the whole suite, read on demand via
{{PREAMBLE_SECTION:id}} / carved-sections.ts). Every other host keeps the
full inline preamble. bin/gstack-artifacts-preamble carries the always-run
artifacts-sync bash (KEEP-IN-SYNC with generate-brain-sync-block.ts).

Ported with the audit's adaptations:
- KEPT upstream's mandatory preamble-tier throw (no '?? 4' fallback)
- brain-sync arithmetic guard + _GBRAIN_HOST sanitize applied on top of
  upstream's quoteSafePath (also PR'd upstream separately as garrytan#2588)
- toYamlInlineScalar '...' quoting + catalog-trim coverage (also garrytan#2589)
- deleted dead generate-writing-style-migration (WRITING_STYLE_PENDING was
  never echoed); migration v1.0.0.0.sh rewritten to a one-line notice
- bin/gstack-config explain_level honesty block re-anchored into the
  refactored set path
- autoplan lazy per-phase review-skill loading merged with upstream's
  scope-gate skip line
- carve-guards floors re-derived from the post-carve regen (design-
  consultation 52k/69k, cso 58k/68k measured 2026-08-15), NOT copied
- fresh parity baseline parity-baseline-v1.64.1.0-carve.json captured and
  union-normalized for the 9 carved skills; skill-size-budget and
  parity-suite repointed
- ship goldens re-blessed; regen verified 0 STALE across all 10 hosts;
  non-Claude hosts confirmed inline (with the arithmetic guard); tier-1
  index confirmed AUQ-row-free, tier-3 carries it

Verification: 638 carve-critical + 778 adjacent tests green.

Co-Authored-By: Claude Fable 5 <[email protected]>
@garrytan

Copy link
Copy Markdown
Owner

Thank you — this landed in v1.67.0.0 (credited in the CHANGELOG). Closing since the fix is on main. 🙏

1 similar comment
@garrytan

Copy link
Copy Markdown
Owner

Thank you — this landed in v1.67.0.0 (credited in the CHANGELOG). Closing since the fix is on main. 🙏

@garrytan garrytan closed this Aug 17, 2026
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.

2 participants