feat(od-ontology): consume the classid pull — annotated DDL, CLI, convergence pin#4
Closed
AdaWorldAPI wants to merge 4 commits into
Closed
feat(od-ontology): consume the classid pull — annotated DDL, CLI, convergence pin#4AdaWorldAPI wants to merge 4 commits into
AdaWorldAPI wants to merge 4 commits into
Conversation
…vergence pin The 5+3 sprint increment: the classid pull (PR #2) exposed the canonical OGAR id; this PR CONSUMES it. Five disjoint-file workers, edit-only, one central compile/clippy/test pass. All additive, all under `ogar-emit`. S1 — emit_via_ogar_annotated(): emits the SurrealQL DDL prefixed with a per-table classid comment header (`-- classid account_move = 0x00020202`, `(uncodified)` for codebook misses) so the emitted schema is self-describing about which shared concept each table denotes. Also re-exports `ogar_vocab::class_ids` so consumers symbol-bind to the codebook constants instead of copying hex. S2 — tests/odoo_ogar_convergence.rs: the consumer-side mirror of OGAR's 5-way convergence pin. Symbol-bound (== class_ids::BILLABLE_WORK_ENTRY, not a hex literal), full-surface (concept + render + schema), + the negative pin (ir_cron -> None) the convergence review (R4) required. S3 — `od-codegen --classids`: prints the `table -> 0xAABBCCDD` map instead of DDL. Self-gated under `ogar-emit` (the flag is always recognized; without the feature it prints a rebuild directive). Verified end-to-end on data/slice_2.spo.ndjson. S4 — README: "Pulling the canonical classid (OGAR)" section — API, the APP‖class layout, the planner↔ERP convergence table, the name-form caveat. S5 — Cargo.toml: pin-freshness annotation (08a9c979 IS the #94 merge, the tightest correct pin; main is 5ee87b5 post-#96, additive/test-only, no bump needed). Comment-only. Review-driven refinements folded in: R2's `_`->`.` bijection-scope doc caveat (l10n_*/im_livechat_* fail safe to None), R4's symbol-bound full-surface pin, R5's pin-freshness note. Tests: 32 lib + 6 bin + 7 convergence + 23 integration/doc, green under --features cli,ogar-emit. Clippy exit 0 (zero new warnings). The canonical_concept-on-Class fusion (R4's highest-value follow-on) is deferred — it needs an OGAR-side id->concept-name capability. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… -- header
5+3 delta-review auto-resolve (convergence-architect R4). The sprint's
first cut stamped the classid as a `-- classid …` line-comment HEADER,
but SurrealDB drops `--` comments at parse time — the id evaporated on
ingestion, self-describing the .surql FILE only, not the database.
The emitter already supports `DEFINE TABLE <t> SCHEMAFULL COMMENT '<desc>'`
(ogar-adapter-surrealql renders Class.description). So emit_via_ogar_annotated
now sets `class.description = Some(format!("classid:0x{id:08X}"))` per
codebook table; the id rides into SurrealDB's own catalog metadata,
queryable via `INFO FOR TABLE`. This also re-aligns S1 to the ORIGINAL
plan-doc spec (which said COMMENT, not --) — the worker had drifted.
Strictly additive: an uncodified-only schema emits byte-identical DDL via
both paths (new test `emit_via_ogar_annotated_is_additive_over_native_emit`).
Tests rewritten to assert `COMMENT 'classid:0x00020202'` + exactly one
classid stamp (ir_cron unstamped).
Also files PROBE-OGAR-ID-TO-CONCEPT-NAME (specs/UPSTREAM_WISHLIST.md): the
concept-NAME enrichment + the canonical_concept-on-Class fusion are gated on
an OGAR-side `u16 -> &str` reverse lookup that doesn't exist yet (OdooPort::
aliases() is forward-only). The hex-id COMMENT shipped here needs no such
capability; the name enrichment waits. Both are the same gate.
32 lib + 6 bin + 7 convergence + 23 integration green under cli,ogar-emit;
clippy exit 0 (zero new warnings); fmt-clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wave B. A runnable example demonstrating the whole "pull OGAR via class"
target: corpus → schema → canonical classid map → annotated SurrealQL DDL
with the classid in the DEFINE TABLE COMMENT clause.
cargo run -p od-ontology --example classid_pull --features ogar-emit
Output (real slice_2 corpus):
account_move concept=0x0202 render=0x00020202
account_move_line concept=0x0201 render=0x00020201
res_company (uncodified — no canonical analogue)
res_partner concept=0x0204 render=0x00020204
account_analytic_line → 0x0103 (BILLABLE_WORK_ENTRY)
≡ WoA/SMB Stundenzettel ≡ OpenProject/Redmine TimeEntry
DEFINE TABLE account_move SCHEMAFULL COMMENT 'classid:0x00020202';
Gated [[example]] (required-features = ["ogar-emit"]) so a default
`cargo build --examples` doesn't hit the gated symbols. Clippy exit 0,
fmt-clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…utcome Board-hygiene: the sprint-plan doc's outcome section — S1-S5 + Wave B shipped, two 5+3 review rounds unanimous LAND, R4's COMMENT-clause auto-resolve, PROBE-OGAR-ID-TO-CONCEPT-NAME filed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
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
The 5+3 sprint increment on top of #2. PR #2 exposed the canonical OGAR
classid (
concept_classid/render_classid/schema_classids); this PRconsumes it. Five disjoint-file Sonnet workers, edit-only, one central
compile/clippy/test pass. All additive, all under
ogar-emit.emit_via_ogar_annotated()— DDL prefixed with a per-table classid comment header (-- classid account_move = 0x00020202,(uncodified)for misses) so the emitted schema is self-describing. Re-exportsogar_vocab::class_idsfor symbol-binding.tests/odoo_ogar_convergence.rs— consumer-side mirror of OGAR's 5-way pin. Symbol-bound (== class_ids::BILLABLE_WORK_ENTRY), full-surface, + negative pin (ir_cron → None).od-codegen --classids— prints thetable → 0xAABBCCDDmap. Self-gated underogar-emit.--classidsend-to-end (real corpus,data/slice_2.spo.ndjson)The "reusable ontology" made operator-inspectable: every Odoo table → the
shared cross-app concept id.
account_analytic_line → 0x00020103(
BILLABLE_WORK_ENTRY) is the planner↔ERP billable-hours pin.Gate (5+3 review of the parent #2 — all green)
brutally-honest-testerLAND ·baton-handoff-auditorCLEAN ·core-first-architectTARGETS-CORE ·
convergence-architectOPPORTUNITY ·integration-leadLANDS CLEANLY.Review-driven refinements folded into THIS PR: R2's
_→.bijection-scope caveat(
l10n_*/im_livechat_*fail safe toNone), R4's symbol-bound full-surface pin,R5's pin-freshness note.
Tests
32 lib + 6 bin + 7 convergence + 23 integration/doc, green under
--features cli,ogar-emit. Clippy exit 0 (zero new warnings). fmt-cleanon all changed files.
Deferred (honest)
R4's highest-value follow-on — populate
canonical_concepton theClassshells so
schema_classidscollapses into a derived view — needs an OGAR-sideid → concept-namecapability (thesale.order → COMMERCIAL_DOCUMENTvs lexicalorderasymmetry is the gating probe). Filed as a follow-on, not forced.Refs: OGAR #94 (
OdooPort), #95 (migration plan), lance-graph #589. Builds on #2.