OGIT 1:1 import + ogar-from-schema producer with reverse-emit and SGO#105
Merged
Merged
Conversation
…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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 lands
Three things, one commit:
OGIT mirrored 1:1 at a pinned SHA. Full upstream vocabulary
under
vocab/imports/ogit/: NTO (72 domains, 1431 TTLs), SGO upperontology (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.
ogar-from-schemaproducer family. Three modules —ttl(line-oriented OGIT-dialect parser),
ttl_emit(reverse emit,semantic bijection),
sgo(verb registry parser + emit). Lifts thestructural 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.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 upstreamextract_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
AdaWorldAPI/OGITat the pinned SHAdiff -qr(manual, documented incalibration/mars/README.md)ttl::tests::application_class_values_appear_in_xsd_oracleparse(emit(parse(src))) == parse(src)for every predicate the OGIT dialect usesttl_emit::tests::all_mars_ttl_files_roundtrip+sgo::tests::all_sgo_verbs_roundtripWhitespace, comment positions, and
@prefixdeclaration order areintentionally 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):
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
Classand diffing against thecommitted schema is "ontology change management" — what Palantir
Foundry charges money for, free here from
extract_classes.pyplus 50 LOC of reverse-emit.
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.
dependsOn,contains,runsOn,generates,relates,causes, …) sittingin the upper ontology are exactly the predicates every NTO entity's
ogit:allowed (…)block references. Lifted into typedVerbDeclregistry; string-compared references become typed lookups for
Association/ActionDef.Docs (reverse-pyramid, pattern density first)
docs/HIRO-IN-CLASSES.md— bardioc-efficiency story: what changeswith 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-entityA→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 (
_inheritmixin composition); what OGAR adds (IR ascontract, not vendor platform).
docs/OGIT-DOMAIN-LIFT-CATALOGUE.md— coverage register for the72 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 thebijection from scratch (three commands).
docs/DOMAIN-INSTANCES.md— MARS row + capability matrix columnsfor frozen-schema bijection oracle, reverse-emit, AST predicate
registry.
Provenance
vocab/imports/ogit/PROVENANCE.md— full OGIT, SHA-pinned atd0f489fff94640fef1e6abe7eacba90a1a144579(2026-05-30), MITlicensed.
vocab/imports/ogit/NTO/MARS/PROVENANCE.md— adds the XSD oraclefrom
arago/MARS-Schemawith Py2→Py3 conversion documentation.Test footprint
ogar-from-schema(round-trips + XSD-oracleagreement on 29 MARS TTLs + 176 SGO verbs).
--no-deps) and fmt-clean on the new crate.Re-vendor recipe
Documented in
vocab/imports/ogit/PROVENANCE.md. Threecp -r+ oneSHA bump. Future SHA updates are mechanical; the bijection tests
catch every drift.
Generated by Claude Code