Skip to content

Allow any audit quantity with every fifth free - #14

Merged
erinepshovel-code merged 4 commits into
mainfrom
audit-arbitrary-quantity
Sep 15, 2026
Merged

erinepshovel-code merged 4 commits into
mainfrom
audit-arbitrary-quantity

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Contributor

Replaces the fixed 1-or-5 audit tiers with arbitrary positive audit quantities while preserving the two-option decision surface.

  • Audit quantity choice is now one repository or multiple repositories; multiple accepts any positive integer quantity above one.
  • Pricing is $5 per audit with every fifth audit free: paid_count = repository_count - floor(repository_count / 5).
  • Stripe Checkout uses the existing $5 unit price with line-item quantity equal to paid_count.
  • Repository lists are bound to payment with count + SHA-256 digest, avoiding Stripe metadata limits for arbitrary quantities.
  • The browser resubmits the list after payment; the server verifies digest, count, paid/free counts, amount, and live payment state before running audits.
  • Lost browser session state can be recovered by re-entering the purchased repository list after payment verification.
  • Operator access accepts arbitrary positive repository counts with the same server-side access code.
  • Adds tests for arbitrary counts, fifth-free pricing, digest binding, and checkout quantity.
  • Updates HOSTED.md.

The old fixed five-repository Stripe price and the old direct payment links have been deactivated; Checkout Sessions are now the only hosted payment path.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 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
📝 Code Review Completed 2026-09-15T05:58:13.770167Z e618ea2 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.

@erinepshovel-code
erinepshovel-code merged commit 4e01b6e into main Sep 15, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e618ea2891

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread service.py
Comment on lines +182 to +183
if metadata.get("pricing_rule") != "every_fifth_free":
raise PermissionError("payment pricing rule is not recognized")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Continue accepting outstanding legacy checkout sessions

When this version is deployed while a Checkout Session created by the previous version is still open—or after payment but before its return is processed—the session contains pubskill_tier and repo_* metadata but no pricing_rule, so both /paid-info and /paid reject it here after the customer has paid. Retain the legacy tier verifier until all previously created sessions have expired or otherwise been redeemed.

Useful? React with 👍 / 👎.

Comment thread index.html
Comment on lines +430 to 431
sessionStorage.setItem("pubskill_pending_repos", JSON.stringify(repoUrls));
location.assign(result.checkout_url);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Let checkout proceed when session storage is unavailable

When browser storage is disabled or sessionStorage is over quota, setItem throws synchronously and the surrounding catch prevents location.assign from running, so the customer cannot reach the newly created Checkout Session. This is especially problematic because the added recovery flow is intended to support missing browser state; make persisting the pending list best-effort and redirect even if it fails.

Useful? React with 👍 / 👎.

Comment thread index.html
Comment on lines +494 to +497
} catch (error) {
status.textContent = error.message;
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fall back to recovery after stored repositories are rejected

When the tab contains a valid pending list from a different or abandoned checkout, submitPaid fails the repository digest check and this early return prevents the /paid-info recovery form from ever being shown. Because the storage key is not associated with a session ID, revisiting a paid return URL in that state leaves the customer stuck on the mismatch error; discard the stale entry and continue into the recovery path.

Useful? React with 👍 / 👎.

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