Add a machine-readable client wiring receipt: midas init/status --json - #16
Merged
Merged
Conversation
#15) One command now yields a compact, pasteable proof of what was wired and where: per client its config path, detected/wired/changed state, backup path and skip reason; plus the memory DB, scope mode, server command, embedder, and the enforced policy. `status --json` parses each client config (JSON mcpServers and codex TOML) to report the actual command + MIDAS_* env every client will launch with, and warns when clients disagree on namespaces. Config paths and scope/policy only — never memory contents. Human output of both commands is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
What
midas init,midas init --dry-run, andmidas statusnow take--json, emitting a compact machine-readable client wiring receipt instead of the text UI (which stays byte-identical without the flag).{ "midas_version": "0.1.1", "receipt_kind": "client_wiring", "generated_at": "2026-07-04T18:41:36Z", "memory_db": "/home/user/.midas/memory.sqlite3", "scope_mode": "shared", "namespace": null, "server_command": "midas-mcp", "embedder": "local", "policy": { "recall_first": true, "capture_enabled": true, "min_importance": 2, "dedup_threshold": 0.95, "external_or_destructive_actions_require_check_memory_use": true }, "clients": [ {"client": "Claude Code", "config_path": "/home/user/.claude.json", "detected": true, "wired": true, "server_command": "midas-mcp", "client_id": "claude-code", "namespace": null, "reason": null}, {"client": "Cursor", "config_path": "/home/user/.cursor/mcp.json", "detected": false, "wired": false, "server_command": null, "client_id": null, "namespace": null, "reason": "config not found"} ], "warnings": [], "store": {"exists": true, "records": 12, "live": 11, "size_kb": 96} }How
init --jsonreports, per client:config_path,detected,wired,changed,backup_path,reason— including clients that were skipped (CLI not installed, config not found) instead of silently omitting them. Dry runs are marked"dry_run": true, never change anything, and carry the planned action inreason.status --jsongoes beyond the substring check: it parses each client config (JSONmcpServers, and codex TOML viatomllib) and reports the actualcommand+MIDAS_*env that client will launch with — so the receipt states which memory/scope every configured client got, not just "wired". OnlyMIDAS_*env keys are surfaced, keeping anything else a user added out of the artifact.scope_mode(shared/project-scoped/manual-namespace) is derived from the wired clients' namespaces; disagreeing clients produce"mixed"plus an explicit warning rather than being hidden.Tests
tmp_path) init that wires Cursor and then proves the same wiring back throughstatus --json(the issue's one-command invariant); codex TOML parsing; the missing-store warning; and all_derive_scopebranches.283 passed, 5 skippedacross the full suite; human output ofinit/statusverified unchanged; ruff clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Deray2qcPRy1hZVQnboHp4
Generated by Claude Code