Skip to content

feat(biomemetics): prove A0 through OpenRouter DeepSeek - #100

Merged
creatifcoding merged 17 commits into
feat/mantis-biomemetics-labfrom
cursor/mantis-assistant-a0-9bdb
Aug 30, 2026
Merged

creatifcoding merged 17 commits into
feat/mantis-biomemetics-labfrom
cursor/mantis-assistant-a0-9bdb

Conversation

@creatifcoding

@creatifcoding creatifcoding commented Aug 21, 2026 •

Copy link
Copy Markdown
Owner

Draft A0 slice for #50 (parent #49). Pin Mastra + CopilotKit/AG-UI and prove the harness with real Mastra Agent calls through OpenRouter DeepSeek. This is not a keeper UI, SpecimenDB bridge, shop-release, EVA, or graph claim. Mastra memory is not canonical care or evidence truth.

Why

The A0 proof is a live agent.generate and in-process CopilotRuntime bind against the Mastra OpenRouter gateway string openrouter/deepseek/deepseek-v4-flash-0731. A canned fake-model sentence is not the proof.

Unit tests that construct MantisController must not require OPENROUTER_API_KEY. The live prove must fail closed when that key is missing.

Scope

  • createAdapterHarness and MantisController.create default to the live OpenRouter lane. That lane reads OPENROUTER_API_KEY only and passes openrouter/deepseek/deepseek-v4-flash-0731.
  • Unit tests use MantisController.createFixture() / createFixtureLane(). Policy guards and the compatibility matrix no longer call create().
  • npm run test:unit never needs a key. npm run test:live is the only path that requires OPENROUTER_API_KEY. Empty or missing fails closed with OPENROUTER_CREDENTIAL_REQUIRED.
  • CopilotKit forwardHeaders denies authorization, so the fixture session Bearer token does not overwrite the OpenRouter key on agent.stream.
  • .github/workflows/mantis-assistant-ci.yml runs Unit without a key, then OpenRouter DeepSeek prove with secrets.OPENROUTER_API_KEY. An unset secret leaves the prove env empty, so that job fails closed.
  • @mastra/core stays 1.61.0.

Tradeoffs

Live observational-memory observer/reflector cycles on InMemoryStore stay QUARANTINED_UPSTREAM.

The GitHub prove job stays red until the repo has an OPENROUTER_API_KEY Actions secret. That is fail-closed, not a skip.

Blast Radius

