Found: gc roles permission deny rejects the --city flag that gc passes on #24

Merged
city-root merged 1 commit from worker/gascitypacks-gen into main 2026-11-12 07:22:43 +00:00
Contributor

gc roles permission deny now accepts the --city <dir> / --city=<dir> flag that gc passes on to a pack command, and ignores it (the city is GC_CITY_NAME all the same), as roles view beads and view mail do. Before, gc --city <dir> roles permission deny ... printed usage and exited 2 without denying the request.

The other global flags (--rig, --city-url, --context) stay refused: they name another store or a remote city, and ignoring one silently would deny a request in the wrong city. The help and the changelog say so.

Verification: the new tests/permission-deny.sh runs the command against a stub curl and checks the URL and body posted with and without --city (either position, and --city=<dir>), and that a valueless --city, --rig, --city-url, --context and a missing request exit 2 and post nothing. It fails on the old script. It is wired into the test workflow; the v1 changelog checker reports valid=true.

Bead: gascitypacks-gen

`gc roles permission deny` now accepts the `--city <dir>` / `--city=<dir>` flag that gc passes on to a pack command, and ignores it (the city is GC_CITY_NAME all the same), as `roles view beads` and `view mail` do. Before, `gc --city <dir> roles permission deny ...` printed usage and exited 2 without denying the request. The other global flags (`--rig`, `--city-url`, `--context`) stay refused: they name another store or a remote city, and ignoring one silently would deny a request in the wrong city. The help and the changelog say so. Verification: the new `tests/permission-deny.sh` runs the command against a stub curl and checks the URL and body posted with and without `--city` (either position, and `--city=<dir>`), and that a valueless `--city`, `--rig`, `--city-url`, `--context` and a missing request exit 2 and post nothing. It fails on the old script. It is wired into the test workflow; the v1 changelog checker reports valid=true. Bead: gascitypacks-gen
fix(roles): permission deny accepts the --city flag gc passes on (gascitypacks-gen)
All checks were successful
test / changelog (pull_request) Successful in 5s
test / lint (pull_request) Successful in 15s
test / scripts (pull_request) Successful in 25s
82e963d689
gc passes its global flag --city <dir> on to a pack command run as
gc --city <dir> roles permission deny. The command's argument loop had no
case for it, so it printed its usage line and exited 2 without denying the
request. Without --city (from the city directory, or with GC_CITY set) it
worked, so it only failed when the city was named on the command line.

The command now accepts --city <dir> and --city=<dir> and ignores them, as
gc roles view beads and view mail do: the city is GC_CITY_NAME all the same.
The other global flags (--rig, --city-url, --context) stay unknown
arguments. They name another store or a remote city, and ignoring one
silently would deny a request in the wrong city; that is left refused and
stated in the help and the changelog.

Validation: the new tests/permission-deny.sh runs the command against a stub
curl. It checks the URL and body posted with and without --city in either
position and as --city=<dir>, and that a --city with no value, --rig,
--city-url, --context and a missing request exit 2 and post nothing. It fails
on the old script. It is wired into the test workflow; the v1 changelog
checker reports valid=true.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
mikluko force-pushed worker/gascitypacks-gen from 82e963d689
All checks were successful
test / changelog (pull_request) Successful in 5s
test / lint (pull_request) Successful in 15s
test / scripts (pull_request) Successful in 25s
to 3a06c4a6ca
All checks were successful
test / changelog (pull_request) Successful in 5s
test / lint (pull_request) Successful in 16s
test / scripts (pull_request) Successful in 34s
2026-11-12 07:17:43 +00:00
Compare
Author
Contributor

Rework round: rebased onto main (d6a1e66, past the 0.4.0 and 0.5.0 releases). The one conflict was in CHANGELOG.md; the entry now sits under a new ### Fixed in the current [Unreleased], and no released section is touched. The change itself is as before.

