Repository navigation
Conversation
|
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, and for the negative cases in the test (a phone number in another field, a truncated id, non-canonical JSON, an unclosed block). I reproduced #4725 on current main (c4cfe6d): We're taking the fix. Because it adds an exemption to the privacy scanner, we'll rebuild it on current main with a security read instead of taking the branch directly, keeping your approach and crediting you as co-author (tracking thread GSTA-36). We'll link the change here and close this PR when it lands. |
|
Thanks, @thomsjack. I'm taking ownership: I'll rebuild this on current main with you credited as co-author, bundled with #4402's run-id change, and I'll comment here when it lands. |
|
Thanks, @thomsjack. Your idea (skip /ship's run ids in the earlier-runs block for the phone check) was rebuilt on current main in #4747 (0d6cc1b) with you credited as co-author, plus negative controls so real phone numbers in that block are still caught. Closing this one in favor of #4747. |
Why (in your own words)
When
/shipupdates a PR body that carries prior run history,gstack-postexempts the<pid>-<10-digit-epoch>-<hex>session id inside the closedgstack-ship-receiptblock frompii.phone.e164, butreceiptIdSpans()inlib/gstack-post.tsdid not inspect the adjacentgstack-receipt-runsblock. As a result,gstack-postfalsely held the post with exit 2 (RULE: pii.phone.e164) on the tool-written"run"value ingstack-receipt-runs.This change extends
receiptIdSpans()to exempt only the exact column span of the top-level"run"value when it matchesSESSION_IDinside a closedgstack-receipt-runsblock whose line is canonical single-line JSON (JSON.stringify(entry) === raw) with a non-empty stringhead. Real phone numbers in any other field on the same line, a phone or truncated id in"run", non-canonical JSON, lines missinghead, and unclosed blocks still triggerpii.phone.e164.Live evidence
Before fix (from
test/gstack-post.test.tsreproducing #4725):After fix (running
bin/gstack-post pr-comment 1 --repo-visibility private --body-file body.mdin a scratch repo with an unreachable GitHub origin):Typecheck and unit tests:
Scope
lib/gstack-post.ts(handle closedgstack-receipt-runsblocks inreceiptIdSpans),test/gstack-post.test.ts(positive and negative regression tests forgstack-receipt-runssession ids).gstack-post pr-commentCLI scenario in a scratch git repo and runningbun run typecheck,bun run typecheck:test, and 85 tests acrosstest/gstack-post.test.ts,test/ship-receipt-runs.test.ts, andtest/pr-review-history.test.ts.ghwrite against a real GitHub PR (verified up to theghinvocation boundary).Checklist
GSTACK PRtyped live into a real surface) or PR author is @garrytan (owner exemption)