Skip to content

Releases

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 04:10

What a consumer must do. Nothing. Both additions are new keys that every
earlier release refused, so no template that rendered before renders
differently. options.limits gains editorBytes; a host that passes a full
limits object needs no change, because absent limits take their defaults.

Added

  • $spread: a group of siblings per item, spliced flat (document builder,
    owner-approved q_52d2323e, "repeating sections"), SPEC.md section 8.
    { "$each": "models", "$as": "model", "$spread": true, "$value": [ ... ] }
    splices each element of $value into the parent array, per item, in order:
    a page break, a heading, a lines table and a subtotal per pricing model.
    Without it an array $value renders as nested arrays ([[4 blocks], [4 blocks]]), which fine-print refuses; a per-block $each gives the wrong
    order. Each element is an element of the PARENT array: matched by the
    spread's own profile path, it may carry $if, $each, a splice or a spread,
    and its $first is the spread's, so "not before the first item" is
    "$if": "!$first" (fancy-expr's negation is !; there is no not). Same
    bindings, iteration and output bounds as a splice; an element's directive
    counts one more toward directiveDepth. Errors: $spread other than true,
    or without $value, is DIRECTIVE_INVALID; a non-array $value is the new
    DIRECTIVE_SPREAD_NOT_ARRAY.
  • The editor envelope key (document builder, owner-approved q_b83ac35f),
    SPEC.md sections 2 and 10: an optional object holding a visual builder's own
    source. Never read by inspect, validateData, render or preview, never
    output, never changed. It is bounded by the new limits.editorBytes (default
    262144, TEMPLATE_EDITOR_TOO_LARGE at /editor) and no longer counts toward
    templateBytes. A non-object is TEMPLATE_SHAPE.
  • An end-to-end test (php/tests/QuoteSpreadFinePrintTest.php): conformance
    row template/directives 0033, a quote with two pricing models, is rendered
    and written through fine-print, which validates it, lints it with no error
    and reads back one page per model.
  • Sabotages S59-S68, T59-T68 and P59-P68 ($spread and editor).

Changed

  • Tests: fancy-conformance pin moved from 0.45.0 to 0.55.0 in all three
    legs. 0.54.0 adds the $spread rows and 0.55.0 the editor rows; no
    existing template/* row changed between 0.45.0 and 0.55.0.

  • CI: the lab-certificate gate verifies against the lab's rotated key list.
    The lab's first signing key is retired: certificates it already issued still
    verify, and nothing new it signs ever can. Consumers do nothing.

  • Releases need a lab-run certificate. publish.yml gains a read-only
    lab-certificate job that every publishing job needs: a tag is published only
    when the fancy-labs lab has certified that exact version and commit. Consumers
    do nothing; this changes how releases are cut, not what the package does.

  • Docs: AGENTS.md is now the guide to using this package (install, its entries on the Fancy MCP catalog server, API essentials, traps), and it ships in the package. The contributor notes it held moved to CONTRIBUTING.md, and CLAUDE.md is now a symlink to it. The README points to the MCP server and to AGENTS.md. No code changed; nothing to do.

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 05:54

What a consumer must do. Nothing, unless your data can hold a band field
written literally. BREAKING: a value containing {section}, {sectionpages},
{author}, {title}, {filename}, {date} or {time} (with or without a
:FORMAT) in a band slot, or anywhere in a blocks band's run text, is now
VALUE_PAGE_FIELD, as {page} and {pages} already were. It was a live-field
injection before: a recipient named see {date} printed a date. Reword the value
or catch the error. Values with other braces are unchanged.

Added

  • profiles/fine-print.json allows tokens in the first and even band slots, and in
    bands on a pageBreak.page, following fine-print's mixed-page vocabulary. Page
    geometry on a break stays closed to tokens.

Fixed

  • Security: VALUE_PAGE_FIELD missed most of the tokens a writer resolves. It
    checked {page} and {pages} alone, in all three legs, while last-word has written
    {date}, {author} and others as live Word fields since 0.16.0, and fine-print now
    resolves {section} and more.
  • Security: a blocks band's run text was not band-encoded, for either writer:
    first match made it plain text, so a user value {page} in a logo footer became
    a live field with no error at all. Both profiles now match it first.

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 12:34

Added

  • Office files as templates (fancy-template#1; owner's rule "any file can
    be a template"), SPEC.md section 12. PHP: Template::inspectFile($bytes, $options) returns the {{ placeholders }} in a .docx/.dotx,
    .pptx/.potx/.ppsx or .xlsx/.xltx with their locations
    (/word/document.xml#p1, /xl/worksheets/sheet1.xml#B4) and the same issue
    codes as inspect; Template::renderFile($bytes, $data, $options) fills them
    IN PLACE and returns the new file. Every member without a token is copied as
    its original zip record, byte for byte. A token Word split across runs is
    found and filled: the value goes into the run holding {{ (keeping its
    formatting), the rest of the token is cut from the following runs, and no run
    is removed. Values are XML-escaped; an xlsx value stays text (never a
    formula, and a whole-token number stays a string). Declarations come as a
    sidecar (options.variables, section 3's format), not document properties;
    without them names are inferred. Read and filled: docx body, tables, text
    boxes, headers, footers, footnotes, endnotes, comments; pptx slides, layouts,
    masters, notes; xlsx shared and inline strings. A token in any other part is
    TOKEN_FORBIDDEN_FIELD.
  • Hardening, matching last-word 0.13.0's template intake, refused with typed
    codes: FILE_DOCTYPE (any part read), FILE_TOO_LARGE / FILE_TOO_MANY_ENTRIES
    / FILE_ZIP_BOMB (options.fileLimits), FILE_PATH (traversal, absolute,
    backslash, control characters, two spellings of one part), FILE_ENCRYPTED,
    FILE_MACRO_ENABLED (refused, not passed through; a .docx carrying a VBA
    project too), FILE_ARCHIVE, FILE_XML, FILE_UNSUPPORTED; VALUE_XML_CHAR
    for a value XML cannot carry. External relationships are never followed.
  • TypeScript inspectFile / renderFile and Python inspect_file /
    render_file exist and throw FileTemplatesNotImplementedError
    (code FILE_NOT_IMPLEMENTED): loud, never a silent no-op.
  • fixtures/files/: 19 files (hand-authored OOXML, a last-word docx, a
    dark-slide pptx, hostile files) and cases.json, 30 hand-written rows in
    fancy-conformance's case-table shape for the ports. Sabotages S42-S58.
  • Requirement: ext-zip is now declared in composer.json (holy-sheet and
    last-word already require it). Nothing to do unless your PHP lacks it.

Changed

  • Sabotage S19 now names the first of two identical guard lines in
    Template.php (render); S57 breaks the second (renderFile).

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 16:57

Phase 6 of the plan: the TypeScript and Python legs, and the dark-slide and
holy-sheet profiles in all three. Nothing to do for a PHP consumer -- every
change to the PHP leg below either adds a profile or accepts a template the spec
always allowed; nothing that rendered before renders differently.

Added

  • The $value splice (owner ruling 2026-10-27, "Agent: add $value
    splice"), SPEC.md section 8: {"$each": "<path>", "$as": "<name>", "$value": <any JSON>} as an item of any array is replaced in place by one rendered copy
    of $value per element, so a holy-sheet ROW, a cell or a string in a list can
    repeat. $value renders as if written at the element's position (a spliced
    row's strings are still { "value": s }), may contain directives under the
    same directiveDepth, and counts toward iterations and outputNodes like
    $each. $value without $each is DIRECTIVE_INVALID; a non-$ key beside
    it is the new DIRECTIVE_SPLICE_KEY. Rows: fancy-conformance 0.36.0.
    Implemented in all three legs (Inspector + Renderer). Against the 0.36.0
    fixtures with the pre-splice code, all 24 new or changed rows failed in every
    leg; with it, all 203 pass in every leg, 211/211 byte-identical across legs
    (parity.php), 0% under --control, 60/60 through the real writers. The xlsx
    corpus report now repeats its quarter rows with a splice instead of
    addressing them by index. Nine sabotages per leg (S33-S41, T33-T41,
    P33-P41): $value without $each, a key beside it, directiveDepth
    inside it, the splice object counting no node, one iteration counter for every
    loop, the element's path for the profile, its top not being an element, a
    null $value still splicing, and plain notes in the profile data.

  • TypeScript leg, @particle-academy/fancy-template (src/, tests/;
    ESM + CJS + types via tsup). Same API as PHP: inspect, validateData,
    render, preview, tokenize, TemplateError { code, path, variable }.
    Written against SPEC.md, not against the PHP source. Depends on
    @particle-academy/fancy-expr >=0.2.0 <2.0 only. Scans UTF-8 bytes so the
    token-length bound means what it means in PHP; every key read and write goes
    through own-property helpers, so a template or data key spelled __proto__
    or constructor is only ever a key.

  • Python leg, fancy-template (python/, Python >= 3.11, typed). API in
    snake_case (validate_data). Depends on fancy-expr>=0.2.0,<2.0 only. Every
    walk of unknown depth is iterative; bool is never a number; names, digits
    and dates are ASCII-only; a host str/int subclass is read through its base
    type, so no host method runs.

  • dark-slide and holy-sheet profiles, in all three legs: the markup,
    markdown and cell encodings. dark-slide values are CommonMark-escaped in
    format: "markdown" content and entity-escaped in format: "html";
    every holy-sheet string result is written { "value": s }, so user data can
    never become a formula. A whole-token number or boolean keeps its type, and so
    does a valid date whose path is DECLARED date (SPEC.md section 9, clarified).

  • All 203 template/* rows of fancy-conformance 0.36.0 pass in every leg,
    none skipped. The fixture pin moved 0.35.0 -> 0.36.0 together in
    composer.json (exact), package.json (^0.36.0) + package-lock.json, the
    three PINNED_SUITE_VERSION constants and both CI checkout refs.

  • Cross-leg parity (php php/tests/parity.php): every fixture row and a
    corpus of realistic templates (examples/: certificate, invoice with $each
    line items, a deck with a repeated slide and repeated table rows, a regional
    xlsx report) run through all three legs and compared byte for byte -- 203/203
    against the expected column in each leg, 211/211 between the legs; --control
    reports 0% on every column. --writers renders the corpus through the real
    writers (fine-print; last-word, dark-slide and holy-sheet in PHP, Node and
    Python) and compares the extracted text: 60/60 files identical.

  • scripts/sabotage.py covers all three legs and fancy-expr's bounds in all
    three of its languages: 134 sabotages (40 PHP, 42 TypeScript, 43 Python, 9
    fancy-expr), each turning a suite red. S29/T29/P29 ("notes always
    markdown-escaped") were retired with that rule.

  • CI: node, python and parity jobs. Publish: npm (Trusted Publishing,
    provenance) and PyPI (build and publish split so id-token: write never runs
    build code), both behind the read-only guard job and the changelog gate,
    which now BLOCKS them. Both names need the owner's one-time bootstrap.

Changed

  • dark-slide speaker notes are plain text (owner ruling 2026-10-27,
    "Agent: notes are plain"), SPEC.md section 9: the profile's slides.*.notes
    is text, not markdown, so a value is no longer backslash-escaped there.
    The PPTX writer writes notes as plain text and fancy-slides edits them in a
    plain textarea, so the escape printed its backslashes in both. Unreleased
    until now in every leg, so no consumer has the old behaviour. Row:
    fancy-conformance 0.36.0 template/profiles 0104.
  • The PHP test that ran the 11 skip.php rows explicitly and asserted there
    were 11 is replaced by one asserting no template/* row is skipped for PHP.
    0.36.0 dropped the skips; the old test's own comment said to delete it then.

Fixed

PHP leg disagreements with SPEC.md, found by building the other two legs against
the spec. Each landed with a test that failed against the old code.

  • A $if written BEFORE its $each in the same object was refused as
    DIRECTIVE_UNDECLARED: the binding was only created when the inspector
    reached $each in key order. Section 8 says $each runs first.
  • templateBytes skipped object keys spelled with digits ("10"), because PHP
    decodes them as integer keys. Section 10 counts every key.
  • maxLength / maxItems written 3.0, and fancyTemplate written 1.0,
    were refused. Section 3 defines integer as an integral value, and JavaScript
    cannot even tell 3.0 from 3.

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 08:53

Added

  • The conformance test asserts the installed fixture set equals the pinned
    0.35.0 and that composer.json pins it exactly, so a moved fixture set fails
    instead of being printed and passed. .gitattributes keeps every file LF, so
    the in-source golden text matches on a Windows checkout too.

  • SPEC.md, the normative specification of document templates: envelope,
    variable declarations, {{ }} tokens, resolution, the fixed filter list,
    $each / $as / $if directives, per-writer profiles and the bounds.

  • profiles/ for fine-print, last-word (implemented) and dark-slide,
    holy-sheet (data only; phase 6).

  • The PHP leg: Template::inspect, validateData, render, preview,
    tokenize, throwing TemplateError with a code, a JSON Pointer and a
    variable path -- never a data value. Passes 169 of 169 runnable rows of the
    seven template/* suites (11 rows are dark-slide/holy-sheet, skipped for PHP
    in the fixtures with the reason stated).

  • examples/certificate.fine-print.json: the default certificate, rendered
    through fine-print 0.3.0 and read back in a golden test.

  • scripts/sabotage.py: every bound and guard broken in turn; all 28 turn a
    suite red.