Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

chore(entitlement): remove retired issue count compatibility fixtures (#10812)

Multica Eve6fc64f22cc4b
diff --git a/packages/core/api/schema.test.ts b/packages/core/api/schema.test.ts
index 0b78b4e704..3b59ec61f1 100644
--- a/packages/core/api/schema.test.ts
+++ b/packages/core/api/schema.test.ts
@@ -1562,8 +1562,6 @@ describe("workspace subscription contract", () => {
status: "active",
seats: 3,
limits: {
- // Retired limit Cloud may still send; the client ignores it.
- issue_count: { mode: "unlimited" },
autopilot_runs: { mode: "unlimited" },
},
current_period_end: "2026-09-01T00:00:00Z",
diff --git a/server/internal/entitlement/README.md b/server/internal/entitlement/README.md
index 885908a3ed..41fb9a5dc8 100644
--- a/server/internal/entitlement/README.md
+++ b/server/internal/entitlement/README.md
@@ -39,16 +39,13 @@ The client reads:
period. A malformed notification policy is ignored without invalidating an
otherwise valid enforcement gate.
-Deploy Cloud policy revision 2 before the Multica consumer. The consumer treats
-a missing notification policy as notices-disabled while continuing to enforce
-the quota. The reverse order is safe because older consumers ignore the
-additive notification fields.
+No deployment order is required for the optional notification policy. The
+consumer treats a missing policy as notices-disabled while continuing to
+enforce the quota.
-Responses tolerate unknown JSON fields for additive compatibility, including
-gates this consumer does not read: Cloud may keep sending the retired
-`issue_count` gate to older consumers, and it is ignored here. Unknown
-schema/action, malformed fields, a missing `autopilot_runs` gate, HTTP failures, and timeouts fail
-open.
+Responses tolerate unknown JSON fields and gates for additive compatibility.
+Unknown schema/action, malformed fields, a missing `autopilot_runs` gate, HTTP
+failures, and timeouts fail open.
## Cache and degradation
diff --git a/server/internal/entitlement/client.go b/server/internal/entitlement/client.go
index b22a5bda85..9c245671fb 100644
--- a/server/internal/entitlement/client.go
+++ b/server/internal/entitlement/client.go
@@ -280,8 +280,7 @@ func normalizePolicy(wire wirePolicy) (fetchedPolicy, error) {
wire.ValidUntil.IsZero() || wire.ValidForSeconds <= 0 || wire.ValidForSeconds > int64(maxPolicyTTL/time.Second) {
return fetchedPolicy{}, ErrInvalidPolicy
}
- // Gates this consumer does not know are ignored, so Cloud can keep sending
- // retired gates (such as issue_count) to older consumers during a rollout.
+ // Unknown gates are ignored for additive compatibility.
gates := make(map[GateName]Gate, 1)
for _, name := range []GateName{GateAutopilotRuns} {
wireGate, ok := wire.Gates[string(name)]
diff --git a/server/internal/entitlement/client_test.go b/server/internal/entitlement/client_test.go
index 77048fae89..2b16cc26ec 100644
--- a/server/internal/entitlement/client_test.go
+++ b/server/internal/entitlement/client_test.go
@@ -607,7 +607,6 @@ func newTestClient(t *testing.T, baseURL string, mutate func(*Config)) *Client {
func samplePolicy(policyRevision, subscriptionVersion, validForSeconds int64, autopilotAction Action) wirePolicy {
autopilotLimit := testAutopilotLimit
- retiredIssueLimit := 1000
periodStart := time.Date(2026, 8, 1, 0, 0, 0, 0, time.UTC)
periodEnd := periodStart.AddDate(0, 1, 0)
autopilotGate := wireGate{Action: string(autopilotAction)}
@@ -627,9 +626,6 @@ func samplePolicy(policyRevision, subscriptionVersion, validForSeconds int64, au
ValidUntil: time.Date(2030, 1, 1, 0, 0, 0, 0, time.UTC),
ValidForSeconds: validForSeconds,
Gates: map[string]wireGate{
- // Cloud may keep sending the retired issue_count gate to older
- // consumers; this consumer must ignore it.
- "issue_count": {Action: string(ActionEnforce), Limit: &retiredIssueLimit},
string(GateAutopilotRuns): autopilotGate,
},
}
@@ -710,23 +706,3 @@ func (o *recordingObserver) snapshot() (cache, refresh, decisions []string, regr
return append([]string(nil), o.cache...), append([]string(nil), o.refresh...),
append([]string(nil), o.decisions...), o.versionRegressions
}
-
-func TestRetiredIssueCountGateDoesNotAffectPolicy(t *testing.T) {
- for _, tc := range []struct {
- name string
- mutate func(*wirePolicy)
- }{
- {"absent", func(p *wirePolicy) { delete(p.Gates, "issue_count") }},
- {"unreadable", func(p *wirePolicy) { p.Gates["issue_count"] = wireGate{Action: "future"} }},
- } {
- t.Run(tc.name, func(t *testing.T) {
- server := httptest.NewServer(policyHandler(tc.mutate))
- defer server.Close()
- client := newTestClient(t, server.URL, nil)
- decision := client.Gate(context.Background(), uuid.New(), GateAutopilotRuns)
- if decision.Gate.Action != ActionEnforce || decision.Reason != ReasonRefreshed {
- t.Fatalf("decision = %+v", decision)
- }
- })
- }
-}