Repository navigation
feat(ogar-emitter): projection emitter — generated impl From<Row> for Domain (Patient furnace turn) - #212
Merged
Conversation
…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.
Bugbot couldn't run - usage limit reachedBugbot 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
marked this pull request as ready for review
July 19, 2026 10:28
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the projection emitter to
ogar-emitter— the read-arm twin ofemit_do_adapters. It turns a typed column→field projection recipe into adeterministic
impl From<Row> for Domainmodule (the Pattern Aprojection 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-declarationemitter (
RustStruct) but no projection emitter — that gap is filledhere so Session A can replay its value oracle against generated output
instead of the hand-written projection.
Shape
ProjectionClass/FieldProjection/FieldSource— corpus-agnostictyped input (no corpus data in the module), mirroring
do_adapter.rs.FieldSourceis a closed transform set derived from the realmedcare
PatientRow→Patientprojection:Passthrough/UnwrapOrDefault/MapNaiveDate/IntFlagToBool/Const. Atransform not in the set is a Core gap → extend the enum deliberately
(Core-First), never hand-patch generated output.
canonical_concept_id);patient=0x0901(already minted). Unminted concepts get a visiblemarker, never silent.
order) → diffable as a golden artifact.
Proof
PatientRow→Patientprojection byte-for-byte in behavior — this isthe Patient shakedown; Session A replays its
medcare-parity-fixturesvalue oracle against this generated output.
cargo test -p ogar-emitter→ 38 pass;cargo clippy -p ogar-emitter --all-targets -- -D warningsclean;cargo fmtclean.Handoff
Session A: wire the emitted
impl From<PatientRow> for Patientas thegenerated Patient adapter and re-run the
projected_patient_matches_csharp_fixture-style replay against it. Thevalue-oracle side is ready to receive it.