Skip to content

release: 2.0.0-alpha.2#80

Open
heskew wants to merge 1 commit into
mainfrom
release/2.0.0-alpha.2
Open

release: 2.0.0-alpha.2#80
heskew wants to merge 1 commit into
mainfrom
release/2.0.0-alpha.2

Conversation

@heskew
Copy link
Copy Markdown
Member

@heskew heskew commented May 12, 2026

Catches up the alpha track with the auth/dispatch fixes and the withOAuthValidation refactor that have been on main since 2.0.0-alpha.1 shipped on 2026-05-01. The published alpha predates the security-relevant work — anyone consuming @harperfast/oauth@alpha should upgrade.

Highlights

Breaking

  • withOAuthValidation now wraps a Resource class, not an instance. Covers both static and instance dispatch surfaces in Resource API v2.

Security

  • Fail-closed when requireAuth: true and no request context is available
  • Fail-closed when onValidationError returns undefined
  • Closed a static-method dispatch bypass (wrapping only instance methods left the static path uncovered)
  • onValidationError no longer sees a mutated request, and is no longer invoked without a request

Fixed

  • withOAuthValidation re-exported from the package entry point
  • withOAuthValidation reads request from getContext() (closes withOAuthValidation doesn't work with Resource API v2 classes #33)
  • Preserve 405 Method Not Allowed for unimplemented verbs (was being serialized as 204 No Content)
  • package-lock.json regenerated with all optional native deps

Added

  • Test coverage for the refactored withOAuthValidation (+1247 lines covering each verb, both dispatch paths, fail-closed branches, callback contract)
  • Integration test harness (integrationTests/) with Harper v5 fixtures
  • harper-mock helper for Node-only unit tests

Changed

  • Node.js 20 is no longer supported (Harper v5 / mock helper requires Node 22+)

Full notes in CHANGELOG.md.

Post-merge

  1. Merge this PR
  2. Create the GitHub release for v2.0.0-alpha.2 — the existing release.yml workflow publishes to npm on release: published, with --provenance --access public
  3. Verify @harperfast/oauth@alpha resolves to 2.0.0-alpha.2 on npm

🤖 Generated with Claude Code

Catches up the published alpha track with the auth/dispatch fixes
and the withOAuthValidation refactor that have been on `main` since
2026-05-01. `2.0.0-alpha.1` shipped the Harper v5 baseline but
predates the security-relevant work — anyone consuming the alpha
should upgrade.

Highlights:

- **Breaking**: `withOAuthValidation` now wraps a Resource class,
  not an instance. Covers both static and instance dispatch
  surfaces in Resource API v2.
- **Security**: fail-closed branches added across `requireAuth`,
  `onValidationError`, and no-context paths. Static-method dispatch
  bypass closed.
- **Fixed**: `withOAuthValidation` re-exported from the package
  entry, `405` preserved for unimplemented verbs, lockfile
  regenerated with optional native deps.
- **Added**: test/withOAuthValidation suite (+1247 lines),
  integration test harness, harper-mock test helper.
- **Changed**: Node 20 no longer supported.

Full notes in `CHANGELOG.md`.
@claude
Copy link
Copy Markdown

claude Bot commented May 12, 2026

Reviewed; no blockers found.

heskew added a commit to HarperFast/ai-review-prompts that referenced this pull request May 12, 2026
…→ gemini-3-flash-preview

The reusable shipped with `gemini-2.5-pro` as the default — wrong
tier (flagship instead of mid) AND now a generation behind. The
apples-to-apples peer of `_claude-review.yml`'s Claude Sonnet 4.6
(current-gen GA mid-tier) is Google's current-gen mid-tier Flash,
which today is `gemini-3-flash-preview`.

Calibration comparison is meaningful only when both sides run
current-gen. Defaulting to `gemini-2.5-flash` (last-gen) would
bias the comparison against Google.

The reusable's default is what new consumers get out of the box.
Consumers worried about preview-drift on every `pull_request` run
can override to `gemini-2.5-flash` (last GA mid-tier). The next
GA mid-tier — likely `gemini-3-flash` once Google drops the
`-preview` suffix — will be a one-line follow-up bump.

Side benefits (preserved from the original 2.5-pro → flash flip
rationale):
- Free-tier API access. Pro-tier requires billing on Google AI
  Studio free-tier projects; mid-tier Flash variants do not. The
  first dual-reviewer trial on HarperFast/oauth#80 failed with
  HTTP 429 `limit: 0, model: gemini-2.5-pro` — the Pro tier had
  zero free-tier allowance.
- Lower cost. PR review is bounded reasoning over a diff; the
  smaller model is sufficient and meaningfully cheaper at scale.
- Faster turnaround. Author waits less for a review.

Consumers that override to a Flash model today (e.g.
HarperFast/oauth's caller currently overriding to
`gemini-2.5-flash`) can drop the override once their pin bumps
past this commit and decide whether they want the new default or
their own pin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@heskew heskew closed this May 12, 2026
@heskew heskew reopened this May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

1 blocker found.

1. CI configuration regression (downgraded ai-review-prompts pins)

File: .github/workflows/claude-review.yml:27, .github/workflows/gemini-review.yml:37
What: The PR downgrades the ai-review-prompts reusable workflow pins from 128656e4 (2026-05-12) back to 3278ce4e and 9471cd80 (May 9th/early May 12th versions).
Why it matters: This regresses the CI environment, losing recent fixes already present in main (from #82), including the authorize-ai-workflow.sh rename and Gemini output-name fixes. This likely happened because the release branch was not rebased after #82 was merged.
Suggested fix: Restore both workflow pins to 128656e40c87c0e1293c542a5500df4f68dbff85 and update the accompanying comments to match the state in main.

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.

withOAuthValidation doesn't work with Resource API v2 classes

1 participant