Skip to content

Worlds engine + pluggable chat providers (N6 graduates 6/6) + roadmap wins - #4

Open
rabbiveesh wants to merge 6 commits into
masterfrom
claude/ambitious-research-project-7lcyur
Open

Worlds engine + pluggable chat providers (N6 graduates 6/6) + roadmap wins#4
rabbiveesh wants to merge 6 commits into
masterfrom
claude/ambitious-research-project-7lcyur

Conversation

@rabbiveesh

Copy link
Copy Markdown
Owner

What this is

The "most ambitious thing the research bore" pass: ships the worlds thesis end-to-end, makes every LLM call provider-pluggable (Claude Code as a backend), and knocks out three smaller ROADMAP items. Six commits, each self-contained.

1. Worlds engine — parallel realities, reliving, world-relative ask (c3d7e11)

V3 proved ATMS world-labels are load-bearing but the surface didn't exist. Now:

  • core: World + defeated_with(suppress) / defeated_in(world) (suppress-then-refixpoint), as_of(txn_time) bitemporal replay, frontier_flips diff. defeated() delegates with an empty suppress set — the main frontier is byte-identical (keystone eval unchanged: same 12 flips).
  • cli: mem world [list|show|diff] (worlds.json in/beside the store — the corpus format verbatim, resolving the N6 design fork), mem relive <as-of-time> (replay diffed vs now), mem ask --world <w> (both V3 halves: world frontier recompute + assumption threaded into the reducer prompt).
  • eval-worlds (in CI): deterministic re-proof of the V3 reachability table over every worlds.json corpus — helix + composr, 15 checks, 0 failures.

2. Pluggable chat providers; N6 graduates (1a4dca5)

Every LLM call already funnels through memory_embed::chat_json, so the provider seam is the model ref itself: claude:sonnet / claude-code[:m] → the Claude Code CLI (-p, tools off, neutral cwd, tolerant JSON extraction); ollama:<m> or any bare ref → ollama, unchanged. JUDGE_MODEL=claude:sonnet flips the judge with zero code changes. Embeddings stay ollama-only.

Recorded result: ASK_MODEL=claude:sonnet eval-worlds --llm6/6 fixture×world cells select their own world's gold answer (blind letter-labeled judge grading; caveats recorded in next-experiments.md N6). The reduction_fixtures graduate TARGET → DEMONSTRATED.

3. Roadmap wins (4cd28b4, 90fdddc, 048ffd4)

  • Real content ids: b_ + sha256(observation)[:12], hand-rolled zero-dep FIPS 180-4 pinned by NIST vectors. Old SipHash ids coexist (append-only, opaque ids).
  • Bitemporal valid_time: parses into Belief.valid_from/valid_until; valid_at(date) is the second axis. mem relive separates "believed then" from "true of the world then" (e.g. helix r3-backspace-original: believed in 2026, valid 2020→2024).
  • Binary vector sidecar: .embeddings.bin fast path; JSON stays the durable committable authority and transparently rebuilds the sidecar when newer. Write-then-rename + corruption fallback.

Note: a lazy-background-worker implementation was built here and then removed (06679f5 keeps only its doc bookkeeping) — that feature already has its own open PR.

Verification

  • cargo test --workspace: 60 tests green (13 new: suppression/reinstatement/reified-edge suppression, as-of replay, flips, valid_time, SHA-256 vectors, sidecar round-trip/freshness/corruption, provider routing, JSON extraction).
  • Both keystones byte-stable: eval (same 12 naive-vs-frontier flips), eval-worlds deterministic 15/15 — now a CI step.
  • Rust worlds resolver cross-checked against corpus/_worlds.py: flips match exactly; the one live-count difference is core's deliberate monotonic supersession chains (noted in CLAUDE.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM


Generated by Claude Code

claude added 6 commits August 2, 2026 23:13
…elative ask (N6)

The most ambitious fruit of the V1-V7 verdicts, built end-to-end. V3 proved
ATMS world-labels are load-bearing (suppress-then-refixpoint reinstates the
dissent belief 3/3 where bi-temporal alone gets 0/3, and the world's
assumption is what lets the reducer SELECT it). This ships that machinery as
a first-class surface instead of a corpus-only experiment:

memory-core:
- `World` value type + `defeated_with(suppress)` / `defeated_in(world)` —
  world-relative frontier resolution: defeating edges whose source (inline
  carrier, reified subject, or the edge-belief itself) is suppressed do not
  bite; everything stays loaded and relivable. `defeated()` delegates with
  an empty set, so the main frontier is byte-identical (keystone eval
  unchanged: same 12 naive-vs-frontier flips).
- `as_of(txn_time)` — bitemporal reliving: the graph as it stood then;
  later defeats genuinely un-happen in the replay.
- `frontier_flips` — the world-diff / relive-diff primitive.
- 5 new unit tests (suppression revives, verdict-reinstatement interaction,
  reified-relation suppression via subject or carrier, as-of replay, flips).

