test: add deterministic Moonshine integration and enforce session resume identity - #3
Open
Charlie-Wang-03 wants to merge 2 commits into
Conversation
Replays the completed deterministic Moonshine runtime integration harness and the session resume identity fix onto the latest upstream-synced main.
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.
Problem
The archive runner had deterministic offline coverage, but it still lacked a regression layer against the real Moonshine runtime.
In particular, resume state only passed
session_idback into Moonshine and then checkedproject_slugafterward. A same-project session created with the wrong Moonshine mode or agent could therefore be accepted by the archive runner.This matters because the persisted
session_idis part of the runner's recovery contract: resuming the wrong runtime identity can silently continue work under incompatible agent semantics.Contract
A resumable archive session must be bound to the complete runtime identity expected by the workflow:
mode="chat"project_slugagent_slug="moonshine-core"The runner must fail closed before continuing when a persisted session violates any of those constraints.
The integration harness should exercise that contract through the real Moonshine runtime while keeping model behavior deterministic and offline.
Implementation
72a64f8984e0e7e1b0a50f6e53e4d00e4fffbb7d.test_*.pydiscovery layer so the existing Python 3.9 / 3.11 suite remains dependency-free.MoonshineApp, session persistence, skill/tool infrastructure, material staging, verification-event storage, recovery, and archive publication.MoonshineApp.start_shell_state(...).RunnerError.Deterministic integration coverage
The integration suite covers:
MoonshineAppwithout another model turn.Regression evidence
Candidate A was originally developed TDD-style: workflow run
33901898148reproduced the wrong-mode / wrong-agent acceptance bug. After the fix, run33902182551passed all five integration tests.After upstream PRs #1 and #2 merged, the work was rebuilt directly on current
main(5f7fbb72) and revalidated:33951560203: 5/5 passed on Python 3.11.33951560213: 17/17 passed on both Python 3.9 and Python 3.11.No real LLM/API credentials or Tavily/MCP network calls are required.
Scope / limitations
This PR verifies the Creative-Intelligence ↔ Moonshine runtime boundary. It does not claim end-to-end model quality, live-provider compatibility, or web/MCP behavior.
The Moonshine commit is intentionally pinned so future runtime changes cannot silently alter this regression baseline.