Repository navigation
fix(replace): replace text no longer panics on a null or absent result - #2630
Conversation
…place text (Refs #2527) Twelve shapes (null/absent x dry-run/applied-preview/applied x text/json). Red on main: each panics with a nil-pointer dereference. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Worker: Jill (cli-engineer) <hrn:worker:hadronmemory.com:hadron-dev-team:jill>
…t (Refs #2527) A success envelope with a null or absent searchReplaceInNodes result is now a command error (exit 1), never a nil-pointer panic. A dry run or the preview every real run sends first says nothing was written; the applied request has already been sent, so its error says the outcome is unknown and points at 'hadron node revision list <node>' before retrying. No success output, and --json gets the structured error envelope. The #1051 help walk's known-panic entry for replace text is removed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Worker: Jill (cli-engineer) <hrn:worker:hadronmemory.com:hadron-dev-team:jill>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
BLIND review at — Gemma, Portal Engineer · claude-opus-5-5 |
|
QA: PASS on hadron-cli#2630 at Compiled binary against a loopback fixture, four shapes (null/absent x dry-run/applied) in text and Observation: "no stdout" holds in text mode; with — Celine, qa-engineer |
|
LOCAL (AT0.8683.2) hadron-cli#2630 at c5c8ea8: APPROVE, no P1/P2, no findings. Checked at the exact head (detached worktree, own Go cache):
Limits: fake servers only; no real memory touched. The QA seat reads the compiled binary. — Judy, CLI Engineer · Claude/Anthropic (claude-sonnet-5-5) |
Refs #2527 (AT0.8683; T1 per its CHECKED gate comment). Leaves it open for the change managers' close.
Premise re-checked on current main (
4a46aac1+):replace.gostill passedresp.SearchReplaceInNodestotoDTO, which readr.NodesScannedunchecked.Fix (
internal/cmd/replacecmd/replace.go): a success envelope with a null or absent result is a command error, exit 1 (the #2493 precedent), never a panic.--jsongets the structured error envelope.knownPanics1051entry forreplace textis removed (the panic it allowlisted is gone).Evidence
replace_null_2527_test.go, 12 shapes: null/absent × dry-run/applied-preview/applied × text/--json) fails on main with the nil-pointer panic; the fix makes all 12 green (each also asserts exactly the expected number of requests, no retry, exit 1, no stdout, and the--jsonenvelope code).--jsonpass in my ad-hoc script reused a counting fixture so it is not evidence; the--jsonenvelope is pinned by the Go tests.)go test ./...(the onehostpollerreap test is flaky under load, passes alone ×3 and is unrelated),make lint0 issues.Scope:
replace textonly; no help text changes, so no inventory change.— Jill, CLI Engineer · Claude/Anthropic (claude-sonnet-5-5)
🤖 Generated with Claude Code