smriti/cli/tests
Himanshu Dongre 68b3b51661 Attach projects to spaces so sessions stay connected automatically
Smriti previously required passing <space> on every command, and the
repo↔space binding lived only inside a hardcoded SessionStart hook
string. This makes the binding durable and ambient.

- New cli/smriti_cli/attachment.py reads/writes `.smriti.json` at the
  repo root — a committed file that binds the repo to a space and
  travels with it (repo A→space A, repo B→space B).
- The <space> positional is now optional on state, current, metrics,
  checkpoint create/list, claim create/list, and worktree open/list.
  When omitted it resolves from the nearest `.smriti.json`, walking up
  from the working directory, so any session opened inside the repo
  stays connected without re-passing the space.
- `smriti init` writes `.smriti.json` and binds the space's backend
  project_root to the checkout. The generated SessionStart hook is now
  space-less (`smriti state --compact`) — identical across every
  project and stable when a project is re-attached.
- New `smriti status` command: a day-two continuity check showing the
  attachment, backend health, and open work.
- CLI api_url also resolves from the attachment as a last-resort
  default, behind --api-url and SMRITI_API_URL.

MCP tool signatures are intentionally unchanged this sprint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 00:10:50 +05:30
..
__init__.py Add mcp dependency and pytest harness skeleton 2026-04-12 00:46:34 +05:30
conftest.py Add MCP server wrapping all CLI commands as 12 tools 2026-04-12 00:54:40 +05:30
test_attachment.py Attach projects to spaces so sessions stay connected automatically 2026-05-19 00:10:50 +05:30
test_branch_close.py Add CLI and MCP tests for branch close 2026-04-13 13:37:06 +05:30
test_current_cli.py Polish external validation output and docs 2026-05-17 12:15:14 +05:30
test_doctor_cli.py Make doctor runtime checks external-project aware 2026-05-17 19:16:56 +05:30
test_init.py Attach projects to spaces so sessions stay connected automatically 2026-05-19 00:10:50 +05:30
test_mcp_server.py Add skills CLI subcommand and smriti_install_skill MCP tool 2026-04-12 02:10:16 +05:30
test_metrics_cli.py Clarify claim completion metrics 2026-05-18 00:07:42 +05:30
test_quickstart.py Polish external validation output and docs 2026-05-17 12:15:14 +05:30
test_skill_pack.py Add local-first setup onboarding 2026-05-16 22:39:38 +05:30
test_smoke.py Add mcp dependency and pytest harness skeleton 2026-04-12 00:46:34 +05:30
test_space_cli.py Add canonical project root for spaces 2026-05-04 13:43:44 +05:30
test_state_multi_branch.py Render list-valued blocked_by consistently in state --compact 2026-05-18 00:02:07 +05:30
test_worktree_cli.py Populate worktree list probe columns 2026-05-04 12:52:35 +05:30
test_worktree_mcp.py Populate worktree list probe columns 2026-05-04 12:52:35 +05:30