Skip to content

Tighten release preparation and durable window consistency - #8

Merged
FlyOverCoderKY merged 4 commits into
mainfrom
claude/harden-release-and-durable-windows
Nov 6, 2026
Merged

FlyOverCoderKY merged 4 commits into
mainfrom
claude/harden-release-and-durable-windows

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Summary

  • authenticate stable release tags before checkout and publish only the sealed two-file artifact
  • isolate consumer smoke and npm publication from preparation state
  • bind durable policy settings, retain windows across bounded clock skew, and bound subject keys before hashing
  • cover release invariants and durable behavior with memory-store and Azurite tests

Verification

  • CI=1 pnpm run format:check
  • CI=1 pnpm run check
  • CI=1 pnpm test
  • CI=1 pnpm run release:check
  • CI=1 pnpm run release:pack
  • isolated consumer smoke

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-06T19:41:53.716296Z bcd9561 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

OpenRouter review posted (clean). #8 (review)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: bcd95618f60c221ea7d46dc4c53a2871572b393f
Judge: skipped (one successful review lane; no merge needed)
Cost: $0.17 + at least $0.0420 (incomplete)

Lanes

  • meta/muse-spark-1.2: ok (5 finding(s), 68.5s, 177763+7561 tokens (78434 cached), 3 tool round(s), via Meta, $0.17)
  • z-ai/glm-5.3-flash: failed-open (at least $0.0420 spent, incomplete) — OpenRouter lane wall-clock deadline exhausted; lane transport history (includes recovered errors): transport_timeouts=2, elapsed_deadlines=2

Warning

meta/muse-spark-1.2: coverage claims 2 finding(s) in '.github/workflows/publish.yml' but 1 were reported

Findings

🟠 Issue 1 — Bare fetch lacks authentication for private repositories

.github/workflows/publish.yml:62 · risk · identified by meta/muse-spark-1.2

Failure scenario: on a private pegma-dev/rate-limit repository the bare-repository verification git fetch uses https://${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git with no token. The fetch fails with 401, aborting the prepare/publish jobs even though the release tag is valid and actions/checkout would succeed with GITHUB_TOKEN.

Evidence: .github/workflows/publish.yml lines for git init --bare / git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" followed by git fetch --no-tags origin … in both Authenticate the release tag and Re-authenticate the release tag steps. Previous workflow fetched via the checked-out origin which inherits the checkout token; the new bare repo does not configure http.extraHeader or a token-bearing URL.

Checked: sibling workflow ci.yml uses actions/checkout with default token; no GITHUB_TOKEN is passed to the bare fetch. Public-repo runs are unaffected, so severity is risk not bug, but the regression is deterministic for private forks.

🟠 Issue 2 — Durable descriptor fast-path caches without revalidation

packages/rate-limit/src/durable.ts:280 · risk · identified by meta/muse-spark-1.2

Failure scenario: after a store reset or external deletion of the policy descriptor, an existing limiter instance keeps descriptorValidated=true and skips store checks. Subsequent allow calls write windows even though the descriptor is missing, and sweep proceeds despite a missing descriptor, leaving orphan counters and breaking the invariant that every partition has an immutable descriptor.

Evidence: packages/rate-limit/src/durable.ts ensureDescriptor returns early if descriptorValidated is true (if (descriptorValidated) return true;). allow guards descriptor checks with if (!descriptorValidated) and sweep calls ensureDescriptor(expected,false) which is no-opped by the same cache. No TTL or store verification invalidates the flag after initial success.

Checked: durable.ts lines 280-330, allow/sweep call sites, and the conflicting-policy test which only tests fresh instances. No test covers descriptor deletion/reset while an instance remains alive. This is a global correctness/bounded-cost concern; uncertainty is low — the code path is reachable after any coordinated reset.

🔵 Issue 3 — CI workflow duplicates Corepack activation

.github/workflows/ci.yml:31 · nit · identified by meta/muse-spark-1.2

Failure scenario: no functional failure, but ci.yml runs corepack enable twice (Enable Corepack then Activate pnpm both execute corepack enable). Wasteful and confusing for readers auditing the supply chain; can mask a missing corepack prepare if pnpm version ever drifts from the pinned pnpm@​10.34.5.

Evidence: .github/workflows/ci.yml has - name: Enable Corepack\n run: corepack enable and immediately after - name: Activate pnpm\n run: corepack enable. publish.yml correctly uses a single enable.

Checked: ci.yml full file read; sibling publish.yml shows the intended single-step pattern.

🔵 Issue 4 — Prettier endOfLine auto yields nondeterministic formatting

.prettierrc.json:1 · nit · identified by meta/muse-spark-1.2

Failure scenario: developers on Windows produce CRLF and on Linux LF; pnpm run format:check passes on the author’s OS but fails in CI (or vice versa) after prettier normalizes to the local auto value. This undermines the format:check gate added to ci.yml and the Run the gate step in publish.yml.

Evidence: .prettierrc.json contains {"endOfLine":"auto"}. The intended deterministic setting for the repository is lf (the repo’s .gitattributes/editorconfig and previous absence of this file imply LF). No sibling config forces lf elsewhere.

Checked: list_dir and read_file for .prettierrc.json; ci.yml and publish.yml both run pnpm run format:check.

🔵 Issue 5 — NPM environment allowlist diverges between code and workflow

scripts/release-package.mjs:48 · nit · identified by meta/muse-spark-1.2

Failure scenario: scripts/release-package.mjs:isolatedNpmEnvironment and the inline publish-verification Node script use different keep-sets. The script allows CI,HOME,PATH,RUNNER_TEMP,SYSTEMROOT,TEMP,TMP,TMPDIR plus GITHUB_*/ACTIONS_ID_TOKEN_*, while the helper also allows COMSPEC,HOMEDRIVE,HOMEPATH,PATHEXT,SYSTEMDRIVE,USERPROFILE,WINDIR. On Windows, a future copy-paste of the workflow allowlist into the script (or vice versa) silently drops needed vars, or the workflow allowlist unexpectedly leaks/omits vars, causing npm provenance or cache writes to use an unisolated config.

Evidence: scripts/release-package.mjs NPM_ENVIRONMENT_KEYS set vs .github/workflows/publish.yml inline keep Set in the Verify and publish the prepared tarball step. test/release-package.test.ts pins the helper’s allowlist, not the workflow’s.

Checked: grep for NPM_CONFIG_USERCONFIG/NPM_ENVIRONMENT_KEYS shows two definitions; no test asserts they are identical. The drift is currently benign on ubuntu-latest but is a maintenance trap.

Workflow run

git -C "${verify_repo}" config gpg.ssh.allowedSignersFile "${allowed_signers}"
git -C "${verify_repo}" fetch --no-tags origin \
refs/heads/main:refs/remotes/origin/main \
"+refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Bare fetch lacks authentication for private repositories (risk)

Failure scenario: on a private pegma-dev/rate-limit repository the bare-repository verification git fetch uses https://${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git with no token. The fetch fails with 401, aborting the prepare/publish jobs even though the release tag is valid and actions/checkout would succeed with GITHUB_TOKEN.

Evidence: .github/workflows/publish.yml lines for git init --bare / git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" followed by git fetch --no-tags origin … in both Authenticate the release tag and Re-authenticate the release tag steps. Previous workflow fetched via the checked-out origin which inherits the checkout token; the new bare repo does not configure http.extraHeader or a token-bearing URL.

Checked: sibling workflow ci.yml uses actions/checkout with default token; no GITHUB_TOKEN is passed to the bare fetch. Public-repo runs are unaffected, so severity is risk not bug, but the regression is deterministic for private forks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applicable here: gh repo view pegma-dev/rate-limit --json isPrivate reports false. This release workflow is deliberately scoped to this public repository, and keeping the pre-checkout fetch credential-free preserves the stated boundary. Private-fork behavior is outside this repository's release contract.

Comment thread packages/rate-limit/src/durable.ts Resolved
Comment thread .prettierrc.json Resolved
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

Follow-up 02eedf1 also removes the duplicate Corepack activation and aligns the platform environment keys used by the workflow and release helper. The complete local gate, release pack, and isolated consumer smoke pass.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

Correction to my earlier follow-up note: setup-node resolves the pnpm cache before subsequent steps run, so it requires the pre-setup Corepack shim; the post-setup activation targets the selected Node.js runtime. Commit 3b6e07f restores both steps with an explanatory comment and invariant coverage.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: partial
Scope: latest-commit (commit-range)
Mode: verify
Commit: 02eedf1963dd60e10a1ddcf79ae624aa39a8a889
Judge: openai/gpt-5.6-luna
Cost: $0.1427 (lanes $0.1419 + judge $0.0008)

Lanes

  • meta/muse-spark-1.2: ok (0 finding(s), 29.1s, 85296+3014 tokens (565 cached), 4 tool round(s), via Meta, $0.12)
  • z-ai/glm-5.3-flash: ok (1 finding(s), 253.8s, 88858+36319 tokens, 2 tool round(s), via CoreWeave, $0.0231)

Round 2 resolution

  • ❌ r1-1 not fixed — Bare fetch lacks authentication for private repositories: No fix landed. Both jobs still do git init --bare + git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" followed by git fetch --no-tags origin ... with no token (prepare ~line 58-61, publish ~line 203-206). On a private repository the fetch 401s and aborts the job. No GITHUB_TOKEN/secret injection was added; diff only expands the npm allowlist keep set.
  • ✅ r1-2 fixed correctly — Durable descriptor fast-path caches without revalidation: Fixed in packages/rate-limit/src/durable.ts. descriptorValidated fast-path removed; flag is now descriptorEstablished set only when a descriptor is observed. allow() revalidates via ensureDescriptor(..., createDescriptor) before every counter write (fresh limiter lists and fails closed if counters exist without descriptor; established limiter calls ensureDescriptor with create=false each t…
  • 3 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 2 (0 bug-severity).

Warning

The PR head advanced after this review's diff was collected. This review is pinned to commit 02eedf1 and does not cover the newest push.

Findings

🟠 Issue 1 — CI runs setup-node with cache: pnpm before any pnpm is on PATH

.github/workflows/ci.yml:39 · risk · identified by z-ai/glm-5.3-flash

actions/setup-node with cache: pnpm resolves the cache directory by executing pnpm store path, and this commit moves the only corepack enable step to after that action. Previously the workflow ran Enable Corepack before setup-node, which left a pnpm shim on PATH when the action computed cache paths; now nothing guarantees pnpm exists at that point. On a runner image without a preinstalled pnpm, the Set up Node.js step fails (Unable to locate executable file: pnpm) and every CI job aborts before corepack enable or pnpm install ever run.

Evidence: .github/workflows/ci.yml step order is checkout → Set up Node.js with cache: pnpm (lines 33–37) → Enable Corepack (line 39) → pnpm install --frozen-lockfile. The removed first Enable Corepack step is visible in the diff. publish.yml avoids the same dependency by passing package-manager-cache: false and no cache: input, so only ci.yml is exposed. A secondary effect even when a preinstalled pnpm exists: cache paths are computed by that binary while the install itself runs the Corepack-managed version, so a store-layout major mismatch would make the recorded cache path not match the store actually written (cache silently ineffective, not a failure).

Proof gap: I could not verify from the repository (no network) whether GitHub-hosted ubuntu-latest images preinstall pnpm; if they do, the reorder is actually an improvement, because the Corepack shims then bind to the matrix Node version instead of the preinstalled one. The risk applies only to images or self-hosted runners that lack pnpm at setup-node time, and the workflow no longer protects against that case.

Workflow run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: partial
Scope: latest-commit (commit-range)
Mode: verify
Commit: 3b6e07ffead7feda5013805f09d04e5d6c85a575
Judge: openai/gpt-5.6-luna
Cost: $0.1116 (lanes $0.1115 + judge $0.0001)

Lanes

  • meta/muse-spark-1.2: ok (0 finding(s), 31.4s, 66715+3003 tokens (7236 cached), 3 tool round(s), via Meta, $0.0882)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 204.2s, 246390+21722 tokens (204160 cached), 8 tool round(s), via Together, $0.0233)

Round 2 resolution

  • 🤝 r1-1 disputed — Bare fetch lacks authentication for private repositories: Current publish.yml still uses credential-free git init --bare / git fetch with "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" in both prepare and publish, but gh repo view pegma-dev/rate-limit --json isPrivate is false as the fixing agent states and the release design is explicitly public-repo/OIDC-only (RELEASING.md, publish.yml header "no token fallback"). Adding `GITHUB_…
  • ✅ r1-2 fixed correctly — Durable descriptor fast-path caches without revalidation: durable.ts now revalidates on every write/sweep: descriptorValidated replaced by descriptorEstablished set only when ensureDescriptor observes a descriptor, allow revalidates via ensureDescriptor(expected, createDescriptor) before any counter update and checks listVersioned for missing descriptor with existing rows, and sweep calls ensureDescriptor(expected, false) before listi…
  • 3 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 0 (0 bug-severity).

Warning

The PR head advanced after this review's diff was collected. This review is pinned to commit 3b6e07f and does not cover the newest push.

No structured findings from the successful lane(s).

Workflow run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 80058dbbd1da92bb05ccdd3e18ea6dfd93711a4c
Judge: openai/gpt-5.6-luna
Cost: $0.1316 (lanes $0.1315 + judge $0.0001)

Lanes

  • meta/muse-spark-1.2: ok (0 finding(s), 31.7s, 73977+3555 tokens (8132 cached), 3 tool round(s), via Meta, $0.0986)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 159.5s, 205137+27431 tokens (96768 cached), 4 tool round(s), via PrimeIntellect, $0.0329)

Round 2 resolution

  • 🤝 r1-1 disputed — Bare fetch lacks authentication for private repositories: Bare fetch remains credential-free (git init --bare + git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git fetch) in both prepare and publish jobs. Repository is public (gh repo view pegma-dev/rate-limit --json isPrivate = false) and workflow is deliberately scoped to public releases with OIDC-only publishing and persist-credentials: false. Keeping pre-checkout ver…
  • ✅ r1-2 fixed correctly — Durable descriptor fast-path caches without revalidation: Fixed in current packages/rate-limit/src/durable.ts: descriptorValidated cache replaced by descriptorEstablished+ensureDescriptor revalidation on every allow and sweep. Fresh path lists versioned rows to detect orphan windows (!hasDescriptor && rows.length>0 fails closed) and createDescriptor = !hasDescriptor; established path always calls ensureDescriptor(expected, false) which …
  • 3 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 0 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

@FlyOverCoderKY
FlyOverCoderKY merged commit add8160 into main Nov 6, 2026
3 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/harden-release-and-durable-windows branch November 6, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant