feat(rest-push): --delete + --rename extension mechanizes ID-renumber pattern (B-0650)#4163
Merged
AceHack merged 1 commit intoMay 18, 2026
Conversation
… pattern (B-0650) Adds two new flags to tools/github/rest-push.ts: - --delete PATH (repeatable) — remove path from tree via sha:null - --rename OLD:NEW (repeatable) — delete OLD + add NEW with content from local disk at NEW All three (--file, --delete, --rename) compose in a single REST commit. Motivation: B-0633 duplicate-ID resolution this session required inline gh api git/blobs|trees|commits|refs (~50 lines bash) to land cleanly because rest-push only supported add/modify. This extension closes that gap; future ID-renumbers, file deprecations, and renames are one-liners. Compiles cleanly via bun build (5.93 KB output). No breaking changes to existing --file / --update / --branch / etc. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds REST push support for delete and rename operations so backlog ID renumbers and file removals can be landed through the GitHub git-data API when normal git push is unreliable.
Changes:
- Extends
tools/github/rest-push.tswith repeatable--deleteand--rename OLD:NEWarguments. - Builds one REST tree/commit containing added, deleted, and renamed paths.
- Adds a closed backlog row documenting B-0650 and the renumber workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tools/github/rest-push.ts |
Implements REST tree entries for file adds, deletes, renames, branch create/update, and help text. |
docs/backlog/P3/B-0650-rest-push-delete-rename-extension-mechanizes-id-renumber-pattern-otto-cli-2026-05-18.md |
Documents the closed backlog item, motivation, examples, and related backlog/tooling references. |
Comments suppressed due to low confidence (1)
docs/backlog/P3/B-0650-rest-push-delete-rename-extension-mechanizes-id-renumber-pattern-otto-cli-2026-05-18.md:74
- P1:
tools/github/rest-ship.tsdoes not exist intools/github/, so this backlog row documents a non-existent companion tool. Update the reference to the actual helper path or remove it to avoid another dead cross-reference.
- `tools/github/rest-ship.ts` — one-shot push+PR+arm helper (could compose with --delete/--rename in future)
| if (body !== undefined) { | ||
| cmdArgs.push("--input", "-"); | ||
| stdin = JSON.stringify(body); | ||
| } |
|
|
||
| ## Composes with | ||
|
|
||
| - [B-0615](B-0615-claude-code-bash-tool-orphans-git-fetch-subprocesses-under-saturation-self-saturation-feedback-loop-2026-05-18.md) — push-hang failure mode (the reason rest-push.ts exists) |
| }) + "\n"); | ||
| } | ||
|
|
||
| main(); |
Comment on lines
+5
to
+8
| // multi-agent saturation, this script lands a single-file change via the | ||
| // GitHub REST git-data API instead. The REST endpoints (POST /git/blobs, | ||
| // /git/trees, /git/commits, /git/refs) are served by different infrastructure | ||
| // than the git-push transport, so they remain responsive while push is hung. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new flags to
tools/github/rest-push.ts:--delete PATHsha: null(repeatable)--rename OLD:NEWAll three (
--file,--delete,--rename) compose in a single REST commit.Why
During the 2026-05-18 Mika+Ani+Riven substrate cascade (8 PRs, 30+ rows), a B-0633 duplicate-ID was detected by CI. Renumber to B-0649 required delete+add+modify which
rest-push.tsdidn't support. I had to inline-scriptgh api git/blobs|trees|commits|refs(~50 lines bash) to land cleanly. This extension closes that gap; future ID-renumbers / file deprecations / renames are one-liners.Worked example
bun tools/github/rest-push.ts --update \ --rename docs/backlog/P3/B-0633-old-name.md:docs/backlog/P3/B-0649-new-name.md \ --file docs/backlog/P1/B-0635-cross-ref-updated.md \ --branch otto-cli/b0633-renumber \ --message "rename(b0633→b0649): duplicate-ID resolution"Substrate
Test plan
🤖 Generated with Claude Code