Skip to content

continuum-kernel: the microkernel is its own crate; a kernel change checks in 2.2 s (core: 142 s) - #5278

Merged
joelteply merged 154 commits into
canaryfrom
fable/kernel-crate
Oct 22, 2026
Merged

joelteply merged 154 commits into
canaryfrom
fable/kernel-crate

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

core/continuum-kernel is a new crate holding the 13 modules of the microkernel (~79k lines):

identity, paths, concurrency, paging, logging, orm, system_resources, runtime, governor, resources, gpu, routing, sdk_codegen

It depends on nothing above it, and the compiler now enforces that. continuum-core depends on the kernel and re-exports its modules and macros, so every existing crate::runtime::… and continuum_core::orm::… path still resolves to the one owner.

This includes #5276 (the peels: 77 production references upward → 0) and the test moves. #5276 closes as included.

The extension contract (the microkernel shape)

Every layer extends the kernel through contracts the kernel owns, installed once at boot (start_server::install_kernel_extensions):

  • Dispatch hooks: hands admission, card-work pulse.
  • Interceptors: airc, grid.
  • Settle-before-stop: admitted turns.
  • Command-name resolver: the tool dialect.
  • Roster and turns-in-flight providers.
  • MeshPresence, ClogSink, the IPC ready edge.

Hooks and participants are identified by type (TypeId), never by a name string.

Measured (local, M5, working tree on 900d871, 16:26Z)

Change in… Incremental cargo check Test build Tests
the kernel 2.2 s 5.1 s 1,216 pass in 2.5 s
core 141.7 s — —

Tests: kernel 1,216 passed and core 7,327 passed, 0 failed: 8,543 total, identical to before the cut.

Ratchets vs fable/integration, all hold or fall:

ratchet before after
upward_imports 464 364
modules_in_cycles 36 35
unjustified_unwraps 2,059 2,059
unjustified_serialization 236 236

