Commit 1db31bc
committed
ogar-render-askama: render ClassView x FieldMask -> struct + ActionDef methods (transpile-chain LEG 3)
The render end of the transpile chain. New render_class_with_methods(class,
mask, actions): a compile-time (askama = ERB analog) transpiler emitting a
Rust struct whose FIELDS are the ClassView x FieldMask projection (the
bitmask indexes the ObjectView N3 order - attributes then family edges - the
basis OgarClassView::render_rows uses) and whose METHODS are the OGAR
ActionDef DO-arm, as a struct-of-methods constructor (impl { new(..) + one fn
per ActionDef }).
Operator rulings (2026-07-04):
- Behaviour is Rust methods, NOT SurrealQL DDL. The deprecated SurrealQL-AST
adapter (DEFINE EVENT ... WHEN ... THEN ...) is not a target; consistent
with SURREAL-AST-AS-ADAPTER.md. Tests assert no DEFINE EVENT / DEFINE TABLE.
- on_enter (the Rubicon state mutation) -> method takes &mut self; read
actions take &self.
New dep lance-graph-contract (FieldMask, branch=main). 6 new tests (mask
gates fields; ActionDef->methods; dotted-predicate + PascalCase sanitisers);
50 tests green; workspace check clean; clippy -D warnings clean. End-to-end
verified: masked account.move (mask={0,2}) -> struct AccountMove { name,
state } + fn new(name, state) + fn action_post(&mut self), CLASS_ID=0x0202.
Also fixes a pre-existing clippy::cloned_ref_to_slice_refs (1.95 toolchain)
in the list_view test. Ledger: docs/DISCOVERY-MAP.md
D-OGAR-RENDER-CLASSVIEW-FIELDMASK-METHODS.1 parent ffacf21 commit 1db31bc
6 files changed
Lines changed: 456 additions & 5 deletions
File tree
- crates/ogar-render-askama
- src
- artifact_kinds
- templates
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
332 | | - | |
333 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
| |||
0 commit comments