Repository navigation
Secrets check stops flagging three code shapes and catches concatenated and commented secrets (GST-3004) - #4457
Merged
Merged
Conversation
…atenated and commented secrets (GST-3004) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… flag the test itself Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…iterals out of template slots, and keep the comment start linear Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…hone number Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he second audit found hex secrets passing them Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…fig files The dotted field path exemption read only the quoted path, so a secret literal after it on the line (or, ||, a tuple comma) and the same text in a .env or YAML file stopped reporting. It now applies only in source files and only when the rest of the line holds no secret literal or template. Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 17, 2026
capy-ai Bot
added a commit
that referenced
this pull request
Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466) - An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481) - A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481) - `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470) - `revise --plan` with a different file now says the run follows that file. (#4470) - A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471) - The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460) - A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456) - A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451) - /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458) - A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458) - A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458) - A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473) - /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461) - /ship on Codex no longer stops at the test coverage audit. (#4489) - A cold first-use check before an app build reaches its owner (GST-3025). (#4465) - `skill_prefix=true` now survives updates when gbrain is installed. (#4454) - The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454) - `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454) - /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464) - /office-hours explains why it recommends a mode. (#4450) - /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463) - Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490) - A Captain can check an ask against the owner's earlier answers before sending it. (#4467) - `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488) - GitHub release notes now list every change in plain words, with a link to its pull request. (#4390) - gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442) - /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469) - /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472) - A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479) - The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457) - A security finding's location and reason no longer go into a PR body. (#4486) - The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487) - A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485) - A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452) - /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474) - A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440) - One queued record with a malformed path no longer stops artifacts sync for every project. (#4455) - A failed artifacts push stays reported until a push succeeds. (#4455) - The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455) - ### Tests (#4495) - A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495) - CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453) - Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447) - The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447) - Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484) - Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459) - Two /autoplan runs started in the same second no longer share a run id. (#4459) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The secrets check no longer stops a push on three kinds of ordinary code that only look like secrets: TypeScript types with spaced generic arguments, Python arguments that read a settings constant, and camelCase dotted field paths.
It also catches two kinds of real secrets it used to miss, one built with
+from short pieces and one written in a comment, so pushes are both quieter and safer.Nothing to do; a secret in any of the loosened positions still fails the check.
What changed
People hit the secrets check on code that holds no secret:
session: Awaited<ReturnType<typeof launch>>;,aws_secret_access_key=settings.S3_SECRET_KEY,andKEY = "form.section.fieldName"each stopped a push. Those three shapes now pass. Each exemption reads the value's shape, never the key's name, and each has tests that put a real-looking secret in the same position and expect it to report.Two misses are closed too.
KEY = "form.x" + "<secret>"is reported because the string pieces of a+chain are joined and checked, andx = 1 # API_KEY = "<secret>"is reported after#,//,/*or an HTML comment opener, while prose in comments is not.The dotted field path exemption applies only in source files, and only when the rest of the line holds no secret literal. So
password = "form.section.fieldName" or "<secret>"and the same path in a.envor YAML file still report.Known limits, still reported and documented in docs/pregate.md (allowlist them by value): JS/TS template keys, arrays of names, and generic types with string-literal arguments.
How it was checked
test/redact-env-kv-code-shapes.test.ts(the three loosenings, each paired with holds, plus the known limits and every audit bypass line, which must report) andtest/redact-env-kv-misses.test.ts(the two misses and a linear-time check on 40 KB lines). At main 0ee5914 every pass and miss test fails and every hold, known-limit and benign test passes. One pregate end-to-end case intest/pregate-secrets-source-context.test.ts.Agent notes
Second-model audit (GPT-6.1 Sol), two rounds. Round 1 at 1d93c56, 3,621 probes: HOLD, four bypasses (a spaced password with symbols in a template, array element or literal type; a regex literal in a template slot) and a quadratic slowdown on long space runs from the comment lookbehind; fixed once in 6a464d6 and fbb4156. Round 2 at fbb4156, 6,639 probes: HOLD, random 20-character hex under 3.0 bits/char passing the template-key and name-array exemptions (19 of 1,500 samples) and a
String.fromCharCodeslot. Per the Captain's ruling the PR was narrowed in f84cfad, not fixed again: the template-key, name-array and literal-type exemptions are removed and their false positives documented as known limits. Long-line timing after the fix: main 5.8 ms, branch 6.0 ms worst case.Outside PR #4309 (@atharva081106) was read as text only; its template exemption is not carried. Thanks to @atharva081106 and to @LimpingWolf for #4289's regression table.
Why
The secrets check runs before every push, so a false alarm on ordinary code blocks real work and teaches people to allowlist by reflex. Fewer false alarms and two closed misses make the check something people can trust.
Blast radius
Only the
env.kvrule inlib/redact-patterns.tschanged, and every redaction caller (pregate, gstack-post, the pre-push hook) reads it throughscan(). A side-by-side scan of every tracked file found no newenv.kvfinding in gstack and one in gbrain, while one false positive in gstack goes away (script ran on 5,088 files).Test Coverage
Coverage: 80% of the changed paths (12 of 15), from an audit-only pass that wrote no tests. Tests: 1801 → 1801 files; the fix commit adds one test case with six hold rows. Proposed follow-up rows for the three gaps: generic-type text inside a string literal, a spaced password split across
+pieces, and a comment secret on a raw diff-prefixed line.Tests ran: test 1683 (files, carried from CI run 44149072762)
Pre-Landing Review
The full review found one real problem, and it is fixed in this PR. The new dotted field path exemption hid a secret written later on the same line (
password = "form.section.fieldName" or "<secret>"), and it hid the same text in config files. The main scanner reported both. The fix limits the exemption to source files and requires the rest of the line to hold no secret literal. The adversarial reader and the second-model review each found this on their own. The repeat pass on the fix found nothing blocking.Second-model review (GPT-6.1 Sol): completed, two findings, both fixed.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/redact-engine.ts:418The engine's placeholder and allowlist shortcut runs on the first piece before validate, so a chain whose first piece looks like a placeholder ("your_key" + secret) gives no finding, against the docs' 'joined and checked' wording. Not a regression.lib/redact-patterns.ts:1692A+chain finding covers only the short first piece, so span redaction leaves the joined secret in place. Not a regression: main did not match these lines at all.lib/redact-patterns.ts:1692A whole-line comment on a raw diff line (+# TOKEN=…) is still missed. Not a regression.lib/redact-patterns.tsA comment or heading whose value has a digit (## Session: 2026-Q3-planning-notes) now reports; none occur in the repository.lib/redact-patterns.tsA single long line with many comment markers scans in 783 ms against 82 ms on main at 544 KB; seconds, not a hang, under the 1 MiB cap.lib/redact-patterns.ts:1229Plain.js,.mjsand.cjsfiles don't get the dotted field path exemption, so such a path there still reports. This adds false positives only.Exploratory QA
Functional, the
gstack-redactCLI on synthetic files at bb221cc: pass, 3 probes. A spaced generic TypeScript type gives no finding;API_KEY = "ab" + "<synthetic>"reports;password = "form.section.fieldName" or "<synthetic>"reports. Smoke only: comment and keyword-argument shapes are left to the unit tests.Design Review
No frontend files changed, so design review was skipped.
Eval Results
No prompt-related files changed, so evals were skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
TODOS
No TODO items completed in this PR.
Documentation
Status: current — documentation already matches the change; no edits.
Scope: base 0ee5914..bb221cc on
secrets-check-code-shapes, 6 committed files (lib/redact-patterns.ts, docs/pregate.md, changelog.d fragment, 3 tests); no staged, unstaged or new files.Documentation health:
docs/pregate.md— Current (branch adds the GST-3004/redact env.kv: Python settings reads and camelCase field-path constants are false positives; concat and comments are missed #4289 bullets: generic types, CONSTANT_CASE keyword arguments, camelCase dotted field paths, known limits,+chains and comment-marker secrets; verified against the code)changelog.d/secrets-check-code-shapes.md— Current (fragment, read only)Coverage debt: the new
env.kvexemptions have reference coverage only (docs/pregate.md); no how-to for allowlisting the known-limit shapes beyond the general allowlist section (common gap). Diagram drift: none.Issues
Refs #4289 (the regression table), #4287 (template keys, still a known limit).
Tests
bun teston the six redact env.kv, engine, context and diff-prefix files: 421 pass, 0 failbun test test/pregate-secrets-source-context.test.ts: 33 pass, 0 failbun run typecheckandtest/module-size-ratchet.test.ts: passAgent notes
Refs GST-3004
Approvals
No approvals recorded for branch secrets-check-code-shapes.
Plan: exempt: bug fix (R65; GST-3004 false positives and #4289 misses, failing tests written first)
REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=2 fixed=3 scope=frozen ledgers_read=2 dispatches=4
Gate edits: none detected (3 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review panel at f84cfad (pass 1): batched specialist (testing, security, state-machines) no findings; red team two informational notes; adversarial reader one blocker plus six notes; GPT-6.1 Sol two blockers. Fix bb221cc carries Review-Finding trailers p1/adversarial-native#1, p1/outside-voice#1, p1/outside-voice#2. Pass 2 on f84cfad..bb221cc: specialist no findings, red team one note. The red-team note on chain-span redaction was skipped as below the blocking floor (not a regression).
Earlier second-model security audit (GPT-6.1 Sol), two rounds before this /ship. Round 1 at 1d93c56, 3,621 probes: four bypasses and a quadratic slowdown, fixed in 6a464d6 and fbb4156. Round 2 at fbb4156, 6,639 probes: random hex passing the template-key and name-array exemptions; per the Captain's ruling the PR was narrowed in f84cfad and those exemptions plus the literal-type one were removed and documented as known limits. Outside PR #4309 (@atharva081106) was read as text only; its template exemption is not carried. Thanks to @atharva081106 and to @LimpingWolf for #4289's regression table.
Fetch-rule note: Playwright's browser cache was downloaded twice during review stage one and two by stray local free-suite workers from this run's own stopped test lane (not by a reader). The lane Captain approved deleting ~/.cache/ms-playwright; both stages reran clean.