Skip to content

feat(ogar-from-ruff): lift_actions — the DO-arm method lift#54

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-from-ruff-lift-actions
Jun 19, 2026
Merged

feat(ogar-from-ruff): lift_actions — the DO-arm method lift#54
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-from-ruff-lift-actions

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

ogar-from-ruff previously dropped Model::functions — the doc comment literally said "Future Rails-method lift can land here." This lands it.

lift_actions(model) -> Vec<ogar_vocab::ActionDef> — one ActionDef per ruff Function, the DO-arm of the harvest.

Facts-only by design

  • Sets identity ({model}::action_def::{method}), predicate (the method name — already snake_case on the Rails side), object_class (the model name).
  • Sets no exec policy — the vocab ActionDef has no exec slot; backend routing is consumer-private.
  • Constructs no ActionInvocation — that's a live-instance carrier (no target instance / cycle / trace exists at harvest time).
  • Does not map 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. The reads / raises / traverses edges already ride the narrow / SPO arm as triples.

Guard / RBAC / exec enrichment 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-existing ogar-vocab warnings); rustdoc intra-doc link check passes under -D broken_intra_doc_links.

🤖 Generated with Claude Code

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.
@AdaWorldAPI AdaWorldAPI merged commit 0bfd903 into main Jun 19, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +136 to +140
ActionDef::new(
format!("{}::action_def::{}", model.name, f.name),
&f.name,
&model.name,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants