Skip to content

OGIT 1:1 import + ogar-from-schema producer with reverse-emit and SGO#105

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z
Jun 22, 2026
Merged

OGIT 1:1 import + ogar-from-schema producer with reverse-emit and SGO#105
AdaWorldAPI merged 1 commit into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What lands

Three things, one commit:

  1. OGIT mirrored 1:1 at a pinned SHA. Full upstream vocabulary
    under vocab/imports/ogit/: NTO (72 domains, 1431 TTLs), SGO upper
    ontology (508 TTLs including 176 canonical verbs), root ogit.ttl,
    SDF JSON config samples. 9.3 MB, bijective with origin.
    Sample-200 random byte-equality check: zero mismatches.

  2. ogar-from-schema producer family. Three modules — ttl
    (line-oriented OGIT-dialect parser), ttl_emit (reverse emit,
    semantic bijection), sgo (verb registry parser + emit). Lifts the
    structural arm of a domain from declarative schemas; pairs with
    the existing source-AST producers (ogar-from-rails,
    ogar-from-elixir) which carry the behavioural arm.

  3. MARS as the third closed-formal calibration domain (after chess
    and OSM-quadkey). The MARS-Schema XSD oracle (MARSSchema2015.xsd,
    frozen since 2015, version 5.3.8) is vendored at
    vocab/imports/ogit/NTO/MARS/_oracle/ together with the upstream
    extract_classes.py (Python 2 as-is + mechanical Py3 conversion).
    The TTL fixed-enum values must agree byte-for-enum with the
    XSD-extracted classification set — mechanically tested.

Three levels of bijection, all mechanically enforced

Level What it proves How
1. Byte equality vs upstream The mirror is bit-identical to AdaWorldAPI/OGIT at the pinned SHA diff -qr (manual, documented in calibration/mars/README.md)
2. XSD-oracle agreement TTL fixed-enum values appear in the XSD-extracted set (chess-grade calibration at the schema layer) ttl::tests::application_class_values_appear_in_xsd_oracle
3. Semantic round-trip parse(emit(parse(src))) == parse(src) for every predicate the OGIT dialect uses ttl_emit::tests::all_mars_ttl_files_roundtrip + sgo::tests::all_sgo_verbs_roundtrip

Whitespace, comment positions, and @prefix declaration order are
intentionally not preserved — they are not load-bearing for the
structural arm, and pursuing byte-bijection would force the producer
to carry raw text alongside parsed structure, defeating the "schema
as IR" pattern.

The finding logged in EPIPHANIES

Three new dated entries (FINDING):

  • Schema-vs-source duality. Schemas lift the structural arm
    bijectively (declarative-by-construction). Source ASTs lift the
    behavioural arm best-effort (dynamic dispatch defeats static
    extraction). The two cover disjoint surfaces that meet only at
    the structural arm and become each other's oracle there. Emitting
    a schema from a source-lifted Class and diffing against the
    committed schema is "ontology change management" — what Palantir
    Foundry charges money for, free here from extract_classes.py
    plus 50 LOC of reverse-emit.
  • Reverse-engineering bijection. Producer is symmetric:
    anything lifted from OGIT TTL can be emitted back. No two-way
    translation table is needed for bardioc's migration — the
    producer IS the translator.
  • SGO is the AST predicate vocabulary. 176 verbs (dependsOn,
    contains, runsOn, generates, relates, causes, …) sitting
    in the upper ontology are exactly the predicates every NTO entity's
    ogit:allowed (…) block references. Lifted into typed VerbDecl
    registry; string-compared references become typed lookups for
    Association / ActionDef.

Docs (reverse-pyramid, pattern density first)

  • docs/HIRO-IN-CLASSES.md — bardioc-efficiency story: what changes
    with the lift (dispatch, validation, dependency graph, similarity)
    and what stays (XSD validation, REST surface, audit). Concrete
    byte/ns numbers per call.
  • docs/MARS-TRANSCODING.md — the calibration spec. Four-entity
    A→R→S→M backbone, oracle pipeline, six IR-shape tests audit.
  • docs/FOUNDRY-ODOO-MARS-LENS.md — three angles on one ontology.
    What MARS teaches Odoo (frozen-schema drift detection); what Odoo
    teaches MARS (_inherit mixin composition); what OGAR adds (IR as
    contract, not vendor platform).
  • docs/OGIT-DOMAIN-LIFT-CATALOGUE.md — coverage register for the
    72 NTO domains with Imported / Lift-tested / Cross-walked /
    Production status. Avoids future re-fetch and re-derivation cycles.
  • docs/calibration/mars/README.md — recipe to re-prove the
    bijection from scratch (three commands).
  • docs/DOMAIN-INSTANCES.md — MARS row + capability matrix columns
    for frozen-schema bijection oracle, reverse-emit, AST predicate
    registry.

Provenance

  • vocab/imports/ogit/PROVENANCE.md — full OGIT, SHA-pinned at
    d0f489fff94640fef1e6abe7eacba90a1a144579 (2026-05-30), MIT
    licensed.
  • vocab/imports/ogit/NTO/MARS/PROVENANCE.md — adds the XSD oracle
    from arago/MARS-Schema with Py2→Py3 conversion documentation.

Test footprint

  • 15/15 tests in ogar-from-schema (round-trips + XSD-oracle
    agreement on 29 MARS TTLs + 176 SGO verbs).
  • 296/0 workspace passed/failed.
  • Clippy-clean (--no-deps) and fmt-clean on the new crate.

Re-vendor recipe

Documented in vocab/imports/ogit/PROVENANCE.md. Three cp -r + one
SHA bump. Future SHA updates are mechanical; the bijection tests
catch every drift.


Generated by Claude Code

…e-emit + SGO verbs

Mirror the full AdaWorldAPI/OGIT vocabulary into vocab/imports/ogit/
(1940 TTLs, NTO 72 domains + SGO 508 upper-ontology TTLs incl. 176
canonical verbs + root ogit.ttl + SDF samples) at a pinned SHA, and
land the ogar-from-schema producer family that lifts them.

Calibration (MARS as the third closed-formal domain):

* vocab/imports/ogit/NTO/MARS/_oracle/ vendors the MARS-Schema XSD
  + the upstream extract_classes.py (Python 2, runs unchanged on
  Py3 via mechanical 2to3-3.11 -w -n conversion, also cached) +
  the asciidoc/html oracle outputs.
* ttl::tests::application_class_values_appear_in_xsd_oracle proves
  the OGIT TTL fixed-enum values agree with the XSD-extracted set
  byte-for-enum (chess-grade calibration at the schema layer).
* ttl_emit::tests::all_mars_ttl_files_roundtrip + sgo::tests::all_sgo_verbs_roundtrip
  prove SEMANTIC bijection (parse → emit → re-parse == original) on
  every MARS TTL (29) and every SGO verb (176). 15/15 tests green.

Reverse-engineering / save-back:

* ttl_emit::{emit_entity,emit_attribute} and sgo::emit_verb close the
  loop: any OGAR Class lifted from OGIT-flavoured TTL can be emitted
  back. Contract is semantic bijection (whitespace, comment positions,
  @Prefix ordering not preserved — they're not load-bearing for the
  structural arm). The producer IS the translator — no two-way table
  needed for bardioc's migration.

SGO verbs as AST predicate vocabulary:

* SGO/sgo/verbs/ carries 176 verbs (dependsOn, contains, runsOn,
  generates, relates, causes, …) — exactly the set every NTO entity's
  ogit:allowed block references. sgo::parse_verb lifts each into a
  typed VerbDecl with round-trip enforced. Resolves string-compared
  references into typed registry lookups for ActionDef / Association.

Docs (reverse-pyramid, pattern density first):

* docs/HIRO-IN-CLASSES.md — bardioc-efficiency story for colleagues
  (the funny insight: schemas lift structure bijectively; source ASTs
  lift behaviour best-effort; the two cross-validate at the
  structural boundary — Foundry's "ontology change management" for free)
* docs/MARS-TRANSCODING.md — calibration spec (chess-grade bijection
  oracle, four-entity A→R→S→M backbone, six IR-shape tests audit)
* docs/FOUNDRY-ODOO-MARS-LENS.md — three angles on one ontology
  (MARS→Odoo: frozen-schema drift detection; Odoo→MARS: _inherit
  mixin composition; OGAR over both: IR-as-contract not platform)
* docs/OGIT-DOMAIN-LIFT-CATALOGUE.md — coverage register for the 72
  imported NTO domains with Imported/Lift-tested/Cross-walked/Production
  status (avoids future re-fetch / re-derive cycles)
* docs/calibration/mars/README.md — oracle re-run recipe
* docs/DOMAIN-INSTANCES.md — MARS row + capability column expansions

Lessons logged:

* .claude/board/EPIPHANIES.md prepends three FINDINGs:
  - schema-vs-source duality
  - reverse-engineering bijection
  - SGO as the AST predicate vocabulary

Provenance:

* vocab/imports/ogit/PROVENANCE.md (top-level — full OGIT, SHA-pinned)
* vocab/imports/ogit/NTO/MARS/PROVENANCE.md (per-MARS — adds XSD oracle
  from arago/MARS-Schema with conversion provenance)
* Sample-200 random byte-equality vs origin: zero mismatches.

Tests: 15/15 in ogar-from-schema; full workspace 296/0 passed/failed.
Clippy-clean (--no-deps), fmt-clean for the new crate.
@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 09ac8eb into main Jun 22, 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