Skip to content

docs: define CBAR-like Rust substrate - #1081

Merged
joelteply merged 1 commit into
canaryfrom
codex/cbar-substrate-alpha-plan
May 12, 2026
Merged

joelteply merged 1 commit into
canaryfrom
codex/cbar-substrate-alpha-plan

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • Rewrites the CBAR substrate reference around the actual C++ precedent at /Users/joelteply/Development/cambrian/cb-mobile-sdk/cpp/cbar.
  • Defines the Rust runtime substrate contract: RuntimeFrame/CognitionTurnFrame, RuntimeModule, ResourceLane, ArtifactHandle/leases, dependency wakeups, cadence/pressure gates, and no bespoke queues/fallbacks.
  • Adds the same substrate contract to the alpha gap plan so future PRs are judged by inherited performance/comms/backpressure behavior and small module size, not monolith growth.

Validation class

  • Contract TDD: n/a - docs-only architecture contract.
  • Failure TDD: n/a - docs-only architecture contract.
  • Performance/Resource/Residency VDD: n/a - defines future VDD gates, no runtime code changed.
  • Browser/UX evidence: precommit browser ping passed.
  • Platform coverage: local Mac docs/precommit hooks.

Validation

  • npx markdownlint-cli2 docs/architecture/CBAR-SUBSTRATE-ARCHITECTURE.md docs/planning/ALPHA-GAP-ANALYSIS.md
  • git diff --check -- docs/architecture/CBAR-SUBSTRATE-ARCHITECTURE.md docs/planning/ALPHA-GAP-ANALYSIS.md
  • precommit hook: TypeScript compilation passed; browser-ping precommit test passed
  • pre-push hook: TypeScript clean; ESLint baseline-tolerant passed; Rust/Docker skipped because docs-only

Known gaps

  • Generated ts-rs/schema files were already dirty locally and are intentionally not part of this PR.
  • AIRC review requested from peer agents; record ACK/BLOCKER comments as they come in.

@joelteply
joelteply force-pushed the codex/cbar-substrate-alpha-plan branch from 76b4737 to 21db130 Compare May 11, 2026 19:35
@joelteply

Copy link
Copy Markdown
Contributor Author

Follow-up review changes pushed in 21db130:

  • Reconciled the doc with shipped Rust primitives: ResourceClass + TargetSilicon, ThroughputLease, PressureBroker, ServiceModule/ModuleRegistry/MessageBus/SharedCompute, ChannelQueue.
  • Marked artifact subscriptions/dependency wakeups as a deliberate Continuum upgrade beyond CBAR routing flags, not a literal CBAR port.
  • Added Qwen GPU residency as an alpha contract: Mac -> Metal, NVIDIA -> CUDA, AMD/Intel -> Vulkan; unsupported layers/CPU graph splits must fail loud or be explicitly degraded before the turn runs.
  • Added Qwen VDD evidence requirements: selected model, backend, GPU layer count, unsupported layers, residency estimate, local GPU backend evidence, tok/s/timing.

Requested platform split over AIRC: Mac owns Metal/Qwen timing; Windows/RTX owns CUDA/Vulkan timing; Rust substrate lane reviews RuntimeFrame/CognitionTurnFrame + artifact subscriptions on top of shipped substrate primitives.

@github-actions github-actions Bot added size: XL and removed size: L labels May 11, 2026
@joelteply
joelteply force-pushed the codex/cbar-substrate-alpha-plan branch from 21db130 to aef380e Compare May 11, 2026 19:39
@joelteply
joelteply merged commit e25019c into canary May 12, 2026
2 checks passed
@joelteply
joelteply deleted the codex/cbar-substrate-alpha-plan branch May 12, 2026 01:13
joelteply added a commit that referenced this pull request May 29, 2026
…re, no node for core, persona migration as L0

Reframes the 37-item roadmap against the architectural ground rules
laid down 2026-05-29:

1. Rust core; Node.js is web only (browser UI, config-load at boot,
   human UX). Anything routing / persisting / dispatching / reasoning
   lives in Rust.
2. AI persona under Rust domain — PersonaUser was CPU-killing.
3. GPU or fail for inference + training.
4. No `dyn Any` / `as_any` patterns — debt when a trait requires them.
5. ts-rs is the bindings source of truth — Rust types canonical,
   TypeScript generated, never hand-written.
6. Inference through llama.cpp; never ollama; candle for training only.

Concrete changes:
- New top section 'Architectural ground rules' encoding the six rules
- New **Layer 0: Persona → Rust migration** (5 items, L0-1 through
  L0-5) covering PersonaServiceModule, cognition dispatch in Rust,
  PersonaGenomeManager migration, PersonaInbox routing in Rust,
  PersonaAutonomousLoop deletion. L0 is parallel to L1, independent.
  Overall item count: 37 → 42.
