Skip to content

feat(rest-push): --delete + --rename extension mechanizes ID-renumber pattern (B-0650)#4163

Merged
AceHack merged 1 commit into
mainfrom
otto-cli/b0650-rest-push-delete-rename-2026-05-18-1226Z
May 18, 2026
Merged

feat(rest-push): --delete + --rename extension mechanizes ID-renumber pattern (B-0650)#4163
AceHack merged 1 commit into
mainfrom
otto-cli/b0650-rest-push-delete-rename-2026-05-18-1226Z

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 18, 2026

Summary

Adds two new flags to tools/github/rest-push.ts:

Flag Behavior
--delete PATH Remove path from tree via sha: null (repeatable)
--rename OLD:NEW Delete OLD + add NEW with content from local disk at NEW (repeatable)

All 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.ts didn't support. I had to inline-script gh 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

  • B-0650 row landed in this PR (closed-status; mechanization complete)
  • Composes with B-0615 (push-hang workaround) + B-0648 (cross-substrate triangulation — Codex thread caught the B-0633 collision that motivated this)

Test plan

  • Bun build compiles cleanly (5.93 KB output)
  • --help shows all 3 flags (--file, --delete, --rename) + --update
  • No breaking changes to existing usage patterns
  • CI passes

🤖 Generated with Claude Code

… 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>
Copilot AI review requested due to automatic review settings May 18, 2026 16:26
@AceHack AceHack enabled auto-merge (squash) May 18, 2026 16:26
@AceHack AceHack merged commit 8084b1c into main May 18, 2026
32 of 33 checks passed
@AceHack AceHack deleted the otto-cli/b0650-rest-push-delete-rename-2026-05-18-1226Z branch May 18, 2026 16:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ts with repeatable --delete and --rename OLD:NEW arguments.
  • 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.ts does not exist in tools/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)

Comment thread tools/github/rest-push.ts
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)
Comment thread tools/github/rest-push.ts
}) + "\n");
}

main();
Comment thread tools/github/rest-push.ts
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.
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.

2 participants