Skip to content

Sprint 3: Action vocab (ActionDef + ActionInvocation) + ogar-adapter + SPO+TeKaMoLo emission#3

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/sprint-3
Jun 4, 2026
Merged

Sprint 3: Action vocab (ActionDef + ActionInvocation) + ogar-adapter + SPO+TeKaMoLo emission#3
AdaWorldAPI merged 2 commits into
mainfrom
claude/sprint-3

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

Sprint 3 of OGAR: behavior arm lands. ActionDef + ActionInvocation + ogar-adapter crate ship with the SPO+TeKaMoLo emission per docs/ADAPTERS-AND-ACTORS.md.

What's new

New crate crates/ogar-adapter

  • Adapter trait + BTreeMapAdapter default + OdooAdapter first concrete impl
  • 15 default Odoo leaves (ogit-erp/move → odoo:transport etc.)
  • 7 unit tests

ogar-vocab — Action vocabulary

  • ActionDef (declaration) + ActionInvocation (per-context firing) — B1 fix
  • KausalSpec sum type (StateGuard / LifecycleTrigger / Depends / ContextDepends / External) — B1 fix
  • B2 provenance fields: trace_id, parent_invocation, idempotency_key, emitted_at_millis, failure_reason
  • ActionState lifecycle: Pending / Committed / Failed / Cancelled — B2 fix
  • LokalSpec with tenant + actor + company

ogar-emitteremit_action_def + emit_action_invocation

  • Full SPO+TeKaMoLo triple emission per invocation
  • KausalSpec sum-type dispatch produces variant-specific triples
  • 4 new tests + 49 tests total

vocab/ogar.ttl — 24 new predicates + 4 enumeration classes

Brutal-review cycle 3 outcomes

Phase Agents Outcome
Research R1 (Ractor), R2 (OpenTelemetry), R3 (@api.depends), R4 (Erlang via-tuple), R5 (Event sourcing) Findings synthesized into design + EPIPHANIES
Brutal B1 (architectural), B2 (production), B3 (YAGNI) B1+B2 critical fixes LANDED; B3 selective cuts applied

YAGNI cuts (deferred)

  • RailsAdapter (Sprint 3.6) — pattern validates with one concrete adapter
  • unmap() direction — Sprint 4.5 (SurrealQL bidirectional) introduces
  • Custom NibleHHTL type — wait for benchmark evidence

Test plan

  • cargo check --workspace clean
  • cargo test --workspace — 49 tests passing (was 45)
  • Reviewer reads EPIPHANIES.md Sprint 3 cycle entry — confirms the synthesis
  • Reviewer confirms Action triple emission for the worked example traces matches doc §3.4

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be571ec1f0

ℹ️ 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".

