interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

Hermes prior art 2: persist-before-act turn discipline and loop-proof recovery in the aien chat loop

Open · #665 · open 2026-10-18 19:11 UTC

Imported from GitHub aien-dev/aien-sovereign-core-mv#665, by drakestapleton

drakestapleton wrote on 2026-10-18 19:11 UTC

Hermes source: agent/turn_tool_round.py, agent/turn_context.py, agent/turn_retry_state.py, agent/turn_truncation.py, agent/error_classifier.py.

Mechanics to implement in crates/aien-cli (interactive loop):

  • The assistant message that requests tools is written durably to the session store before any tool runs; if that write fails the turn ends with a named reason.
  • The exact wire bytes of any injected message are kept as a sidecar so later turns replay byte-identical prompts.
  • Failure classification with one-shot recovery flags per attempt (each recovery fires at most once), so no recovery can loop.
  • A tool call truncated by the output cap is retried with a raised cap and is never executed with incomplete arguments.
  • Credential or provider pool tried before the fallback model chain.

Same idea as AIENOS continuity commits (advance the record, then act), applied to the chat loop.

Acceptance: kill the process between persist and tool run and show the session resumes with the request recorded and no tool side effect lost or doubled; a forced classifier loop terminates in one attempt.

Parent: aien-dev/aien-architecture#267. Research note: aien-architecture docs/research/hermes-agent-prior-art.md. Prior art: Hermes Agent, Nous Research, MIT, commit 5480918 (2026-10-18). No Hermes code is copied; the mechanism is re-implemented from reading. The module header credits Hermes Agent, Nous Research, the MIT licence and the commit. Rust now, pure part effect-free and content-addressed so it can move to Omega (ADR 0024). No Python.

🤖 Generated with Claude Code

drakestapleton wrote on 2026-10-18 19:54 UTC

Progress (Hermes agent, PR desk, 2026-10-18): branch feat/665-persist-before-act at 0996e28.

Built:

  • crates/aien-cli/src/turn_journal.rs: append-only, hash-chained session journal. Every message and tool request is flushed to disk before the loop acts. aien-cli --resume <id> replays it: in-flight reads run again; any other in-flight request is reported to the model as outcome_unknown and never run twice. A torn last line is dropped; damage elsewhere is refused.
  • crates/aien-cli/src/turn_recovery.rs: failure classes with one-shot recovery flags per turn (retry once, wait once on 429, compact once on overflow, raise the output cap once on a cut-off tool call). A cut-off tool call is never executed.
  • Wired into the interactive loop and -p mode; crates/aien-cli/README.md added.

Tests (cargo test -p aien-cli --bin aien-cli turn_): 16 pass, including a real SIGKILL test (the test re-runs itself as a child, kills it after the request is on disk and before the effect, then resumes: request recorded, effect not doubled). Mutation check: running the tool before recording it, or never spending a recovery flag, fails 5 of them. Whole aien-cli bin suite 109 pass; clippy -D warnings and fmt clean. crumb verify OK with the pinned tool (94fffbc).

Not done or not tested: the autonomous goal loop (goal auto) is not wired yet; the credential/provider pool before a fallback model is not built (one model seat today); not run against a live model; browser_mirror::stub_page_screenshot_and_eval fails on the Spark shell (headless Chrome, file unchanged vs main).

The PR opens after the current GPU benchmark window ends: this change selects PREFILL-E2E-2, which runs without the GPU lock (pool=host), and would disturb the TandemLLM timing run.

Sign in to comment