Merged
Conversation
Rust (Pipeline Engine)
┌────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────┐
│ File │ Action │
├────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────┤
│ workers/.../sentinel/types.rs │ Added CodingAgent variant with 12 fields to PipelineStep enum │
├────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────┤
│ workers/.../sentinel/steps/coding_agent.rs │ New — delegates to TS via execute_ts_json("sentinel/coding-agent") │
├────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────┤
│ workers/.../sentinel/steps/mod.rs │ Added module + dispatch arm │
├────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────┤
│ shared/generated/sentinel/PipelineStep.ts │ Auto-regenerated by ts-rs │
└────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────┘
TypeScript (Provider Architecture)
┌──────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────┐
│ File │ Action │
├──────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ system/sentinel/coding-agents/CodingAgentProvider.ts │ Interface: CodingAgentProvider, CodingAgentConfig, CodingAgentResult │
├──────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ system/sentinel/coding-agents/ClaudeCodeProvider.ts │ SDK wrapper — spawns child process, streams messages, captures interactions │
├──────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ system/sentinel/coding-agents/CodingAgentRegistry.ts │ Dynamic registry — no switch, no enum, providers self-register │
├──────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ system/sentinel/coding-agents/index.ts │ Barrel + auto-registration of built-in providers │
└──────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────┘
Command (sentinel/coding-agent)
┌─────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────┐
│ File │ Action │
├─────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────┤
│ commands/sentinel/coding-agent/shared/SentinelCodingAgentTypes.ts │ Params, Result, static executor │
├─────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────┤
│ commands/sentinel/coding-agent/server/SentinelCodingAgentServerCommand.ts │ Resolves provider, executes, emits events, captures training data │
├─────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────┤
│ commands/sentinel/coding-agent/browser/SentinelCodingAgentBrowserCommand.ts │ Delegates to server │
└─────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────┘
Bindings
┌──────────────────────────────────────────┬─────────────────────────────────────────┐
│ File │ Action │
├──────────────────────────────────────────┼─────────────────────────────────────────┤
│ workers/.../bindings/modules/sentinel.ts │ Added codingagent to PipelineStep union │
└──────────────────────────────────────────┴─────────────────────────────────────────┘
Verification
- 109 Rust tests pass (0 failures)
- TypeScript compiles clean (strict mode)
- SDK installed: @anthropic-ai/claude-agent-sdk added to package.json
Canonical SENTINEL-ARCHITECTURE.md rewritten to match actual Rust/TS
implementation: all 10 step types documented (was 6), variable
interpolation syntax corrected from $variable to {{variable}},
runtime/safety/commands sections updated with real structs and
commands, CodingAgent step type added throughout.
7 supporting docs updated with status headers pointing to canonical
doc. Superseded docs marked. Academy step-type count fixed (6/10).
New SENTINEL-GAP-ANALYSIS.md compares our sentinel system against
Claude Code, Codex, Aider, OpenCode, GSD, SWE-agent, OpenHands,
Cline, Cursor, and Sweep. Identifies 7 gaps (codebase understanding,
context management, multi-agent isolation, quality scoring, multi-
provider support, developer UX, persona integration depth) and 6
unique strengths (pipeline composition, LoRA training, Academy
dual-sentinel, training capture, persona ownership, event-based
inter-agent communication). Includes 5-phase prioritized roadmap
and research references for distillation pipeline hardening.
Sentinel demo system proven end-to-end: setup → milestones (CodingAgent
loop with test feedback) → training-export → genome/train. Pipeline ran
successfully on task-tracker project (3 milestones, all passed, adapter
trained with loss=2.49).
Key additions:
- DemoPipeline builder + DemoTypes (pipeline orchestration)
- genome/training-export command (accumulator buffer → JSONL → disk)
- genome/demo-run command (entry point for demo pipelines)
- task-tracker project (3 milestones, 14+ deterministic tests)
- Shell allowFailure flag (test runners don't kill loops)
- Interpolation fix: {{steps.N}} searches by step_index not array
position (loop sub-steps shift positions in shared results array)
- ClaudeCodeProvider: strip ANTHROPIC_API_KEY for OAuth auth
- Startup self-healing: Postgres DB health check + auto-create + auto-seed
… hygiene - Remove 60s blanket IPC timeout that killed long-running voice/speak-in-call and ai/generate commands. CLI already enforces per-command timeouts. - Fix OnceLock race in Silero VAD init — multiple STT listeners no longer treat concurrent init as fatal error (silero.rs + silero_raw.rs) - Fix Unicode byte-slice panics on emoji text in transcription logging (2 locations in livekit_agent.rs) - Add 10MB log file size cap with auto-truncation in LoggerModule - Truncate all worker logs on startup in start-workers.sh - Remove 5 debug logs from animation hot paths (gpu_bridge register/resize, speaking toggle, duplicate sentence log, broadcast count) - Fix system-stop.sh: SIGKILL for LiveKit (matches start behavior) - Fix stop-workers.sh: subshell bug where STILL_RUNNING never propagated
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the Sentinel system with a new CodingAgent step/provider architecture (Claude Code via Agent SDK), adds a demo “teacher → distill” pipeline, and includes multiple stability/logging improvements across IPC, VAD/STT, LiveKit video publishing, and script preflight/log hygiene.
Changes:
- Add Sentinel
codingagentpipeline step (Rust + TS command) and a provider registry with a Claude Code provider implementation. - Add demo pipeline tooling (
genome/demo-run,genome/training-export,task-trackerdemo project/test scaffolding) to capture agent interactions and train LoRA. - Improve operational stability/hygiene: IPC dispatch via tokio tasks, pool wait timeouts, Unicode-safe log previews, VAD session init race fix, log truncation/caps, shared script preflight utilities.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/workers/stop-workers.sh | Avoid subshell so STILL_RUNNING state is preserved. |
| src/workers/start-workers.sh | Create log subdirs + truncate logs on restart. |
| src/workers/continuum-core/src/runtime/runtime.rs | Add recv_timeout safety net to route_command_sync. |
| src/workers/continuum-core/src/orm/postgres.rs | Configure deadpool pool max_size + timeouts. |
| src/workers/continuum-core/src/modules/sentinel/types.rs | Add allowFailure to shell + introduce CodingAgent step type. |
| src/workers/continuum-core/src/modules/sentinel/steps/shell.rs | Implement allow-failure semantics + tests. |
| src/workers/continuum-core/src/modules/sentinel/steps/sentinel.rs | Update tests for new shell field. |
| src/workers/continuum-core/src/modules/sentinel/steps/parallel.rs | Update tests for new shell field. |
| src/workers/continuum-core/src/modules/sentinel/steps/mod.rs | Wire new Shell signature + add coding_agent executor. |
| src/workers/continuum-core/src/modules/sentinel/steps/loop_step.rs | Add richer failure logging and failedSubStep metadata. |
| src/workers/continuum-core/src/modules/sentinel/steps/condition.rs | Update tests for new shell field. |
| src/workers/continuum-core/src/modules/sentinel/steps/coding_agent.rs | New Rust step delegating to TS sentinel/coding-agent. |
| src/workers/continuum-core/src/modules/sentinel/interpolation.rs | Change steps.N resolution to search by step_index. |
| src/workers/continuum-core/src/modules/sentinel/executor.rs | Update tests for new shell field. |
| src/workers/continuum-core/src/modules/logger.rs | Add 10MB size cap via truncation on reopen. |
| src/workers/continuum-core/src/modules/data.rs | Treat postgres URLs as “main DB” for pool sizing. |
| src/workers/continuum-core/src/live/transport/livekit_agent.rs | Video loop notify-driven publish, VAD frame size fix, Unicode-safe previews, lip sync smoothing, logging tweaks. |
| src/workers/continuum-core/src/live/session/orchestrator.rs | Remove a noisy log line. |
| src/workers/continuum-core/src/live/avatar/render_loop.rs | Add frame_ready Notify to allocations. |
| src/workers/continuum-core/src/live/avatar/publishers/native_buffer.rs | Add FPS-average logging. |
| src/workers/continuum-core/src/live/avatar/publishers/gpu_bridge.rs | Reduce hot-path logs + add FPS-average logging. |
| src/workers/continuum-core/src/live/avatar/frame_publisher.rs | Add FPS-average logging + clarify effective FPS comment. |
| src/workers/continuum-core/src/live/audio/vad/silero_raw.rs | Ignore OnceLock::set failure (race-safe init). |
| src/workers/continuum-core/src/live/audio/vad/silero.rs | Ignore OnceLock::set failure (race-safe init). |
| src/workers/continuum-core/src/live/audio/vad/production.rs | Use 512-sample frame size + reduce debug log frequency. |
| src/workers/continuum-core/src/live/audio/mixer.rs | Reduce per-frame debug spam for AI ring buffer writes. |
| src/workers/continuum-core/src/ipc/mod.rs | Dispatch IPC requests via tokio tasks + async routing (avoid rayon starvation). |
| src/workers/continuum-core/bindings/modules/sentinel.ts | Update TS pipeline step union (shell allowFailure + codingagent). |
| src/widgets/persona-brain/PersonaBrainWidget.ts | Remove browser-side per-persona DB queries (no dbHandle available). |
| src/system/user/server/modules/cognitive/memory/Hippocampus.ts | Require per-persona dbHandle (no fallback). |
| src/system/user/server/modules/cognition/CognitionLogger.ts | Add requireHandle guard; skip writes pre-init (no fallback). |
| src/system/user/server/modules/PersonaToolDefinitions.ts | Add tool descriptions + “essential tools” include coding-agent + docs. |
| src/system/user/server/modules/PersonaTaskExecutor.ts | Skip memory store until persona longterm dbHandle is ready. |
| src/system/sentinel/pipelines/DemoTypes.ts | New demo pipeline config/result types. |
| src/system/sentinel/pipelines/DemoPipeline.ts | New end-to-end demo pipeline builder (CodingAgent + tests + train). |
| src/system/sentinel/coding-agents/index.ts | Barrel exports + self-registration. |
| src/system/sentinel/coding-agents/CodingAgentRegistry.ts | New provider registry. |
| src/system/sentinel/coding-agents/CodingAgentProvider.ts | New provider interface + interaction/toolcall types. |
| src/system/sentinel/coding-agents/ClaudeCodeProvider.ts | Claude Agent SDK wrapper + PATH hardening + custom spawn. |
| src/system/rag/sources/ToolDefinitionsSource.ts | Prioritize sentinel tools in essential tool recipe. |
| src/shared/version.ts | Version bump. |
| src/shared/generated-command-constants.ts | Add sentinel/coding-agent + genome/demo-run + genome/training-export constants. |
| src/server/generated.ts | Register new server commands. |
| src/scripts/system-stop.sh | Use shared preflight + SIGKILL LiveKit. |
| src/scripts/shared/preflight.sh | New shared shell preflight utilities. |
| src/scripts/shared/Preflight.ts | New TS preflight utilities mirroring shell checks. |
| src/scripts/setup-rust.sh | Use shared preflight (build tools + jq install). |
| src/scripts/parallel-start.sh | Use shared preflight; hot restart PID tracking; add DB health check + auto-seed. |
| src/scripts/install-livekit.sh | Use shared preflight. |
| src/scripts/download-voice-models.sh | Use shared preflight. |
| src/scripts/download-avatar-models.sh | Use shared preflight. |
| src/projects/task-tracker/tests/milestone-0.test.ts | New demo project tests (milestone 0). |
| src/projects/task-tracker/tests/milestone-1.test.ts | New demo project tests (milestone 1). |
| src/projects/task-tracker/tests/milestone-2.test.ts | New demo project tests (milestone 2). |
| src/projects/task-tracker/scaffold/tsconfig.json | Demo scaffold tsconfig. |
| src/projects/task-tracker/scaffold/package.json | Demo scaffold package manifest. |
| src/projects/task-tracker/project.json | Demo project spec (milestones + test commands). |
| src/package.json | Add claude-agent-sdk dependency + version bump. |
| src/package-lock.json | Lockfile update for new dependency + version bump. |
| src/generator/generate-rust-bindings.ts | Use spawnSync + --lib; improved error handling + preflight detection. |
| src/generated-command-schemas.json | Add schemas for new commands + regeneration timestamp. |
| src/docs/personas/ACADEMY_GENOMIC_DESIGN.md | Mark legacy doc status + point to canonical doc. |
| src/docs/personas/ACADEMY_ARCHITECTURE.md | Mark legacy doc status + point to canonical doc. |
| src/docs/personas/ACADEMY-DOJO-ARCHITECTURE.md | Update “step types demonstrated” count. |
| src/docs/SENTINEL-PIPELINE-ARCHITECTURE.md | Mark superseded + update summary. |
| src/docs/SENTINEL-LOGGING-PLAN.md | Update doc to reflect Rust implementation status. |
| src/docs/SENTINEL-GAP-ANALYSIS.md | New gap analysis doc. |
| docs/SENTINEL-WORKERS.md | Mark superseded + point to canonical doc. |
| docs/SENTINEL-ARCHITECTURE.md | Mark superseded + point to canonical doc. |
| src/daemons/data-daemon/shared/ORMConfig.ts | Add per-persona collection guard + resolveDbHandle. |
| src/commands/sentinel/coding-agent/shared/SentinelCodingAgentTypes.ts | New shared command types. |
| src/commands/sentinel/coding-agent/server/SentinelCodingAgentServerCommand.ts | New server command implementation + progress events + training capture. |
| src/commands/sentinel/coding-agent/package.json | New command package metadata. |
| src/commands/sentinel/coding-agent/browser/SentinelCodingAgentBrowserCommand.ts | New browser delegating command. |
| src/commands/genome/training-export/shared/GenomeTrainingExportTypes.ts | New shared command types. |
| src/commands/genome/training-export/server/GenomeTrainingExportServerCommand.ts | Export persona training buffer to JSONL. |
| src/commands/genome/training-export/package.json | New command package metadata. |
| src/commands/genome/training-export/browser/GenomeTrainingExportBrowserCommand.ts | New browser delegating command. |
| src/commands/genome/training-export/README.md | New command docs. |
| src/commands/genome/demo-run/shared/GenomeDemoRunTypes.ts | New shared command types. |
| src/commands/genome/demo-run/server/GenomeDemoRunServerCommand.ts | Build + dispatch demo pipeline via sentinel/run. |
| src/commands/genome/demo-run/package.json | New command package metadata. |
| src/commands/genome/demo-run/browser/GenomeDemoRunBrowserCommand.ts | New browser delegating command. |
| src/commands/genome/demo-run/README.md | New command docs. |
| src/commands/data/vector-search/server/VectorSearchServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/data/update/server/DataUpdateServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/data/shared/BaseDataTypes.ts | Stop defaulting dbHandle to 'default' in payload factory. |
| src/commands/data/read/server/DataReadServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/data/list/server/DataListServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/data/delete/server/DataDeleteServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/data/create/server/DataCreateServerCommand.ts | Use resolveDbHandle for db routing safety. |
| src/commands/ai/context/search/server/AiContextSearchServerCommand.ts | Skip per-persona collections unless persona dbHandle is available. |
| src/browser/generated.ts | Register new browser commands. |
Blocking issues found (must fix before merge):
DemoPipeline.tsuses condition expressions like{{loop.2.exitCode == 0}}/{{steps[-1].exitCode == 0}}, but the Rust condition system only interpolates paths and then applies a simple truthiness check (no==parsing). These conditions will interpolate to an empty string and evaluate false, breaking pass/fail control flow for the demo.DemoPipeline.tsusessteps[-1]to reference the last step, but Ruststeps.Nresolution parsesNasusizeand does not support negative indices, sosteps[-1]will resolve to empty.src/package.jsonadds@anthropic-ai/claude-agent-sdkwhile the repo declares"node": ">=16.0.0". The added dependency declares"engines": { "node": ">=18.0.0" }in the lockfile entry, which is an installation/runtime compatibility break unless the repo’s supported Node version is bumped accordingly.
Files not reviewed (1)
- src/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Key files
workers/continuum-core/src/modules/sentinel/— pipeline engine (Rust)system/sentinel/— coding agent providers, demo pipeline (TypeScript)workers/continuum-core/src/ipc/mod.rs— IPC timeout removalworkers/continuum-core/src/live/— VAD race fix, Unicode fixes, log cleanupworkers/continuum-core/src/modules/logger.rs— 10MB size capworkers/start-workers.sh/stop-workers.sh/scripts/system-stop.sh— log truncation, SIGKILL, subshell fixTest plan
cargo check --package continuum-coreclean🤖 Generated with Claude Code