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
Enforce Pulse Mobile compatibility from the core contract
rcourtman9e39ffc9205d
diff --git a/.github/workflows/canonical-governance.yml b/.github/workflows/canonical-governance.ymlindex ab47f4b8c4..8f9d7a53e5 100644--- a/.github/workflows/canonical-governance.yml+++ b/.github/workflows/canonical-governance.yml@@ -63,6 +63,29 @@ jobs:cache: truecache-dependency-path: repos/pulse/go.sum+ - name: Check Pulse Mobile compatibility contract+ run: |+ python3 scripts/release_control/generate_mobile_compatibility_test.py+ python3 scripts/release_control/mobile_compatibility_test.py+ python3 scripts/release_control/generate_mobile_compatibility.py --check --mobile-repo ../pulse-mobile+ python3 scripts/release_control/mobile_compatibility.py \+ --mobile-repo ../pulse-mobile \+ --evidence-out "${RUNNER_TEMP}/pulse-mobile-compatibility.json" \+ --pretty+ go test ./internal/api \+ -run 'Test(RelayMobileRuntimeRouteInventory|RelayMobileAccessScopeAllowsGovernedMobileRuntimeEndpoints|RelayMobileAccessScopeDeniesAdjacentAIRoutes|Contract_PatrolAttentionRoutesAcceptMobileRelayCapability)$' \+ -count=1+ go test ./internal/relay \+ -run 'Test(CanonicalActionOutcomeNotificationMatrix|NewPatrolFindingNotification|NewApprovalRequestNotification|NewActionDecisionNotificationUsesCanonicalActionIdentity|NewFixCompletedNotification|NewActionOutcomeNotificationIsHonestAboutVerification)$' \+ -count=1++ - name: Upload Pulse Mobile compatibility evidence+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1+ with:+ name: pulse-mobile-compatibility+ path: ${{ runner.temp }}/pulse-mobile-compatibility.json+ if-no-files-found: error+- name: Determine governance diff rangeid: diffshell: bashdiff --git a/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json b/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.jsonnew file mode 100644index 0000000000..e194ca5cfa--- /dev/null+++ b/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json@@ -0,0 +1,536 @@+{+ "$schema": "./mobile_compatibility_manifest.schema.json",+ "schema_version": 1,+ "contract_version": 1,+ "mobile_role": "Away-from-desk decision surface for the same Pulse runtime: attention, approvals, reconnect, instance switching, contextual Assistant handoff, and safe recovery.",+ "surface_classes": [+ {+ "id": "mobile-required",+ "description": "The mobile client must consume the capability directly and compatibility is part of feature completion."+ },+ {+ "id": "mobile-handoff-only",+ "description": "Mobile must preserve context and provide a safe handoff to the owning desktop surface."+ },+ {+ "id": "desktop-only",+ "description": "The capability is intentionally desktop-only and must not change a mobile-owned transport or outcome."+ }+ ],+ "pairing": {+ "schema": "pulse-mobile-onboarding-v1",+ "scheme": "pulse",+ "host": "connect",+ "required_fields": [+ "auth_token",+ "instance_id",+ "relay_url"+ ],+ "optional_fields": [+ "identity_fingerprint",+ "identity_public_key",+ "instance_url",+ "name"+ ]+ },+ "push": {+ "required_fields": [+ "action_id",+ "action_type",+ "body",+ "instance_id",+ "priority",+ "title",+ "type"+ ],+ "types": [+ { "value": "patrol_finding", "go_symbol": "PushTypePatrolFinding" },+ { "value": "patrol_critical", "go_symbol": "PushTypePatrolCritical" },+ { "value": "approval_request", "go_symbol": "PushTypeApprovalRequest" },+ { "value": "fix_completed", "go_symbol": "PushTypeFixCompleted" }+ ],+ "priorities": [+ { "value": "normal", "go_symbol": "PushPriorityNormal" },+ { "value": "high", "go_symbol": "PushPriorityHigh" }+ ],+ "actions": [+ {+ "value": "view_finding",+ "go_symbol": "PushActionViewFinding",+ "destination": "finding-detail",+ "lifecycle": "current"+ },+ {+ "value": "view_alert",+ "go_symbol": "PushActionViewAlert",+ "destination": "finding-detail",+ "lifecycle": "compatibility"+ },+ {+ "value": "approve_fix",+ "go_symbol": "PushActionApproveFix",+ "destination": "approval-detail",+ "lifecycle": "compatibility"+ },+ {+ "value": "decide_action",+ "go_symbol": "PushActionDecideAction",+ "destination": "approval-detail",+ "lifecycle": "current"+ },+ {+ "value": "view_fix_result",+ "go_symbol": "PushActionViewFixResult",+ "destination": "finding-detail",+ "lifecycle": "current"+ }+ ]+ },+ "routes": [+ {+ "id": "onboarding-qr",+ "go_symbol": "relayMobileRouteOnboardingQR",+ "method": "GET",+ "path": "/api/onboarding/qr",+ "required_scope": "settings:read",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/onboarding_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "schema", "type": "string" },+ { "path": "instance_id", "type": "string", "required": false },+ { "path": "relay.url", "type": "string" },+ { "path": "auth_token", "type": "string" },+ { "path": "deep_link", "type": "string" },+ { "path": "diagnostics", "type": "array" }+ ]+ },+ {+ "id": "onboarding-validate",+ "go_symbol": "relayMobileRouteOnboardingValidate",+ "method": "POST",+ "path": "/api/onboarding/validate",+ "required_scope": "settings:read",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/onboarding_handlers.go"],+ "request_fields": [+ { "path": "instance_id", "type": "string" },+ { "path": "relay_url", "type": "string" },+ { "path": "auth_token", "type": "string" }+ ],+ "response_fields": [+ { "path": "success", "type": "boolean" },+ { "path": "diagnostics", "type": "array" }+ ]+ },+ {+ "id": "onboarding-deep-link",+ "go_symbol": "relayMobileRouteOnboardingDeepLink",+ "method": "GET",+ "path": "/api/onboarding/deep-link",+ "required_scope": "settings:read",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/onboarding_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "url", "type": "string" },+ { "path": "diagnostics", "type": "array" }+ ]+ },+ {+ "id": "patrol-findings-list",+ "go_symbol": "relayMobileRoutePatrolFindingsList",+ "method": "GET",+ "path": "/api/ai/patrol/findings",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "$", "type": "array" },+ { "path": "$[].id", "type": "string" },+ { "path": "$[].title", "type": "string" },+ { "path": "$[].severity", "type": "string" }+ ]+ },+ {+ "id": "finding-investigation",+ "go_symbol": "relayMobileRouteFindingInvestigation",+ "method": "GET",+ "path": "/api/ai/findings/{finding_id}/investigation",+ "required_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "id", "type": "string" },+ { "path": "status", "type": "string" },+ { "path": "startedAt", "type": "string" }+ ]+ },+ {+ "id": "finding-investigation-messages",+ "go_symbol": "relayMobileRouteFindingInvestigationMessages",+ "method": "GET",+ "path": "/api/ai/findings/{finding_id}/investigation/messages",+ "required_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "messages", "type": "array" },+ { "path": "messages[].role", "type": "string" },+ { "path": "messages[].content", "type": "string" },+ { "path": "messages[].timestamp", "type": "string" }+ ]+ },+ {+ "id": "patrol-acknowledge",+ "go_symbol": "relayMobileRoutePatrolAcknowledge",+ "method": "POST",+ "path": "/api/ai/patrol/acknowledge",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [{ "path": "finding_id", "type": "string" }],+ "response_fields": []+ },+ {+ "id": "patrol-dismiss",+ "go_symbol": "relayMobileRoutePatrolDismiss",+ "method": "POST",+ "path": "/api/ai/patrol/dismiss",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [{ "path": "finding_id", "type": "string" }],+ "response_fields": []+ },+ {+ "id": "patrol-snooze",+ "go_symbol": "relayMobileRoutePatrolSnooze",+ "method": "POST",+ "path": "/api/ai/patrol/snooze",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [+ { "path": "finding_id", "type": "string" },+ { "path": "duration_minutes", "type": "integer" }+ ],+ "response_fields": []+ },+ {+ "id": "approvals-list",+ "go_symbol": "relayMobileRouteApprovalsList",+ "method": "GET",+ "path": "/api/ai/approvals",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "approvals", "type": "array" },+ { "path": "stats", "type": "object" }+ ]+ },+ {+ "id": "approval-approve",+ "go_symbol": "relayMobileRouteApprovalApprove",+ "method": "POST",+ "path": "/api/ai/approvals/{approval_id}/approve",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": []+ },+ {+ "id": "approval-deny",+ "go_symbol": "relayMobileRouteApprovalDeny",+ "method": "POST",+ "path": "/api/ai/approvals/{approval_id}/deny",+ "required_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handlers.go"],+ "request_fields": [],+ "response_fields": []+ },+ {+ "id": "pending-actions",+ "go_symbol": "relayMobileRoutePendingActions",+ "method": "GET",+ "path": "/api/actions/pending",+ "required_scope": "actions:approve",+ "legacy_scope": "ai:execute",+ "lifecycle": "compatibility",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/actions.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "actions", "type": "array" },+ { "path": "count", "type": "integer" },+ { "path": "readOnly", "type": "boolean" }+ ]+ },+ {+ "id": "actions-list",+ "go_symbol": "relayMobileRouteActionsList",+ "method": "GET",+ "path": "/api/actions",+ "required_scope": "actions:approve",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/actions.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "view", "type": "string" },+ { "path": "actions", "type": "array" },+ { "path": "actions[].id", "type": "string" },+ { "path": "actions[].state", "type": "string" },+ { "path": "actions[].plan.planHash", "type": "string" },+ { "path": "count", "type": "integer" },+ { "path": "readOnly", "type": "boolean" }+ ]+ },+ {+ "id": "action-detail",+ "go_symbol": "relayMobileRouteActionDetail",+ "method": "GET",+ "path": "/api/actions/{action_id}",+ "required_scope": "actions:approve",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/actions.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "audit", "type": "object" },+ { "path": "events", "type": "array" },+ { "path": "readOnly", "type": "boolean" }+ ]+ },+ {+ "id": "action-decision",+ "go_symbol": "relayMobileRouteActionDecision",+ "method": "POST",+ "path": "/api/actions/{action_id}/decision",+ "required_scope": "actions:approve",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/actions.go"],+ "request_fields": [+ { "path": "outcome", "type": "string" },+ { "path": "reason", "type": "string", "required": false },+ { "path": "planHash", "type": "string" }+ ],+ "response_fields": [+ { "path": "actionId", "type": "string" },+ { "path": "state", "type": "string" },+ { "path": "audit", "type": "object" }+ ]+ },+ {+ "id": "action-execute",+ "go_symbol": "relayMobileRouteActionExecute",+ "method": "POST",+ "path": "/api/actions/{action_id}/execute",+ "required_scope": "actions:execute",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/actions.go"],+ "request_fields": [+ { "path": "reason", "type": "string", "required": false },+ { "path": "planHash", "type": "string" }+ ],+ "response_fields": [+ { "path": "actionId", "type": "string" },+ { "path": "state", "type": "string" },+ { "path": "audit", "type": "object" }+ ]+ },+ {+ "id": "chat-send",+ "go_symbol": "relayMobileRouteChatSend",+ "method": "POST",+ "path": "/api/ai/chat",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/ai_handler.go", "internal/api/router_routes_ai_relay.go"],+ "request_fields": [+ { "path": "prompt", "type": "string" },+ { "path": "session_id", "type": "string" }+ ],+ "response_fields": []+ },+ {+ "id": "sessions-list",+ "go_symbol": "relayMobileRouteSessionsList",+ "method": "GET",+ "path": "/api/ai/sessions",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "$", "type": "array" },+ { "path": "$[].id", "type": "string" },+ { "path": "$[].title", "type": "string" },+ { "path": "$[].created_at", "type": "string" },+ { "path": "$[].updated_at", "type": "string" },+ { "path": "$[].message_count", "type": "integer" }+ ]+ },+ {+ "id": "session-create",+ "go_symbol": "relayMobileRouteSessionCreate",+ "method": "POST",+ "path": "/api/ai/sessions",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "id", "type": "string" },+ { "path": "title", "type": "string" }+ ]+ },+ {+ "id": "session-messages",+ "go_symbol": "relayMobileRouteSessionMessages",+ "method": "GET",+ "path": "/api/ai/sessions/{session_id}/messages",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "$", "type": "array" },+ { "path": "$[].id", "type": "string" },+ { "path": "$[].role", "type": "string" },+ { "path": "$[].content", "type": "string" },+ { "path": "$[].timestamp", "type": "string" }+ ]+ },+ {+ "id": "session-abort",+ "go_symbol": "relayMobileRouteSessionAbort",+ "method": "POST",+ "path": "/api/ai/sessions/{session_id}/abort",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [],+ "response_fields": []+ },+ {+ "id": "session-rename",+ "go_symbol": "relayMobileRouteSessionRename",+ "method": "PATCH",+ "path": "/api/ai/sessions/{session_id}",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [{ "path": "title", "type": "string" }],+ "response_fields": []+ },+ {+ "id": "session-delete",+ "go_symbol": "relayMobileRouteSessionDelete",+ "method": "DELETE",+ "path": "/api/ai/sessions/{session_id}",+ "required_scope": "ai:chat",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/router.go"],+ "request_fields": [],+ "response_fields": []+ },+ {+ "id": "attention-list",+ "go_symbol": "relayMobileRouteAttentionList",+ "method": "GET",+ "path": "/api/ai/patrol/attention",+ "required_scope": "monitoring:read",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/attention_handlers.go", "internal/api/attention_mutations.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "data", "type": "array" },+ { "path": "data[].id", "type": "string" },+ { "path": "data[].operationalRecordId", "type": "string" },+ { "path": "data[].subjectResourceId", "type": "string" },+ { "path": "data[].subjectResourceName", "type": "string" },+ { "path": "data[].kind", "type": "string" },+ { "path": "data[].title", "type": "string" },+ { "path": "data[].plainLanguageSummary", "type": "string" },+ { "path": "data[].severity", "type": "string" },+ { "path": "data[].state", "type": "string" },+ { "path": "data[].firstObservedAt", "type": "string" },+ { "path": "data[].lastObservedAt", "type": "string" },+ { "path": "data[].evidenceFreshness", "type": "string" },+ { "path": "data[].evidenceCompleteness", "type": "string" },+ { "path": "data[].relatedResources", "type": "array" },+ { "path": "data[].availableActions", "type": "array" },+ { "path": "data[].verificationState", "type": "string" },+ { "path": "summary", "type": "object" },+ { "path": "meta", "type": "object" }+ ]+ },+ {+ "id": "attention-detail",+ "go_symbol": "relayMobileRouteAttentionDetail",+ "method": "GET",+ "path": "/api/ai/patrol/attention/{item_id}",+ "required_scope": "monitoring:read",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/attention_handlers.go"],+ "request_fields": [],+ "response_fields": [+ { "path": "item", "type": "object" },+ { "path": "item.id", "type": "string" },+ { "path": "operationalRecord", "type": "object" },+ { "path": "timeline", "type": "array" },+ { "path": "evidence", "type": "array" }+ ]+ },+ {+ "id": "attention-mutation",+ "go_symbol": "relayMobileRouteAttentionMutation",+ "method": "POST",+ "path": "/api/ai/patrol/attention/{item_id}/{mutation}",+ "required_scope": "monitoring:write",+ "legacy_scope": "ai:execute",+ "lifecycle": "current",+ "mobile_impact": "mobile-required",+ "implementation_paths": ["internal/api/attention_mutations.go"],+ "request_fields": [],+ "response_fields": [{ "path": "success", "type": "boolean" }]+ }+ ]+}diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.mdindex 72677ee315..04b8f8cb1b 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-07-19+Last updated: 2026-07-22Status: ACTIVEThis file is the stable human governance layer for the active v6 release@@ -181,6 +181,14 @@ without desktop fallback.Until that validation and the remaining hardware proof gates pass, widen mobilethrough clearer ops cues and trust repair only, not through extra tabs, graphs,or desktop-parity surface expansion.+Pulse and Pulse Mobile must nevertheless share one compatibility boundary.+Every server capability declared on that companion boundary is explicitly+`mobile-required`, `mobile-handoff-only`, or `desktop-only`; routes, token+scopes, pairing links, push navigation, and mobile-required payload fields live+in the canonical mobile compatibility manifest and generated projections. A+Pulse change that breaks the checked-in Pulse Mobile consumer, or a mobile+change that exceeds released-server compatibility, fails before release with+evidence tied to the exact repository revisions.## Release Definitiondiff --git a/docs/release-control/v6/internal/mobile_compatibility_manifest.schema.json b/docs/release-control/v6/internal/mobile_compatibility_manifest.schema.jsonnew file mode 100644index 0000000000..49ebc69a10--- /dev/null+++ b/docs/release-control/v6/internal/mobile_compatibility_manifest.schema.json@@ -0,0 +1,180 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "title": "Pulse Mobile compatibility manifest",+ "type": "object",+ "additionalProperties": false,+ "required": [+ "schema_version",+ "contract_version",+ "mobile_role",+ "surface_classes",+ "pairing",+ "push",+ "routes"+ ],+ "properties": {+ "$schema": { "type": "string" },+ "schema_version": { "type": "integer", "const": 1 },+ "contract_version": { "type": "integer", "minimum": 1 },+ "mobile_role": { "type": "string", "minLength": 1 },+ "surface_classes": {+ "type": "array",+ "minItems": 3,+ "items": {+ "type": "object",+ "additionalProperties": false,+ "required": ["id", "description"],+ "properties": {+ "id": {+ "type": "string",+ "enum": ["mobile-required", "mobile-handoff-only", "desktop-only"]+ },+ "description": { "type": "string", "minLength": 1 }+ }+ }+ },+ "pairing": {+ "type": "object",+ "additionalProperties": false,+ "required": [+ "schema",+ "scheme",+ "host",+ "required_fields",+ "optional_fields"+ ],+ "properties": {+ "schema": { "type": "string", "minLength": 1 },+ "scheme": { "type": "string", "minLength": 1 },+ "host": { "type": "string", "minLength": 1 },+ "required_fields": {+ "type": "array",+ "items": { "type": "string", "minLength": 1 },+ "uniqueItems": true+ },+ "optional_fields": {+ "type": "array",+ "items": { "type": "string", "minLength": 1 },+ "uniqueItems": true+ }+ }+ },+ "push": {+ "type": "object",+ "additionalProperties": false,+ "required": ["required_fields", "types", "priorities", "actions"],+ "properties": {+ "required_fields": {+ "type": "array",+ "items": { "type": "string", "minLength": 1 },+ "uniqueItems": true+ },+ "types": { "$ref": "#/$defs/symbolValues" },+ "priorities": { "$ref": "#/$defs/symbolValues" },+ "actions": {+ "type": "array",+ "minItems": 1,+ "items": {+ "type": "object",+ "additionalProperties": false,+ "required": ["value", "go_symbol", "destination", "lifecycle"],+ "properties": {+ "value": { "type": "string", "minLength": 1 },+ "go_symbol": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" },+ "destination": {+ "type": "string",+ "enum": ["finding-detail", "approval-detail"]+ },+ "lifecycle": {+ "type": "string",+ "enum": ["current", "compatibility"]+ }+ }+ }+ }+ }+ },+ "routes": {+ "type": "array",+ "minItems": 1,+ "items": { "$ref": "#/$defs/route" }+ }+ },+ "$defs": {+ "symbolValues": {+ "type": "array",+ "minItems": 1,+ "items": {+ "type": "object",+ "additionalProperties": false,+ "required": ["value", "go_symbol"],+ "properties": {+ "value": { "type": "string", "minLength": 1 },+ "go_symbol": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" }+ }+ }+ },+ "field": {+ "type": "object",+ "additionalProperties": false,+ "required": ["path", "type"],+ "properties": {+ "path": { "type": "string", "minLength": 1 },+ "type": {+ "type": "string",+ "enum": ["array", "boolean", "integer", "number", "object", "string"]+ },+ "required": { "type": "boolean", "default": true }+ }+ },+ "route": {+ "type": "object",+ "additionalProperties": false,+ "required": [+ "id",+ "go_symbol",+ "method",+ "path",+ "required_scope",+ "lifecycle",+ "mobile_impact",+ "implementation_paths",+ "request_fields",+ "response_fields"+ ],+ "properties": {+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },+ "go_symbol": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9]*$" },+ "method": {+ "type": "string",+ "enum": ["DELETE", "GET", "PATCH", "POST", "PUT"]+ },+ "path": { "type": "string", "pattern": "^/api/" },+ "required_scope": { "type": "string", "minLength": 1 },+ "legacy_scope": { "type": "string", "minLength": 1 },+ "lifecycle": {+ "type": "string",+ "enum": ["current", "compatibility"]+ },+ "mobile_impact": {+ "type": "string",+ "enum": ["mobile-required", "mobile-handoff-only", "desktop-only"]+ },+ "implementation_paths": {+ "type": "array",+ "minItems": 1,+ "items": { "type": "string", "minLength": 1 },+ "uniqueItems": true+ },+ "request_fields": {+ "type": "array",+ "items": { "$ref": "#/$defs/field" }+ },+ "response_fields": {+ "type": "array",+ "items": { "$ref": "#/$defs/field" }+ }+ }+ }+ }+}diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.jsonindex d87b24b09a..7e6f10e232 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-07-19",+ "updated_at": "2026-07-22","scope": {"active_repos": ["pulse",@@ -4926,6 +4926,69 @@"evidence_tier": "managed-runtime-exercise"}]+ },+ {+ "id": "RA43",+ "summary": "Pulse and Pulse Mobile remain compatible at exact repository revisions: one canonical provider manifest generates the server route/scope inventory, pairing schema, push constants, and mobile TypeScript projection; the checked-in mobile consumer minimum preserves every route, method, field, pairing, and push behavior it uses; and the released-line OTA probe remains an independent skew check against stable and RC servers.",+ "kind": "invariant",+ "blocking_level": "repo-ready",+ "proof_type": "automated",+ "lane_ids": [+ "L5",+ "L6",+ "L7"+ ],+ "subsystem_ids": [+ "api-contracts",+ "relay-runtime"+ ],+ "release_gate_ids": [],+ "proof_commands": [+ {+ "id": "ra43-pulse-mobile-exact-revision-compatibility",+ "run": [+ "python3",+ "scripts/release_control/mobile_compatibility.py",+ "--mobile-repo",+ "../pulse-mobile"+ ]+ }+ ],+ "evidence": [+ {+ "repo": "pulse",+ "path": "docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json",+ "kind": "file"+ },+ {+ "repo": "pulse",+ "path": "scripts/release_control/mobile_compatibility.py",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse",+ "path": "scripts/release_control/mobile_compatibility_test.py",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse-mobile",+ "path": "config/mobile-api-surface.json",+ "kind": "file"+ },+ {+ "repo": "pulse-mobile",+ "path": "scripts/ota-compat-gate.mjs",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse-mobile",+ "path": "src/generated/coreCompatibility.ts",+ "kind": "file"+ }+ ]}],"evidence_reference_policy": {@@ -8459,7 +8522,7 @@},{"id": "mobile-post-rc-hardening",- "summary": "Track explicit Pulse Mobile store-publication execution and remaining post-GA mobile hardening beyond the current proof floor. Governed action parity now keeps approval and execution separately authenticated, binds both gestures to the reviewed plan identity, preserves approved work in the durable inbox, removes command-shaped presentation, renders approval posture truthfully, and persists revoked-access recovery. Build 4 retains physical Android and iOS companion-role proof; public rollout still requires a separate human-triggered release operation, and future hardening must not reopen the GA readiness gate unless new evidence regresses.",+ "summary": "Track explicit Pulse Mobile store-publication execution and remaining post-GA mobile hardening beyond the current proof floor. Exact-revision Pulse/Pulse Mobile API, route-scope, pairing, push, and payload compatibility is now enforced by RA43 and the Canonical Governance workflow, while the mobile OTA gate independently protects released-server skew. Governed action parity keeps approval and execution separately authenticated and bound to the reviewed plan identity. Public rollout still requires a separate human-triggered release operation, and future hardening must not reopen the GA readiness gate unless new evidence regresses.","owner": "project-owner","status": "planned","recorded_at": "2026-03-13",@@ -9077,6 +9140,19 @@"kind": "release-gate","id": "single-build-release-promotion-path"}+ },+ {+ "id": "pulse-mobile-compat-lane-followup-mobile-post-rc-hardening",+ "agent_id": "pulse-mobile-compat",+ "summary": "Enforce exact-revision Pulse and Pulse Mobile API, scope, push, and deep-link compatibility before release",+ "target_id": "v6-product-lane-expansion",+ "claimed_at": "2026-07-22T12:08:06Z",+ "heartbeat_at": "2026-07-22T12:08:06Z",+ "expires_at": "2026-07-22T20:08:06Z",+ "work_item": {+ "kind": "lane-followup",+ "id": "mobile-post-rc-hardening"+ }}],"open_decisions": [],diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex a2228ca963..228cecd6b7 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -145,6 +145,14 @@ product API routes free of maintainer commercial analytics.83a. `internal/api/agent_fleet_doctor.go`83b. `frontend-modern/src/api/agentDiagnostics.ts`84. `internal/api/notification_queue.go`+85. `docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json`+86. `docs/release-control/v6/internal/mobile_compatibility_manifest.schema.json`+87. `scripts/release_control/generate_mobile_compatibility.py`+88. `scripts/release_control/mobile_compatibility.py`+89. `internal/api/relay_mobile_capability_generated.go`+90. `pulse-mobile:config/mobile-api-surface.json`+91. `pulse-mobile:src/generated/coreCompatibility.ts`+92. `pulse-mobile:src/api/coreMobileContract.ts`The alert and notification transports expose the operational-trust contractadditively. Alert payloads may carry a typed operational record, latest@@ -204,6 +212,18 @@ when the resolved Pulse URL is an absolute `https://` URL; non-HTTPS adminURLs must be omitted from QR/deep-link payloads with a warning diagnostic somobile pairing does not fail on a web-handoff-only field.+The complete Pulse-to-mobile boundary is governed by+`MOBILE_COMPATIBILITY_MANIFEST.json`, not by parallel route strings in each+repository. It classifies every declared capability as `mobile-required`,+`mobile-handoff-only`, or `desktop-only`; owns route methods, compatible token+scopes, required request/response fields, pairing data, and push navigation;+and generates both the Go runtime inventory and Pulse Mobile TypeScript+projection. `pulse-mobile:config/mobile-api-surface.json` is the consumer+minimum and released-line probe declaration. Canonical Governance must compare+that consumer against the exact Pulse manifest and retain revision-bound+evidence. Pulse Mobile's OTA gate separately proves the app against server+lines already in customers' hands.+Proxy-auth administrator evaluation is a shared auth/API contract. Once`PROXY_AUTH_ROLE_HEADER` and `PROXY_AUTH_ADMIN_ROLE` are configured,`internal/api/auth.go` must treat a valid proxy-auth user with a missing or@@ -1628,6 +1648,7 @@ payload shape change when the portal presents compact client rows.ran or were suppressed by the owner-email limiter, while invalid bodies andtrue server failures remain explicit.77. `internal/api/relay_mobile_capability.go` shared with `relay-runtime`: the backend-owned Pulse Mobile relay capability inventory is both a relay runtime boundary and a canonical API payload contract surface.+78. `internal/api/relay_mobile_capability_generated.go` shared with `relay-runtime`: the generated Pulse Mobile route inventory is both a relay runtime allowlist and the backend projection of the canonical mobile API contract.78. `internal/api/resources.go` shared with `unified-resources`: the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary.79. `internal/api/security.go` shared with `security-privacy`: the security handlers are both a security/privacy control surface and a canonical API payload contract boundary.That same shared security/API boundary owns CSRF replacement-token@@ -1712,6 +1733,8 @@ payload shape change when the portal presents compact client rows.88. `pkg/aicontracts/investigation.go` shared with `ai-runtime`: the public Patrol investigation record and finding contract is both an AI runtime handoff boundary and a canonical API payload contract for Patrol, Assistant, unified findings, persistence, and audit surfaces.89. `pkg/aicontracts/orchestrator_deps.go` shared with `ai-runtime`: the public investigation orchestrator dependency contract is both an AI runtime handoff boundary and a canonical API payload contract for Assistant and Patrol tool-call history.90. `pkg/extensions/ai_autofix.go` shared with `ai-runtime`: the enterprise auto-fix extension dependency seam is both an AI runtime approved-action boundary and a canonical API extension contract over Assistant and Patrol execution dependencies.+91. `pulse-mobile:config/mobile-api-surface.json` shared with `relay-runtime`: the Pulse Mobile consumer minimum and released-line probe inventory are both API compatibility and relay runtime boundaries.+92. `pulse-mobile:src/generated/coreCompatibility.ts` shared with `relay-runtime`: the generated mobile route, pairing, and push projection is both an API consumer contract and relay runtime boundary.91. `scripts/generate-pulse-intelligence-docs.go` shared with `ai-runtime`: the Pulse Intelligence manifest docs generator is both an AI runtime docs/onboarding projection and a canonical API contract projection over the agent capabilities manifest and Pulse MCP surface tool contract.Update-plan responses own the structured readiness verdict for serverupdater capability, rollback support, agent continuity, v5 agent migration@@ -3514,6 +3537,15 @@ context-quality, and latency dimensions plus per-autonomy-mode suitability;same settings-write permission boundary as other AI diagnostics, and avoidreturning prompts, tool transcripts, credentials, or infrastructure data.+Every mobile-facing contract change must update the canonical manifest,+regenerate both repositories, keep the mobile consumer minimum compatible, and+pass `generate_mobile_compatibility.py --check` plus+`mobile_compatibility.py`. A desktop feature is not implicitly mobile work:+its manifest classification records whether the phone consumes it, hands it+off with context, or intentionally has no mobile surface. A `mobile-required`+change is incomplete while either generated projection or the mobile consumer+contract is stale.+## Current State### vSphere host composition on the vCenter system rowdiff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.jsonindex 89e44e6298..90f8f75102 100644--- a/docs/release-control/v6/internal/subsystems/registry.json+++ b/docs/release-control/v6/internal/subsystems/registry.json@@ -851,6 +851,14 @@"relay-runtime"]},+ {+ "path": "internal/api/relay_mobile_capability_generated.go",+ "rationale": "the generated Pulse Mobile route inventory is both a relay runtime allowlist and the backend projection of the canonical mobile API contract",+ "subsystems": [+ "api-contracts",+ "relay-runtime"+ ]+ },{"path": "internal/api/resources.go","rationale": "the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary",@@ -1045,6 +1053,22 @@"api-contracts"]},+ {+ "path": "pulse-mobile:config/mobile-api-surface.json",+ "rationale": "the Pulse Mobile consumer minimum and released-line probe inventory are both API compatibility and relay runtime boundaries",+ "subsystems": [+ "api-contracts",+ "relay-runtime"+ ]+ },+ {+ "path": "pulse-mobile:src/generated/coreCompatibility.ts",+ "rationale": "the generated mobile route, pairing, and push projection is both an API consumer contract and relay runtime boundary",+ "subsystems": [+ "api-contracts",+ "relay-runtime"+ ]+ },{"path": "pulse-pro:relay-server/main.go","rationale": "the Relay server startup and readiness path is both a relay-runtime server boundary and a cloud-paid entitlement invalidation boundary",@@ -2316,6 +2340,8 @@"cmd/agent-probe/main.go","cmd/pulse-mcp/main.go","cmd/pulse-mcp/README.md",+ "docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json",+ "docs/release-control/v6/internal/mobile_compatibility_manifest.schema.json","frontend-modern/src/components/Settings/AgentIntegrationsPanel.tsx","frontend-modern/src/components/Settings/APITokenManager.tsx","frontend-modern/src/components/Settings/apiTokenManagerModel.ts",@@ -2353,8 +2379,13 @@"pkg/pulsecli/api_client.go","pkg/pulsecli/fleet.go","pkg/pulsecli/root.go",+ "pulse-mobile:config/mobile-api-surface.json",+ "pulse-mobile:src/api/coreMobileContract.ts",+ "pulse-mobile:src/generated/coreCompatibility.ts","scripts/generate-pulse-intelligence-docs.go",- "scripts/generate-types.go"+ "scripts/generate-types.go",+ "scripts/release_control/generate_mobile_compatibility.py",+ "scripts/release_control/mobile_compatibility.py"],"verification": {"allow_same_subsystem_tests": false,@@ -2366,6 +2397,31 @@],"require_explicit_path_policy_coverage": true,"path_policies": [+ {+ "id": "pulse-mobile-compatibility-contract",+ "label": "Pulse and Pulse Mobile exact-revision compatibility proof",+ "match_prefixes": [],+ "match_files": [+ "docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json",+ "docs/release-control/v6/internal/mobile_compatibility_manifest.schema.json",+ "internal/api/relay_mobile_capability.go",+ "internal/api/relay_mobile_capability_generated.go",+ "pulse-mobile:config/mobile-api-surface.json",+ "pulse-mobile:src/api/coreMobileContract.ts",+ "pulse-mobile:src/generated/coreCompatibility.ts",+ "scripts/release_control/generate_mobile_compatibility.py",+ "scripts/release_control/mobile_compatibility.py"+ ],+ "allow_same_subsystem_tests": false,+ "test_prefixes": [],+ "exact_files": [+ "internal/api/contract_test.go",+ "internal/api/relay_mobile_capability_test.go",+ "pulse-mobile:src/api/__tests__/coreMobileContract.test.ts",+ "scripts/release_control/generate_mobile_compatibility_test.py",+ "scripts/release_control/mobile_compatibility_test.py"+ ]+ },{"id": "agent-resource-context-sections","label": "agent resource context section proof",@@ -6097,7 +6153,10 @@],"owned_files": ["internal/api/relay_mobile_capability.go",+ "internal/api/relay_mobile_capability_generated.go","internal/config/persistence_relay.go",+ "pulse-mobile:config/mobile-api-surface.json",+ "pulse-mobile:src/generated/coreCompatibility.ts","pulse-pro:relay-server/main.go","pulse-pro:relay-server/registry.go","pulse-pro:relay-server/revocation_feed.go"@@ -6112,6 +6171,7 @@"internal/relay/encryption_test.go","internal/relay/protocol_test.go","internal/relay/push_test.go",+ "pulse-mobile:src/api/__tests__/coreMobileContract.test.ts","pulse-mobile:src/relay/__tests__/channel.test.ts","pulse-mobile:src/relay/__tests__/client-hardening.test.ts","pulse-mobile:src/relay/__tests__/client.test.ts",@@ -6119,7 +6179,9 @@"pulse-mobile:src/relay/__tests__/identity.test.ts","pulse-mobile:src/relay/__tests__/protocol-contract.test.ts","pulse-mobile:src/relay/__tests__/protocol.test.ts",- "pulse-mobile:src/relay/__tests__/proxy.test.ts"+ "pulse-mobile:src/relay/__tests__/proxy.test.ts",+ "scripts/release_control/generate_mobile_compatibility_test.py",+ "scripts/release_control/mobile_compatibility_test.py"],"require_explicit_path_policy_coverage": true,"path_policies": [@@ -6176,12 +6238,20 @@"label": "relay mobile capability boundary proof","match_prefixes": [],"match_files": [- "internal/api/relay_mobile_capability.go"+ "internal/api/relay_mobile_capability.go",+ "internal/api/relay_mobile_capability_generated.go",+ "internal/relay/mobile_compatibility_generated.go",+ "pulse-mobile:config/mobile-api-surface.json",+ "pulse-mobile:src/generated/coreCompatibility.ts"],"allow_same_subsystem_tests": false,"test_prefixes": [],"exact_files": [- "internal/api/relay_mobile_capability_test.go"+ "internal/api/relay_mobile_capability_test.go",+ "internal/relay/push_test.go",+ "pulse-mobile:src/api/__tests__/coreMobileContract.test.ts",+ "scripts/release_control/generate_mobile_compatibility_test.py",+ "scripts/release_control/mobile_compatibility_test.py"]},{diff --git a/docs/release-control/v6/internal/subsystems/relay-runtime.md b/docs/release-control/v6/internal/subsystems/relay-runtime.mdindex cf29372217..2aa66ce787 100644--- a/docs/release-control/v6/internal/subsystems/relay-runtime.md+++ b/docs/release-control/v6/internal/subsystems/relay-runtime.md@@ -9,7 +9,9 @@"contract_file": "docs/release-control/v6/internal/subsystems/relay-runtime.md","status_file": "docs/release-control/v6/internal/status.json","registry_file": "docs/release-control/v6/internal/subsystems/registry.json",- "dependency_subsystem_ids": []+ "dependency_subsystem_ids": [+ "api-contracts"+ ]}```@@ -26,16 +28,26 @@ for Pulse instance bridging.2. `internal/relay/protocol.go`3. `internal/config/persistence_relay.go`4. `internal/api/relay_mobile_capability.go`-5. `pulse-pro:relay-server/main.go`-6. `pulse-pro:relay-server/registry.go`-7. `pulse-pro:relay-server/revocation_feed.go`+5. `internal/api/relay_mobile_capability_generated.go`+6. `internal/relay/mobile_compatibility_generated.go`+7. `docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json`+8. `scripts/release_control/generate_mobile_compatibility.py`+9. `scripts/release_control/mobile_compatibility.py`+10. `pulse-mobile:config/mobile-api-surface.json`+11. `pulse-mobile:src/generated/coreCompatibility.ts`+12. `pulse-pro:relay-server/main.go`+13. `pulse-pro:relay-server/registry.go`+14. `pulse-pro:relay-server/revocation_feed.go`## Shared Boundaries1. `internal/api/relay_mobile_capability.go` shared with `api-contracts`: the backend-owned Pulse Mobile relay capability inventory is both a relay runtime boundary and a canonical API payload contract surface.-2. `pulse-pro:relay-server/main.go` shared with `cloud-paid`: the Relay server startup and readiness path is both a relay-runtime server boundary and a cloud-paid entitlement invalidation boundary.-3. `pulse-pro:relay-server/registry.go` shared with `cloud-paid`: the Relay server active-session registry is both a relay-runtime connection boundary and a cloud-paid entitlement invalidation boundary.-4. `pulse-pro:relay-server/revocation_feed.go` shared with `cloud-paid`: the Relay server revocation feed is both a relay-runtime server boundary and a cloud-paid entitlement invalidation boundary.+2. `internal/api/relay_mobile_capability_generated.go` shared with `api-contracts`: the generated Pulse Mobile route inventory is both a relay runtime allowlist and the backend projection of the canonical mobile API contract.+3. `pulse-mobile:config/mobile-api-surface.json` shared with `api-contracts`: the Pulse Mobile consumer minimum and released-line probe inventory are both API compatibility and relay runtime boundaries.+4. `pulse-mobile:src/generated/coreCompatibility.ts` shared with `api-contracts`: the generated mobile route, pairing, and push projection is both an API consumer contract and relay runtime boundary.+5. `pulse-pro:relay-server/main.go` shared with `cloud-paid`: the Relay server startup and readiness path is both a relay-runtime server boundary and a cloud-paid entitlement invalidation boundary.+6. `pulse-pro:relay-server/registry.go` shared with `cloud-paid`: the Relay server active-session registry is both a relay-runtime connection boundary and a cloud-paid entitlement invalidation boundary.+7. `pulse-pro:relay-server/revocation_feed.go` shared with `cloud-paid`: the Relay server revocation feed is both a relay-runtime server boundary and a cloud-paid entitlement invalidation boundary.## Extension Points@@ -52,7 +64,7 @@ for Pulse instance bridging.accepting a malformed override. Saving the resulting `relay.Config`from the UI is allowed to persist the env-effective state to disk;the override is not stripped before save.-4. Add or change the backend-owned mobile relay capability inventory and compatibility scope mapping through `internal/api/relay_mobile_capability.go`+4. Add or change the backend-owned mobile relay capability inventory, compatibility scope mapping, pairing contract, or push routing through `docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json`, then regenerate both repositories. Generated files are not extension points.5. Keep desktop and mobile relay changes aligned with the governed server relay surfaces represented by the L7 lane evidence6. Add or change server-side grant revocation ingestion, readiness, active-session teardown, or reconnect-token invalidation through `pulse-pro:relay-server/main.go`, `pulse-pro:relay-server/revocation_feed.go`, and `pulse-pro:relay-server/registry.go`.@@ -61,6 +73,7 @@ for Pulse instance bridging.1. Reintroducing relay client trust or TLS handling through ad hoc dialer configuration outside the canonical relay client2. Letting encrypted DATA frames race ahead of nonce-order guarantees by deferring inbound decrypt work to background goroutines3. Treating a missing persisted relay config file as a hard failure instead of falling back to the canonical disabled default+4. Editing generated mobile compatibility projections directly or landing a mobile-required route/push/pairing change with a stale Pulse Mobile consumer contract## Completion Obligations@@ -72,6 +85,7 @@ for Pulse instance bridging.5. Keep mobile relay runtime changes tied to explicit proof in `pulse-mobile:src/relay/__tests__/`6. Keep the operator Relay incapable of serving v6 grants until it has synchronously drained the authenticated revocation feed, and expose stale feed state through readiness.7. Keep feed-applied restrictive events tied to proof that already-connected stale grants are disconnected and their persisted reconnect credentials are invalidated.+8. Keep exact-revision Pulse/Pulse Mobile compatibility evidence green in Canonical Governance and keep released-line compatibility green in the Pulse Mobile OTA gate.## Current State@@ -127,9 +141,15 @@ overrides, so a successful failover reconnect must return future reconnects tothe instance's canonical relay URL unless the server sends a fresh drain hint.The server-owned mobile relay capability boundary is part of that same ownedsurface too. The dedicated `relay:mobile:access` credential may only reach the-explicit runtime route inventory in `internal/api/relay_mobile_capability.go`,-and expanding that inventory is governed L7 work rather than a router-local-compatibility tweak.+explicit runtime route inventory generated from+`MOBILE_COMPATIBILITY_MANIFEST.json`, and expanding that inventory is governed+L7 work rather than a router-local compatibility tweak. The same manifest now+generates mobile-visible push constants and the pairing schema projection, and+Pulse Mobile consumes its TypeScript route/push/pairing projection. Canonical+Governance compares the provider manifest with the mobile consumer declaration+at exact repository revisions and publishes that evidence; the mobile OTA gate+continues to probe stable and RC server lines with a real+`relay:mobile:access` token.Assistant session rename is part of that explicit mobile relay runtimeinventory: `PATCH /api/ai/sessions/{session_id}` may pass through`relay:mobile:access` with `ai:chat` scope because it mutates only thediff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex 0e11f8d397..aa1c626a82 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -9421,6 +9421,9 @@ func TestContract_OwnerTransferRequiresFreshSession(t *testing.T) {}func TestContract_OnboardingQRResponseJSONSnapshot(t *testing.T) {+ if onboardingSchemaVersion != "pulse-mobile-onboarding-v1" {+ t.Fatalf("generated mobile onboarding schema = %q", onboardingSchemaVersion)+ }payload := onboardingQRResponse{Schema: onboardingSchemaVersion,InstanceURL: "https://pulse.example.test",diff --git a/internal/api/onboarding_handlers.go b/internal/api/onboarding_handlers.goindex 38ed204cf2..ab9125a538 100644--- a/internal/api/onboarding_handlers.go+++ b/internal/api/onboarding_handlers.go@@ -12,7 +12,6 @@ import ("github.com/rcourtman/pulse-go-rewrite/internal/relay")-const onboardingSchemaVersion = "pulse-mobile-onboarding-v1"const onboardingNotReadyCode = "onboarding_not_ready"const onboardingNotReadyMessage = "Pulse Mobile pairing is not ready yet."diff --git a/internal/api/relay_mobile_capability.go b/internal/api/relay_mobile_capability.goindex 18f8ec7ba2..09866579cc 100644--- a/internal/api/relay_mobile_capability.go+++ b/internal/api/relay_mobile_capability.go@@ -1,5 +1,7 @@package api+//go:generate python3 ../../scripts/release_control/generate_mobile_compatibility.py --write+import ("fmt""net/http"@@ -17,242 +19,6 @@ type relayMobileRuntimeRouteSpec struct {legacyScope string}-const (- relayMobileRouteOnboardingQR relayMobileRuntimeRouteID = "onboarding-qr"- relayMobileRouteOnboardingValidate relayMobileRuntimeRouteID = "onboarding-validate"- relayMobileRouteOnboardingDeepLink relayMobileRuntimeRouteID = "onboarding-deep-link"- relayMobileRoutePatrolFindingsList relayMobileRuntimeRouteID = "patrol-findings-list"- relayMobileRouteFindingInvestigation relayMobileRuntimeRouteID = "finding-investigation"- relayMobileRouteFindingInvestigationMessages relayMobileRuntimeRouteID = "finding-investigation-messages"- relayMobileRoutePatrolAcknowledge relayMobileRuntimeRouteID = "patrol-acknowledge"- relayMobileRoutePatrolDismiss relayMobileRuntimeRouteID = "patrol-dismiss"- relayMobileRoutePatrolSnooze relayMobileRuntimeRouteID = "patrol-snooze"- relayMobileRouteApprovalsList relayMobileRuntimeRouteID = "approvals-list"- relayMobileRouteApprovalApprove relayMobileRuntimeRouteID = "approval-approve"- relayMobileRouteApprovalDeny relayMobileRuntimeRouteID = "approval-deny"- relayMobileRoutePendingActions relayMobileRuntimeRouteID = "pending-actions"- relayMobileRouteActionsList relayMobileRuntimeRouteID = "actions-list"- relayMobileRouteActionDetail relayMobileRuntimeRouteID = "action-detail"- relayMobileRouteActionDecision relayMobileRuntimeRouteID = "action-decision"- relayMobileRouteActionExecute relayMobileRuntimeRouteID = "action-execute"- relayMobileRouteChatSend relayMobileRuntimeRouteID = "chat-send"- relayMobileRouteSessionsList relayMobileRuntimeRouteID = "sessions-list"- relayMobileRouteSessionCreate relayMobileRuntimeRouteID = "session-create"- relayMobileRouteSessionMessages relayMobileRuntimeRouteID = "session-messages"- relayMobileRouteSessionAbort relayMobileRuntimeRouteID = "session-abort"- relayMobileRouteSessionRename relayMobileRuntimeRouteID = "session-rename"- relayMobileRouteSessionDelete relayMobileRuntimeRouteID = "session-delete"- relayMobileRouteAttentionList relayMobileRuntimeRouteID = "attention-list"- relayMobileRouteAttentionDetail relayMobileRuntimeRouteID = "attention-detail"- relayMobileRouteAttentionMutation relayMobileRuntimeRouteID = "attention-mutation"-)--var relayMobileRuntimeRouteOrder = []relayMobileRuntimeRouteID{- relayMobileRouteOnboardingQR,- relayMobileRouteOnboardingValidate,- relayMobileRouteOnboardingDeepLink,- relayMobileRoutePatrolFindingsList,- relayMobileRouteFindingInvestigation,- relayMobileRouteFindingInvestigationMessages,- relayMobileRoutePatrolAcknowledge,- relayMobileRoutePatrolDismiss,- relayMobileRoutePatrolSnooze,- relayMobileRouteApprovalsList,- relayMobileRouteApprovalApprove,- relayMobileRouteApprovalDeny,- relayMobileRoutePendingActions,- relayMobileRouteActionsList,- relayMobileRouteActionDetail,- relayMobileRouteActionDecision,- relayMobileRouteActionExecute,- relayMobileRouteChatSend,- relayMobileRouteSessionsList,- relayMobileRouteSessionCreate,- relayMobileRouteSessionMessages,- relayMobileRouteSessionAbort,- relayMobileRouteSessionRename,- relayMobileRouteSessionDelete,- relayMobileRouteAttentionList,- relayMobileRouteAttentionDetail,- relayMobileRouteAttentionMutation,-}--var relayMobileRuntimeRouteSpecs = map[relayMobileRuntimeRouteID]relayMobileRuntimeRouteSpec{- relayMobileRouteOnboardingQR: {- id: relayMobileRouteOnboardingQR,- method: http.MethodGet,- path: "/api/onboarding/qr",- requiredScope: config.ScopeSettingsRead,- },- relayMobileRouteOnboardingValidate: {- id: relayMobileRouteOnboardingValidate,- method: http.MethodPost,- path: "/api/onboarding/validate",- requiredScope: config.ScopeSettingsRead,- },- relayMobileRouteOnboardingDeepLink: {- id: relayMobileRouteOnboardingDeepLink,- method: http.MethodGet,- path: "/api/onboarding/deep-link",- requiredScope: config.ScopeSettingsRead,- },- relayMobileRoutePatrolFindingsList: {- id: relayMobileRoutePatrolFindingsList,- method: http.MethodGet,- path: "/api/ai/patrol/findings",- requiredScope: config.ScopeAIExecute,- },- relayMobileRouteFindingInvestigation: {- id: relayMobileRouteFindingInvestigation,- method: http.MethodGet,- path: "/api/ai/findings/{finding_id}/investigation",- requiredScope: config.ScopeAIExecute,- },- relayMobileRouteFindingInvestigationMessages: {- id: relayMobileRouteFindingInvestigationMessages,- method: http.MethodGet,- path: "/api/ai/findings/{finding_id}/investigation/messages",- requiredScope: config.ScopeAIExecute,- },- relayMobileRoutePatrolAcknowledge: {- id: relayMobileRoutePatrolAcknowledge,- method: http.MethodPost,- path: "/api/ai/patrol/acknowledge",- requiredScope: config.ScopeAIExecute,- },- relayMobileRoutePatrolDismiss: {- id: relayMobileRoutePatrolDismiss,- method: http.MethodPost,- path: "/api/ai/patrol/dismiss",- requiredScope: config.ScopeAIExecute,- },- relayMobileRoutePatrolSnooze: {- id: relayMobileRoutePatrolSnooze,- method: http.MethodPost,- path: "/api/ai/patrol/snooze",- requiredScope: config.ScopeAIExecute,- },- relayMobileRouteApprovalsList: {- id: relayMobileRouteApprovalsList,- method: http.MethodGet,- path: "/api/ai/approvals",- requiredScope: config.ScopeAIExecute,- },- relayMobileRouteApprovalApprove: {- id: relayMobileRouteApprovalApprove,- method: http.MethodPost,- path: "/api/ai/approvals/{approval_id}/approve",- requiredScope: config.ScopeAIExecute,- },- relayMobileRouteApprovalDeny: {- id: relayMobileRouteApprovalDeny,- method: http.MethodPost,- path: "/api/ai/approvals/{approval_id}/deny",- requiredScope: config.ScopeAIExecute,- },- relayMobileRoutePendingActions: {- id: relayMobileRoutePendingActions,- method: http.MethodGet,- path: "/api/actions/pending",- requiredScope: config.ScopeActionsApprove,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteActionsList: {- id: relayMobileRouteActionsList,- method: http.MethodGet,- path: "/api/actions",- requiredScope: config.ScopeActionsApprove,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteActionDetail: {- id: relayMobileRouteActionDetail,- method: http.MethodGet,- path: "/api/actions/{action_id}",- requiredScope: config.ScopeActionsApprove,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteActionDecision: {- id: relayMobileRouteActionDecision,- method: http.MethodPost,- path: "/api/actions/{action_id}/decision",- requiredScope: config.ScopeActionsApprove,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteActionExecute: {- id: relayMobileRouteActionExecute,- method: http.MethodPost,- path: "/api/actions/{action_id}/execute",- requiredScope: config.ScopeActionsExecute,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteChatSend: {- id: relayMobileRouteChatSend,- method: http.MethodPost,- path: "/api/ai/chat",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionsList: {- id: relayMobileRouteSessionsList,- method: http.MethodGet,- path: "/api/ai/sessions",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionCreate: {- id: relayMobileRouteSessionCreate,- method: http.MethodPost,- path: "/api/ai/sessions",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionMessages: {- id: relayMobileRouteSessionMessages,- method: http.MethodGet,- path: "/api/ai/sessions/{session_id}/messages",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionAbort: {- id: relayMobileRouteSessionAbort,- method: http.MethodPost,- path: "/api/ai/sessions/{session_id}/abort",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionRename: {- id: relayMobileRouteSessionRename,- method: http.MethodPatch,- path: "/api/ai/sessions/{session_id}",- requiredScope: config.ScopeAIChat,- },- relayMobileRouteSessionDelete: {- id: relayMobileRouteSessionDelete,- method: http.MethodDelete,- path: "/api/ai/sessions/{session_id}",- requiredScope: config.ScopeAIChat,- },- // The attention workbench supersedes the legacy patrol findings routes,- // which accepted mobile relay tokens; its routes must keep doing so or- // every registered phone loses alert sync the moment a server upgrades.- relayMobileRouteAttentionList: {- id: relayMobileRouteAttentionList,- method: http.MethodGet,- path: "/api/ai/patrol/attention",- requiredScope: config.ScopeMonitoringRead,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteAttentionDetail: {- id: relayMobileRouteAttentionDetail,- method: http.MethodGet,- path: "/api/ai/patrol/attention/{item_id}",- requiredScope: config.ScopeMonitoringRead,- legacyScope: config.ScopeAIExecute,- },- relayMobileRouteAttentionMutation: {- id: relayMobileRouteAttentionMutation,- method: http.MethodPost,- path: "/api/ai/patrol/attention/{item_id}/{mutation}",- requiredScope: config.ScopeMonitoringWrite,- legacyScope: config.ScopeAIExecute,- },-}-func relayMobileRuntimeRouteInventory() []relayMobileRuntimeRouteSpec {inventory := make([]relayMobileRuntimeRouteSpec, 0, len(relayMobileRuntimeRouteOrder))for _, routeID := range relayMobileRuntimeRouteOrder {diff --git a/internal/api/relay_mobile_capability_generated.go b/internal/api/relay_mobile_capability_generated.gonew file mode 100644index 0000000000..dc88720139--- /dev/null+++ b/internal/api/relay_mobile_capability_generated.go@@ -0,0 +1,245 @@+// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.+// Source SHA256: 85bf17ae6e6fa50233dadc7447624e1aded31b31a28339d9db1d4a0401ece107++package api++import (+ "net/http"++ "github.com/rcourtman/pulse-go-rewrite/internal/config"+)++const onboardingSchemaVersion = "pulse-mobile-onboarding-v1"++const (+ relayMobileRouteOnboardingQR relayMobileRuntimeRouteID = "onboarding-qr"+ relayMobileRouteOnboardingValidate relayMobileRuntimeRouteID = "onboarding-validate"+ relayMobileRouteOnboardingDeepLink relayMobileRuntimeRouteID = "onboarding-deep-link"+ relayMobileRoutePatrolFindingsList relayMobileRuntimeRouteID = "patrol-findings-list"+ relayMobileRouteFindingInvestigation relayMobileRuntimeRouteID = "finding-investigation"+ relayMobileRouteFindingInvestigationMessages relayMobileRuntimeRouteID = "finding-investigation-messages"+ relayMobileRoutePatrolAcknowledge relayMobileRuntimeRouteID = "patrol-acknowledge"+ relayMobileRoutePatrolDismiss relayMobileRuntimeRouteID = "patrol-dismiss"+ relayMobileRoutePatrolSnooze relayMobileRuntimeRouteID = "patrol-snooze"+ relayMobileRouteApprovalsList relayMobileRuntimeRouteID = "approvals-list"+ relayMobileRouteApprovalApprove relayMobileRuntimeRouteID = "approval-approve"+ relayMobileRouteApprovalDeny relayMobileRuntimeRouteID = "approval-deny"+ relayMobileRoutePendingActions relayMobileRuntimeRouteID = "pending-actions"+ relayMobileRouteActionsList relayMobileRuntimeRouteID = "actions-list"+ relayMobileRouteActionDetail relayMobileRuntimeRouteID = "action-detail"+ relayMobileRouteActionDecision relayMobileRuntimeRouteID = "action-decision"+ relayMobileRouteActionExecute relayMobileRuntimeRouteID = "action-execute"+ relayMobileRouteChatSend relayMobileRuntimeRouteID = "chat-send"+ relayMobileRouteSessionsList relayMobileRuntimeRouteID = "sessions-list"+ relayMobileRouteSessionCreate relayMobileRuntimeRouteID = "session-create"+ relayMobileRouteSessionMessages relayMobileRuntimeRouteID = "session-messages"+ relayMobileRouteSessionAbort relayMobileRuntimeRouteID = "session-abort"+ relayMobileRouteSessionRename relayMobileRuntimeRouteID = "session-rename"+ relayMobileRouteSessionDelete relayMobileRuntimeRouteID = "session-delete"+ relayMobileRouteAttentionList relayMobileRuntimeRouteID = "attention-list"+ relayMobileRouteAttentionDetail relayMobileRuntimeRouteID = "attention-detail"+ relayMobileRouteAttentionMutation relayMobileRuntimeRouteID = "attention-mutation"+)++var relayMobileRuntimeRouteOrder = []relayMobileRuntimeRouteID{+ relayMobileRouteOnboardingQR,+ relayMobileRouteOnboardingValidate,+ relayMobileRouteOnboardingDeepLink,+ relayMobileRoutePatrolFindingsList,+ relayMobileRouteFindingInvestigation,+ relayMobileRouteFindingInvestigationMessages,+ relayMobileRoutePatrolAcknowledge,+ relayMobileRoutePatrolDismiss,+ relayMobileRoutePatrolSnooze,+ relayMobileRouteApprovalsList,+ relayMobileRouteApprovalApprove,+ relayMobileRouteApprovalDeny,+ relayMobileRoutePendingActions,+ relayMobileRouteActionsList,+ relayMobileRouteActionDetail,+ relayMobileRouteActionDecision,+ relayMobileRouteActionExecute,+ relayMobileRouteChatSend,+ relayMobileRouteSessionsList,+ relayMobileRouteSessionCreate,+ relayMobileRouteSessionMessages,+ relayMobileRouteSessionAbort,+ relayMobileRouteSessionRename,+ relayMobileRouteSessionDelete,+ relayMobileRouteAttentionList,+ relayMobileRouteAttentionDetail,+ relayMobileRouteAttentionMutation,+}++var relayMobileRuntimeRouteSpecs = map[relayMobileRuntimeRouteID]relayMobileRuntimeRouteSpec{+ relayMobileRouteOnboardingQR: {+ id: relayMobileRouteOnboardingQR,+ method: http.MethodGet,+ path: "/api/onboarding/qr",+ requiredScope: config.ScopeSettingsRead,+ },+ relayMobileRouteOnboardingValidate: {+ id: relayMobileRouteOnboardingValidate,+ method: http.MethodPost,+ path: "/api/onboarding/validate",+ requiredScope: config.ScopeSettingsRead,+ },+ relayMobileRouteOnboardingDeepLink: {+ id: relayMobileRouteOnboardingDeepLink,+ method: http.MethodGet,+ path: "/api/onboarding/deep-link",+ requiredScope: config.ScopeSettingsRead,+ },+ relayMobileRoutePatrolFindingsList: {+ id: relayMobileRoutePatrolFindingsList,+ method: http.MethodGet,+ path: "/api/ai/patrol/findings",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRouteFindingInvestigation: {+ id: relayMobileRouteFindingInvestigation,+ method: http.MethodGet,+ path: "/api/ai/findings/{finding_id}/investigation",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRouteFindingInvestigationMessages: {+ id: relayMobileRouteFindingInvestigationMessages,+ method: http.MethodGet,+ path: "/api/ai/findings/{finding_id}/investigation/messages",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRoutePatrolAcknowledge: {+ id: relayMobileRoutePatrolAcknowledge,+ method: http.MethodPost,+ path: "/api/ai/patrol/acknowledge",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRoutePatrolDismiss: {+ id: relayMobileRoutePatrolDismiss,+ method: http.MethodPost,+ path: "/api/ai/patrol/dismiss",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRoutePatrolSnooze: {+ id: relayMobileRoutePatrolSnooze,+ method: http.MethodPost,+ path: "/api/ai/patrol/snooze",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRouteApprovalsList: {+ id: relayMobileRouteApprovalsList,+ method: http.MethodGet,+ path: "/api/ai/approvals",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRouteApprovalApprove: {+ id: relayMobileRouteApprovalApprove,+ method: http.MethodPost,+ path: "/api/ai/approvals/{approval_id}/approve",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRouteApprovalDeny: {+ id: relayMobileRouteApprovalDeny,+ method: http.MethodPost,+ path: "/api/ai/approvals/{approval_id}/deny",+ requiredScope: config.ScopeAIExecute,+ },+ relayMobileRoutePendingActions: {+ id: relayMobileRoutePendingActions,+ method: http.MethodGet,+ path: "/api/actions/pending",+ requiredScope: config.ScopeActionsApprove,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteActionsList: {+ id: relayMobileRouteActionsList,+ method: http.MethodGet,+ path: "/api/actions",+ requiredScope: config.ScopeActionsApprove,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteActionDetail: {+ id: relayMobileRouteActionDetail,+ method: http.MethodGet,+ path: "/api/actions/{action_id}",+ requiredScope: config.ScopeActionsApprove,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteActionDecision: {+ id: relayMobileRouteActionDecision,+ method: http.MethodPost,+ path: "/api/actions/{action_id}/decision",+ requiredScope: config.ScopeActionsApprove,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteActionExecute: {+ id: relayMobileRouteActionExecute,+ method: http.MethodPost,+ path: "/api/actions/{action_id}/execute",+ requiredScope: config.ScopeActionsExecute,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteChatSend: {+ id: relayMobileRouteChatSend,+ method: http.MethodPost,+ path: "/api/ai/chat",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionsList: {+ id: relayMobileRouteSessionsList,+ method: http.MethodGet,+ path: "/api/ai/sessions",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionCreate: {+ id: relayMobileRouteSessionCreate,+ method: http.MethodPost,+ path: "/api/ai/sessions",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionMessages: {+ id: relayMobileRouteSessionMessages,+ method: http.MethodGet,+ path: "/api/ai/sessions/{session_id}/messages",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionAbort: {+ id: relayMobileRouteSessionAbort,+ method: http.MethodPost,+ path: "/api/ai/sessions/{session_id}/abort",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionRename: {+ id: relayMobileRouteSessionRename,+ method: http.MethodPatch,+ path: "/api/ai/sessions/{session_id}",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteSessionDelete: {+ id: relayMobileRouteSessionDelete,+ method: http.MethodDelete,+ path: "/api/ai/sessions/{session_id}",+ requiredScope: config.ScopeAIChat,+ },+ relayMobileRouteAttentionList: {+ id: relayMobileRouteAttentionList,+ method: http.MethodGet,+ path: "/api/ai/patrol/attention",+ requiredScope: config.ScopeMonitoringRead,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteAttentionDetail: {+ id: relayMobileRouteAttentionDetail,+ method: http.MethodGet,+ path: "/api/ai/patrol/attention/{item_id}",+ requiredScope: config.ScopeMonitoringRead,+ legacyScope: config.ScopeAIExecute,+ },+ relayMobileRouteAttentionMutation: {+ id: relayMobileRouteAttentionMutation,+ method: http.MethodPost,+ path: "/api/ai/patrol/attention/{item_id}/{mutation}",+ requiredScope: config.ScopeMonitoringWrite,+ legacyScope: config.ScopeAIExecute,+ },+}diff --git a/internal/api/relay_mobile_capability_test.go b/internal/api/relay_mobile_capability_test.goindex b32a253406..e3d5d6670a 100644--- a/internal/api/relay_mobile_capability_test.go+++ b/internal/api/relay_mobile_capability_test.go@@ -1,13 +1,32 @@package apiimport (+ "crypto/sha256""fmt"+ "os""reflect"+ "strings""testing""github.com/rcourtman/pulse-go-rewrite/internal/config")+func TestRelayMobileRuntimeProjectionMatchesManifestDigest(t *testing.T) {+ manifest, err := os.ReadFile("../../docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json")+ if err != nil {+ t.Fatalf("read mobile compatibility manifest: %v", err)+ }+ generated, err := os.ReadFile("relay_mobile_capability_generated.go")+ if err != nil {+ t.Fatalf("read generated mobile route projection: %v", err)+ }++ digest := fmt.Sprintf("%x", sha256.Sum256(manifest))+ if !strings.Contains(string(generated), "Source SHA256: "+digest) {+ t.Fatalf("generated mobile route projection does not match manifest digest %s", digest)+ }+}+func TestRelayMobileRuntimeRouteInventory(t *testing.T) {got := make([]string, 0, len(relayMobileRuntimeRouteOrder))seenIDs := make(map[relayMobileRuntimeRouteID]struct{}, len(relayMobileRuntimeRouteOrder))diff --git a/internal/relay/mobile_compatibility_generated.go b/internal/relay/mobile_compatibility_generated.gonew file mode 100644index 0000000000..c11914790f--- /dev/null+++ b/internal/relay/mobile_compatibility_generated.go@@ -0,0 +1,27 @@+// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.+// Source SHA256: 85bf17ae6e6fa50233dadc7447624e1aded31b31a28339d9db1d4a0401ece107++package relay++// Notification type constants consumed by Pulse Mobile.+const (+ PushTypePatrolFinding = "patrol_finding"+ PushTypePatrolCritical = "patrol_critical"+ PushTypeApprovalRequest = "approval_request"+ PushTypeFixCompleted = "fix_completed"+)++// Priority constants consumed by Pulse Mobile.+const (+ PushPriorityNormal = "normal"+ PushPriorityHigh = "high"+)++// Action type constants consumed by Pulse Mobile.+const (+ PushActionViewFinding = "view_finding"+ PushActionViewAlert = "view_alert"+ PushActionApproveFix = "approve_fix"+ PushActionDecideAction = "decide_action"+ PushActionViewFixResult = "view_fix_result"+)diff --git a/internal/relay/protocol.go b/internal/relay/protocol.goindex 098674844e..c4dc33facb 100644--- a/internal/relay/protocol.go+++ b/internal/relay/protocol.go@@ -195,7 +195,7 @@ type PushNotificationPayload struct {Title string `json:"title"` // Short title (≤100 chars)Body string `json:"body"` // Body text (≤200 chars)InstanceID string `json:"instance_id,omitempty"` // Canonical relay instance identifier for mobile routing/repair- ActionType string `json:"action_type,omitempty"` // "view_finding", "decide_action", legacy "approve_fix", "view_fix_result"+ ActionType string `json:"action_type,omitempty"` // "view_finding", legacy "view_alert", "decide_action", legacy "approve_fix", "view_fix_result"ActionID string `json:"action_id,omitempty"` // Finding ID or Approval IDCategory string `json:"category,omitempty"` // Finding category (performance, capacity, etc.)Severity string `json:"severity,omitempty"` // Finding severitydiff --git a/internal/relay/push.go b/internal/relay/push.goindex 505d3ec725..1eddb5760a 100644--- a/internal/relay/push.go+++ b/internal/relay/push.go@@ -8,28 +8,6 @@ import ("github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources")-// Notification type constants-const (- PushTypePatrolFinding = "patrol_finding"- PushTypePatrolCritical = "patrol_critical"- PushTypeApprovalRequest = "approval_request"- PushTypeFixCompleted = "fix_completed"-)--// Priority constants-const (- PushPriorityNormal = "normal"- PushPriorityHigh = "high"-)--// Action type constants-const (- PushActionViewFinding = "view_finding"- PushActionApproveFix = "approve_fix"- PushActionDecideAction = "decide_action"- PushActionViewFixResult = "view_fix_result"-)-// Title and body length limits for push payloads visible to Apple/Google.const (maxPushTitleLen = 100diff --git a/internal/relay/push_test.go b/internal/relay/push_test.goindex e6699a8d6d..1d8da2e5ac 100644--- a/internal/relay/push_test.go+++ b/internal/relay/push_test.go@@ -42,6 +42,26 @@ func TestCanonicalActionOutcomeNotificationMatrix(t *testing.T) {}}+func TestMobileCompatibilityPushActionVocabulary(t *testing.T) {+ want := []string{+ "view_finding",+ "view_alert",+ "approve_fix",+ "decide_action",+ "view_fix_result",+ }+ got := []string{+ PushActionViewFinding,+ PushActionViewAlert,+ PushActionApproveFix,+ PushActionDecideAction,+ PushActionViewFixResult,+ }+ if fmt.Sprint(got) != fmt.Sprint(want) {+ t.Fatalf("mobile push action vocabulary = %v, want %v", got, want)+ }+}+func TestNewPatrolFindingNotification(t *testing.T) {t.Run("warning finding", func(t *testing.T) {n := NewPatrolFindingNotification("finding-123", "warning", "performance", "High CPU usage detected")diff --git a/scripts/release_control/generate_mobile_compatibility.py b/scripts/release_control/generate_mobile_compatibility.pynew file mode 100644index 0000000000..85e8f83c43--- /dev/null+++ b/scripts/release_control/generate_mobile_compatibility.py@@ -0,0 +1,525 @@+#!/usr/bin/env python3+"""Generate runtime and mobile projections of the Pulse Mobile contract."""++from __future__ import annotations++import argparse+import hashlib+import json+import re+import subprocess+import sys+from pathlib import Path+from typing import Any+++REPO_ROOT = Path(__file__).resolve().parents[2]+MANIFEST_REL = Path("docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json")+API_OUTPUT_REL = Path("internal/api/relay_mobile_capability_generated.go")+RELAY_OUTPUT_REL = Path("internal/relay/mobile_compatibility_generated.go")+MOBILE_OUTPUT_REL = Path("src/generated/coreCompatibility.ts")++METHOD_SYMBOLS = {+ "DELETE": "http.MethodDelete",+ "GET": "http.MethodGet",+ "PATCH": "http.MethodPatch",+ "POST": "http.MethodPost",+ "PUT": "http.MethodPut",+}++SCOPE_SYMBOLS = {+ "actions:approve": "config.ScopeActionsApprove",+ "actions:execute": "config.ScopeActionsExecute",+ "ai:chat": "config.ScopeAIChat",+ "ai:execute": "config.ScopeAIExecute",+ "monitoring:read": "config.ScopeMonitoringRead",+ "monitoring:write": "config.ScopeMonitoringWrite",+ "settings:read": "config.ScopeSettingsRead",+}++VALID_FIELD_TYPES = {"array", "boolean", "integer", "number", "object", "string"}+VALID_LIFECYCLES = {"compatibility", "current"}+VALID_IMPACTS = {"desktop-only", "mobile-handoff-only", "mobile-required"}+PLACEHOLDER_RE = re.compile(r"\{([a-z][a-z0-9_]*)\}")+ROUTE_ID_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")+GO_SYMBOL_RE = re.compile(r"^[A-Za-z][A-Za-z0-9]*$")+++class ManifestError(ValueError):+ """Raised when the canonical manifest is internally inconsistent."""+++def load_manifest(pulse_root: Path) -> tuple[dict[str, Any], bytes]:+ path = pulse_root / MANIFEST_REL+ raw = path.read_bytes()+ try:+ payload = json.loads(raw)+ except json.JSONDecodeError as exc:+ raise ManifestError(f"invalid JSON in {path}: {exc}") from exc+ if not isinstance(payload, dict):+ raise ManifestError("mobile compatibility manifest root must be an object")+ validate_manifest(payload)+ return payload, raw+++def _require_non_empty_string(value: Any, label: str) -> str:+ if not isinstance(value, str) or not value.strip():+ raise ManifestError(f"{label} must be a non-empty string")+ return value+++def _reject_unknown_keys(+ value: dict[str, Any], allowed: set[str], label: str+) -> None:+ unknown = set(value) - allowed+ if unknown:+ raise ManifestError(f"{label} has unknown keys: {sorted(unknown)}")+++def _validate_symbol_values(+ values: Any, label: str, *, extra_keys: set[str] | None = None+) -> None:+ if not isinstance(values, list) or not values:+ raise ManifestError(f"{label} must be a non-empty list")+ seen_values: set[str] = set()+ seen_symbols: set[str] = set()+ for index, entry in enumerate(values):+ if not isinstance(entry, dict):+ raise ManifestError(f"{label}[{index}] must be an object")+ _reject_unknown_keys(+ entry,+ {"value", "go_symbol"} | (extra_keys or set()),+ f"{label}[{index}]",+ )+ value = _require_non_empty_string(entry.get("value"), f"{label}[{index}].value")+ symbol = _require_non_empty_string(+ entry.get("go_symbol"), f"{label}[{index}].go_symbol"+ )+ if not GO_SYMBOL_RE.fullmatch(symbol):+ raise ManifestError(f"{label}[{index}].go_symbol is invalid")+ if value in seen_values:+ raise ManifestError(f"duplicate {label} value {value!r}")+ if symbol in seen_symbols:+ raise ManifestError(f"duplicate {label} Go symbol {symbol!r}")+ seen_values.add(value)+ seen_symbols.add(symbol)+++def _validate_fields(fields: Any, label: str) -> None:+ if not isinstance(fields, list):+ raise ManifestError(f"{label} must be a list")+ seen: set[str] = set()+ for index, field in enumerate(fields):+ if not isinstance(field, dict):+ raise ManifestError(f"{label}[{index}] must be an object")+ _reject_unknown_keys(field, {"path", "type", "required"}, f"{label}[{index}]")+ path = _require_non_empty_string(field.get("path"), f"{label}[{index}].path")+ field_type = _require_non_empty_string(+ field.get("type"), f"{label}[{index}].type"+ )+ if field_type not in VALID_FIELD_TYPES:+ raise ManifestError(f"{label}[{index}] has unknown type {field_type!r}")+ if "required" in field and not isinstance(field["required"], bool):+ raise ManifestError(f"{label}[{index}].required must be boolean")+ if path in seen:+ raise ManifestError(f"duplicate field {path!r} in {label}")+ seen.add(path)+++def validate_manifest(payload: dict[str, Any]) -> None:+ _reject_unknown_keys(+ payload,+ {+ "$schema",+ "schema_version",+ "contract_version",+ "mobile_role",+ "surface_classes",+ "pairing",+ "push",+ "routes",+ },+ "manifest",+ )+ if payload.get("schema_version") != 1:+ raise ManifestError("schema_version must be 1")+ if not isinstance(payload.get("contract_version"), int) or payload["contract_version"] < 1:+ raise ManifestError("contract_version must be a positive integer")+ _require_non_empty_string(payload.get("mobile_role"), "mobile_role")++ classes = payload.get("surface_classes")+ if not isinstance(classes, list):+ raise ManifestError("surface_classes must be a list")+ for index, entry in enumerate(classes):+ if not isinstance(entry, dict):+ raise ManifestError(f"surface_classes[{index}] must be an object")+ _reject_unknown_keys(+ entry, {"id", "description"}, f"surface_classes[{index}]"+ )+ _require_non_empty_string(+ entry.get("description"), f"surface_classes[{index}].description"+ )+ class_ids = [entry.get("id") for entry in classes if isinstance(entry, dict)]+ if set(class_ids) != VALID_IMPACTS or len(class_ids) != len(VALID_IMPACTS):+ raise ManifestError(+ "surface_classes must define mobile-required, mobile-handoff-only, and desktop-only exactly once"+ )++ pairing = payload.get("pairing")+ if not isinstance(pairing, dict):+ raise ManifestError("pairing must be an object")+ _reject_unknown_keys(+ pairing,+ {"schema", "scheme", "host", "required_fields", "optional_fields"},+ "pairing",+ )+ for key in ("schema", "scheme", "host"):+ _require_non_empty_string(pairing.get(key), f"pairing.{key}")+ required_pairing = pairing.get("required_fields")+ optional_pairing = pairing.get("optional_fields")+ if not isinstance(required_pairing, list) or not all(+ isinstance(value, str) and value for value in required_pairing+ ):+ raise ManifestError("pairing.required_fields must be a string list")+ if not isinstance(optional_pairing, list) or not all(+ isinstance(value, str) and value for value in optional_pairing+ ):+ raise ManifestError("pairing.optional_fields must be a string list")+ if len(required_pairing) != len(set(required_pairing)):+ raise ManifestError("pairing.required_fields must not contain duplicates")+ if len(optional_pairing) != len(set(optional_pairing)):+ raise ManifestError("pairing.optional_fields must not contain duplicates")+ overlap = set(required_pairing) & set(optional_pairing)+ if overlap:+ raise ManifestError(f"pairing fields cannot be both required and optional: {sorted(overlap)}")++ push = payload.get("push")+ if not isinstance(push, dict):+ raise ManifestError("push must be an object")+ _reject_unknown_keys(+ push, {"required_fields", "types", "priorities", "actions"}, "push"+ )+ required_push_fields = push.get("required_fields")+ if not isinstance(required_push_fields, list) or not all(+ isinstance(value, str) and value for value in required_push_fields+ ):+ raise ManifestError("push.required_fields must be a string list")+ if len(required_push_fields) != len(set(required_push_fields)):+ raise ManifestError("push.required_fields must not contain duplicates")+ _validate_symbol_values(push.get("types"), "push.types")+ _validate_symbol_values(push.get("priorities"), "push.priorities")+ _validate_symbol_values(+ push.get("actions"),+ "push.actions",+ extra_keys={"destination", "lifecycle"},+ )+ for index, action in enumerate(push["actions"]):+ if action.get("lifecycle") not in VALID_LIFECYCLES:+ raise ManifestError(f"push.actions[{index}] has invalid lifecycle")+ if action.get("destination") not in {"approval-detail", "finding-detail"}:+ raise ManifestError(f"push.actions[{index}] has invalid destination")++ routes = payload.get("routes")+ if not isinstance(routes, list) or not routes:+ raise ManifestError("routes must be a non-empty list")+ seen_ids: set[str] = set()+ seen_symbols: set[str] = set()+ seen_method_paths: set[tuple[str, str]] = set()+ for index, route in enumerate(routes):+ if not isinstance(route, dict):+ raise ManifestError(f"routes[{index}] must be an object")+ _reject_unknown_keys(+ route,+ {+ "id",+ "go_symbol",+ "method",+ "path",+ "required_scope",+ "legacy_scope",+ "lifecycle",+ "mobile_impact",+ "implementation_paths",+ "request_fields",+ "response_fields",+ },+ f"routes[{index}]",+ )+ route_id = _require_non_empty_string(route.get("id"), f"routes[{index}].id")+ symbol = _require_non_empty_string(+ route.get("go_symbol"), f"routes[{index}].go_symbol"+ )+ method = _require_non_empty_string(route.get("method"), f"routes[{index}].method")+ path = _require_non_empty_string(route.get("path"), f"routes[{index}].path")+ scope = _require_non_empty_string(+ route.get("required_scope"), f"routes[{index}].required_scope"+ )+ if not ROUTE_ID_RE.fullmatch(route_id):+ raise ManifestError(f"route id {route_id!r} is invalid")+ if not GO_SYMBOL_RE.fullmatch(symbol):+ raise ManifestError(f"route {route_id!r} Go symbol is invalid")+ if method not in METHOD_SYMBOLS:+ raise ManifestError(f"route {route_id!r} has unsupported method {method!r}")+ if scope not in SCOPE_SYMBOLS:+ raise ManifestError(f"route {route_id!r} has unsupported scope {scope!r}")+ legacy_scope = route.get("legacy_scope")+ if legacy_scope is not None and legacy_scope not in SCOPE_SYMBOLS:+ raise ManifestError(+ f"route {route_id!r} has unsupported legacy scope {legacy_scope!r}"+ )+ if route.get("lifecycle") not in VALID_LIFECYCLES:+ raise ManifestError(f"route {route_id!r} has invalid lifecycle")+ if route.get("mobile_impact") not in VALID_IMPACTS:+ raise ManifestError(f"route {route_id!r} has invalid mobile_impact")+ implementation_paths = route.get("implementation_paths")+ if (+ not isinstance(implementation_paths, list)+ or not implementation_paths+ or not all(+ isinstance(implementation_path, str) and implementation_path+ for implementation_path in implementation_paths+ )+ ):+ raise ManifestError(f"route {route_id!r} must name implementation_paths")+ if len(implementation_paths) != len(set(implementation_paths)):+ raise ManifestError(f"route {route_id!r} has duplicate implementation_paths")+ _validate_fields(route.get("request_fields"), f"route {route_id} request_fields")+ _validate_fields(route.get("response_fields"), f"route {route_id} response_fields")+ if route_id in seen_ids:+ raise ManifestError(f"duplicate route id {route_id!r}")+ if symbol in seen_symbols:+ raise ManifestError(f"duplicate route Go symbol {symbol!r}")+ if (method, path) in seen_method_paths:+ raise ManifestError(f"duplicate route {method} {path}")+ if not path.startswith("/api/"):+ raise ManifestError(f"route {route_id!r} path must start with /api/")+ placeholders = PLACEHOLDER_RE.findall(path)+ if len(placeholders) != len(set(placeholders)):+ raise ManifestError(f"route {route_id!r} repeats a path placeholder")+ seen_ids.add(route_id)+ seen_symbols.add(symbol)+ seen_method_paths.add((method, path))+++def manifest_sha256(raw: bytes) -> str:+ return hashlib.sha256(raw).hexdigest()+++def render_api_go(payload: dict[str, Any], digest: str) -> str:+ routes = payload["routes"]+ lines = [+ "// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.",+ f"// Source SHA256: {digest}",+ "",+ "package api",+ "",+ "import (",+ '\t"net/http"',+ "",+ '\t"github.com/rcourtman/pulse-go-rewrite/internal/config"',+ ")",+ "",+ f'const onboardingSchemaVersion = {json.dumps(payload["pairing"]["schema"])}',+ "",+ "const (",+ ]+ for route in routes:+ lines.append(+ f'\t{route["go_symbol"]} relayMobileRuntimeRouteID = {json.dumps(route["id"])}'+ )+ lines.extend([")", "", "var relayMobileRuntimeRouteOrder = []relayMobileRuntimeRouteID{"])+ lines.extend(f'\t{route["go_symbol"]},' for route in routes)+ lines.extend(["}", "", "var relayMobileRuntimeRouteSpecs = map[relayMobileRuntimeRouteID]relayMobileRuntimeRouteSpec{"])+ for route in routes:+ lines.extend(+ [+ f'\t{route["go_symbol"]}: {{',+ f'\t\tid: {route["go_symbol"]},',+ f'\t\tmethod: {METHOD_SYMBOLS[route["method"]]},',+ f'\t\tpath: {json.dumps(route["path"])},',+ f'\t\trequiredScope: {SCOPE_SYMBOLS[route["required_scope"]]},',+ ]+ )+ if route.get("legacy_scope"):+ lines.append(f'\t\tlegacyScope: {SCOPE_SYMBOLS[route["legacy_scope"]]},')+ lines.append("\t},")+ lines.extend(["}", ""])+ return "\n".join(lines)+++def render_relay_go(payload: dict[str, Any], digest: str) -> str:+ push = payload["push"]+ lines = [+ "// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.",+ f"// Source SHA256: {digest}",+ "",+ "package relay",+ "",+ "// Notification type constants consumed by Pulse Mobile.",+ "const (",+ ]+ lines.extend(f'\t{entry["go_symbol"]} = {json.dumps(entry["value"])}' for entry in push["types"])+ lines.extend([")", "", "// Priority constants consumed by Pulse Mobile.", "const ("])+ lines.extend(+ f'\t{entry["go_symbol"]} = {json.dumps(entry["value"])}'+ for entry in push["priorities"]+ )+ lines.extend([")", "", "// Action type constants consumed by Pulse Mobile.", "const ("])+ lines.extend(+ f'\t{entry["go_symbol"]} = {json.dumps(entry["value"])}' for entry in push["actions"]+ )+ lines.extend([")", ""])+ return "\n".join(lines)+++def render_mobile_typescript(payload: dict[str, Any], digest: str) -> str:+ routes = {+ route["id"]: {+ "method": route["method"],+ "path": route["path"],+ "requiredScope": route["required_scope"],+ "compatibleScopes": list(+ dict.fromkeys(+ [+ "relay:mobile:access",+ route["required_scope"],+ *([route["legacy_scope"]] if route.get("legacy_scope") else []),+ ]+ )+ ),+ "lifecycle": route["lifecycle"],+ "mobileImpact": route["mobile_impact"],+ }+ for route in payload["routes"]+ }+ push_actions = {+ action["value"]: {+ "value": action["value"],+ "destination": action["destination"],+ "lifecycle": action["lifecycle"],+ }+ for action in payload["push"]["actions"]+ }+ return "\n".join(+ [+ "// This file is generated by Pulse's mobile compatibility generator.",+ "// Do not edit it in pulse-mobile; update MOBILE_COMPATIBILITY_MANIFEST.json in Pulse.",+ f"// Source SHA256: {digest}",+ "",+ f"export const CORE_MOBILE_CONTRACT_VERSION = {payload['contract_version']} as const;",+ f"export const CORE_MOBILE_CONTRACT_SHA256 = {json.dumps(digest)} as const;",+ "",+ "export const CORE_MOBILE_PAIRING = "+ + json.dumps(payload["pairing"], indent=2, ensure_ascii=False)+ + " as const;",+ "",+ "export const CORE_MOBILE_ROUTES = "+ + json.dumps(routes, indent=2, ensure_ascii=False)+ + " as const;",+ "",+ "export type CoreMobileRouteId = keyof typeof CORE_MOBILE_ROUTES;",+ "",+ "export const CORE_MOBILE_PUSH = "+ + json.dumps(+ {+ "requiredFields": payload["push"]["required_fields"],+ "types": [entry["value"] for entry in payload["push"]["types"]],+ "priorities": [+ entry["value"] for entry in payload["push"]["priorities"]+ ],+ "actions": push_actions,+ },+ indent=2,+ ensure_ascii=False,+ )+ + " as const;",+ "",+ "export type CoreMobilePushAction = keyof typeof CORE_MOBILE_PUSH.actions;",+ "",+ ]+ )+++def format_go(source: str) -> str:+ completed = subprocess.run(+ ["gofmt"],+ input=source,+ check=True,+ capture_output=True,+ text=True,+ )+ return completed.stdout+++def generated_outputs(+ pulse_root: Path, mobile_repo: Path | None+) -> dict[Path, str]:+ payload, raw = load_manifest(pulse_root)+ digest = manifest_sha256(raw)+ outputs = {+ pulse_root / API_OUTPUT_REL: format_go(render_api_go(payload, digest)),+ pulse_root / RELAY_OUTPUT_REL: format_go(render_relay_go(payload, digest)),+ }+ if mobile_repo is not None:+ outputs[mobile_repo / MOBILE_OUTPUT_REL] = render_mobile_typescript(payload, digest)+ return outputs+++def write_outputs(outputs: dict[Path, str]) -> None:+ for path, content in outputs.items():+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(content, encoding="utf-8")+++def check_outputs(outputs: dict[Path, str]) -> list[str]:+ errors: list[str] = []+ for path, expected in outputs.items():+ try:+ actual = path.read_text(encoding="utf-8")+ except OSError:+ errors.append(f"missing generated projection: {path}")+ continue+ if actual != expected:+ errors.append(f"generated projection is stale: {path}")+ return errors+++def parse_args() -> argparse.Namespace:+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--pulse-root", default=str(REPO_ROOT))+ parser.add_argument("--mobile-repo", default="")+ mode = parser.add_mutually_exclusive_group()+ mode.add_argument("--write", action="store_true")+ mode.add_argument("--check", action="store_true")+ return parser.parse_args()+++def main() -> int:+ args = parse_args()+ pulse_root = Path(args.pulse_root).resolve()+ mobile_repo = Path(args.mobile_repo).resolve() if args.mobile_repo else None+ try:+ outputs = generated_outputs(pulse_root, mobile_repo)+ if args.write:+ write_outputs(outputs)+ print(f"[OK] Wrote {len(outputs)} mobile compatibility projections")+ return 0+ errors = check_outputs(outputs)+ except (ManifestError, OSError, subprocess.CalledProcessError) as exc:+ print(f"ERROR: {exc}", file=sys.stderr)+ return 1+ if errors:+ for error in errors:+ print(f"ERROR: {error}", file=sys.stderr)+ print(+ "Run scripts/release_control/generate_mobile_compatibility.py --write "+ "--mobile-repo ../pulse-mobile",+ file=sys.stderr,+ )+ return 1+ print(f"[OK] {len(outputs)} mobile compatibility projections are current")+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/release_control/generate_mobile_compatibility_test.py b/scripts/release_control/generate_mobile_compatibility_test.pynew file mode 100644index 0000000000..2824085784--- /dev/null+++ b/scripts/release_control/generate_mobile_compatibility_test.py@@ -0,0 +1,49 @@+#!/usr/bin/env python3+"""Unit tests for the canonical Pulse Mobile contract generator."""++from __future__ import annotations++import copy+import unittest++from generate_mobile_compatibility import (+ ManifestError,+ REPO_ROOT,+ generated_outputs,+ load_manifest,+ validate_manifest,+)+++class MobileCompatibilityGeneratorTest(unittest.TestCase):+ def setUp(self) -> None:+ self.manifest, _ = load_manifest(REPO_ROOT)++ def test_manifest_renders_backend_projections(self) -> None:+ outputs = generated_outputs(REPO_ROOT, None)+ rendered = "\n".join(outputs.values())+ self.assertIn("relayMobileRouteAttentionList", rendered)+ self.assertIn("PushActionDecideAction", rendered)+ self.assertIn('onboardingSchemaVersion = "pulse-mobile-onboarding-v1"', rendered)++ def test_duplicate_route_ids_fail_closed(self) -> None:+ payload = copy.deepcopy(self.manifest)+ payload["routes"][1]["id"] = payload["routes"][0]["id"]+ with self.assertRaisesRegex(ManifestError, "duplicate route id"):+ validate_manifest(payload)++ def test_unknown_scope_fails_closed(self) -> None:+ payload = copy.deepcopy(self.manifest)+ payload["routes"][0]["required_scope"] = "mobile:anything"+ with self.assertRaisesRegex(ManifestError, "unsupported scope"):+ validate_manifest(payload)++ def test_invalid_mobile_impact_fails_closed(self) -> None:+ payload = copy.deepcopy(self.manifest)+ payload["routes"][0]["mobile_impact"] = "maybe-mobile"+ with self.assertRaisesRegex(ManifestError, "invalid mobile_impact"):+ validate_manifest(payload)+++if __name__ == "__main__":+ unittest.main()diff --git a/scripts/release_control/mobile_compatibility.py b/scripts/release_control/mobile_compatibility.pynew file mode 100644index 0000000000..4a01e09f82--- /dev/null+++ b/scripts/release_control/mobile_compatibility.py@@ -0,0 +1,355 @@+#!/usr/bin/env python3+"""Verify Pulse core against the checked-in Pulse Mobile consumer contract."""++from __future__ import annotations++import argparse+import datetime as dt+import json+import subprocess+import sys+from pathlib import Path+from typing import Any, Iterable++from generate_mobile_compatibility import (+ MANIFEST_REL,+ ManifestError,+ check_outputs,+ generated_outputs,+ load_manifest,+ manifest_sha256,+)+++REPO_ROOT = Path(__file__).resolve().parents[2]+CONSUMER_REL = Path("config/mobile-api-surface.json")+VALID_FIELD_TYPES = {"array", "boolean", "integer", "number", "object", "string"}+++class CompatibilityError(ValueError):+ """Raised when the mobile consumer contract is invalid or incompatible."""+++def load_consumer(mobile_repo: Path) -> dict[str, Any]:+ path = mobile_repo / CONSUMER_REL+ try:+ payload = json.loads(path.read_text(encoding="utf-8"))+ except OSError as exc:+ raise CompatibilityError(f"cannot read mobile consumer contract {path}: {exc}") from exc+ except json.JSONDecodeError as exc:+ raise CompatibilityError(f"invalid JSON in mobile consumer contract {path}: {exc}") from exc+ if not isinstance(payload, dict):+ raise CompatibilityError("mobile consumer contract root must be an object")+ validate_consumer(payload)+ return payload+++def _string_list(value: Any, label: str, *, allow_empty: bool = True) -> list[str]:+ if not isinstance(value, list) or not all(isinstance(item, str) and item for item in value):+ raise CompatibilityError(f"{label} must be a list of non-empty strings")+ if not allow_empty and not value:+ raise CompatibilityError(f"{label} must not be empty")+ if len(value) != len(set(value)):+ raise CompatibilityError(f"{label} must not contain duplicates")+ return value+++def _validate_consumer_fields(value: Any, label: str) -> None:+ if not isinstance(value, list):+ raise CompatibilityError(f"{label} must be a list")+ seen: set[str] = set()+ for index, entry in enumerate(value):+ if not isinstance(entry, dict):+ raise CompatibilityError(f"{label}[{index}] must be an object")+ path = entry.get("path")+ field_type = entry.get("type")+ if not isinstance(path, str) or not path:+ raise CompatibilityError(f"{label}[{index}].path must be non-empty")+ if field_type not in VALID_FIELD_TYPES:+ raise CompatibilityError(f"{label}[{index}].type is invalid")+ if "required" in entry and not isinstance(entry["required"], bool):+ raise CompatibilityError(f"{label}[{index}].required must be boolean")+ if path in seen:+ raise CompatibilityError(f"duplicate {label} path {path!r}")+ seen.add(path)+++def validate_consumer(payload: dict[str, Any]) -> None:+ if payload.get("schemaVersion") != 1:+ raise CompatibilityError("consumer schemaVersion must be 1")+ contract = payload.get("coreContract")+ if not isinstance(contract, dict):+ raise CompatibilityError("coreContract must be an object")+ versions = contract.get("supportedVersions")+ if not isinstance(versions, dict):+ raise CompatibilityError("coreContract.supportedVersions must be an object")+ minimum = versions.get("minimum")+ maximum = versions.get("maximum")+ if not isinstance(minimum, int) or not isinstance(maximum, int) or minimum < 1:+ raise CompatibilityError("core contract versions must be positive integers")+ if minimum > maximum:+ raise CompatibilityError("minimum core contract version cannot exceed maximum")++ pairing = contract.get("pairing")+ if not isinstance(pairing, dict):+ raise CompatibilityError("pairing must be an object")+ for key in ("schema", "scheme", "host"):+ if not isinstance(pairing.get(key), str) or not pairing[key]:+ raise CompatibilityError(f"pairing.{key} must be a non-empty string")+ _string_list(pairing.get("requiredFields"), "pairing.requiredFields", allow_empty=False)++ push = contract.get("push")+ if not isinstance(push, dict):+ raise CompatibilityError("push must be an object")+ _string_list(push.get("requiredFields"), "push.requiredFields", allow_empty=False)+ actions = push.get("actions")+ if not isinstance(actions, list) or not actions:+ raise CompatibilityError("push.actions must be a non-empty list")+ action_values: set[str] = set()+ for index, action in enumerate(actions):+ if not isinstance(action, dict):+ raise CompatibilityError(f"push.actions[{index}] must be an object")+ value = action.get("value")+ destination = action.get("destination")+ if not isinstance(value, str) or not value:+ raise CompatibilityError(f"push.actions[{index}].value must be non-empty")+ if destination not in {"approval-detail", "finding-detail"}:+ raise CompatibilityError(f"push.actions[{index}].destination is invalid")+ if value in action_values:+ raise CompatibilityError(f"duplicate push action {value!r}")+ action_values.add(value)++ routes = payload.get("endpoints")+ if not isinstance(routes, list) or not routes:+ raise CompatibilityError("endpoints must be a non-empty list")+ route_fields = contract.get("routeFields")+ if not isinstance(route_fields, dict):+ raise CompatibilityError("coreContract.routeFields must be an object")+ route_ids: set[str] = set()+ for index, route in enumerate(routes):+ if not isinstance(route, dict):+ raise CompatibilityError(f"endpoints[{index}] must be an object")+ route_id = route.get("id")+ if not isinstance(route_id, str) or not route_id:+ raise CompatibilityError(f"endpoints[{index}].id must be non-empty")+ core_route_id = route.get("coreRouteId", route_id)+ if not isinstance(core_route_id, str) or not core_route_id:+ raise CompatibilityError(f"endpoint {route_id!r} coreRouteId must be non-empty")+ if route.get("method") not in {"DELETE", "GET", "PATCH", "POST", "PUT"}:+ raise CompatibilityError(f"endpoint {route_id!r} has invalid method")+ fields = route_fields.get(route_id)+ if not isinstance(fields, dict):+ raise CompatibilityError(+ f"coreContract.routeFields is missing endpoint {route_id!r}"+ )+ _validate_consumer_fields(fields.get("request"), f"endpoint {route_id} request fields")+ _validate_consumer_fields(fields.get("response"), f"endpoint {route_id} response fields")+ if route_id in route_ids:+ raise CompatibilityError(f"duplicate endpoint {route_id!r}")+ route_ids.add(route_id)+ stale_fields = set(route_fields) - route_ids+ if stale_fields:+ raise CompatibilityError(+ f"coreContract.routeFields has stale endpoints: {sorted(stale_fields)}"+ )+++def _field_map(fields: Iterable[dict[str, Any]]) -> dict[str, dict[str, Any]]:+ return {str(field["path"]): field for field in fields}+++def compare_contracts(+ provider: dict[str, Any], consumer: dict[str, Any]+) -> list[str]:+ errors: list[str] = []+ version = provider["contract_version"]+ consumer_contract = consumer["coreContract"]+ versions = consumer_contract["supportedVersions"]+ if not versions["minimum"] <= version <= versions["maximum"]:+ errors.append(+ f"core contract version {version} is outside mobile's supported range "+ f"{versions['minimum']}..{versions['maximum']}"+ )++ provider_pairing = provider["pairing"]+ consumer_pairing = consumer_contract["pairing"]+ for key in ("schema", "scheme", "host"):+ if provider_pairing[key] != consumer_pairing[key]:+ errors.append(+ f"pairing {key} = {provider_pairing[key]!r}, mobile requires {consumer_pairing[key]!r}"+ )+ missing_pairing = set(consumer_pairing["requiredFields"]) - (+ set(provider_pairing["required_fields"]) | set(provider_pairing["optional_fields"])+ )+ if missing_pairing:+ errors.append(f"core pairing contract is missing fields: {sorted(missing_pairing)}")++ provider_push = provider["push"]+ consumer_push = consumer_contract["push"]+ missing_push_fields = set(consumer_push["requiredFields"]) - set(+ provider_push["required_fields"]+ )+ if missing_push_fields:+ errors.append(f"core push contract is missing fields: {sorted(missing_push_fields)}")+ provider_actions = {entry["value"]: entry for entry in provider_push["actions"]}+ for required_action in consumer_push["actions"]:+ actual = provider_actions.get(required_action["value"])+ if actual is None:+ errors.append(f"core push contract removed action {required_action['value']!r}")+ continue+ if actual["destination"] != required_action["destination"]:+ errors.append(+ f"push action {required_action['value']!r} destination changed from "+ f"{required_action['destination']!r} to {actual['destination']!r}"+ )++ provider_routes = {route["id"]: route for route in provider["routes"]}+ route_fields = consumer_contract["routeFields"]+ for required_route in consumer["endpoints"]:+ endpoint_id = required_route["id"]+ route_id = required_route.get("coreRouteId", endpoint_id)+ actual = provider_routes.get(route_id)+ if actual is None:+ errors.append(+ f"core contract removed mobile route {route_id!r} used by endpoint {endpoint_id!r}"+ )+ continue+ if actual["method"] != required_route["method"]:+ errors.append(+ f"route {route_id!r} method changed from {required_route['method']} "+ f"to {actual['method']}"+ )+ if actual["mobile_impact"] != "mobile-required":+ errors.append(+ f"route {route_id!r} is consumed by mobile but classified "+ f"{actual['mobile_impact']!r}"+ )+ compatible_scopes = {+ "relay:mobile:access",+ actual["required_scope"],+ *([actual["legacy_scope"]] if actual.get("legacy_scope") else []),+ }+ if "relay:mobile:access" not in compatible_scopes:+ errors.append(f"route {route_id!r} no longer accepts relay:mobile:access")+ for consumer_direction, provider_direction in (+ ("request", "request_fields"),+ ("response", "response_fields"),+ ):+ provider_fields = _field_map(actual[provider_direction])+ for field in route_fields[endpoint_id][consumer_direction]:+ provider_field = provider_fields.get(field["path"])+ if provider_field is None:+ errors.append(+ f"route {route_id!r} removed mobile {consumer_direction} field {field['path']!r}"+ )+ continue+ if provider_field["type"] != field["type"]:+ errors.append(+ f"route {route_id!r} field {field['path']!r} changed type from "+ f"{field['type']} to {provider_field['type']}"+ )+ consumer_requires = field.get("required", True)+ provider_guarantees = provider_field.get("required", True)+ if consumer_requires and not provider_guarantees:+ errors.append(+ f"route {route_id!r} field {field['path']!r} is no longer guaranteed"+ )+ return errors+++def git_revision(repo: Path) -> tuple[str, bool]:+ def run(*args: str) -> str:+ completed = subprocess.run(+ ["git", "-C", str(repo), *args],+ check=True,+ capture_output=True,+ text=True,+ )+ return completed.stdout.strip()++ try:+ revision = run("rev-parse", "HEAD")+ dirty = bool(run("status", "--porcelain"))+ return revision, dirty+ except (OSError, subprocess.CalledProcessError):+ return "unavailable", True+++def read_candidate(mobile_repo: Path) -> dict[str, Any]:+ path = mobile_repo / "store/release-readiness.json"+ try:+ payload = json.loads(path.read_text(encoding="utf-8"))+ except (OSError, json.JSONDecodeError):+ return {}+ candidate = payload.get("currentCandidate")+ return candidate if isinstance(candidate, dict) else {}+++def build_evidence(+ pulse_root: Path,+ mobile_repo: Path,+ provider: dict[str, Any],+ manifest_raw: bytes,+) -> dict[str, Any]:+ pulse_revision, pulse_dirty = git_revision(pulse_root)+ mobile_revision, mobile_dirty = git_revision(mobile_repo)+ return {+ "schemaVersion": 1,+ "status": "passed",+ "generatedAt": dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat(),+ "contractVersion": provider["contract_version"],+ "contractSha256": manifest_sha256(manifest_raw),+ "pulseRevision": pulse_revision,+ "pulseDirty": pulse_dirty,+ "mobileRevision": mobile_revision,+ "mobileDirty": mobile_dirty,+ "mobileCandidate": read_candidate(mobile_repo),+ "checks": [+ "canonical-manifest-valid",+ "generated-projections-current",+ "route-method-scope-compatible",+ "request-response-fields-compatible",+ "pairing-contract-compatible",+ "push-routing-compatible",+ ],+ }+++def parse_args() -> argparse.Namespace:+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--pulse-root", default=str(REPO_ROOT))+ parser.add_argument("--mobile-repo", required=True)+ parser.add_argument("--evidence-out", default="")+ parser.add_argument("--pretty", action="store_true")+ return parser.parse_args()+++def main() -> int:+ args = parse_args()+ pulse_root = Path(args.pulse_root).resolve()+ mobile_repo = Path(args.mobile_repo).resolve()+ try:+ provider, raw = load_manifest(pulse_root)+ consumer = load_consumer(mobile_repo)+ errors = compare_contracts(provider, consumer)+ errors.extend(check_outputs(generated_outputs(pulse_root, mobile_repo)))+ except (CompatibilityError, ManifestError, OSError, subprocess.CalledProcessError) as exc:+ print(f"ERROR: {exc}", file=sys.stderr)+ return 1+ if errors:+ for error in errors:+ print(f"ERROR: {error}", file=sys.stderr)+ return 1++ evidence = build_evidence(pulse_root, mobile_repo, provider, raw)+ rendered = json.dumps(evidence, indent=2 if args.pretty else None, sort_keys=True) + "\n"+ if args.evidence_out:+ output = Path(args.evidence_out)+ output.parent.mkdir(parents=True, exist_ok=True)+ output.write_text(rendered, encoding="utf-8")+ print(rendered, end="")+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/release_control/mobile_compatibility_test.py b/scripts/release_control/mobile_compatibility_test.pynew file mode 100644index 0000000000..cc9d133a7a--- /dev/null+++ b/scripts/release_control/mobile_compatibility_test.py@@ -0,0 +1,62 @@+#!/usr/bin/env python3+"""Unit tests for provider/consumer Pulse Mobile compatibility checks."""++from __future__ import annotations++import copy+import unittest++from generate_mobile_compatibility import REPO_ROOT, load_manifest+from mobile_compatibility import compare_contracts, load_consumer+++MOBILE_REPO = REPO_ROOT.parent / "pulse-mobile"+++class MobileCompatibilityTest(unittest.TestCase):+ def setUp(self) -> None:+ if not (MOBILE_REPO / "config/mobile-api-surface.json").is_file():+ self.skipTest(f"Pulse Mobile checkout not available at {MOBILE_REPO}")+ self.provider, _ = load_manifest(REPO_ROOT)+ self.consumer = load_consumer(MOBILE_REPO)++ def test_checked_in_contracts_are_compatible(self) -> None:+ self.assertEqual(compare_contracts(self.provider, self.consumer), [])++ def test_removed_mobile_route_is_rejected(self) -> None:+ provider = copy.deepcopy(self.provider)+ provider["routes"] = [+ route for route in provider["routes"] if route["id"] != "attention-list"+ ]+ self.assertTrue(+ any(+ "removed mobile route 'attention-list'" in error+ for error in compare_contracts(provider, self.consumer)+ )+ )++ def test_response_field_type_change_is_rejected(self) -> None:+ provider = copy.deepcopy(self.provider)+ route = next(route for route in provider["routes"] if route["id"] == "attention-list")+ field = next(field for field in route["response_fields"] if field["path"] == "data")+ field["type"] = "object"+ self.assertTrue(+ any(+ "field 'data' changed type" in error+ for error in compare_contracts(provider, self.consumer)+ )+ )++ def test_pairing_and_push_drift_are_rejected(self) -> None:+ provider = copy.deepcopy(self.provider)+ provider["pairing"]["host"] = "pair"+ provider["push"]["actions"] = [+ action for action in provider["push"]["actions"] if action["value"] != "decide_action"+ ]+ errors = compare_contracts(provider, self.consumer)+ self.assertTrue(any("pairing host" in error for error in errors))+ self.assertTrue(any("removed action 'decide_action'" in error for error in errors))+++if __name__ == "__main__":+ unittest.main()diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.pyindex 330a62ff24..c1330fdde7 100644--- a/scripts/release_control/subsystem_lookup_test.py+++ b/scripts/release_control/subsystem_lookup_test.py@@ -2981,8 +2981,8 @@ class SubsystemLookupTest(unittest.TestCase):{"heading": "## Shared Boundaries","path": "internal/api/access_control_handlers.go",- "line": 1248,- "heading_line": 158,+ "line": 1268,+ "heading_line": 166,}],)