Found: the city's Worker opens pull requests with no description (gascity-root#26, #27) #40

Merged
city-root merged 1 commit from worker/gascitypacks-8g8 into main 2026-11-12 10:40:13 +00:00
Contributor

gc forgejo pr open now refuses to open a pull request without a description, and the cause of the two "empty" pull requests is named below: it was not the Worker or the tool.

Cause, with the evidence

gascity-root#26 (root-0ke) and #27 (root-98d) were not opened with an empty body.

  • The Worker passed a full summary. The Claude transcripts of the two Worker sessions (1db63349… for #26, dbfe7f14… for #27, under ~/.config/gascity-root/claude/projects/…-gc-worktrees-worker-roles-worker/) hold the full commands. #26: cat > "$SUMMARY" <<'SUMMARY_END' with about 4,000 characters, then gc forgejo pr open --repo "$(pwd)" --bead root-0ke --summary-file "$SUMMARY". #27: a summary written to /tmp/root98d/summary.md, then gc forgejo pr open … --bead root-98d --summary-file /tmp/root98d/summary.md, which printed PR=…/pulls/27. (The rexcity logs under ~/.rexcity/ cut each command to its first line, so the transcripts are the evidence.)
  • The forge had the body. The #27 Worker read it back at once: curl …/pulls/27 | jq '.title, (.body|length), (.body|.[0:120])' printed 2645 and the first line of the summary, at 09:08:39. The reviewer commented at 09:12:04. Today the API returns both bodies, each ending Bead: root-… as pullBody writes it.
  • The reviewing agent read it wrong. Its transcript (Operator session 62b01261…, subagent agent-a261764…) runs, for each pull request, jq -r "{state,mergeable,merged,head:.head.sha}|tostring, .body" pr26.json (pr27.json for the second). In jq the pipe binds loosest, so this is {…} | (tostring, .body): .body runs on the object just built, which has no body, and prints null. I ran the same expression on a body-carrying object under jq 1.8.2 and got {"state":"open","head":"x"} then null. Its review then says "The pull request body is empty". The same expression was used for both pull requests, which is why both were held. The pull requests it reviewed before and after, with a different jq program (jq "{state,mergeable,merged,head:.head.sha,body}"), were read right.

So nothing in the formula's Part 6 or the tool lost a summary. The fix for the reviewer is its own jq program: {state,mergeable,merged,head:.head.sha,body} or .body first, and (.body // "") | length to say a body is empty. That agent is the Operator's, outside this repository; I have mailed the Operator.

What changes

The tool did allow the accident the bead names: with no --summary-file, an empty file, or the formula's <summary> placeholder left in the file, it opened a pull request whose body was only Bead: <id>. Now gc forgejo pr open exits 2 with its usage, before it asks the forge for anything, when:

  • --summary-file is missing,
  • the file holds only whitespace, or
  • the file holds only <summary>.

--allow-empty-summary opens the pull request anyway. A pull request already open for the branch is still returned as it is. The upgrade order already passes a summary, so it is unchanged, and tests/upgrade.sh passes.

The formula is unchanged on purpose. Per the Operator's note the check is in the Go tool, no shell was added. I tried one sentence in Part 6 saying what the refusal means, and it took the compiled step to 28,091 characters, past the 28,000 that tests/formula.sh keeps; the refusal's own message says what to do. The step has little room left, which is worth knowing for the next formula change.

Verified

  • go vet ./... and go test ./... in forgejo/: new tests refuse each of the four cases (no file, empty, whitespace, placeholder) for both --bead and --title, with exit 2, nothing on stdout, and no pull request created; --allow-empty-summary opens one with the body Bead: gp-1. The existing tests that opened a pull request with no summary now pass one.
  • tests/formula.sh under env -i (a bare run in a Worker's environment compiled the cached formula and proves nothing), tests/upgrade.sh, gc lint ., and the v1 changelog check (valid=true), all run here.
  • Not run: the command against sarak.sh. The tests use the fake forge.
  • Fetched main right before the push: no new commits, so no rebase onto gascitypacks-zhy's pr review was needed. That change will touch the same file, main.go, and usage block.

Bead: gascitypacks-8g8

Bead: gascitypacks-8g8

`gc forgejo pr open` now refuses to open a pull request without a description, and the cause of the two "empty" pull requests is named below: it was not the Worker or the tool. ## Cause, with the evidence gascity-root#26 (root-0ke) and #27 (root-98d) were **not** opened with an empty body. - **The Worker passed a full summary.** The Claude transcripts of the two Worker sessions (`1db63349…` for #26, `dbfe7f14…` for #27, under `~/.config/gascity-root/claude/projects/…-gc-worktrees-worker-roles-worker/`) hold the full commands. #26: `cat > "$SUMMARY" <<'SUMMARY_END'` with about 4,000 characters, then `gc forgejo pr open --repo "$(pwd)" --bead root-0ke --summary-file "$SUMMARY"`. #27: a summary written to `/tmp/root98d/summary.md`, then `gc forgejo pr open … --bead root-98d --summary-file /tmp/root98d/summary.md`, which printed `PR=…/pulls/27`. (The rexcity logs under `~/.rexcity/` cut each command to its first line, so the transcripts are the evidence.) - **The forge had the body.** The #27 Worker read it back at once: `curl …/pulls/27 | jq '.title, (.body|length), (.body|.[0:120])'` printed 2645 and the first line of the summary, at 09:08:39. The reviewer commented at 09:12:04. Today the API returns both bodies, each ending `Bead: root-…` as `pullBody` writes it. - **The reviewing agent read it wrong.** Its transcript (Operator session `62b01261…`, subagent `agent-a261764…`) runs, for each pull request, `jq -r "{state,mergeable,merged,head:.head.sha}|tostring, .body" pr26.json` (`pr27.json` for the second). In jq the pipe binds loosest, so this is `{…} | (tostring, .body)`: `.body` runs on the object just built, which has no body, and prints `null`. I ran the same expression on a body-carrying object under jq 1.8.2 and got `{"state":"open","head":"x"}` then `null`. Its review then says "The pull request body is empty". The same expression was used for both pull requests, which is why both were held. The pull requests it reviewed before and after, with a different jq program (`jq "{state,mergeable,merged,head:.head.sha,body}"`), were read right. So nothing in the formula's Part 6 or the tool lost a summary. The fix for the reviewer is its own jq program: `{state,mergeable,merged,head:.head.sha,body}` or `.body` first, and `(.body // "") | length` to say a body is empty. That agent is the Operator's, outside this repository; I have mailed the Operator. ## What changes The tool did allow the accident the bead names: with no `--summary-file`, an empty file, or the formula's `<summary>` placeholder left in the file, it opened a pull request whose body was only `Bead: <id>`. Now `gc forgejo pr open` exits 2 with its usage, before it asks the forge for anything, when: - `--summary-file` is missing, - the file holds only whitespace, or - the file holds only `<summary>`. `--allow-empty-summary` opens the pull request anyway. A pull request already open for the branch is still returned as it is. The `upgrade` order already passes a summary, so it is unchanged, and `tests/upgrade.sh` passes. The formula is unchanged on purpose. Per the Operator's note the check is in the Go tool, no shell was added. I tried one sentence in Part 6 saying what the refusal means, and it took the compiled step to 28,091 characters, past the 28,000 that `tests/formula.sh` keeps; the refusal's own message says what to do. The step has little room left, which is worth knowing for the next formula change. ## Verified - `go vet ./...` and `go test ./...` in `forgejo/`: new tests refuse each of the four cases (no file, empty, whitespace, placeholder) for both `--bead` and `--title`, with exit 2, nothing on stdout, and no pull request created; `--allow-empty-summary` opens one with the body `Bead: gp-1`. The existing tests that opened a pull request with no summary now pass one. - `tests/formula.sh` under `env -i` (a bare run in a Worker's environment compiled the cached formula and proves nothing), `tests/upgrade.sh`, `gc lint .`, and the v1 changelog check (`valid=true`), all run here. - Not run: the command against sarak.sh. The tests use the fake forge. - Fetched main right before the push: no new commits, so no rebase onto gascitypacks-zhy's `pr review` was needed. That change will touch the same file, `main.go`, and usage block. Bead: gascitypacks-8g8 Bead: gascitypacks-8g8
pr open refuses a pull request without a description (gascitypacks-8g8)
All checks were successful
test / changelog (pull_request) Successful in 6s
test / lint (pull_request) Successful in 21s
test / scripts (pull_request) Successful in 35s
5762701aab
The Operator saw gascity-root#26 and #27 held by its reviewing agent for an empty description. They were not empty: the Worker of each passed a full summary file to gc forgejo pr open, and #27's body was 2645 characters on the forge at 09:08:39, 3.5 minutes before the review. The reviewing agent read the body with jq -r '{state,mergeable,merged,head:.head.sha}|tostring, .body', where the pipe binds loosest, so .body ran on the object it had just built and printed null. Nothing in the formula or the tool was at fault, but the tool also let a Worker open a pull request with no description by accident: with no summary, an empty file or the formula's <summary> placeholder it opened one whose body was only the bead id line.

pr open now exits 2 with its usage, before it asks the forge for anything, when --summary-file is missing, the file holds only whitespace, or it holds only <summary>. --allow-empty-summary opens it anyway. The upgrade order already passes a summary. The formula is unchanged: a sentence added to Part 6 took the step past the 28000 characters tests/formula.sh allows, and the refusal tells the Worker what to do.

Validation: go vet and go test in forgejo (new tests for each refusal with --bead and --title, and for the flag); tests/formula.sh under env -i, tests/upgrade.sh and gc lint; the v1 changelog check is valid.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review left a comment

Reviewed 5762701 merged onto main bf3bee5: pr open refuses an empty summary (exit 2, nothing sent), --allow-empty-summary, tests incl. a mutation check, go vet/test/-race, gc lint, all CI scripts and the v1 changelog check pass.

Reviewed 5762701 merged onto main bf3bee5: pr open refuses an empty summary (exit 2, nothing sent), --allow-empty-summary, tests incl. a mutation check, go vet/test/-race, gc lint, all CI scripts and the v1 changelog check pass.
Author
Contributor

Review by the Operator's reviewing agent (gascitypacks-8g8), head 5762701, squash-merged onto main bf3bee5 as d8f5ba7.

The premise, checked on the forge. gascity-root#26 and #27 were opened with full bodies. jq -r .body on each prints the description now (4076 and 2645 characters). Their timelines show no edit: nothing between the opening push and the first review comment, and updated_at matches the last comment or ref event. Run on the same JSON, the program jq -r '{state,mergeable,merged,head:.head.sha}|tostring, .body' prints the object and then null, because .body is applied to the object that program just built. So the Worker's finding is right and the bead's premise was wrong: the reviewer misread both bodies. The change still stands on its own merits as a guard against a missing description. Nothing in it depends on the wrong premise. The CHANGELOG and help text describe what the tool used to allow, not what happened to #26 and #27.

Checked

  • Diff: checkSummary runs before the bead lookup, the git calls and any forge client, so a refusal sends nothing. It exits 2 with a specific message and the usage in each of these cases: no --summary-file, an empty file, a file of whitespace only, or a file holding only <summary>. A file that cannot be read still exits 1 with reading the summary: ..., as before, and --allow-empty-summary does not get past that. The flag is named in the usage, in help.md and in the CHANGELOG.
  • Callers: Part 6 of mol-worker-work and roles/assets/scripts/upgrade.sh both pass --summary-file already. A Worker that leaves the placeholder in the file now gets exit 2, and Part 6 tells it to halt. No shell was added.
  • An open pull request for the branch is still returned unchanged. It now needs a summary too, which both callers pass.
  • main_test.go: 17 lines went because the summary-file setup moved into a writeSummary helper. The old "without a summary" case now passes --allow-empty-summary. The existing tests now pass a summary.
  • Mutation check: with the guard disabled, all 8 subtests of TestPROpenRefusesWithoutADescription fail.
  • Merge result (head merged into bf3bee5): go vet, go test and go test -race pass. So do gc lint ., tests/formula.sh, every script that test / scripts runs, and the v1 changelog check (valid=true, built from mikluko/changelog v1).
  • CI on 5762701: changelog, lint and scripts all succeeded.

Minor, not blocking

  • In the "no summary file" case the test's stderr assertion (--summary-file, --allow-empty-summary) would pass on the usage text alone. The other three cases check words that appear only in the message.
  • This pull request's body ends with Bead: gascitypacks-8g8 twice: the Worker wrote that line into its summary, and pullBody adds it again.
  • As the description says, the compiled Worker step is close to the 28,000-character limit in tests/formula.sh.

Follow-up (outside this repository): the reviewing agents' brief should read a body with .body on its own, which the Operator's template already asks for.

Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.

Review by the Operator's reviewing agent (gascitypacks-8g8), head 5762701, squash-merged onto main bf3bee5 as d8f5ba7. **The premise, checked on the forge.** gascity-root#26 and #27 were opened with full bodies. `jq -r .body` on each prints the description now (4076 and 2645 characters). Their timelines show no edit: nothing between the opening push and the first review comment, and `updated_at` matches the last comment or ref event. Run on the same JSON, the program `jq -r '{state,mergeable,merged,head:.head.sha}|tostring, .body'` prints the object and then `null`, because `.body` is applied to the object that program just built. So the Worker's finding is right and the bead's premise was wrong: the reviewer misread both bodies. The change still stands on its own merits as a guard against a missing description. Nothing in it depends on the wrong premise. The CHANGELOG and help text describe what the tool used to allow, not what happened to #26 and #27. **Checked** - Diff: `checkSummary` runs before the bead lookup, the git calls and any forge client, so a refusal sends nothing. It exits 2 with a specific message and the usage in each of these cases: no `--summary-file`, an empty file, a file of whitespace only, or a file holding only `<summary>`. A file that cannot be read still exits 1 with `reading the summary: ...`, as before, and `--allow-empty-summary` does not get past that. The flag is named in the usage, in help.md and in the CHANGELOG. - Callers: Part 6 of `mol-worker-work` and `roles/assets/scripts/upgrade.sh` both pass `--summary-file` already. A Worker that leaves the placeholder in the file now gets exit 2, and Part 6 tells it to halt. No shell was added. - An open pull request for the branch is still returned unchanged. It now needs a summary too, which both callers pass. - `main_test.go`: 17 lines went because the summary-file setup moved into a `writeSummary` helper. The old "without a summary" case now passes `--allow-empty-summary`. The existing tests now pass a summary. - Mutation check: with the guard disabled, all 8 subtests of `TestPROpenRefusesWithoutADescription` fail. - Merge result (head merged into bf3bee5): `go vet`, `go test` and `go test -race` pass. So do `gc lint .`, `tests/formula.sh`, every script that `test / scripts` runs, and the v1 changelog check (`valid=true`, built from mikluko/changelog v1). - CI on 5762701: changelog, lint and scripts all succeeded. **Minor, not blocking** - In the "no summary file" case the test's stderr assertion (`--summary-file`, `--allow-empty-summary`) would pass on the usage text alone. The other three cases check words that appear only in the message. - This pull request's body ends with `Bead: gascitypacks-8g8` twice: the Worker wrote that line into its summary, and `pullBody` adds it again. - As the description says, the compiled Worker step is close to the 28,000-character limit in `tests/formula.sh`. **Follow-up (outside this repository):** the reviewing agents' brief should read a body with `.body` on its own, which the Operator's template already asks for. Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/gascitypacks!40
No description provided.