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
fix(governance): fail closed on unsupported commercial evidence
rcourtman633d3117f734
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.mdindex 97c73b0815..2dbf4d6e14 100644--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md@@ -1,6 +1,6 @@# Pulse v6 Source Of Truth-Last updated: 2026-08-02+Last updated: 2026-08-08Status: ACTIVEThis file is the stable human governance layer for the active v6 release@@ -423,6 +423,14 @@ Assertion design rules:verification receipt with exact routes, changed paths, final-contentdigests, states, and interactions. DOM presence, unit tests, snapshots, anda successful build cannot substitute for rendered-pixel and behavior proof.+27. A material owner-approval record that relies on quantitative rationale must+ carry reproducible provenance in the same record. It must identify the+ durable source, exact query or canonical report command, sanitized snapshot,+ and measurement time. A prose number, model summary, operator recollection,+ or unreferenced claim cannot substitute for those artifacts. Quantitative+ association must not be labelled conversion or causation unless the source+ and query actually measure that outcome. The approval itself still requires+ a separate durable owner-confirmation artifact.## Non-Negotiable Release Gatesdiff --git a/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md b/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-evidence-audit-2026-08-08.mdnew file mode 100644index 0000000000..4a2d4b2804--- /dev/null+++ b/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md@@ -0,0 +1,120 @@+# Self-Hosted Commercial Surfaces Evidence Audit++- Audit date: `2026-08-08`+- Audited record: `self-hosted-commercial-surfaces-revision-2026-08-07.md`+- Source cutoff under test: `2026-08-07T12:47:46Z`+- Result: `exact rationale not reproducible`+- Data handling: `aggregate-only read, no install, customer, subscription, or resource identifiers returned`++## Provenance++- Source repository: `pulse-pro@6fa9bc6dc2c2df917c16964a0305d41967162f1f`+- Source schema: `license-server/main.go`, table `telemetry_pings`+- Access path: tracked pinned-host wrapper `pulse-pro/scripts/license_ssh.sh`+- Query mode: SQLite `-readonly`+- Measured at: `2026-08-08T01:47:00Z`+- Original query or snapshot: `not found`++The audit searched current tracked files, all reachable git history, commit+messages, and git notes in `pulse` and `pulse-pro`. The exact figures and the+`Richard` approval label existed only in the audited prose record. No git notes+namespace was present.++## Sanitized Reconstruction Query++This query is a forensic reconstruction. It is not represented as the original+query. It returns aggregate counts only.++```sql+WITH latest AS (+ SELECT+ p.*,+ ROW_NUMBER() OVER (+ PARTITION BY p.install_id+ ORDER BY p.received_at DESC, p.rowid DESC+ ) AS rn+ FROM telemetry_pings p+ WHERE p.received_at >= datetime('2026-08-07 12:47:46', '-7 days')+ AND p.received_at < '2026-08-07 12:47:46'+ AND COALESCE(p.version_is_development, 0) = 0+), classified AS (+ SELECT+ CASE+ WHEN COALESCE(pve_nodes, 0) >= 5+ OR COALESCE(docker_hosts, 0) >= 10+ OR COALESCE(vmware_hosts, 0) >= 3+ THEN 1 ELSE 0+ END AS business,+ CASE WHEN COALESCE(paid_license, 0) != 0 THEN 1 ELSE 0 END AS paid+ FROM latest+ WHERE rn = 1+)+SELECT+ COUNT(*) AS installs,+ SUM(business) AS business_estates,+ SUM(CASE WHEN business = 1 AND paid = 1 THEN 1 ELSE 0 END) AS business_paid,+ ROUND(+ 100.0 * SUM(CASE WHEN business = 1 AND paid = 1 THEN 1 ELSE 0 END)+ / NULLIF(SUM(business), 0),+ 4+ ) AS business_paid_pct,+ SUM(CASE WHEN business = 0 AND paid = 1 THEN 1 ELSE 0 END) AS smaller_paid,+ ROUND(+ 100.0 * SUM(CASE WHEN business = 0 AND paid = 1 THEN 1 ELSE 0 END)+ / NULLIF(SUM(CASE WHEN business = 0 THEN 1 ELSE 0 END), 0),+ 4+ ) AS smaller_paid_pct+FROM classified;+```++The pre-GA comparison used the same aggregate distinct-install calculation with+cutoffs at the start and end of 2026-07-04 UTC:++```sql+SELECT COUNT(DISTINCT install_id)+FROM telemetry_pings+WHERE received_at >= datetime(:cutoff, '-7 days')+ AND received_at < :cutoff;+```++## Sanitized Snapshot++| Cutoff and filter | Weekly active installs | Business estates | Business paid | Business paid share | Smaller paid | Smaller paid share |+|---|---:|---:|---:|---:|---:|---:|+| Landing commit, non-development | 9,426 | 672 | 53 | 7.8869% | 86 | 0.9824% |+| Landing commit, published non-development | 9,424 | 672 | 53 | 7.8869% | 85 | 0.9712% |+| End of 2026-08-07 UTC, non-development | 9,527 | 672 | 53 | 7.8869% | 83 | 0.9373% |++Pre-GA weekly active install counts varied materially with the unspecified+cutoff:++| Cutoff | Weekly active installs |+|---|---:|+| `2026-07-04T00:00:00Z` | 362 |+| `2026-07-05T00:00:00Z` | 958 |++Schema inspection at audit time found only two schema-v8 rows, first received+on `2026-08-08T00:10:01Z`. The private landing commit explicitly added the+stored `business_estate` column without backfill. The original 2026-08-07+figures therefore had to derive classification from earlier resource counts.++## Findings++1. The exact 9,421-install and 671-estate population does not reproduce from+ the documented thresholds and observable non-development or published+ filters. Reaching it would require an additional exclusion rule that was not+ recorded.+2. The 7.9% and 0.98% figures closely match paid-license share in the latest+ weekly ping per install. The data does not establish that either cohort+ converted during the window or that estate size caused conversion.+3. The pre-GA baseline lacks an exact cutoff and changes substantially across+ the GA date boundary.+4. No query or durable report was found for the claim about new paid+ subscriptions per month. The 2026-08-07 canonical finance snapshot reports+ active subscriptions and revenue, not that acquisition rate.+5. No repository or git artifact confirms project-owner approval of the product+ reversal.++The reconstructed data is useful context for a new explicit owner decision. It+is not sufficient to preserve the earlier approval label or causal conversion+claim.diff --git a/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-revision-2026-08-07.md b/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-revision-2026-08-07.mdindex dcb87c7321..af70151837 100644--- a/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-revision-2026-08-07.md+++ b/docs/release-control/v6/internal/records/self-hosted-commercial-surfaces-revision-2026-08-07.md@@ -2,120 +2,195 @@- Date: `2026-08-07`- Assertion: `RA5`-- Lane: `interactive (Claude Code, Richard-approved)`-- Result: `pass`-- Supersedes: `records/self-hosted-paid-services-opt-in-surface-2026-04-25.md`--## Decision--Ordinary free self-hosted Pulse v6 sessions see reactive commercial surfaces-by default: paid-feature navigation items are visible with panel-owned inline-gates, gate sections render their upgrade call-to-action, and the Plans &-Billing page is discoverable. One proactive surface exists — a one-shot-business-estate card shown only to authenticated sessions of free installs-whose monitored estate crosses business-scale thresholds (>=5 PVE nodes,->=10 Docker hosts, or >=3 VMware hosts), permanently dismissible in a single+- Lane: `L2`+- Implementation status: `landed on main after v6.2.0-rc.9`+- Approval status: `not verified`+- Governance result: `blocked pending project-owner decision`+- Supersedes only if approved: `records/self-hosted-paid-services-opt-in-surface-2026-04-25.md`++## Governance Correction++The original record labelled this revision `Richard-approved` and treated an+undocumented telemetry read as material decision evidence. The repository and+git history contain no owner-confirmation artifact, query, snapshot, report URL,+or source identifier for that label or the exact figures. The label is removed.++The 2026-08-08 evidence audit reconstructed nearby aggregate telemetry results,+but it did not reproduce the exact population counts, the monthly subscription+claim, or a longitudinal conversion measure. The reconstructed percentages are+paid-license share in the latest weekly ping cohort, not conversion. See+`self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md`.++This correction does not revert product code. It records the landed behavior+honestly and blocks release readiness until the project owner chooses a product+posture explicitly.++## Quantitative Evidence++- Source: `self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md` (forensic reconstruction, exact rationale not reproduced)+- Query: `self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md#sanitized-reconstruction-query`+- Snapshot: `self-hosted-commercial-surfaces-evidence-audit-2026-08-08.md#sanitized-snapshot`+- Measured at: `2026-08-08T01:47:00Z`++## Implemented Posture Under Review++Ordinary free self-hosted Pulse v6 sessions currently see reactive commercial+surfaces by default. Paid-feature navigation items are visible with panel-owned+inline gates, gate sections render their upgrade call-to-action, and the Plans &+Billing page is discoverable. One proactive surface exists: a one-shot+business-estate card shown only to authenticated sessions of free installs whose+monitored estate crosses the current thresholds of at least 5 PVE nodes, 10+Docker hosts, or 3 VMware hosts. The card is permanently dismissible in a singleinteraction.-Commercial suppression remains absolute for demo mode and white-label-runtimes (which covers MSP tenant containers via their chained white-label-entitlement), and kiosk sessions inherit suppression through the existing-kiosk mount gate. Monitoring surfaces — dashboards, infrastructure pages,-alerts, incident flows, onboarding, and notification channels — carry no-commercial content. Trial ceremony and hosted handoff flows remain absent.--## Why the April decision is superseded--The 2026-04-25 record optimized for a clean community-first GA, before any-post-GA evidence existed. Measured on 2026-08-07 (production telemetry,-mock-fleet rows excluded): weekly active installs grew from ~330 pre-GA to-9,421, while new paid subscriptions stayed flat (~30-40/month) because no-commercial surface was reachable — `hideUpgrade` was forced on for every-non-hosted session, making upgrade CTAs dead code for the entire self-hosted-fleet, and paid-only navigation hiding made deliberate reach impossible.-671 business-scale estates (which convert at 7.9% vs 0.98% for smaller-installs) were active in the trailing 7 days with no in-product path to any-paid tier. The April record's own boundary ("commercial surfaces remain-available when the user deliberately reaches for them") is better served by-visible-but-gated navigation than by hiding, which concealed the existence-of the capabilities users would deliberately reach for.--## Product Boundary (revised)+Commercial suppression remains absolute for demo mode and white-label runtimes,+which covers MSP tenant containers through their chained white-label+entitlement. Kiosk sessions inherit suppression through the existing kiosk mount+gate. Monitoring surfaces, including dashboards, infrastructure pages, alerts,+incident flows, onboarding, and notification channels, carry no commercial+content. Trial ceremony and hosted handoff flows remain absent.++## Evidence Status++The earlier quantitative rationale is not decision-grade evidence:++- A reconstruction at the landing commit cutoff found 9,426 non-development+ weekly active install IDs, not 9,421.+- The same reconstruction found 672 threshold-classified estates, not 671.+- Paid-license share was 7.8869% for the threshold cohort and 0.9824% for the+ smaller cohort. This is a current-state association, not a conversion rate.+- No reproducible source was found for the earlier claim about new paid+ subscriptions per month.+- The `business_estate` stored field first received production rows after the+ original record and was not backfilled, so it cannot be the original source.+- No durable evidence confirms project-owner approval of the reversal.++The historical April decision remains the last verified product direction until+the open owner decision is resolved. The current main implementation differs+from that direction and must not be promoted as approved merely because its+runtime tests pass.++## Current Product Boundary++The following describes the landed code and is not an approval record:- Core self-hosted monitoring stays free and uncapped.-- Reactive surfaces (feature-gate CTAs, paid-feature navigation with inline- gates, Plans & Billing) are visible to ordinary self-hosted sessions.-- Exactly one proactive commercial surface exists: the one-shot- business-estate card. It never shows in demo, white-label, kiosk, hosted,- or paid sessions; never on the first qualifying day; never before the- GitHub star prompt has been interacted with; and never again after any- dismissal action.+- Reactive feature-gate calls to action, paid-feature navigation with inline+ gates, and Plans & Billing are visible to ordinary self-hosted sessions.+- The one-shot business-estate card never shows in demo, white-label, kiosk,+ hosted, or paid sessions. It never shows on the first qualifying day, never+ appears before the GitHub star prompt has been handled, and never appears+ again after any dismissal action.- The business-estate signal is served only on the authenticated security- status response (`sessionCapabilities.businessEstate`), never on the- pre-auth presentation policy, so estate size cannot leak to anonymous- visitors.-- Demo mode and white-label runtimes hide all commercial surfaces- (`hideCommercial` and `hideUpgrade` both forced).+ status response at `sessionCapabilities.businessEstate`, never on the+ pre-auth presentation policy.+- Demo mode and white-label runtimes force both `hideCommercial` and+ `hideUpgrade`.- `multi_tenant` organization navigation stays hidden without the feature.-- No trial flows, no hosted handoff prompts, no commercial content in+- No trial flows, hosted handoff prompts, or commercial content appear inmonitoring or notification surfaces.-## Proof--- `go test ./internal/api ./pkg/licensing -count=1` — pass (includes new- `TestContract_SecurityStatusPresentationPolicyShowsUpgradeByDefault`,- `TestContract_SecurityStatusPresentationPolicySuppressionInputs`,- `TestContract_BusinessScaleEstateThresholds`; demo-mode suppression pins- unchanged and passing).-- `npm --prefix frontend-modern run type-check` — pass.-- RA5 frontend proof suite (`npx vitest run` over the pinned files) — pass- after honest re-pinning of `settingsNavigation.integration.test.tsx` to- the revised navigation invariant.+## Owner Decision Required++The project owner must choose one of these outcomes before the next RC or stable+promotion:++1. **Retain the whole commercial cluster.** Approve the implemented reactive+ navigation, inline gates, discoverable Plans & Billing, one-shot+ business-estate card, schema-v8 classification field, and checkout-source+ attribution. The evidence audit may be used only as aggregate current-state+ context. It does not establish conversion causality.+2. **Revert the whole commercial cluster.** Restore the 2026-04-25 opt-in+ posture, remove the card and its business-estate signal, return paid-feature+ navigation and calls to action to the earlier suppression boundary, remove+ schema-v8 `business_estate`, and remove checkout-source attribution from both+ repositories. The implementation must preserve later unrelated authorization+ and settings fixes while reverting the cluster.+3. **Direct a new narrower posture.** Specify the exact retained and removed+ surfaces. This is a new product decision and does not count as approval of+ either whole-cluster option.++### Whole-cluster commit set++Public `pulse` commits:++- `f0e2243b44b7e40eb6c3af624c4f9337cdf2f4d4`: UI gates, navigation,+ business-estate card, session capability, RA5 revision, and browser proof.+- `6a36b5f8ef34a87d613ff113712be758c7b9ceff`: revised settings navigation test+ pin.+- `5b07bdc3d8eab45ee004c3c71f22fd2f4d318371`: schema-v8 telemetry payload,+ business-estate classifier, privacy copy, and server plumbing.+- `d5bc3e3862fd25f520afe9ecf38b3272f6cd5d93`: in-app checkout-source+ attribution and client handoff contract.+- `06d8bfe65ebf3683a07d9ec7775a50a9872418ce`: held release-note copy.++Private `pulse-pro` dependency commits:++- `884eb4c6147a7ccb7a1c254cb5a9ca57173d7fd0`: stores schema-v8+ `business_estate` pings without backfill.+- `34c0a2b7eee071c2e633efd0edad91ecdc313c07`: accepts, stores, and forwards+ checkout-source attribution.+- `3360c640df62c7125b869ac6a99b7a2e49b73966`: records attribution and deploy+ ordering.++Later settings and authorization fixes overlap files first changed by+`f0e2243b4`. A revert must be conflict-aware and must not blanket-revert those+later fixes.++Later overlapping commits to preserve while implementing any product revert:++- `755a8887874e21d0115e1490b9e69e9501d2a31e`: non-admin settings endpoint+ polling.+- `14a82e7684390c9fe0a4bd900417c4adbb7140b8`: authorization refusal logging.+- `6a958761e84b64dca7052caad855144e57880690`: admin-only System tab+ visibility.+- `27b4d98bc0528a359dc71b819a1b79115354eed8`: viewer workload navigation.+- `6d8a50937672b13fb98f025701a885f3361363e1`: viewer display settings.+- `7a0f410508822afed26c23cd3e715fbeaae3c420`: admin-only panel gates.+- `98ecfb3f10143cdb7b317cb7ab410ae5b2852ab2`: update-status route authority.+- `541c9be7fd764acedb29844506681992faba3a8b`: oversized WebSocket recovery.++## Runtime Proof++These checks prove the landed implementation shape. They do not prove owner+approval or the commercial rationale:++- `go test ./internal/api ./pkg/licensing -count=1`+- `npm --prefix frontend-modern run type-check`+- The RA5 frontend proof suite pinned in the landing commit.- `tests/integration/tests/58-self-hosted-trial-rate-limit-ui.spec.ts`- re-pinned: paid-only navigation and inline gates visible, trial ceremony- and hosted handoff still absent.-- Live browser verification recorded in- `frontend-modern/browser-verification.json` in the landing commit.+- `frontend-modern/browser-verification.json` in the landing commit.-## Release Note Copy (ready to paste)+## Held Release Note Copy-This closes the release-note entry owed by this revision. `v6.2.0-rc.9` was-already tagged when the work landed, so the copy is staged here rather than-written into a version-numbered packet: choosing the next version and-generating its packet is the governed release-preparation step. Paste these-into the `Changed` and `Telemetry` sections of the next `v6.2.0` packet.+Do not paste this copy into a release packet until the owner decision is+resolved. It describes the currently landed implementation only.### Changed-- Free self-hosted installs now show the paid feature pages in Settings with- an inline explanation on each one, instead of hiding them, and Plans &- Billing is reachable from Settings without hunting for it. Monitoring pages,- alerts, onboarding, and notification channels carry no commercial content.-- An install whose monitored estate reaches business scale (5 or more Proxmox- nodes, 10 or more Docker hosts, or 3 or more vSphere hosts) may see one card- asking whether Pulse is running at work. It never appears on the first day- the estate qualifies, and every button on it dismisses the card for good.+- Free self-hosted installs show the paid feature pages in Settings with an+ inline explanation on each one, and Plans & Billing is reachable from+ Settings. Monitoring pages, alerts, onboarding, and notification channels+ carry no commercial content.+- An install whose monitored estate reaches the current thresholds may see one+ card asking whether Pulse is running at work. It never appears on the first+ qualifying day, and every button dismisses it permanently.- Demo mode, kiosk sessions, white-label runtimes, and MSP tenant containers- continue to show no commercial content anywhere. That suppression is- unchanged.+ continue to show no commercial content.### Telemetry- The usage telemetry payload moves to schema 8 and adds `business_estate`, a- true or false flag the install works out from the resource counts already in- the payload. No new detail about your infrastructure is collected. Telemetry- stays opt-out through `PULSE_TELEMETRY=false` or the Settings toggle, and the- new field is listed in the privacy documentation alongside the counts it is- derived from.-- A checkout started from inside Pulse now records which surface it came from,- such as a feature page or the plans page. It is a fixed list of surface- names, never account or infrastructure data, and it is sent only at the- moment you choose to start a purchase.+ Boolean derived from resource counts already present in the payload. No new+ infrastructure detail is collected. Telemetry remains opt-out through+ `PULSE_TELEMETRY=false` or the Settings toggle.+- A checkout started from inside Pulse records a closed-vocabulary source for+ the surface that started it. It is sent only when the user starts a purchase.### Release ordering-The checkout attribution field is read by the private license server, which-decodes the handoff strictly. The license server must be deployed before a-Pulse build that sends the field reaches users, or in-app upgrade clicks fail-closed with the Pulse Account unavailable page. The constraint is recorded in-`pulse-pro` `OPERATIONS.md` under `Stripe / Checkout attribution`.+The private license server decodes the checkout handoff strictly. It must be+deployed before any Pulse build that sends the attribution field, or in-app+upgrade clicks fail closed with the Pulse Account unavailable page. The+constraint is recorded in `pulse-pro` `OPERATIONS.md` under+`Stripe / Checkout attribution`.diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.jsonindex 476a73112a..a04c1b5961 100644--- a/docs/release-control/v6/internal/status.json+++ b/docs/release-control/v6/internal/status.json@@ -1,6 +1,6 @@{"version": "6.0",- "updated_at": "2026-08-02",+ "updated_at": "2026-08-08","scope": {"active_repos": ["pulse",@@ -9119,7 +9119,20 @@"coverage_gaps": [],"candidate_lanes": [],"work_claims": [],- "open_decisions": [],+ "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": []+ }+ ],"source_of_truth_file": "docs/release-control/v6/internal/SOURCE_OF_TRUTH.md","resolved_decisions": [{diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 04c514466d..dbb21c5f54 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -2852,7 +2852,7 @@ change beyond the shutdown defect.`internal/monitoring/business_estate.go` holds the single definition of thebusiness-scale estate thresholds (>=5 PVE nodes, >=10 Docker hosts, or >=3-VMware hosts, from the 2026-08-07 telemetry segmentation): exported constants,+VMware hosts): exported constants,`BusinessScaleEstateCounts`, and `InstallSnapshotCounts.BusinessScaleEstate`.Both consumers delegate here rather than restating numbers: the authenticatedsession-capability surface behind the in-product business-estate card@@ -2865,3 +2865,8 @@ counts-derived method is pinned byby `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/internal/monitoring/business_estate.go b/internal/monitoring/business_estate.goindex 36d2beee6b..8d09e6321d 100644--- a/internal/monitoring/business_estate.go+++ b/internal/monitoring/business_estate.go@@ -1,11 +1,9 @@package monitoring-// Business-scale estate thresholds. These mirror the segmentation used in the-// 2026-08-07 telemetry read that motivated the commercial-surface revision:-// installs at or above any one of these convert to paid at ~8x the rate of-// smaller estates. This is the single definition; the session capability-// surface in internal/api and the outbound telemetry snapshot both classify-// against it.+// 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 = 5BusinessEstateMinDockerHosts = 10diff --git a/internal/monitoring/canonical_guardrails_test.go b/internal/monitoring/canonical_guardrails_test.goindex bb1ffb5baf..bf669d2395 100644--- a/internal/monitoring/canonical_guardrails_test.go+++ b/internal/monitoring/canonical_guardrails_test.go@@ -2839,3 +2839,22 @@ func TestInstallSnapshotCountsBusinessScaleEstate(t *testing.T) {})}}++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/scripts/release_control/release_promotion_policy_test.py b/scripts/release_control/release_promotion_policy_test.pyindex 3730e84875..b146173ba6 100644--- a/scripts/release_control/release_promotion_policy_test.py+++ b/scripts/release_control/release_promotion_policy_test.py@@ -4,6 +4,7 @@from __future__ import annotationsimport os+from pathlib import PurePosixPathimport reimport subprocessimport unittest@@ -41,6 +42,141 @@ def normalize_ws(text: str) -> str:return " ".join(text.split())+_MATERIAL_APPROVAL_RE = re.compile(+ r"(?i)(?:"+ r"\brichard[- ]approved\b|"+ r"\bapproved by (?:richard|the (?:project|product|release) owner)\b|"+ r"\b(?:project|product|release) owner (?:then )?(?:explicitly )?approved\b"+ r")"+)+_QUANTITATIVE_RATIONALE_RE = re.compile(+ r"(?i)(?:"+ r"\d+(?:\.\d+)?\s*%|"+ r"\bconversion(?: rate)?\b|"+ r"\bweekly active\b|"+ r"\bsubscriptions?\s*(?:/|per )\s*(?:month|week|year)\b|"+ r"\bgrew from\b|"+ r"\bmeasured on\b|"+ r"\bcohort(?:s)?\b"+ r")"+)+_QUANTITATIVE_EVIDENCE_FIELDS = (+ "Source",+ "Query",+ "Snapshot",+ "Measured at",+)+_UNUSABLE_EVIDENCE_VALUE_RE = re.compile(+ r"(?i)^(?:none|n/a|na|unknown|unavailable|not (?:available|recorded)|missing)$"+)+_INLINE_EVIDENCE_REFERENCE_RE = re.compile(r"`([^`]+)`")+_RFC3339_UTC_RE = re.compile(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$")+++def _heading_anchor(heading: str) -> str:+ normalized = re.sub(r"[^a-z0-9 _-]", "", heading.strip().lower())+ return re.sub(r"[ _]+", "-", normalized)+++def _local_evidence_reference_error(+ *, field: str, value: str, record_rel: str+) -> str | None:+ reference_match = _INLINE_EVIDENCE_REFERENCE_RE.search(value)+ if reference_match is None:+ return f"'- {field}:' must contain an inline durable reference"++ reference = reference_match.group(1).strip()+ if reference.startswith(("https://", "http://")):+ return None+ if field == "Source" and re.fullmatch(r"[A-Za-z0-9_.-]+@[0-9a-f]{7,40}:.+", reference):+ return None++ path_part, separator, anchor = reference.partition("#")+ if not path_part or path_part.startswith("/") or any(char.isspace() for char in path_part):+ return f"'- {field}:' must reference a repository artifact, source identifier, or URL"++ candidate = PurePosixPath(path_part)+ if candidate.parts and candidate.parts[0] not in {"docs", "scripts"}:+ candidate = PurePosixPath(record_rel).parent / candidate+ candidate_rel = candidate.as_posix()+ try:+ target_content = read(candidate_rel)+ except (OSError, subprocess.CalledProcessError):+ return f"'- {field}:' references missing artifact {candidate_rel!r}"++ if separator:+ anchors = {+ _heading_anchor(match.group(1))+ for match in re.finditer(r"(?m)^#{1,6}\s+(.+?)\s*$", target_content)+ }+ if anchor not in anchors:+ return f"'- {field}:' references missing section #{anchor} in {candidate_rel!r}"+ return None+++def material_approval_evidence_errors(+ content: str, *, record_rel: str | None = None+) -> tuple[str, ...]:+ """Return structural evidence errors for quantitatively justified owner approvals."""+ if not _MATERIAL_APPROVAL_RE.search(content):+ return ()+ if not _QUANTITATIVE_RATIONALE_RE.search(content):+ return ()++ errors: list[str] = []+ if not re.search(r"(?m)^## Quantitative Evidence\s*$", content):+ return ("missing '## Quantitative Evidence' section",)++ values: dict[str, str] = {}+ for field in _QUANTITATIVE_EVIDENCE_FIELDS:+ match = re.search(rf"(?m)^- {re.escape(field)}:\s*(.+?)\s*$", content)+ if match is None:+ errors.append(f"missing '- {field}:' provenance field")+ continue+ value = match.group(1).strip().strip("`").strip()+ values[field] = match.group(1).strip()+ if not value or _UNUSABLE_EVIDENCE_VALUE_RE.fullmatch(value):+ errors.append(f"'- {field}:' must identify durable reproducible evidence")++ for field in ("Source", "Query", "Snapshot"):+ value = values.get(field)+ if value is None or _UNUSABLE_EVIDENCE_VALUE_RE.fullmatch(value.strip("`").strip()):+ continue+ if record_rel is None:+ if _INLINE_EVIDENCE_REFERENCE_RE.search(value) is None:+ errors.append(f"'- {field}:' must contain an inline durable reference")+ continue+ error = _local_evidence_reference_error(+ field=field,+ value=value,+ record_rel=record_rel,+ )+ if error is not None:+ errors.append(error)++ measured_at = values.get("Measured at", "").strip("`").strip()+ if measured_at and not _UNUSABLE_EVIDENCE_VALUE_RE.fullmatch(measured_at):+ if _RFC3339_UTC_RE.fullmatch(measured_at) is None:+ errors.append("'- Measured at:' must be an exact RFC3339 UTC timestamp")+ return tuple(errors)+++def tracked_release_control_records() -> tuple[str, ...]:+ result = subprocess.run(+ [+ "git",+ "ls-files",+ "docs/release-control/v6/internal/records/*.md",+ ],+ cwd=REPO_ROOT,+ check=True,+ capture_output=True,+ text=True,+ env=git_env(),+ )+ return tuple(sorted(line for line in result.stdout.splitlines() if line.strip()))++def workflow_job_block(workflow: str, job: str) -> str:match = re.search(rf"(?ms)^ {re.escape(job)}:\n.*?(?=^ [A-Za-z0-9_]+:\n|\Z)",@@ -644,6 +780,7 @@ class ReleasePromotionPolicyTest(unittest.TestCase):self.assertIn("scripts/release_control/live_runtime_proof.py", content)self.assertIn("an operator statement cannot substitute for the receipt", content)+def test_live_runtime_claim_rejects_unknown_successful_posture(self) -> None:observed, failures = evaluate_live_runtime(expected_version="6.2.0-rc.8",@@ -1722,5 +1859,113 @@ class ReleasePromotionPolicyTest(unittest.TestCase):self.assertIn("An asynchronous dispatch or manual SSH deployment is not release completion.", normalize_ws(contract))+class MaterialApprovalEvidenceTest(unittest.TestCase):+ def test_source_of_truth_requires_quantitative_approval_provenance(self) -> None:+ content = normalize_ws(+ read("docs/release-control/v6/internal/SOURCE_OF_TRUTH.md")+ )+ self.assertIn(+ "material owner-approval record that relies on quantitative rationale",+ content,+ )+ self.assertIn(+ "durable source, exact query or canonical report command, sanitized snapshot, and measurement time",+ content,+ )+ self.assertIn("separate durable owner-confirmation artifact", content)++ def test_quantitative_owner_approval_requires_reproducible_provenance(self) -> None:+ content = """# Material decision++The release owner explicitly approved this change because weekly active installs+grew from 100 to 1,000 and conversion reached 7.9%.+"""+ self.assertEqual(+ material_approval_evidence_errors(content),+ ("missing '## Quantitative Evidence' section",),+ )++ def test_quantitative_evidence_rejects_placeholder_provenance(self) -> None:+ content = """# Material decision++Approved by the project owner after conversion reached 7.9%.++## Quantitative Evidence++- Source: unavailable+- Query: `scripts/report.py --as-of 2026-08-08`+- Snapshot: `records/report-2026-08-08.json`+- Measured at: `2026-08-08T01:47:00Z`+"""+ self.assertEqual(+ material_approval_evidence_errors(content),+ ("'- Source:' must identify durable reproducible evidence",),+ )++ def test_quantitative_evidence_rejects_unreferenced_field_values(self) -> None:+ content = """# Material decision++The product owner explicitly approved this change after a cohort reached 7.9%.++## Quantitative Evidence++- Source: production telemetry+- Query: weekly conversion report+- Snapshot: sanitized aggregate results+- Measured at: `2026-08-08T01:47:00Z`+"""+ self.assertEqual(+ material_approval_evidence_errors(content),+ (+ "'- Source:' must contain an inline durable reference",+ "'- Query:' must contain an inline durable reference",+ "'- Snapshot:' must contain an inline durable reference",+ ),+ )++ def test_quantitative_evidence_rejects_missing_local_artifact(self) -> None:+ content = """# Material decision++Approved by the project owner after conversion reached 7.9%.++## Quantitative Evidence++- Source: `missing-evidence.md`+- Query: `missing-evidence.md#query`+- Snapshot: `missing-evidence.md#snapshot`+- Measured at: `2026-08-08T01:47:00Z`+"""+ record_rel = "docs/release-control/v6/internal/records/example.md"+ self.assertEqual(+ material_approval_evidence_errors(content, record_rel=record_rel),+ (+ "'- Source:' references missing artifact 'docs/release-control/v6/internal/records/missing-evidence.md'",+ "'- Query:' references missing artifact 'docs/release-control/v6/internal/records/missing-evidence.md'",+ "'- Snapshot:' references missing artifact 'docs/release-control/v6/internal/records/missing-evidence.md'",+ ),+ )++ def test_quantitative_evidence_accepts_complete_provenance(self) -> None:+ content = """# Material decision++The product owner explicitly approved this change after a cohort reached 7.9%.++## Quantitative Evidence++- Source: `pulse-pro:license-server/telemetry.sqlite`+- Query: `scripts/report.py --as-of 2026-08-08`+- Snapshot: `records/report-2026-08-08.json`+- Measured at: `2026-08-08T01:47:00Z`+"""+ self.assertEqual(material_approval_evidence_errors(content), ())++ def test_tracked_material_approval_records_have_reproducible_provenance(self) -> None:+ failures: list[str] = []+ for rel in tracked_release_control_records():+ errors = material_approval_evidence_errors(read(rel), record_rel=rel)+ failures.extend(f"{rel}: {error}" for error in errors)+ self.assertEqual(failures, [], "\n".join(failures))++if __name__ == "__main__":unittest.main()