Comment thread crates/ogar-emitter/src/lib.rs Outdated
Comment on lines +664 to +667
triples.push(Triple::new(&id, "ogar:methodBody", body.clone()));
}
for d in &def.decorators {
triples.push(Triple::new(&id, "ogar:decoratorName", d.clone()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use action-scoped body/decorator predicates

When an ActionDef has a body or decorators, these triples reuse ogar:methodBody / ogar:decoratorName, but the canonical vocabulary declares those predicates with rdfs:domain ogar:MethodDecl in vocab/ogar.ttl lines 201-204. Under RDFS reasoning, every decorated/body-carrying ActionDef will also be inferred as a MethodDecl, polluting method queries and violating the vocabulary-as-contract rule; add ActionDef-specific predicates or widen the TTL domains before emitting them here.

Useful? React with 👍 / 👎.

Comment thread crates/ogar-emitter/src/lib.rs Outdated
Comment on lines +737 to +744
v.push(Triple::new(action_subject, "ogar:dependsPath", p.clone()));
}
v
}
KausalSpec::ContextDepends { keys } => {
let mut v = vec![Triple::new(action_subject, "ogar:kausalKind", "ogar:ContextDepends")];
for k in keys {
v.push(Triple::new(action_subject, "ogar:dependsContext", k.clone()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid reusing computed-field dependency predicates

For KausalSpec::Depends / ContextDepends, emitting ogar:dependsPath and ogar:dependsContext from an ActionDef conflicts with the TTL contract: those predicates are declared with rdfs:domain ogar:ComputedField in vocab/ogar.ttl lines 187-188. Any action with dependency guards will therefore be inferred as a ComputedField, which corrupts downstream graph queries that enumerate computed fields; define action/kausal dependency predicates or adjust the vocabulary domain before using these terms here.

Useful? React with 👍 / 👎.

…d on UPSTREAM-DEPS)

Rebased onto main after the UPSTREAM-DEPS.md doc landed. Sprint 3 content
unchanged; adds an EPIPHANIES entry noting lance-graph #461 (Quasicryth +
COW Adaptive Radix Tree) as the future binding point for migrating the
BTreeMapAdapter placeholder to a COW radix structure (per B3 YAGNI exit
condition).

NEW crate: crates/ogar-adapter
- Adapter trait with map() direction (unmap deferred to Sprint 4.5)
- BTreeMapAdapter with iter_prefix() filter
- OdooAdapter with 15 default leaves for OGAR↔Odoo identity renames
- 7 unit tests

ogar-vocab — Action vocabulary
- ActionDef (declaration) + ActionInvocation (per (S, P, O, context)) — B1 fix
- KausalSpec sum type (StateGuard / LifecycleTrigger / Depends / ContextDepends / External) — B1 fix
- B2 provenance: trace_id, parent_invocation, idempotency_key, emitted_at_millis, failure_reason
- ActionState lifecycle: Pending / Committed / Failed / Cancelled — B2 fix
- LokalSpec with tenant + actor + company

ogar-emitter — emit_action_def + emit_action_invocation
- Full SPO+TeKaMoLo triple emission
- KausalSpec sum-type dispatch produces variant-specific triples
- 4 new tests — 49 tests total

vocab/ogar.ttl — 24 new predicates + 4 enumeration classes

EPIPHANIES updates
- Sprint 3 brutal-review cycle synthesis (5 research + 3 brutal — B1+B2 critical fixes
  LANDED, B3 selective YAGNI cuts applied)
- lance-graph #461 (COW Adaptive Radix Tree) noted as the future NibleHHTL substrate;
  current BTreeMapAdapter placeholder per B3 will migrate when leaf count / cross-tenant
  sharing demands a COW radix structure

Tests
- cargo check --workspace clean
- cargo test --workspace: 49 tests passing
…tion

Codex review on the Sprint 3 emitter caught two RDFS domain-pollution
gaps: emit_action_def reused predicates whose canonical domain is a
DIFFERENT class, so under RDFS/OWL reasoning an ActionDef would be
inferred as a MethodDecl or ComputedField — and, worse, plain SPARQL
queries enumerating those classes would catch ActionDefs too.

The real problem is query pollution, not just type inference: a query
`?cf ogar:dependsPath ?p` enumerating computed-field dependencies would
return dependency-guarded actions if they shared the predicate. Union
domains would NOT fix this (the predicate is still shared); distinct
predicates are required.

Two reuses fixed with action/kausal-scoped predicates:

1. ActionDef body + decorators (Codex finding #1)
   ogar:methodBody  → ogar:actionBody       (domain ogar:ActionDef)
   ogar:decoratorName → ogar:actionDecorator (domain ogar:ActionDef)
   The MethodDecl emitter keeps ogar:methodBody / ogar:decoratorName
   (domain ogar:MethodDecl) — unchanged.

2. Kausal dependency paths (Codex finding #2)
   ogar:dependsPath    → ogar:kausalDependsPath    (domain ogar:ActionDef)
   ogar:dependsContext → ogar:kausalDependsContext (domain ogar:ActionDef)
   The ComputedField emitter keeps ogar:dependsPath / ogar:dependsContext
   (domain ogar:ComputedField) — unchanged.

vocab/ogar.ttl
- Added ogar:actionBody, ogar:actionDecorator, ogar:kausalDependsPath,
  ogar:kausalDependsContext, all with rdfs:domain ogar:ActionDef.
- Gave the previously domain-less kausal predicates (kausalKind,
  guardField, guardValue, triggerEvent) explicit rdfs:domain ogar:ActionDef
  so the full kausal sub-graph is contract-scoped to ActionDef.

Tests
- kausal_spec_variants_emit_distinct_kinds now asserts on
  ogar:kausalDependsPath AND asserts ogar:dependsPath does NOT appear
  on an ActionDef (negative test guarding against regression).
- 49 tests still passing.

Verified by grep: ogar:methodBody / ogar:decoratorName appear only in
emit_method_decl_indexed; ogar:dependsPath / ogar:dependsContext only in
emit_computed_field_indexed. No cross-domain predicate reuse remains.
@AdaWorldAPI AdaWorldAPI merged commit e305167 into main Jun 4, 2026
AdaWorldAPI added a commit that referenced this pull request Jun 4, 2026
…; Sprint 5b unblocked

bardioc responded to OGAR's 3 surfaced decisions + mirrored the
coordination record (symmetric, with the Lance-sub bus consumer API +
ownership table). Net state change recorded:

- Decision #1 (registry append API) RESOLVED: the Box::leak interning
  workaround (ogar_proposal::boundary, PR #5) is accepted. Sprint 5b
  proceeds without waiting for an upstream SchemaOwned variant
  (which stays a nice-to-have-cleaner-later, not a blocker). Sprint 5b
  UNBLOCKED — now gated only on the cross-repo build (protoc), not a
  decision.
- Decision #2 (mailbox home) RESOLVED (grill #9) — already absorbed.
- Decision #3 (Lance-sub bus API) SURFACED: consumer API documented by
  bardioc, but the upstream symbol layout (concrete Rust types) hasn't
  shipped. Sprint 7 STAYS BLOCKED until it lands — binding against a
  documented-but-unshipped symbol layout is the guess-the-contract
  rework this discipline avoids.

Also reconciled Sprint 5's stale deliverables (same defect class Codex
flagged on Sprint 7): the old "wire contract layer / NiblePath
dictionary / Lance write path" deliverables were pre-correction and are
DROPPED (upstream's job). Sprint 5 now split 5a (shipped, PR #5) + 5b
(unblocked). EPIPHANIES updated append-only (new dated entry citing the
prior cross-session entry). Docs only.
AdaWorldAPI added a commit that referenced this pull request Jun 4, 2026
…print 7 unblocked + corrected; #4 surfaced

The parallel sessions shipped the Lance-subscription bus and placed the
temporal-epistemology framework. Two things land on OGAR's side; one is
a correction to OGAR's own doc.

NEW docs/TEMPORAL-TIME-TRAVEL.md
- Decision #3 SHIPPED: the bus is
  lance-graph-callcenter::version_watcher::LanceVersionWatcher, built on
  std::sync::{Arc,RwLock,Mutex,Condvar}, NOT tokio (upstream I-2
  invariant: tokio is Layer-3 outbound only; hot loop never uses
  tokio::sync). Hot path: subscribe() -> WatchReceiver -> wait_changed()
  (Condvar park) -> current() returns Arc<CognitiveEventRow>.
- This CORRECTS OGAR's design: SOA-IMPLEMENTATION §5.2's tokio::sync
  KanbanMailbox violates I-2 and is superseded by std::sync
  (Mutex<VecDeque> + Condvar) on the hot path. WIP/pull/backpressure
  policy stands; mechanism changes. (Sprint 7 was held — building the
  tokio version would have been exactly this rework.)
- SoA bridge ownership: ontology owns identity/classes/codebooks;
  callcenter owns LanceMembrane (sole writer) + watcher + CognitiveEventRow;
  ogar-runtime is a std::sync SUBSCRIBER, never a writer.
- Temporal-epistemology is a PLANNER-layer query annotation, NOT OGAR:
  the parallel session mapped the Python framework onto Lance versions
  (KnowledgeHorizon = checkout_version; EpistemicMode = planner query
  annotation; cross-server = HLC tick on CognitiveEventRow). OGAR does
  NOT build QueryReference/EpistemicMode (planner) or the HLC stamp
  (callcenter). OGAR consumes.
- Decision #4 surfaced (NOT blocking): ActionInvocation.emitted_at_millis
  is wall-clock i64; cross-server causal ordering needs an HLC tuple.
  Keep emitted_at an Option on the non_exhaustive struct so an HLC
  variant is a non-breaking add; conform to callcenter's HLC when the
  cross-server workload lands. Single-server causal order IS the Lance
  version sequence, so no change now.

CORRECTED docs/SOA-IMPLEMENTATION.md §5
- Correction banner at the top of the runtime layer: the tokio::sync
  sketches are superseded by the std::sync Condvar LanceVersionWatcher
  pattern per I-2. Policy kept, mechanism replaced.

PLAN.md Sprint 7
- UNBLOCKED + CORRECTED: std::sync Condvar subscriber over
  LanceVersionWatcher, not tokio/Ractor on the hot path. Consume
  lance-graph-callcenter::version_watcher as reference. Remaining gate:
  cross-repo build (protoc) + the user's signal. Decision #4 noted.

EPIPHANIES: one entry recording decision #3 shipped + the std::sync
correction + the epistemology boundary + decision #4 surfaced.

Posture matches the other session: FYI absorbed, not building yet.
Sprint 7 holds for the signal. Docs only; tests green.
AdaWorldAPI added a commit that referenced this pull request Jun 4, 2026
Temporal time-travel: decision #3 shipped (LanceVersionWatcher/Condvar) — Sprint 7 unblocked+corrected; #4 surfaced
AdaWorldAPI pushed a commit that referenced this pull request Jun 10, 2026
Born from the session's own regrounding audit: six turns of synthesis,
zero probes run — the workspace rule applies verbatim ('if the probe is
NOT RUN, the next deliverable is the probe, not more synthesis'). This
plan orders ALL the work probe-first:

  §0 The three shaky joints (J1 TILE256<->PREFIXBOOK circularity;
     J2 'lossless for synthesis' scope drift; J3 Parseval !=
     gaussian-preservation) promoted to first-class falsification
     targets — each with its resolving probe AND its kill condition.
     A probe without a kill condition is theater.

  §1 Wave 0 — ground in 48 hours: seven probes runnable against
     SHIPPED code only (~170 LOC of tests, zero new impl): PHASE-1
     (CurveRuler determinism), WHP-1a/1b (Parseval split — transform
     vs quantized envelope), PHI-1 (phi-stride vs uniform), F2
     (quasicryth paper_theorems run), F13 (parity suite verify), F8
     (helix fidelity — lance-graph's oldest owed probe, #459).

  §2 Wave 1 — first impl bricks, each gated: C (SoaEnvelope keystone,
     F6) · O1 (Class traversal API) · PrefixShapeTable (ROUTE-1) ·
     WHP-3/4 (incl. the permanent two-algebra CI guard) · HILBERT-L4
     fix (the PP-13 P0-4 red that blocks every L4 claim).

  §3 Wave 2 — the conjecture tower gets numbers: 4^4 codebook builder
     (CODEBOOK-44 + BOOT-1 -> J1) · perturbation encoder v0 (PERT-RHO
     with reported escalation rate -> J2) · F3 spectral anti-moire ·
     F10-F12 anchor re-measures.

  §4 Wave 3 — identity-arc phases gated per INTEGRATION-MAP (D/B/O7/
     R1-R3 incl. the NodeGuid group-3/4 audit addendum); §5 Wave 4 —
     consumers; §6 standing rules (every red is a same-day ledger
     event; thresholds measured never optimism); §7 ownership.

CLAUDE.md doc-family updated (the plan is read #3).

Docs-only. PII abort-guard: CLEAN. No model identifier.

https://claude.ai/code/session_01PBTGaPCSnnt6u3pjXpbLwY
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.

1 participant