memory-cli:
- `mem world [list|show <w>|diff <a> <b>]` — named worlds from worlds.json
  in/beside the store; the corpus format verbatim, so a corpus dir IS a
  store (this resolves the N6 design fork).
- `mem relive <as-of-time> [--all]` — replay + diff vs now: believed-then/
  since-defeated, defeated-then/since-reinstated (the ROADMAP "worlds and
  reliving" surface).
- `mem ask --world <w>` — world-relative reduction doing BOTH V3 halves:
  world-frontier recompute (reachable) + assumption threaded into the
  reducer prompt (selectable).
- `eval-worlds` bin — the worlds keystone. Deterministic pass (in CI now)
  re-proves the V3 reachability table over every worlds.json corpus:
  helix + composr, 15 checks, 0 failures. `--llm` pass is N6's graduation
  gate: fixture x world reduction graded by embedding proximity to each
  world's gold answer (needs ollama; not yet recorded, so the
  reduction_fixtures stay TARGET until that run).

Docs: CLAUDE.md commands/worlds notes, N6 unblocked in next-experiments.md,
ROADMAP worlds-and-reliving marked shipped-surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
…d; N6 GRADUATES 6/6

Every LLM call in the tree already funnels through memory_embed::chat_json,
and every caller reads its model from env — so the provider seam is the model
ref itself. parse_model_ref dispatches:

  claude:sonnet / claude:haiku / claude-code[:m] / bare "claude"
      -> the Claude Code CLI (claude -p): --tools "" + --max-turns 1 (a pure
         model call), --system-prompt REPLACES the default agent prompt, child
         runs from a neutral temp cwd so the surrounding repo's CLAUDE.md
         cannot leak into a judgment, prompt via stdin, JSON envelope parsed
         with tolerant extraction (fenced/prose-wrapped JSON normalized —
         Claude has no format:json forcing). CLAUDE_BIN / CLAUDE_CHAT_ARGS env.
  ollama:<m>, or any bare ref (qwen2.5:7b — ollama tags contain ':')
      -> the historical curl-to-ollama path, unchanged.

Zero call-site churn: JUDGE_MODEL=claude:sonnet flips the consolidation
judge, ASK_MODEL=claude:opus flips mem ask, TIER2_MODEL likewise — remember,
consolidate, dream, review, onboard, eval-qa, eval-worlds all inherit the
seam. Embeddings stay ollama-only (Claude Code has no embedding endpoint).
Unit tests cover ref routing (incl. the ':'-in-ollama-tags trap) and JSON
extraction.

eval-worlds grows a grading fallback through the same seam: when embeddings
are unavailable, a BLIND letter-labeled LLM judge (GRADE_MODEL, default =
reducer ref) matches each answer to the gold references without ever seeing
world names.

And the payoff, recorded in docs + fixture status lines: the N6 graduation
gate RAN and PASSED — ASK_MODEL=claude:sonnet eval-worlds --llm = 6/6
fixture x world cells select their own world's gold answer (composr 2x2 +
helix 1x2; deterministic substrate 15/15 alongside; verbatim answers match
gold by inspection). Caveats recorded honestly in next-experiments.md N6:
not the pinned qwen reducer (no temperature control in the CLI), and
judge-graded rather than embedding-graded this run. reduction_fixtures:
TARGET -> DEMONSTRATED.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
…ion)[:12]

Replaces the SipHash placeholder per ROADMAP. Same b_ + 12-hex shape, so old
and new ids coexist in an append-only store; seeds are unchanged, so edge/
promote idempotency keys stay deterministic. hash.rs is FIPS 180-4 pinned by
NIST vectors incl. the padding-boundary cases (55/56/64 bytes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
…+ surfaced in relive

ROADMAP 'Bitemporality': valid_time {start,end} now parses into
Belief.valid_from/valid_until (corpus already ships windows core ignored).
Belief::valid_at(date) answers 'was it true OF THE WORLD then' — distinct
from as_of's 'did we BELIEVE it then'. mem relive now separates the axes:
a believed-then belief whose window excludes t is flagged as describing a
different era, not as wrong (e.g. helix r3-backspace-original: believed in
2026, valid 2020-12-13..2024-03-09).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
…che loads

ROADMAP scale-path step 1: the measured cold-start bottleneck is the
embeddings-JSON parse, not embed compute. Loads now prefer a length-prefixed
little-endian sidecar (magic MEMVEC1) when it is at least as new as the
JSON; the JSON stays the durable, committable authority — hand-edit it and
the sidecar transparently rebuilds on next load. Writes go to both;
write-then-rename keeps a killed process from leaving a truncated sidecar;
any malformation falls back to JSON (corruption can only slow one load,
never poison vectors). Round-trip, freshness, and corruption tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
…ar as shipped

(Recommit of the doc bookkeeping from the dropped lazy-worker commit — that
feature already has its own open PR, so it was removed from this branch.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLWVCpiyAAaYrBaasBewZM
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