feat(ogar-from-ruff): lift_actions — the DO-arm method lift#54
Conversation
ogar-from-ruff previously dropped Model::functions (the doc comment noted
'Future Rails-method lift can land here'). Add lift_actions(model) ->
Vec<ogar_vocab::ActionDef>: one ActionDef per ruff Function.
Facts-only by design:
- sets identity ({model}::action_def::{method}), predicate (method name,
already snake_case on Rails), object_class (model name);
- sets NO exec policy (the vocab ActionDef has no exec slot; backend
routing is consumer-private);
- constructs NO ActionInvocation (live-instance carrier — no target/
cycle/trace at harvest time);
- does NOT map Function::reads to a causal dependency — a plain Rails read
is not a reactive @api.depends trigger; claiming one would leak
method-body description into causal semantics. reads/raises/traverses
stay on the narrow/SPO arm as triples.
4 new tests (16 total green); clippy clean; rustdoc intra-doc links pass.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f538f92d28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ActionDef::new( | ||
| format!("{}::action_def::{}", model.name, f.name), | ||
| &f.name, | ||
| &model.name, | ||
| ) |
There was a problem hiding this comment.
Use canonical class identities for lifted actions
When these actions are emitted or registered alongside the Class values from this crate, the join from ActionDef.object_class back to the class will miss: ActionDef documents object_class as the OGAR-canonical identity (e.g. ogit-erp/sale.order in crates/ogar-vocab/src/lib.rs:314-316), and emit_action_def writes it verbatim, while class triples are addressed via prefixed identities such as ogit-op/WorkPackage. Building both identity and object_class from raw model.name here produces WorkPackage::... / WorkPackage, so every Rails action lifted this way points at a non-existent class identity unless the caller has no prefix at all.
Useful? React with 👍 / 👎.
What
ogar-from-ruffpreviously droppedModel::functions— the doc comment literally said "Future Rails-method lift can land here." This lands it.lift_actions(model) -> Vec<ogar_vocab::ActionDef>— oneActionDefper ruffFunction, the DO-arm of the harvest.Facts-only by design
identity({model}::action_def::{method}),predicate(the method name — already snake_case on the Rails side),object_class(the model name).execpolicy — the vocabActionDefhas noexecslot; backend routing is consumer-private.ActionInvocation— that's a live-instance carrier (no target instance / cycle / trace exists at harvest time).Function::reads→ a causal dependency. A plain Rails method reading a field is not a reactive@api.depends-style trigger; claiming one would leak method-body description into causal semantics. Thereads/raises/traversesedges already ride the narrow / SPO arm as triples.Guard / RBAC /
execenrichment happens downstream at registration — not in the producer.Tests
4 new (
emits_one_def_per_function,predicate_object_class_and_identity,is_facts_only,empty_functions_yields_empty) — 16 total green. Clippy clean (only pre-existingogar-vocabwarnings); rustdoc intra-doc link check passes under-D broken_intra_doc_links.🤖 Generated with Claude Code