Repository navigation
gstack-approvals says which --owner-ref check failed and stops pointing every refusal at add (#4718) - #4720
Conversation
…ng every refusal at add (garrytan#4718) rule refused a bad --owner-ref, a missing --words and a missing --by with one sentence that never stated the shape OWNER_REF requires, round-grant merged the ref and --words checks the same way, and the APPROVAL_RECORD_INVALID fix clause told every subcommand to rerun add with add's flags. Each check now prints its own line, the shape refusal quotes the ref and states OWNER_REF_SHAPE, the help reuses that constant, and the fix clause is neutral. OWNER_REF, exit codes and the troubleshooting anchor are unchanged.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thank you, this is a clean fix, and the tests pin each message. We're picking it up for our next batch of small fixes (tracking thread GSTA-36). Every outside change gets a line-by-line safety read before anything runs, so the batch will either keep your commits as they are or rebuild the change on current main with you credited as co-author. Either way we'll link the result here and close this PR when it lands. Nothing more is needed from you. |
|
Owner: Capy thread GSTA-827 is fixing this as part of today's small-fix wave and will link the wave PR here when it lands. |
… bisect case names (#4748) /ship now tells you to fix your commit email when GitHub refuses a push with GH007, instead of sending you into a pointless merge; `gstack-approvals` says which `--owner-ref` check failed; and the merge queue's bisect accepts a red judge case whose name has a space. Why: three small, plainly correct fixes from outside reports (#4738, #4718 with #4720, #4724 for #3580), taken as one batch. Nothing to do. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Co-authored-by: Barack-zero-to-one <[email protected]> Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/adversarial-native#3 reader=adversarial-native Review-Finding: p1/specialist-batched#1 reader=testing
|
Thanks @Barack-zero-to-one. This landed in #4748 (merged as 100e109), rebuilt on our main with you credited as co-author. The one change from your version: the shape refusal doesn't repeat the rejected ref, because that text could hold anything and it skipped the secret scanner. Closing this PR in favor of #4748. |
gstack-approvals ruleandround-grantnow say which--owner-refcheck failed and what shape the ref needs.Why: one shared sentence covered a bad ref, a missing
--wordsand a missing--by, and its fix line pointed atgstack-approvals add.Nothing to do; refs that were accepted before are still accepted, and every refusal still exits 2.
Root cause
In
bin/gstack-approvals,ruletested theOWNER_REFmatch, a non empty--wordsand a non empty--byin one condition and printed one sentence for all three, andround-grantdid the same for the ref and--words. Neither sentence stated the shapeOWNER_REFinlib/ruled-notes.tsrequires, soship-161:…orSHIPD1:…failed with no hint why. EveryAPPROVAL_RECORD_INVALIDline also ends with the onefixclause oflib/result-codes-capy.ts, which namedaddand its flags (--ask,--words,--scope,--by), sorule,round-grant,lane-exception,gateand thelocate()refusals of the read commands all sent the user to a different subcommand.Fix
lib/ruled-notes.tsexportsOWNER_REF_SHAPE, the regex in words next to it.rulenow runs three checks in order. A ref outsideOWNER_REFis refused with the ref quoted andOWNER_REF_SHAPE, then a missing--wordsand a missing--byeach get a line naming only that flag;round-grantgets the same shape check and its own--wordscheck. The help states the shape through the same constant. Thefixclause ofAPPROVAL_RECORD_INVALIDis now neutral. It says to rerun the command the line names with the flag its detail names, andgstack-approvals --helplists each command's flags.OWNER_REF, exit codes, the anchor,resultLineandfail()are unchanged.docs/troubleshooting.md#approval-record-invaliddescribes the two--owner-refrefusals, andchangelog.d/fix-issue-4718-owner-ref-refusal.mdcarries the entry. Closes #4718.Tests
Five tests at the end of
test/approval-record.test.tssplit stderr at; fix:so the refusal and the fix clause are checked apart. They cover the issue's own command (the ref is quoted, the shape is stated, neither--wordsnor--byis named, andSHIP-161:…still records), a missing--words, a missing--by, a badround-grantref, and a fix clause free ofadd,--askand--scopeonrule,round-grant,lane-exceptionandgate. All five failed on the old code for those reasons before the source changed.On Windows 11 with bun 1.4.5,
test/approval-record.test.tsgives 41 pass and 13 fail; the 13 are the same tests by name on untouched main, all using a fakeghshell script or symlinks.test/troubleshooting-anchors.test.ts,round-cap-granted-stop,ship-finish-ruled-notes,ship-run-record,security-finding-redactionandfix-check-clearinggive the same failures by name as main, except two anchor walks that timed out at 5 seconds under load and pass when the file runs alone (423 pass, twice).bun run typecheckreports no error,bun run typecheck:testno new diagnostic, and the doc link check, the credential scan and prose lint on the added lines pass. The full free suite was not run on this Windows machine, so full validation relies on the Linux CI infree-tests.yml.Out of scope
docs/ship-policy.mdanddocs/review-policy.mdstill give the ref only as<thread code>:<message id or timestamp>; the refusal, the help and the troubleshooting entry now state the shape.