Skip to content

D236 — a push refused with the hold unmoved is said as refused, with its reason - #432

Merged
napkinstack-agent[bot] merged 1 commit into
mainfrom
d236-refused-push-said
Nov 18, 2026
Merged

napkinstack-agent[bot] merged 1 commit into
mainfrom
d236-refused-push-said

Conversation

@napkinstack-agent

Copy link
Copy Markdown
Contributor

Closes #427.

Why

On #427's project, the default branch was red on B1 and the pre-push fitness hook refused every push. nstack unclaim said twice « hold moved meanwhile … run nstack plan, then again », although the hold was the same locally and on the remote. Running nstack plan and trying again could never help. The hook's own reason, written on stdout, was lost, because _record kept stderr alone.

What

flowchart LR
  P[push of a hold's event refused] --> F{read the remote again}
  F -->|another event came first| M[hold moved meanwhile: today's message]
  F -->|same tip as before| R[the push was refused, the hold did not move:<br/>the refusal's words, what can refuse]
  F -->|this very event is there| OK[recorded: git failed after the remote took it]
  F -->|unreadable| U[refused; whether it moved is not known]
Loading

Legend: what claim, unclaim and deliver say after a refused push.

  • hold.py: _after_refusal and _refusal are shared by all three commands. _record quotes both output streams.

  • .nstack/fitness-before-push.sh (D232's script) lets nstack's own records through without judging:

    • a hold's event on refs/heads/nstack/hold/…;
    • an attested record on refs/notes/nstack/….

    They move no file of the project. Every other hook still runs, and CI judges every pull request.

  • Register row D236.

Tests

  • Red on main first:
    • the issue's reproducer (unclaim);
    • the same case for deliver and for claim.
  • Neighbours:
    • a hold that really moved keeps its message (a real race, the first read held still);
    • an unreadable remote is never said to be unmoved;
    • an event the remote took before git failed is said to be recorded.
  • test_push_hook.py: a hold's branch and nstack's notes are let through; nstack/hold-not-a-hold and main are still judged.
  • Checked by hand with pre-commit's own pre-push: a hold's branch passes and a work branch is judged. The suite sets PRE_COMMIT_REMOTE_BRANCH itself.
  • Oracle: platform tests OK. Fitness compliant.
  • Independent verifier: nothing blocking. It traced pre-commit's _pre_push_ns (deletions never set the variable) and checked the tip comparison on every release path. Its findings are fixed:
    • the row sat in the wrong table;
    • an unreadable remote was said to be unmoved;
    • an event already recorded was said to have moved;
    • attested records, pushed to refs/notes, were stopped by the hook the same way;
    • claim's wording was untested.

🤖 Generated with Claude Code

…its reason

Closes #427.

Agent-Session: nstack-os-d236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@napkinstack-agent
napkinstack-agent Bot requested a review from a team as a code owner November 18, 2026 10:14
@napkinstack-agent
napkinstack-agent Bot merged commit dd7d914 into main Nov 18, 2026
3 checks passed
@napkinstack-agent
napkinstack-agent Bot deleted the d236-refused-push-said branch November 18, 2026 10:20
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.

A push the clone's pre-push hook refuses is said as « hold moved meanwhile » by claim, unclaim and deliver

1 participant