Skip to content

Midas 1.0.0 — control-plane, trust, and adoption power-up - #17

Merged
vornicx merged 11 commits into
mainfrom
claude/midas-issue-15-3wlmof
Jul 6, 2026
Merged

vornicx merged 11 commits into
mainfrom
claude/midas-issue-15-3wlmof

Conversation

@vornicx

@vornicx vornicx commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Numbered into 1.0.0 (2026-07-06). main shipped a 1.0.0 semver-freeze while this PR was open. Since 1.0.0 hasn't been published to PyPI/npm yet, this batch is folded into the single 1.0.0 release rather than shipped as a separate minor (5dbe633). The merge itself was clean — code auto-merged; only the version/changelog files conflicted. CHANGELOG is now one [1.0.0] — 2026-07-06 section (contract paragraph reworded to reflect that 1.0.0 genuinely adds the control-plane/audit-chain/tooling, not just consolidates). Merged tree: 336 passed / 5 skipped, ruff clean, midas.__version__ == 1.0.0.

The full power-up batch, in the order agreed: quick wins → the differentiating control-plane → trust → adoption — plus the follow-up backlog (bench the new features, inspector views, TS parity, Claude Code hook, Mem0/Zep import, encryption at rest, the inspector redesign).

Highlights (each phase self-contained)

  1. Quick wins — 4 new midas init clients (VS Code servers key, Gemini CLI, Cline, Zed context_servers); midas serve --http --token / MIDAS_MCP_TOKEN bearer auth (constant-time; the HTTP transport was previously open to any local process); CI on Windows + macOS; midas doctor --json.
  2. Control-planeresume (one-call session-onboarding pack, token-budgeted), memory_conflicts (live contradictions with neither side superseded — NLI when available, same-slot heuristic otherwise; ranked candidates, never auto-resolved), open loops (remember_commitment/open_loops/close_loop), per-kind TTL retention (MIDAS_MCP_TTL). Agent policy now starts sessions with resume.
  3. Trust — tamper-evident hash-chained audit_log in SQLiteStore (hashes only, never content); midas audit [--json]; doctor checks chain integrity.
  4. Adoptionmidas import --from claude-md|cursorrules|jsonl|mem0|zep (governance-safe provenance defaults); TS port gains local ONNX semantic embeddings (LocalEmbedder, optional @huggingface/transformers, announced fallback; async Memory API).
  5. Bench + inspector — Agent Continuity Bench grows resume_fidelity, conflict_detection, conflict_precision (all → 1.00, in the midas bench verdict); inspector gains Conflicts / Open loops / Audit log views.
  6. TS parity — continuity control-plane + audit chain in the TypeScript port; the audit hash is canonicalised (integer microseconds) so each runtime verifies chains written by the other (validated bidirectionally).
  7. Closersmidas init --claude-hook (SessionEnd auto-capture, fail-open, policy-gated); encryption at rest via SQLCipher (MIDAS_MCP_KEY + [encrypted] extra, fails closed; ciphertext verified on disk).
  8. midas inspect redesigned end to end — a real light theme, a fixed/validated categorical color system consistent across every view, real charts (30-day activity + recency), a command palette (⌘K), in-app modals/toasts, responsive to phone width; fixed a real hashchange routing bug in the process. Verified with Playwright across views/themes/mobile.

Tests

  • Python: 336 passed, 5 skipped on the merged tree.
  • TypeScript: 20/20 (conflicts, loop lifecycle, resume budget, audit tamper detection, cross-runtime chain interop).
  • midas bench: all green ✓ including the three new continuity axes.

Publishing note

Versions are 1.0.0 (PyPI midas-memory, npm midas-memory-mcp, server.json / mcpb manifest) but publishing needs maintainer credentials — after merge: python -m build && twine upload and npm publish from packages/midas-ts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4

claude added 8 commits July 5, 2026 02:27
…doctor --json

- `midas init` now wires VS Code (user mcp.json, `servers` key), Gemini CLI,
  Cline, and Zed (`context_servers`), each with its own config schema;
  status/uninstall understand the per-client server-map keys too.
- `midas serve --http` accepts MIDAS_MCP_TOKEN / --token: a constant-time
  bearer-token ASGI gate, since the HTTP transport otherwise exposes the whole
  store to any local process.
- CI runs the core+MCP suite on Windows and macOS (the client-wiring code is
  full of per-OS paths that only Linux exercised).
- `midas doctor --json` emits the same machine-readable envelope as the wiring
  receipt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…ention

- midas/continuity.py — three primitives similarity search can't express:
  * memory_conflicts: live beliefs that contradict each other with neither
    superseding the other (the multi-agent shared-memory failure mode). NLI-
    scored when available; else a same-slot heuristic (value swap on a shared
    frame, numbers disagree, one side negates). Ranked candidates only —
    nothing is resolved silently.
  * open loops: kind="commitment" records a promise, close_loop supersedes it
    with its resolution, open_loops lists what's still unclosed (oldest first).
  * resume: the one-call session-onboarding pack — pinned directives,
    forbidden rules, what changed, current state, open loops, conflicts —
    token-budgeted and prompt-ready.
