Repository navigation
feat(cognition): TS bridge for admit-inbox-message + recall-engrams (#1195 PR-1) - #1202
Merged
Merged
Conversation
…1195 PR-1) The Rust IPC handlers `cognition/admit-inbox-message` (#1121 PR-4) and `cognition/recall-engrams` (#1121 PR-5) shipped weeks ago but have NO TS layer. Recipe pipelines invoke commands via `Commands.execute`, so without TS scaffolding the recipe JSONs literally cannot reach the admission gate or the engram recall surface — the substrate is built and unused. This PR adds the missing thin bridge per CLAUDE.md "Rust-Backed Commands (IPC Mixin Pattern)" + Joel's "if not UI/UX it is rust" rule: 1. RustCoreIPC cognition mixin gains two methods: - `cognitionAdmitInboxMessage(personaId, message)` → { decision: AdmissionDecision, engram_count, trace_seam_count } - `cognitionRecallEngrams({ personaId, kind?, limit?, id?, keyword?, origin? })` → { engrams: Engram[], count } Both use the ts-rs generated types verbatim from `shared/generated/persona/`. No parallel reimplementation. 2. Two TS server commands generated via `npx tsx generator/cli.ts command <spec>`. Each `execute()` body is pure pass-through: - validate inbound params (loud-throw on missing required fields) - call mixin method - wrap mixin result into the Result type Zero business logic in TS. The whole "admit / recall" decision tree lives in `workers/continuum-core/src/modules/cognition.rs`. 3. Spec JSONs checked in under `generator/specs/` so future regeneration is one command away. Spec is the source of truth for the scaffolding. Out of scope (PR-2 follows): - Wiring these commands into the 11 chat-class recipe JSONs (10 Shape B + 1 Shape C) per RECIPE-AUDIT-2026-05-14 Gap 1. Sidecar code-smells filed while shipping this: - #1196 SystemOrchestrator stub-only class (every method throws) - #1198 RustBackedCommand<P,R> base class — visually-identical envelope every Rust-backed TS command repeats today Validation: `npm run build:ts` clean + ESLint count matches baseline (5462). Hooks ran without --no-verify. Refs #1195. Refs #1121. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 14, 2026
Closed
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.
Summary
The Rust IPC handlers
cognition/admit-inbox-message(#1121 PR-4) andcognition/recall-engrams(#1121 PR-5) shipped weeks ago but have no TS layer. Recipe pipelines invoke commands viaCommands.execute, so without TS scaffolding the recipe JSONs literally cannot reach the admission gate or the engram recall surface. Substrate built and unused.This PR adds the missing thin bridge per CLAUDE.md "Rust-Backed Commands (IPC Mixin Pattern)" + Joel's "if not UI/UX it is rust" rule.
Changes
cognitionAdmitInboxMessage(personaId, message)returns{ decision, engram_count, trace_seam_count }typed via the ts-rs generatedAdmissionDecisionfromshared/generated/persona/.cognitionRecallEngrams({ personaId, kind?, limit?, id?, keyword?, origin? })returns{ engrams: Engram[], count }typed via the ts-rs generatedEngram.commands/cognition/admit-inbox-message/andcommands/cognition/recall-engrams/, generated vianpx tsx generator/cli.ts command <spec>. Eachexecute()is pure pass-through: validate inbound params (loud-throw on missing required fields) → call mixin → wrap result. Zero business logic in TS.generator/specs/so future regeneration is one command away.Out of scope
Wiring these commands into the 11 chat-class recipe JSONs (10 Shape B + 1 Shape C) is PR-2 — see RECIPE-AUDIT-2026-05-14 Gap 1 for the recipe-side plan. This PR exists to unblock that one.
Sidecar issues filed
Test plan
npm run build:tspasses clean--no-verify./jtag cognition/recall-engramsRefs #1195. Refs #1121.
🤖 Generated with Claude Code