test: gr2 native add/commit/push failing tests (grip#752 slice 1 follow-up)#762
Conversation
…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).
|
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:
Premium boundary: OSS mechanics, correctly declared. Red state is the documented contract per TDD. Merge gate: Atlas's stamp as named second reviewer. |
laynepenney
left a comment
There was a problem hiding this comment.
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.
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:
ModuleNotFoundErrorongr2.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
addstages files via multi-repo path attribution (a gripspace-relative path has to be matched to the right repo beforegit addever 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 makesgit addfail is a real error (AddError), never a silent skip.commit
Mirrors gr1's
has_staged_changes+create_commitshape closely -- nothing staged raises clearly (CommitError) rather than silently no-op'ing,--amendkeeps a single commit and updates the message.push
Mirrors gr1's
has_commits_to_pushheuristic, 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_scopeis 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, matchingbranchand 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.