- Memory.forget_expired(ttl_by_kind) + MIDAS_MCP_TTL / maintain(ttl=...):
  age-based per-kind retention; user-confirmed, standing, and supersession-
  chain records never expire silently.
- MCP tools: resume, memory_conflicts, open_loops, remember_commitment,
  close_loop; agent instructions now start sessions with resume and keep
  promises via open loops.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
Every SQLite mutation (put / delete / clear — so remember, supersede, and
forget) appends an entry to an append-only audit_log table: seq, timestamp,
op, record id, a sha256 of the record's audited state, and a hash chained
over the previous entry. Editing, removing, or reordering ANY past entry
breaks every hash after it. Entries carry hashes only — never memory content,
preserving the receipt/audit boundary.

- SQLiteStore.audit_log() / verify_audit_log(); audit=False opt-out for
  perf-sensitive paths. Additive table: older Midas versions still open the
  file.
- `midas audit [--limit N] [--json]` shows the tail and verifies the chain
  (exit 1 + first_invalid_seq when broken).
- `midas doctor` now checks chain integrity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…ntic embeddings

- midas/importers.py + `midas import --from …`: file-based agent memory
  (CLAUDE.md, .cursorrules, exported JSONL) becomes first-class Midas records —
  bullets/paragraphs parsed per item with heading context, fenced code skipped,
  idempotent re-runs, and governance-safe defaults (observation provenance;
  imported rules can't authorize guarded actions unless --confirmed).
- TypeScript port: LocalEmbedder — local ONNX semantic embeddings (bge-small,
  384d) via the optional @huggingface/transformers behind
  MIDAS_MCP_EMBEDDER=local, with an announced fallback to the byte-parity
  hashing embedder when the package is absent. The TS Memory API is now async
  (remember/capture/recall/buildContext/forgetMatching), verified end-to-end
  (paraphrase recall 0.731 vs 0.491 noise). 14/14 TS tests pass.
- CHANGELOG for the whole batch; README updates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…tamper test

The new macOS/Windows jobs caught exactly what they exist for — in the tests:
- VS Code/Zed/Claude Desktop resolve OS-specific roots (macOS Library/,
  Windows %APPDATA%) that ignore a patched Path.home(), so the client-wiring
  tests looked in the wrong place off-Linux (and could have touched a
  runner's real configs). A _sandbox_client_paths helper now pins every
  lookup into tmp_path on all three OSes.
- test_tampering_breaks_the_chain rewrote the sha's first hex char to 'f' —
  a 1/16 no-op (hit on the Windows runner). Tamper the op field instead,
  which is always a real change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…licts, loops, audit chain

- Agent Continuity Bench grows three axes, all deterministic and $0:
  resume_fidelity (the one-call pack contains live state / forbidden rules /
  open loops and never presents superseded values or closed loops as live),
  conflict_detection (every planted live-live contradiction found), and
  conflict_precision (no benign look-alike flagged). All → 1.00; wired into
  `midas bench` / eval.benches with the same all-green verdict rule.
- Inspector: three new glass-box views + pure API endpoints — Conflicts
  (ranked pairs with per-side forget), Open loops (close with a recorded
  resolution), Audit log (chain verification + hash-only tail). Conflict
  similarity is cast to float at the source so every JSON consumer works.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…ind TTL

- packages/midas-ts/src/continuity.ts — resume (one-call onboarding pack),
  memoryConflicts (heuristic tier: value swap / numeric drift / negation),
  and open loops (rememberCommitment / openLoops / closeLoop), exposed as
  MCP tools and SDK exports; "commitment" added to the TS MemoryKind.
- SQLiteStore writes the same hash-chained audit_log as Python. The hash
  formula is canonicalised to integer microseconds on BOTH sides (float
  FORMATTING differs across runtimes; IEEE multiply+floor doesn't), verified
  bidirectionally: Python validates TS-written chains and vice versa.
- Memory.forgetExpired + parseTtlSpec + maintain(ttl=…) / MIDAS_MCP_TTL.
- 20/20 TS tests (6 new: conflicts, loop lifecycle, resume budget, chain
  tamper detection, audit opt-out).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
…r at rest; release 0.2.0

- `midas init --claude-hook` installs a Claude Code SessionEnd hook
  (`midas hook capture-session`): each finished session's user turns are
  OFFERED to capture — the no-LLM policy still decides what's kept. Fail-open
  (a memory hook must never break a session), idempotent install/uninstall
  into ~/.claude/settings.json with backup; removed by `midas uninstall`.
- `midas import --from mem0|zep`: Mem0 distilled memories → facts (original
  ids/user/agent attribution preserved in metadata); Zep facts/edges → facts,
  messages → chat turns. Tolerant of the wrapped and bare-list export shapes.
- Encryption at rest (opt-in): SQLiteStore(key=…) / MIDAS_MCP_KEY via the new
  [encrypted] extra (SQLCipher). Ciphertext on disk (verified: no plaintext,
  no SQLite header), wrong/no key can't read, audit chain works under
  encryption, and a set key without the extra FAILS CLOSED.
- Release prep 0.2.0: version bump (pyproject, __init__, npm package + MCP
  handshake), dated CHANGELOG covering the whole batch; Linux CI now installs
  [encrypted] so those tests run (they skip where wheels are absent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
@vornicx vornicx changed the title Power-up batch: quick wins → continuity control-plane → audit chain → adoption Midas 0.2.0 — control-plane, trust, and adoption power-up (8 commits) Jul 5, 2026
claude added 2 commits July 6, 2026 04:19
…ystem

The inspector had one problem underneath its polish: every kind, every
provenance, every signal rendered in the same monochrome gold accent, so a
glass-box tool for governed memory couldn't be visually parsed at a glance.
And it was dark-only, had no real charts, used native confirm()/prompt(),
and its hash router never listened for hashchange (back/forward and direct
links silently did nothing).

- Fixed categorical color system: kind and provenance each get a
  consistent, validated color (colorblind-safe contrast/separation checked
  in both themes) used identically across every view — Overview bars,
  Browse tags, Project governance, Conflicts. Status color (good/warning/
  critical) reserved separately for verdicts/chain-integrity/conflicts, so
  a revision reads as "normal lifecycle" (amber) not "error" (red).
- A real second theme: light, deliberately designed (not an inverted
  dark), toggle + system-preference default + persisted choice.
- Real charts: a 30-day activity line/area chart with a hover crosshair +
  tooltip, and a recency (short/medium/long) stacked bar — backed by two
  new pure API functions, api_timeseries and api_meta (plus by_tier added
  to api_overview).
- Native confirm()/prompt() replaced with in-app modal + toast components;
  grouped nav (Memory/Coding/Governance) with live badge counts; a command
  palette (Cmd/Ctrl-K) and "/" search shortcut; responsive down to phone
  width with a horizontal pill nav.
- Fixed the hashchange bug (the router only ran once, at load) and two
  real API-shape bugs the fixes surfaced under interaction testing:
  api_conflicts/api_loops return bare lists (the code assumed a
  {count,...} envelope) and the forget receipt's key is content_sha256
  (the code read content_sha).

Verified with Playwright end-to-end (not just screenshots): forget with
modal confirm, close-loop with a resolution textarea, theme toggle,
command-palette keyboard nav, "/" focus, and browser back/forward through
the hash router — all against a seeded demo store, in both themes and a
mobile viewport, zero console/page errors. 336 tests pass, ruff clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
main jumped straight to a 1.0.0 semver-freeze release while this branch was
open, so the branch (cut from the pre-1.0 base) conflicted. Reconcile by
merging main in — code auto-merged cleanly; the only conflicts were the
version/changelog files — and renumbering the batch from the pre-release
0.2.0 to 1.1.0, the correct minor on top of 1.0.0 (all additive, no breaks).

- pyproject / __init__ / midas-ts package.json + lock / mcp.ts handshake /
  mcpb manifest / server.json: all 1.1.0 (the `forwarded` dep's own 0.2.0 in
  the lockfile is left untouched).
- CHANGELOG: the batch + inspector redesign become [1.1.0] — 2026-07-06,
  above main's [1.0.0]; nothing dropped or duplicated.

Merged tree: 336 passed, 5 skipped; ruff clean; midas.__version__ == 1.1.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
@vornicx vornicx changed the title Midas 0.2.0 — control-plane, trust, and adoption power-up (8 commits) Midas 1.1.0 — control-plane, trust, and adoption power-up Jul 6, 2026
…ease)

1.0.0 hasn't been published yet, so instead of shipping this batch as a
separate 1.1.0 on top, fold it into the one comprehensive 1.0.0 release.

- All own-version references back to 1.0.0 (pyproject, __init__, midas-ts
  package.json + lock own-version lines, mcp.ts handshake, mcpb manifest,
  server.json); the lockfile's `forwarded` dependency version is untouched.
- CHANGELOG: [1.1.0] folded into a single [1.0.0] — 2026-07-06; the contract
  paragraph reworded (this release now genuinely adds the control-plane,
  audit chain, and tooling, not just consolidates), Added/Changed/Security
  merged with nothing dropped or duplicated.

Merged tree: 336 passed, 5 skipped; ruff clean; midas.__version__ == 1.0.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
@vornicx vornicx changed the title Midas 1.1.0 — control-plane, trust, and adoption power-up Midas 1.0.0 — control-plane, trust, and adoption power-up Jul 6, 2026
@vornicx
vornicx merged commit 5dbe633 into main Jul 6, 2026
4 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