projects/biomemetics/labs/mantis/tooling/typescript/mantis-assistant/** plus the A0 eval matrix, assistant-run fixtures, and .github/workflows/mantis-assistant-ci.yml. Off assistant/app, golden-care, workflow-lab, and packages/specimendb.

Verification

Local npm run test:unit with no key: 32 passed, 0 failed.

Local npm run test:live with a store OPENROUTER_API_KEY: 3 passed, 0 failed. That includes generate, in-process CopilotRuntime bind, evals, and AG-UI matrix cases. Text is CareAdvice, not FAKE_MODEL_TEXT. Model id stays openrouter/deepseek/deepseek-v4-flash-0731.

Stay draft. Do not merge until the GitHub prove job is green.

Closes #50.

Open in Web Open in Cursor 

cursoragent and others added 4 commits August 21, 2026 05:15
…arness

Pin Mastra, CopilotKit, AG-UI, Effect, and TypeScript in a lab-local
mantis-assistant package with a committed lockfile. Add Draft 2020-12
contracts, deny/ask/allow policy, assayed read-only tools, and a
MantisController adapter that isolates every used beta API.

This is a compatibility and deterministic harness slice. It is not a
keeper UI, SpecimenDB bridge, shop-release, EVA, or graph claim.
Mastra memory is not canonical care or evidence truth.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Wire Observability through the in-memory TestExporter, keep
checks.includes/excludes as the proven eval hook, and mark live OM
observer/reflector plus hanging runEvals persistence as
QUARANTINED_UPSTREAM instead of papering them over.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Expose MastraAgent.getLocalAgents through CopilotRuntime as a fetch
handler at /api/copilotkit with no runtimeUrl and no listen(). Transcode
EventEncoder string chunks to Uint8Array so Node Response.text() can
read the run SSE. Authenticated fixture run emits CareAdvice.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title Mantis Assistant A0: pin Mastra/CopilotKit and prove the controller harness Mantis Assistant A0: pin Mastra/CopilotKit and prove fake CI plus live Luna consume Aug 21, 2026
Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title Mantis Assistant A0: pin Mastra/CopilotKit and prove fake CI plus live Luna consume Mantis Assistant A0: pin Mastra/CopilotKit and quarantine Codex OAuth lane Aug 21, 2026
cursoragent and others added 2 commits August 21, 2026 07:48
Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title Mantis Assistant A0: pin Mastra/CopilotKit and quarantine Codex OAuth lane Mantis Assistant A0: pin Mastra/CopilotKit and enable Codex Luna consume Aug 21, 2026
@cursor cursor Bot changed the title Mantis Assistant A0: pin Mastra/CopilotKit and enable Codex Luna consume Mantis Assistant A0: pin Mastra/CopilotKit and prepare gated Codex Luna lane Aug 21, 2026
Replace the Codex OAuth lane with Mastra's OpenAI-compatible OpenRouter
config for openai/gpt-5.6-luna at reasoning max. npm test calls
agent.generate and the in-process CopilotRuntime bind. A missing
OPENROUTER_API_KEY fails closed. @mastra/core stays 1.61.0.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title Mantis Assistant A0: pin Mastra/CopilotKit and prepare gated Codex Luna lane feat(biomemetics): prove A0 through OpenRouter Luna Aug 21, 2026
Restore createFakeModel as the default harness. Live openai/gpt-5.6-luna
uses OPENROUTER_API_KEY only and skips unless MASTRA_LIVE=1 is also set.
A missing key fails closed. @mastra/core stays 1.61.0.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title feat(biomemetics): prove A0 through OpenRouter Luna feat(biomemetics): gate OpenRouter Luna behind fake CI Aug 21, 2026
Revert the MASTRA_LIVE skip. npm test calls agent.generate and the
in-process CopilotRuntime bind against OpenRouter openai/gpt-5.6-luna.
A missing OPENROUTER_API_KEY fails closed. createFakeModel is not the
passing path. @mastra/core stays 1.61.0.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title feat(biomemetics): gate OpenRouter Luna behind fake CI feat(biomemetics): prove A0 through OpenRouter Luna Aug 21, 2026
cursoragent and others added 4 commits August 21, 2026 09:17
Reject error-event and quarantine passes on the generate and in-process
AG-UI prove. createFakeModel cannot satisfy those assertions.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Use the documented model-router string and OPENROUTER_API_KEY.
Pin openrouter/deepseek/deepseek-v4-flash-0731. Drop the custom
OpenAI-compatible url object and Luna max reasoning.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Pin openai/gpt-5.6-luna. Keep OPENROUTER_API_KEY fail-closed.
@mastra/core 1.61.0 has no openrouter/openai/gpt-5.6-luna router
id, so the live lane stays OpenAI-compatible config. Not DeepSeek.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Pin the Mastra model-router id openrouter/deepseek/deepseek-v4-flash-0731.
Keep OPENROUTER_API_KEY fail-closed. Drop Luna max reasoning.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@cursor cursor Bot changed the title feat(biomemetics): prove A0 through OpenRouter Luna feat(biomemetics): prove A0 through OpenRouter DeepSeek Aug 21, 2026
cursoragent and others added 3 commits August 25, 2026 15:42
Add a GitHub Actions job on feat/mantis-biomemetics-lab that runs
npm test against OpenRouter DeepSeek. Missing OPENROUTER_API_KEY
fails closed. The fake model is not the passing path.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
Unit tests use an explicit fixture lane. MantisController.create still
defaults to live DeepSeek. test:live fails closed without
OPENROUTER_API_KEY. CI runs unit without a key and prove with the secret.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
CopilotKit forwards inbound Authorization onto agent.stream, which
overwrote the OpenRouter Bearer key with the fixture token. Deny that
header at the runtime and join TEXT_MESSAGE deltas so the live AG-UI
proof can read CareAdvice.

Co-authored-by: digicoder <creatifcoding@users.noreply.github.com>
@creatifcoding
creatifcoding marked this pull request as ready for review August 30, 2026 02:10
@creatifcoding
creatifcoding merged commit 3e16986 into feat/mantis-biomemetics-lab Aug 30, 2026
1 of 2 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.

2 participants