Skip to content

test: gr2 native add/commit/push failing tests (grip#752 slice 1 follow-up)#762

Merged
laynepenney merged 1 commit into
sprint-39from
test/gr2-add-commit-push
Jul 7, 2026
Merged

test: gr2 native add/commit/push failing tests (grip#752 slice 1 follow-up)#762
laynepenney merged 1 commit into
sprint-39from
test/gr2-add-commit-push

Conversation

@laynepenney

Copy link
Copy Markdown
Member

Summary

TDD spec completing D3 slice 1's remaining daily verbs (branch already merged in #757/#761). Ref #752 (partial -- slice 1 complete once this and its implementation land).

20 tests, all fail correctly right now: ModuleNotFoundError on gr2.python_cli.{add,commit,push}, "No such command" for each new CLI verb. Full suite otherwise unaffected -- 511 pre-existing tests untouched, these 20 are net-new red.

add -- grip#754's root cause, structurally eliminated

gr1's add stages files via multi-repo path attribution (a gripspace-relative path has to be matched to the right repo before git add ever runs), and blanket-treats any stderr containing "did not match any files" as "not in this repo" -- which is what fired on a genuinely valid, real, untracked file (reproduced twice, different sessions, identical wording). gr2's cwd-repo-scope default removes the attribution step entirely: with exactly one target repo, "is this path in this repo" is answered by checking the path resolves under repo root, not by parsing git's stderr text. A path that really doesn't exist gets reported precisely (missing); anything else that makes git add fail is a real error (AddError), never a silent skip.

commit

Mirrors gr1's has_staged_changes + create_commit shape closely -- nothing staged raises clearly (CommitError) rather than silently no-op'ing, --amend keeps a single commit and updates the message.

push

Mirrors gr1's has_commits_to_push heuristic, simplified for a single-repo target: no remote-tracking branch yet -> attempt the push (git itself reports "up to date" gracefully if there's truly nothing to push -- the right default for gr2's simpler single-repo model, vs. gr1's manifest-aware default-branch resolution which gr2 doesn't have or need); remote-tracking branch exists -> compare ahead/behind, skip cleanly if not ahead; diverged history fails without --force (PushError), succeeds with it.

test_gr2_push_defaults_to_cwd_repo_scope is grip#755's finding as an executable negative -- the bug that started this whole scope-default investigation, now permanently guarded against regressing.

Consistency

All three verbs wired as --repo-path (not --repo, per Opus's #757 review) with cwd-repo-scope default, matching branch and the now-ratified gr2 product canon (one mental model across all four daily verbs).

Premium boundary

OSS (grip is OSS; CLI daily-verb orchestration -- no identity/org semantics).

Reviewers

@Opus + Atlas, same pair for continuity across this slice.

…ow-up)

TDD spec for the remaining D3 slice 1 daily verbs. 20 tests, all fail
correctly right now (ModuleNotFoundError on gr2.python_cli.{add,commit,push};
"No such command" for each CLI verb). Full suite otherwise unaffected
(511 pre-existing + these 20 net-new red).

add (grip#754 root cause, structurally eliminated not just patched): gr1's
add stages files via multi-repo path attribution -- a gripspace-relative
path has to be matched to the right repo before git add ever runs -- and
blanket-treats any stderr containing "did not match any files" as "not in
this repo," which is what fired on a genuinely valid untracked file
(reproduced twice, different sessions, same wording). gr2's cwd-repo-scope
default removes the attribution step entirely: with exactly one target
repo, "is this path in this repo" is answered by checking the path
resolves under repo root, not by parsing git's stderr text. A path that
really doesn't exist gets reported precisely; anything else that makes
git add fail is a real error (AddError), never a silent skip.

commit: mirrors gr1's has_staged_changes + create_commit shape closely --
nothing staged raises clearly (CommitError) rather than silently no-op'ing,
amend keeps a single commit and updates the message.

push: mirrors gr1's has_commits_to_push heuristic, simplified for a
single-repo target -- no remote-tracking branch yet -> attempt the push
(git itself reports "up to date" gracefully if there's truly nothing,
correct default for gr2's simpler single-repo model vs gr1's manifest-aware
default-branch resolution); remote-tracking branch exists -> compare
ahead/behind, skip cleanly if not ahead; diverged history fails without
--force (PushError), succeeds with it. test_gr2_push_defaults_to_cwd_repo_scope
is the grip#755 finding as an executable negative -- the bug that started
this whole scope-default investigation, now permanently guarded against
regressing.

All three verbs wired as --repo-path (not --repo, per Opus's #757 review)
with cwd-repo-scope default, consistent with branch and now-ratified gr2
product canon.

Ref #752 (partial -- slice 1 complete once this + its implementation land).

Premium boundary: OSS (grip is OSS; CLI daily-verb orchestration, no
identity/org semantics).
@laynepenney

Copy link
Copy Markdown
Member Author

Review (Opus): APPROVE. All 20 tests read and verified discriminating: the #754 conflation is structurally dead (missing = direct path-resolution check with a precise .missing list, outside-repo pathspec = AddError — never a silent "not in this repo" skip), partial staging reports rather than all-or-nothings, commit pins nothing-staged as a clear error at both library and CLI tiers, and push's up-to-date case is a clean skip with a reason, not an error. The #755 executable negative is the strictest possible form — repo_b's bare remote never even receives a ref (rev-list raises). Scope canon consistent across all three verbs.

Two impl-decision notes to declare (not change) in the implementation PR body:

  1. CLI exit code for missing paths: the spec pins library behavior (.staged/.missing) but not what gr2 add ghost.txt exits with — report-and-zero vs nonzero. Pick one and say why.
  2. force semantics: consider implementing --force as --force-with-lease under the hood — the diverged-history test remains compatible (the tracking ref matches the remote at test time), and lease is the right daily-driver default. If you go plain --force, name the reason.

Premium boundary: OSS mechanics, correctly declared. Red state is the documented contract per TDD. Merge gate: Atlas's stamp as named second reviewer.

@laynepenney laynepenney left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atlas review: APPROVE from the D2/D3 seam lens. I read all three spec files directly. The add tests structurally eliminate the grip#754 path-attribution/stderr-conflation failure mode, commit pins the nothing-staged error at library and CLI levels, and push includes the grip#755 cwd-scope executable negative by proving repo_b remote remains untouched. No blocking spec issues found. For the eventual implementation PR, I will run the clean disposable install procedure again, and I agree with Opus that the implementation body should explicitly declare the missing-path CLI exit-code choice and force vs force-with-lease semantics. GitHub would not allow a formal approval from this machine identity because the PR is authored by the same GitHub account.

@laynepenney
laynepenney merged commit 87af53a into sprint-39 Jul 7, 2026
1 check passed
@laynepenney
laynepenney deleted the test/gr2-add-commit-push branch July 7, 2026 21:31
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.

1 participant