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.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
docs(agent): record P9 memory calibration
Rahman4920c51321eb
diff --git a/README.md b/README.mdindex 8377dd6e..007037b5 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`, isolated scratch-fixture `bun run bench:corpus`, deterministic repeated `bun run bench:corpus:repeat`, and observation-only `bun run bench:cache-calibration` guard routing, correctness, policy compliance, repeat coverage/spread, latency, context savings, cache telemetry, 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:memory:calibration`, `bun run bench:pipeline`, isolated scratch-fixture `bun run bench:corpus`, deterministic repeated `bun run bench:corpus:repeat`, and observation-only `bun run bench:cache-calibration` guard routing, memory correction/privacy semantics, correctness, policy compliance, repeat coverage/spread, latency, context savings, cache telemetry, 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.mdindex 60c97f1e..e6ea0f71 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -14,6 +14,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.**Fixed**+- `agent` calibrate correction memory semantics- `agent` compare normalized token proofs per row- `mcp` advertise implemented protocol era- `mcp` support trusted browser probes@@ -32,6 +33,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.**Docs**+- `agent` record P9 memory calibration- `agent` record P8 calibration baseline- `agent` record P7 repeated corpus baselinediff --git a/docs/COGNITIVE-RUNTIME.md b/docs/COGNITIVE-RUNTIME.mdindex 6581f200..6d400f4c 100644--- a/docs/COGNITIVE-RUNTIME.md+++ b/docs/COGNITIVE-RUNTIME.md@@ -95,7 +95,7 @@ P1 keeps the two proven planes but upgrades stable agent memory from untyped Mar- **Markdown compatibility projection** — `USER.md` / `MEMORY.md` remain the resolved materialized view consumed by older CLI/session code. Existing installations are read unchanged; the first structured mutation seeds the ledger from legacy `## key` sections instead of deleting or rewriting history.- **Experience memory** — verified workflow trajectories remain client-scoped and now accumulate P1 quality telemetry: completed/failed/denied/rate-limited/invalid-argument steps, retries, rollback/restore evidence and timed-step latency.-Resolution is deterministic at a requested timestamp: only effective claims participate, then authority (`explicit > observed > inferred > migration`), confidence, observation recency, creation recency and stable id break ties. `mode=replace` supersedes the currently resolved claim from its `valid_from`; `mode=claim` keeps parallel evidence so disagreement remains inspectable. A future replacement therefore does **not** erase the fact that is still valid today.+Resolution is deterministic at a requested timestamp: only effective claims participate, then authority (`explicit > observed > inferred > migration`), confidence, observation recency, creation recency and stable id break ties. `mode=replace` supersedes the currently resolved claim from its `valid_from`; `mode=claim` keeps parallel evidence so disagreement remains inspectable. A future replacement therefore does **not** erase the fact that is still valid today. `agent_memory_forget` retracts every matching claim that can still become effective now or later, so a scheduled future value cannot resurrect after a forget request; already-finished historical evidence is left unchanged and remains visible only through explicit history retrieval.`agent_memory_search` is the model-facing typed retrieval surface. Normal reads return resolved claims plus conflict evidence; `include_history=true` is explicit because superseded/retracted material should not silently bloat context. MCP provenance stores only a short SHA-256 digest of the internal durable session id—not the raw OpenAI conversation id or bearer identity. New sessions still freeze the resolved Markdown snapshot, so memory cannot mutate underneath an active session.@@ -106,6 +106,7 @@ Run:```bashbun run bench:cognitive # routing/schema + typed-memory gatesbun run bench:memory # deterministic retrieval/temporal/conflict suite+bun run bench:memory:calibration -- --corrections 200 # repeated-correction/privacy/context calibration in isolated temp memorybun run bench:quality -- --live # learned workflow success + P1 telemetry coveragebun run bench:agents -- --provider openai-codex --model gpt-5.6-terra # one-task smoke planbun run bench:corpus -- --provider openai-codex --model gpt-5.6-terra # nine-task dry plan@@ -348,6 +349,24 @@ Combining the raw P7 two-run artifact and raw P8 three-run artifact gives a five5. **Move next to memory calibration** — test P1 authority/confidence/temporal/correction policies against real repeated corrections before considering graph-memory complexity.6. **Keep benchmark → engineering feedback closed-loop** — when a fixture exposes deterministic tool/routing/accounting waste, fix the system and rerun the same objective gate rather than prompting harder.+## P9 memory calibration: repeated corrections, temporal forget, and bounded context++P9 calibrates the existing P1 typed-memory ledger against correction sequences instead of adding a new memory architecture. The benchmark uses a temporary isolated `OS_AGENT_MEMORY_DIR`, never the operator's real memory. Six deterministic scenarios cover: explicit-user authority over newer observations, confidence before recency within equal authority, future replacement boundaries, forget across scheduled future claims, preservation of already-finished history, and repeated replacements with bounded resolved context.++The calibration exposed one real privacy/temporal defect. `forgetAgentMemory` previously retracted only claims effective **at the instant of the forget**. A future-scheduled replacement was therefore left untouched and could become visible later. P9 adds an interval-intersection guard: forget now retracts any matching claim whose validity interval can still intersect `now..∞`, while records whose effective interval already ended remain immutable historical evidence. The regression reproduces the old `[] now → ["Singapore"] later` resurrection and requires `[] → []` after the fix.++The final P9 stress run from implementation source `d249da4` uses **200 successive replacements** of one key plus the five authority/temporal/privacy scenarios. Result: **6/6 calibration scenarios pass**, deterministic resolution remains true, the existing `bench:memory` suite stays **8/8 / 100%**, and `bench:cognitive` retains **100% memory retrieval/temporal/conflict gates**. The 200-correction ledger contains **200 records / 135,180 bytes**, while the default compatibility projection contains **1 resolved record / 58 bytes** — **99.96% smaller**. Explicit history retrieval remains capped at **100 rows** even though the ledger contains 200 records.++That result does **not** prove that graph memory is never useful. It does show that repeated corrections, authority, conflict and temporal validity do not currently require graph complexity: the keyed ledger keeps model-active context bounded while retaining audit history. `graphMemoryRequiredByCalibration=false` therefore means only “no calibrated fixture requires it,” not a universal architecture verdict.++## P9 next direction++1. **Keep graph memory evidence-gated** — add relationship/multi-hop storage only after a real retrieval task fails the keyed ledger and a benchmark shows the graph fixes that failure without unacceptable context/tool cost.+2. **Calibrate retention before the hard ledger caps matter** — repeated corrections grow durable history even though model context stays flat. Design archival/compaction around the existing 2,000-record / 2 MiB limits without silently deleting provenance.+3. **Measure production correction patterns without recording content in telemetry** — track counts/depth/conflict/retraction rates so retention work is driven by real usage rather than synthetic scale.+4. **Preserve frozen-session semantics** — new sessions capture the latest resolved snapshot; an active session must not silently change because persistent memory changed elsewhere.+5. **Benchmark semantic recall only if lexical retrieval becomes the bottleneck** — do not add embedding/vector infrastructure merely because it is available.+## Security notes- Session archives are private backups, not secret vaults; recursive redaction happens before compression.diff --git a/docs/PROGRESS.md b/docs/PROGRESS.mdindex 653f0d51..31663734 100644--- a/docs/PROGRESS.md+++ b/docs/PROGRESS.md@@ -1,4 +1,11 @@# mso — Progress Log+## 2026-09-03 — Cognitive Runtime P9 memory calibration++- **Repeated-correction calibration instead of graph expansion:** added `bench:memory:calibration`, which runs only against an isolated temporary agent-memory root and exercises explicit authority, confidence/recency, future replacement, forget semantics, finished-history integrity and deep repeated corrections.+- **Future-memory resurrection fixed:** `agent_memory_forget` previously retracted only claims effective at the current instant, allowing a scheduled future replacement to reappear later. Forget now retracts every matching claim whose interval can still become effective now/future while leaving already-ended historical evidence unchanged.+- **Bounded context under correction depth:** the final 200-correction stress run from source `d249da4` passed **6/6 deterministic scenarios**. The ledger reached **200 records / 135,180 bytes**, but the compatibility snapshot stayed **1 resolved record / 58 bytes (99.96% smaller)** and explicit history retrieval remained capped at 100 rows. Existing `bench:memory` stayed 100% and the full Cognitive Runtime memory gates stayed 100%.+- **Graph memory remains deferred by evidence:** P9 found no authority/conflict/temporal/repeated-correction task that needs a graph. Future graph or vector complexity must first solve a reproduced retrieval failure; next memory work should focus on real correction telemetry and retention/archival before the 2,000-record / 2 MiB ledger caps.+- **Fresh 3 completion / scanner-clean contract (2026-09-03):** server `1.8.1` / toolset `2026.09.03.6` keeps the 62-action Fresh 3 surface unchanged while closing the post-refresh metadata gaps. Every ChatGPT action now advertises `outputSchema`; dynamic actions share one DRY bounded `{ result }` envelope instead of 57 duplicated hand schemas, keeping the profile at 64,180 bytes (~16.0k rough tokens). Four MCP Apps now declare the dedicated sibling widget origin `https://mso-ui.rahmanef.com` (Traefik config in `ops/traefik/mso-ui.yml`), and the OpenAI/MCP skills extension publishes five official, digest-verified `claude-skills/` snapshots through `skills/list`, `skills/get`, and `resources/read`. Generic MCP clients retain the prior text-only result behavior unless a tool already had explicit structured output.- **Fresh 3 capability-max release (2026-09-03):** server `1.8.0` / toolset `2026.09.03.5` restores Original MSO bounded VPS/system/filesystem/app/browser/infra operations to the ChatGPT profile while preserving Fresh 3 workflow/session/Local Agent/read-pipeline/project-MCP orchestration. The ChatGPT transport profile is now 62 tools (61 model actions + app-only `workflow_status`) at 57,853 descriptor bytes (~14.5k rough tokens), while the full model/operator catalog grows to 85 tools. New Lovable-inspired surfaces add `project_get`, Git history/diff, `.mso/KNOWLEDGE.md`, safe connection inventory, private `project_agent_run`/`project_agent_status`, and MCP Apps project/diff/VPS cards. Convex is first-class through the project-installed official Convex MCP CLI with projectDir override stripping, cross-project selector refusal, dynamic schemas, and no automatic dangerous production flags.diff --git a/docs/TESTING-HANDOFF.md b/docs/TESTING-HANDOFF.mdindex 2488651c..37cab39a 100644--- a/docs/TESTING-HANDOFF.md+++ b/docs/TESTING-HANDOFF.md@@ -4,12 +4,14 @@ Update this file at the end of every manual or automated test session. Keep it f## Current status-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.+The current release target is **MSO CLI 1.12.0**, MCP server `1.8.1`, toolset `2026.09.03.6`; 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:+- Fresh 3 current MCP contract: server `1.8.1` / toolset `2026.09.03.6`; ChatGPT receives **62 transport tools = 61 model/operator actions (32 read / 17 write / 12 exec) + app-only `workflow_status`**, while the full transport catalog is 86 tools / 85 model tools. Every ChatGPT action advertises `outputSchema`, the dedicated MCP Apps widget origin is `https://mso-ui.rahmanef.com`, and five official digest-verified Skills are exposed through the MCP Skills/resource extension.+- P9 memory calibration: isolated temporary-memory fixtures now cover repeated corrections, explicit-vs-observed authority, confidence/recency, future validity, forget, and history integrity. P9 fixed a real temporal privacy bug where `forget` could leave a future-scheduled claim that resurrected later; forget now closes all current/future-capable intervals while preserving already-ended history. Final 200-correction stress from source `d249da4`: **6/6 calibration scenarios**, existing memory benchmark **100%**, Cognitive Runtime memory gates **100%**; 200 ledger rows / 135,180 bytes resolve to 1 row / 58-byte compatibility projection (**99.96% smaller**) and history retrieval remains capped at 100. No calibrated case requires graph memory.- P8 calibration: repeat aggregation now reports descriptive per-run spread without inferential claims; three new complete nine-scenario runs from source `51ae31f` were **27/27 task + 27/27 scenario-policy and 3/3 perfect runs for both agents**, with 54/54 row identity/provider/model/token-arithmetic checks passing. Combined with P7, both agents are **5/5 perfect**; five-run means are MSO vs Hermes 16,907.6 vs 66,791.1 normalized tokens/attempt (~74.7% lower for MSO), 18,985.9 vs 21,779.8 ms average latency, and 14,130.8 vs 21,457.2 ms per-run p50. New `bench:cache-calibration` final 4-round/12K-prefix run was 8/8 success; MSO cache-read was zero on 4/4 while Hermes naturally reported positive cache reads on 2/4 (9,728 + 19,968), but cache frequency is unranked because request envelopes differ. P8 also fixes false token non-comparability when independently valid normalized proof shapes vary across cache/no-cache rows. Cost remains non-comparable because attribution is asymmetric.- 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.+- Historical MCP 1.7 hardening baseline: ChatGPT was 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`.- P4 `bench:corpus` uses six seeded, per-agent isolated 0700 scratch scenarios, exact scenario-tree scoring (`policyObservationScope=scenario-tree`, not whole-host sandbox proof), and rotating scenario-major runner order. The reproduced full provider+model-matched MSO↔Hermes run on `openai-codex/gpt-5.6-terra` is 6/6 task + 6/6 scenario-observable policy for both; MSO measured 10,759.5 ms average / 10,646.5 ms p50 versus Hermes 14,624 ms / 14,304.5 ms. This is a bounded corpus tie-break, not an overall-product claim. Token/cost accounting remains explicitly non-comparable and is not a ranking input; OpenClaw is unranked until an equivalent model/provider path exists.