Verified before pushing: tests/formula.sh, worktree-setup.sh, worktree.sh, gnu-tools.sh, merge.sh, apply.sh, upgrade.sh, view-beads.sh, view-mail.sh and permission-deny.sh all exit 0; the v1 changelog checker, run in an ordinary clone of the branch, reports valid=true.

  • command -v date in my session printed /Users/mikluko/.local/share/gascitypacks/gnubin/date.
  • My work directory was already a linked worktree when Part 2 started.
Rework round: rebased onto main (d6a1e66, past the 0.4.0 and 0.5.0 releases). The one conflict was in CHANGELOG.md; the entry now sits under a new `### Fixed` in the current `[Unreleased]`, and no released section is touched. The change itself is as before. Verified before pushing: `tests/formula.sh`, `worktree-setup.sh`, `worktree.sh`, `gnu-tools.sh`, `merge.sh`, `apply.sh`, `upgrade.sh`, `view-beads.sh`, `view-mail.sh` and `permission-deny.sh` all exit 0; the v1 changelog checker, run in an ordinary clone of the branch, reports valid=true. - `command -v date` in my session printed `/Users/mikluko/.local/share/gascitypacks/gnubin/date`. - My work directory was already a linked worktree when Part 2 started.
Author
Contributor

Reviewed head 3a06c4a against main d6a1e66 (single commit on top of main; the rebase lost and added nothing).

  • Change matches gascitypacks-gen: --city <dir> and --city=<dir> are skipped, the same way view beads, view mail and worktree setup skip them. --rig, --city-url, --context and a --city with no value still exit 2 and post nothing.
  • What works now (stub curl): --session S --request R in either order, with --city <dir> before or after them, and with --city=<dir>. Each posts {"action":"deny","request_id":R} to /v0/city/$GC_CITY_NAME/session/S/respond. A missing --session or --request, an extra argument, or another global flag gives usage and exit 2.
  • tests/permission-deny.sh passes here and fails against main's run.sh (the three --city cases exit 2), so it tests what it says it tests.
  • CHANGELOG: the entry is under [Unreleased] / ### Fixed; the 0.4.0 and 0.5.0 sections are untouched.
  • CI on the head was green (changelog, lint, scripts).
  • Merge result (head merged into d6a1e66), with GC_/REX_/REXCITY_/BEADS_/BD_* unset and a throwaway HOME: every tests/*.sh in the workflow plus formula.sh exited 0, gc lint . was ok, the forgejo pack's go vet and go test passed, and the changelog checker built from mikluko/changelog v1 source (7ec45bb) reported valid=true.

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

Reviewed head 3a06c4a against main d6a1e66 (single commit on top of main; the rebase lost and added nothing). - Change matches gascitypacks-gen: `--city <dir>` and `--city=<dir>` are skipped, the same way `view beads`, `view mail` and `worktree setup` skip them. `--rig`, `--city-url`, `--context` and a `--city` with no value still exit 2 and post nothing. - What works now (stub curl): `--session S --request R` in either order, with `--city <dir>` before or after them, and with `--city=<dir>`. Each posts `{"action":"deny","request_id":R}` to `/v0/city/$GC_CITY_NAME/session/S/respond`. A missing `--session` or `--request`, an extra argument, or another global flag gives usage and exit 2. - `tests/permission-deny.sh` passes here and fails against main's run.sh (the three `--city` cases exit 2), so it tests what it says it tests. - CHANGELOG: the entry is under `[Unreleased]` / `### Fixed`; the 0.4.0 and 0.5.0 sections are untouched. - CI on the head was green (changelog, lint, scripts). - Merge result (head merged into d6a1e66), with GC_*/REX_*/REXCITY_*/BEADS_*/BD_* unset and a throwaway HOME: every `tests/*.sh` in the workflow plus `formula.sh` exited 0, `gc lint .` was ok, the forgejo pack's `go vet` and `go test` passed, and the changelog checker built from mikluko/changelog `v1` source (7ec45bb) reported valid=true. 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!24
No description provided.