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
chore: seal Pulse Intelligence release gate
rcourtman8ffb56946ec3
diff --git a/docs/release-control/v6/internal/pulse-intelligence-release-gate.json b/docs/release-control/v6/internal/pulse-intelligence-release-gate.jsonindex 750c3c1684..cad0eb8427 100644--- a/docs/release-control/v6/internal/pulse-intelligence-release-gate.json+++ b/docs/release-control/v6/internal/pulse-intelligence-release-gate.json@@ -1,5 +1,5 @@{- "schema_version": 2,+ "schema_version": 3,"matrix_id": "pulse-intelligence-rg-01-rg-12","program": "pulse-intelligence","result_semantics": {@@ -15,6 +15,11 @@"physical-device","live-relay"],+ "triple_zero_semantics": {+ "persistence_writes": "Unauthorized or revoked requests persist no action, approval, or authority state.",+ "dispatch_attempts": "Unauthorized or revoked requests create no executor, outbox, or transport dispatch attempt.",+ "external_mutations": "Unauthorized or revoked requests change no provider, device, Relay, or infrastructure state."+ },"gates": [{"id": "RG-01",@@ -206,6 +211,7 @@"required_evidence_tier": "live-relay","requires_triple_zero": true,"allows_ancestor_provenance": false,+ "artifact_contract": "physical-live-relay-v1","non_mutating_proof_commands": [{"id": "rg-12-aggregate-verdict",diff --git a/docs/release-control/v6/internal/records/pulse-intelligence-rg-01-rg-12-external-e2e-2026-07-12.md b/docs/release-control/v6/internal/records/pulse-intelligence-rg-01-rg-12-external-e2e-2026-07-12.mdnew file mode 100644index 0000000000..7c373dfd61--- /dev/null+++ b/docs/release-control/v6/internal/records/pulse-intelligence-rg-01-rg-12-external-e2e-2026-07-12.md@@ -0,0 +1,29 @@+# Pulse Intelligence RG-01 through RG-12 external E2E record++Date: 2026-07-12++## Verdict++The closed RG-01 through RG-12 matrix reached independent GO for bounded limited autonomy at these exact implementation revisions:++- Pulse core: `a63b3eae2b5a62ee6803bfb4eee8fadbbba8e449`+- Pulse Mobile: `a1ddb451618664025d22a986fbd3fd837e4ffe97`++The proof set covers exact-revision unit and integration checks, Docker and Debian/Ubuntu Colima journeys, a clean Product Trust browser exercise, and physical-iPad behavior against the live Relay service. The physical exercise covered fresh pairing, notification registration, encrypted reconnect, canonical inert action detail, approval and denial, exact-token revocation, fail-closed reconnect behavior, and full temporary-state cleanup.++## Sealed evidence++- Physical iPad/live Relay artifact: `/Volumes/Development/.pulse-proof-artifacts/rg12-a63b3eae-a1ddb451-final-20260712T234230Z`+- Artifact `SHA256SUMS` SHA-256: `58778244cb370be4bf7bd74a8316a5bf4e8ec4dca23f08e45c5bc8cfec152397`+- Aggregate evidence: `/Volumes/Development/.pulse-proof-artifacts/pulse-intelligence-evidence-a63b3eae2b5a62ee6803bfb4eee8fadbbba8e449-final.json`+- Aggregate evidence SHA-256: `9992148c61420e527dab47fc33a49aecb4d757fe2030a40bff6656328566fa37`++The sealed artifact manifest verifies every included file. The aggregate evaluator binds the records to the audited core revision, requires the physical artifact descriptor, and validates its manifest, implementation revisions, inert action semantics, revocation barrier, cleanup state, physical test summaries, screenshots, and underlying result-bundle digests.++## Trust boundary++The approved and denied actions used canonical `target_type=test` and `executor=none`; neither action executed. The final action state had zero pending actions, dispatch attempts, outbox entries, and receipts. After the exact Relay token was revoked, protected requests returned HTTP 401 and the negative barrier remained canonical triple-zero: zero persistence writes, zero dispatch attempts, and zero external mutations.++Temporary Relay instance, device-token, connection-log, local action, audit, attempt, outbox, receipt, and token state were removed. The original Relay instance remained present. The iPad finished unpaired at onboarding, the environment was restored, and Colima was stopped.++Agent-executed RG06 and RG09 product outcomes remain `fix_verification_unknown`; independent Colima-control observations do not upgrade product verification. This GO certifies only the proved bounded capability set. It does not certify arbitrary infrastructure mutation, general MSP-scale autonomy, agent-native discovery, or operable onboarding and import planning.diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.jsonindex b2d96c9919..874f77e442 100644--- a/docs/release-control/v6/internal/status.json+++ b/docs/release-control/v6/internal/status.json@@ -3949,7 +3949,7 @@},{"id": "RA35",- "summary": "Passed unit and integration proof shows that covered Patrol mutation candidates use typed proposals and the canonical action lifecycle, while covered unsupported and raw-command paths fail closed. This does not certify final-SHA real-lab, browser, physical-device, or live-relay behavior; the aggregate Pulse Intelligence release gate remains blocked.",+ "summary": "The closed RG-01 through RG-12 matrix independently reached GO for bounded limited autonomy at core a63b3eae2b5a62ee6803bfb4eee8fadbbba8e449 and Pulse Mobile a1ddb451618664025d22a986fbd3fd837e4ffe97. Covered Patrol investigations remain read-only; supported mutation candidates use typed proposals and the canonical action lifecycle; unsupported and raw-command paths fail closed; exact-SHA Docker and Debian/Ubuntu labs, clean Product Trust browser proof, and a physical-iPad/live-Relay pairing, reconnect, inert decision, revocation, and cleanup journey passed. RG06/RG09 product outcomes remain agent-attested fix_verification_unknown even where separate Colima-control readback supplies independent facts. This assertion does not certify arbitrary infrastructure mutations, general MSP-scale autonomy, or broader L20 residuals.","kind": "invariant","blocking_level": "release-ready","proof_type": "hybrid",@@ -4058,6 +4058,18 @@}],"evidence": [+ {+ "repo": "pulse",+ "path": "docs/release-control/v6/internal/pulse-intelligence-release-gate.json",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse",+ "path": "docs/release-control/v6/internal/records/pulse-intelligence-rg-01-rg-12-external-e2e-2026-07-12.md",+ "kind": "file",+ "evidence_tier": "real-external-e2e"+ },{"repo": "pulse","path": "frontend-modern/src/features/actions/__tests__/aptActionPresentation.test.ts",@@ -4211,6 +4223,18 @@"path": "pkg/aicontracts/orchestrator_deps.go","kind": "file"},+ {+ "repo": "pulse",+ "path": "scripts/release_control/pulse_intelligence_gate.py",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse",+ "path": "scripts/release_control/pulse_intelligence_gate_test.py",+ "kind": "file",+ "evidence_tier": "test-proof"+ },{"repo": "pulse","path": "tests/integration/tests/78-monitor-first-patrol-workbench.spec.ts",@@ -6209,7 +6233,7 @@"status": "partial","completion": {"state": "bounded-residual",- "summary": "Action governance has a first-class typed lifecycle floor backed by unit and integration evidence: covered Patrol investigations are read-only, typed proposals cross shared planning, policy, approval, plan-hash, durable-delivery, audit, verification, and ActionResultV2 contracts, and covered raw or unsupported paths fail closed. Docker restart is the only implemented typed infrastructure vertical with an ancestor-bound Colima artifact; it is not certified against the final SHA. APT update and package-cache cleanup have typed fake-backed contracts but remain operationally open until disposable Debian and Ubuntu tier-6 evidence exists. Limited unattended autonomy remains NO-GO. Current continuity and fail-closed claims apply only to the passed unit and integration profiles, not to clean Product Trust browser, physical-device, live-relay, or final-SHA real-lab behavior. Task 10 remains the sole owner of execution, verification, evidence, compensation, and rollback truth. Task 12 owns the final RG-01 through RG-12 verdict, which remains blocked by RG-06, RG-08, RG-09, RG-11, and RG-12.",+ "summary": "Action governance has reached the bounded limited-autonomy floor. Covered Patrol investigations are read-only; typed proposals cross shared planning, policy, approval, plan-hash, durable delivery, audit, verification, and ActionResultV2 contracts; covered raw and unsupported paths fail closed. The exact audited core/mobile pair passed the closed RG-01 through RG-12 matrix, including Docker and Debian/Ubuntu Colima journeys, clean Product Trust browser proof, and physical-iPad/live-Relay pairing, notification registration, encrypted reconnect, inert approval and denial, exact-token revocation with HTTP 401, fail-closed UI, and complete cleanup. Agent-executed RG06/RG09 product outcomes remain honestly fix_verification_unknown; separate Colima-control observations do not upgrade product verification. Limited autonomy is GO only for this proved capability set. Arbitrary infrastructure mutations, general MSP-scale autonomy, agent-native discovery, operable onboarding/import planning, and the lane's existing post-RC hardening residuals remain outside this certification, so L20 stays partial with bounded residual tracking.","tracking": [{"kind": "lane-followup",@@ -7685,11 +7709,11 @@},{"id": "pulse-intelligence-rg-01-rg-12",- "summary": "Require the closed RG-01 through RG-12 Pulse Intelligence matrix to reach GO at the final Git SHA. Implemented unit and integration contracts do not substitute for missing Docker final-SHA lab/browser, Debian and Ubuntu APT tier-6, clean Product Trust Playwright, physical-device, or live-relay evidence.",+ "summary": "The closed RG-01 through RG-12 Pulse Intelligence matrix reached independent GO for bounded limited autonomy at core a63b3eae2b5a62ee6803bfb4eee8fadbbba8e449 and Pulse Mobile a1ddb451618664025d22a986fbd3fd837e4ffe97. Exact-SHA unit/integration, Docker and Debian/Ubuntu Colima, clean Product Trust browser, and physical-iPad/live-Relay proof are sealed by /Volumes/Development/.pulse-proof-artifacts/rg12-a63b3eae-a1ddb451-final-20260712T234230Z with SHA256SUMS hash 58778244cb370be4bf7bd74a8316a5bf4e8ec4dca23f08e45c5bc8cfec152397 and aggregate evidence /Volumes/Development/.pulse-proof-artifacts/pulse-intelligence-evidence-a63b3eae2b5a62ee6803bfb4eee8fadbbba8e449-final.json. This gate does not certify arbitrary infrastructure mutation or general MSP-scale autonomy.","owner": "task-12","blocking_level": "release-ready","minimum_evidence_tier": "real-external-e2e",- "status": "blocked",+ "status": "passed","verification_doc": "docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md","lane_ids": ["L6",@@ -7701,6 +7725,24 @@"path": "docs/release-control/v6/internal/pulse-intelligence-release-gate.json","kind": "file","evidence_tier": "test-proof"+ },+ {+ "repo": "pulse",+ "path": "docs/release-control/v6/internal/records/pulse-intelligence-rg-01-rg-12-external-e2e-2026-07-12.md",+ "kind": "file",+ "evidence_tier": "real-external-e2e"+ },+ {+ "repo": "pulse",+ "path": "scripts/release_control/pulse_intelligence_gate.py",+ "kind": "file",+ "evidence_tier": "test-proof"+ },+ {+ "repo": "pulse",+ "path": "scripts/release_control/pulse_intelligence_gate_test.py",+ "kind": "file",+ "evidence_tier": "test-proof"}]},@@ -8071,7 +8113,7 @@},{"id": "action-governance-auditability-post-rc-hardening",- "summary": "Task 07 durable delivery and generic agent-operation receipts are accepted: transactional dispatch admission, one-shot send CAS, immutable attempt/action/operation/digest/agent binding, query-only restart reconciliation, strict sanitized terminal envelopes, and permanent replay-denial tombstones. Task 09 consumes that owner for both APT workflows and completes the fake-only detector-to-finding, exact empty-parameter proposal, shared policy/approval, typed dispatch, delayed/callback-loss/reopened-server receipt reconciliation, ActionResultV2 truth, terminal audit, and finding reconciliation floor without blind resend. Task 11 adds the desktop/browser tier-5 Product Trust consumer: bounded command/path/package-free Patrol evidence; exact empty parameter and elevated-versus-low-risk review; separate execution, evidence-sourced verification, and recovery cards; agent-attested confirmed updates; reboot fact without reboot authority; partial/unknown-health recovery; measured irreversible cleanup; and one durable receipt across reconnect, all exercised in current-build Chromium and a 390-pixel viewport with fake typed API fixtures only. Malformed phases, counts, timestamps, usage, or cleanup arithmetic fail closed. Task 10 remains sole owner of execution, verification, evidence, compensation, and rollback truth. Claims 16 and 17 and both workflow scorecards remain operationally open until disposable Debian/Ubuntu tier-6 proof and Task 12 final-SHA certification pass. Mobile/relay, physical-device, MSP aggregation, and real-lab proof remain separate. Raw model command, file write, arbitrary pod exec, legacy run_command, /api/ai/run-command, and enterprise command remediation remain retired with no replacement or executable historical authority.",+ "summary": "Task 07 durable delivery and generic agent-operation receipts are accepted: transactional dispatch admission, one-shot send CAS, immutable attempt/action/operation/digest/agent binding, query-only restart reconciliation, strict sanitized terminal envelopes, and permanent replay-denial tombstones. Task 09 consumes that owner for both APT workflows and completes the detector-to-finding, exact empty-parameter proposal, shared policy/approval, typed dispatch, delayed/callback-loss/reopened-server receipt reconciliation, ActionResultV2 truth, terminal audit, and finding reconciliation floor without blind resend. Task 11 adds the desktop/browser tier-5 Product Trust consumer: bounded command/path/package-free Patrol evidence; exact empty parameter and elevated-versus-low-risk review; separate execution, evidence-sourced verification, and recovery cards; agent-attested confirmed updates; reboot fact without reboot authority; partial/unknown-health recovery; measured irreversible cleanup; and one durable receipt across reconnect, all exercised in current-build Chromium and a 390-pixel viewport. Malformed phases, counts, timestamps, usage, or cleanup arithmetic fail closed. The closed RG-01 through RG-12 matrix now supplies the disposable Debian/Ubuntu tier-6, Docker, browser, physical-device, live-Relay, revocation, cleanup, and independent Task 12 proof that previously kept claims 16 and 17 and both workflow scorecards operationally open. Task 10 remains sole owner of execution, verification, evidence, compensation, and rollback truth, and RG06/RG09 product outcomes remain agent-attested fix_verification_unknown. This follow-up now tracks only broader post-RC auditability beyond the proved bounded capability set, including additional operation and platform coverage, deeper compensation and rollback proof, and MSP or fleet aggregation; it does not reopen the accepted matrix. Raw model command, file write, arbitrary pod exec, legacy run_command, /api/ai/run-command, and enterprise command remediation remain retired with no replacement or executable historical authority.","owner": "project-owner","status": "planned","recorded_at": "2026-04-25",diff --git a/scripts/release_control/pulse_intelligence_gate.py b/scripts/release_control/pulse_intelligence_gate.pyindex 3285a37b4a..3e82c93019 100644--- a/scripts/release_control/pulse_intelligence_gate.py+++ b/scripts/release_control/pulse_intelligence_gate.py@@ -9,6 +9,7 @@ This program never executes proof or mutation-gated commands.from __future__ import annotationsimport argparse+import hashlibimport jsonimport reimport subprocess@@ -47,6 +48,22 @@ KIND_MAX_TIER = {"live-relay-artifact": "live-relay",}SHA_RE = re.compile(r"^[0-9a-f]{40}$")+SHA256_RE = re.compile(r"^[0-9a-f]{64}$")+TRIPLE_ZERO_FIELDS = ("persistence_writes", "dispatch_attempts", "external_mutations")+TRIPLE_ZERO_SEMANTICS = {+ "persistence_writes": "Unauthorized or revoked requests persist no action, approval, or authority state.",+ "dispatch_attempts": "Unauthorized or revoked requests create no executor, outbox, or transport dispatch attempt.",+ "external_mutations": "Unauthorized or revoked requests change no provider, device, Relay, or infrastructure state.",+}+RG12_ARTIFACT_CONTRACT = "physical-live-relay-v1"+RG12_PROOF_NAMES = (+ "fresh-pairing",+ "notifications",+ "relaunch-reconnect",+ "action-detail-r3",+ "revoked-access-r3",+ "unpaired-cleanup",+)class MatrixError(ValueError):@@ -115,12 +132,20 @@ def validate_matrix(payload: Any) -> dict[str, Any]:root = _object(payload, "matrix")_exact_keys(root,- {"schema_version", "matrix_id", "program", "result_semantics", "evidence_tiers", "gates"},+ {+ "schema_version",+ "matrix_id",+ "program",+ "result_semantics",+ "evidence_tiers",+ "triple_zero_semantics",+ "gates",+ },set(),"matrix",)- if root["schema_version"] != 2:- raise MatrixError("matrix.schema_version must be 2")+ if root["schema_version"] != 3:+ raise MatrixError("matrix.schema_version must be 3")if root["matrix_id"] != "pulse-intelligence-rg-01-rg-12":raise MatrixError("matrix.matrix_id is not the canonical Pulse Intelligence matrix")if root["program"] != "pulse-intelligence":@@ -133,6 +158,8 @@ def validate_matrix(payload: Any) -> dict[str, Any]:raise MatrixError("matrix.result_semantics must define the canonical PASS/FAIL/NOT_RUN meanings")if tuple(root["evidence_tiers"]) != EVIDENCE_TIERS:raise MatrixError("matrix.evidence_tiers must contain the canonical ordered tiers")+ if root["triple_zero_semantics"] != TRIPLE_ZERO_SEMANTICS:+ raise MatrixError("matrix.triple_zero_semantics must define the canonical persistence/dispatch/external oracle")gates = _array(root["gates"], "matrix.gates")gate_ids: list[str] = []@@ -152,7 +179,7 @@ def validate_matrix(payload: Any) -> dict[str, Any]:"non_mutating_proof_commands","mutation_gated_commands",},- set(),+ {"artifact_contract"},context,)gate_id = _string(gate["id"], f"{context}.id")@@ -165,6 +192,12 @@ def validate_matrix(payload: Any) -> dict[str, Any]:for field in ("requires_triple_zero", "allows_ancestor_provenance"):if not isinstance(gate[field], bool):raise MatrixError(f"{gate_id}.{field} must be boolean")+ artifact_contract = gate.get("artifact_contract")+ if artifact_contract is not None:+ if gate_id != "RG-12" or artifact_contract != RG12_ARTIFACT_CONTRACT:+ raise MatrixError(f"{gate_id}.artifact_contract is invalid")+ if gate_id == "RG-12" and gate["required_evidence_tier"] == "live-relay" and artifact_contract != RG12_ARTIFACT_CONTRACT:+ raise MatrixError(f"RG-12.artifact_contract must be {RG12_ARTIFACT_CONTRACT!r}")proof_commands = _array(gate["non_mutating_proof_commands"], f"{context}.non_mutating_proof_commands")if not proof_commands:raise MatrixError(f"{gate_id} must declare at least one non-mutating proof command")@@ -206,8 +239,8 @@ def _gate_command_ids(gate: dict[str, Any]) -> set[str]:def validate_evidence(payload: Any, matrix: dict[str, Any]) -> dict[str, Any]:root = _object(payload, "evidence")_exact_keys(root, {"schema_version", "matrix_id", "audited_git_sha", "records"}, set(), "evidence")- if root["schema_version"] != 1:- raise MatrixError("evidence.schema_version must be 1")+ if root["schema_version"] != 2:+ raise MatrixError("evidence.schema_version must be 2")if root["matrix_id"] != matrix["matrix_id"]:raise MatrixError("evidence.matrix_id does not match the selected matrix")_full_sha(root["audited_git_sha"], "evidence.audited_git_sha")@@ -219,7 +252,7 @@ def validate_evidence(payload: Any, matrix: dict[str, Any]) -> dict[str, Any]:_exact_keys(record,{"id", "gate_id", "result", "tier", "kind", "git_sha", "command_id"},- {"triple_zero", "note"},+ {"triple_zero", "artifact", "note"},context,)record_id = _string(record["id"], f"{context}.id")@@ -246,15 +279,262 @@ def validate_evidence(payload: Any, matrix: dict[str, Any]) -> dict[str, Any]:triple_zero = _object(record["triple_zero"], f"{context}.triple_zero")_exact_keys(triple_zero,- {"unauthorized_mutations", "transport_dispatches", "authority_writes"},+ set(TRIPLE_ZERO_FIELDS),set(),f"{context}.triple_zero",)if any(not isinstance(value, int) or isinstance(value, bool) or value < 0 for value in triple_zero.values()):raise MatrixError(f"{context}.triple_zero values must be non-negative integers")+ if "artifact" in record:+ if gate_id != "RG-12":+ raise MatrixError(f"{context}.artifact is only valid for RG-12")+ artifact = _object(record["artifact"], f"{context}.artifact")+ _exact_keys(+ artifact,+ {"contract", "path", "sha256sums_sha256", "mobile_git_sha"},+ set(),+ f"{context}.artifact",+ )+ if artifact["contract"] != RG12_ARTIFACT_CONTRACT:+ raise MatrixError(f"{context}.artifact.contract is invalid")+ _string(artifact["path"], f"{context}.artifact.path")+ digest = _string(artifact["sha256sums_sha256"], f"{context}.artifact.sha256sums_sha256")+ if not SHA256_RE.fullmatch(digest):+ raise MatrixError(f"{context}.artifact.sha256sums_sha256 must be a lowercase SHA-256")+ _full_sha(artifact["mobile_git_sha"], f"{context}.artifact.mobile_git_sha")return root+def _read_json(path: Path, context: str) -> dict[str, Any] | list[Any]:+ try:+ return json.loads(path.read_text(encoding="utf-8"))+ except (OSError, json.JSONDecodeError) as exc:+ raise MatrixError(f"{context} is unreadable: {exc}") from exc+++def _sha256_file(path: Path) -> str:+ digest = hashlib.sha256()+ with path.open("rb") as handle:+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):+ digest.update(chunk)+ return digest.hexdigest()+++def _validate_rg12_manifest(root: Path, expected_manifest_digest: str) -> None:+ manifest = root / "SHA256SUMS"+ if not manifest.is_file() or _sha256_file(manifest) != expected_manifest_digest:+ raise MatrixError("RG-12 SHA256SUMS is absent or does not match the evidence record")+ declared: dict[str, str] = {}+ for line_number, line in enumerate(manifest.read_text(encoding="utf-8").splitlines(), 1):+ match = re.fullmatch(r"([0-9a-f]{64}) (.+)", line)+ if match is None:+ raise MatrixError(f"RG-12 SHA256SUMS line {line_number} is malformed")+ digest, relative_text = match.groups()+ relative = Path(relative_text)+ if relative.is_absolute() or ".." in relative.parts or relative_text == "SHA256SUMS":+ raise MatrixError(f"RG-12 SHA256SUMS line {line_number} has an unsafe path")+ if relative_text in declared:+ raise MatrixError(f"RG-12 SHA256SUMS repeats {relative_text!r}")+ declared[relative_text] = digest+ actual = {+ str(candidate.relative_to(root))+ for candidate in root.rglob("*")+ if candidate.is_file() and candidate != manifest+ }+ if set(declared) != actual:+ missing = sorted(actual - set(declared))+ stale = sorted(set(declared) - actual)+ raise MatrixError(f"RG-12 SHA256SUMS coverage mismatch; missing={missing}, stale={stale}")+ for relative_text, expected in declared.items():+ if _sha256_file(root / relative_text) != expected:+ raise MatrixError(f"RG-12 artifact checksum mismatch for {relative_text}")+++def _zero(value: Any, context: str) -> None:+ if value != 0:+ raise MatrixError(f"{context} must be zero")+++def _validate_rg12_action_semantics(root: Path, environment: dict[str, Any]) -> None:+ action_ids = environment.get("action_ids")+ if not isinstance(action_ids, list) or len(action_ids) != 2 or any(not isinstance(value, str) or not value for value in action_ids):+ raise MatrixError("RG-12 environment.action_ids must identify exactly two actions")+ action_id_set = set(action_ids)+ if len(action_id_set) != 2:+ raise MatrixError("RG-12 environment.action_ids must be unique")++ api = _object(_read_json(root / "canonical-action-api.json", "RG-12 canonical action API"), "RG-12 canonical action API")+ if api.get("approve_http_status") != 200 or api.get("deny_http_status") != 200 or api.get("matching_pending_after_count") != 0:+ raise MatrixError("RG-12 canonical decisions must return 200 and leave zero matching pending actions")+ for name, expected_state, expected_outcome in (+ ("approve", "approved", "approved"),+ ("deny", "rejected", "rejected"),+ ):+ decision = _object(api.get(name), f"RG-12 {name}")+ if decision.get("state") != expected_state or decision.get("execute_endpoint_called") is not False:+ raise MatrixError(f"RG-12 {name} state or execute boundary is invalid")+ approval = _object(decision.get("approval"), f"RG-12 {name}.approval")+ audit = _object(decision.get("audit"), f"RG-12 {name}.audit")+ request = _object(audit.get("request"), f"RG-12 {name}.audit.request")+ params = _object(request.get("params"), f"RG-12 {name}.audit.request.params")+ if approval.get("outcome") != expected_outcome or decision.get("actionId") not in action_id_set:+ raise MatrixError(f"RG-12 {name} decision correlation is invalid")+ if params.get("target_type") != "test" or params.get("executor") != "none":+ raise MatrixError(f"RG-12 {name} is not an inert target_type=test action")++ store = _object(_read_json(root / "action-store-observations.json", "RG-12 action store"), "RG-12 action store")+ for field in ("dispatch_attempts", "dispatch_outbox", "dispatch_receipts"):+ _zero(store.get(field), f"RG-12 action store {field}")+ records = _array(store.get("records"), "RG-12 action store records")+ decision_records = [+ record+ for record in records+ if isinstance(record, dict) and record.get("id") in action_id_set+ ]+ if {record.get("id") for record in decision_records} != action_id_set:+ raise MatrixError("RG-12 action-store records do not match the correlated action IDs")+ if {record.get("state") for record in decision_records} != {"approved", "rejected"}:+ raise MatrixError("RG-12 action-store records do not contain one approval and one rejection")+ if any(+ record.get("target_type") != "test" or record.get("executor") != "none"+ for record in decision_records+ ):+ raise MatrixError("RG-12 action-store records are not inert test actions")+ barrier_records = [+ record+ for record in records+ if isinstance(record, dict) and record.get("id") == environment.get("revoked_barrier_action_id")+ ]+ if len(barrier_records) != 1 or barrier_records[0].get("state") != "pending_approval":+ raise MatrixError("RG-12 action store does not preserve the revoked pending barrier")+++def _validate_rg12_revocation_and_cleanup(root: Path, environment: dict[str, Any]) -> None:+ barrier = _object(_read_json(root / "revocation-negative-barrier.json", "RG-12 revocation barrier"), "RG-12 revocation barrier")+ if barrier.get("token_delete_http_status") != 204:+ raise MatrixError("RG-12 exact token deletion did not return 204")+ if barrier.get("post_revoke_pending_http_status") != 401 or barrier.get("post_revoke_decision_http_status") != 401:+ raise MatrixError("RG-12 revoked token did not fail closed with HTTP 401")+ if barrier.get("admin_bypass_enabled") is not False:+ raise MatrixError("RG-12 revocation barrier was not run with admin bypass disabled")+ triple_zero = _object(barrier.get("triple_zero"), "RG-12 revocation triple-zero")+ if triple_zero != {field: 0 for field in TRIPLE_ZERO_FIELDS}:+ raise MatrixError("RG-12 revocation barrier does not prove canonical triple zero")+ residue = _object(barrier.get("transport_residue"), "RG-12 revocation transport residue")+ for field in ("dispatch_outbox", "dispatch_receipts"):+ _zero(residue.get(field), f"RG-12 revocation {field}")+ before = _array(barrier.get("before"), "RG-12 revocation before")+ after = _array(barrier.get("after"), "RG-12 revocation after")+ if len(before) != 1 or len(after) != 1:+ raise MatrixError("RG-12 revocation barrier must contain one before and after record")+ expected_id = environment.get("revoked_barrier_action_id")+ for record in (before[0], after[0]):+ record = _object(record, "RG-12 revocation record")+ if record.get("id") != expected_id or record.get("state") != "pending_approval" or record.get("decision_revision", record.get("decisionRevision")) != 0:+ raise MatrixError("RG-12 revoked request changed the pending barrier action")++ cleanup = _object(_read_json(root / "cleanup.json", "RG-12 cleanup"), "RG-12 cleanup")+ for field in (+ "temporary_api_token_present_after",+ "temporary_license_activation_files_present_after",+ ):+ if cleanup.get(field) is not False:+ raise MatrixError(f"RG-12 cleanup {field} must be false")+ for field in ("local_environment_restored_from_pre_run_backup", "ipad_local_pairing_removed"):+ if cleanup.get(field) is not True:+ raise MatrixError(f"RG-12 cleanup {field} must be true")+ relay_after = _array(cleanup.get("relay_after"), "RG-12 relay cleanup")+ counts = {+ entry.get("surface"): entry.get("temp_count")+ for entry in relay_after+ if isinstance(entry, dict)+ }+ if counts != {"instances": 0, "device_tokens": 0, "connection_log": 0, "original_preserved": 1}:+ raise MatrixError("RG-12 Relay cleanup did not remove temporary state while preserving the original instance")+ for document in _array(cleanup.get("local_action_store_after"), "RG-12 local action cleanup"):+ rows = _array(document, "RG-12 local action cleanup document")+ for row in rows:+ row = _object(row, "RG-12 local action cleanup row")+ for value in row.values():+ _zero(value, "RG-12 local action residue")+++def _validate_rg12_mobile_proofs(root: Path) -> None:+ digest_records = _array(_read_json(root / "xcresult-digests.json", "RG-12 xcresult digests"), "RG-12 xcresult digests")+ by_name = {+ record.get("proof"): record+ for record in digest_records+ if isinstance(record, dict)+ }+ if set(by_name) != set(RG12_PROOF_NAMES):+ raise MatrixError("RG-12 xcresult digests do not cover the exact physical proof sequence")+ for proof_name in RG12_PROOF_NAMES:+ proof_dir = root / "mobile-proofs" / proof_name+ summary = _object(_read_json(proof_dir / "test-summary.json", f"RG-12 {proof_name} summary"), f"RG-12 {proof_name} summary")+ if summary.get("result") != "Passed" or not isinstance(summary.get("totalTestCount"), int) or summary["totalTestCount"] < 1:+ raise MatrixError(f"RG-12 {proof_name} did not record a passed physical test")+ failed_tests = summary.get("failedTests")+ if failed_tests not in (0, []):+ raise MatrixError(f"RG-12 {proof_name} contains failed tests")+ screenshots = list((proof_dir / "attachments").glob("*.png"))+ if not screenshots:+ raise MatrixError(f"RG-12 {proof_name} has no sealed screenshot")++ record = _object(by_name[proof_name], f"RG-12 {proof_name} xcresult digest")+ members = _array(record.get("members"), f"RG-12 {proof_name} xcresult members")+ if record.get("file_count") != len(members) or not members:+ raise MatrixError(f"RG-12 {proof_name} xcresult member count is invalid")+ lines: list[str] = []+ member_paths: set[str] = set()+ for member in members:+ member = _object(member, f"RG-12 {proof_name} xcresult member")+ member_path = _string(member.get("path"), f"RG-12 {proof_name} xcresult member path")+ member_digest = _string(member.get("sha256"), f"RG-12 {proof_name} xcresult member digest")+ if member_path in member_paths or not SHA256_RE.fullmatch(member_digest):+ raise MatrixError(f"RG-12 {proof_name} xcresult member manifest is invalid")+ member_paths.add(member_path)+ lines.append(f"{member_digest} {member_path}\n")+ aggregate = hashlib.sha256("".join(lines).encode()).hexdigest()+ if record.get("aggregate_sha256") != aggregate:+ raise MatrixError(f"RG-12 {proof_name} xcresult aggregate digest is invalid")+ source = Path(_string(record.get("source"), f"RG-12 {proof_name} xcresult source")).resolve()+ if not source.is_dir():+ raise MatrixError(f"RG-12 {proof_name} xcresult source is unavailable")+ source_members = {+ str(candidate.relative_to(source)): _sha256_file(candidate)+ for candidate in source.rglob("*")+ if candidate.is_file()+ }+ expected_members = {member["path"]: member["sha256"] for member in members}+ if source_members != expected_members:+ raise MatrixError(f"RG-12 {proof_name} underlying xcresult no longer matches its sealed digest")+++def _validate_rg12_artifact(record: dict[str, Any], audited_sha: str) -> None:+ descriptor = _object(record.get("artifact"), "RG-12 evidence artifact")+ root = Path(_string(descriptor.get("path"), "RG-12 evidence artifact path")).resolve()+ if not root.is_dir():+ raise MatrixError("RG-12 evidence artifact directory is unavailable")+ _validate_rg12_manifest(root, descriptor["sha256sums_sha256"])+ environment = _object(_read_json(root / "environment.json", "RG-12 environment"), "RG-12 environment")+ if environment.get("core_sha") != audited_sha or environment.get("mobile_sha") != descriptor["mobile_git_sha"]:+ raise MatrixError("RG-12 artifact core/mobile SHA binding is invalid")+ if environment.get("credential_material_in_bundle") is not False:+ raise MatrixError("RG-12 artifact may not contain credential material")+ correlation = _object(_read_json(root / "correlation.json", "RG-12 correlation"), "RG-12 correlation")+ for field in ("core_sha", "mobile_sha", "action_ids", "token_record_id"):+ expected = environment.get(field if field != "token_record_id" else "temporary_token_record_id")+ if correlation.get(field) != expected:+ raise MatrixError(f"RG-12 correlation.{field} does not match environment")+ if correlation.get("target_type") != "test" or correlation.get("executor") != "none":+ raise MatrixError("RG-12 correlation does not bind an inert test action")+ if tuple(correlation.get("physical_proof_sequence", ())) != RG12_PROOF_NAMES:+ raise MatrixError("RG-12 physical proof sequence is incomplete")+ _validate_rg12_action_semantics(root, environment)+ _validate_rg12_revocation_and_cleanup(root, environment)+ _validate_rg12_mobile_proofs(root)++def evaluate_matrix(matrix: dict[str, Any],audited_sha: str,@@ -313,11 +593,22 @@ def evaluate_matrix(continueif any(triple_zero[field] != 0- for field in ("unauthorized_mutations", "transport_dispatches", "authority_writes")+ for field in TRIPLE_ZERO_FIELDS):failed = Truedetails.append(f"{gate_id} evidence {record['id']} does not prove triple zero")continue+ if gate_id == "RG-12" and gate.get("artifact_contract") == RG12_ARTIFACT_CONTRACT:+ if record.get("artifact") is None:+ failed = True+ details.append(f"RG-12 evidence {record['id']} is missing the required sealed artifact descriptor")+ continue+ try:+ _validate_rg12_artifact(record, audited_sha)+ except MatrixError as exc:+ failed = True+ details.append(f"RG-12 evidence {record['id']} artifact validation failed: {exc}")+ continuequalifying = Trueif failed:results[gate_id] = "FAIL"diff --git a/scripts/release_control/pulse_intelligence_gate_test.py b/scripts/release_control/pulse_intelligence_gate_test.pyindex fec236bac9..105a5dd963 100644--- a/scripts/release_control/pulse_intelligence_gate_test.py+++ b/scripts/release_control/pulse_intelligence_gate_test.py@@ -4,7 +4,9 @@from __future__ import annotationsimport json+import hashlibimport re+import tempfileimport unittestfrom pathlib import Path@@ -14,6 +16,135 @@ import pulse_intelligence_gate as gateSHA = "1" * 40NEXT_SHA = "2" * 40ANCESTOR_SHA = "3" * 40+MOBILE_SHA = "4" * 40+++def write_json(path: Path, payload: object) -> None:+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")+++def create_rg12_artifact(root: Path, audited_sha: str) -> dict[str, str]:+ action_ids = ["approve-action", "deny-action"]+ environment = {+ "core_sha": audited_sha,+ "mobile_sha": MOBILE_SHA,+ "action_ids": action_ids,+ "revoked_barrier_action_id": "revoked-barrier",+ "temporary_token_record_id": "temporary-token",+ "credential_material_in_bundle": False,+ }+ write_json(root / "environment.json", environment)+ write_json(+ root / "correlation.json",+ {+ "core_sha": audited_sha,+ "mobile_sha": MOBILE_SHA,+ "action_ids": action_ids,+ "token_record_id": "temporary-token",+ "target_type": "test",+ "executor": "none",+ "physical_proof_sequence": list(gate.RG12_PROOF_NAMES),+ },+ )++ def decision(action_id: str, state: str, outcome: str) -> dict[str, object]:+ return {+ "actionId": action_id,+ "state": state,+ "execute_endpoint_called": False,+ "approval": {"outcome": outcome},+ "audit": {"request": {"params": {"target_type": "test", "executor": "none"}}},+ }++ write_json(+ root / "canonical-action-api.json",+ {+ "approve_http_status": 200,+ "deny_http_status": 200,+ "matching_pending_after_count": 0,+ "approve": decision(action_ids[0], "approved", "approved"),+ "deny": decision(action_ids[1], "rejected", "rejected"),+ },+ )+ write_json(+ root / "action-store-observations.json",+ {+ "records": [+ {"id": action_ids[0], "state": "approved", "target_type": "test", "executor": "none"},+ {"id": action_ids[1], "state": "rejected", "target_type": "test", "executor": "none"},+ {"id": "revoked-barrier", "state": "pending_approval", "target_type": "test", "executor": "none"},+ ],+ "dispatch_attempts": 0,+ "dispatch_outbox": 0,+ "dispatch_receipts": 0,+ },+ )+ barrier = {"id": "revoked-barrier", "state": "pending_approval", "decision_revision": 0}+ write_json(+ root / "revocation-negative-barrier.json",+ {+ "token_delete_http_status": 204,+ "post_revoke_pending_http_status": 401,+ "post_revoke_decision_http_status": 401,+ "admin_bypass_enabled": False,+ "before": [barrier],+ "after": [barrier],+ "triple_zero": {field: 0 for field in gate.TRIPLE_ZERO_FIELDS},+ "transport_residue": {"dispatch_outbox": 0, "dispatch_receipts": 0},+ },+ )+ write_json(+ root / "cleanup.json",+ {+ "relay_after": [+ {"surface": "instances", "temp_count": 0},+ {"surface": "device_tokens", "temp_count": 0},+ {"surface": "connection_log", "temp_count": 0},+ {"surface": "original_preserved", "temp_count": 1},+ ],+ "local_action_store_after": [[{"temp_action_audits": 0}], [{"temp_events": 0}]],+ "temporary_api_token_present_after": False,+ "local_environment_restored_from_pre_run_backup": True,+ "temporary_license_activation_files_present_after": False,+ "ipad_local_pairing_removed": True,+ },+ )++ digest_records: list[dict[str, object]] = []+ for proof_name in gate.RG12_PROOF_NAMES:+ proof_dir = root / "mobile-proofs" / proof_name+ write_json(+ proof_dir / "test-summary.json",+ {"result": "Passed", "totalTestCount": 1, "failedTests": []},+ )+ (proof_dir / "attachments").mkdir(parents=True)+ (proof_dir / "attachments" / "proof.png").write_bytes(b"png")+ source = root.parent / f"{proof_name}.xcresult"+ source.mkdir()+ (source / "member.bin").write_bytes(proof_name.encode())+ member_digest = hashlib.sha256(proof_name.encode()).hexdigest()+ line = f"{member_digest} member.bin\n"+ digest_records.append(+ {+ "proof": proof_name,+ "source": str(source),+ "file_count": 1,+ "aggregate_sha256": hashlib.sha256(line.encode()).hexdigest(),+ "members": [{"path": "member.bin", "sha256": member_digest}],+ }+ )+ write_json(root / "xcresult-digests.json", digest_records)+ files = sorted(candidate for candidate in root.rglob("*") if candidate.is_file())+ lines = [f"{hashlib.sha256(candidate.read_bytes()).hexdigest()} {candidate.relative_to(root)}" for candidate in files]+ manifest = root / "SHA256SUMS"+ manifest.write_text("\n".join(lines) + "\n", encoding="utf-8")+ return {+ "contract": gate.RG12_ARTIFACT_CONTRACT,+ "path": str(root),+ "sha256sums_sha256": hashlib.sha256(manifest.read_bytes()).hexdigest(),+ "mobile_git_sha": MOBILE_SHA,+ }def valid_matrix() -> dict[str, object]:@@ -34,7 +165,7 @@ def valid_matrix() -> dict[str, object]:})return {- "schema_version": 2,+ "schema_version": 3,"matrix_id": "pulse-intelligence-rg-01-rg-12","program": "pulse-intelligence","result_semantics": {@@ -43,6 +174,7 @@ def valid_matrix() -> dict[str, object]:"NOT_RUN": "No qualifying external evidence exists for the gate at the audited Git SHA.",},"evidence_tiers": list(gate.EVIDENCE_TIERS),+ "triple_zero_semantics": dict(gate.TRIPLE_ZERO_SEMANTICS),"gates": gates,}@@ -69,13 +201,13 @@ def evidence_for(matrix: dict[str, object], audited_sha: str) -> dict[str, objec}if item["requires_triple_zero"]:record["triple_zero"] = {- "unauthorized_mutations": 0,- "transport_dispatches": 0,- "authority_writes": 0,+ "persistence_writes": 0,+ "dispatch_attempts": 0,+ "external_mutations": 0,}records.append(record)return {- "schema_version": 1,+ "schema_version": 2,"matrix_id": matrix["matrix_id"],"audited_git_sha": audited_sha,"records": records,@@ -172,6 +304,47 @@ class PulseIntelligenceGateTest(unittest.TestCase):self.assertEqual(evaluation.gate_results["RG-01"], "FAIL")self.assertTrue(any("missing required triple-zero" in detail for detail in evaluation.details))+ def test_live_relay_rg12_requires_semantically_valid_sealed_artifact(self) -> None:+ payload = valid_matrix()+ rg12 = payload["gates"][11]+ rg12["required_evidence_tier"] = "live-relay"+ rg12["artifact_contract"] = gate.RG12_ARTIFACT_CONTRACT+ matrix = gate.validate_matrix(payload)+ evidence_payload = evidence_for(matrix, SHA)+ evidence_payload["records"][11]["tier"] = "live-relay"+ evidence_payload["records"][11]["kind"] = "live-relay-artifact"++ missing = gate.validate_evidence(evidence_payload, matrix)+ missing_evaluation = gate.evaluate_matrix(matrix, SHA, missing)+ self.assertEqual(missing_evaluation.gate_results["RG-12"], "FAIL")+ self.assertTrue(any("missing the required sealed artifact descriptor" in detail for detail in missing_evaluation.details))++ with tempfile.TemporaryDirectory() as temp_dir:+ artifact = create_rg12_artifact(Path(temp_dir) / "sealed", SHA)+ evidence_payload["records"][11]["artifact"] = artifact+ evidence = gate.validate_evidence(evidence_payload, matrix)+ evaluation = gate.evaluate_matrix(matrix, SHA, evidence)+ self.assertEqual(evaluation.gate_results["RG-12"], "PASS")+ self.assertEqual(evaluation.verdict, "GO")++ def test_rg12_artifact_checksum_tampering_fails_closed(self) -> None:+ payload = valid_matrix()+ rg12 = payload["gates"][11]+ rg12["required_evidence_tier"] = "live-relay"+ rg12["artifact_contract"] = gate.RG12_ARTIFACT_CONTRACT+ matrix = gate.validate_matrix(payload)+ evidence_payload = evidence_for(matrix, SHA)+ evidence_payload["records"][11]["tier"] = "live-relay"+ evidence_payload["records"][11]["kind"] = "live-relay-artifact"+ with tempfile.TemporaryDirectory() as temp_dir:+ root = Path(temp_dir) / "sealed"+ evidence_payload["records"][11]["artifact"] = create_rg12_artifact(root, SHA)+ (root / "cleanup.json").write_text("{}\n", encoding="utf-8")+ evidence = gate.validate_evidence(evidence_payload, matrix)+ evaluation = gate.evaluate_matrix(matrix, SHA, evidence)+ self.assertEqual(evaluation.gate_results["RG-12"], "FAIL")+ self.assertTrue(any("checksum mismatch" in detail for detail in evaluation.details))+def test_repository_matrix_schema_is_deterministic_and_requirement_only(self) -> None:matrix_path = Path(__file__).resolve().parents[2] / "docs/release-control/v6/internal/pulse-intelligence-release-gate.json"matrix_text = matrix_path.read_text(encoding="utf-8")@@ -181,10 +354,12 @@ class PulseIntelligenceGateTest(unittest.TestCase):self.assertEqual(first, second)self.assertNotIn("evaluation_git_sha", first)self.assertNotIn("overall_result", first)+ self.assertEqual(first["triple_zero_semantics"], gate.TRIPLE_ZERO_SEMANTICS)self.assertIsNone(re.search(r"\b[0-9a-f]{40}\b", matrix_text))for item in first["gates"]:self.assertNotIn("result", item)self.assertNotIn("evidence", item)+ self.assertEqual(first["gates"][11]["artifact_contract"], gate.RG12_ARTIFACT_CONTRACT)if __name__ == "__main__":