- Dependency-graph block updated with L0 row + clarified L1 rust-core
  framing on each item.
- L1 items L1-1 through L1-6 had owner-suggestions reframed: every
  'tab-2 (TS-only)' and 'TS daemon scaffolding' suggestion now
  explicitly Rust-primary with thin TS shims for browser concerns.
  Original 'codex + tab-2' splits where TS was an equal partner
  rebalanced to Rust-kernel-primary + ts-rs projection.
- L1-2 (AircEventTransport) updated to explicitly reference airc
  PR #1075 (ConsumerAdapter trait) + #1081 (dispatch wire) as
  upstream dependencies — these went from theoretical to landed/
  in-flight on 2026-05-29.

Per Joel: 'we can update or just merge it in' — this is the update
path. The substance of the roadmap (5 layers, 37 → 42 items, full
dependency graph, exit criteria) is preserved; the framing reflects
the architectural direction now articulated.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request May 29, 2026
…st (#1442)

* docs(grid): GRID-MIGRATION-ROADMAP — 37-item phased migration checklist

Sibling doc to GRID-BUS-ARCHITECTURE.md (#1439) + MULTI-PEER-COMMANDS.md.
Breaks the migration into 5 layers, 37 PR-sized items, with explicit
dependency chains, owner suggestions, effort estimates, and done-criteria.

Layers:
  L1 Foundation (substrate) — 6 items — hard prereq for L2-L5
  L2 Chat migration — 5 items — finishes chat-out-of-ORM work
  L3 Alloy refactor — 3 items (per FORGE-ALLOY-DOMAIN-EXTENSIBILITY.md WI 0-5)
  L4 Per-command opt-in — 18 items across Phases A-G
  L5 Patch deletion — 5 items, interleaved with L2-L4 as upstreams complete

Per Joel's instruction: PR descriptions reference this roadmap by item
ID (L#-N format); mergers check off [x] + append merge metadata
(yyyy-mm-dd PR#). Status table at the top auto-summarizes by counting
checkboxes.

L1 kanban cards seeded (CambrianTech/continuum, P0):
  L1-1 (EventClass registry)
  L1-2 (AircEventTransport adapter)
  L1-3 (CommandBase.naturalScope + CommandParams.scope)
  L1-4 (presence:peer-manifest + capability index)
  L1-5 (grid-router-daemon + bid loop)
  L1-6 (contract event chain + ed25519 signatures)

L2-L5 cards NOT pre-populated — created as upstream items unblock, so
the cards reflect the reality the design encountered rather than the
pre-implementation guess.

Owner suggestions on each L1 card; peers self-claim per #cambriantech
work-division pattern. Default sequencing: L1-1+L1-3 in parallel,
then L1-2+L1-4 stacked, then L1-5+L1-6 stacked, with L1 exit criteria
gating L2-L4 start.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(grid): align roadmap with Joel's 2026-05-29 directives — rust core, no node for core, persona migration as L0

Reframes the 37-item roadmap against the architectural ground rules
laid down 2026-05-29:

1. Rust core; Node.js is web only (browser UI, config-load at boot,
   human UX). Anything routing / persisting / dispatching / reasoning
   lives in Rust.
2. AI persona under Rust domain — PersonaUser was CPU-killing.
3. GPU or fail for inference + training.
4. No `dyn Any` / `as_any` patterns — debt when a trait requires them.
5. ts-rs is the bindings source of truth — Rust types canonical,
   TypeScript generated, never hand-written.
6. Inference through llama.cpp; never ollama; candle for training only.

Concrete changes:
- New top section 'Architectural ground rules' encoding the six rules
- New **Layer 0: Persona → Rust migration** (5 items, L0-1 through
  L0-5) covering PersonaServiceModule, cognition dispatch in Rust,
  PersonaGenomeManager migration, PersonaInbox routing in Rust,
  PersonaAutonomousLoop deletion. L0 is parallel to L1, independent.
  Overall item count: 37 → 42.
- Dependency-graph block updated with L0 row + clarified L1 rust-core
  framing on each item.
- L1 items L1-1 through L1-6 had owner-suggestions reframed: every
  'tab-2 (TS-only)' and 'TS daemon scaffolding' suggestion now
  explicitly Rust-primary with thin TS shims for browser concerns.
  Original 'codex + tab-2' splits where TS was an equal partner
  rebalanced to Rust-kernel-primary + ts-rs projection.
- L1-2 (AircEventTransport) updated to explicitly reference airc
  PR #1075 (ConsumerAdapter trait) + #1081 (dispatch wire) as
  upstream dependencies — these went from theoretical to landed/
  in-flight on 2026-05-29.

Per Joel: 'we can update or just merge it in' — this is the update
path. The substance of the roadmap (5 layers, 37 → 42 items, full
dependency graph, exit criteria) is preserved; the framing reflects
the architectural direction now articulated.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Test <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant