|
3 | 3 | All notable changes to this repository are documented here. Format loosely |
4 | 4 | follows Keep a Changelog; versioning follows Semantic Versioning. |
5 | 5 |
|
| 6 | +## [1.637.0] — 2026-11-01 |
| 7 | + |
| 8 | +### Added |
| 9 | +- Opt-in per-lane stop-starting cap in `.claude/skills/agentic-delivery/scripts/flow_alarm.py`: with `PERUN_STOP_STARTING_LANES` set (for example `web=web/*,docs/*;api=`, lanes split by `;`, each `name=glob,glob`, whole-path fnmatch, first match wins, a lane written with no globs is the fallback), `PERUN_STOP_STARTING_READY` applies per lane instead of repo-wide, so a full merge train no longer denies new work for an idle one. Only where the global count already denies, and before the throughput judgement, the hook takes the new PR's lane from the files GitHub lists for it (`gh api repos/{owner}/{repo}/compare/<base>...<branch>`, run in the command's directory; the local diff reads the local `origin/<base>` and lists more than the PR when that base was not fetched) and counts the ready PRs in that lane from a second `gh pr list --limit 500` call that also returns each PR's files. The count is used only when that call's own ready total is at least the cap, so it confirms the first read. A lane with room passes with no ledger entry and no denial record. A PR whose file list is missing or cut short, whose `changedFiles` is missing or null, or whose files match no lane when there is no fallback, counts in every lane. Every failure keeps the deny: a malformed map, a command or branch not judged, a compare list that is empty or at GitHub's 300-file limit, files in no lane, a call that fails or times out, a recount that does not confirm the first read, 500 PRs back. Each of the two calls gets what is left of a 15 second budget counted from the hook's start and is skipped when under 2 seconds are left, and the command is judged once per hook call. With the variable unset, behavior and the denial record are unchanged. |
| 10 | +- With the variable set, the denial record adds `lane` and `lane_ready` (null when unknown) and the deny message names the lane and its count. The module docstring documents the syntax, every failure that keeps the deny and the residuals (a renamed file counts by its new path only; local git calls are not budgeted, so a slow git can still run the hook past its timeout); `.claude/skills/agentic-delivery/references/flow-guards.md` carries a three-line summary. |
| 11 | +- Tests: `python3 scripts/test_flow_alarm.py` goes from 69 to 86 tests; the test environment now also drops `PERUN_STOP_STARTING_*`, and the fake `gh` serves a canned compare list and can fail the compare call or the recount list call on its own. The new `Lanes` class covers lane room and fullness, a lane taken from the compare and not from a superset local diff, a compare that fails, is empty or lists 300 files, first-match order and the fallback, whole-path globs, unknown lanes counting everywhere (a missing `changedFiles` too), malformed maps, an unjudged branch, a recount that is empty, short or fails, 500 PRs back, red and draft PRs not counting, one judging per hook call, the per-call time budget, the base and quoted branch in the compare path, the throughput grant in a full lane, and the unchanged record when the variable is unset. |
| 12 | +size-budget-raise: .claude/skills/agentic-delivery/references/flow-guards.md 2684→3171 per-lane cap summary and the lane keys of the denial log |
| 13 | + |
| 14 | +### Added |
| 15 | +- Three bundled semgrep rules, two in `.claude/skills/deep-code-review/templates/semgrep-taint/js.yml` and one in `py.yml`, for a secret that silently falls back to a known value and a secret-looking variable behind a public bundler prefix. Each carries the same test-path exclusions as `hardcoded-credential-compare` of its language, and the JavaScript fallback rule also skips test-runner configs (`playwright.config.*`, `vitest.config.*`, `jest.config.*`, `cypress.config.*`), because a test runner is not the service. A name counts as secret only when it ends in a secret stem (pass, passwd, password, passcode, passphrase, secret, token, credential, credentials, api_key, apikey, a secret, private, signing, encryption, session, jwt, hmac, master, access, auth, client, app, service, service_role or webhook key compound, or `_pwd`) after an optional prefix, so `ACME_TOKEN_TTL`, `ACME_PASSWORD_RESET_URL`, `ACME_CACHE_KEY`, `ACME_ACCESS_KEY_ID` and a bare `PWD` stay clean while `ACME_WEBHOOK_SECRET`, `ACME_DB_PASSWORD`, `ACME_GH_TOKEN`, `ACME_API_KEY`, `ACME_DB_PWD`, `ACME_SSH_PASSPHRASE` and `ACME_SERVICE_ROLE_KEY` are reported. A fallback that looks like a file path (it starts with `/`, `./`, `../` or `~/`, or ends in `.json`, `.pem`, `.key`, `.crt`, `.cer`, `.der`, `.p12`, `.pfx`, `.jks`, `.keystore`, `.yaml` or `.yml`) says where to look for a secret and is not a known secret, so `process.env.ACME_APPLICATION_CREDENTIALS || "./acme-sa.json"` stays clean. |
| 16 | +- `perun.js.secret-env-fallback` (WARNING): `process.env.X`, `process.env["X"]` or `import.meta.env.X` followed by `||` or `??` and a non-empty string literal, `process.env.X` or `process.env["X"]` assigned with `||=` or `??=` and a string literal, or a `const`, `let` or `var` destructuring default from `process.env` (`const { X = "..." } = process.env`, also with other keys around it), where `X` is secret-named. A name behind a public bundler prefix (`NEXT_PUBLIC_`, `VITE_`, `REACT_APP_`, `EXPO_PUBLIC_`, `NUXT_PUBLIC_`, `GATSBY_`, `PUBLIC_`, `STORYBOOK_`, `VUE_APP_`) is left to the next rule, and the literal rule is the one `hardcoded-credential-compare` uses, so an empty string, a one-character string and sentinels such as `none` stay clean. Ceiling: a chained fallback, a ternary, a non-null `!` read, an alias of `process.env`, a renamed destructuring and `Deno.env.get` are not seen, a template literal with a `${}` substitution is not matched, and optional chaining (`process?.env?.X || "x"`), a value first copied to a variable (`const s = process.env.X; s || "x"`) and a value-based fallback (a connection string holding a password under a non-secret name) are not followed. |
| 17 | +- `perun.js.public-env-secret` (WARNING): any use, a write included, of `process.env.X`, `process.env["X"]` or `import.meta.env.X`, with or without a fallback, where `X` starts with one of those public prefixes and ends in `secret`, `password`, `passwd`, `passcode`, `passphrase`, `_pwd`, `service_role`, or a `secret`, `private`, `signing`, `encryption` or `service_role` key compound with or without the underscore (`secret_key`, `secretkey`), because a bundler inlines such variables into any client code that reads them, so the value can reach every visitor's browser. Token, `api_key`, anon, publishable and site key names are not reported, because many browser keys are public by design. Ceiling: a destructured read is not seen. |
| 18 | +- `perun.py.secret-env-fallback` (WARNING): `os.environ.get("X", "...")`, `os.getenv("X", "...")`, either with `default="..."`, `os.environ.setdefault("X", "...")`, and `os.environ.get("X") or "..."` or `os.getenv("X") or "..."` with a secret-named `X`, including the `from os import environ, getenv` spellings. No default, `None`, an empty string, a one-character string, sentinel strings and file-path literals stay clean. There is no public-prefix check for Python. Ceiling: a chained `or`, a conditional expression, an f-string with a field and `os.environ` bound to another name first are not matched, and a value first copied to a variable (`s = os.environ.get("X"); s or "x"`) and a value-based fallback (a connection string holding a password under a non-secret name) are not followed. |
| 19 | +- Test: `scripts/test_semgrep_secret_env.py`, registered in `scripts/ci-tests.d/semgrep-secret-env.sh`, runs annotated fictional fixtures (a `ruleid` or `ok` comment marks the next line) through semgrep with the bundled rules only, plus copies under test paths and test-runner configs that must stay clean. Offline checks of severity, exclusions, the shared name and literal regexes against must-match and must-not-match names and file-path literals, the public-prefix list and the pattern shapes run where semgrep is absent. `scripts/test_semgrep_hardcoded_cred.py` now checks the shared literal regex per rule (each of the three rules that carries it, in both files) instead of counting copies per file. |
| 20 | + |
6 | 21 | ## [1.636.0] — 2026-11-01 |
7 | 22 |
|
8 | 23 | ### Changed |
|
0 commit comments