Skip to content

refactor(op-canon): re-export APP_PREFIX + render_classid from OGAR (one source of truth)#57

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/op-canon-app-prefix-reexport
Jun 22, 2026
Merged

refactor(op-canon): re-export APP_PREFIX + render_classid from OGAR (one source of truth)#57
AdaWorldAPI merged 1 commit into
mainfrom
claude/op-canon-app-prefix-reexport

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Adopts the OGAR PR #97 / #98 / #99 surface in op_canon::app, closing the B2#1 follow-up flagged on #56: the local APP_PREFIX = 0x0001 literal and the local (APP_PREFIX as u32) << 16 | concept bit math are gone — both come from ogar-vocab now (one source of truth).

// before — local literal + local bit math
pub const APP_PREFIX: u16 = 0x0001;
pub const fn render_classid(concept: u16) -> u32 {
    ((APP_PREFIX as u32) << 16) | (concept as u32)
}

// after — re-exports from the typed OGAR surface
pub const APP_PREFIX: u16 = OpenProjectPort::APP_PREFIX;           // #97 typed const
pub fn render_classid(concept: u16) -> u32 {
    ogar_vocab::app::render_classid_for::<OpenProjectPort>(concept) // #97 central comp
}

Same one-source-of-truth discipline class_ids (re-exports ogar_vocab::class_ids::*) and class_view already follow. Drift between local and OGAR is now structurally impossible.

New tests (pin the re-exports themselves)

  • app_prefix_re_exports_the_typed_ogar_constantAPP_PREFIX == OpenProjectPort::APP_PREFIX == 0x0001.
  • render_classid_agrees_with_the_central_ogar_composition — for every concept, render_classid(c) == ogar_vocab::app::render_classid_for::<OpenProjectPort>(c).

The low/high decomposition in render_classid_keeps_concept_in_the_low_half now routes through ogar_vocab::app::app_of / concept_of (also #97) instead of local shifts — the bit math now has exactly one home.

#99 spellbook pre-flight (cleared)

Q answer
Q1 reading FROM OGAR static port alias + PortSpec::APP_PREFIXno behavior.
Q2 lifecycle vocab None.
Q3 target IR Canonical OGAR (ogar_vocab::ports + ogar_vocab::app).
Q4 arrow direction producer→OGAR→consumer. No SurrealQL in this PR.
Q5 inverse recover N/A — no behavior.

Zero diagnostic signatures (*_ast.rs spine / From<DdlAst> / triple.rs+recompute_dag.rs cluster / sentinel DDL comments / behavioral roundtrip claims / string-typed FSMs / DEFINE EVENT chains) — none present.

Build

Cross-refs


Generated by Claude Code

…one source of truth)

Adopts the OGAR PR #97 / #98 / #99 surface in `op_canon::app`, replacing the
two local mirrors with re-exports from `ogar-vocab`:

  - APP_PREFIX        local `pub const = 0x0001`
                  →   `pub const = OpenProjectPort::APP_PREFIX`  (#97 typed const)
  - render_classid    local `(APP_PREFIX as u32) << 16 | concept`
                  →   `ogar_vocab::app::render_classid_for::<OpenProjectPort>` (#97 central)
  - low/high decomp   local `(cid >> 16) as u16` / `cid as u16` in the test
                  →   `ogar_vocab::app::app_of(cid)` / `concept_of(cid)`  (#97 central)

Closes the B2#1 follow-up flagged on #56 (op-canon's introductory PR): the
local prefix literal and local bit math are gone; the consumer composes its
0x0001 render via the typed upstream surface, matching the same
one-source-of-truth discipline `class_ids` / `class_view` already follow.

Two new tests:
  - app_prefix_re_exports_the_typed_ogar_constant
  - render_classid_agrees_with_the_central_ogar_composition

#99 trap-spellbook pre-flight: cleared all 5 questions (no producer reading,
no lifecycle vocabulary, target IR is canonical OGAR, arrow producer→OGAR→
consumer, no behavior to recover). Zero diagnostic signatures present.

Lockfile: cargo update -p ogar-vocab → OGAR main @ 273fa78 (post-#99).
cargo +1.95 test -p op-canon: 19 unit + 5 doctests pass; fmt + clippy
(--D warnings) clean.
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