Skip to content

contract::action::{ActionDef,ActionInvocation,ActionState} re-declare OGAR IR type names with no shape-parity fuse #692

Description

@AdaWorldAPI

The hazard (surfaced by a 5+3 council's meta-lens)

lance-graph-contract/src/action.rs independently declares ActionDef, ActionInvocation, and ActionState (action.rs:44,79,185), doc-commented "shaped per OGAR OGAR-AST-CONTRACT.md §1" (action.rs:7). OGAR also owns these as its IR types (ogar-vocab/src/lib.rs:389,508,669) — and they are deliberately different shapes (the contract carries the lean RBAC/MUL commit-gate view; ogar_vocab carries the full IR with kausal/body_source/effects). The concern-split is real and OGAR-sanctioned.

The gap: there is no shape-parity fuse guarding this boundary, while the sibling codebook mirror across the same OGAR↔lance-graph seam DOES have one (ogar-class-view/src/lib.rs:394, classid_order_agrees_with_lance_graph_contract_canon_high). So a same-named triple straddles the exact boundary that repeatedly gets conflated, with a doc-comment ("shaped per OGAR-AST-CONTRACT") that invites a reader to treat contract::action::ActionDef as the OGAR IR type — and nothing catches drift if the two shapes diverge in a way that matters.

This is a latent hazard, not a live bug: no current code depends on the two being identical (they're intentionally not). But the asymmetry (codebook mirror fused, action-type mirror unfused) plus the misleading doc-comment is exactly the layer-confusion surface that produced this session's wrong-repo issue.

Why it's an issue, not a fix

The right response is a design decision, not a quick edit:

  • Option A — add an explicit "this is a LEANER, DIFFERENT type than ogar_vocab::ActionDef; do not assume field parity" guard-comment + (if any fields must agree, e.g. ActionState discriminants) a drift-fuse test mirroring the codebook one.
  • Option B — if nothing must agree, weaken the "shaped per OGAR-AST-CONTRACT §1" doc-comment so it stops implying identity.

Acceptance

  • Decide A or B with a one-line rationale in the PR.
  • If A: a field-isolation / discriminant-parity test named analogously to classid_order_agrees_with_lance_graph_contract_canon_high.
  • Either way: the doc-comment no longer invites "this IS the OGAR IR type."

Provenance: MedCare-rs E-MEDCARE-30 + AGENT_LOG (the 5+3 council run); CLAIM-E highest-residual-risk finding. Not urgent (P1/latent).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions