feat(ogar-doc-ir): two-axis resolved projection (SlotOutcome::Grid) + typst emit_grid - #307
Conversation
… typst emit_grid
The ObjectSlot resolver could only emit flat (label, value) rows, so an
object addressed by TWO coordinates (an aggregate result, a cross-tab, a
matrix-shaped measurement) had no lawful projection: u8 rail positions
cannot address its coordinates and folding the second axis into labels is
lossy.
- resolve.rs: `ResolvedGrid` { rows, columns: GridAxis{keys, labels},
measures, cells (row-major) }, `SlotOutcome::Grid`, and an optional
`DocObjectSource::grid_of(key, view) -> Option<ResolvedGrid>` defaulting
to `None` (every existing source is unchanged). Consulted only after the
root-class agreement gate; a malformed grid fails closed.
- Orientation is the VIEW's: two slots naming one target through two views
present the same cells rotated; nothing about the object is copied into
the composition. Axis keys keep canonical coordinates for back-trace.
- ogar-render-typst: `emit_grid` beside `emit_field_view`.
- dual_render test walker handles the new arm.
- DOCIR-COMPOSITION-LAYER.md §8: dated note recording where the doctrine's
Table arm was realized (resolve layer; DocNode unchanged, no v2 bump).
Tests: 3 new resolver tests (grid resolves + non-grid view still walks
rails; malformed grid fails closed; class gate still applies) and one
emit_grid test. Disable-verified: bypassing grid_of fails 2 of them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCEP2fZdHYdMCtcEVcTpS2
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 Generate docstrings
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_0ac85351-4f85-4169-acab-80edec43deb4) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b3923e76-14e7-44bf-b5c5-030c81741709) |
Why
resolve_slotcould only produce flat(label, value)rows. That leaves no lawful way to project an object that is addressed by two coordinates, such as an aggregate/pivot result, a cross-tab, or a matrix-shaped measurement:u8rail positions cannot address those coordinates;The first consumer is a lance-graph report result embedded in a composed document through an ordinary
ObjectSlot.What
resolve.rsgains three things. It is still behind theclassviewfeature, so the default build is unchanged.ResolvedGrid { rows, columns: GridAxis { keys, labels }, measures, cells }, with cells stored row-major.SlotOutcome::Grid { class, grid }variant.DocObjectSource::grid_of(key, view) -> Option<ResolvedGrid>that defaults toNone. Every existing source is untouched.grid_ofsits in resolution. It is consulted after the existing root-class agreement gate. A malformed grid fails closed, to the fallback or toUnresolvable, never to a half-rendered table.DocCompose.keyskeep the canonical coordinates, so a rendered cell can be traced back to its aggregate coordinate.ogar-render-typstgetsemit_gridbesideemit_field_view.dual_rendertest walker handles the new arm.DOCIR-COMPOSITION-LAYER.md§8 gets a dated note: the doctrine'sTablearm is realized at the resolve layer.DocNodeis unchanged (§3: a table is an object reached through a slot), so there is nodoc-compose.v2bump. The askama-sideFieldView::Tablewidening is still unbuilt.Tests
cargo test -p ogar-doc-ir --features classview -p ogar-render-typstpasses: 30 + 6 + 2 dual-render. Clippy-D warningsis clean.New tests:
Grid, and the same object through a non-grid view still walks the rails (the stay-silent twin);Unresolvable, because the class gate still applies;emit_gridlayout, including the transposed input.Disable check: making resolution ignore
grid_offails 2 of the new tests.Companion
lance-graph
claude/brave-mayer-65y3cyaddslance-graph-report-ogar, which implementsDocObjectSource::grid_offor report results.🤖 Generated with Claude Code
https://claude.ai/code/session_01DCEP2fZdHYdMCtcEVcTpS2
Generated by Claude Code