Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
revert(commercial): restore self-hosted opt-in posture
rcourtman5ff0855882cd
diff --git a/docs/PRIVACY.md b/docs/PRIVACY.mdindex 827661007b..f953af622e 100644--- a/docs/PRIVACY.md+++ b/docs/PRIVACY.md@@ -108,7 +108,6 @@ Every field is listed below with the reason it exists. Nothing else is included| SSO enabled | `true`/`false` | See whether single-sign-on support is being used || Multi-tenant | `true`/`false` | See whether multi-tenant/runtime-org features are being used || Paid license | `true`/`false` | Distinguish free from paid posture without sending the exact commercial tier |-| Business estate | `true`/`false` | Mark whether the resource counts above cross a business-scale threshold, derived on the install from counts already in this payload; no extra infrastructure detail is sent || Has API tokens | `true`/`false` | See whether token-based automation/integration is being used without sending token counts || RBAC custom roles | `3` | Count roles created by the operator, excluding the roles that ship built in, without sending role names, permissions, or scopes || RBAC user assignments | `7` | Count user-to-role assignments without sending usernames, role names, or permissions |diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.jsonindex 720aece4b4..5d261320d0 100644--- a/docs/release-control/v6/internal/status.json+++ b/docs/release-control/v6/internal/status.json@@ -9198,20 +9198,7 @@"coverage_gaps": [],"candidate_lanes": [],"work_claims": [],- "open_decisions": [- {- "id": "self-hosted-commercial-surfaces-owner-approval",- "summary": "Choose whether to retain or revert the complete 2026-08-07 self-hosted commercial-surface cluster. The landed cluster exposes reactive paid navigation, inline gates, Plans & Billing, and one proactive business-estate card to ordinary free self-hosted sessions, then adds schema-v8 business-estate telemetry and checkout-source attribution across pulse and pulse-pro. Its original quantitative rationale is not exactly reproducible, its paid-license percentages were mislabeled as conversion, and no durable artifact confirms project-owner approval. A narrower posture requires a new explicit product decision rather than a partial implicit approval.",- "owner": "project-owner",- "blocking_level": "rc-ready",- "status": "owner-action",- "opened_at": "2026-08-08",- "lane_ids": [- "L2"- ],- "subsystem_ids": []- }- ],+ "open_decisions": [],"source_of_truth_file": "docs/release-control/v6/internal/SOURCE_OF_TRUTH.md","resolved_decisions": [{@@ -10094,6 +10081,19 @@"L12","L17"]+ },+ {+ "id": "self-hosted-commercial-surfaces-opt-in-posture",+ "summary": "The project owner chose the complete revert of the 2026-08-07 self-hosted commercial-surface cluster. Ordinary free self-hosted sessions return to the prior opt-in commercial posture; the proactive business-estate prompt and telemetry, checkout-source attribution, and newly broadened reactive paid entry points are removed. Any narrower reintroduction requires a new explicit product decision with reproducible evidence.",+ "kind": "release-policy",+ "decided_at": "2026-08-08",+ "subsystem_ids": [+ "cloud-paid"+ ],+ "lane_ids": [+ "L2",+ "L3"+ ]}]}diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex d86ccccf59..fefd6e3a75 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -3077,14 +3077,13 @@ records for private Pro runtime hooks. Lifecycle-adjacent flows must treatthose records as executable-runtime identity, not as agent enrollment,installer success, or lifecycle capability evidence, and must leave privateruntime download guidance to the licensing/settings surfaces that own it.-The same presentation-policy split still governs paid lifecycle extensions in-ordinary self-hosted v6 installs, under the revised default (2026-08-07-commercial-surfaces revision): `presentationPolicy.hideUpgrade` is no longer-forced true outside hosted mode, but wherever it is true (demo mode,-white-label runtimes) default Infrastructure navigation must not advertise-agent-profile upgrades, trial prompts, or paid helper links. Agent lifecycle-flows themselves carry no commercial content either way; the revision changes-browser presentation posture only, not agent auth, registration, or the+The same presentation-policy split governs paid lifecycle extensions in+ordinary self-hosted v6 installs. `presentationPolicy.hideUpgrade` defaults+true for free self-hosted sessions, and demo mode or white-label runtimes also+force the stronger commercial suppression boundary. Default Infrastructure+navigation must not advertise agent-profile upgrades, trial prompts, or paid+helper links. Agent lifecycle flows themselves carry no commercial content.+This presentation posture does not alter agent auth, registration, or thesecurity-status auth snapshot.The normal Infrastructure installer also follows that contract. Agent-commandexecution controls may describe the runtime trust and command-execution effect,@@ -5984,19 +5983,6 @@ ack invokes the hook — observer acks never steer the updater`TestAgentSendReport_ObserverAckNeverInvokesCallback`).`agentupdate.Config.InitialCheckDelay` overrides the five-second initial checkdelay; zero keeps the default.-### Session-capability estate classification delegates to monitoring--The business-estate marker on the authenticated session-capability surface-(`internal/api/security_status_capabilities.go`, an extension point of this-subsystem's agent routes) no longer carries its own threshold constants:-`businessScaleEstateCounts` now delegates to the monitoring-owned definition-in `internal/monitoring/business_estate.go`, which the schema-v8 telemetry-`business_estate` field also classifies against. Behavior is unchanged — the-agent-host counting inputs (Docker hosts from read state, VMware agent-type-unified resources) and the pinned thresholds-(`TestContract_BusinessScaleEstateThresholds`) are identical; only the source-of the numbers moved, so the card cohort and the telemetry cohort cannot-drift.### Purchase-start attribution does not touch agent routesThe `source` attribution parameter added todiff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 6d2263ee2d..306729dc41 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -3119,12 +3119,9 @@ query...`, and `Reading storage...` before streamed tool arguments areevidence must remain independent from Assistant session, handoff, and drawerstate, and browser-local Assistant or resource metadata must not resolveplatform navigation on an otherwise evidence-free first load. The app- shell's global prompt mounts (GitHub star and, since the 2026-08-07- commercial-surfaces revision, the one-shot business-estate card) stay- behind the kiosk/settings-access gate and outside every AI runtime- surface: Assistant, Patrol, Actions, and Discovery chrome must not host- commercial prompts, and the business-estate card must not read or alter- Assistant or Patrol state.+ shell's global GitHub-star prompt stays behind the kiosk/settings-access+ gate and outside every AI runtime surface. Assistant, Patrol, Actions, and+ Discovery chrome must not host commercial prompts.Reloaded Assistant sessions may consume the backend-owned`handoff_summary` only as safe presentation state and a Patrol findingpointer; hidden model context, command payloads, preflight data, and actiondiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 6302588cf0..b63a285464 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -5230,17 +5230,14 @@ runtime contract for `demoMode`, `readOnly`,must therefore defer their first read until that policy has resolved, sopublic demos fail closed without probing hidden commercial routes duringbootstrap.-For ordinary self-hosted v6 installs, that same security-status contract owns-the revised commercial posture (2026-08-07, supersedes the 2026-04-25 opt-in-posture; see records/self-hosted-commercial-surfaces-revision-2026-08-07.md):-`hideUpgrade` and `hideCommercial` default to false and are forced true only-for demo mode and white-label runtimes. API consumers must still treat them as-the prompt-suppression contract for upgrade links, plan upsells, and-commercial navigation rather than as a billing entitlement change. The-authenticated `sessionCapabilities` payload additionally carries-`businessEstate`, a business-scale estate marker for free installs; it must-never move onto the pre-auth presentation policy, because the public response-would leak estate size to anonymous visitors.+For ordinary free self-hosted v6 installs, that same security-status contract+owns the opt-in commercial posture: `hideUpgrade` defaults true so navigation,+upgrade links, plan upsells, and proactive prompts fail closed. Hosted sessions+and installs with existing paid, activation, or recovery context may receive+`hideUpgrade=false`. `hideCommercial` remains the stronger suppression boundary+for demo mode and white-label runtimes. API consumers must treat both fields as+presentation policy rather than as billing entitlement truth, and direct+activation or recovery routes remain separately routeable.That same contract split also makes the licensing boundary explicit:`/api/license/runtime-capabilities` is the public runtime feature contract,`/api/license/commercial-posture` is the non-billing upgrade posture@@ -9031,26 +9028,6 @@ together: `type Ping struct` in `internal/telemetry/telemetry.go`, theRetired columns stay in the live receiver database rather than being dropped:migrations only add, the columns hold real rows from the schema-v6 window, andnothing writes them once the receiver struct loses the fields.-### Telemetry payload parity spans three surfaces at schema v8--The outbound telemetry contract stays defined in exactly three places that move-together: `type Ping struct` in `internal/telemetry/telemetry.go`, the-`var ping struct` receiver in the private license server, and-`export interface TelemetryPingPreview` in-`frontend-modern/src/api/settings.ts`, all checked by-`scripts/check_telemetry_schema_parity.py`. Schema v8 adds `business_estate`,-a boolean the install derives inside the `pkg/server` snapshot closure from-the same `AggregateInstallSnapshotCounts` values the payload already carries.-The thresholds (>=5 PVE nodes, >=10 Docker hosts, or >=3 VMware hosts) live in-exactly one place, `internal/monitoring/business_estate.go`, and the-session-capability surface that drives the in-product business-estate card-(`internal/api/security_status_capabilities.go`) delegates to that same-definition, so the card cohort and the telemetry cohort cannot drift apart-(`TestContract_BusinessScaleEstateThresholds`,-`TestInstallSnapshotCountsBusinessScaleEstate`). The flag reveals nothing the-resource counts in the payload do not already reveal; it exists so-receiver-side cohort queries keep a stable column even if the thresholds-change in a later schema.### Per-tenant resource stores are released on offboarding and shutdown`ResourceHandlers.getStore` opens a SQLite handle per org and caches it for the@@ -9076,24 +9053,6 @@ router echoes it end-to-end on enrollment acks(`TestHostAgentRemovalLifecycleThroughAuthenticatedRouterAndRestart`). Agentsuse it to trigger an immediate self-update check after a server upgrade. Thefield is additive: agents that predate it ignore it.-### Checkout start forwards attribution in the handoff body, never the portal URL--`GET /auth/license-purchase-start` accepts an optional `source` query-parameter alongside `feature`. It is validated in-`internal/api/licensing_handlers.go` against the same closed kebab vocabulary-the frontend emits (`normalizeSelfHostedPurchaseSource`); anything else is-dropped rather than forwarded. Like `feature`, `source` is added to the-skip list in `pulseAccountUpgradeURLForRequest`, so it never reaches the-browser-visible Pulse Account portal redirect; it travels only inside the-`CreateCheckoutPortalHandoff` request body, where `omitempty` keeps-source-less installs compatible with a license server that predates the-field. The cancelled-checkout return URL echoes a valid source back onto the-plan route (`licensePurchaseActivationRedirectPathWithSource`) so a retry-keeps the surface that started it. Unrelated query parameters keep their-existing pass-through behavior.-`TestContract_CheckoutStartSourceAttributionReachesHandoffNeverPortal` pins-both the forwarding and the drop of a malformed value.-### Security status serves an infrastructureRead settings capability`GET /api/security/status` adds `settingsCapabilities.infrastructureRead` to thediff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.mdindex c6eb10e377..e5777c7e86 100644--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md@@ -1316,27 +1316,22 @@ hands-on Patrol modes, issue investigation, verified fixes, and longer history`.pricing/checkout, upgrade-metrics, or infrastructure-onboarding analyticsfields, controls, routes, stores, or startup DB artifacts to normal productusers.-17. Keep ordinary self-hosted v6 commercial surfaces reactive and- policy-governed (2026-08-07 revision, supersedes the 2026-04-25 opt-in- posture; see- records/self-hosted-commercial-surfaces-revision-2026-08-07.md). Default- free self-hosted browser surfaces show paid-feature settings navigation- with panel-owned inline gates, render gate CTAs, and keep Plans & Billing- discoverable including the MSP/provider path with its self-issued- evaluation. Exactly one proactive commercial surface is allowed: the- one-shot business-estate card driven by the authenticated- `sessionCapabilities.businessEstate` flag, shown only to free installs- and permanently dismissible in a single interaction.- `presentationPolicy.hideUpgrade` remains the suppression contract and is- forced true for demo mode and white-label runtimes (which covers MSP- tenant containers); every commercial surface must keep honoring it- wherever it is true. Trial CTAs, hosted handoff prompts, and- monitored-system limit pressure stay out of default self-hosted UI. The- authenticated app shell must still skip background- `/api/license/commercial-posture` bootstrap while- `presentationPolicy.hideUpgrade` is true; explicit self-hosted plan,- activation/recovery, and prompt-allowed flows may refresh the shared- posture store.+17. Keep ordinary self-hosted v6 commercial surfaces explicitly opt-in under+ the 2026-04-25 posture. Default free self-hosted browser surfaces hide+ paid-feature settings navigation, Plans & Billing navigation, upgrade+ calls to action, trial ceremony, hosted handoff prompts, and proactive+ commercial cards. Direct plan, activation, recovery, and feature-gate+ routes remain available for an operator who deliberately enters that+ context. Hosted sessions and installs with an existing paid, activation,+ or recovery context may expose the corresponding navigation.+ `presentationPolicy.hideUpgrade` is the fail-closed navigation and prompt+ contract. Demo mode and white-label runtimes also force+ `hideCommercial`, which keeps all commercial surfaces suppressed for demos,+ kiosks, and MSP tenant containers. The authenticated app shell must still+ skip background `/api/license/commercial-posture` bootstrap while the+ presentation policy forbids the relevant commercial surface. Explicit+ self-hosted plan, activation, recovery, and prompt-allowed flows may+ refresh the shared posture store.18. Keep hosted and trial billing construction separate from retired hosted-AIquickstart inventory: `pkg/licensing/trial_start.go` and hostedentitlement refresh paths may preserve historical billing fields for old@@ -1411,30 +1406,6 @@ hands-on Patrol modes, issue investigation, verified fixes, and longer history`.scope-limited session gets the temporary header reveal instead. Theblocked-route redirect and the banner block must stay active for ascope-limited session even when kiosk is off.-30. Keep checkout source attribution closed-vocabulary, authenticated-only,- and out of browser-visible portal URLs. In-app upgrade CTAs stamp a- `source` token (`gate-<feature>`, `estate-card`, or the `plans-page`- default) onto the owned billing plan route and the authenticated- `/auth/license-purchase-start` URL- (`frontend-modern/src/utils/pricingHandoff.ts`); the public `/pricing`- route and the public pricing URL never carry it, and- `getSelfHostedPurchaseStartUrl` scrubs it from forwarded query strings so- a crafted website link cannot claim in-app attribution. Server-side,- `HandleCheckoutStart` validates the token against the closed kebab- pattern, sends it only inside the `CreateCheckoutPortalHandoff` body- (`omitempty`, so source-less requests stay compatible with older license- servers), skip-lists it from the Pulse Account portal redirect query, and- echoes it onto the cancel return so a retry keeps its origin- (`TestHandleCheckoutStart_SourceAttributionReachesHandoffNeverPortal`).- The license server persists it on the checkout intent and stamps Stripe- session metadata `checkout_source`, with `checkout_origin` now honestly- split: `pulse_app` for intent-resolved sessions, `pulserelay_landing`- only for the public landing funnel- (`TestHandleCheckoutSessionCreate_CarriesSourceAttributionToStripe`,- `TestCreateStripeCheckoutSessionKeepsLandingOriginWithoutIntent`).- Deploy ordering: the license server must carry the `source` field before- a Pulse release that sends it, because the handoff body decodes strictly.-## Current StateThe approved commercial contract is recorded in@@ -2156,9 +2127,9 @@ Browser and shell coverage now guard that retired boundary:`tests/integration/scripts/retired-trial-acquisition-contract.sh` must expect `404` from theretired route and prove entitlements remain unchanged. The paid-prompt browserproof in `tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.ts`-must keep trial CTAs and hosted handoff prompts out of the default-self-hosted UI while proving paid-feature navigation stays visible with-panel-owned inline gates (2026-08-07 commercial-surfaces revision).+must keep trial CTAs, hosted handoff prompts, paid-feature navigation, and+Plans & Billing navigation out of the default free self-hosted UI while keeping+explicit direct routes available for activation and recovery.`scripts/tests/test-retired-trial-acquisition-docs.sh` guards the same documentation postureso active operator docs and eval metadata describe the retired route instead ofthe old hosted-signup acquisition contract.diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 8654ee1a5e..c706410aed 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -230,22 +230,15 @@ puts the same machine on two surfaces that do not share an identity.Settings navigation discoverability is part of the shared settings-shellboundary. A settings route that is available in normal commercial presentationmust be reachable through the sidebar unless it is explicitly a hidden-deep-link flow. The self-hosted `Plans` page is not a deep-link-only flow:-`system-billing` stays visible whenever commercial presentation is allowed,-while demo or commercial-suppressed sessions may still hide it.-`system-relay` (Remote Access) is likewise not a deep-link-only flow: its nav-item stays visible without the `relay` feature so Relay remains discoverable-to free installs, and the panel-owned feature gate — not nav hiding —-communicates the paid boundary. Capability-based hiding (`relayRead`) still-applies; feature-based `hideWhenUnavailable` must not be reintroduced on that-item. Per the 2026-08-07 self-hosted commercial-surfaces revision-(`records/self-hosted-commercial-surfaces-revision-2026-08-07.md`), the same-rule extends to `support-reporting`, `security-roles`, `security-users`,-`security-audit`, and `security-webhooks`: their nav items stay visible-without the paid feature, the panel-owned gates communicate the paid-boundary, capability-based hiding still applies, and feature-based-`hideWhenUnavailable` must not be reintroduced on them. The `multi_tenant`-organization items are deliberately excluded and keep `hideWhenUnavailable`.+deep-link flow. Ordinary free self-hosted sessions use the explicit opt-in+boundary: `system-billing` is hidden from navigation while+`presentationPolicy.hideUpgrade` is true, and paid-feature items including+`system-relay`, `support-reporting`, `security-roles`, `security-users`,+`security-audit`, and `security-webhooks` use `hideWhenUnavailable`. Their+direct routes remain available because the owning panels still handle explicit+activation, recovery, and feature-gate handoffs. Capability-based hiding still+applies independently, so a session that lacks route authority cannot mount a+panel merely because it has paid or recovery context.Candidate import-plan presentation inside the Infrastructure settings dialog isa shared primitive composition boundary. `NodeCandidateImportPlan.tsx` may use@@ -2037,10 +2030,10 @@ default` instead of fusing provider and badge text such asand keep adjacent settings-shell referrals such as`InfrastructureWorkspace.tsx` on that same shared owner instead ofreintroducing local “go to Pulse Pro” variants.- That same shared owner must also keep self-hosted commercial settings- discoverable: the nav label and page shell title use the shared- `Plans & Billing` label, and the owned plan shell must foreground the active- plan name plus available+ That same shared owner must keep self-hosted commercial settings coherent+ when deliberately reached: the direct route, page shell, and any navigation+ shown for paid or recovery context use the shared `Plans & Billing` label,+ and the owned plan shell must foreground the active plan name plus availablecapabilities before secondary billing or recovery detail so paid upgradescan confirm their entitlement immediately after activation without makingdefault Community look like it is missing an activation key.@@ -5857,12 +5850,13 @@ in `frontend-modern/src/components/Settings/settingsNavCatalog.ts`, so`shouldHideSettingsNavItem` and `shouldBlockSettingsRouteItem` withhold both thesidebar entry and the route from a session the backend says cannot read it.-This is a different gate from `system-relay` and `support-reporting`, which stay-visible without their paid feature so the panel can render its own upgrade-prompt. Infrastructure has no upgrade story: every endpoint behind it is+This is a different gate from `system-relay` and `support-reporting`. Paid+feature navigation is hidden from ordinary free sessions, but its panel-owned+direct route remains available for an explicit activation or recovery handoff.+Infrastructure has no such route exception: every endpoint behind it is`RequireAdmin`, so a non-admin got an all-empty page whose pollers logged a-warn-level denial on every tick. Hiding the item is what stops those pollers-mounting.+warn-level denial on every tick. Hiding and blocking the item is what stops+those pollers mounting.The same rule now covers the admin-only System tabs. `system-network`,`system-updates`, and `system-recovery` declarediff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 5bcfbb2a71..6451dd7e1a 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -2869,25 +2869,3 @@ Known and deliberately unchanged: each changed guest still triggers a full-filesave, so one poll cycle over N changed guests performs N marshals and N atomicwrites that serialize on the store mutex. Coalescing them is a behaviouralchange beyond the shutdown defect.-### Business-scale estate classification is monitoring-owned--`internal/monitoring/business_estate.go` holds the single definition of the-business-scale estate thresholds (>=5 PVE nodes, >=10 Docker hosts, or >=3-VMware hosts): exported constants,-`BusinessScaleEstateCounts`, and `InstallSnapshotCounts.BusinessScaleEstate`.-Both consumers delegate here rather than restating numbers: the authenticated-session-capability surface behind the in-product business-estate card-(`internal/api/security_status_capabilities.go`) and the schema-v8 telemetry-snapshot in `pkg/server`, which derives the `business_estate` boolean from the-same `AggregateInstallSnapshotCounts` values the ping already carries. The-counts-derived method is pinned by-`TestInstallSnapshotCountsBusinessScaleEstate`-(`internal/monitoring/canonical_guardrails_test.go`) and the threshold values-by `TestContract_BusinessScaleEstateThresholds` in `internal/api`; the-`pkg/server` wiring is pinned by-`TestTelemetrySnapshotDerivesBusinessEstateFromAggregateCounts`.-These thresholds are product segmentation constants only. They must not be-described as conversion evidence or as project-owner approval for the-commercial surface without a durable source, exact query, sanitized snapshot,-measurement time, and separate owner-confirmation record. The 2026-08-08-evidence audit records why the earlier causal wording does not meet that bar.diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.mdindex c67e6b7398..10d0c0fe60 100644--- a/docs/release-control/v6/internal/subsystems/security-privacy.md+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md@@ -1636,11 +1636,7 @@ availability fact through`/api/security/status.sessionCapabilities.assistantEnabled`, so generalsettings or security surfaces do not probe `/api/settings/ai` or otherassistant endpoints merely to decide whether dormant assistant chrome may be-opened. The same tiering rule protects estate size: the business-scale-marker `sessionCapabilities.businessEstate` (2026-08-07 commercial-surfaces-revision) is authenticated-session data and must never move onto the-pre-auth `presentationPolicy` payload, where it would disclose to anonymous-visitors that an install monitors a business-scale estate.+opened.Security status disclosure is tiered by construction: public callers receiveonly login/setup discovery, authenticated callers receive their own identityand capability context, and deployment, network, credential, token-hint,@@ -1992,20 +1988,6 @@ actor, and every audit row read stay on the install.`TestWithAuditReadActivity_RecordIsContentFree` and`TestRecordAuditReadActivity_RejectsUnknownActivity` pin both properties.-### Business-estate telemetry is classification, not new information--Schema v8's `business_estate` boolean is derived on the install, inside the-`pkg/server` telemetry snapshot closure, from the same aggregate resource-counts (`pve_nodes`, `docker_hosts`, `vmware_hosts`) the payload already-sends; no additional infrastructure detail leaves the install. It is the-telemetry counterpart of the authenticated-`sessionCapabilities.businessEstate` marker and classifies against the same-single threshold definition in `internal/monitoring/business_estate.go`. The-authenticated-only tiering rule above is unaffected: telemetry pings are-pseudonymous outbound payloads under the standing telemetry opt-out, not a-pre-auth API surface. Both PRIVACY.md copies document the field alongside the-counts it is derived from.-### Licensed-feature adoption fields must discriminate`telemetry.LicensedFeatureAdoptionFields` registers every telemetry field whosediff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex e9a627d4c1..957a65efda 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -3309,12 +3309,11 @@ items, recovery events, and latest points so PBS backups, TrueNAS snapshots,Kubernetes artifacts, and future providers all fit the same first-class UIframe without removing the source badges and row-level cues that make Proxmoxoperators productive.-License recovery keeps the same shape under the 2026-08-07-commercial-surfaces revision: the self-hosted license recovery section on the-Plans & Billing page (`SelfHostedCommercialRecoverySection` inside-`ProLicensePanel.tsx`) stays reachable and functionally unchanged while that-page gains commercial discoverability (MSP/provider section, visible plan-surfaces); recovery flows must not acquire commercial prompts of their own.+License recovery stays reachable through the direct Plans & Billing route.+`SelfHostedCommercialRecoverySection` inside `ProLicensePanel.tsx` remains+available for explicit activation and recovery even when the ordinary free+self-hosted navigation hides commercial surfaces. Recovery flows must not+acquire proactive commercial prompts of their own.Operator-facing filter and detail labels should likewise prefer `platform`wording over implementation-facing `provider` wording, so the recovery surfacedescribes the monitored platform families Pulse covers rather than exposing@@ -5072,25 +5071,6 @@ running server's version at router wiring timeingest path's persistence surface — agent-id continuity and host state — isunchanged by the echo(`TestHostAgentRemovalLifecycleThroughAuthenticatedRouterAndRestart`).-### Estate-threshold delegation leaves capability persistence untouched--`internal/api/security_status_capabilities.go` (named in this contract's-extension points) changed only in where its business-estate thresholds live:-it now delegates to `internal/monitoring/business_estate.go`, shared with the-schema-v8 telemetry `business_estate` field. The capability read path stays a-pure in-memory classification over monitor state — no storage surface, store-handle, or persistence behavior is introduced or altered-(`TestContract_BusinessScaleEstateThresholds` pins the unchanged thresholds).-### Purchase-start attribution persists nothing on the install--The `source` attribution parameter handled in-`internal/api/licensing_handlers.go` (named in this contract's extension-points) is request-scoped: it is validated, forwarded in the portal-handoff-body, and echoed onto the cancel return URL. It is never written to config-persistence, the license store, or any recovery artifact, so the install's-storage surface is unchanged. Attribution is retained only by the commercial-backend, on the checkout intent it already owns.-### Security status capability payload gained an infrastructure field`internal/api/` is a canonical reference in this contract's Extension Points, sodiff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex dc1d87ba49..0699a7c240 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,40 +1,71 @@{"version": 1,- "base_sha": "76f433c2f86159be3a741628873001975e95dedc",- "verified_at": "2026-08-08T08:56:14Z",+ "base_sha": "7d95a707bcedd82c48158d48e1d203d2c8ea9d07",+ "verified_at": "2026-08-08T15:41:56Z","result": "passed","changed_paths": [- "frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx"+ "frontend-modern/src/App.tsx",+ "frontend-modern/src/api/settings.ts",+ "frontend-modern/src/components/BusinessEstateCard.tsx",+ "frontend-modern/src/components/Settings/ProLicensePanel.tsx",+ "frontend-modern/src/components/Settings/settingsNavCatalog.ts",+ "frontend-modern/src/components/Settings/settingsNavVisibility.ts",+ "frontend-modern/src/components/Settings/settingsNavigationModel.ts",+ "frontend-modern/src/components/Settings/useProLicensePanelState.ts",+ "frontend-modern/src/components/Settings/useSettingsAccess.ts",+ "frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx",+ "frontend-modern/src/features/patrol/patrolAutonomyAvailability.ts",+ "frontend-modern/src/stores/sessionCapabilities.ts",+ "frontend-modern/src/types/config.ts",+ "frontend-modern/src/utils/pricingHandoff.ts"],"content_sha256": {- "frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx": "f75ab0102c54238b634fce3bb7662ef2fd2a5d819edd32cecf0689e49e35b517"+ "frontend-modern/src/App.tsx": "cf12ab5e6b1e96d1bdf7da889db49b88f4c3161fb60fa9b879400039b361f84c",+ "frontend-modern/src/api/settings.ts": "5347422cc84eb13f212e196cddaa45515446b445858ff95f9d1a6ba6810db6f7",+ "frontend-modern/src/components/BusinessEstateCard.tsx": "deleted",+ "frontend-modern/src/components/Settings/ProLicensePanel.tsx": "be6955b43cc09cd2bca41cdf3a93c2ebe2c6c95c8a893b777df6d9bae7d35fd1",+ "frontend-modern/src/components/Settings/settingsNavCatalog.ts": "a95ed0a83af7ba54755928b2fb4955481780240c03351f6b850f3b31d696dc5e",+ "frontend-modern/src/components/Settings/settingsNavVisibility.ts": "05407c809e71724694ba39a01288d3580bbe3c35ab7c5dee502ed0ab31364a13",+ "frontend-modern/src/components/Settings/settingsNavigationModel.ts": "94f00fe53960b3d7fda42ad7b226197e9fddf5b055cdda80615c75274f464ea0",+ "frontend-modern/src/components/Settings/useProLicensePanelState.ts": "7559445debf9afdd86d2e3c5f15a22e81f3eacc4e5bd185c54fe1fc586933f41",+ "frontend-modern/src/components/Settings/useSettingsAccess.ts": "42c586bdc3a5f91fdcd8c120bf65e4bd7105d5cc948defc6784ccf389ff631b4",+ "frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx": "de74125176e6d7421cec5717c963cd8e992f0ef0f11bf9304bb7b75c6f844658",+ "frontend-modern/src/features/patrol/patrolAutonomyAvailability.ts": "7f68482c556ef0164770ac81156a38c6dd3ef600bfa567240cf5ffaf0b517784",+ "frontend-modern/src/stores/sessionCapabilities.ts": "8e7557152025a5bdd99a8072b6283c4d3ec3c21ebbeab4f4464ee10308fa9e60",+ "frontend-modern/src/types/config.ts": "86778a683f7f259bb3eb0b47586ac177e82a953955538868cec25010585fd5ec",+ "frontend-modern/src/utils/pricingHandoff.ts": "d7b863c45a6f8d8a991e8aad99e03869aa50bb3ad525c9ab22a445c1607b4d4d"},"routes": [- "/settings (System > Network section)"+ "/settings/security-roles",+ "/settings/pulse-intelligence/billing/plan",+ "/settings/system-general",+ "/patrol"],"viewports": [- {- "width": 390,- "height": 844- },- {- "width": 768,- "height": 1024- },{"width": 1280,"height": 800+ },+ {+ "width": 390,+ "height": 844}],"states": [- "Public URL section default view with empty field showing the https FQDN placeholder",- "PULSE_PUBLIC_URL environment-override state: disabled input with amber override alert",- "Mobile 390x844 and tablet 768x1024 wrapped label/description with zero horizontal overflow"+ "Authenticated free self-hosted Roles route with presentationPolicy.hideUpgrade=true, no paid-feature or Plans & Billing navigation, and no trial, upgrade, hosted-handoff, or business-estate prompt.",+ "Authenticated free self-hosted direct Plans & Billing route with the Community plan visible while its sidebar navigation item remains absent.",+ "The refreshed responsive Settings shell kept direct content inside the 390-pixel viewport after a desktop-to-narrow resize and preserved the General route after mobile navigation.",+ "Commercial Roles and direct Plans & Billing states rendered from the final production frontend build at 1280x800 and 390x844 and were inspected from captured Chromium screenshots.",+ "Authenticated free self-hosted Patrol rendered only the Watch only mode, with no disabled paid-mode controls, Unlock Patrol modes copy, or Plans & Billing action at 1280x800 and 390x844.",+ "The production Patrol build remained within the 390-pixel viewport with no horizontal overflow, while the mode, run control, settings control, attention filters, and finding rows remained visible and usable."],"interactions": [- "Logged in at 1280x800 with real typed credentials and navigated Settings > System > Network via real clicks",- "Read the rendered label, description, and example copy via page text extraction and confirmed the exact new wording",- "Inspected the live input element: placeholder https://pulse.example.com, disabled by PULSE_PUBLIC_URL override",- "Re-rendered the section at 768x1024 and 390x844 (DOM-dispatched nav clicks; hidden-pane real input unavailable) and measured documentElement.scrollWidth == innerWidth at both"+ "Built the production frontend and local Pulse backend from the refreshed isolated candidate, authenticated through the managed Playwright backend, and mocked only the commercial posture, entitlements, runtime capabilities, and security status responses.",+ "Opened /settings/security-roles and verified default paid navigation and proactive commercial calls to action were absent while the deliberately reached Roles panel remained usable.",+ "Opened /settings/pulse-intelligence/billing/plan directly and verified the Plans & Billing panel and Community plan rendered without restoring its sidebar navigation item.",+ "Ran the canonical Settings shell matrix, resized direct Plans & Billing from desktop to 390x844, verified the content remained within the viewport, and navigated the narrow shell to General.",+ "Captured and inspected full-page screenshots for commercial desktop and narrow states.",+ "Built and embedded the final production frontend, opened /patrol against the isolated backend, confirmed Watch only was the sole free-session Patrol mode, and inspected captured desktop and narrow screenshots.",+ "Measured the 390-pixel Patrol document at a 390-pixel scroll width and verified the Run Patrol, Patrol settings, attention-state selector, refresh action, and finding list remained reachable without exposing paid-mode discovery."]}diff --git a/frontend-modern/public/docs/PRIVACY.md b/frontend-modern/public/docs/PRIVACY.mdindex 827661007b..f953af622e 100644--- a/frontend-modern/public/docs/PRIVACY.md+++ b/frontend-modern/public/docs/PRIVACY.md@@ -108,7 +108,6 @@ Every field is listed below with the reason it exists. Nothing else is included| SSO enabled | `true`/`false` | See whether single-sign-on support is being used || Multi-tenant | `true`/`false` | See whether multi-tenant/runtime-org features are being used || Paid license | `true`/`false` | Distinguish free from paid posture without sending the exact commercial tier |-| Business estate | `true`/`false` | Mark whether the resource counts above cross a business-scale threshold, derived on the install from counts already in this payload; no extra infrastructure detail is sent || Has API tokens | `true`/`false` | See whether token-based automation/integration is being used without sending token counts || RBAC custom roles | `3` | Count roles created by the operator, excluding the roles that ship built in, without sending role names, permissions, or scopes || RBAC user assignments | `7` | Count user-to-role assignments without sending usernames, role names, or permissions |diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsxindex 00f1f1c0cd..fdf5f0d0d2 100644--- a/frontend-modern/src/App.tsx+++ b/frontend-modern/src/App.tsx@@ -11,7 +11,6 @@ import { WhatsNewCard } from './components/WhatsNewCard';import { DemoBanner } from './components/DemoBanner';import { CommercialMigrationBanner } from './components/CommercialMigrationBanner';import { GitHubStarBanner } from './components/GitHubStarBanner';-import { BusinessEstateCard } from './components/BusinessEstateCard';// Modals are only mounted when opened, so their code can stay out of the// entry bundle until first use (same pattern as AIChat below).const KeyboardShortcutsModal = lazy(() =>@@ -536,7 +535,6 @@ function App() {<UpdateBanner /><WhatsNewCard /><GitHubStarBanner />- <BusinessEstateCard /><Show when={canReadUpdateStatus()}><GlobalUpdateProgressWatcher /></Show>diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.tsindex 58bbb2e65e..43740b9003 100644--- a/frontend-modern/src/__tests__/App.architecture.test.ts+++ b/frontend-modern/src/__tests__/App.architecture.test.ts@@ -722,22 +722,3 @@ describe('App architecture', () => {expect(appRuntimeStateSource).not.toContain('/api/license/entitlements');});});--// 2026-08-07 commercial-surfaces revision: the one-shot business-estate card-// is the only proactive commercial surface, and it must stay inside the same-// kiosk/settings-access mount gate as the other global prompts so kiosk-// sessions and viewers without settings access never see it.-describe('App commercial prompt mounting', () => {- it('mounts the business estate card behind the kiosk and settings-access gate', () => {- const gateStart = appSource.indexOf('<Show when={!kioskMode() && hasSettingsAccess()}>');- expect(gateStart).toBeGreaterThan(-1);- const gatedBlock = appSource.slice(- gateStart,- appSource.indexOf('<GlobalUpdateProgressWatcher />', gateStart),- );- expect(gatedBlock).toContain('<GitHubStarBanner />');- expect(gatedBlock).toContain('<BusinessEstateCard />');- // Exactly one mount, and only the gated one.- expect(appSource.split('<BusinessEstateCard />').length).toBe(2);- });-});diff --git a/frontend-modern/src/api/__tests__/settings.test.ts b/frontend-modern/src/api/__tests__/settings.test.tsindex 9c2a7c093e..d85e9a6663 100644--- a/frontend-modern/src/api/__tests__/settings.test.ts+++ b/frontend-modern/src/api/__tests__/settings.test.ts@@ -63,7 +63,6 @@ const mockTelemetryPreviewPayload = {sso_enabled: false,multi_tenant: false,paid_license: false,- business_estate: false,has_api_tokens: true,rbac_custom_roles: 0,rbac_user_assignments: 0,diff --git a/frontend-modern/src/api/settings.ts b/frontend-modern/src/api/settings.tsindex c0b77c4f84..8b0618fac8 100644--- a/frontend-modern/src/api/settings.ts+++ b/frontend-modern/src/api/settings.ts@@ -64,7 +64,6 @@ export interface TelemetryPingPreview {sso_enabled: boolean;multi_tenant: boolean;paid_license: boolean;- business_estate: boolean;has_api_tokens: boolean;rbac_custom_roles: number;rbac_user_assignments: number;diff --git a/frontend-modern/src/components/BusinessEstateCard.tsx b/frontend-modern/src/components/BusinessEstateCard.tsxdeleted file mode 100644index 01f6b42f46..0000000000--- a/frontend-modern/src/components/BusinessEstateCard.tsx+++ /dev/null@@ -1,179 +0,0 @@-import { Show, createSignal, createEffect, onCleanup } from 'solid-js';-import { useNavigate } from '@solidjs/router';-import {- createLocalStorageBooleanSignal,- createLocalStorageStringSignal,- STORAGE_KEYS,-} from '@/utils/localStorage';-import { useWebSocket } from '@/contexts/appRuntime';-import { sessionCapabilities } from '@/stores/sessionCapabilities';-import { presentationPolicyHidesUpgradePrompts } from '@/stores/sessionPresentationPolicy';-import {- getSelfHostedBillingHref,- PURCHASE_HANDOFF_SOURCE_ESTATE_CARD,- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,-} from '@/utils/pricingHandoff';-import { ActionIconButton, Button } from '@/components/shared/Button';-import BriefcaseIcon from 'lucide-solid/icons/briefcase';-import XIcon from 'lucide-solid/icons/x';--function getTodayDateString(): string {- return new Date().toISOString().split('T')[0];-}--// Deliberately local rather than in the STORAGE_KEYS registry: these keys are-// read nowhere else, and utils/localStorage.ts sits inside the-// deployment-installability verification blast radius.-const BUSINESS_ESTATE_DISMISSED_KEY = 'pulse-business-estate-dismissed';-const BUSINESS_ESTATE_FIRST_SEEN_KEY = 'pulse-business-estate-first-seen';--/**- * One-shot commercial prompt for free installs whose monitored estate crosses- * the backend's business-scale thresholds (sessionCapabilities.businessEstate).- * Deliberately stricter than the GitHub star prompt: every action dismisses- * permanently — there is no snooze loop, so an install sees this card once.- * It also waits until the star prompt has been interacted with, so the two- * cards never stack in the same corner.- */-export function BusinessEstateCard() {- const navigate = useNavigate();- const { initialDataReceived } = useWebSocket();-- const [dismissed, setDismissed] = createLocalStorageBooleanSignal(- BUSINESS_ESTATE_DISMISSED_KEY,- false,- );- const [firstSeenDate, setFirstSeenDate] = createLocalStorageStringSignal(- BUSINESS_ESTATE_FIRST_SEEN_KEY,- '',- );- const [starDismissed] = createLocalStorageBooleanSignal(- STORAGE_KEYS.GITHUB_STAR_DISMISSED,- false,- );- const [starSnoozedUntil] = createLocalStorageStringSignal(- STORAGE_KEYS.GITHUB_STAR_SNOOZED_UNTIL,- '',- );-- const [showCard, setShowCard] = createSignal(false);-- createEffect(() => {- if (dismissed()) {- setShowCard(false);- return;- }- if (!initialDataReceived()) {- setShowCard(false);- return;- }- if (presentationPolicyHidesUpgradePrompts()) {- setShowCard(false);- return;- }- if (sessionCapabilities().businessEstate !== true) {- setShowCard(false);- return;- }-- // The star prompt owns this corner until the user has interacted with it- // (dismissed or snoozed). Never show two asks at once.- const starInteracted = starDismissed() || starSnoozedUntil() !== '';- if (!starInteracted) {- setShowCard(false);- return;- }-- const today = getTodayDateString();- const firstSeen = firstSeenDate();-- // First qualifying day: record it, stay quiet. Never prompt on the same- // day the estate first crossed the threshold (or during initial setup).- if (!firstSeen) {- setFirstSeenDate(today);- setShowCard(false);- return;- }-- if (firstSeen !== today) {- setShowCard(true);- }- });-- const handleDismiss = () => {- setDismissed(true);- setShowCard(false);- };-- const handleSeePlans = () => {- setDismissed(true);- setShowCard(false);- navigate(- getSelfHostedBillingHref('plan', {- intent: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,- source: PURCHASE_HANDOFF_SOURCE_ESTATE_CARD,- }),- );- };-- createEffect(() => {- if (!showCard()) return;- const handleKeyDown = (event: KeyboardEvent) => {- if (event.key !== 'Escape') return;- handleDismiss();- };- document.addEventListener('keydown', handleKeyDown);- onCleanup(() => document.removeEventListener('keydown', handleKeyDown));- });-- return (- <Show when={showCard()}>- <section- class="fixed left-4 right-20 bottom-[calc(5rem+env(safe-area-inset-bottom,0px))] z-30 max-w-md overflow-hidden rounded-lg border border-border bg-surface text-base-content shadow-xl md:right-auto md:bottom-4"- aria-labelledby="business-estate-title"- aria-live="polite"- >- <div class="flex items-start gap-3 p-4">- <div- class="mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-surface-hover"- aria-hidden="true"- >- <BriefcaseIcon class="h-5 w-5 text-base-content" />- </div>-- <div class="min-w-0 flex-1">- <div class="flex items-start gap-2">- <div class="min-w-0 flex-1">- <h2 id="business-estate-title" class="text-sm font-semibold text-base-content">- Monitoring a business environment?- </h2>- <p class="mt-1 text-xs leading-5 text-muted">- Pulse is free and stays free. If it's earning its keep at work, the business plans- fund its development, and MSPs get a free 60-day evaluation.- </p>- </div>- <ActionIconButton- onClick={handleDismiss}- label="Close and don't show again"- title="Don't show again"- tone="muted"- size="sm"- type="button"- >- <XIcon class="h-4 w-4" aria-hidden="true" />- </ActionIconButton>- </div>- <div class="mt-3 flex flex-wrap gap-2">- <Button onClick={handleSeePlans} variant="primary" size="mdCompact" type="button">- See business plans- </Button>- <Button onClick={handleDismiss} variant="ghost" size="mdCompact" type="button">- This is a homelab- </Button>- </div>- </div>- </div>- </section>- </Show>- );-}diff --git a/frontend-modern/src/components/Settings/ProLicensePanel.tsx b/frontend-modern/src/components/Settings/ProLicensePanel.tsxindex 47f64b0554..4869850d66 100644--- a/frontend-modern/src/components/Settings/ProLicensePanel.tsx+++ b/frontend-modern/src/components/Settings/ProLicensePanel.tsx@@ -16,25 +16,6 @@ import {SELF_HOSTED_PRO_BILLING_RECOVERY_SECTION_ID,} from '@/utils/pricingHandoff';-const MSPProviderSection: Component = () => (- <div class="rounded-lg border border-border bg-surface px-4 py-4 text-sm">- <p class="font-semibold text-base-content">MSPs and multi-client providers</p>- <p class="mt-1 text-muted">- Run an isolated Pulse instance per client with central provisioning, backups, and branded- reporting. Plans start at $149/mo, and the provider bundle self-issues a free 60-day- evaluation.- </p>- <a- href="https://pulserelay.pro/msp"- target="_blank"- rel="noopener noreferrer"- class="mt-2 inline-block text-blue-500 hover:underline"- >- Learn more at pulserelay.pro/msp- </a>- </div>-);-const ProLicensePolicyLoadingPanel: Component = () => (<CommercialBillingShelltitle={SELF_HOSTED_PRO_BILLING_PRESENTATION.hiddenShellTitle}@@ -123,8 +104,6 @@ const ProLicensePanelContent: Component = () => {purchaseActivationNotice={state.purchaseActivationNotice()}/>- <MSPProviderSection />-<SelfHostedCommercialRecoverySectionsectionId={SELF_HOSTED_PRO_BILLING_RECOVERY_SECTION_ID}open={state.showRecoveryByDefault()}diff --git a/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsxindex 7d0bc81adc..49b985ca51 100644--- a/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx@@ -13,7 +13,6 @@ import {getSelfHostedBillingHref,getPublicPricingUrl,getSelfHostedPurchaseStartUrl,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,SELF_HOSTED_PRO_BILLING_PLAN_HREF,SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED,@@ -275,23 +274,6 @@ describe('ProLicensePanel', () => {expect(screen.queryByRole('link', { name: 'View plans' })).not.toBeInTheDocument();});- // 2026-08-07 commercial-surfaces revision: the plans page is the landing- // surface for business-estate prompts, so it must carry the MSP/provider- // path including the self-issued evaluation.- it('surfaces the MSP provider section with the self-issued evaluation', async () => {- renderPanel();-- await waitFor(() => {- expect(loadLicenseEntitlementsMock).toHaveBeenCalled();- });-- expect(screen.getByText('MSPs and multi-client providers')).toBeInTheDocument();- expect(screen.getByText(/Plans start at \$149\/mo/)).toBeInTheDocument();- expect(screen.getByText(/free\s*60-day evaluation/)).toBeInTheDocument();- const mspLink = screen.getByRole('link', { name: /pulserelay\.pro\/msp/i });- expect(mspLink).toHaveAttribute('href', 'https://pulserelay.pro/msp');- });-it('opens compare-plan checkout from the explicit self-hosted billing handoff', async () => {useLocationMock.mockReturnValue({search: `?intent=${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT}`,@@ -1151,11 +1133,7 @@ describe('ProLicensePanel', () => {purchase: SELF_HOSTED_PRO_BILLING_PURCHASE_CANCELLED,title: 'Checkout cancelled',actionLabel: 'View plans',- actionHref: getSelfHostedPurchaseStartUrl(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,- undefined,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,- ),+ actionHref: getSelfHostedPurchaseStartUrl(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT),redirectedHref: getSelfHostedBillingHref('plan', {intent: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,}),@@ -1164,11 +1142,7 @@ describe('ProLicensePanel', () => {purchase: SELF_HOSTED_PRO_BILLING_PURCHASE_EXPIRED,title: 'Upgrade return expired',actionLabel: 'View plans',- actionHref: getSelfHostedPurchaseStartUrl(- undefined,- undefined,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,- ),+ actionHref: getSelfHostedPurchaseStartUrl(),},{purchase: SELF_HOSTED_PRO_BILLING_PURCHASE_FAILED,@@ -1185,11 +1159,7 @@ describe('ProLicensePanel', () => {purchase: SELF_HOSTED_PRO_BILLING_PURCHASE_UNAVAILABLE,title: 'Pulse Account unavailable',actionLabel: 'Try again',- actionHref: getSelfHostedPurchaseStartUrl(- undefined,- undefined,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,- ),+ actionHref: getSelfHostedPurchaseStartUrl(),},])('shows the purchase arrival notice for $purchase',@@ -1445,11 +1415,7 @@ describe('ProLicensePanel', () => {compareLinks.some((link) =>link.getAttribute('href') ===- getSelfHostedPurchaseStartUrl(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,- undefined,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,- ),+ getSelfHostedPurchaseStartUrl(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT),),).toBe(true);expect(screen.queryByRole('button', { name: 'Hide counting rules' })).not.toBeInTheDocument();diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex 083376ae3c..be86bdde17 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -236,12 +236,7 @@ describe('settings architecture guardrails', () => {);});- // 2026-08-07 commercial-surfaces revision (see- // docs/release-control/v6/internal/records/- // self-hosted-commercial-surfaces-revision-2026-08-07.md): paid-feature- // tabs stay visible for free installs and their panels gate inline, while- // the multi_tenant organization tabs deliberately stay feature-hidden.- it('keeps paid-feature settings tabs visible with panel-owned inline gates', () => {+ it('keeps paid-feature settings navigation opt-in while direct panels own their gates', () => {const itemBlock = (id: string): string => {const start = settingsNavCatalogSource.indexOf(`id: '${id}'`);expect(start, `nav item ${id} present in catalog`).toBeGreaterThan(-1);@@ -256,21 +251,13 @@ describe('settings architecture guardrails', () => {'security-audit','security-webhooks','system-relay',- ]) {- expect(- itemBlock(id),- `${id} must stay visible without the paid feature (panel gates inline)`,- ).not.toContain('hideWhenUnavailable');- }-- for (const id of ['organization-overview','organization-access','organization-sharing','organization-billing','organization-billing-admin',]) {- expect(itemBlock(id), `${id} stays hidden without multi_tenant`).toContain(+ expect(itemBlock(id), `${id} stays hidden without its paid feature`).toContain('hideWhenUnavailable: true',);}@@ -312,11 +299,12 @@ describe('settings architecture guardrails', () => {);expect(pulseIntelligenceNavBlock?.[0]).toContain("id: 'system-billing'");const systemBillingNavBlock = settingsNavCatalogSource.match(- /id: 'system-billing',[\s\S]*?hideWhenCommercialHidden: true,\n\s*},/,+ /id: 'system-billing',[\s\S]*?hideWhenUpgradeHidden: true,\n\s*},/,);expect(systemBillingNavBlock?.[0]).toContain('label: SELF_HOSTED_PRO_BILLING_PRESENTATION.navLabel',);+ expect(systemBillingNavBlock?.[0]).toContain('hideWhenUpgradeHidden: true');expect(systemBillingNavBlock?.[0]).not.toContain('hideFromSidebar');const systemNavBlock = settingsNavCatalogSource.match(/id: 'system',[\s\S]*?id: 'support',/);expect(systemNavBlock?.[0]).not.toContain("id: 'system-billing'");@@ -325,14 +313,11 @@ describe('settings architecture guardrails', () => {expect(settingsNavCatalogSource).toContain("features: ['relay']");expect(settingsNavCatalogSource).toContain("features: ['advanced_reporting']");expect(settingsNavCatalogSource).toContain('hideWhenUnavailable: true');- // system-relay deliberately stays visible without the relay feature so- // Relay remains discoverable to free installs; the panel-owned upgrade- // gate communicates the paid boundary instead of nav hiding.const systemRelayNavBlock = settingsNavCatalogSource.match(/id: 'system-relay',[\s\S]*?requiredCapability: 'relayRead',\n\s*},/,);expect(systemRelayNavBlock?.[0]).toContain("features: ['relay']");- expect(systemRelayNavBlock?.[0]).not.toContain('hideWhenUnavailable');+ expect(systemRelayNavBlock?.[0]).toContain('hideWhenUnavailable: true');expect(settingsHeaderMetaSource).toContain('title: SELF_HOSTED_PRO_BILLING_PRESENTATION.shellTitle',);diff --git a/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov2.test.tsindex 5bb666ad02..2925ba0d93 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov2.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov2.test.ts@@ -442,9 +442,8 @@ describe('isSettingsNavItemLocked', () => {});it('returns false for a tab with hideWhenUnavailable (early `item.hideWhenUnavailable` branch)', () => {- // Since the 2026-08-07 commercial-surfaces revision only the organization-*- // tabs still carry hideWhenUnavailable -> short-circuit before isTabLocked- // is consulted.+ // organization-overview, security-roles, system-relay, support-reporting all+ // carry hideWhenUnavailable -> short-circuit before isTabLocked is consulted.expect(isSettingsNavItemLocked('organization-overview',@@ -452,17 +451,14 @@ describe('isSettingsNavItemLocked', () => {),).toBe(false);expect(- isSettingsNavItemLocked(- 'organization-access',- createContext({ hasFeature: hasFeatures([]) }),- ),+ isSettingsNavItemLocked('security-roles', createContext({ hasFeature: hasFeatures([]) })),).toBe(false);});- it('reports system-relay as locked for free installs (visible nav item, panel-owned gate)', () => {+ it('hides system-relay instead of reporting a locked navigation item for free installs', () => {expect(isSettingsNavItemLocked('system-relay', createContext({ hasFeature: hasFeatures([]) })),- ).toBe(true);+ ).toBe(false);expect(isSettingsNavItemLocked('system-relay',@@ -471,21 +467,6 @@ describe('isSettingsNavItemLocked', () => {).toBe(false);});- it('reports security-webhooks as locked for free installs (visible nav item, panel-owned gate)', () => {- // Relay-shaped since the 2026-08-07 commercial-surfaces revision: the- // catalog entry dropped hideWhenUnavailable so the tab stays visible and- // the panel gates inline, so the lock state reports honestly.- expect(- isSettingsNavItemLocked('security-webhooks', createContext({ hasFeature: hasFeatures([]) })),- ).toBe(true);- expect(- isSettingsNavItemLocked(- 'security-webhooks',- createContext({ hasFeature: hasFeatures(['audit_logging']) }),- ),- ).toBe(false);- });-it('returns false for a tab without feature requirements (isTabLocked -> isFeatureLocked false branch)', () => {expect(isSettingsNavItemLocked('system-general', createContext({ hasFeature: hasFeatures([]) })),@@ -501,12 +482,11 @@ describe('isSettingsNavItemLocked', () => {).toBe(false);});- it('never reports other real catalog tabs as locked', () => {- // system-relay and security-webhooks are the two deliberate exceptions:- // they stay visible without their feature and report locked (see the- // dedicated tests above). The organization-* tabs still hide via- // hideWhenUnavailable, and the rest carry no lock requirements.+ it('never reports other real catalog tabs as locked (their feature gates also carry hideWhenUnavailable)', () => {+ // Paid feature navigation stays quiet when unavailable. Deliberate direct+ // routes remain panel-owned and continue to render their opt-in affordance.const tabs: SettingsTab[] = [+ 'security-webhooks','organization-overview','organization-access','organization-sharing',diff --git a/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx b/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsxindex dbd9b3628b..0ee91c25e5 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx@@ -114,11 +114,27 @@ describe('settingsNavigation integration scaffold', () => {).toBe(true);});- it('keeps self-hosted billing discoverable from Pulse Intelligence settings', () => {+ it('keeps self-hosted billing direct-routeable while hiding free default navigation', () => {expect(deriveTabFromPath('/settings/pulse-intelligence/billing/plan')).toBe('system-billing');expect(deriveTabFromPath('/settings/system/billing/plan')).toBe('system-billing');expect(settingsTabPath('system-billing')).toBe('/settings/pulse-intelligence/billing/plan');expect(getSettingsNavItem('system-billing')?.hideFromSidebar).not.toBe(true);+ expect(getSettingsNavItem('system-billing')?.hideWhenUpgradeHidden).toBe(true);+ const freeContext = {+ hasFeature: hasFeatures([]),+ runtimeCapabilitiesLoaded: () => true,+ presentationPolicyResolved: true,+ presentationPolicyHidesUpgrade: true,+ hostedModeEnabled: false,+ };+ expect(shouldHideSettingsNavItem('system-billing', freeContext)).toBe(true);+ expect(shouldBlockSettingsRouteItem('system-billing', freeContext)).toBe(false);+ expect(+ shouldHideSettingsNavItem('system-billing', {+ ...freeContext,+ presentationPolicyHidesUpgrade: false,+ }),+ ).toBe(false);});it('keeps resource privacy route-backed but out of the normal sidebar', () => {@@ -135,10 +151,7 @@ describe('settingsNavigation integration scaffold', () => {).toBe(false);});- it('keeps the Remote Access tab visible to free installs so Relay stays discoverable', () => {- // system-relay deliberately omits hideWhenUnavailable: the panel renders its- // own upgrade gate, so free installs see the entry instead of never learning- // the capability exists.+ it('hides Remote Access navigation for free installs but keeps the direct route available', () => {expect(shouldHideSettingsNavItem('system-relay', {hasFeature: hasFeatures([]),@@ -147,7 +160,7 @@ describe('settingsNavigation integration scaffold', () => {settingsCapabilitiesResolved: true,settingsCapabilities: { relayRead: true },}),- ).toBe(false);+ ).toBe(true);expect(shouldBlockSettingsRouteItem('system-relay', {hasFeature: hasFeatures([]),@@ -159,10 +172,7 @@ describe('settingsNavigation integration scaffold', () => {).toBe(false);});- // 2026-08-07 commercial-surfaces revision: paid-only tabs stay visible for- // free installs and their panels gate inline, following the Relay- // precedent. Hiding them made the capabilities undiscoverable.- it('shows paid-only self-hosted tabs to free installs (panels gate inline)', () => {+ it('hides paid-only self-hosted tabs from free installs', () => {for (const tab of ['security-roles','security-users',@@ -185,11 +195,11 @@ describe('settingsNavigation integration scaffold', () => {users: true,},}),- ).toBe(false);+ ).toBe(true);}});- it('keeps reporting navigation visible with and without advanced reporting', () => {+ it('shows reporting navigation only with advanced reporting', () => {expect(shouldHideSettingsNavItem('support-reporting', {hasFeature: hasFeatures([]),@@ -198,7 +208,7 @@ describe('settingsNavigation integration scaffold', () => {presentationPolicyIsDemoMode: false,hostedModeEnabled: false,}),- ).toBe(false);+ ).toBe(true);expect(shouldHideSettingsNavItem('support-reporting', {@@ -211,7 +221,7 @@ describe('settingsNavigation integration scaffold', () => {).toBe(false);});- it('keeps panel-owned feature gate tabs visible and routeable for free installs', () => {+ it('keeps hidden panel-owned feature gates directly routeable for free installs', () => {for (const tab of ['support-reporting','security-roles',@@ -228,7 +238,7 @@ describe('settingsNavigation integration scaffold', () => {hostedModeEnabled: false,settingsCapabilitiesResolved: false,}),- ).toBe(false);+ ).toBe(true);expect(shouldBlockSettingsRouteItem(tab, {hasFeature: hasFeatures([]),diff --git a/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx b/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsxindex 33df1c0a1e..0b564e62c6 100644--- a/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx@@ -8,6 +8,7 @@ const runtimeCapabilitiesLoadedMock = vi.fn();const isHostedModeEnabledMock = vi.fn();const presentationPolicyHidesCommercialSurfacesMock = vi.fn();const presentationPolicyHidesOrganizationSurfacesMock = vi.fn();+const presentationPolicyHidesUpgradePromptsMock = vi.fn();const presentationPolicyIsDemoModeMock = vi.fn();const presentationPolicyIsReadOnlyMock = vi.fn();const sessionPresentationPolicyResolvedMock = vi.fn();@@ -28,6 +29,8 @@ vi.mock('@/stores/sessionPresentationPolicy', () => ({presentationPolicyHidesCommercialSurfacesMock(...args),presentationPolicyHidesOrganizationSurfaces: (...args: unknown[]) =>presentationPolicyHidesOrganizationSurfacesMock(...args),+ presentationPolicyHidesUpgradePrompts: (...args: unknown[]) =>+ presentationPolicyHidesUpgradePromptsMock(...args),presentationPolicyIsDemoMode: (...args: unknown[]) => presentationPolicyIsDemoModeMock(...args),presentationPolicyIsReadOnly: (...args: unknown[]) => presentationPolicyIsReadOnlyMock(...args),sessionPresentationPolicyResolved: (...args: unknown[]) =>@@ -95,6 +98,7 @@ describe('useSettingsAccess', () => {isHostedModeEnabledMock.mockReset();presentationPolicyHidesCommercialSurfacesMock.mockReset();presentationPolicyHidesOrganizationSurfacesMock.mockReset();+ presentationPolicyHidesUpgradePromptsMock.mockReset();presentationPolicyIsDemoModeMock.mockReset();presentationPolicyIsReadOnlyMock.mockReset();sessionPresentationPolicyResolvedMock.mockReset();@@ -107,6 +111,7 @@ describe('useSettingsAccess', () => {isHostedModeEnabledMock.mockReturnValue(false);presentationPolicyHidesCommercialSurfacesMock.mockReturnValue(false);presentationPolicyHidesOrganizationSurfacesMock.mockReturnValue(false);+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);presentationPolicyIsDemoModeMock.mockReturnValue(false);presentationPolicyIsReadOnlyMock.mockReturnValue(false);sessionPresentationPolicyResolvedMock.mockReturnValue(true);diff --git a/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts b/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.tsindex bc04c49eb5..0db2ebeb30 100644--- a/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts@@ -69,7 +69,6 @@ const buildTelemetryPreviewPayload = (sso_enabled: false,multi_tenant: false,paid_license: false,- business_estate: false,has_api_tokens: true,rbac_custom_roles: 0,rbac_user_assignments: 0,diff --git a/frontend-modern/src/components/Settings/settingsNavCatalog.ts b/frontend-modern/src/components/Settings/settingsNavCatalog.tsindex 4727e51a4b..e08f016ef8 100644--- a/frontend-modern/src/components/Settings/settingsNavCatalog.ts+++ b/frontend-modern/src/components/Settings/settingsNavCatalog.ts@@ -83,6 +83,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [label: SELF_HOSTED_PRO_BILLING_PRESENTATION.navLabel,icon: PulseLogoIcon,hideWhenCommercialHidden: true,+ hideWhenUpgradeHidden: true,},{id: 'system-ai-assistant',@@ -223,9 +224,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: FileText,iconProps: { strokeWidth: 2 },features: ['advanced_reporting'],- // Visible without the feature (2026-08-07 commercial-surfaces- // revision): the panel renders its own upgrade gate, and hiding the- // item made the capability undiscoverable — same rationale as Relay.+ hideWhenUnavailable: true,hideWhenDemoMode: true,requiredCapability: 'reportingRead',},@@ -282,7 +281,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: ShieldCheck,iconProps: { strokeWidth: 2 },features: ['rbac'],- // Visible without the feature: the panel gates inline (see Relay).+ hideWhenUnavailable: true,requiredCapability: 'roles',},{@@ -291,7 +290,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: Users,iconProps: { strokeWidth: 2 },features: ['rbac'],- // Visible without the feature: the panel gates inline (see Relay).+ hideWhenUnavailable: true,requiredCapability: 'users',},{@@ -300,7 +299,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: Activity,iconProps: { strokeWidth: 2 },features: ['audit_logging'],- // Visible without the feature: the panel gates inline (see Relay).+ hideWhenUnavailable: true,requiredCapability: 'auditLog',},{@@ -309,7 +308,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: Globe,iconProps: { strokeWidth: 2 },features: ['audit_logging'],- // Visible without the feature: the panel gates inline (see Relay).+ hideWhenUnavailable: true,requiredCapability: 'auditWebhooksRead',},{@@ -318,9 +317,7 @@ export const SETTINGS_NAV_GROUPS: SettingsNavGroup[] = [icon: RadioTower,iconProps: { strokeWidth: 2 },features: ['relay'],- // Deliberately visible without the relay feature: the panel renders its- // own upgrade gate, and hiding the item made Relay undiscoverable for- // free installs.+ hideWhenUnavailable: true,requiredCapability: 'relayRead',},],diff --git a/frontend-modern/src/components/Settings/settingsNavVisibility.ts b/frontend-modern/src/components/Settings/settingsNavVisibility.tsindex ef36bd6f59..ebb49e97cc 100644--- a/frontend-modern/src/components/Settings/settingsNavVisibility.ts+++ b/frontend-modern/src/components/Settings/settingsNavVisibility.ts@@ -7,6 +7,7 @@ export interface SettingsNavVisibilityContext {hasFeature: (feature: string) => boolean;runtimeCapabilitiesLoaded: () => boolean;presentationPolicyHidesCommercial?: boolean;+ presentationPolicyHidesUpgrade?: boolean;presentationPolicyIsDemoMode?: boolean;presentationPolicyIsReadOnly?: boolean;presentationPolicyHidesOrganizations?: boolean;@@ -82,6 +83,16 @@ export function shouldHideSettingsNavItem(}}+ if (item.hideWhenUpgradeHidden) {+ if (context.presentationPolicyResolved === false) {+ return true;+ }++ if (context.presentationPolicyHidesUpgrade) {+ return true;+ }+ }+if (item.hideWhenDemoMode) {if (context.presentationPolicyResolved === false) {return true;diff --git a/frontend-modern/src/components/Settings/settingsNavigationModel.ts b/frontend-modern/src/components/Settings/settingsNavigationModel.tsindex ae09162ccf..4a0ad4a5c9 100644--- a/frontend-modern/src/components/Settings/settingsNavigationModel.ts+++ b/frontend-modern/src/components/Settings/settingsNavigationModel.ts@@ -85,6 +85,9 @@ export interface SettingsNavItem {hideWhenUnavailable?: boolean;hostedOnly?: boolean;hideWhenCommercialHidden?: boolean;+ // Navigation-only suppression for opt-in commercial surfaces. Direct routes+ // remain reachable for activation, recovery, and explicit handoffs.+ hideWhenUpgradeHidden?: boolean;hideWhenOrganizationHidden?: boolean;hideWhenDemoMode?: boolean;hideWhenReadOnly?: boolean;diff --git a/frontend-modern/src/components/Settings/useProLicensePanelState.ts b/frontend-modern/src/components/Settings/useProLicensePanelState.tsindex ded9c18865..39123b371a 100644--- a/frontend-modern/src/components/Settings/useProLicensePanelState.ts+++ b/frontend-modern/src/components/Settings/useProLicensePanelState.ts@@ -32,9 +32,7 @@ import {getSelfHostedBillingHref,getSelfHostedBillingPlanDetail,getSelfHostedBillingPlanIntent,- getSelfHostedBillingPlanSource,getSelfHostedBillingPurchaseArrival,- PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,resolveSelfHostedBillingSection,resolveSelfHostedPurchaseStartDestination,SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,@@ -166,12 +164,6 @@ export function useProLicensePanelState() {resolveSelfHostedBillingSection(location.pathname, location.search, location.hash),);- // Checkout attribution: a gate CTA or the estate card stamps ?source= onto- // the plan route; organic arrivals attribute to the plans page itself.- const purchaseHandoffSource = createMemo(- () => getSelfHostedBillingPlanSource(location.search) ?? PURCHASE_HANDOFF_SOURCE_PLANS_PAGE,- );-const activeSection = createMemo<SelfHostedBillingSection>(() => {return requestedSection() === 'usage' ? 'plan' : requestedSection();});@@ -215,8 +207,6 @@ export function useProLicensePanelState() {actionLabel: SELF_HOSTED_PRO_BILLING_PRESENTATION.planSelectionPromptActionLabel,actionDestination: resolveSelfHostedPurchaseStartDestination(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,- undefined,- purchaseHandoffSource(),),};});@@ -341,20 +331,12 @@ export function useProLicensePanelState() {case SELF_HOSTED_PRO_BILLING_PURCHASE_CANCELLED:return {label: SELF_HOSTED_PRO_BILLING_PRESENTATION.purchaseCancelledActionLabel,- destination: resolveSelfHostedPurchaseStartDestination(- intent,- undefined,- purchaseHandoffSource(),- ),+ destination: resolveSelfHostedPurchaseStartDestination(intent),};case SELF_HOSTED_PRO_BILLING_PURCHASE_EXPIRED:return {label: SELF_HOSTED_PRO_BILLING_PRESENTATION.purchaseExpiredActionLabel,- destination: resolveSelfHostedPurchaseStartDestination(- intent,- undefined,- purchaseHandoffSource(),- ),+ destination: resolveSelfHostedPurchaseStartDestination(intent),};case SELF_HOSTED_PRO_BILLING_PURCHASE_FAILED:return {@@ -369,11 +351,7 @@ export function useProLicensePanelState() {case SELF_HOSTED_PRO_BILLING_PURCHASE_UNAVAILABLE:return {label: SELF_HOSTED_PRO_BILLING_PRESENTATION.purchaseUnavailableActionLabel,- destination: resolveSelfHostedPurchaseStartDestination(- intent,- undefined,- purchaseHandoffSource(),- ),+ destination: resolveSelfHostedPurchaseStartDestination(intent),};default:return null;@@ -432,8 +410,6 @@ export function useProLicensePanelState() {label: SELF_HOSTED_PRO_BILLING_PRESENTATION.planComparisonActionLabel,destination: resolveSelfHostedPurchaseStartDestination(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,- undefined,- purchaseHandoffSource(),),}: null,diff --git a/frontend-modern/src/components/Settings/useSettingsAccess.ts b/frontend-modern/src/components/Settings/useSettingsAccess.tsindex 91fdac961b..2592dd3425 100644--- a/frontend-modern/src/components/Settings/useSettingsAccess.ts+++ b/frontend-modern/src/components/Settings/useSettingsAccess.ts@@ -2,6 +2,7 @@ import { Accessor, createEffect, createMemo, createSignal, onMount } from 'solidimport {presentationPolicyHidesCommercialSurfaces,presentationPolicyHidesOrganizationSurfaces,+ presentationPolicyHidesUpgradePrompts,presentationPolicyIsDemoMode,presentationPolicyIsReadOnly,sessionPresentationPolicyResolved,@@ -56,6 +57,13 @@ export function useSettingsAccess({const presentationPolicyResolved = createMemo(() => securityStatus() !== null || sessionPresentationPolicyResolved(),);+ const upgradePromptsHidden = createMemo(() => {+ const resolvedSecurityStatus = securityStatus();+ if (resolvedSecurityStatus) {+ return resolvedSecurityStatus.presentationPolicy?.hideUpgrade !== false;+ }+ return presentationPolicyHidesUpgradePrompts();+ });const demoMode = createMemo(() => {const resolvedSecurityStatus = securityStatus();if (resolvedSecurityStatus) {@@ -96,6 +104,7 @@ export function useSettingsAccess({hasFeature,runtimeCapabilitiesLoaded,presentationPolicyHidesCommercial: commercialSurfacesHidden(),+ presentationPolicyHidesUpgrade: upgradePromptsHidden(),presentationPolicyIsDemoMode: demoMode(),presentationPolicyIsReadOnly: readOnly(),presentationPolicyHidesOrganizations: organizationSurfacesHidden(),@@ -175,6 +184,7 @@ export function useSettingsAccess({const requiresCapabilityResolution = Boolean(currentItem?.requiredCapability);const requiresPresentationPolicyResolution = Boolean(currentItem?.hideWhenCommercialHidden ||+ currentItem?.hideWhenUpgradeHidden ||currentItem?.hideWhenOrganizationHidden ||currentItem?.hideWhenReadOnly ||currentItem?.hideWhenDemoMode,diff --git a/frontend-modern/src/components/__tests__/BusinessEstateCard.test.tsx b/frontend-modern/src/components/__tests__/BusinessEstateCard.test.tsxdeleted file mode 100644index f9d32296e3..0000000000--- a/frontend-modern/src/components/__tests__/BusinessEstateCard.test.tsx+++ /dev/null@@ -1,196 +0,0 @@-import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';--/* ------------------------------------------------------------------ */-/* Mocks */-/* ------------------------------------------------------------------ */--const mockInitialDataReceived = vi.hoisted(() => vi.fn<() => boolean>(() => true));-const capabilityState = vi.hoisted(() => ({ businessEstate: true }));-const policyState = vi.hoisted(() => ({ hidesUpgradePrompts: false }));-const mockNavigate = vi.hoisted(() => vi.fn());--vi.mock('@/contexts/appRuntime', () => ({- useWebSocket: () => ({- initialDataReceived: mockInitialDataReceived,- }),-}));--vi.mock('@/stores/sessionCapabilities', () => ({- sessionCapabilities: () => ({ demoMode: false, businessEstate: capabilityState.businessEstate }),-}));--vi.mock('@/stores/sessionPresentationPolicy', () => ({- presentationPolicyHidesUpgradePrompts: () => policyState.hidesUpgradePrompts,-}));--vi.mock('@solidjs/router', () => ({- useNavigate: () => mockNavigate,-}));--/* ------------------------------------------------------------------ */-/* Helpers */-/* ------------------------------------------------------------------ */--const DISMISSED_KEY = 'pulse-business-estate-dismissed';-const FIRST_SEEN_KEY = 'pulse-business-estate-first-seen';-const STAR_DISMISSED_KEY = 'pulse-github-star-dismissed';-const STAR_SNOOZED_KEY = 'pulse-github-star-snoozed-until';--const YESTERDAY = '2020-01-01';--async function renderCard() {- const mod = await import('../BusinessEstateCard');- render(() => <mod.BusinessEstateCard />);-}--/** Seed the state under which the card is expected to show. */-function seedEligibleState() {- capabilityState.businessEstate = true;- policyState.hidesUpgradePrompts = false;- localStorage.setItem(STAR_DISMISSED_KEY, 'true');- localStorage.setItem(FIRST_SEEN_KEY, YESTERDAY);-}--function queryCard() {- return screen.queryByText('Monitoring a business environment?');-}--/* ------------------------------------------------------------------ */-/* Tests */-/* ------------------------------------------------------------------ */--describe('BusinessEstateCard', () => {- beforeEach(() => {- localStorage.clear();- mockNavigate.mockReset();- mockInitialDataReceived.mockReturnValue(true);- capabilityState.businessEstate = true;- policyState.hidesUpgradePrompts = false;- });-- afterEach(() => {- cleanup();- localStorage.clear();- });-- it('shows for an eligible business estate on a later day', async () => {- seedEligibleState();-- await renderCard();-- await waitFor(() => expect(queryCard()).not.toBeNull());- expect(screen.getByRole('button', { name: 'See business plans' })).toBeTruthy();- expect(screen.getByRole('button', { name: 'This is a homelab' })).toBeTruthy();- });-- it('stays hidden when the session is not a business estate', async () => {- seedEligibleState();- capabilityState.businessEstate = false;-- await renderCard();-- expect(queryCard()).toBeNull();- });-- it('stays hidden when the presentation policy hides upgrade prompts', async () => {- seedEligibleState();- policyState.hidesUpgradePrompts = true;-- await renderCard();-- expect(queryCard()).toBeNull();- });-- it('stays hidden until initial data is received', async () => {- seedEligibleState();- mockInitialDataReceived.mockReturnValue(false);-- await renderCard();-- expect(queryCard()).toBeNull();- });-- it('waits until the GitHub star prompt has been interacted with', async () => {- seedEligibleState();- localStorage.removeItem(STAR_DISMISSED_KEY);- localStorage.removeItem(STAR_SNOOZED_KEY);-- await renderCard();-- expect(queryCard()).toBeNull();- });-- it('treats a snoozed star prompt as interacted', async () => {- seedEligibleState();- localStorage.removeItem(STAR_DISMISSED_KEY);- localStorage.setItem(STAR_SNOOZED_KEY, '2099-01-01');-- await renderCard();-- await waitFor(() => expect(queryCard()).not.toBeNull());- });-- it('records the first qualifying day and stays quiet that day', async () => {- seedEligibleState();- localStorage.removeItem(FIRST_SEEN_KEY);-- await renderCard();-- expect(queryCard()).toBeNull();- await waitFor(() => expect(localStorage.getItem(FIRST_SEEN_KEY)).not.toBeNull());- const recorded = (localStorage.getItem(FIRST_SEEN_KEY) ?? '').replace(/"/g, '');- expect(recorded).toBe(new Date().toISOString().split('T')[0]);- });-- it('never shows again after the close control', async () => {- seedEligibleState();-- await renderCard();- await waitFor(() => expect(queryCard()).not.toBeNull());-- fireEvent.click(screen.getByRole('button', { name: "Close and don't show again" }));-- expect(queryCard()).toBeNull();- expect(JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? 'false')).toBe(true);- });-- it('never shows again after "This is a homelab"', async () => {- seedEligibleState();-- await renderCard();- await waitFor(() => expect(queryCard()).not.toBeNull());-- fireEvent.click(screen.getByRole('button', { name: 'This is a homelab' }));-- expect(queryCard()).toBeNull();- expect(JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? 'false')).toBe(true);- });-- it('navigates to plan selection and dismisses permanently on the primary action', async () => {- seedEligibleState();-- await renderCard();- await waitFor(() => expect(queryCard()).not.toBeNull());-- fireEvent.click(screen.getByRole('button', { name: 'See business plans' }));-- expect(mockNavigate).toHaveBeenCalledWith(- '/settings/pulse-intelligence/billing/plan?intent=self_hosted_plan&source=estate-card',- );- expect(queryCard()).toBeNull();- expect(JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? 'false')).toBe(true);- });-- it('dismisses permanently on Escape', async () => {- seedEligibleState();-- await renderCard();- await waitFor(() => expect(queryCard()).not.toBeNull());-- fireEvent.keyDown(document, { key: 'Escape' });-- await waitFor(() => expect(queryCard()).toBeNull());- expect(JSON.parse(localStorage.getItem(DISMISSED_KEY) ?? 'false')).toBe(true);- });-});diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsxindex fa5337f4d9..adb829172b 100644--- a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx@@ -142,10 +142,7 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState}),);const shouldShowAutonomyOptions = createMemo(- () =>- canChooseAutonomyLevel() ||- autonomyAvailability().kind === 'runtime_locked' ||- (autonomyAvailability().kind === 'plan_locked' && !commercialSurfacesHidden()),+ () => canChooseAutonomyLevel() || autonomyAvailability().kind === 'runtime_locked',);const showAutonomyUpgradeAction = createMemo(() =>diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.tsindex 5db27474f4..3e00f02499 100644--- a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts+++ b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts@@ -99,7 +99,7 @@ describe('PatrolIntelligenceHeader', () => {expect(headerSource).toContain('sm:min-h-0');});- it('makes Patrol mode a simple four-level choice with plan-locked paid modes disabled and Pro-badged', () => {+ it('makes Patrol mode a simple four-level choice without rendering plan-locked paid modes', () => {expect(PATROL_AUTONOMY_POLICY_PRESENTATION).toEqual({monitor: {label: 'Watch only',@@ -222,7 +222,7 @@ describe('PatrolIntelligenceHeader', () => {locked: true,title: 'Watch only',body: 'This install watches infrastructure and shows issues.',- actionLabel: 'Unlock Patrol modes',+ actionLabel: 'Plans & Billing',destination: {href: '/settings/pulse-intelligence/billing/plan',external: false,diff --git a/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.tsindex 1620125970..100d81e519 100644--- a/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts+++ b/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts@@ -263,12 +263,12 @@ describe('patrolAutonomyAvailability', () => {});expect(result.kind).toBe('plan_locked');- expect(result.actionLabel).toBe('Unlock Patrol modes');+ expect(result.actionLabel).toBe('Plans & Billing');});});describe('plan_locked presentation', () => {- it('shows the unlock action when surfaces are visible', () => {+ it('shows the Plans & Billing action when surfaces are visible', () => {const result = getPatrolAutonomyAvailabilityPresentation({autoFixLocked: true,planUpgradeDestination: planDestination,@@ -279,7 +279,7 @@ describe('patrolAutonomyAvailability', () => {locked: true,title: 'Watch only',body: 'This install watches infrastructure and shows issues.',- actionLabel: 'Unlock Patrol modes',+ actionLabel: 'Plans & Billing',destination: planDestination,});});diff --git a/frontend-modern/src/features/patrol/__tests__/patrolCommercialBoundary.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolCommercialBoundary.test.tsindex 9aefbc857c..5954158c43 100644--- a/frontend-modern/src/features/patrol/__tests__/patrolCommercialBoundary.test.ts+++ b/frontend-modern/src/features/patrol/__tests__/patrolCommercialBoundary.test.ts@@ -22,7 +22,7 @@ describe('patrol commercial boundary', () => {expect(patrolIntelligenceHeaderSource).toContain("autonomyAvailability().kind === 'plan_locked'",);- expect(patrolAutonomyAvailabilitySource).toContain('Unlock Patrol modes');+ expect(patrolAutonomyAvailabilitySource).toContain('Plans & Billing');expect(patrolAutonomyAvailabilitySource).toContain('input.upgradePromptsHidden');expect(patrolIntelligenceHeaderSource).toContain('getPatrolAutonomyAvailabilityPresentation');expect(patrolIntelligenceHeaderSource).toContain('!presentationPolicyHidesUpgradePrompts()');diff --git a/frontend-modern/src/features/patrol/patrolAutonomyAvailability.ts b/frontend-modern/src/features/patrol/patrolAutonomyAvailability.tsindex ce33bc01bd..f23791bd33 100644--- a/frontend-modern/src/features/patrol/patrolAutonomyAvailability.ts+++ b/frontend-modern/src/features/patrol/patrolAutonomyAvailability.ts@@ -83,7 +83,7 @@ export function getPatrolAutonomyAvailabilityPresentation(...(input.upgradePromptsHidden? {}: {- actionLabel: 'Unlock Patrol modes',+ actionLabel: 'Plans & Billing',destination: input.planUpgradeDestination,}),};diff --git a/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts b/frontend-modern/src/stores/__tests__/sessionCapabilities.test.tsindex 725865a018..fbce64da5c 100644--- a/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts+++ b/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts@@ -17,28 +17,28 @@ describe('session capabilities store', () => {it('default-fills capabilities when no status payload is provided', () => {const next = syncSessionCapabilities();- expect(next).toEqual({ demoMode: false, businessEstate: false });- expect(sessionCapabilities()).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });+ expect(sessionCapabilities()).toEqual({ demoMode: false });});it('default-fills capabilities when the status payload is null', () => {const next = syncSessionCapabilities(null);- expect(next).toEqual({ demoMode: false, businessEstate: false });- expect(sessionCapabilities()).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });+ expect(sessionCapabilities()).toEqual({ demoMode: false });});it('default-fills capabilities when sessionCapabilities is omitted from status', () => {const next = syncSessionCapabilities({});- expect(next).toEqual({ demoMode: false, businessEstate: false });- expect(sessionCapabilities()).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });+ expect(sessionCapabilities()).toEqual({ demoMode: false });});it('default-fills capabilities when sessionCapabilities is explicitly undefined', () => {const next = syncSessionCapabilities({ sessionCapabilities: undefined });- expect(next).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });});it('default-fills capabilities when sessionCapabilities is null', () => {@@ -46,7 +46,7 @@ describe('session capabilities store', () => {typeof syncSessionCapabilities>[0]);- expect(next).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });});it('preserves an explicit demoMode===true capability', () => {@@ -54,8 +54,8 @@ describe('session capabilities store', () => {sessionCapabilities: { demoMode: true },});- expect(next).toEqual({ demoMode: true, businessEstate: false });- expect(sessionCapabilities()).toEqual({ demoMode: true, businessEstate: false });+ expect(next).toEqual({ demoMode: true });+ expect(sessionCapabilities()).toEqual({ demoMode: true });});it('coerces an explicit demoMode===false capability to the default', () => {@@ -63,7 +63,7 @@ describe('session capabilities store', () => {sessionCapabilities: { demoMode: false },});- expect(next).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });});// The normalizer gates demoMode on strict equality with `true`, so any@@ -79,7 +79,7 @@ describe('session capabilities store', () => {sessionCapabilities: { demoMode: demoMode as unknown as boolean },});- expect(next).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });});it.each([@@ -93,7 +93,7 @@ describe('session capabilities store', () => {sessionCapabilities: { demoMode: demoMode as unknown as boolean },});- expect(next).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });});it('returns the same normalized value it publishes to the signal', () => {@@ -112,12 +112,12 @@ describe('session capabilities store', () => {it('overwrites the previous capability value instead of merging', () => {syncSessionCapabilities({ sessionCapabilities: { demoMode: true } });- expect(sessionCapabilities()).toEqual({ demoMode: true, businessEstate: false });+ expect(sessionCapabilities()).toEqual({ demoMode: true });const next = syncSessionCapabilities(null);- expect(next).toEqual({ demoMode: false, businessEstate: false });- expect(sessionCapabilities()).toEqual({ demoMode: false, businessEstate: false });+ expect(next).toEqual({ demoMode: false });+ expect(sessionCapabilities()).toEqual({ demoMode: false });});it('strips unrecognized capability fields rather than passing them through', () => {@@ -128,34 +128,8 @@ describe('session capabilities store', () => {},});- expect(next).toEqual({ demoMode: true, businessEstate: false });+ expect(next).toEqual({ demoMode: true });expect(next).not.toHaveProperty('assistantEnabled');expect(sessionCapabilities()).not.toHaveProperty('assistantEnabled');});-- it('preserves an explicit businessEstate===true capability', () => {- const next = syncSessionCapabilities({- sessionCapabilities: { demoMode: false, businessEstate: true },- });-- expect(next).toEqual({ demoMode: false, businessEstate: true });- expect(sessionCapabilities()).toEqual({ demoMode: false, businessEstate: true });- });-- // Same strict-equality gate as demoMode: only the boolean `true` survives.- it.each([- ['number 1', 1],- ['string "true"', 'true'],- ['null', null],- ['undefined', undefined],- ])('coerces a non-boolean businessEstate (%s) to false', (_label, businessEstate) => {- const next = syncSessionCapabilities({- sessionCapabilities: {- demoMode: false,- businessEstate: businessEstate as unknown as boolean,- },- });-- expect(next).toEqual({ demoMode: false, businessEstate: false });- });});diff --git a/frontend-modern/src/stores/sessionCapabilities.ts b/frontend-modern/src/stores/sessionCapabilities.tsindex 87f91f78d1..3416a557b1 100644--- a/frontend-modern/src/stores/sessionCapabilities.ts+++ b/frontend-modern/src/stores/sessionCapabilities.ts@@ -15,7 +15,6 @@ function normalizeSessionCapabilities(return {...DEFAULT_SESSION_CAPABILITIES,demoMode: capabilities?.demoMode === true,- businessEstate: capabilities?.businessEstate === true,};}diff --git a/frontend-modern/src/types/config.ts b/frontend-modern/src/types/config.tsindex 2946c637f6..0868dd62f1 100644--- a/frontend-modern/src/types/config.ts+++ b/frontend-modern/src/types/config.ts@@ -128,7 +128,6 @@ export interface SecurityStatusSettingsCapabilities {export interface SecurityStatusSessionCapabilities {demoMode: boolean;assistantEnabled?: boolean;- businessEstate?: boolean;}export interface SecurityStatusPresentationPolicy {diff --git a/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.tsindex 5da37fc734..be806cdf39 100644--- a/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts+++ b/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts@@ -123,17 +123,13 @@ describe('pricingHandoff (branch coverage)', () => {describe('getInProductPricingDestination', () => {it('maps known in-product feature keys to their plan/selection hrefs', () => {- expect(getInProductPricingDestination('relay')).toBe(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- );- expect(getInProductPricingDestination('mobile_app')).toBe(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- );+ expect(getInProductPricingDestination('relay')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);+ expect(getInProductPricingDestination('mobile_app')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);expect(getInProductPricingDestination('long_term_metrics')).toBe(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,);expect(getInProductPricingDestination('agent_profiles')).toBe(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,);expect(getInProductPricingDestination('self_hosted_plan')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,diff --git a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts b/frontend-modern/src/utils/__tests__/pricingHandoff.test.tsindex c7687fe558..96922ae264 100644--- a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts+++ b/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts@@ -46,27 +46,19 @@ describe('pricingHandoff', () => {expect(getInProductPricingDestination('cloud')).toBeUndefined();});- it('routes paid self-hosted feature upgrades to in-product plan selection with gate attribution', () => {- expect(getUpgradeFallbackDestination('relay')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-relay`,- );- expect(getUpgradeFallbackDestination('mobile_app')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-mobile-app`,- );+ it('routes paid self-hosted feature upgrades to the in-product billing plan page', () => {+ expect(getUpgradeFallbackDestination('relay')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);+ expect(getUpgradeFallbackDestination('mobile_app')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);expect(getUpgradeFallbackDestination('push_notifications')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-push-notifications`,- );- expect(getUpgradeFallbackDestination('ai_alerts')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-ai-alerts`,+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,);+ expect(getUpgradeFallbackDestination('ai_alerts')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);expect(getUpgradeFallbackDestination('ai_autofix')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-ai-autofix`,- );- expect(getUpgradeFallbackDestination('rbac')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-rbac`,+ SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,);+ expect(getUpgradeFallbackDestination('rbac')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);expect(getUpgradeFallbackDestination('advanced_reporting')).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=gate-reporting`,+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,);});@@ -91,61 +83,15 @@ describe('pricingHandoff', () => {'agent_profiles','external_probe',]);- const expectedGateSources: Record<string, string> = {- relay: 'gate-relay',- mobile_app: 'gate-mobile-app',- push_notifications: 'gate-push-notifications',- ai_alerts: 'gate-ai-alerts',- ai_autofix: 'gate-ai-autofix',- long_term_metrics: 'gate-long-term-metrics',- rbac: 'gate-rbac',- audit_logging: 'gate-audit-logging',- advanced_reporting: 'gate-reporting',- agent_profiles: 'gate-agent-profiles',- external_probe: 'gate-external-probe',- };for (const key of paidCatalogFeatureKeys) {expect(getUpgradeFallbackDestination(key)).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF}&source=${expectedGateSources[key]}`,+ key === 'ai_autofix'+ ? SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF+ : SELF_HOSTED_PRO_BILLING_PLAN_HREF,);}});- it('threads checkout source attribution through owned billing hrefs and purchase start', () => {- // Plan hrefs carry a validated source; the usage section never does.- expect(getSelfHostedBillingHref('plan', { source: 'estate-card' })).toBe(- `${SELF_HOSTED_PRO_BILLING_PLAN_HREF}?source=estate-card`,- );- expect(getSelfHostedBillingHref('usage', { source: 'estate-card' })).toBe(- SELF_HOSTED_PRO_BILLING_USAGE_HREF,- );- // Canonical route resolution preserves a valid plan-route source.- expect(- resolveCanonicalSelfHostedBillingHref(SELF_HOSTED_PRO_BILLING_PLAN_HREF, '?source=gate-rbac'),- ).toBe(`${SELF_HOSTED_PRO_BILLING_PLAN_HREF}?source=gate-rbac`);- // An explicit source lands on the purchase-start URL.- expect(getSelfHostedPurchaseStartUrl('self_hosted_plan', undefined, 'plans-page')).toBe(- `${SELF_HOSTED_PURCHASE_START_PATH}?source=plans-page&feature=self_hosted_plan`,- );- // A forwarded query string never smuggles attribution in (public /pricing).- expect(- getSelfHostedPurchaseStartUrl(- 'unknown_pro_feature',- new URLSearchParams('source=gate-rbac&utm_content=legacy-bookmark'),- ),- ).toBe(- `${SELF_HOSTED_PURCHASE_START_PATH}?utm_content=legacy-bookmark&feature=unknown_pro_feature`,- );- // Malformed sources are dropped rather than forwarded.- expect(getSelfHostedPurchaseStartUrl('relay', undefined, 'Bad Source!')).toBe(- `${SELF_HOSTED_PURCHASE_START_PATH}?feature=relay`,- );- // The public /pricing resolver stays unsourced for mapped features.- expect(getPricingRouteDestination('?feature=rbac')).toBe(- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- );- });-it('keeps retired trial-expired out of upgrade fallbacks while preserving neutral legacy arrival', () => {expect(getPricingRouteDestination('?feature=trial_expired')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF,diff --git a/frontend-modern/src/utils/pricingHandoff.ts b/frontend-modern/src/utils/pricingHandoff.tsindex b6e1cc3f9e..dcf1a262f7 100644--- a/frontend-modern/src/utils/pricingHandoff.ts+++ b/frontend-modern/src/utils/pricingHandoff.ts@@ -25,7 +25,6 @@ export const SELF_HOSTED_PRO_BILLING_USAGE_DETAILS_QUERY_PARAM =export const SELF_HOSTED_PRO_BILLING_PLAN_DETAILS_QUERY_PARAM =SELF_HOSTED_PRO_BILLING_DETAILS_QUERY_PARAM;export const SELF_HOSTED_PRO_BILLING_PLAN_INTENT_QUERY_PARAM = 'intent';-export const SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM = 'source';export const SELF_HOSTED_PRO_BILLING_PURCHASE_QUERY_PARAM = 'purchase';export const SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL = 'counting-rules';export const SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL = 'recovery';@@ -54,65 +53,22 @@ export const SELF_HOSTED_PRO_BILLING_PLAN_RECOVERY_HREF = `${SELF_HOSTED_PRO_BILexport const SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF = `${SELF_HOSTED_PRO_BILLING_USAGE_ROUTE}?${SELF_HOSTED_PRO_BILLING_USAGE_DETAILS_QUERY_PARAM}=${SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL}`;export const SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF = `${SELF_HOSTED_PRO_BILLING_PLAN_ROUTE}?${SELF_HOSTED_PRO_BILLING_PLAN_INTENT_QUERY_PARAM}=${SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT}`;-// Checkout source attribution. Gate CTAs stamp a closed-vocabulary `source`-// onto the billing plan route (or directly onto the purchase-start URL for-// unmapped keys); the plan page threads it into the purchase-start handoff so-// the license server can attribute the Stripe checkout to the surface that-// started it. The param is authenticated-session-only: the public /pricing-// route and the public pricing URL never carry it, and forwarded pre-auth-// query strings are scrubbed of it in getSelfHostedPurchaseStartUrl.-export const PURCHASE_HANDOFF_SOURCE_PLANS_PAGE = 'plans-page';-export const PURCHASE_HANDOFF_SOURCE_ESTATE_CARD = 'estate-card';--const PURCHASE_HANDOFF_GATE_SOURCES: Record<string, string> = {- rbac: 'gate-rbac',- advanced_reporting: 'gate-reporting',- mobile_app: 'gate-mobile-app',- push_notifications: 'gate-push-notifications',- ai_alerts: 'gate-ai-alerts',- ai_autofix: 'gate-ai-autofix',- relay: 'gate-relay',- audit_logging: 'gate-audit-logging',- agent_profiles: 'gate-agent-profiles',- external_probe: 'gate-external-probe',- long_term_metrics: 'gate-long-term-metrics',- white_label: 'gate-white-label',-};--const PURCHASE_HANDOFF_SOURCE_PATTERN = /^[a-z][a-z0-9-]{0,39}$/;--export function normalizePurchaseHandoffSource(- source: string | null | undefined,-): string | undefined {- const normalized = source?.trim();- if (!normalized || !PURCHASE_HANDOFF_SOURCE_PATTERN.test(normalized)) return undefined;- return normalized;-}--export function getPurchaseHandoffGateSource(- feature: string | null | undefined,-): string | undefined {- const normalizedFeature = feature?.trim();- if (!normalizedFeature) return undefined;- return PURCHASE_HANDOFF_GATE_SOURCES[normalizedFeature];-}-const IN_PRODUCT_PRICING_DESTINATIONS: Record<string, string> = {self_hosted_plan: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,// Paid self-hosted feature keys: route to the owned billing plan page instead// of the Pulse Account purchase-start handoff, which fails for local instances// without PublicURL.- mobile_app: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- push_notifications: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- ai_alerts: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,+ mobile_app: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ push_notifications: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ ai_alerts: SELF_HOSTED_PRO_BILLING_PLAN_HREF,ai_autofix: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- relay: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- rbac: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- audit_logging: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- advanced_reporting: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- agent_profiles: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- external_probe: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,- long_term_metrics: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,+ relay: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ rbac: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ audit_logging: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ advanced_reporting: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ agent_profiles: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ external_probe: SELF_HOSTED_PRO_BILLING_PLAN_HREF,+ long_term_metrics: SELF_HOSTED_PRO_BILLING_PLAN_HREF,};const RETIRED_TRIAL_PRICING_FEATURES = new Set(['trial_expired']);@@ -163,7 +119,6 @@ function normalizeFeatureKey(feature: string | null | undefined): string | undefexport function getSelfHostedPurchaseStartUrl(feature?: string | null,searchParams?: URLSearchParams,- source?: string | null,): string {const url = new URL(SELF_HOSTED_PURCHASE_START_PATH, INTERNAL_HREF_BASE);if (searchParams) {@@ -175,15 +130,6 @@ export function getSelfHostedPurchaseStartUrl(}}- // Attribution is set only by authenticated in-app callers via the explicit- // argument; a forwarded query string (the public /pricing route) never- // carries it through.- url.searchParams.delete(SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM);- const normalizedSource = normalizePurchaseHandoffSource(source);- if (normalizedSource) {- url.searchParams.set(SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM, normalizedSource);- }-const normalizedFeature = normalizeFeatureKey(feature);if (normalizedFeature) {url.searchParams.set('feature', normalizedFeature);@@ -194,9 +140,8 @@ export function getSelfHostedPurchaseStartUrl(export function resolveSelfHostedPurchaseStartDestination(feature?: string | null,searchParams?: URLSearchParams,- source?: string | null,): UpgradeDestination {- return resolveUpgradeDestination(getSelfHostedPurchaseStartUrl(feature, searchParams, source), {+ return resolveUpgradeDestination(getSelfHostedPurchaseStartUrl(feature, searchParams), {hardNavigation: true,newTab: true,preserveOpener: true,@@ -229,30 +174,12 @@ export function getManagedHostingRequestUrl(): string {return DEFAULT_MANAGED_HOSTING_REQUEST_URL;}-// withPurchaseHandoffSource stamps a gate source onto an in-product billing-// plan href. Only the authenticated upgrade-CTA fallback below uses it; the-// public /pricing route resolves the same destinations unsourced so a website-// arrival is never attributed to an in-app gate.-function withPurchaseHandoffSource(destination: string, source: string | undefined): string {- const normalized = normalizePurchaseHandoffSource(source);- if (!normalized) return destination;- const url = new URL(destination, INTERNAL_HREF_BASE);- if (!isSelfHostedBillingPath(url.pathname)) return destination;- url.searchParams.set(SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM, normalized);- return `${url.pathname}${url.search}`;-}-export function getUpgradeFallbackDestination(feature?: string | null): string | undefined {if (isRetiredPricingFeature(feature)) return undefined;if (normalizeFeatureKey(feature) === 'cloud') {return getManagedHostingRequestUrl();}- const gateSource = getPurchaseHandoffGateSource(feature);- const inProductDestination = getInProductPricingDestination(feature);- if (inProductDestination) {- return withPurchaseHandoffSource(inProductDestination, gateSource);- }- return getSelfHostedPurchaseStartUrl(feature, undefined, gateSource);+ return getInProductPricingDestination(feature) || getSelfHostedPurchaseStartUrl(feature);}export function getSelfHostedBillingUsageDetail(@@ -279,14 +206,6 @@ export function getSelfHostedBillingPlanIntent(search: string): SelfHostedBillinreturn null;}-export function getSelfHostedBillingPlanSource(search: string): string | null {- return (- normalizePurchaseHandoffSource(- billingSearch(search).get(SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM),- ) ?? null- );-}-export function getSelfHostedBillingPurchaseArrival(search: string,): SelfHostedBillingPurchaseArrival | null {@@ -309,7 +228,6 @@ export function getSelfHostedBillingHref(detail?: SelfHostedBillingDetail | null;intent?: SelfHostedBillingPlanIntent | null;purchase?: SelfHostedBillingPurchaseArrival | null;- source?: string | null;} = {},): string {const baseRoute =@@ -341,11 +259,6 @@ export function getSelfHostedBillingHref(params.set(SELF_HOSTED_PRO_BILLING_PURCHASE_QUERY_PARAM, options.purchase);}- const source = section === 'plan' ? normalizePurchaseHandoffSource(options.source) : undefined;- if (source) {- params.set(SELF_HOSTED_PRO_BILLING_PLAN_SOURCE_QUERY_PARAM, source);- }-const search = params.toString();return `${baseRoute}${search ? `?${search}` : ''}`;}@@ -413,7 +326,6 @@ export function resolveCanonicalSelfHostedBillingHref(? SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL: null;const planIntent = section === 'plan' ? getSelfHostedBillingPlanIntent(search) : null;- const planSource = section === 'plan' ? getSelfHostedBillingPlanSource(search) : null;const planDetail =section === 'plan' &&(getSelfHostedBillingPlanDetail(search) === SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL ||@@ -426,7 +338,6 @@ export function resolveCanonicalSelfHostedBillingHref(detail: section === 'usage' ? usageDetail : planDetail,intent: planIntent,purchase,- source: planSource,});}diff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex 23a31475fd..a4c0fcbeb1 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -10855,10 +10855,10 @@ func TestContract_PublicSecurityStatusIncludesDemoPresentationPolicy(t *testing.}}-func TestContract_SecurityStatusPresentationPolicyShowsUpgradeByDefault(t *testing.T) {- // 2026-08-07 self-hosted commercial-surfaces revision: ordinary free- // self-hosted sessions see upgrade CTAs; suppression is reserved for demo- // mode and white-label runtimes (pinned separately below).+func TestContract_SecurityStatusPresentationPolicyHidesUpgradeByDefault(t *testing.T) {+ // Ordinary free self-hosted sessions stay opt-in. The billing route remains+ // directly reachable, but the served policy suppresses upgrade prompts and+ // navigation until there is hosted, paid, activation, or recovery context.cfg := newTestConfigWithTokens(t)cfg.DemoMode = false@@ -10884,7 +10884,7 @@ func TestContract_SecurityStatusPresentationPolicyShowsUpgradeByDefault(t *testi"demoMode": false,"readOnly": false,"hideCommercial": false,- "hideUpgrade": false,+ "hideUpgrade": true,} {if got, _ := presentationPolicy[key].(bool); got != want {t.Fatalf("presentationPolicy.%s = %v, want %v", key, presentationPolicy[key], want)@@ -10894,21 +10894,23 @@ func TestContract_SecurityStatusPresentationPolicyShowsUpgradeByDefault(t *testifunc TestContract_SecurityStatusPresentationPolicySuppressionInputs(t *testing.T) {cases := []struct {- name string- demoMode bool- whiteLabel bool- wantHidden bool+ name string+ demoMode bool+ whiteLabel bool+ commercialContext bool+ wantCommercial bool+ wantUpgrade bool}{- {"default shows commercial surfaces", false, false, false},- {"demo mode hides commercial surfaces", true, false, true},- {"white-label hides commercial surfaces", false, true, true},- {"demo and white-label hides commercial surfaces", true, true, true},+ {"free self-hosted stays opt-in", false, false, false, false, true},+ {"hosted or paid context exposes upgrade navigation", false, false, true, false, false},+ {"demo mode suppresses every commercial surface", true, false, true, true, true},+ {"white-label suppresses every commercial surface", false, true, true, true, true},}for _, tc := range cases {t.Run(tc.name, func(t *testing.T) {- policy := resolveSecurityStatusPresentationPolicy(tc.demoMode, tc.whiteLabel)- if policy.HideUpgrade != tc.wantHidden || policy.HideCommercial != tc.wantHidden {- t.Fatalf("policy = %+v, want hideUpgrade=hideCommercial=%v", policy, tc.wantHidden)+ policy := resolveSecurityStatusPresentationPolicy(tc.demoMode, tc.whiteLabel, tc.commercialContext)+ if policy.HideUpgrade != tc.wantUpgrade || policy.HideCommercial != tc.wantCommercial {+ t.Fatalf("policy = %+v, want hideUpgrade=%v hideCommercial=%v", policy, tc.wantUpgrade, tc.wantCommercial)}if policy.DemoMode != tc.demoMode || policy.ReadOnly != tc.demoMode {t.Fatalf("policy = %+v, want demoMode=readOnly=%v", policy, tc.demoMode)@@ -10917,30 +10919,6 @@ func TestContract_SecurityStatusPresentationPolicySuppressionInputs(t *testing.T}}-func TestContract_BusinessScaleEstateThresholds(t *testing.T) {- // Thresholds mirror the 2026-08-07 telemetry segmentation: >=5 PVE nodes,- // >=10 Docker hosts, or >=3 VMware hosts marks a business-scale estate.- cases := []struct {- name string- pveNodes, dockerHosts, vmwareHosts int- want bool- }{- {"empty estate", 0, 0, 0, false},- {"homelab scale", 4, 9, 2, false},- {"pve threshold", 5, 0, 0, true},- {"docker threshold", 0, 10, 0, true},- {"vmware threshold", 0, 0, 3, true},- }- for _, tc := range cases {- t.Run(tc.name, func(t *testing.T) {- if got := businessScaleEstateCounts(tc.pveNodes, tc.dockerHosts, tc.vmwareHosts); got != tc.want {- t.Fatalf("businessScaleEstateCounts(%d, %d, %d) = %v, want %v",- tc.pveNodes, tc.dockerHosts, tc.vmwareHosts, got, tc.want)- }- })- }-}-// Settings → Infrastructure reads only RequireAdmin + settings:read endpoints// and then polls two of them, so the served capability has to track the scope// exactly. A capability that over-reports puts a non-admin back on a page whose@@ -23984,76 +23962,6 @@ func TestUnifiedAgentHandlers_HandleReportAckOmitsEmptyServerVersion(t *testing.}}-// Checkout source attribution is an in-app funnel signal, not a browser-visible-// one: it must reach the license server only inside the portal-handoff body and-// must never appear on the Pulse Account portal redirect the browser follows.-func TestContract_CheckoutStartSourceAttributionReachesHandoffNeverPortal(t *testing.T) {- cases := []struct {- name string- querySource string- wantSource string- wantCancelURL string- }{- {- name: "valid gate source",- querySource: "gate-rbac",- wantSource: "gate-rbac",- wantCancelURL: "https://pulse.example.com/settings/system/billing/plan?purchase=cancelled&source=gate-rbac",- },- {- name: "malformed source is dropped",- querySource: "Bad Source!",- wantSource: "",- wantCancelURL: "https://pulse.example.com/settings/system/billing/plan?purchase=cancelled",- },- }- for _, tc := range cases {- t.Run(tc.name, func(t *testing.T) {- handler := createTestHandler(t)- handler.SetConfig(&config.Config{PublicURL: "https://pulse.example.com"})- var capturedReq struct {- Feature string `json:"feature"`- CancelURL string `json:"cancel_url"`- Source string `json:"source"`- }- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- if err := json.NewDecoder(r.Body).Decode(&capturedReq); err != nil {- t.Fatalf("decode checkout portal handoff request: %v", err)- }- w.Header().Set("Content-Type", "application/json")- _ = json.NewEncoder(w).Encode(map[string]any{"portal_handoff_id": "cph_test_source"})- }))- defer server.Close()- t.Setenv("PULSE_LICENSE_SERVER_URL", server.URL)-- req := httptest.NewRequest(- http.MethodGet,- "https://pulse.example.com/auth/license-purchase-start?feature=rbac&source="+url.QueryEscape(tc.querySource),- nil,- )- rec := httptest.NewRecorder()- handler.HandleCheckoutStart(rec, req)-- if rec.Code != http.StatusSeeOther {- t.Fatalf("status = %d, want %d (body=%q)", rec.Code, http.StatusSeeOther, rec.Body.String())- }- redirectURL, err := url.Parse(rec.Header().Get("Location"))- if err != nil {- t.Fatalf("parse redirect location: %v", err)- }- if got := redirectURL.Query().Get("source"); got != "" {- t.Fatalf("source = %q, want omitted from portal query", got)- }- if capturedReq.Source != tc.wantSource {- t.Fatalf("handoff source = %q, want %q", capturedReq.Source, tc.wantSource)- }- if capturedReq.CancelURL != tc.wantCancelURL {- t.Fatalf("cancel_url = %q, want %q", capturedReq.CancelURL, tc.wantCancelURL)- }- })- }-}-// App bootstrap requires presentation defaults for every authenticated role.// Pin both sides of the privilege boundary: the narrow runtime projection is// readable by a viewer, while the complete system settings payload remainsdiff --git a/internal/api/licensing_handlers.go b/internal/api/licensing_handlers.goindex baa53985e2..861595932b 100644--- a/internal/api/licensing_handlers.go+++ b/internal/api/licensing_handlers.go@@ -10,7 +10,6 @@ import ("net/http""net/url""os"- "regexp""strings""sync""time"@@ -30,7 +29,6 @@ const (licensePurchaseReturnTokenField = "purchase_return_token"pulseAccountUpgradeService = "upgrade"pulseAccountPortalFeatureQueryParam = "feature"- pulseAccountPortalSourceQueryParam = "source"pulseAccountPortalHandoffIDField = "portal_handoff_id"pulseAccountPortalHandoffURLQueryParam = "purchase_handoff_url"pulseAccountPortalServiceQueryParam = "service"@@ -294,7 +292,6 @@ func pulseAccountUpgradeURLForRequest(portalHandoffID string, query url.Values)for key, values := range query {switch key {case pulseAccountPortalFeatureQueryParam,- pulseAccountPortalSourceQueryParam,pulseAccountPortalHandoffIDField,pulseAccountPortalHandoffURLQueryParam,pulseAccountPortalServiceQueryParam,@@ -357,36 +354,13 @@ func normalizeSelfHostedPurchaseFeature(feature string) string {}}-// selfHostedPurchaseSourcePattern mirrors the frontend attribution vocabulary-// (pricingHandoff.ts): lowercase kebab tokens such as "gate-rbac",-// "estate-card", or "plans-page". Anything else is dropped, not forwarded.-var selfHostedPurchaseSourcePattern = regexp.MustCompile(`^[a-z][a-z0-9-]{0,39}$`)--func normalizeSelfHostedPurchaseSource(source string) string {- trimmed := strings.TrimSpace(source)- if !selfHostedPurchaseSourcePattern.MatchString(trimmed) {- return ""- }- return trimmed-}-func licensePurchaseActivationRedirectPath(feature, purchaseResult string) string {- return licensePurchaseActivationRedirectPathWithSource(feature, purchaseResult, "")-}--// licensePurchaseActivationRedirectPathWithSource additionally carries the-// checkout source attribution back onto the plan route so a retry after a-// cancelled checkout keeps the surface that originally drove it.-func licensePurchaseActivationRedirectPathWithSource(feature, purchaseResult, source string) string {normalizedFeature := normalizeSelfHostedPurchaseFeature(feature)query := url.Values{}switch normalizedFeature {case "self_hosted_plan":query.Set("intent", "self_hosted_plan")}- if normalizedSource := normalizeSelfHostedPurchaseSource(source); normalizedSource != "" {- query.Set(pulseAccountPortalSourceQueryParam, normalizedSource)- }switch strings.TrimSpace(purchaseResult) {case selfHostedBillingPurchaseActivated,selfHostedBillingPurchaseCancelled,@@ -1101,9 +1075,6 @@ func (h *LicenseHandlers) HandleCheckoutStart(w http.ResponseWriter, r *http.Reqfeature := normalizeSelfHostedPurchaseFeature(r.URL.Query().Get(pulseAccountPortalFeatureQueryParam),)- purchaseSource := normalizeSelfHostedPurchaseSource(- r.URL.Query().Get(pulseAccountPortalSourceQueryParam),- )writeUnavailable := func(statusCode int, message string) {writeLicensePurchaseStartFailurePage(w, statusCode, feature, message)}@@ -1160,7 +1131,7 @@ func (h *LicenseHandlers) HandleCheckoutStart(w http.ResponseWriter, r *http.ReqcancelURL, err := publicAbsoluteURLForPath(r,h.cfg,- licensePurchaseActivationRedirectPathWithSource(feature, selfHostedBillingPurchaseCancelled, purchaseSource),+ licensePurchaseActivationRedirectPath(feature, selfHostedBillingPurchaseCancelled),)if err != nil {log.Error().Err(err).Str("feature", feature).Msg("Failed to build Pulse Account cancellation return url")@@ -1198,7 +1169,6 @@ func (h *LicenseHandlers) HandleCheckoutStart(w http.ResponseWriter, r *http.ReqSuccessURL: activationURLTemplate,CancelURL: cancelURL,PurchaseReturnJTI: purchaseReturnJTI,- Source: purchaseSource,})if err != nil {log.Error().Err(err).Str("feature", feature).Msg("Failed to create Pulse Account checkout portal handoff")diff --git a/internal/api/security_status_capabilities.go b/internal/api/security_status_capabilities.goindex cd0b07d4c3..17433b14c8 100644--- a/internal/api/security_status_capabilities.go+++ b/internal/api/security_status_capabilities.go@@ -6,8 +6,6 @@ import ("strings""github.com/rcourtman/pulse-go-rewrite/internal/config"- "github.com/rcourtman/pulse-go-rewrite/internal/monitoring"- "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"internalauth "github.com/rcourtman/pulse-go-rewrite/pkg/auth")@@ -63,11 +61,6 @@ type securityStatusSettingsCapabilities struct {type securityStatusSessionCapabilities struct {DemoMode bool `json:"demoMode"`AssistantEnabled bool `json:"assistantEnabled"`- // BusinessEstate marks a free self-hosted install whose monitored estate- // crosses the business-scale thresholds. Authenticated-session only: it- // must never ride the pre-auth presentation policy, where it would leak- // estate size to anonymous visitors.- BusinessEstate bool `json:"businessEstate"`}type securityStatusPresentationPolicy struct {@@ -313,83 +306,42 @@ func (r *Router) securityStatusSessionCapabilities(ctx context.Context) securityif r != nil && r.aiSettingsHandler != nil {assistantEnabled = r.aiSettingsHandler.AssistantEnabled(ctx)}- businessEstate := false- if r != nil && !demoMode && !r.hostedMode {- paidOrBranded := false- if svc := getLicenseServiceForContext(ctx); svc != nil {- if lic := svc.Current(); lic != nil && lic.Claims.Tier != licenseTierFreeValue {- paidOrBranded = true- }- if svc.HasFeature(featureWhiteLabelValue) {- paidOrBranded = true- }- }- if !paidOrBranded {- businessEstate = r.businessScaleEstate(ctx)- }- }return securityStatusSessionCapabilities{DemoMode: demoMode,AssistantEnabled: assistantEnabled,- BusinessEstate: businessEstate,}}-// businessScaleEstateCounts delegates to the canonical business-scale estate-// definition in internal/monitoring, which the outbound telemetry snapshot-// also classifies against.-func businessScaleEstateCounts(pveNodes, dockerHosts, vmwareHosts int) bool {- return monitoring.BusinessScaleEstateCounts(pveNodes, dockerHosts, vmwareHosts)-}--func (r *Router) businessScaleEstate(ctx context.Context) bool {- if r == nil || r.configHandlers == nil {- return false- }- monitor := r.configHandlers.getMonitor(ctx)- if monitor == nil {- return false- }- pveNodes, dockerHosts := 0, 0- if readState := monitor.GetUnifiedReadStateOrSnapshot(); readState != nil {- pveNodes = len(readState.Nodes())- dockerHosts = len(readState.DockerHosts())- }- vmwareHosts := 0- resources, _ := monitor.UnifiedResourceSnapshot()- for _, resource := range resources {- if resource.VMware == nil {- continue- }- if unifiedresources.CanonicalResourceType(resource.Type) == unifiedresources.ResourceTypeAgent {- vmwareHosts++- }- }- return businessScaleEstateCounts(pveNodes, dockerHosts, vmwareHosts)-}-// resolveSecurityStatusPresentationPolicy maps commercial suppression inputs-// to the served policy. Per the 2026-08-07 self-hosted commercial-surfaces-// revision (supersedes the 2026-04-25 opt-in record, RA5), upgrade CTAs are-// visible by default; demo mode and white-label runtimes stay suppressed so-// demos, kiosks, and MSP tenant containers never show commercial content.-func resolveSecurityStatusPresentationPolicy(demoMode, whiteLabel bool) securityStatusPresentationPolicy {+// to the served policy. Ordinary free self-hosted sessions stay opt-in and do+// not receive upgrade prompts. Hosted sessions and installs with existing paid+// or recovery context may expose the commercial navigation. Demo mode and+// white-label runtimes remain fully suppressed.+func resolveSecurityStatusPresentationPolicy(demoMode, whiteLabel, commercialContext bool) securityStatusPresentationPolicy {hideCommercial := demoMode || whiteLabelreturn securityStatusPresentationPolicy{DemoMode: demoMode,ReadOnly: demoMode,HideCommercial: hideCommercial,- HideUpgrade: hideCommercial,+ HideUpgrade: hideCommercial || !commercialContext,}}func (r *Router) securityStatusPresentationPolicy(ctx context.Context) securityStatusPresentationPolicy {demoMode := r != nil && r.config != nil && r.config.DemoModewhiteLabel := false+ commercialContext := r != nil && r.hostedModeif r != nil && !demoMode {if svc := getLicenseServiceForContext(ctx); svc != nil {whiteLabel = svc.HasFeature(featureWhiteLabelValue)+ if lic := svc.Current(); lic != nil && lic.Claims.Tier != licenseTierFreeValue {+ commercialContext = true+ }+ switch strings.ToLower(strings.TrimSpace(svc.SubscriptionState())) {+ case "active", "grace", "canceled", "suspended", "trial":+ commercialContext = true+ }}}- return resolveSecurityStatusPresentationPolicy(demoMode, whiteLabel)+ return resolveSecurityStatusPresentationPolicy(demoMode, whiteLabel, commercialContext)}diff --git a/internal/monitoring/business_estate.go b/internal/monitoring/business_estate.godeleted file mode 100644index 8d09e6321d..0000000000--- a/internal/monitoring/business_estate.go+++ /dev/null@@ -1,25 +0,0 @@-package monitoring--// Business-scale estate thresholds. These are the single classification-// definition used by the session capability surface in internal/api and the-// outbound telemetry snapshot. They are product segmentation constants, not-// evidence of conversion or owner approval for a commercial surface.-const (- BusinessEstateMinPVENodes = 5- BusinessEstateMinDockerHosts = 10- BusinessEstateMinVMwareHosts = 3-)--// BusinessScaleEstateCounts reports whether the given counts cross any-// business-scale estate threshold.-func BusinessScaleEstateCounts(pveNodes, dockerHosts, vmwareHosts int) bool {- return pveNodes >= BusinessEstateMinPVENodes ||- dockerHosts >= BusinessEstateMinDockerHosts ||- vmwareHosts >= BusinessEstateMinVMwareHosts-}--// BusinessScaleEstate reports whether the install-wide aggregate counts cross-// any business-scale estate threshold.-func (c InstallSnapshotCounts) BusinessScaleEstate() bool {- return BusinessScaleEstateCounts(c.PVENodes, c.DockerHosts, c.VMwareHosts)-}diff --git a/internal/monitoring/canonical_guardrails_test.go b/internal/monitoring/canonical_guardrails_test.goindex bf669d2395..9831fb5daf 100644--- a/internal/monitoring/canonical_guardrails_test.go+++ b/internal/monitoring/canonical_guardrails_test.go@@ -2813,48 +2813,3 @@ func TestMockGuestChartHistorySkipsMemoryUsedForNonProxmoxGuests(t *testing.T) {}}}--// The business-scale estate thresholds are monitoring-owned so the session-// capability surface (internal/api) and the outbound telemetry snapshot-// (pkg/server) classify against one definition. This pins the counts-derived-// method used by telemetry; the API-side wrapper is pinned separately by-// TestContract_BusinessScaleEstateThresholds in internal/api.-func TestInstallSnapshotCountsBusinessScaleEstate(t *testing.T) {- cases := []struct {- name string- counts InstallSnapshotCounts- want bool- }{- {"empty estate", InstallSnapshotCounts{}, false},- {"homelab scale", InstallSnapshotCounts{PVENodes: 4, DockerHosts: 9, VMwareHosts: 2}, false},- {"pve threshold", InstallSnapshotCounts{PVENodes: 5}, true},- {"docker threshold", InstallSnapshotCounts{DockerHosts: 10}, true},- {"vmware threshold", InstallSnapshotCounts{VMwareHosts: 3}, true},- }- for _, tc := range cases {- t.Run(tc.name, func(t *testing.T) {- if got := tc.counts.BusinessScaleEstate(); got != tc.want {- t.Fatalf("BusinessScaleEstate() with %+v = %v, want %v", tc.counts, got, tc.want)- }- })- }-}--func TestBusinessEstateClassifierDoesNotClaimCommercialEvidence(t *testing.T) {- data, err := os.ReadFile("business_estate.go")- if err != nil {- t.Fatalf("read business_estate.go: %v", err)- }-- source := strings.ToLower(string(data))- for _, unsupported := range []string{- "convert to paid",- "conversion rate",- "richard-approved",- "~8x",- } {- if strings.Contains(source, unsupported) {- t.Fatalf("business-estate classifier must not claim unsupported commercial evidence %q", unsupported)- }- }-}diff --git a/internal/telemetry/telemetry.go b/internal/telemetry/telemetry.goindex 6e313aa294..e993ec79a9 100644--- a/internal/telemetry/telemetry.go+++ b/internal/telemetry/telemetry.go@@ -35,7 +35,6 @@// - Whether SSO/OIDC is configured// - Whether multi-tenant mode is enabled// - Whether a paid license is active-// - Whether the monitored estate crosses a business-scale threshold (a boolean derived from the resource counts above)// - Whether any API tokens are configured// - Aggregate alert fired/acknowledged/resolved counts over 30 days// - Aggregate notification attempt/delivery/failure counts over seven days@@ -148,12 +147,7 @@ const (// count measured background write volume; neither discriminated an install// that uses audit logging from one that merely has it. Reaching a// license-gated audit read does.- // Schema v8 adds business_estate, a server-derived boolean marking installs- // whose aggregate counts cross any business-scale estate threshold (the- // same single definition that drives the in-product business-estate card).- // The flag is derived from counts already present in the payload; it adds a- // stable cohort column so segmentation survives future threshold changes.- TelemetrySchemaVersion = 8+ TelemetrySchemaVersion = 7)type installIDRecord struct {@@ -239,7 +233,6 @@ type Ping struct {SSOEnabled bool `json:"sso_enabled"`MultiTenant bool `json:"multi_tenant"`PaidLicense bool `json:"paid_license"`- BusinessEstate bool `json:"business_estate"`HasAPITokens bool `json:"has_api_tokens"`// Licensed-feature adoption. Counts only: no role names, schedule names,@@ -389,7 +382,6 @@ type Snapshot struct {SSOEnabled boolMultiTenant boolPaidLicense bool- BusinessEstate boolHasAPITokens boolRBACCustomRoles intRBACUserAssignments int@@ -980,7 +972,6 @@ func applySnapshot(base Ping, fn SnapshotFunc) Ping {ping.SSOEnabled = s.SSOEnabledping.MultiTenant = s.MultiTenantping.PaidLicense = s.PaidLicense- ping.BusinessEstate = s.BusinessEstateping.HasAPITokens = s.HasAPITokensping.RBACCustomRoles = s.RBACCustomRolesping.RBACUserAssignments = s.RBACUserAssignmentsdiff --git a/internal/telemetry/telemetry_test.go b/internal/telemetry/telemetry_test.goindex 46a840604e..7186c5d9c1 100644--- a/internal/telemetry/telemetry_test.go+++ b/internal/telemetry/telemetry_test.go@@ -355,7 +355,6 @@ func TestApplySnapshot(t *testing.T) {AlertAIEnabled: true,ActiveAlerts: 2,PaidLicense: true,- BusinessEstate: true,HasAPITokens: true,RBACCustomRoles: 3,RBACUserAssignments: 7,@@ -465,9 +464,6 @@ func TestApplySnapshot(t *testing.T) {if !ping.PaidLicense {t.Fatal("PaidLicense should be true")}- if !ping.BusinessEstate {- t.Fatal("BusinessEstate should be true")- }if !ping.HasAPITokens {t.Fatal("HasAPITokens should be true")}diff --git a/pkg/licensing/license_server_client.go b/pkg/licensing/license_server_client.goindex fea686414d..2d6b4e85d0 100644--- a/pkg/licensing/license_server_client.go+++ b/pkg/licensing/license_server_client.go@@ -49,11 +49,6 @@ type CheckoutPortalHandoffRequest struct {SuccessURL string `json:"success_url"`CancelURL string `json:"cancel_url"`PurchaseReturnJTI string `json:"purchase_return_jti"`- // Source is the closed-vocabulary in-app surface attribution for the- // checkout (e.g. "gate-rbac", "estate-card", "plans-page"). omitempty keeps- // requests without attribution compatible with license servers that predate- // the field, since the receiver decodes strictly.- Source string `json:"source,omitempty"`}// CheckoutPortalHandoffResponse is the canonical opaque portal handoff used todiff --git a/pkg/licensing/license_server_client_test.go b/pkg/licensing/license_server_client_test.goindex 50c518fbbd..a5f93150b3 100644--- a/pkg/licensing/license_server_client_test.go+++ b/pkg/licensing/license_server_client_test.go@@ -523,54 +523,6 @@ func TestClientCreateCheckoutPortalHandoff(t *testing.T) {}}-func TestClientCreateCheckoutPortalHandoffSourceAttribution(t *testing.T) {- // The license server decodes this body strictly (DisallowUnknownFields), so- // an install with no attribution must omit `source` entirely rather than- // send an empty string. That keeps source-less handoffs working against a- // license server deployed either side of the field being added.- cases := []struct {- name string- source string- wantKey bool- wantSource string- }{- {name: "attributed handoff carries the source", source: "gate-rbac", wantKey: true, wantSource: "gate-rbac"},- {name: "unattributed handoff omits the key", source: "", wantKey: false},- }- for _, tc := range cases {- t.Run(tc.name, func(t *testing.T) {- var body map[string]any- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- if err := json.NewDecoder(r.Body).Decode(&body); err != nil {- t.Fatalf("decode request: %v", err)- }- w.WriteHeader(http.StatusOK)- _ = json.NewEncoder(w).Encode(CheckoutPortalHandoffResponse{PortalHandoffID: "cph_test_source"})- }))- defer server.Close()-- client := NewLicenseServerClient(server.URL)- if _, err := client.CreateCheckoutPortalHandoff(context.Background(), CheckoutPortalHandoffRequest{- Feature: "rbac",- SuccessURL: "https://pulse.example.com/auth/license-purchase-activate?purchase_return_token=prt_signed&session_id={CHECKOUT_SESSION_ID}",- CancelURL: "https://pulse.example.com/settings/system/billing/plan?purchase=cancelled",- PurchaseReturnJTI: "purchase_return_jti_123",- Source: tc.source,- }); err != nil {- t.Fatalf("CreateCheckoutPortalHandoff failed: %v", err)- }-- got, present := body["source"]- if present != tc.wantKey {- t.Fatalf("source key present = %v, want %v (body=%v)", present, tc.wantKey, body)- }- if tc.wantKey && got != tc.wantSource {- t.Fatalf("source = %v, want %q", got, tc.wantSource)- }- })- }-}-func TestClientRefreshGrant(t *testing.T) {t.Run("successful refresh", func(t *testing.T) {newGrantJWT := makeTestGrantJWT(t, &GrantClaims{diff --git a/pkg/server/server.go b/pkg/server/server.goindex bc886c88a9..1267deb1ed 100644--- a/pkg/server/server.go+++ b/pkg/server/server.go@@ -551,9 +551,6 @@ func Run(ctx context.Context, version string) error {snap.NotificationFailuresConfiguration7d = counts.NotificationFailuresConfiguration7dsnap.NotificationFailuresRejected7d = counts.NotificationFailuresRejected7dsnap.NotificationFailuresUnknown7d = counts.NotificationFailuresUnknown7d- // Coarse business-scale classification derived from the same- // aggregate counts; thresholds live in internal/monitoring.- snap.BusinessEstate = counts.BusinessScaleEstate()snap.DiscoveryEnabled = currentCfg.DiscoveryEnabled// Feature flags from persisted config (using pre-created persistence).diff --git a/pkg/server/server_test.go b/pkg/server/server_test.goindex 015d66a894..84e8ee74ce 100644--- a/pkg/server/server_test.go+++ b/pkg/server/server_test.go@@ -375,25 +375,3 @@ func TestServerRun_RejectsWildcardTrustedProxyCIDR(t *testing.T) {t.Fatalf("expected wildcard trusted proxy configuration to be rejected, got %v", err)}}--// The telemetry snapshot closure in Run is not directly invocable, so this-// pins the wiring: business_estate must be derived from the same-// AggregateInstallSnapshotCounts values the payload already carries, via the-// monitoring-owned threshold definition. The derivation itself is pinned in-// internal/monitoring (TestInstallSnapshotCountsBusinessScaleEstate) and the-// thresholds in internal/api (TestContract_BusinessScaleEstateThresholds).-func TestTelemetrySnapshotDerivesBusinessEstateFromAggregateCounts(t *testing.T) {- source, err := os.ReadFile("server.go")- if err != nil {- t.Fatalf("read server.go: %v", err)- }- src := string(source)- if !strings.Contains(src, "snap.BusinessEstate = counts.BusinessScaleEstate()") {- t.Fatal("telemetry snapshot must derive BusinessEstate from AggregateInstallSnapshotCounts via counts.BusinessScaleEstate()")- }- counts := strings.Index(src, "reloadableMonitor.AggregateInstallSnapshotCounts()")- derived := strings.Index(src, "snap.BusinessEstate = counts.BusinessScaleEstate()")- if counts < 0 || derived < counts {- t.Fatal("BusinessEstate must be derived after the aggregate counts are captured in the snapshot closure")- }-}diff --git a/tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.ts b/tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.tsindex ab3eac5344..6fd572972c 100644--- a/tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.ts+++ b/tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.ts@@ -1,4 +1,4 @@-import { expect, test } from '@playwright/test';+import { expect, test, type Page } from '@playwright/test';import { ensureAuthenticated } from './helpers';const FREE_SELF_HOSTED_ENTITLEMENTS = {@@ -16,16 +16,12 @@ const SELF_HOSTED_SECURITY_STATUS = {ssoProviders: [],sessionCapabilities: {demoMode: false,- businessEstate: false,},- // 2026-08-07 commercial-surfaces revision: the canonical free self-hosted- // policy shows upgrade CTAs; suppression is reserved for demo mode and- // white-label runtimes.presentationPolicy: {demoMode: false,readOnly: false,hideCommercial: false,- hideUpgrade: false,+ hideUpgrade: true,},settingsCapabilities: {apiAccessRead: true,@@ -40,74 +36,102 @@ const SELF_HOSTED_SECURITY_STATUS = {},};-test.describe.serial('Self-hosted paid prompt visibility', () => {- test('surfaces paid-only navigation with inline gates and no trial ceremony', async ({- page,- }, testInfo) => {- test.skip(- testInfo.project.name.startsWith('mobile-'),- 'Desktop-only settings navigation coverage',- );-- await ensureAuthenticated(page);-- await page.route('**/api/security/status', async (route) => {- await route.fulfill({- status: 200,- contentType: 'application/json',- body: JSON.stringify(SELF_HOSTED_SECURITY_STATUS),- });+async function mockFreeSelfHostedCommercialPosture(page: Page) {+ await page.route('**/api/security/status', async (route) => {+ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify(SELF_HOSTED_SECURITY_STATUS),});+ });- await page.route('**/api/license/runtime-capabilities', async (route) => {- await route.fulfill({- status: 200,- contentType: 'application/json',- body: JSON.stringify({- capabilities: [],- limits: [],- hosted_mode: false,- max_history_days: 7,- }),- });+ await page.route('**/api/license/runtime-capabilities', async (route) => {+ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify({+ capabilities: [],+ limits: [],+ hosted_mode: false,+ max_history_days: 7,+ }),});+ });- await page.route('**/api/license/commercial-posture', async (route) => {+ for (const path of ['commercial-posture', 'entitlements']) {+ await page.route(`**/api/license/${path}`, async (route) => {await route.fulfill({status: 200,contentType: 'application/json',body: JSON.stringify(FREE_SELF_HOSTED_ENTITLEMENTS),});});+ }+}- await page.route('**/api/license/entitlements', async (route) => {- await route.fulfill({- status: 200,- contentType: 'application/json',- body: JSON.stringify(FREE_SELF_HOSTED_ENTITLEMENTS),- });- });+test.describe.serial('Self-hosted paid prompt visibility', () => {+ test('keeps paid-only navigation and trial CTAs out of the default self-hosted UI', async ({+ page,+ }, testInfo) => {+ test.skip(+ testInfo.project.name.startsWith('mobile-'),+ 'Desktop-only settings navigation coverage',+ );++ await ensureAuthenticated(page);+ await mockFreeSelfHostedCommercialPosture(page);await page.goto('/settings/security-roles');await expect(page.getByRole('heading', { level: 1, name: 'Roles' })).toBeVisible();- // The panel gates inline with the canonical upgrade CTA (2026-08-07- // commercial-surfaces revision: paid-only tabs follow the Relay- // precedent instead of hiding).- await expect(page.getByRole('heading', { name: 'Custom Roles' }).first()).toBeVisible();- await expect(page.getByRole('link', { name: 'View plans' }).first()).toBeVisible();- await expect(page.getByRole('button', { name: 'Remote Access' })).toBeVisible();- await expect(page.getByRole('button', { name: 'Roles' })).toBeVisible();- await expect(page.getByRole('button', { name: 'Users' })).toBeVisible();- await expect(page.getByRole('button', { name: 'Audit Log' })).toBeVisible();- await expect(page.getByRole('button', { name: 'Audit Webhooks' })).toBeVisible();- await expect(page.getByRole('button', { name: 'Plans & Billing' })).toBeVisible();- // Trial ceremony and hosted handoff remain absent: the revision opens- // discoverability, not trial or hosted flows.+ await expect(page.getByText('Custom Roles (Pro)')).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Remote Access' })).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Roles' })).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Users' })).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Audit Log' })).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Audit Webhooks' })).toHaveCount(0);+ await expect(page.getByRole('button', { name: 'Plans & Billing' })).toHaveCount(0);await expect(page.getByRole('link', { name: /upgrade to pro/i })).toHaveCount(0);await expect(page.getByRole('button', { name: /start free trial/i })).toHaveCount(0);await expect(page.getByRole('button', { name: /start trial/i })).toHaveCount(0);await expect(page.getByText(/free 14-day trial/i)).toHaveCount(0);await expect(page.getByText(/open hosted handoff/i)).toHaveCount(0);+ await page.screenshot({+ path: testInfo.outputPath('free-default-settings.png'),+ fullPage: true,+ });+ await page.setViewportSize({ width: 390, height: 844 });+ await expect(page.getByRole('heading', { level: 1, name: 'Roles' })).toBeVisible();+ await expect(page.getByRole('button', { name: 'Plans & Billing' })).toHaveCount(0);+ await page.screenshot({+ path: testInfo.outputPath('free-default-settings-narrow.png'),+ fullPage: true,+ });+ });++ test('keeps the Plans & Billing direct route available as an explicit opt-in surface', async ({+ page,+ }, testInfo) => {+ test.skip(+ testInfo.project.name.startsWith('mobile-'),+ 'Desktop-only settings navigation coverage',+ );++ await ensureAuthenticated(page);+ await mockFreeSelfHostedCommercialPosture(page);+ await page.goto('/settings/pulse-intelligence/billing/plan');++ await expect(page.getByRole('heading', { name: 'Plans & Billing' }).first()).toBeVisible();+ await expect(page.getByRole('button', { name: 'Plans & Billing' })).toHaveCount(0);+ await page.screenshot({+ path: testInfo.outputPath('free-explicit-billing-route.png'),+ fullPage: true,+ });+ await page.setViewportSize({ width: 390, height: 844 });+ await expect(page.getByRole('heading', { name: 'Plans & Billing' }).first()).toBeVisible();+ await page.screenshot({+ path: testInfo.outputPath('free-explicit-billing-route-narrow.png'),+ fullPage: true,+ });});});