Translating the runtime architecture from arXiv:2608.26263v2 into highly executable capabilities for ce-ai and Compound Engineering.
ce-ai is a fast Rust CLI orchestrating the 7-stage Compound Engineering lifecycle across 10 native AI harnesses (OpenCode, Claude, Antigravity, Cursor, Pi, Codex, etc.). Crucially, ce-ai is an orchestrator/governor, not the LLM inference runtime.
src/state/state.rs: Atomic state.json I/O and FSM workflow stage tracking.src/commands/workflow.rs: FSM checkpointing, status queries, and stage resumption.src/commands/skills.rs: Skill registry, installation, and harness distribution.src/commands/doctor.rs & sync.rs: SHA256 manifest drift detection and health verification.SKILL.state (Badhe et al. 2026) replaces append-only conversational history with an explicit, mutable execution state:
(P, Σt, Ot) → (Rt, ΔΣt, at).Rt is discarded immediately after validating the state patch Σt+1 = Σt ⊕ ΔΣt.
The integration surface of SKILL.state into ce-ai decomposes across five orthogonal dimensions:
SKILL.md frontmatter and distributed to harnesses.RepoState Sync
Connect doctor.rs and sync.rs SHA256 manifest diffing directly to ce-ai workflow resume. When human developers make git commits, edit files, or switch branches outside the agent's turn, conversational agents hallucinate for 5–8 turns because obsolete chat history overpowers reality. ce-ai computes a live RepoState projection upon invocation that injects a canonical ground-truth state update, achieving the paper's proven 0-step recovery without touching LLM inference internals.
external: arXiv:2608.26263v2 §5.4 (Table 3) documents that history-based runtimes waste 5–8 turns recovering from environment drift, while explicit state updates achieve instant 0-turn recovery.direct: src/commands/doctor.rs and src/commands/sync.rs already have robust SHA256 manifest and filesystem drift calculation; connecting this to workflow.rs requires minimal new code.
Implement deterministic output filters and distillers in ce-ai for command execution during Stage 5 (Verification) and Stage 7 (Shipping). Instead of dumping 500 lines of raw compiler warnings, cargo check logs, or gh pr checks polling telemetry into the agent context, ce-ai parses tool output into a clean structured summary (failing assertions, blocking jobs, specific line numbers) before it reaches the agent context.
external: arXiv:2608.26263v2 §5.3 proves that standard ReAct agents drop from 0.68 to 0.53 task accuracy under background telemetry noise, whereas state-based noise filtering preserves ≥0.97 accuracy.direct: Hard-Gate Invariant 2 and Stage 7 shipping workflows mandate running gh pr checks --watch and CI matrix gates, which generate high volumes of distractor logs.SKILL.state Schemas in Skill Frontmatter
Define formal execution state schemas in the YAML frontmatter of SKILL.md files in compound-engineering-plugin (e.g. ce-work, ce-debug, ce-optimize). ce-ai validates these schemas at skill installation and sync time, providing standard state templates that tell agents exactly what state fields to track in external files rather than accumulating conversational clutter.
external: arXiv:2608.26263v2 §3.1 proves that static 5-field domain schemas can generalize across hundreds of diverse real-world tasks without per-task tuning.direct: src/commands/skills.rs already manages skill distribution and validation; adding YAML frontmatter schema parsing is a clean additive change..ce-state.json instead of relying on prompt memory.compound-engineering-plugin.SKILL.state Behavioral Convention for Long-Horizon Stage 4 TDD Loops
Reframe the Stage 4 TDD loop as a skill-level behavioral convention rather than an impossible engine-level prompt interceptor. ce-work instructs the agent to maintain an explicit local state file (e.g. .ce-tdd-state.json with failing_tests, tested_hypotheses, active_lints) and explicitly consult and overwrite this state file during multi-step bugfixing rather than replaying past trial-and-error reasoning in conversational memory.
external: arXiv:2608.26263v2 demonstrates that explicit state tracking prevents hypothesis repetition in Linux bash CTF challenges (+7.8 points pass@1).direct: Reframing from a CLI runtime wrapper to a skill instruction pattern respects the reality that ce-ai orchestrates third-party harnesses without controlling their internal token loops.
Initiate a focused architectural spike to design a shared state blackboard for parallel subagents (e.g. ce-ideate, ce-code-review). Currently, write_atomic in src/state/mod.rs is a simple tempfile+rename without locking or concurrency controls. This spike will design a lock-safe patch merge mechanism (supporting null-deletion and conflict resolution) for multi-agent workflows.
external: arXiv:2608.26263v2 §7 notes that multi-agent explicit state requires deterministic conflict-resolution semantics in the merge operator ⊕.direct: src/state/mod.rs:38 uses tempfile rename, which guarantees atomic POSIX writes but can silently clobber concurrent writers without file locking or transactional merges.
Re-architect src/commands/workflow.rs around a deterministic pure reducer pattern (State, Action) → State. Every user action, agent transition, and checkpoint becomes a discrete serializable action object. When resuming a session across different harnesses (e.g. starting in Claude Code and switching to Antigravity CLI), the target harness receives the compiled state snapshot without needing any chat history translation.
reasoned: Pure reducer architectures provide mathematical determinism and lossless state reconstitution across disparate UI/agent clients.direct: src/state/state.rs already uses atomic writes and serde serialization; refactoring transition methods into pure reducer functions requires minimal architectural disruption.Candidates evaluated during divergent ideation and adversarial filtering that were cut, along with their specific rejection rationales:
| Candidate Idea | Frame | Rejection Rationale |
|---|---|---|
| Engine-Level Prompt Interception Loop | Inversion & Removal | Scope mismatch / unrealistic; ce-ai is a CLI orchestrator across 10 third-party harnesses and cannot intercept native inference loops. Reframed as Idea 4 (Skill-Level Convention). |
| Sufficient-Statistic Memory vs. RAG | Assumption-breaking | Duplicates stronger ideas; already incorporated into Idea 3 (Declarative Schemas) and Idea 2 (Telemetry State). |
| Git Object DAG for Agent State Transitions | Cross-domain Analogy | Too expensive relative to likely value; full content-addressed DAG storage adds unnecessary disk I/O compared to simple JSON state snapshots. |
| Strict 4k Token Context Window Constraint | Constraint-flipping | Below ambition floor; modern production models already have ≥128k context windows. The real bottleneck is context pollution and quadratic cost, not artificial 4k constraints. |
| 1,000-Step Autonomous Coding Sessions | Constraint-flipping | Too vague and ungrounded; represents an aspirational vision rather than an actionable CLI or skill implementation unit. |
| LLMLingua Perplexity History Compressor | Inversion & Removal | Refuted by paper findings: arXiv:2608.26263v2 §5.6 shows statistical compression drops accuracy to 0.22 by destroying critical structured slot dependencies. |