Skip to content

feat: implement grip object model CLI (grip#606)#728

Open
laynepenney wants to merge 1 commit into
mainfrom
impl/grip-object-model-phase0
Open

feat: implement grip object model CLI (grip#606)#728
laynepenney wants to merge 1 commit into
mainfrom
impl/grip-object-model-phase0

Conversation

@laynepenney
Copy link
Copy Markdown
Member

Summary

  • Bridge grip_cli.py to match TDD spec contract in test_grip_object_model.py (14 tests, all previously failing)
  • Auto-discover repos from workspace_spec.toml when --repos not provided
  • Add JSON index layer at .grip/snapshots/index.json for O(1) lookup alongside git plumbing storage
  • Dirty-repo blocking for snapshot and checkout commands
  • Track detached HEAD state and empty repos in snapshot metadata

Details

The existing test_grip_snapshot.py (35 tests) tested the library API directly and all passed. The test_grip_object_model.py (14 tests) tested through the CLI via typer CliRunner and expected a different interface:

  1. Repo auto-discovery from workspace_spec.toml (not --repos required)
  2. JSON index storage at .grip/snapshots/index.json
  3. Snapshot entries with id, message, repos, repo_states containing head, head_state, is_empty
  4. Dirty-repo blocking for both snapshot and checkout
  5. Clean error messages for missing .grip/ state

This implementation reconciles both contracts: keeps git plumbing internally (content-addressable), adds JSON index as a view layer, makes --repos optional with workspace_spec fallback.

Test plan

  • All 14 test_grip_object_model.py tests pass (previously 0/14)
  • All 23 test_grip_cli.py tests pass (no regressions)
  • All 35 test_grip_snapshot.py tests pass (no regressions)
  • Full gr2 test suite: 471 passed, 0 failed
  • ruff lint clean
  • cargo fmt clean

Premium boundary: core OSS (workspace orchestration, git plumbing).

Closes #606

🤖 Generated with Claude Code

Bridge grip_cli.py to match TDD spec contract in test_grip_object_model.py:
auto-discover repos from workspace_spec.toml, add JSON index layer at
.grip/snapshots/index.json, block on dirty repos, track detached HEAD
and empty repo states. Internal storage stays git plumbing.

Closes #606

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Phase 0: gr grip snapshot/log/diff/checkout

1 participant