Skip to content

feat: add branch-driven discovery and archive runner v2 - #5

Merged
DeepMathLLM merged 2 commits into
mainfrom
feat/archive-runner-v2
Sep 7, 2026
Merged

feat: add branch-driven discovery and archive runner v2#5
DeepMathLLM merged 2 commits into
mainfrom
feat/archive-runner-v2

Conversation

@DeepMathLLM

Copy link
Copy Markdown
Owner

Summary

This PR upgrades the mathematical-object archive runner with a branch-driven discovery workflow while preserving the existing JSON queue mode.

The runner can now select suitable mathematical objects from supplied research branches, create and verify each archive in its own Moonshine project and session, and continue serially until the requested number of verified archives is reached.

No Moonshine source code is modified.

Motivation

The original runner required every mathematical object to be specified in advance through an input JSON file.

For broader archive collection, the runner also needs to:

  • discover suitable objects from mathematical branches;
  • avoid objects attempted in previous runs;
  • connect each object to a concrete motivating problem;
  • generate and verify the archive in one continuous task;
  • preserve enough state to resume interrupted runs safely.

Main Changes

  • Add branch-driven execution through:
    • --branches
    • --target-archives
    • --run-name
    • --stream-output
  • Keep the existing ordered JSON queue workflow.
  • Process discovered objects serially, with one Moonshine project and session per object.
  • Pass previously attempted object names into subsequent discovery tasks.
  • Count only verified and published archives toward the target.
  • Preserve failed attempts in runner state for later inspection or repair.
  • Support an explicit discovery-stop response when no suitable distinct object can be identified.
  • Stream normal agent output to the terminal when requested.

Archive Content

The archive format and task skills now emphasize the mathematical reason an object was formed:

  • the concrete problem or problem class that motivated it;
  • the precise mathematical difficulty;
  • why the available concepts or methods were inadequate;
  • the insight that led to the object’s formation;
  • the essential role played by the object’s defining structure.

The archive is intended to explain mathematical meaning and formation rather than present a chronology of people and publications.

Verification

The verification tool continues to act as the publication gate.

It checks:

  • mathematical correctness;
  • accuracy and specificity of the mathematical context;
  • whether the archive explains the actual obstacle and structural mechanism rather than giving generic conclusions;
  • compliance with the active archive format specification.

Only the exact Markdown accepted by the verifier is published.

Safety and Recovery

This version preserves and extends the deterministic contracts introduced by earlier PRs:

  • bind local materials to their resolved paths and SHA-256 hashes;
  • reject resume if material content changes;
  • bind accepted verification output to the correct project, session, and archive hash;
  • refuse to overwrite a different existing archive;
  • require resumed sessions to match:
    • mode="chat"
    • the expected project_slug
    • agent_slug="moonshine-core"
  • apply the same session identity checks to both JSON queue and branch-discovery recovery;
  • reject sessions with incomplete persisted runtime identity.

Tests

  • Offline deterministic regression tests: 17/17 passed.
  • Real Moonshine runtime integration tests with deterministic provider substitutes: 7/7 passed.
  • GitHub branch checks: 3/3 passed.

The integration tests use real Moonshine session persistence, tool registration, material staging, verification-event storage, recovery, and archive publication.

Limitations

This PR does not validate:

  • live model output quality;
  • live provider availability;
  • Tavily or other MCP search behavior;
  • large-scale end-to-end archive quality.

Those remain runtime and evaluation concerns.

@DeepMathLLM
DeepMathLLM merged commit c0b2816 into main Sep 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant