Skip to content

feat(portal): enforce fair use and show each client's priority level - #624

Merged
devantler merged 6 commits into
mainfrom
claude/portal-priority
Nov 16, 2026
Merged

devantler merged 6 commits into
mainfrom
claude/portal-priority

Conversation

@devantler

Copy link
Copy Markdown
Contributor

Stacked on #623 (add-ons). Review only this PR's commit.

The standard add-ons include two monthly feature-request priority tiers. With Standard (included), hosted projects' requests are picked up in a monthly round. Priority (400 a month) picks them up about weekly. Express (1,000 a month) starts work and replies within 1 business day. Fair use applies to every level: one request in progress per customer at a time. The terms text is #621, a draft for danish-law's review.

What changes

  • Level per customer. A client's level is the highest tier among the monthly add-ons of their orders that still bill: no withdrawal, and no end before this month. Otherwise it is Standard. It is derived, not stored separately, so it follows orders, ends and withdrawals with nothing to keep in sync. The operator's request page shows it.
  • Fair use enforced. A client with hosting cannot send a new request while another of theirs is in progress. They get a 409 with the reason in EN/DA, and keep what they typed. The check runs in the request's own transaction under a per-client advisory lock, so two at once cannot both pass. A retry of the same submission is not a second request. Clients without hosting have no limit; their requests are quoted.
  • Finished. The operator marks a request finished, or not going ahead, on its page (POST /operator/requests/{id}/finished, portal_request_closures, migration v26). The client can then send the next one. The page shows when it was finished.
  • Purge. The retention purge deletes a former client's closures, and counts them among a client's records.
  • The order gates control both. With them off there are no orders and no limit.

Tests

  • TestFairUseOneRequestInProgress: an Express order, a refused second request, the operator's view of the level and the request in progress, an idempotent "finished", then the next request admitted and a third refused.
  • TestFeatureLevels: Priority while the order bills, Standard after a withdrawal, and no limit without hosting.

Mutation checks on the refusal and the "still bills" condition are load-bearing. The frozen maintenance inventory still matches: the new alert renders nothing when absent. The full Go suite passes, and golangci-lint, vet, gofmt, jscpd and cspell are clean.

Part of #21

🤖 Generated with Claude Code

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for fair use: per-client advisory lock and in-progress check in persistRequest, derived priority level from billing orders, operator closure

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T02:49:47.415530Z 0db2aa7 Manual request
ℹ️ 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.

@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: 876bdc8aed

ℹ️ 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 server/internal/identity/priority.go Resolved
@devantler
devantler force-pushed the claude/portal-addons branch from 7bc39ef to 8453916 Compare November 16, 2026 00:38
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from 876bdc8 to d293d92 Compare November 16, 2026 00:38
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Re-review after the findings on the previous head were fixed (see the replies on each thread).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: d293d923a3

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

@devantler
devantler force-pushed the claude/portal-addons branch from 8453916 to 17a1650 Compare November 16, 2026 00:48
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from d293d92 to 358e044 Compare November 16, 2026 00:48
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from 358e044 to af94829 Compare November 16, 2026 00:49
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Review this PR's own commits; it is stacked on its base branch (rebased onto #625).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: af94829d34

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

@devantler
devantler force-pushed the claude/portal-addons branch from 5edcbec to 61fe284 Compare November 16, 2026 01:05
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from af94829 to 636e6b3 Compare November 16, 2026 01:05
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Review this PR's own commits; it is stacked on its base branch, now on #625's latest head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 636e6b3e31

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

@devantler
devantler force-pushed the claude/portal-addons branch from 61fe284 to 3a06b48 Compare November 16, 2026 01:29
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from 636e6b3 to bee8e02 Compare November 16, 2026 01:29
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review for Re-review this PR's own commits after rebasing onto main (#625 merged); findings on earlier heads are answered on their threads.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: bee8e02dbd

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

@devantler
devantler force-pushed the claude/portal-addons branch from 3a06b48 to 3164548 Compare November 16, 2026 01:47
Base automatically changed from claude/portal-addons to main November 16, 2026 02:26
devantler added a commit that referenced this pull request Nov 16, 2026
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from bee8e02 to 157ead2 Compare November 16, 2026 02:28
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 157ead276d

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.37s
✅ CSS stylelint 1 0 0 0 1.37s
✅ GO golangci-lint yes yes no no 121.55s
✅ GO revive 189 0 0 0.82s
✅ HTML djlint 5 0 0 2.03s
✅ HTML htmlhint 5 0 0 0.51s
✅ JSON jsonlint 2 0 0 0.09s
✅ JSON prettier 2 0 0 0 0.72s
✅ JSON v8r 2 0 0 0.95s
✅ MARKDOWN markdownlint 17 0 0 0 1.29s
✅ MARKDOWN markdown-table-formatter 17 0 0 0 0.43s
✅ REPOSITORY betterleaks yes no no 0.72s
✅ REPOSITORY checkov yes no no 14.86s
✅ REPOSITORY git_diff yes no no 0.12s
✅ REPOSITORY grype yes no no 155.2s
✅ REPOSITORY osv-scanner yes no no 144.38s
✅ REPOSITORY secretlint yes no no 1.01s
✅ REPOSITORY syft yes no no 2.38s
✅ REPOSITORY trivy yes no no 10.85s
✅ REPOSITORY trivy-sbom yes no no 0.21s
✅ REPOSITORY trufflehog yes no no 2.85s
✅ SPELL cspell 216 0 0 4.62s
✅ SPELL lychee 24 0 0 123.33s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters COPYPASTE_JSCPD,CSS_STYLELINT,GO_GOLANGCI_LINT,GO_REVIVE,HTML_DJLINT,HTML_HTMLHINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@github-code-quality

github-code-quality Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Go

Go / code-coverage/go

main claude/portal-priori... 0db2aa7 +/-
— 78% —

Line coverage data for the main branch is not yet available.

View coverage of the 10 most covered files.
File main claude/portal-priori... 0db2aa7 +/-
internal/identity/browser.go — 90% —
internal/webapp/app.go — 89% —
internal/identity/contact.go — 89% —
internal/custom...ity/material.go — 85% —
internal/identity/request.go — 81% —
internal/identi...ork_approval.go — 79% —
internal/identity/card.go — 78% —
internal/identi...l_acceptance.go — 77% —
internal/identity/order.go — 76% —
internal/identity/billing.go — 69% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 16, 2026 02:59 UTC

devantler and others added 6 commits November 16, 2026 03:41
The standard add-ons include two feature-request priority tiers,
Priority and Express, with fair use: one request in progress per
customer at a time.

- A client's level is the highest tier among the monthly add-ons of
  their orders that still bill, else Standard; the operator's request
  page shows it.
- A client with hosting cannot send a new request while another of
  theirs is in progress. The check runs in the request's transaction
  under a per-client advisory lock; a retry is not a second request.
- The operator marks a request finished on its page
  (portal_request_closures, migration v26), and the client can then
  send the next one.
- The retention purge deletes a former client's closures too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review on #624: a retry of a submission that already exists is
not a new request, so it keeps its receipt even while another request
is in progress, as REQUESTS.md documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jscpd found the Express order and the new-request form repeated across
the fair-use tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
djlint H015 on #624: the feature-request line sat on the heading's
line. It now opens the next line, so the page renders the same text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler
devantler force-pushed the claude/portal-priority branch from 157ead2 to 0db2aa7 Compare November 16, 2026 02:47
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 0db2aa75df

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

@devantler
devantler marked this pull request as ready for review November 16, 2026 03:02
@devantler
devantler requested a review from a team as a code owner November 16, 2026 03:02
@devantler
devantler merged commit eca1176 into main Nov 16, 2026
40 checks passed
@devantler
devantler deleted the claude/portal-priority branch November 16, 2026 03: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