Skip to content

feat(notations): render view nodes for the blocks notation in document-view engine - #454

Merged
transitrix merged 2 commits into
methodology/11-trace-matrixfrom
methodology/11-view-blocks-rendering
Aug 7, 2026
Merged

feat(notations): render view nodes for the blocks notation in document-view engine#454
transitrix merged 2 commits into
methodology/11-trace-matrixfrom
methodology/11-view-blocks-rendering

Conversation

@transitrix

Copy link
Copy Markdown
Owner

Summary

  • Seventh slice of the document-view engine epic. {{ view ... }} (§2) now renders a blocks notation (nested_blocks form) source file as inline SVG at render time, via a new zero-dependency blocks-view.mjs (own YAML-subset reader + schematic box layout, same discipline as this package's other modules).
  • Illustration border classes per §4: green (dv-illus-view) when it renders clean, amber (dv-illus-suspect) + ⚑S when a cross-linked block id resolves suspect, red (dv-illus-missing) + ⚑U when the file is missing, isn't the blocks notation, or uses the not-yet-supported grid: (matrix-subset) root.
  • figure and view now share one illustration numbering sequence in document order, as §2 requires — this closes the gap the trace-matrix slice flagged as a known limitation.
  • Other notations (BPMN, capability-map, etc.) remain later slices on the same epic, same posture as figure/figref and trace shipping incrementally ahead of view itself.

Depends on #452 (still open, CI green) — this PR is based on that branch, per the stacked-PR exception (a change that truly depends on an unmerged one). Please merge #450, #451, #452 first, in that order.

Scope still open on the epic: view for notations other than blocks, the blocks grid: form, derivation share (§5), telemetry (§6), and PDF output (§7).

Test plan

  • node packages/document-view-engine/tests/test_blocks_view.mjs — new unit tests for the YAML-subset parser and SVG layout/render
  • node packages/document-view-engine/tests/test_render.mjs — extended with view node integration cases (valid render, suspect border, missing file, wrong-notation file, shared numbering with figure)
  • node packages/document-view-engine/tests/test_parse_skeleton.mjs, test_resolve_references.mjs, test_evaluate.mjs — unchanged, still green
  • node scripts/check-notations.mjs (doc-lint), check-adl.mjs, check-workflow-scripts.mjs, check-skill-cheatsheet.mjs — all clean

…t-view engine

Seventh slice of the document-view engine epic. blocks-view.mjs parses a
`blocks` notation nested_blocks document (own zero-dependency YAML subset
reader, same discipline as this package's other modules) and lays it out
as nested-box SVG. render.mjs's `view` case wires it in: green border when
it renders clean, amber + ⚑S when a cross-linked block id resolves
suspect, red + ⚑U when the file is missing, isn't the blocks notation, or
uses the not-yet-supported grid (matrix-subset) root. `figure` and `view`
now share one illustration numbering sequence, in document order, as §2
requires — fixing the gap the trace-matrix slice flagged. Other notations
remain later slices on the same epic.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
…#456)

* feat(notations): compute derivation share in the document-view engine

Word-count ratio of derived vs. manual content (§5), printed in the review
profile only, with illustrations counted on their own line as a separate
figure/view metric never folded into the word ratio.

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): add telemetry (§6) to the document-view engine (#458)

* feat(notations): add telemetry (§6) to the document-view engine

Records which types, fields, relation kinds and matrix pairs a render
referenced and how often, plus a tally of each §3 failure state across
the whole render (not just inline spans) — nothing that could be
replayed back into a document's shape.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): add PDF output — print stylesheet, engine seam, page-geometry verification (#460)

Completes the document-view engine's output stage: declare the page
geometry, convert through a print engine, verify the geometry of what came
back.

pdf-layout.mjs declares A4 portrait as the default page and a named
landscape page a 'fit = page' illustration selects, and gives every class
render.mjs emits its print colour or border. convertToPdf() takes the print
engine as a parameter rather than importing one — no rendering engine is
bundled, since that dependency is an open architecture question, so the
whole path around it is implemented and adopting an engine later is
supplying one function.

pdf-geometry.mjs reads each page's MediaBox back out of the produced PDF,
honouring /Rotate and page-tree inheritance, and checks it against the two
declared orientations. An engine that ignores the page-size declaration
falls back to its own default paper and produces a plausible PDF whose last
centimetres spill onto a second page; that case is reported by name rather
than as a bare mismatch. A PDF whose page objects cannot be read is a
failure too — an unverifiable page size is not a verified one.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

---------

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

---------

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
@transitrix
transitrix merged commit 9c67292 into methodology/11-trace-matrix Aug 7, 2026
8 checks passed
@transitrix
transitrix deleted the methodology/11-view-blocks-rendering branch August 7, 2026 19:57
transitrix added a commit that referenced this pull request Aug 8, 2026
…w engine (#452)

* feat(notations): add derived-content evaluation and render profiles to document-view engine

Adds createEvaluator() (inline field traversal + each selection against canon)
and renderDocument() (review/clean HTML render profiles, §4) on top of the
existing skeleton parser and reference resolver. trace/view/figure/figref
evaluation, derivation share, telemetry, and PDF output remain open on the epic.

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): render figure/figref illustrations in the document-view engine

Fifth slice of the document-view engine epic. Adds figure numbering (assigned
in document order, forward references resolve correctly), the manual/missing
border classes, and figref resolution to renderDocument(). trace and view
remain deferred pass-through markers.

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): render the trace coverage matrix in the document-view engine

Sixth slice of the document-view engine epic. evaluateTrace() builds the
full from-type x to-type coverage matrix for `{{ trace from = A to = B
via = kind }}`, resolving `via` against either link mechanism canon has
(a first-class REL kind's own `type` field, or a claim record's named
endpoint field such as VERIFICATION.verifies) without the caller saying
which. renderDocument() renders it as an HTML table; every row and
column appears even when uncovered, per the epic's own "an uncovered
item is the point of the matrix" requirement. view remains a deferred
pass-through marker.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): render view nodes for the blocks notation in document-view engine (#454)

* feat(notations): render view nodes for the blocks notation in document-view engine

Seventh slice of the document-view engine epic. blocks-view.mjs parses a
`blocks` notation nested_blocks document (own zero-dependency YAML subset
reader, same discipline as this package's other modules) and lays it out
as nested-box SVG. render.mjs's `view` case wires it in: green border when
it renders clean, amber + ⚑S when a cross-linked block id resolves
suspect, red + ⚑U when the file is missing, isn't the blocks notation, or
uses the not-yet-supported grid (matrix-subset) root. `figure` and `view`
now share one illustration numbering sequence, in document order, as §2
requires — fixing the gap the trace-matrix slice flagged. Other notations
remain later slices on the same epic.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): compute derivation share in the document-view engine (#456)

* feat(notations): compute derivation share in the document-view engine

Word-count ratio of derived vs. manual content (§5), printed in the review
profile only, with illustrations counted on their own line as a separate
figure/view metric never folded into the word ratio.

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): add telemetry (§6) to the document-view engine (#458)

* feat(notations): add telemetry (§6) to the document-view engine

Records which types, fields, relation kinds and matrix pairs a render
referenced and how often, plus a tally of each §3 failure state across
the whole render (not just inline spans) — nothing that could be
replayed back into a document's shape.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

* feat(notations): add PDF output — print stylesheet, engine seam, page-geometry verification (#460)

Completes the document-view engine's output stage: declare the page
geometry, convert through a print engine, verify the geometry of what came
back.

pdf-layout.mjs declares A4 portrait as the default page and a named
landscape page a 'fit = page' illustration selects, and gives every class
render.mjs emits its print colour or border. convertToPdf() takes the print
engine as a parameter rather than importing one — no rendering engine is
bundled, since that dependency is an open architecture question, so the
whole path around it is implemented and adopting an engine later is
supplying one function.

pdf-geometry.mjs reads each page's MediaBox back out of the produced PDF,
honouring /Rotate and page-tree inheritance, and checks it against the two
declared orientations. An engine that ignores the page-size declaration
falls back to its own default paper and produces a plausible PDF whose last
centimetres spill onto a second page; that case is reported by name rather
than as a bare mismatch. A PDF whose page objects cannot be read is a
failure too — an unverifiable page size is not a verified one.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

---------

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

---------

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

---------

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>

* fix(document-view-engine): remove parked derivation share, telemetry and PDF output

These landed on this branch through a stacked-PR chain even though the
2026-08-07 scope change parked them; render.mjs, README.md and
test_render.mjs are hand-reconstructed to their pre-parked-scope shape
since the additions were interleaved with kept §2/§3 logic and could not
be reverted mechanically. Trace matrix, view/figure/figref rendering, and
render profiles are unaffected.

Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>

---------

Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
Signed-off-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Co-authored-by: Valerii Korobeinikov <vkgeorgia@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:human-merge Mergeable but not a simple PR; awaits human merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants