Repository navigation
feat(OMN-16839): committed REST-PATCH PR-body helper with a read-back assertion (gh pr edit writes nothing) - #2963
Conversation
… assertion `gh pr edit --body/--body-file` exits 1 on the deprecated Projects-classic GraphQL call and writes NOTHING. Third rediscovery. This is the one committed copy of the ad-hoc `gh api --method PATCH` workaround, with the two assertions the ad-hoc form never had: target identity before writing, and a read-back comparison after, so a silently-dropped write can never exit 0.
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 131 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
|
| Verdict | Meaning | Blocks merge? |
|---|---|---|
passed |
No critical findings | No |
blocked |
CRITICAL findings found | Yes |
degraded |
All models unavailable (infra) | No (pilot) |
Powered by omniintelligence.review_pairing.cli_review — multi-model adversarial review (OMN-8468/OMN-8524)
…ibase_infra#2963 (#7404) * evidence(OMN-16839): author OCC companion for OmniNode-ai/omnibase_infra#2963 OCC companion by node_pr_lifecycle_fix_effect (OMN-13317 F1 / OMN-13990 / OMN-14285). Product PR head 0bae1a79278b6e20dad62838cb99c1285db897a0. * evidence(OMN-16839): self-bind OCC#7404 + rebind contract_sha256 --------- Co-authored-by: omnimarket-bot <bot@omninode.ai>
Closes OMN-16839.
Problem
gh pr edit <n> --body .../--body-file ...exits 1 on OmniNode-ai repos: the edit path calls the deprecated Projects-classic GraphQL API, which the org no longer serves. The PR body is not written.The failure is in the dangerous direction. There is no output a casual reader notices, the exit code is easy to lose (a
&&chain, a|| true, a pipeline whose last stage succeeds, or a caller that simply does not check), and the next step — a Receipt-Gate run, a merge, a closeout report — proceeds believing anEvidence-Source:/Evidence-Ticket:line is published when nothing changed.This is the third rediscovery. It is recorded in memory
reference_gh_pr_edit_projects_classicand worked around privately each time with an ad-hocgh api --method PATCH. A rule in a memory file is not a mechanism.Blast radius: PR bodies are how evidence stamps reach the Receipt Gate. A silently-dropped body write is a missing stamp the author believes they filed — the same class as OMN-15441 / OMN-15460 / OMN-15564, but originating locally rather than in CI.
What this ships
scripts/pr_body.py— the one committed copy of that workaround, alongsideheavy_lock.pyandledger_lock.py(same directory, same friction-to-committed-helper pattern, OMN-16822 / OMN-16532). It carries the two assertions the ad-hocgh apiform never had:--repo OWNER/NAME --pr N; the helper GETs that PR and refuses to write unless the servedhtml_urlandnumberare that PR. Body-writing automation with no target-identity check is how OCC#5621's body was overwritten with omnibase_infra#2589's (OMN-15564) — cross-repo and unattributable.gh pr editdefect, caught.--append. Reads the current body, adds the text after a blank line, and no-ops if the text is already present verbatim. Evidence appends get retried (a lane re-runs a closeout, a sweep passes twice); twoEvidence-Source:lines in one body is the over-match class OMN-14675 describes.pr_body:marker. 65 identity mismatch (nothing written), 69 gh unavailable, 70 read-back mismatch. Deliberately not 127: a bare 127 with no marker means the helper itself is missing, and those two must stay mechanically distinguishable — the lesson OMN-16822 encoded afterflock(1)'s absence produced exactly that markerless 127.--field body=..., so newlines, backticks, and leading dashes in an evidence block survive untouched.Tests —
tests/unit/scripts/test_pr_body.py(14, TDD red-first)Written before the helper existed; the first run failed with
FileNotFoundError: .../scripts/pr_body.pyat collection.The suite drives the helper against a scripted stand-in for
gh(injected via--gh-bin), so nothing touches the network. The stand-in can be told to accept a PATCH and change nothing — thegh pr editbehaviour, reproduced.pr_body:marker, and the test asserts the served body really is still the old one, i.e. the helper did not lie about what is published;--setis confirmed by read-back;--appendpreserves the existing body and adds the text; running it twice leaves exactly one copy of the stamp;html_url(asked foromnibase_infra#42, servedonex_change_control#42) and a wrong number; in each case the served body is asserted untouched;ghexits 69 with the marker, with a negative control asserting an absent helper is a markerless failure;prnoreditis ever a literal handed togh(withapi/PATCHas the positive control) — prose about the broken verb is expected in the header, a call site is not;--dry-runprints the intended body and writes nothing;--set/--appendare mutually exclusive; pure-function coverage of the append composition rule.Follow-on (separate repo, separate PR)
The dispatch-template sweep —
docs/standards/DISPATCH_LANE_BRIEF.mdCORE block,docs/runbooks/pr-landing-ceremony.md,docs/runbooks/merge-sweep-standing-procedure.md— lands in omni_home, since that is where those docs live. AC3/AC4 are tracked there.dod_evidence
scripts/pr_body.py(executable, SPDX-stamped)tests/unit/scripts/test_pr_body.py— 14 passedFileNotFoundError: .../scripts/pr_body.pybefore implementationuv run ruff checkclean;uv run mypy scripts/pr_body.py --strict→Success: no issues found in 1 source filescripts/heavy_lock.py(OMN-16822)Evidence-Ticket: OMN-16839
Evidence-Source: OCC#7404