What an unlimited numeric limit is, and how it is stored and delivered #164
Closed
opened 2026-10-05 23:38:39 +00:00 by cgalo5758
·
2 comments
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Public launch
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#164
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The question
The designed data model (
design/data-model.md) says a limit of -1 means unlimited, but almost nothing built treats it that way:core.entitlement_set_ruleshas no sign rule.effectiveLimitininternal/entitlements/materialize.go), so an unlimited rule plus a rule for 10 materializes as 9.internal/integrations/fedwiki/web/api.go,web/partials.go,workflows/activities.go), so a limit of -1 lets no site be created.unlimitedLimitininternal/entitlements/rule_change.go).Is "unlimited" something a plan can grant? If so, how is it stored, how does it combine with other rules for the same resource key, and how does an integration receive it?
What depends on the answer
Options known so far
unlimitedLimitgoes away.Decided when
The entitlements model page states what an unlimited grant is and how it combines, and the rule form refuses whatever the answer makes invalid.
Settled: the console has no unlimited limit.
unlimitedLimitininternal/entitlements/rule_change.go).What the code does today: the rule form refuses a negative number in the row being edited (
entitlementSetRuleValueFieldininternal/server/operator_entitlement_set_forms.go), but the step that applies a staged change parses the value again without that check (ruleInputFromDeltaininternal/server/operator_entitlement_set_rule_change.go), and the database accepts a negative, so a crafted request stores one. A -1 stored that way would be added like any other number, so -1 and 10 give 9; it would stop every FedWiki create; and it would crash FedWiki's reconcile under the force-reduce policy, which slices the active sites at the limit (internal/integrations/fedwiki/workflows/reconcile.go).Answered and built: the console has no unlimited limit.
Stored. A limit is a whole number of zero or more wherever the console holds one: on a rule in an entitlement set (the list of what a plan grants), on each plan's contribution to an organization's pool (what the organization holds), and on the pool's total for a resource key. The rule form refuses a negative number, and so do CHECK constraints on all three columns, so -1 has no meaning anywhere. The rule-change preview compares usage with the limit as the number it is.
Combined. When several plans fund one resource key, their limits add as before. The sum stops at the largest value the column holds instead of wrapping to a negative number.
Why no unlimited value. Nothing a deployment hands out is truly without limit, and a real ceiling also stops a runaway script. A resource nobody intends to count is on-or-off access, which a boolean rule already grants.
Hiding a limit instead. "Unlimited" is really something a page says to a member, so an operator can hide a limit instead. A limit rule of 1 or more can be marked "Hide limit". While usage is below the limit, the member's pages show the count alone, with no limit and no bar, and a plan card names the resource without a number. FedWiki's sites card does the same. Once usage reaches the limit, the number shows again, so nobody is stopped by a ceiling they cannot see. When several plans fund one key, the limit is hidden if any of them hides it. Operator pages always show the number. The console never prints the word "unlimited": a lint check refuses it in the console's own copy, and text an operator writes on a product prints as given.
Delivered. A connected application receives the number. The hide mark is display only and is not part of what an application receives. The integration contract (#171) states that a numeric entry always carries a limit of zero or more.
The entitlements model page (
docs/models/entitlements.md) states the rule and how limits combine, and the rule form refuses a negative limit and a hidden limit below 1.