Skip to content

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

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

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

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

The Redmine-side twin of openproject-nexgen-rs#57: adopts the OGAR PR #97 surface in redmine_canon::app, replacing the two local mirrors with re-exports from ogar-vocab.

// before — local literal + local bit math
pub const APP_PREFIX: u16 = 0x0007;
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 = RedminePort::APP_PREFIX;             // #97 typed const
pub fn render_classid(concept: u16) -> u32 {
    ogar_vocab::app::render_classid_for::<RedminePort>(concept)  // #97 central comp
}

Keeps the two -canon ports byte-symmetric on the new OGAR surface: op-canon re-exports OpenProjectPort::APP_PREFIX (0x0001), redmine-canon re-exports RedminePort::APP_PREFIX (0x0007). One source of truth; drift between local and OGAR is now structurally impossible.

New tests (pin the re-exports)

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

The low/high decomposition test now routes through ogar_vocab::app::app_of / concept_of (also #97) instead of local shifts.

#99 spellbook pre-flight (cleared)

Q answer
Q1 reading FROM OGAR static port alias + PortSpec::APP_PREFIX — no 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 present.

Build

Cross-refs

…GAR (one source of truth)

The Redmine-side twin of openproject-nexgen-rs#57: adopts the OGAR PR #97
surface in `redmine_canon::app`, replacing the two local mirrors with
re-exports from `ogar-vocab`:

  - APP_PREFIX        local `pub const = 0x0007`
                  →   `pub const = RedminePort::APP_PREFIX`  (#97 typed const)
  - render_classid    local `(APP_PREFIX as u32) << 16 | concept`
                  →   `ogar_vocab::app::render_classid_for::<RedminePort>` (#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)

Keeps the two `-canon` ports byte-symmetric on the new OGAR surface: op-canon
re-exports OpenProjectPort::APP_PREFIX (0x0001), redmine-canon re-exports
RedminePort::APP_PREFIX (0x0007). The local prefix literal and local bit math
are gone; the consumer composes its 0x0007 render via the typed upstream
surface, matching the one-source-of-truth discipline class_ids already follows.

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 (post-#97).
cargo +1.95 test -p redmine-canon: 22 unit + 5 doctests pass; fmt + clippy
(-D warnings) clean.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AdaWorldAPI AdaWorldAPI merged commit 33e4ea4 into main Jun 23, 2026
1 check passed
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