Skip to content

feat(wrap): extended template dialect — version, subtitle, tags, asset_meta tokens - #126

Merged
drawmeanelephant merged 1 commit into
mainfrom
feat/wrap-dialect-v2
Aug 27, 2026
Merged

drawmeanelephant merged 1 commit into
mainfrom
feat/wrap-dialect-v2

Conversation

@drawmeanelephant

Copy link
Copy Markdown
Owner

Summary

Extends the oliver wrap 7-token template dialect with the shared template contract v2 tokens (rotkeeper #244): $version$, $subtitle$, $tags$, $asset_meta$, $navigation$, $warnings$.

  • MetaJson gains the six optional scalar fields; fieldVal/isKnownField cover them with the existing semantics — html-escaped substitution, $if$ gating, absent-known → empty, unknown → verbatim.
  • No change to oliver meta (still the seven S1 fields); the rotkeeper adapter feeds the extended keys into --meta-json (version from bones/config/version, the rest from source frontmatter via yq).
  • Unit suite covers substitution, escaping, gating, and absence semantics for the new tokens.

Rotkeeper will move OLIVER_PIN to this commit after merge so the builds release serves the v2 dialect.

Validation

  • zig build test — full suite green (460 tests)
  • Manual wrap probe: $version$/$subtitle$/$tags$/$asset_meta$ substitute escaped, $if(version)$ gates, $unknown$ passes verbatim

Generated with Codebuff 🤖
Co-Authored-By: Codebuff noreply@codebuff.com

…t_meta tokens

Extends the 7-token wrap dialect with the v2 shared template contract
tokens (rotkeeper #244): $version$, $subtitle$, $tags$, $asset_meta$,
$navigation$, $warnings$. MetaJson carries the new optional scalar
fields, fieldVal/isKnownField cover them (html-escaped substitution,
$if$ gating, absent-known → empty, unknown → verbatim), and the unit
suite covers substitution, escaping, gating, and absence semantics.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drawmeanelephant
drawmeanelephant merged commit 8460f28 into main Aug 27, 2026
3 checks passed
@drawmeanelephant
drawmeanelephant deleted the feat/wrap-dialect-v2 branch August 27, 2026 20:05
@itoqa

itoqa Bot commented Aug 27, 2026

Copy link
Copy Markdown

Ito QA test results
Commit: 6db830e: 10 test cases ran, 10 passed ✅.

Summary

Coverage spans normal template rendering and business rules for conditional sections, metadata substitution, escaping, token ordering, and literal content insertion. It also exercises edge and adversarial inputs, including missing or empty values, unknown and malformed conditional syntax, and invalid metadata, with no application behavior problems found.

Safe to merge — the exercised rendering and input-handling behavior is healthy, with no regressions, new failures, or previously flagged failures attributable to this PR. No merge-blocking risk is indicated.

Tests run by Ito

View full run

Result Severity Type Description
General Template conditions keep or remove only the content inside their first closing marker. Extra closing markers remain visible instead of consuming unrelated content.
General The command kept the version text in its original place, removed empty conditional content, and left unknown text unchanged. The final output stayed in the expected order.
General Mixed templates kept metadata safely escaped, trusted body and asset text unchanged, unknown tokens visible, and every part in the original order.
Conditional A template kept the version section when the version was 2.0. The section markers were removed and the output showed before-Version: 2.0-after.
Conditional The command removed the subtitle, tags, and navigation sections when their values were empty, null, or missing. The surrounding text stayed in place, producing before-||-after.
Conditional Unknown conditional text and extra end markers stayed unchanged. The version block rendered as V:2.0, and malformed or nested-looking input followed the documented first-end-marker behavior.
Metadata All six new metadata values appear in the correct order, and characters that could affect HTML are escaped. The earlier mismatch came from the expected text reversing the quote and apostrophe order, not from the renderer.
Metadata The wrap command rendered empty spaces for a missing version, a null subtitle, and empty tags. No placeholder text appeared.
Wrap The wrap command escaped the legacy title, inserted the asset path and body as literal text, and kept the unknown token unchanged.
Wrap Invalid metadata stops the wrap command before it renders anything. The command returns an error and leaves standard output empty.

Tip

Reply with @itoqa to send us feedback on this test run.

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.

1 participant