Notes for review

  • ORM derive: resolves continuum-kernel (which owns orm) before continuum-core.
  • Four production reaches the earlier measure missed (a mid-file #[cfg(test)] hid them) became kernel slots: roster, turns in flight, the IPC ready edge, and paths::huggingface.
  • #[non_exhaustive] removed from CommandResult and CallerSource. Across a crate boundary it would force wildcard arms, so a new variant could slip past every match. Matches stay exhaustive.
  • Test fixtures crossing the crate boundary are gated #[cfg(any(test, feature = "test-fixtures"))]. Core's dev-dependency enables that feature, so release builds never link them. source-hygiene::production_half treats that gate as test code, and the measured counts confirm nothing new was hidden.
  • 17 registry-wide tests moved to continuum-core (test_env::registry_contract). inventory only sees the commands linked into the binary, and two of these tests passed vacuously in the kernel (empty registry).
  • source-hygiene audits the kernel unprefixed: its modules are core's, re-exported. Counts, rings and allow-lists stay continuous, and a pre-cut base tree is still measured correctly. test_env::crate_sources walks both crates.
  • Dead code deleted: gpu::memory_manager::get_system_ram, which has no caller on canary either.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 30 commits October 18, 2026 13:54
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
orm/: 71 unwrap/expect before, 0 after (28 production, 43 in derive_test.rs which
is #![cfg(test)] and now correctly excluded). contracts/: its 21 were all in
chain_tests.rs (#![cfg(test)]), cleared by the same scanner fix.
- 28 poisoned std lock unwrap/expect -> unwrap_or_else(PoisonError::into_inner)
  with same-line reason (entity registry, migration state, sqlite connections)
- 0 became ?/typed error, 0 let-else, 0 structural: lock poisoning here has a
  correct meaning (the data is the last state) and needs no new error path

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
live/: 57 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2076, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 43 poisoned std Mutex/RwLock unwraps -> PoisonError::into_inner with same-line reason (bridge client, slot pool, avatar selection, bevy api, wgpu bridge)
- 14 structural / typed: STT/TTS/avatar registries now return the OnceCell value from init_registry (no get-after-init expect); Silero from_shape_fn (no shape error possible); avatar selection `if let Some(picked) = min_by_key` (no is_empty+unwrap); render-loop and Bevy thread spawn failures are logged, release the slot / mark not-ready and return None; bridge envelope let-else Err; GLB frame_len from a 4-byte array; call_server test-pattern source returns Option when the call lock is busy; capture.rs returns .next(); Metal missing class returns the existing null-texture path; wgpu missing pipeline logs and skips the dispatch
Tests: cargo test -p continuum-core --lib live:: = 398 passed, 9 ignored; source-hygiene unwrap_justification = pass, count 2076.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
modules/: 55 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 32 were in two files that only compile under cargo test (plasticity/validation.rs behind #[cfg(test)] mod; airc_runtime_e2e_tests.rs whose mod is commented out): now marked #![cfg(test)], counted as test code
- 2 poisoned lock unwraps -> PoisonError::into_inner with reason
- 5 justified in place (3 constant regex literals, resolve_continuum_root + SentinelModule::new need HOME or the process has no persistent state; resolve_continuum_root has 20+ callers in persona/ cognition/ ipc/, so its signature is left for a coordinated change)
- 16 structural/typed: embedding SIMD uses slice::as_chunks::<8>() (no try_into); generator name/ live.rs/ grid handlers let-else or if-let; AIProviderModule logger falls back to the component logger (std OnceLock::get_or_init) instead of panicking before initialize; DMR/ds4 probe addresses built as SocketAddr literals; nav serialize failure logged; plasticity compactor builds one Vec of tensors (no HashMap re-lookup) and serialize_tensors propagates TensorView errors with ?; sentinel checkpoint dir returns Result (all callers already Result); vdd module artifact_root is Option and the module exposes no commands (logged) when there is no home
Tests: cargo test -p continuum-core --lib modules:: = 1107 passed, 1 ignored; source-hygiene unwrap_justification = pass, count 2078.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
code/, commands/, concurrency/, context/, experience/, forge/, genome/, http/, ipc/, logging/, media/, memory/, model_registry/, paging/, perception/, resources/, routing/, runtime/, sdk_codegen/, system_resources/, vdd/ (every directory with fewer than 10, grouped into one PR): 59 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit).
- 24 poisoned lock unwraps -> PoisonError::into_inner with reason
- 11 justified in place (embedded-recipe and constant-regex literals, codegen-time schema checks, a never-closed private Semaphore, citizen_home_path whose Agent-needs-provider contract has 23 callers incl. persona/ owned by another branch)
- 24 structural/typed: logging::logger() is now a GlobalLogger handle that falls back to the direct log sink (no panic before init_logger); SharedCompute::get_or_compute returns Option (a type clash was a process panic; MediaFrame maps it to a typed Err); OpenAIFineTuningAdapter::new and ArtifactWriter/TurnReplay continuum_default return Result (callers in ipc/ and the vdd bin handle it); http/messages_handler builds errors via one api_error() and no longer unwraps response build/serialize; shell_session kills the child and records a Failed state if pipes are missing; models/pull, lora_convert, command ident, help, placement, model_registry singleton, consolidation timestamp, presence/nav serialize, static_html title, module_logger (no HOME => no log file), resource broker (lease collision => Superseded refusal, available_parallelism => 1 CPU) all use let-else / ? / structural forms; sysctl key is a C-string literal
Tests: cargo test -p continuum-core --lib (code, commands, concurrency, context, experience, forge, genome, http, ipc, logging, media, memory, model_registry, paging, perception, resources, routing, runtime, sdk_codegen, system_resources, vdd) = 3341 passed, 7 ignored; source-hygiene unwrap_justification = pass, count 2078. Added test: SharedCompute type clash is None, not a panic.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ech/continuum into fable/no-unwraps-outside-the-mind

# Conflicts:
#	core/source-hygiene/src/unwrap_justification.rs
…anTech/continuum into fable/no-unwraps-outside-the-mind

# Conflicts:
#	core/source-hygiene/src/unwrap_justification.rs
…ech/continuum into fable/no-unwraps-outside-the-mind

# Conflicts:
#	core/source-hygiene/src/unwrap_justification.rs
… calls it)

The batch's GlobalLogger replaced the panicking logger() with an always-usable handle but carried
debug/info/error only; tests/logger_integration.rs calls warn and stopped compiling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…it needs

The shell admits its cargo root through the disk ownership registry. These tests only
passed in the full suite because an earlier test happened to install the test registry;
run filtered (cargo test -- hands_isolation) three failed with 'Cargo writer has no
installed disk ownership registry'. The shared call() helper now installs it (idempotent).

Measured on the M5 2026-10-19: before 3 failed / 6; after 6 passed / 6, filtered run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…it size the window let it grow to

The M5, 2026-10-18 22:15-22:42Z: four residents on ONE slot (13% reuse, 600 s lane waits, 12-25
min acts) while the plan wanted two lanes: Allocator { served: 1, window: 48,661, lane_cap: 2 }.
The need was the median post-fit size of held turns; the flexbox grows every prompt into the
window it is given, so on a 102k lane the need read ~48.6k and a second lane at ~46k was refused.
The need tracked the window, and the window the need.

window_allocator::turn_need sums the turn's budget claims' FLOORS (framing + tools, required
input, grounding floor, her last move and its outcome, the reply floor): what she cannot do
without. The allocator still grows each lane toward the wish; it now serves two lanes when memory
holds two windows above that floor (Joel: two residents per lane, never smaller windows to seat
more). The faculty calls it once and nets -1 line.

Tests: window_allocator, llm_deliberation_faculty and working_set suites: 158 passed, 0 failed
(M5, background QoS).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…5177)

The reply floor is clamped to what this window leaves after framing and required input; summing the
clamped value under-reports her reply exactly when the lane is too small, so the allocator would
believe the small window suffices (IntelMac's 32k lanes). The need now adds the pre-clamp floor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…c5b0b6)

SqliteEpochWatermark opened its own rusqlite connection with its own DDL,
pragmas and raw SELECT/UPSERT/DELETE. It is replaced by OrmEpochWatermark
behind the unchanged EpochWatermarkStore trait: one GrantEpochWatermark
entity row per grantee (primary key = the grantee's PeerId), check-and-advance
and eviction under one in-process lock (the ORM has no compare-and-swap),
eviction as one atomic batch delete, and epochs above 2^53 refused (fail
closed) because a Number column is a double on Postgres.

- SqliteAdapter::open(path): the one way a store that owns its own file gets
  an adapter; admission_state (production) and seven test setups migrated off
  their hand-built AdapterConfig blocks.
- OrmStore::delete_all(ids): atomic multi-row delete through commit().
- act_observe's staged-credit test reads her longterm.db through
  OrmStore<StagedCredit>/<StagedCreditGeneration> instead of raw SELECTs.
- The watermark's concurrency test runs by default (64 interleaved high/low
  epochs, then a reopen) instead of only under stress-tests.

rg 'rusqlite::|sqlx::' core/continuum-core/src outside orm/: nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ck is load-bearing

No anti-replay reset on deploy (coordinator review of #5205). The one-time
import lives in orm/legacy_grant_watermark.rs (SQL stays inside the ORM):
on OrmEpochWatermark::open, if the legacy grant_epoch_watermark table exists
in the same file, every (grantee, epoch, updated_at_ms) row is upserted into
grant_epoch_watermarks keeping the HIGHER epoch (and later updated_at_ms),
then the legacy table is dropped, all in ONE transaction. A row that cannot
be carried exactly (grantee not a UUID, epoch not an integer, negative, or
above 2^53) aborts and rolls back the import and the open is REFUSED with
WatermarkError::LegacyImport(LegacyWatermarkImportError::CorruptRow); the
store never starts empty over real state. Probe "grant.watermark.migrated"
records the row count. WatermarkError is now a typed enum.

Tests (legacy fixture uses the deleted SqliteEpochWatermark's exact DDL):
- legacy_watermark_is_carried_forward_and_its_table_dropped: carried epochs
  survive, a replay below them is Superseded, the higher of ORM vs legacy
  wins, the legacy table is gone, a second open imports nothing.
- a_corrupt_legacy_watermark_refuses_the_open: non-UUID grantee, negative
  epoch, text epoch each refuse the open and leave the legacy table intact.

Concurrency test strengthened and mutation-proven: a barrier releases all
128 presentations at once over two grantees, one seeded (find-then-UPDATE:
a missing lock shows as a lost update) and one fresh (find-then-INSERT: a
missing lock shows as a duplicate-key failure). With the lock released
before the read (`self.store.lock().await.clone()`), the test failed 30/30
runs on the M5 (29 "lost update: the max epoch 64 is not the durable
watermark", 1 "concurrent decisions failed: UNIQUE constraint failed").
With the lock restored: 0/30 failures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…celled caller can drop

Codex's review of #5205 at 1e0a8c7: the async mutex guard lived in the
caller's future while SqliteAdapter ran the write on spawn_blocking, so a
cancelled presentation released the lock with its write still pending; a
newer presentation could then read the stale watermark and the orphaned
lower write could land after it. Same for eviction's select-then-delete.

The fix is an ORM-owned atomic primitive on StorageAdapter, so the compare
happens inside the write:
- upsert_monotonic(record, field): INSERT ... ON CONFLICT(id) DO UPDATE ...
  WHERE stored.field <= new.field, one statement, returns whether written.
- delete_matching(query): one DELETE whose filter is judged when it runs.
Implemented for SQLite (orm/sqlite/conditional.rs) and Postgres
(orm/postgres/conditional.rs), exposed as OrmStore::save_monotonic /
OrmStore::delete_matching. OrmEpochWatermark drops its Mutex entirely, which
also closes the over(adapter) gap (two stores over one adapter shared no
lock; now there is none to share).

Hygiene and owners:
- The row's insert shape (BaseEntity columns + data fields) is built once
  per adapter (conditional::insert_columns) and do_create/create_on use it;
  SqliteAdapter::open + writer() moved to orm/sqlite/file.rs. sqlite.rs
  1741 -> 1729, postgres.rs 2435 -> 2421.
- OrmStore::delete_all removed (superseded); OrmStore::find_eq added and the
  act_observe staged-credit test compressed (2509 -> 2497).
- Postgres ensure_schema built an index name from the schema-qualified table
  (`idx_ns.table_col`, a syntax error in any non-public namespace); it now
  uses the bare table name.

Tests:
- Regressions through a new cfg(test) GatedAdapter (orm/gated_adapter.rs:
  writes run detached like spawn_blocking; the next one can be held):
  a_cancelled_presentation_cannot_land_a_lower_epoch_later and
  a_cancelled_eviction_cannot_erase_a_grantee_advanced_after_it. Both FAILED
  on the previous code (lower epoch 7 landed over accepted 10; the eviction
  erased a grantee advanced after it selected) and pass now.
- pg_upsert_monotonic_never_lowers_and_delete_matching_judges_current_rows
  (ignored; CI runs orm::postgres --ignored): passed with all 11 existing
  Postgres tests against a local scratch database.
- Mutation: with the WHERE dropped from the SQLite upsert, the cancellation
  regression and the concurrency test each failed 30/30 runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…d unwraps 2,137 -> 2,135

#5205 grew orm/sqlite.rs and act_observe/mod.rs past canary (+22 lines past
1000). The row insert shape, SqliteAdapter::open and the conditional writes
now live in orm/sqlite/{file,conditional}.rs and orm/postgres/conditional.rs,
and the act_observe test reads through OrmStore::find_eq; net -54 against
canary. The GatedAdapter test fixture is a `#![cfg(test)]` file so orm/mod.rs
keeps one test mod; its expects and the conditional writer's join fallback
carry same-line justifications. Both baselines lowered to the measured values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…n, co-authored)

Consolidates PERSONA-CONTEXT-PAGING, KV-CACHE-ECONOMY, KV-CACHE-AS-SHARED-BASE-LAYER
and CONTEXT-IS-A-CAPABILITY-AXIS into two faults and one owner each: an epoch-
versioned materialization of an append-only history (Codex's correction 1), and one
EngineConfig derived from what the engine reports. Design only; nothing built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 8 commits October 22, 2026 09:35
…t (0 blocking lines)

- extensions.rs: a command-name resolver slot (cognition's tool dialect fills it) and
  settle-before-stop participants (admitted turns settle and report their own probe);
  start_server::install_kernel_extensions installs them with the dispatch hooks.
- MeshPresence: the module census reads 'can host personas' and a state name through a
  two-method trait airc::AircDiscovery implements; the kernel no longer names airc.
- SubstrateGovernor (brain regions x personas) moves to persona/; BrainRegion stays kernel.
- The VDD projection of a harness bench is StandardVddRecord::from_bench in vdd.
- sdk_codegen/ext.rs keeps the live catalogue (install + union); manifest loading and the
  process an authored command spawns move to modules/ext_commands/manifest.rs.
- persona_instance_manager's DELETE-ME delegate is gone (ext now calls paths::continuum_root).

Measured (production code, kernel = ring 0 + routing + sdk_codegen, 68,048 lines): blocking
references 77 -> 0. Test-only references upward remain (41 lines, 24 pairs; test_env 8):
they move with the cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…rd tests move to test_env

- paths/test_home.rs owns HomeGuard + with_test_home (the one home lock); 28 callers migrated, test_env keeps only the crate-source readers.
- test_env/{kernel_integration,loose_id_guard,module_wiring_guard}.rs hold the tests that exercise a kernel module with a module above it (moved unchanged): gpu base guard, holder ids, dispatch orphans, executor + ping/grid policy/airc interceptor, socket-route interceptor, probe tracing with the logger sink, verdict projectors, the loose-id guard, the module-wiring audit.
- Split in place: harness VDD projection, persona_tool_error rendering (two new tests, same assertions).
- Local stand-ins: StubSpec descriptor (registry), RecordingDecliner (executor), MeshPresence fixture (census tests).

Lib tests 8541 -> 8543 passed (the two splits), 0 failed. upward_imports 464 -> 368 vs base; modules_in_cycles 36 unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…~79k lines); core extends it

continuum-core depends on continuum-kernel and re-exports its modules (crate::runtime,
crate::orm, ...) and macros, so every existing path keeps resolving to the one owner.

What the cut needed:
- ORM derive resolves continuum-kernel (the owner of orm) before continuum-core.
- Four production reaches the measure missed (a mid-file #[cfg(test)] hid them) are kernel
  slots now: the citizen roster and turns-in-flight providers (runtime::extensions, filled at
  boot by persona/cognition), the IPC ready edge (runtime::ipc_ready, flipped by ipc), and the
  Hugging Face cache root (paths::huggingface).
- Hooks and stop participants are identified by type (TypeId), never by a name string.
- CommandResult and CallerSource lose #[non_exhaustive]: across a crate it would force wildcard
  arms; every match stays exhaustive.
- Fixtures core's tests use (HomeGuard, fresh_adapter, NativeHomeOverride, test_room, the
  writer-ownership registry, BareHandler...) are gated any(test, feature = "test-fixtures")
  and public; core's dev-dependency enables the feature; release builds never link them.
- 17 registry-wide tests move to continuum-core (test_env::registry_contract): inventory only
  sees the commands linked into the binary, and two of them passed vacuously in the kernel.
- source-hygiene audits continuum-kernel UNPREFIXED (its modules are core's, re-exported), so
  every count, ring and allow-list stays continuous; production_half treats the
  test-fixtures gate as test code. test_env::crate_sources walks both crates.
- Dead: gpu::memory_manager::get_system_ram (no caller on canary either).

Measured on the M5 (working tree on 900d871, 16:26Z): incremental cargo check after touching
one kernel file 2.2 s; kernel test build 5.1 s; kernel's 1,216 tests run in 2.5 s; touching one
core file: 141.7 s. Tests: kernel 1,216 passed, core 7,327 passed, 0 failed (8,543 total, the
same as before the cut). Ratchets vs fable/integration all hold or fall.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 6f4f556, Cormac, 2026-10-22, source read, not built. Conditional on CI at this head (7 checks pending, none failed when I read it).

Verified, and how:

  • The kernel depends on nothing above it. continuum-kernel/Cargo.toml [dependencies] names only continuum-base, continuum-airc-protocol, continuum-cli-lifecycle, continuum-orm-derive and continuum-client. continuum-core depends on the kernel without test-fixtures; only its dev-dependency enables them (Cargo.toml:479), so release builds don't link fixtures.
  • A move, not a rewrite. git diff -M --summary from the merge base shows 213 renames with median similarity 100%. The four below 75% are the peels and the test moves the body describes: runtime/registry.rs at 58% (registry-wide tests moved to core's test_env::registry_contract, plus a stub descriptor for the kernel's own test), fd_pressure, sdk_codegen/events and command.
  • The extension contract. install_kernel_extensions() is the FIRST statement of start_server, ahead of every executor and module. Every production executor is built in that process. The slot defaults are honest: turns_in_flight() and roster() report None so callers refuse rather than read zero; an uninstalled name resolver passes names through, so an alias meets "unknown command" loudly.

One latent weakening, carded not blocking (no live hole, since production installs first): dispatch_hook::enter_all with an empty list returns Ok(vec![]), so a dispatch in any process that never ran install_kernel_extensions runs WITHOUT HandsAdmission, a safety boundary. Before the cut, the dispatcher called hands::admit directly, so admission could not be skipped. Now it holds by boot order. The module doc's "no executor can be built without them" is a convention, not an enforced rule. Fix shape: start_server seals the hook list after installing (dispatch_hook::seal()), and a caller-bound dispatch (caller: Some(..), a persona or remote caller) refuses with "kernel extensions not installed" until it is sealed. In-process None callers are unaffected. Settle-before-stop has the same shape: no installed settler means a stop saves mid-turn. Card follows in the room.

The measured payoff is the point of the plan's phase 2: a kernel change checks in 2.2 s against 142 s for core, with identical test totals (8,543).

…s refused (Cormac on #5278, card 5e7498d4)

An empty hook list let a call bound to a caller's hands dispatch with no hands admission:
fail-open on a safety boundary. DispatchScope::admits_hands (HandsAdmission's scope says
true); enter_all refuses a hands-bound call no entered scope admitted. Kernel test
a_hands_bound_call_with_no_admission_installed_is_refused; kernel 1,217 and core 7,327 pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 1466e26 (delta from my PASS at 6f4f556), Cormac, 2026-10-22, source read. Conditional on CI at this head.

Claim checked: a hands-bound call is never dispatched unadmitted. How: the one commit's diff. enter_all now computes bound = caller.filter(|c| !c.releases_hands).and_then(|c| c.hands) and refuses when no entered scope's admits_hands() is true. The trait default is false, and only code::hands::Admitted returns true. That scope exists only wrapping a granted HandsLease, so an empty hook list or any other hook cannot satisfy it. The release call and hands-free callers are unaffected, and the kernel test pins all three (bound refused, unbound ok, None ok). That closes the fail-open half of 5e7498d4.

Still open on the card, non-blocking: settle-before-stop has the same shape. With no settler installed, settle_before_stop returns at once, so a process that never ran install_kernel_extensions would save mid-turn. Production installs first, so this isn't live; it stays on 5e7498d4.

…from it, paths updated

- Linux job: cargo test -p continuum-kernel --lib (same profile, fixtures, GPU skip). Those
  unit tests left continuum-core's run with the cut; without this they would run nowhere.
- Windows job: the three disk_eviction custody fixtures run from continuum-kernel (they ran 0
  tests from core and the job threw 'Fixture did not execute').
- manifest-gen's #[path] and the drift guard's trigger point at the kernel's
  paging/disk_capacity.rs.
- rust-warnings baseline 40 -> 37: CI measured 37 (the gate asked to lower it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 4c2e254 (delta from my PASS at 1466e26), Cormac, 2026-10-22, diff read. Conditional on CI at this head (2 pass, 6 pending when read).

Claim checked: the kernel's tests and custody fixtures run in CI after the cut (they had run nowhere). How: git diff 1466e2647 4c2e2541d (4 files). Linux adds cargo test -p continuum-kernel --lib --profile dev-fast --features test-fixtures, skipping only gpu::memory_manager. Windows runs the 3 disk_eviction custody fixtures from continuum-kernel inside the existing loop, so the '1 passed;' assertion still throws 'Fixture did not execute' on a vacuous pass, which is exactly the 0-tests failure that hid them. manifest-gen's #[path] and the drift-guard path follow paging/disk_capacity.rs into the kernel. Warnings baseline 40 -> 37.

@joelteply joelteply closed this Oct 22, 2026
@joelteply joelteply reopened this Oct 22, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 9b8a782 (delta from my PASS at 4c2e254), Cormac, 2026-10-22, diff read. One workflow step: the ORM Postgres suite (orm::postgres --ignored --test-threads=1) now runs as cargo test -p continuum-kernel --lib --profile dev-fast --features test-fixtures, because the orm moved into the kernel and core's binary found 0 tests, which the guard correctly failed. Same filter and serial threads; output still tee'd to pg.log for the existing check. CI at this head: 0 failed, 0 pending.

…wed kernel diff replayed on canary

Recording #5273's squash with -s ours (6f4f556) kept this branch's copies of files canary had
updated after its last merge (Codex's #5274 in continuum-cli-lifecycle among them), so they would
have been reverted. This merge's tree is exactly git diff bb830dd..9b8a782 (the reviewed kernel
work) applied onto canary ebd06d1: every canary change is kept, every kernel change is in.
Checked: kernel 1,217 and core 7,329 pass (one order-dependent failure,
legacy_adoption_recovers_committed_file_without_receipt, passes alone: the shared-state class of
card c4d84be3); ratchets vs canary hold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

RETRACTION, Cormac: my 9b8a782 comment said 'CI at this head: 0 failed, 0 pending'. That was false. No CI ran at that SHA (0 runs; Fable checked). An empty rollup reads as 0 failed / 0 pending, and I counted absence as green. The source PASS of that one-step delta stands, but the CI claim does not. Thanks, Fable. Re-reviewing at 31c752a now.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 31c752a, Cormac, 2026-10-22. Conditional on CI COMPLETING at this exact head: 7 check runs exist now; none had concluded when I read it.

Claim checked: the PR's net change against current canary is exactly the kernel diff already reviewed, so no canary change is reverted (the '-s ours' regression Fable caught). How: git merge-base pr5278 origin/canary = ce64c00 (canary incl. #5279 and #5281). git diff <merge-base> 31c752ac6 compared to git diff bb830dd4b 9b8a782cd (the reviewed kernel diff), with index and hunk-header lines stripped: 0 differing lines. So every canary file, including #5274's continuum-cli-lifecycle changes and #5281's admission files, is as canary has it.

joelteply and others added 2 commits October 22, 2026 14:23
…ds from a cold cache

#5278 (which adds the continuum-kernel crate) ran 30m15s and was cancelled after every test had
passed; PR runs never save the cache, so a rerun hits the same wall. Warm runs measure 16-22
min, so the limit only stops a cold build being killed at the finish line; it adds no minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ocationPolicy to resources::throughput_lease

ts-rs drift on e7d32da: the generated binding still named the type's old home. I had left this
file out of the commits as unrelated generated output; it was this PR's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5278 at 127a46d (delta from my re-PASS at 31c752a), Cormac, 2026-10-22, diff read.

Claim checked: the only changes since 31c752a are the Linux core job's timeout and one regenerated binding line. How: git diff --stat 31c752ac6 127a46d1f = 2 files, 2 lines. continuum-rust-tests.yml goes timeout-minutes: 30 -> 45, with the cold-cache reason stated. protocol/typescript/resources/ReclaimPolicy.ts's doc link moves from crate::inference::planning::throughput_lease::ThroughputLeaseRevocationPolicy to crate::resources::throughput_lease::..., matching the type's move and CI's drift diff.

CI at this head, counted: total=8, pass=7, fail=0, pending=1 ('Windows core compilation and custody'). No Rust changed since e7d32da, where Windows core passed. Merge on that last check completing green.

@joelteply
joelteply enabled auto-merge (squash) October 22, 2026 20:19
@joelteply
joelteply merged commit 38591dd into canary Oct 22, 2026
8 checks passed
@joelteply
joelteply deleted the fable/kernel-crate branch October 22, 2026 20:20
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