Foreign-consumer SDK: ogar-adapter-python + ogar-adapter-csharp (materialization emitters, compile+run parity)#177
Conversation
Two new crates in the adapter family (operator directive: give C# and Python consumers the plug-and-play surface before the pattern dilutes). Each emits ONE deterministic self-contained source file materializing: all 84 class ids + the canon-high compose helper, the domain action tables (generic over domain_tables() -- future domains land on regeneration), a PURE target-language mirror of resolve_hotplug with the same five drift arms (the confirmation loop runs identically in the foreign language), and the V3 4+12 facet decoder (16 B = classid LE + 6x8:8, E-V3-FACET-4-PLUS-12) as the substrate read surface. Verification is compile+RUN parity in both languages against ONE Rust ground-truth dump (115 lines): python3 py_compile + import + diff; dotnet build + run + diff (offline, no NuGet). Facet bytes built in Rust decode field-identically in both. 4/4 integration tests; fmt+clippy -D warnings clean; ogar-vocab sibling untouched. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
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_0ee85439-8fe9-471c-a92e-0d85cc81cbf0) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f7eaeba7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| lines.append(f"UnknownClassid={e.classid:04X}") | ||
|
|
||
| try: | ||
| resolve_hotplug("tesseract-ogar", [CLASS_IDS["patient"]], []) |
There was a problem hiding this comment.
Pick a no-capability class dynamically
This hard-codes patient as the NoCapabilitiesFor fixture, which makes the advertised “future domain_tables entry lands on regeneration” path brittle. If a later valid domain table binds the health patient classid, this generated dump (and the mirrored C#/ground-truth fixture) will throw a different drift such as UnexpectedConsumer/Uncovered instead of recording NoCapabilitiesFor, so adapter regeneration/tests fail even though the new domain table is valid. Choose a minted id that is absent from the current DOMAIN_TABLES at dump-generation/runtime instead of pinning patient.
Useful? React with 👍 / 👎.
Two things: 1. Finish the consumer parity (#177 follow-up). The C#/Python adapter parity tests hard-`.expect()`ed their external toolchain, so any environment without `dotnet` / `python3` reported a FALSE failure for a missing-toolchain condition (not a code defect) — e.g. a bare sandbox with no .NET SDK. Added `dotnet_available()` / `python3_available()` probes: skip with a printed SKIP notice when the toolchain is absent, but HARD-FAIL under `CI` (env var set) so a runner missing the SDK breaks loudly rather than silently dropping coverage. CI images must provision the net8.0 SDK / a python3 interpreter (both already assumed by the pure-BCL / py_compile loops). Verified: both crates' parity targets are now green in a bare sandbox (C# skips 2, Python runs 2), fmt + clippy clean. 2. Add docs/integration/MEDCARE-CSHARP-PARITY-INTEGRATION-PLAN.md (PROPOSAL, operator-gated). The absence of a healthcare ActionDef table is a deficiency, not a limit: the OCR table is hand-authored only because tesseract has no ActiveRecord source; MedCare HAS a C# source, so its healthcare action table should be HARVESTED (ruff_csharp_spo -> ModelGraph -> ogar-from-ruff::lift_actions) not fabricated. And because MedCare IS C#, the same capability surface rendered two ways -- medcare-rs (Rust, ogar-vocab) and MedCareV2 (C#, ogar-adapter-csharp emit) -- is a diverse-redundancy cross-language parity witness. The plan sequences consumer-parity-first (Loop B, P1-P2) then harvest-the-deficiency (Loop A, P3-P6), probe-first with per-phase KILL conditions, and records the missing pieces (a C# frontend for lift_actions; the executor/capability set question). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
What
Foreign-consumer SDK (operator directive: give C# and Python consumers the plug-and-play surface before the pattern dilutes): two new crates in the adapter family.
ogar-adapter-python/ogar-adapter-csharp—emit_python(module)/emit_csharp(namespace): ONE deterministic, self-contained generated source file per language, materializing:class_ids::ALL) + the canon-highcompose_render_classidhelper,capability_registry::domain_tables()— a future thinking-styles entry lands on regeneration, zero emitter changes) incl. the full OCR specs (params/produces/subjects),resolve_hotplugwith the same five drift arms — the hot-plug confirmation loop runs identically in Python/C#,E-V3-FACET-4-PLUS-12) — the substrate read surface for foreign consumers.Verification — compile + RUN parity, both languages, ONE ground truth
The comparison harness is a single Rust function (
ogar_adapter_python::ground_truth, reused by the C# tests): a 115-line canonical dump. Python:py_compile+ import + byte-identical diff. C#:dotnet build+dotnet run(net8.0, offline, zero NuGet) + byte-identical diff. Facet bytes built in Rust decode field-identically in both languages. 4/4 integration tests, fmt + clippy-D warningsclean,ogar-vocabuntouched.Next (separate PR): the tesseract-rs V3-substrate parity probe — real eng.lstm facet bytes decoded by THIS emitted Python SDK.
🤖 Generated with Claude Code
https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1