Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

docs(agent): record P7 repeated corpus baseline

Rahmanf543a3a817a2
diff --git a/README.md b/README.md
index de758875..95ff76bb 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ For a real deployment, put MSO behind **Tailscale, a VPN, or a TLS reverse proxy
- **Message live local sessions by a short name** — every durable same-principal MSO session gets a unique familiar handle such as `@milo`, `@luna`, or `@nara`, independent from its longer auto-generated session title. `/rename <name>` changes that handle, while `/title <text>` changes the session description. `@milo …` resolves only agents with a current lease **and** a live receiver subscription, then creates an explicitly correlated request; replies relay deterministically into the originating conversation while notify-only events remain passive. Presence lease (`idle`/`busy`/`offline`) and receiver subscription (`consumerConnected`) are reported separately so an idle-but-unsubscribed target is diagnosable. For ChatGPT/MCP sessions, `local_agent_inbox(wait_ms=...)` temporarily turns the foreground MCP call into that live receiver for up to 20 seconds, enabling direct two-way session messaging without a worker, DB, webhook, or broker. See [Local Agents](./docs/LOCAL-AGENTS.md).
- **Spawn focused same-session subagents** — `/spawn` and `agent_subagent_run` create bounded foreground workers with isolated context, explicit delegated scope, turn/timeout caps, no recursive spawn, and final-result-only return. They are not Local Agent peers and do not run autonomously after the parent call returns. See [Subagents](./docs/SUBAGENTS.md).
- **Delegate between remote agents with standard A2A v1** — register public HTTPS peers, attach private API-key/Bearer/OAuth access-token profiles, stream remote tasks over SSE, or expose MSO's authenticated inbound Agent Card when a public HTTPS origin is configured. Inbound credentials are owner-minted `read | write | exec` capabilities and run in a memory-isolated task context. See [A2A](./docs/A2A.md).
-- **Keep agents efficient independently of the model provider** — the MCP-first [Cognitive Runtime](./docs/COGNITIVE-RUNTIME.md) isolates conversations from OAuth identity, budgets model context/tool output, uses the RASMIC catalog-first router to select a tiny per-turn capability pack without weakening scopes, compacts durable sessions with sanitized 30-day backup archives, learns only verified workflow recipes, promotes repeated procedures only through the eval-gated Tool Forge, and batches/filter/aggregates independent reads through `read_pipeline` before raw data reaches the model. `bun run bench:cognitive`, `bun run bench:pipeline`, and isolated scratch-fixture `bun run bench:corpus` guard routing, correctness, policy compliance, latency, context savings, and proof-gated normalized provider usage so cache/reasoning details are never double-counted or guessed.
+- **Keep agents efficient independently of the model provider** — the MCP-first [Cognitive Runtime](./docs/COGNITIVE-RUNTIME.md) isolates conversations from OAuth identity, budgets model context/tool output, uses the RASMIC catalog-first router to select a tiny per-turn capability pack without weakening scopes, compacts durable sessions with sanitized 30-day backup archives, learns only verified workflow recipes, promotes repeated procedures only through the eval-gated Tool Forge, and batches/filter/aggregates independent reads through `read_pipeline` before raw data reaches the model. `bun run bench:cognitive`, `bun run bench:pipeline`, isolated scratch-fixture `bun run bench:corpus`, and deterministic repeated `bun run bench:corpus:repeat` guard routing, correctness, policy compliance, repeat coverage, latency, context savings, and proof-gated normalized provider usage so cache/reasoning details are never double-counted or guessed.
- **Make orchestration risk-aware and self-improving** — [RASMIC](./docs/RASMIC.md) classifies task risk/contention, retrieves compact repo-local memory, records manual user tests and Evidence Receipts, detects path/shared-resource collisions before merge conflicts, and promotes repeated safe routes from observed traces → recipes → tested bounded scripts.
- **Add app slices** — features are modular under `frontend/slices/<slug>/`.
- **Personalize the interface** — macOS, Windows, iOS, and Android shell layouts are UI preferences, not the core product.
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 3b4425e3..ab6b5481 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -19,8 +19,13 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Faster**
+- `agent` add repeatable corpus runner
- `agent` expand objective repo corpus
+**Docs**
+
+- `agent` record P7 repeated corpus baseline
+
## 2026-09-02
**Added**
diff --git a/docs/COGNITIVE-RUNTIME.md b/docs/COGNITIVE-RUNTIME.md
index f0a5bdf9..4ac237b5 100644
--- a/docs/COGNITIVE-RUNTIME.md
+++ b/docs/COGNITIVE-RUNTIME.md
@@ -110,6 +110,8 @@ bun run bench:quality -- --live # learned workflow success + P1 telemetry cover
bun run bench:agents -- --provider openai-codex --model gpt-5.6-terra # one-task smoke plan
bun run bench:corpus -- --provider openai-codex --model gpt-5.6-terra # nine-task dry plan
bun run bench:corpus -- --provider openai-codex --model gpt-5.6-terra --run # isolated scratch-fixture quality corpus
+bun run bench:corpus:repeat -- --runs 2 --seed baseline-1 --provider openai-codex --model gpt-5.6-terra # deterministic repeated plan
+bun run bench:corpus:repeat -- --runs 2 --seed baseline-1 --provider openai-codex --model gpt-5.6-terra --run # repeated full corpus
```
The core benchmark is deterministic and provider-neutral. Its checked scenarios cover application logs, server health, safe file editing, long/short execution, project functions, Cloudflare/Hostinger/Dokploy, browser/screenshots, memory, session resume, Skills, manual regression evidence, Indonesian repository changes, local-agent requests, subagents, A2A and Tool Forge. It also verifies the second phase after `workflow_start`.
@@ -276,9 +278,31 @@ Efficiency is less sensitive to that one miss. On all nine attempts, MSO average
The full-run MSO repo traces also confirm the structural lifecycle fix: `repo-debug` and `repo-migration` each contain one `workflow_start`, bounded reads/writes, one `exec_run` validator, and `workflow_finish`; rollback preserves rejected-transaction evidence while restoring the config exactly. The older P4/P5 six-scenario results above remain historical evidence and are not rewritten as if they were P6 results.
-## P6 next direction
+## P7 repeated full-corpus baseline
-1. **Repeat full corpora across seeds/runs before reliability claims** — aggregate repeated complete v2 runs rather than promoting a one-run miss into a product claim.
+P7 closes the first P6 follow-up by making repeatability a first-class benchmark contract instead of an ad-hoc rerun. `bench:corpus` now accepts an explicit bounded `--seed` and records both the seed and requested agent order. New `bench:corpus:repeat` derives a deterministic seed per run, rotates the starting agent between runs, executes the complete child corpus unchanged, and aggregates only after strict identity checks. Ranking is withheld if any requested child run is missing, seed/order identity drifts, one agent duplicates or omits a scenario while preserving row count, or provider/model identity changes across runs. The repeat layer reports observed counts/rates and does **not** manufacture confidence intervals or statistical-significance claims.
+
+The first full P7 baseline was executed from source commit `5bd5788` with two complete nine-scenario runs on `openai-codex/gpt-5.6-terra`, using different derived fixture seeds and opposite starting-agent order. Independent post-run validation checked all **36 rows**, exact per-run/per-agent scenario identity, provider/model evidence, scenario-policy, exit status, and every token-accounting arithmetic proof.
+
+| P7 repeated metric | MSO | Hermes |
+|---|---:|---:|
+| Task success | **18/18 (100%)** | **18/18 (100%)** |
+| Scenario-observable policy compliance | **18/18 (100%)** | **18/18 (100%)** |
+| Perfect full runs | **2/2** | **2/2** |
+| Average latency | **18,922.6 ms** | 21,077.4 ms |
+| p50 latency | **13,761 ms** | 20,513.5 ms |
+| Normalized token coverage | **100%** | **100%** |
+| Normalized tokens / attempt | **17,271.3** | 65,073.3 |
+| Accounting proof | explicit inclusive contract | exact exclusive-cache sum |
+| Cost semantics comparable | no | no |
+
+Across these two runs, MSO used about **73.5% fewer normalized tokens per attempt** (Hermes used ~3.77× as many), with **10.2% lower average latency** and **32.9% lower p50 latency**. The earlier P6 Hermes `multi-read` miss did not recur: both agents passed `multi-read` **2/2** here, in addition to the prior P6 3/3 alternating-order stability follow-up. That strengthens the interpretation that the single P6 miss was run variance, but two complete repeats are still a small sample and P7 does not turn this into a universal reliability claim.
+
+P7 also observed real provider-reported cache-read activity without forcing a cache hit: MSO had positive `cacheReadTokens` on **4/18** rows while preserving `explicit-inclusive-contract` arithmetic; Hermes reported positive cache reads on all 18 rows under its separately proven `exact-exclusive-cache-sum` shape. Cache-hit frequency is not ranked because the runners expose different request/context behavior. The observation is useful only as evidence for a dedicated repeated-prefix cache-calibration phase. Cost remains withheld because the attribution contract is still asymmetric.
+
+## P7 next direction
+
+1. **Increase repeat depth before reliability statistics** — run at least several additional complete, independently seeded corpora before estimating variance/confidence; two runs establish the mechanism and first repeated baseline, not statistical certainty.
2. **Calibrate cache behavior** — add repeated-prefix fixtures that can observe real provider cache hits without forcing them; keep zero/absent cache fields distinct and never assume a hit.
3. **Normalize cost only with attribution** — compare cost only when every runner exposes the same usable USD source/contract; `0` with source `none` is not evidence of free execution.
4. **Add OpenClaw only when comparable** — run the same corpus when an equivalent provider/model is legitimately configured, without mutating credentials as part of the benchmark.
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index d8a5887f..b914dc4a 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -3,6 +3,13 @@
- **MCP protocol-era correctness (2026-09-03):** server `1.7.3` stops claiming the stateless `2026-07-28` protocol while serving the legacy initialize/session wire shape. The supported ceiling is deliberately `2025-06-18` (matching the known-good CareerPack ChatGPT connector); a modern HTTP probe receives a 400 and can fall back to initialize. `server/discover` is no longer aliased to the legacy initialize payload. Browser CORS also permits `Mcp-Method`/`Mcp-Name` so a standards-aware probe can reach the server and receive the fallback signal. Toolset stays `2026.09.03.4`.
Running log of what shipped each phase. Newest at top.
+## 2026-09-03 — Cognitive Runtime P7 repeatable corpus baseline
+
+- **Deterministic repeat contract:** added `bench:corpus:repeat`, explicit single-run `--seed`, deterministic per-run seed derivation, and alternating starting-agent order. Repeated aggregation is fail-closed on missing runs, seed/order drift, duplicate or missing per-agent scenario identities, and cross-run provider/model drift.
+- **First repeated full baseline:** two complete nine-scenario `openai-codex/gpt-5.6-terra` runs from source `5bd5788` produced **18/18 task + 18/18 scenario-policy** for both MSO and Hermes, with **2/2 perfect runs** each. The prior P6 Hermes `multi-read` miss did not recur (`2/2` here for both agents).
+- **Observed efficiency, still bounded:** MSO measured **18,922.6 ms average / 13,761 ms p50 / 17,271.3 normalized tokens per attempt** versus Hermes **21,077.4 ms / 20,513.5 ms / 65,073.3 tokens**. On these two runs that is ~**73.5% fewer normalized tokens/attempt**, ~**10.2% lower average latency**, and ~**32.9% lower p50** for MSO. All 36 token proofs passed independent arithmetic validation; cost semantics remain non-comparable.
+- **Cache evidence without a manufactured hit:** provider telemetry naturally reported positive MSO cache reads on 4/18 rows and Hermes cache reads on 18/18. P7 records this as calibration evidence only; it does not rank cache-hit rates because runner request/context behavior differs. More independent full repeats are required before reliability statistics.
+
## 2026-09-03 — OAuth DCR registration identity fix
- **2026-09-03 — Browser MCP install compatibility:** comparison with the working CareerPack MCP showed that ChatGPT completed DCR + OAuth for MSO but the post-auth browser probe differed: CareerPack serves CORS preflight/metadata while MSO rejected `Origin: https://chatgpt.com` and returned OPTIONS without usable CORS headers. MCP server `1.7.2` now permits the exact ChatGPT browser origins only against the configured public MSO origin, keeps arbitrary/loopback-origin requests denied, adds explicit `/mcp` preflight headers, and adds public CORS to OAuth discovery/DCR. Toolset stays `2026.09.03.4` because no tool descriptor changed.
diff --git a/docs/TESTING-HANDOFF.md b/docs/TESTING-HANDOFF.md
index 82653e6d..2e4ff539 100644
--- a/docs/TESTING-HANDOFF.md
+++ b/docs/TESTING-HANDOFF.md
@@ -7,6 +7,7 @@ Update this file at the end of every manual or automated test session. Keep it f
The current release target is **MSO CLI 1.12.0**, MCP server `1.7.3`, toolset `2026.09.03.4`; use `mso --version` plus `/api/health` for the exact Git build because documentation-only release commits also advance that identity. The v1.10/v1.11 findings and the v1.12 sectioned-terminal/recoverable-error work below are resolved and retained as historical test evidence. Do not re-open a resolved finding from prose alone: reproduce it against the current build first. There is no known 1.12 release blocker in this handoff.
Current verified behavior:
+- P7 repeatability gate: `bench:corpus:repeat` adds explicit/deterministic seeds, alternating starting-agent order, and strict per-run/per-agent scenario + provider/model identity checks before any cross-run ranking. The first two complete 9-scenario runs from source `5bd5788` on `openai-codex/gpt-5.6-terra` were 18/18 task + 18/18 scenario-policy for both agents and 2/2 perfect runs each. Aggregate MSO vs Hermes: 17,271.3 vs 65,073.3 normalized tokens/attempt (~73.5% lower for MSO), 18,922.6 vs 21,077.4 ms average latency, and 13,761 vs 20,513.5 ms p50. All 36 token-proof arithmetic checks passed. This is a bounded two-run baseline, not statistical reliability proof; cost remains non-comparable.
- MCP 1.7 release candidate: ChatGPT is fail-closed to a 29-tool compact MSO-only profile (~31.8 KiB descriptor JSON / ~8k rough tokens), full MSO remains 73 transport tools, and project-specific MCP names stay dynamic behind `project_mcp_tools` / `project_mcp_call`. OAuth resource binding + rotating refresh credentials, Streamable HTTP protocol handling, and legacy registered ChatGPT-client profile detection have focused regression coverage. Deterministic security gates (Trivy/OSV/Gitleaks/Semgrep/ShellCheck) pass; Codex Security AI scanning is explicitly incomplete because executor/cost guards stopped it, with 0 findings in the targeted partial reports.
- P6 `mso-agent-quality-v2` expands the matched corpus to nine scenarios with repo-debug, schema migration, and transactional rollback. Final `openai-codex/gpt-5.6-terra` full run: MSO 9/9 task + 9/9 scenario-policy, Hermes 8/9 + 9/9; normalized tokens/attempt 16,683.4 vs 67,433.1 (~75.3% lower for MSO), p50 15,285 vs 23,294 ms, while MSO average latency was ~2.6% higher. The Hermes `multi-read` miss did not reproduce in a 3/3-vs-3/3 alternating-order follow-up, so it is not treated as a universal reliability claim. P6 also fixes over-broad manual-test routing, restores explicit exec validation for repo tasks, and prevents duplicate `workflow_start` inside long single-user turns. Cost remains non-comparable.
- P5 provider-usage normalization preserves Codex/OpenAI cache/reasoning details without double counting, keeps unknown fields unknown, and proof-gates canonical token semantics. A full candidate MSO↔Hermes run on `openai-codex/gpt-5.6-terra` remained 6/6 task + 6/6 scenario-policy for both; token semantics are now comparable at 3,510.8 vs 59,743.2 normalized tokens/success, while cost semantics remain non-comparable. MSO's proof is `explicit-inclusive-contract`; Hermes is `exact-exclusive-cache-sum`.