Skip to content

feat(ogar-emitter): projection emitter — generated impl From<Row> for Domain (Patient furnace turn) - #212

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/a2ui-screen-addressing-continue-azizft
Jul 19, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
claude/a2ui-screen-addressing-continue-azizft

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Adds the projection emitter to ogar-emitter — the read-arm twin of
emit_do_adapters. It turns a typed column→field projection recipe into a
deterministic impl From<Row> for Domain module (the Pattern A
projection consumers hand-write today as impl From<XRow> for Domain).

Why

Session B's Patient furnace turn (CODEGEN-PARITY-SESSION-SPLIT.md).
The furnace's "no hand-roll" rule: when a consumer wants to hand-author a
projection, that means the generator is missing an arm. OGAR had the
DO/behavioral emitter (emit_do_adapters) and a struct-declaration
emitter (RustStruct) but no projection emitter — that gap is filled
here so Session A can replay its value oracle against generated output
instead of the hand-written projection.

Shape

  • ProjectionClass / FieldProjection / FieldSource — corpus-agnostic
    typed input (no corpus data in the module), mirroring do_adapter.rs.
  • FieldSource is a closed transform set derived from the real
    medcare PatientRow→Patient projection: Passthrough /
    UnwrapOrDefault / MapNaiveDate / IntFlagToBool / Const. A
    transform not in the set is a Core gap → extend the enum deliberately
    (Core-First), never hand-patch generated output.
  • classid provenance stamped from the codebook (canonical_concept_id);
    patient = 0x0901 (already minted). Unminted concepts get a visible
    marker, never silent.
  • Fully deterministic (classes sorted by domain type; field order = recipe
    order) → diffable as a golden artifact.

Proof

  • Pinned golden test reproduces the hand-written medcare
    PatientRow→Patient projection byte-for-byte in behavior — this is
    the Patient shakedown; Session A replays its medcare-parity-fixtures
    value oracle against this generated output.
  • Determinism test (class-order invariance) + unminted-marker test.
  • cargo test -p ogar-emitter → 38 pass; cargo clippy -p ogar-emitter --all-targets -- -D warnings clean; cargo fmt clean.

Handoff

Session A: wire the emitted impl From<PatientRow> for Patient as the
generated Patient adapter and re-run the
projected_patient_matches_csharp_fixture-style replay against it. The
value-oracle side is ready to receive it.

…r Domain`

The read-arm twin of `emit_do_adapters`. Turns a typed column->field
projection recipe (`ProjectionClass` / `FieldProjection` / closed
`FieldSource` transform vocabulary) into a deterministic, golden-diffable
`impl From<Row> for Domain` module — the Pattern-A projection that
consumers hand-write today (`impl From<XRow> for Domain`).

This is Session B's Patient furnace turn (CODEGEN-PARITY-SESSION-SPLIT):
the generator arm that retires the hand-rolled projection residue so the
value oracle can replay against generated output instead of hand code.

- `FieldSource` closed set derived from the real medcare `PatientRow` ->
  `Patient` projection: Passthrough / UnwrapOrDefault / MapNaiveDate /
  IntFlagToBool / Const. A transform not in the set is a Core gap ->
  extend the enum deliberately (Core-First), never hand-patch output.
- classid provenance stamped from the codebook (`canonical_concept_id`);
  `patient` = 0x0901 (already minted). Unminted concepts marked, not silent.
- Pinned golden test reproduces the hand-written medcare projection
  byte-for-byte in behavior; determinism + unminted-marker tests.

Generated by Claude Code.
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_af8e9675-8f5f-4594-99f6-5702afe01240)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review July 19, 2026 10:28
@AdaWorldAPI
AdaWorldAPI merged commit 034bdef into main Jul 19, 2026
2 checks 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