Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

ci(cua-driver): keep Jev credentials outside Actions

Francesco Bonaccia5f18829df02
diff --git a/.github/scripts/tests/test_authorized_live_jev_use_demo.py b/.github/scripts/tests/test_authorized_live_jev_use_demo.py
index 7788b9e5f3..70edfa7984 100644
--- a/.github/scripts/tests/test_authorized_live_jev_use_demo.py
+++ b/.github/scripts/tests/test_authorized_live_jev_use_demo.py
@@ -1,4 +1,4 @@
-"""Static security contracts for the review-gated live Jev visual demo."""
+"""Static security contracts for the review-gated candidate Jev visual demo."""
from pathlib import Path
import re
@@ -25,6 +25,22 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
cls.triggers = cls.workflow.get("on", cls.workflow.get(True))
cls.jobs = cls.workflow["jobs"]
+ def candidate_steps(self):
+ return self.jobs["candidate"]["steps"]
+
+ def candidate_text(self):
+ return "\n".join(step.get("run", "") for step in self.candidate_steps())
+
+ def test_workflow_is_credential_free(self):
+ self.assertNotIn("TYPESAFE_API_KEY", self.text)
+ self.assertNotIn("${{ secrets.", self.text)
+ self.assertNotIn("run_live", self.text)
+ self.assertNotIn("RUN_LIVE_ACKNOWLEDGED", self.text)
+ self.assertNotIn("jev-use-live", self.text)
+ for job_name in ("source", "mock-preflight"):
+ self.assertNotIn("environment", self.jobs[job_name])
+ self.assertNotIn("TYPESAFE_API_KEY", str(self.jobs[job_name]))
+
def test_is_manual_or_callable_with_open_source_head_and_merged_jev_commit(self):
self.assertEqual(set(self.triggers), {"workflow_dispatch", "workflow_call"})
dispatch_inputs = self.triggers["workflow_dispatch"]["inputs"]
@@ -35,7 +51,6 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertEqual(
set(trigger["inputs"]),
{
- "run_live",
"source_pr_number",
"source_sha",
"jev_pr_number",
@@ -47,13 +62,8 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
},
)
self.assertTrue(all(value["required"] for value in trigger["inputs"].values()))
- self.assertEqual(trigger["inputs"]["run_live"]["type"], "boolean")
source = self.jobs["source"]["steps"][0]["run"]
- self.assertIn('[[ "$RUN_LIVE_ACKNOWLEDGED" == true ]]', source)
- self.assertEqual(
- self.jobs["source"]["steps"][0]["env"]["RUN_LIVE_ACKNOWLEDGED"],
- "${{ inputs.run_live }}",
- )
+ self.assertNotIn("RUN_LIVE_ACKNOWLEDGED", source)
self.assertIn('validate_pr_head "$SOURCE_PR_NUMBER"', source)
self.assertIn('validate_merged_pr "$JEV_PR_NUMBER"', source)
self.assertNotIn("CANONICAL_JEV_MERGE_SHA", self.text)
@@ -77,7 +87,7 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn('.status <<<"$run_json")" == completed', source)
download = next(
step
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
if "download-artifact" in step.get("uses", "")
)
self.assertEqual(download["with"]["run-id"], "${{ needs.source.outputs.candidate_run_id }}")
@@ -92,31 +102,31 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
".conclusion",
):
self.assertIn(contract, source)
- live_text = "\n".join(step.get("run", "") for step in self.jobs["live"]["steps"])
- self.assertIn("extension inspect cua-perception --catalog", live_text)
- self.assertIn("extension install cua-perception --catalog", live_text)
- self.assertIn("extension status cua-perception --self-test --json", live_text)
+ candidate_text = self.candidate_text()
+ self.assertIn("extension inspect cua-perception --catalog", candidate_text)
+ self.assertIn("extension install cua-perception --catalog", candidate_text)
+ self.assertIn("extension status cua-perception --self-test --json", candidate_text)
self.assertIn(
'catalog["signature_algorithm"] == measured["signature_algorithm"] == "ed25519"',
- live_text,
+ candidate_text,
)
- self.assertIn('status["trust"] == "review-only-publisher-verified"', live_text)
- self.assertIn('digest == files[model["path"]] == model["conversion_sha256"]', live_text)
- self.assertNotIn("--allow-unsigned-local", live_text)
- self.assertNotRegex(live_text, r"--archive\s+[^\n]+--catalog")
+ self.assertIn('status["trust"] == "review-only-publisher-verified"', candidate_text)
+ self.assertIn('digest == files[model["path"]] == model["conversion_sha256"]', candidate_text)
+ self.assertNotIn("--allow-unsigned-local", candidate_text)
+ self.assertNotRegex(candidate_text, r"--archive\s+[^\n]+--catalog")
- def test_canonical_runs_are_attested_before_protected_live_job(self):
+ def test_canonical_runs_are_attested_before_protected_candidate_job(self):
self.assertEqual(
set(self.jobs),
- {"source", "mock-preflight", "live"},
+ {"source", "mock-preflight", "candidate"},
)
preflights = "\n".join(str(self.jobs[name]) for name in ("source", "mock-preflight"))
self.assertNotIn("environment", preflights)
self.assertNotIn("TYPESAFE_API_KEY", preflights)
- self.assertEqual(self.jobs["live"]["environment"], "authorized-live-jev-use-demo")
- self.assertEqual(self.jobs["live"]["env"]["CUA_E2E_UNRESTRICTED_GUI"], "1")
+ self.assertEqual(self.jobs["candidate"]["environment"], "authorized-live-jev-use-demo")
+ self.assertEqual(self.jobs["candidate"]["env"]["CUA_E2E_UNRESTRICTED_GUI"], "1")
self.assertEqual(
- set(self.jobs["live"]["needs"]),
+ set(self.jobs["candidate"]["needs"]),
{"source", "mock-preflight"},
)
source = self.jobs["source"]["steps"][0]["run"]
@@ -131,8 +141,8 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn("rust-linux-e2e-certification", source)
self.assertNotIn("run-rust-e2e", self.text)
- def test_live_matrix_uses_review_candidates_and_orchestrator_supports_macos(self):
- matrix = self.jobs["live"]["strategy"]["matrix"]["include"]
+ def test_candidate_matrix_uses_review_candidates_and_orchestrator_supports_macos(self):
+ matrix = self.jobs["candidate"]["strategy"]["matrix"]["include"]
self.assertEqual(
{item["platform"]: item["runner"] for item in matrix},
{
@@ -150,12 +160,12 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertGreater(shared, self.orchestrator.index('Command::new("py")'))
self.assertGreater(shared, self.orchestrator.index('Command::new("python3")'))
- def test_live_paths_use_private_windows_extension_home_and_runner_temp_evidence(self):
- live_env = self.jobs["live"]["env"]
- self.assertNotIn("CUA_PERCEPTION_EXTENSION_HOME", live_env)
- self.assertNotIn("CUA_PERCEPTION_EVIDENCE_DIR", live_env)
- self.assertNotIn("CUA_E2E_RECORDINGS_ROOT", live_env)
- steps = self.jobs["live"]["steps"]
+ def test_candidate_paths_use_private_windows_extension_home_and_runner_temp_evidence(self):
+ candidate_env = self.jobs["candidate"]["env"]
+ self.assertNotIn("CUA_PERCEPTION_EXTENSION_HOME", candidate_env)
+ self.assertNotIn("CUA_PERCEPTION_EVIDENCE_DIR", candidate_env)
+ self.assertNotIn("CUA_E2E_RECORDINGS_ROOT", candidate_env)
+ steps = self.candidate_steps()
configure = next(
step for step in steps if step.get("name") == "Configure temporary evidence paths"
)
@@ -181,7 +191,7 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
)
self.assertNotIn("LOCALAPPDATA", configure["run"])
self.assertIn(
- "$extensionHome = Join-Path $env:RUNNER_TEMP 'cua-perception-extension-home/live'",
+ "$extensionHome = Join-Path $env:RUNNER_TEMP 'cua-perception-extension-home/mock'",
configure["run"],
)
self.assertIn(
@@ -193,16 +203,14 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
configure["run"],
)
self.assertIn(
- "CUA_PERCEPTION_EVIDENCE_DIR=$(Join-Path $env:RUNNER_TEMP 'cua-perception-evidence/live')",
+ "CUA_PERCEPTION_EVIDENCE_DIR=$(Join-Path $env:RUNNER_TEMP 'cua-perception-evidence/mock')",
configure["run"],
)
self.assertNotIn("if", configure)
mock = next(step for step in steps if "deterministic mock" in step.get("name", ""))
- live = next(step for step in steps if "bounded live Jev chooser" in step.get("name", ""))
self.assertLess(steps.index(configure), steps.index(mock))
- self.assertLess(steps.index(configure), steps.index(live))
self.assertEqual(
- {item["platform"] for item in self.jobs["live"]["strategy"]["matrix"]["include"]},
+ {item["platform"] for item in self.jobs["candidate"]["strategy"]["matrix"]["include"]},
{"windows", "linux-x11"},
)
self.assertNotRegex(
@@ -214,10 +222,10 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
r"CUA_E2E_RECORDINGS_ROOT[^\n]*github\.workspace",
)
self.assertNotIn("github.workspace", configure["run"])
- self.assertFalse(any("${{ runner." in value for value in live_env.values()))
+ self.assertFalse(any("${{ runner." in value for value in candidate_env.values()))
- def test_live_linux_desktop_persists_and_is_rechecked_before_demos(self):
- steps = self.jobs["live"]["steps"]
+ def test_candidate_linux_desktop_persists_and_is_rechecked_before_demos(self):
+ steps = self.candidate_steps()
prepare = next(step for step in steps if step.get("name") == "Prepare Linux X11 desktop")
self.assertEqual(prepare["if"], "runner.os == 'Linux'")
self.assertRegex(prepare["run"], r"apt-get install[^\n]*\bx11-utils\b")
@@ -263,6 +271,8 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn('kill "$pid"', stop["run"])
def test_external_chooser_receives_only_the_key_and_windows_system_root(self):
+ # Product capability for direct local execution: the external chooser
+ # contract is unchanged, but no Actions workflow step invokes it.
start = self.orchestrator.index("fn external_choice(")
end = self.orchestrator.index("fn choose(", start)
external = self.orchestrator[start:end]
@@ -270,65 +280,35 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn('.env("TYPESAFE_API_KEY", required("TYPESAFE_API_KEY"))', external)
self.assertIn('command.env("SYSTEMROOT", system_root)', external)
self.assertEqual(external.count(".env("), 2)
+ self.assertFalse(any("CUA_JEV_CHOOSER_PROGRAM" in str(step) for step in self.candidate_steps()))
def test_review_driver_is_consumed_from_hash_bound_aggregate(self):
- live_text = "\n".join(step.get("run", "") for step in self.jobs["live"]["steps"])
- self.assertIn("review-measurements.json", live_text)
- self.assertIn('measured["review_driver_sha256"]', live_text)
+ candidate_text = self.candidate_text()
+ self.assertIn("review-measurements.json", candidate_text)
+ self.assertIn('measured["review_driver_sha256"]', candidate_text)
self.assertIn(
- 'measured["review_driver_build_profile"] == "debug-review-trust-root"', live_text
+ 'measured["review_driver_build_profile"] == "debug-review-trust-root"', candidate_text
)
- self.assertIn("CUA_TEST_DRIVER_BIN", live_text)
- self.assertIn("signed-candidate-checksums.txt", live_text)
- self.assertIn('measured["code_signing"] == {"status": "not-applicable"', live_text)
- self.assertNotIn("cargo build --manifest-path", live_text)
- self.assertNotIn("target/release/cua-driver", live_text)
+ self.assertIn("CUA_TEST_DRIVER_BIN", candidate_text)
+ self.assertIn("signed-candidate-checksums.txt", candidate_text)
+ self.assertIn('measured["code_signing"] == {"status": "not-applicable"', candidate_text)
+ self.assertNotIn("cargo build --manifest-path", candidate_text)
+ self.assertNotIn("target/release/cua-driver", candidate_text)
self.assertNotIn("RSA-SHA256", self.evidence_readme)
self.assertIn("Ed25519", self.evidence_readme)
self.assertIn("debug review-trust-root", self.evidence_readme)
- def test_only_measured_binary_receives_typesafe_secret_in_one_bounded_step(self):
- secret = next(
- step for step in self.jobs["live"]["steps"] if "secrets.TYPESAFE_API_KEY" in str(step)
- )
- self.assertEqual(
- sum("secrets.TYPESAFE_API_KEY" in str(step) for step in self.jobs["live"]["steps"]),
- 1,
- )
- self.assertEqual(secret["timeout-minutes"], 15)
- self.assertEqual(
- secret["env"],
- {
- "GH_TOKEN": "${{ github.token }}",
- "LIVE_TYPESAFE_API_KEY": "${{ secrets.TYPESAFE_API_KEY }}",
- },
- )
- self.assertNotIn("cargo ", secret["run"])
- self.assertIn("CUA_LIVE_TEST_BINARY_SHA256", secret["run"])
- self.assertIn("Remove-Item Env:LIVE_TYPESAFE_API_KEY", secret["run"])
- self.assertIn("Remove-Item Env:TYPESAFE_API_KEY", secret["run"])
- self.assertIn("pulls/$sourcePrNumber", secret["run"])
- self.assertIn("pulls/$jevPrNumber", secret["run"])
- self.assertIn("$jevReview.state -ne 'closed'", secret["run"])
- self.assertIn("$jevReview.merged -ne $true", secret["run"])
- self.assertIn("$jevReview.head.repo.full_name -ne $env:GITHUB_REPOSITORY", secret["run"])
- self.assertIn(
- "$jevReview.merge_commit_sha -ne '${{ needs.source.outputs.jev_sha }}'", secret["run"]
- )
- self.assertNotIn("$jevReview.head.sha", secret["run"])
- self.assertIn("cua-perception-live-review", secret["run"])
- self.assertIn("Remove-Item Env:GH_TOKEN", secret["run"])
- self.assertIn(
- "& $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_WINDOW_TEST",
- secret["run"],
- )
- self.assertIn(
- "& $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_DESKTOP_TEST",
- secret["run"],
+ def test_no_step_uses_secrets_and_only_measured_binary_runs_demos(self):
+ candidate_text = self.candidate_text()
+ self.assertNotIn("TYPESAFE_API_KEY", candidate_text)
+ self.assertNotIn("${{ secrets.", candidate_text)
+ self.assertNotIn("LIVE_TYPESAFE_API_KEY", self.text)
+ self.assertFalse(
+ any("GH_TOKEN" in str(step.get("env", {})) for step in self.candidate_steps())
)
compile_step = next(
step
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
if step.get("name", "").startswith("Compile and measure")
)
self.assertIn("--no-run --message-format=json", compile_step["run"])
@@ -337,60 +317,65 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn("re.fullmatch", compile_step["run"])
self.assertIn('resolve("authorized_visual_only_window_demo")', compile_step["run"])
self.assertIn('resolve("authorized_visual_only_primary_desktop_demo")', compile_step["run"])
- self.assertIn("CUA_LIVE_WINDOW_TEST={window_test}", compile_step["run"])
- self.assertIn("CUA_LIVE_DESKTOP_TEST={desktop_test}", compile_step["run"])
-
- def test_chooser_is_exact_fixed_and_fails_closed_when_absent(self):
- live = self.jobs["live"]
- checkout = next(
- step
- for step in live["steps"]
- if step.get("name") == "Check out the exact reviewed Jev chooser"
+ self.assertIn("CUA_CANDIDATE_WINDOW_TEST={window_test}", compile_step["run"])
+ self.assertIn("CUA_CANDIDATE_DESKTOP_TEST={desktop_test}", compile_step["run"])
+ self.assertIn("CUA_CANDIDATE_TEST_BINARY_SHA256", compile_step["run"])
+ mock = next(
+ step for step in self.candidate_steps() if "deterministic mock" in step.get("name", "")
)
- self.assertEqual(checkout["with"]["ref"], "${{ needs.source.outputs.jev_sha }}")
- setup = next(
- step
- for step in live["steps"]
- if step.get("name", "").startswith("Install the locked reviewed chooser")
- )
- self.assertIn("python/choose_action.py", setup["run"])
- self.assertIn("uv sync --frozen --project", setup["run"])
- self.assertIn("reviewed live chooser contract is unavailable", setup["run"])
- secret = next(step for step in live["steps"] if "secrets.TYPESAFE_API_KEY" in str(step))
- self.assertIn("CUA_JEV_CHOOSER_PROGRAM", secret["run"])
- self.assertIn("CUA_JEV_CHOOSER_SCRIPT", secret["run"])
+ self.assertIn("& $env:CUA_CANDIDATE_TEST_BINARY --ignored --exact $env:CUA_CANDIDATE_WINDOW_TEST", mock["run"])
+ self.assertIn("& $env:CUA_CANDIDATE_TEST_BINARY --ignored --exact $env:CUA_CANDIDATE_DESKTOP_TEST", mock["run"])
+ self.assertLess(
+ self.candidate_steps().index(compile_step), self.candidate_steps().index(mock)
+ )
+
+ def test_no_external_chooser_install_remains_and_orchestrator_fails_closed(self):
+ names = [step.get("name", "") for step in self.candidate_steps()]
+ self.assertFalse(any("Jev chooser" in name for name in names))
+ self.assertFalse(any("reviewed chooser" in name for name in names))
+ self.assertNotIn("CUA_FIXED_CHOOSER", self.text)
+ self.assertNotIn("CUA_JEV_LIVE", self.text)
+ self.assertNotIn("jev-use-source", self.text)
self.assertNotIn("Invoke-Expression", self.text)
- self.assertNotIn("bash -c", secret["run"])
+ self.assertNotIn("bash -c", self.candidate_text())
+ # The product orchestrator still supports a reviewed live chooser for
+ # direct local execution; Actions never configures it.
+ self.assertIn("CUA_JEV_LIVE", self.orchestrator)
+ self.assertIn(
+ "reviewed chooser program and script paths must be absolute", self.orchestrator
+ )
+ self.assertIn("set CUA_JEV_MOCK_DEMO=1 or CUA_JEV_LIVE=1", self.orchestrator)
def test_mock_has_no_chooser_or_key(self):
mock = next(
step
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
if "deterministic mock" in step.get("name", "")
)
self.assertEqual(
mock["env"],
{
"CUA_JEV_MOCK_DEMO": "1",
- "CUA_PERCEPTION_EVIDENCE_DIR": "${{ runner.temp }}/perception-evidence/mock",
"CUA_TEST_DRIVER_STDERR": "1",
},
)
self.assertNotIn("CHOOSER", str(mock))
self.assertNotIn("TYPESAFE", str(mock))
- self.assertIn("--exact $env:CUA_LIVE_WINDOW_TEST", mock["run"])
- self.assertIn("--exact $env:CUA_LIVE_DESKTOP_TEST", mock["run"])
+ self.assertIn("--exact $env:CUA_CANDIDATE_WINDOW_TEST", mock["run"])
+ self.assertIn("--exact $env:CUA_CANDIDATE_DESKTOP_TEST", mock["run"])
def test_only_encrypted_schema_validated_evidence_is_uploaded(self):
uploads = [
- step for step in self.jobs["live"]["steps"] if "upload-artifact" in step.get("uses", "")
+ step for step in self.candidate_steps() if "upload-artifact" in step.get("uses", "")
]
self.assertEqual(len(uploads), 1)
upload = uploads[0]
self.assertEqual(upload["with"]["path"], "${{ runner.temp }}/encrypted-evidence/")
+ self.assertIn("mock-jev-visual-", upload["with"]["name"])
+ self.assertNotIn("live-jev-visual", str(upload))
validate_step = next(
step
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
if step.get("name", "").startswith("Fully decode")
)
validate = validate_step["run"]
@@ -418,13 +403,13 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn('manifest["environment"] ==', validate)
self.assertIn('perception["models"] == measured["models"]', validate)
self.assertIn('chooser["model_id"]', validate)
- self.assertIn('chooser["mode"] == "live"', validate)
- self.assertIn('chooser["provider"] == "typesafe"', validate)
+ self.assertIn('chooser["mode"] == "mock"', validate)
+ self.assertIn('chooser["provider"] == "fixture"', validate)
self.assertIn('recording_value["frame_rate"]', validate)
self.assertIn('recording_value["edit_operations"]', validate)
encrypt_step = next(
step
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
if step.get("name") == "Encrypt the validated evidence bundles"
)
self.assertEqual(
@@ -438,7 +423,7 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertEqual(
sum(
"vars.EVIDENCE_ARCHIVE_RECIPIENT_PUBLIC_KEY" in str(step)
- for step in self.jobs["live"]["steps"]
+ for step in self.candidate_steps()
),
1,
)
@@ -451,7 +436,7 @@ class AuthorizedLiveDemoWorkflowTests(unittest.TestCase):
self.assertIn("Remove-Item Env:CUA_PERCEPTION_EVIDENCE_RECIPIENT", encrypt_step["run"])
self.assertIn('== ["primary-desktop.cuae", "window.cuae"]', encrypt_step["run"])
self.assertNotIn("CUA_PERCEPTION_EVIDENCE_RECIPIENT", validate)
- steps = self.jobs["live"]["steps"]
+ steps = self.candidate_steps()
cleanup = next(
step
for step in steps
diff --git a/.github/scripts/tests/test_cua_perception_pr_review_trigger.py b/.github/scripts/tests/test_cua_perception_pr_review_trigger.py
index c908e997d2..2860897531 100644
--- a/.github/scripts/tests/test_cua_perception_pr_review_trigger.py
+++ b/.github/scripts/tests/test_cua_perception_pr_review_trigger.py
@@ -135,19 +135,20 @@ def test_pr_review_produces_candidates_without_entering_the_protected_environmen
assert not re.findall(r"^\s*environment:", trigger_text, re.MULTILINE)
-def test_protected_live_workflow_owns_secrets_and_environment() -> None:
+def test_protected_candidate_workflow_is_secret_free_and_keeps_environment() -> None:
live_text, live_workflow = load_workflow(LIVE)
- live_job = live_workflow["jobs"]["live"]
+ live_job = live_workflow["jobs"]["candidate"]
assert live_job["environment"] == "authorized-live-jev-use-demo"
+ assert "TYPESAFE_API_KEY" not in live_text
+ assert "LIVE_TYPESAFE_API_KEY" not in live_text
+ assert "${{ secrets." not in live_text
+ assert "run_live" not in live_text
+ assert "CUA_JEV_LIVE" not in live_text
secret_steps = [step for step in live_job["steps"] if "${{ secrets." in str(step)]
- assert len(secret_steps) == 1
- typesafe_step = next(
- step for step in secret_steps if "LIVE_TYPESAFE_API_KEY" in step.get("env", {})
+ assert secret_steps == []
+ assert "TYPESAFE_API_KEY" not in "\n".join(
+ str(job) for name, job in live_workflow["jobs"].items() if name != "candidate"
)
- assert typesafe_step["env"] == {
- "GH_TOKEN": "${{ github.token }}",
- "LIVE_TYPESAFE_API_KEY": "${{ secrets.TYPESAFE_API_KEY }}",
- }
evidence_step = next(
step
for step in live_job["steps"]
@@ -157,14 +158,11 @@ def test_protected_live_workflow_owns_secrets_and_environment() -> None:
"CUA_PERCEPTION_EVIDENCE_RECIPIENT": ("${{ vars.EVIDENCE_ARCHIVE_RECIPIENT_PUBLIC_KEY }}"),
}
assert "EVIDENCE_ARCHIVE_KEY" not in live_text
- assert "TYPESAFE_API_KEY" not in "\n".join(
- str(job) for name, job in live_workflow["jobs"].items() if name != "live"
- )
validation = next(
step["run"] for step in live_job["steps"] if step.get("name", "").startswith("Fully decode")
)
- assert 'chooser["mode"] == "live"' in validation
- assert 'chooser["provider"] == "typesafe"' in validation
+ assert 'chooser["mode"] == "mock"' in validation
+ assert 'chooser["provider"] == "fixture"' in validation
def test_macos_direct_lume_registration_is_manual_and_not_pr_event_chained() -> None:
diff --git a/.github/scripts/tests/test_macos_hosted_e2e_workflow.py b/.github/scripts/tests/test_macos_hosted_e2e_workflow.py
index d6366738e8..30b1d65238 100644
--- a/.github/scripts/tests/test_macos_hosted_e2e_workflow.py
+++ b/.github/scripts/tests/test_macos_hosted_e2e_workflow.py
@@ -128,7 +128,7 @@ def test_hosted_macos_probe_proves_textedit_window_content() -> None:
def test_script_ci_runs_when_hosted_macos_contract_changes() -> None:
workflow = read(".github/workflows/ci-test-scripts.yml")
- assert ' - ".github/workflows/e2e-rust-macos.yml"' in workflow
+ assert ' - ".github/workflows/**"' in workflow
assert ' - "scripts/ci/macos/**"' in workflow
guide = read("scripts/ci/README.md")
diff --git a/.github/scripts/tests/test_typesafe_secret_boundary.py b/.github/scripts/tests/test_typesafe_secret_boundary.py
new file mode 100644
index 0000000000..e4934d7cf1
--- /dev/null
+++ b/.github/scripts/tests/test_typesafe_secret_boundary.py
@@ -0,0 +1,19 @@
+"""Keep TypeSafe provider credentials completely outside GitHub Actions."""
+
+from pathlib import Path
+
+
+ROOT = Path(__file__).resolve().parents[3]
+ACTION_SURFACES = (ROOT / ".github/workflows", ROOT / ".github/actions")
+
+
+def test_actions_never_reference_the_typesafe_credential() -> None:
+ credential_name = "TYPESAFE" + "_API_KEY"
+ matches = []
+ for surface in ACTION_SURFACES:
+ if not surface.exists():
+ continue
+ for path in sorted(surface.rglob("*")):
+ if path.is_file() and credential_name in path.read_text(encoding="utf-8"):
+ matches.append(path.relative_to(ROOT))
+ assert matches == []
diff --git a/.github/workflows/authorized-live-jev-use-demo.yml b/.github/workflows/authorized-live-jev-use-demo.yml
index 93461e0063..845fd5328e 100644
--- a/.github/workflows/authorized-live-jev-use-demo.yml
+++ b/.github/workflows/authorized-live-jev-use-demo.yml
@@ -1,12 +1,8 @@
-name: "Authorized: live Jev visual demo"
+name: "Authorized: candidate Jev visual demo"
on:
workflow_dispatch:
inputs:
- run_live:
- description: "Explicit acknowledgement that this invocation may use protected live credentials"
- required: true
- type: boolean
source_pr_number:
description: "Pull request number under live review; must be open with the fixed cua-perception-live-review label"
required: true
@@ -41,10 +37,6 @@ on:
type: string
workflow_call:
inputs:
- run_live:
- description: "Explicit acknowledgement that this invocation may use protected live credentials"
- required: true
- type: boolean
source_pr_number:
description: "Pull request number under live review; must be open with the fixed cua-perception-live-review label"
required: true
@@ -101,7 +93,6 @@ jobs:
shell: bash
env:
GH_TOKEN: ${{ github.token }}
- RUN_LIVE_ACKNOWLEDGED: ${{ inputs.run_live }}
SOURCE_PR_NUMBER: ${{ inputs.source_pr_number }}
REQUESTED_SHA: ${{ inputs.source_sha }}
JEV_PR_NUMBER: ${{ inputs.jev_pr_number }}
@@ -117,8 +108,7 @@ jobs:
EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
- [[ "$GITHUB_REPOSITORY" == "trycua/cua" ]] || { echo "live demo runs only in trycua/cua" >&2; exit 2; }
- [[ "$RUN_LIVE_ACKNOWLEDGED" == true ]] || { echo "run_live must be explicitly acknowledged" >&2; exit 2; }
+ [[ "$GITHUB_REPOSITORY" == "trycua/cua" ]] || { echo "candidate demo runs only in trycua/cua" >&2; exit 2; }
[[ "$SOURCE_PR_NUMBER" =~ ^[1-9][0-9]*$ ]] || { echo "source_pr_number must be numeric" >&2; exit 2; }
[[ "$REQUESTED_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "source_sha must be exactly 40 lowercase hexadecimal characters" >&2; exit 2; }
[[ "$JEV_PR_NUMBER" =~ ^[1-9][0-9]*$ ]] || { echo "jev_pr_number must be numeric" >&2; exit 2; }
@@ -216,7 +206,7 @@ jobs:
[[ "$EVENT_LABEL" == cua-perception-live-review && "$run_id" == "$GITHUB_RUN_ID" ]] || { echo "same-run caller lacks the exact review label or run ID" >&2; exit 2; }
[[ "$(jq -r .status <<<"$run_json")" == in_progress && "$(jq -r .conclusion <<<"$run_json")" == null ]] || { echo "same-run candidate artifact is not from the active review run" >&2; exit 2; }
else
- [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] || { echo "unsupported live demo invocation" >&2; exit 2; }
+ [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] || { echo "unsupported candidate demo invocation" >&2; exit 2; }
[[ "$(jq -r .status <<<"$run_json")" == completed && "$(jq -r .conclusion <<<"$run_json")" == success ]] || { echo "candidate artifact workflow run did not complete successfully" >&2; exit 2; }
fi
echo "sha=$REQUESTED_SHA" >> "$GITHUB_OUTPUT"
@@ -258,8 +248,8 @@ jobs:
cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver --test authorized_live_jev_use_demo_test --locked
cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-perception --locked
- live:
- name: Live Jev (${{ matrix.platform }})
+ candidate:
+ name: Candidate mock Jev (${{ matrix.platform }})
needs: [source, mock-preflight]
strategy:
fail-fast: false
@@ -300,19 +290,12 @@ jobs:
$extensionHomeItem = Get-Item -LiteralPath $extensionHome -Force
if (-not $extensionHomeItem.PSIsContainer -or $extensionHomeItem.Attributes -band [IO.FileAttributes]::ReparsePoint) { throw 'Windows extension home must be a real directory' }
} else {
- $extensionHome = Join-Path $env:RUNNER_TEMP 'cua-perception-extension-home/live'
+ $extensionHome = Join-Path $env:RUNNER_TEMP 'cua-perception-extension-home/mock'
}
"CUA_PERCEPTION_EXTENSION_HOME=$extensionHome" >> $env:GITHUB_ENV
"CUA_DRIVER_RS_HOME=$extensionHome" >> $env:GITHUB_ENV
"CUA_E2E_RECORDINGS_ROOT=$(Join-Path $env:RUNNER_TEMP 'cua-perception-recordings')" >> $env:GITHUB_ENV
- "CUA_PERCEPTION_EVIDENCE_DIR=$(Join-Path $env:RUNNER_TEMP 'cua-perception-evidence/live')" >> $env:GITHUB_ENV
- - name: Check out the exact reviewed Jev chooser
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- repository: trycua/cua
- ref: ${{ needs.source.outputs.jev_sha }}
- path: jev-use-source
- persist-credentials: false
+ "CUA_PERCEPTION_EVIDENCE_DIR=$(Join-Path $env:RUNNER_TEMP 'cua-perception-evidence/mock')" >> $env:GITHUB_ENV
- uses: dtolnay/rust-toolchain@4716b85f2fac3e324e64fa2810f6b5c3905760a5 # 1.97.1
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
@@ -490,38 +473,13 @@ jobs:
stream.write(f"CUA_PERCEPTION_MODEL={supplied_model_path}\nCUA_RUNNER_OS_NAME={runner_identity['name']}\nCUA_RUNNER_OS_VERSION={runner_identity['version']}\nCUA_RUNNER_OS_ARCH={runner_identity['arch']}\n")
'@ | python - $inspect $status $catalog $installed $env:GITHUB_ENV $driver $measurements
if ($LASTEXITCODE -ne 0) { throw 'candidate measurement failed' }
- - name: Install the locked reviewed chooser with the source-reviewed adapter
- shell: pwsh
- env:
- EXPECTED_JEV_SHA: ${{ needs.source.outputs.jev_sha }}
- run: |
- $ErrorActionPreference = 'Stop'
- $chooserRepo = Join-Path $env:GITHUB_WORKSPACE 'jev-use-source'
- $chooserRoot = Join-Path $chooserRepo 'libs/cua-driver/examples/jev-use'
- if ((git -C $chooserRepo rev-parse HEAD).Trim() -ne $env:EXPECTED_JEV_SHA) { throw 'chooser checkout does not match jev_source_sha' }
- $script = Join-Path $chooserRoot 'python/choose_action.py'
- $adapter = Join-Path $env:GITHUB_WORKSPACE 'libs/cua-driver/examples/jev-use/python/jev_adapter.py'
- $installedAdapter = Join-Path $chooserRoot 'python/jev_adapter.py'
- if (-not (Test-Path $script -PathType Leaf)) { throw 'reviewed live chooser contract is unavailable' }
- if (-not (Test-Path $adapter -PathType Leaf) -or -not (Test-Path $installedAdapter -PathType Leaf)) { throw 'reviewed live chooser adapter is unavailable' }
- Copy-Item -LiteralPath $adapter -Destination $installedAdapter -Force
- $adapterSha256 = (Get-FileHash $adapter -Algorithm SHA256).Hash.ToLowerInvariant()
- if ((Get-FileHash $installedAdapter -Algorithm SHA256).Hash.ToLowerInvariant() -ne $adapterSha256) { throw 'source-reviewed chooser adapter copy does not match' }
- uv sync --frozen --project $chooserRoot
- if ($LASTEXITCODE -ne 0) { throw 'locked chooser install failed' }
- $program = if ($IsWindows) { Join-Path $chooserRoot '.venv/Scripts/python.exe' } else { Join-Path $chooserRoot '.venv/bin/python' }
- if (-not (Test-Path $program -PathType Leaf)) { throw 'chooser interpreter is unavailable' }
- "CUA_FIXED_CHOOSER_PROGRAM=$program" >> $env:GITHUB_ENV
- "CUA_FIXED_CHOOSER_SCRIPT=$script" >> $env:GITHUB_ENV
- "CUA_FIXED_CHOOSER_ADAPTER=$installedAdapter" >> $env:GITHUB_ENV
- "CUA_FIXED_CHOOSER_ADAPTER_SHA256=$adapterSha256" >> $env:GITHUB_ENV
- - name: Compile and measure the exact live test binary without credentials
+ - name: Compile and measure the exact candidate test binary without credentials
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
- $messages = Join-Path $env:RUNNER_TEMP 'live-test-build.jsonl'
+ $messages = Join-Path $env:RUNNER_TEMP 'candidate-test-build.jsonl'
cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver --test authorized_live_jev_use_demo_test --locked --no-run --message-format=json-render-diagnostics | Set-Content $messages -Encoding utf8
- if ($LASTEXITCODE -ne 0) { throw 'live test build failed' }
+ if ($LASTEXITCODE -ne 0) { throw 'candidate test build failed' }
@'
import hashlib, json, os, pathlib, re, subprocess, sys
records = []
@@ -535,23 +493,23 @@ jobs:
available = [line.removesuffix(": test") for line in listing if line.endswith(": test")]
def resolve(short_name):
matches = [name for name in available if name == short_name or name.endswith(f"::{short_name}")]
- assert len(matches) == 1, f"required live test {short_name!r} resolved to {matches!r}"
+ assert len(matches) == 1, f"required candidate test {short_name!r} resolved to {matches!r}"
assert re.fullmatch(r"[A-Za-z0-9_]+(?:::[A-Za-z0-9_]+)*", matches[0]), matches[0]
return matches[0]
window_test = resolve("authorized_visual_only_window_demo")
desktop_test = resolve("authorized_visual_only_primary_desktop_demo")
negative_test = resolve("authorized_live_jev_no_matching_action_control")
with pathlib.Path(os.environ["GITHUB_ENV"]).open("a") as stream:
- stream.write(f"CUA_LIVE_TEST_BINARY={binary}\nCUA_LIVE_TEST_BINARY_SHA256={hashlib.sha256(binary.read_bytes()).hexdigest()}\nCUA_LIVE_WINDOW_TEST={window_test}\nCUA_LIVE_DESKTOP_TEST={desktop_test}\nCUA_LIVE_NEGATIVE_TEST={negative_test}\n")
+ stream.write(f"CUA_CANDIDATE_TEST_BINARY={binary}\nCUA_CANDIDATE_TEST_BINARY_SHA256={hashlib.sha256(binary.read_bytes()).hexdigest()}\nCUA_CANDIDATE_WINDOW_TEST={window_test}\nCUA_CANDIDATE_DESKTOP_TEST={desktop_test}\nCUA_CANDIDATE_NEGATIVE_TEST={negative_test}\n")
'@ | python - $messages
- if ($LASTEXITCODE -ne 0) { throw 'live test binary measurement failed' }
+ if ($LASTEXITCODE -ne 0) { throw 'candidate test binary measurement failed' }
- name: Verify Linux X11 desktop survived setup steps
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
dump_desktop_state() {
- echo "Linux X11 desktop is unavailable before the live demos" >&2
+ echo "Linux X11 desktop is unavailable before the mock demos" >&2
pgrep -a -f 'Xvfb|dbus-daemon|openbox|picom' >&2 || true
DISPLAY="$DISPLAY" xprop -root _NET_SUPPORTED _NET_SUPPORTING_WM_CHECK _NET_CLIENT_LIST >&2 2>&1 || true
for name in xvfb dbus openbox picom; do
@@ -585,46 +543,12 @@ jobs:
shell: pwsh
env:
CUA_JEV_MOCK_DEMO: "1"
- CUA_PERCEPTION_EVIDENCE_DIR: ${{ runner.temp }}/perception-evidence/mock
CUA_TEST_DRIVER_STDERR: "1"
run: |
- & $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_WINDOW_TEST --nocapture
+ & $env:CUA_CANDIDATE_TEST_BINARY --ignored --exact $env:CUA_CANDIDATE_WINDOW_TEST --nocapture
if ($LASTEXITCODE -ne 0) { throw 'artifact-gated mock window demo failed' }
- & $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_DESKTOP_TEST --nocapture
+ & $env:CUA_CANDIDATE_TEST_BINARY --ignored --exact $env:CUA_CANDIDATE_DESKTOP_TEST --nocapture
if ($LASTEXITCODE -ne 0) { throw 'artifact-gated mock primary-desktop demo failed' }
- - name: Run bounded live Jev chooser against the measured binary
- shell: pwsh
- timeout-minutes: 15
- env:
- GH_TOKEN: ${{ github.token }}
- LIVE_TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
- run: |
- $ErrorActionPreference = 'Stop'
- $key = $env:LIVE_TYPESAFE_API_KEY; Remove-Item Env:LIVE_TYPESAFE_API_KEY
- if ([string]::IsNullOrWhiteSpace($key)) { throw 'TYPESAFE_API_KEY environment secret is required' }
- $sourcePrNumber = '${{ inputs.source_pr_number }}'
- $jevPrNumber = '${{ inputs.jev_pr_number }}'
- $review = gh api "repos/$env:GITHUB_REPOSITORY/pulls/$sourcePrNumber" | ConvertFrom-Json
- if ($review.state -ne 'open' -or $review.head.repo.full_name -ne $env:GITHUB_REPOSITORY -or $review.head.sha -ne '${{ needs.source.outputs.sha }}' -or 'cua-perception-live-review' -notin $review.labels.name) { throw "PR #$sourcePrNumber is no longer the exact labeled source under review" }
- $jevReview = gh api "repos/$env:GITHUB_REPOSITORY/pulls/$jevPrNumber" | ConvertFrom-Json
- if ($jevReview.state -ne 'closed' -or $jevReview.merged -ne $true -or $jevReview.head.repo.full_name -ne $env:GITHUB_REPOSITORY -or $jevReview.merge_commit_sha -ne '${{ needs.source.outputs.jev_sha }}') { throw "PR #$jevPrNumber is no longer the exact canonical merged Jev recipe" }
- Remove-Item Env:GH_TOKEN
- if ((git rev-parse HEAD).Trim() -ne '${{ needs.source.outputs.sha }}') { throw 'source changed after build' }
- if ((git -C (Join-Path $env:GITHUB_WORKSPACE 'jev-use-source') rev-parse HEAD).Trim() -ne '${{ needs.source.outputs.jev_sha }}') { throw 'chooser source changed after setup' }
- if ((Get-FileHash $env:CUA_LIVE_TEST_BINARY -Algorithm SHA256).Hash.ToLowerInvariant() -ne $env:CUA_LIVE_TEST_BINARY_SHA256) { throw 'live test binary changed after measurement' }
- if (-not (Test-Path $env:CUA_FIXED_CHOOSER_SCRIPT -PathType Leaf)) { throw 'chooser script disappeared after setup' }
- if ((Get-FileHash $env:CUA_FIXED_CHOOSER_ADAPTER -Algorithm SHA256).Hash.ToLowerInvariant() -ne $env:CUA_FIXED_CHOOSER_ADAPTER_SHA256) { throw 'source-reviewed chooser adapter changed after setup' }
- $env:CUA_JEV_LIVE = '1'; $env:CUA_JEV_CHOOSER_PROGRAM = $env:CUA_FIXED_CHOOSER_PROGRAM; $env:CUA_JEV_CHOOSER_SCRIPT = $env:CUA_FIXED_CHOOSER_SCRIPT; $env:TYPESAFE_API_KEY = $key
- try {
- & $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_NEGATIVE_TEST --nocapture
- if ($LASTEXITCODE -ne 0) { throw 'live Jev no-matching-action control failed' }
- & $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_WINDOW_TEST --nocapture
- if ($LASTEXITCODE -ne 0) { throw 'live Jev window demo failed' }
- & $env:CUA_LIVE_TEST_BINARY --ignored --exact $env:CUA_LIVE_DESKTOP_TEST --nocapture
- if ($LASTEXITCODE -ne 0) { throw 'live Jev primary-desktop demo failed' }
- } finally {
- Remove-Item Env:TYPESAFE_API_KEY -ErrorAction SilentlyContinue; Remove-Item Env:CUA_JEV_LIVE -ErrorAction SilentlyContinue; Remove-Item Env:CUA_JEV_CHOOSER_PROGRAM -ErrorAction SilentlyContinue; Remove-Item Env:CUA_JEV_CHOOSER_SCRIPT -ErrorAction SilentlyContinue; $key = $null
- }
- name: Fully decode and validate redacted evidence
shell: pwsh
env:
@@ -637,7 +561,7 @@ jobs:
$scopeEvidence = if ($scope -eq 'window') { $evidence } else { Join-Path $evidence $scope }
$recording = Join-Path $scopeEvidence 'recording.mp4'
$manifest = Join-Path $scopeEvidence 'manifest.json'
- if (-not (Test-Path $recording -PathType Leaf) -or -not (Test-Path $manifest -PathType Leaf)) { throw "complete $scope live evidence was not produced" }
+ if (-not (Test-Path $recording -PathType Leaf) -or -not (Test-Path $manifest -PathType Leaf)) { throw "complete $scope mock evidence was not produced" }
ffmpeg -v error -xerror -i $recording -map 0:v:0 -f null -
if ($LASTEXITCODE -ne 0) { throw "$scope recording.mp4 did not fully decode" }
}
@@ -662,7 +586,7 @@ jobs:
assert driver["build"] == {"profile": measured["review_driver_build_profile"], "target": measured["target"], "sealed_artifact_manifest_sha256": measured["sealed_artifact_manifest_sha256"], "sealed_extension_manifest_sha256": measured["sealed_extension_manifest_sha256"]}
assert perception["signature_algorithm"] == measured["signature_algorithm"] == "ed25519"; assert perception["signed_extension_archive_sha256"] == measured["archive_sha256"]; assert perception["signing_key_sha256"] == measured["public_key_sha256"]; assert perception["signed_catalog_sha256"] == measured["catalog_sha256"]
assert perception["protocol_version"] == measured["protocol_version"] and perception["worker_sha256"] == measured["worker_sha256"] and perception["self_test"] == measured["self_test"] and perception["models"] == measured["models"] and perception["onnx_runtime"] == measured["onnx_runtime"]
- assert chooser["mode"] == "live" and chooser["provider"] == "typesafe" and chooser["model_id"]
+ assert chooser["mode"] == "mock" and chooser["provider"] == "fixture" and chooser["model_id"]
assert chooser["adapter_source_sha"] == os.environ["EXPECTED_SHA"] and chooser["source_sha"] == os.environ["CUA_JEV_SOURCE_SHA"]
result = manifest["result"]; observation = manifest["observation"]
assert observation["session_label"] == f'{os.environ["CUA_SESSION_LABEL"]}-{scope}'
@@ -709,7 +633,7 @@ jobs:
- name: Upload only encrypted evidence envelopes
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.2
with:
- name: live-jev-visual-${{ matrix.platform }}-${{ needs.source.outputs.sha }}
+ name: mock-jev-visual-${{ matrix.platform }}-${{ needs.source.outputs.sha }}
path: ${{ runner.temp }}/encrypted-evidence/
if-no-files-found: error
retention-days: 14
diff --git a/.github/workflows/authorized-live-jev-use.yml b/.github/workflows/authorized-live-jev-use.yml
index 6225c0415e..93a4a9a793 100644
--- a/.github/workflows/authorized-live-jev-use.yml
+++ b/.github/workflows/authorized-live-jev-use.yml
@@ -1,4 +1,4 @@
-name: "Authorized: live jev-use"
+name: "Authorized: mock jev-use"
on:
workflow_dispatch:
@@ -10,11 +10,6 @@ on:
description: "Canonical main or release branch that must contain the SHA"
required: true
default: "main"
- run_live:
- description: "Acknowledge live TypeSafe calls and account billing"
- required: true
- type: boolean
- default: false
permissions:
contents: read
@@ -22,7 +17,6 @@ permissions:
jobs:
source:
name: Validate canonical source
- if: inputs.run_live == true
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.validate.outputs.sha }}
@@ -36,7 +30,7 @@ jobs:
run: |
set -euo pipefail
if [[ "$GITHUB_REPOSITORY" != "trycua/cua" ]]; then
- echo "live validation runs only in trycua/cua" >&2
+ echo "candidate validation runs only in trycua/cua" >&2
exit 2
fi
if [[ ! "$REQUESTED_SHA" =~ ^[0-9a-fA-F]{40}$ ]]; then
@@ -56,14 +50,11 @@ jobs:
gh api "repos/$GITHUB_REPOSITORY/commits/${REQUESTED_SHA,,}" --jq .sha
echo "sha=${REQUESTED_SHA,,}" >> "$GITHUB_OUTPUT"
- live:
- name: Mock first, then live Jev
+ mock:
+ name: Deterministic mock Jev
needs: source
runs-on: ubuntu-latest
timeout-minutes: 45
- # Repository administrators must create this environment with required
- # reviewers and a TYPESAFE_API_KEY environment secret before dispatch.
- environment: jev-use-live
env:
CUA_DRIVER_BIN: ${{ github.workspace }}/libs/cua-driver/rust/target/release/cua-driver
CUA_DRIVER_PERMISSION_MODE: unrestricted
@@ -108,51 +99,48 @@ jobs:
npm ci --ignore-scripts
echo "Candidate SHA: $(git rev-parse HEAD)"
"$CUA_DRIVER_BIN" --version
- - name: Run bounded mock and live checks
- env:
- TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
+ - name: Run bounded mock checks
working-directory: ${{ github.workspace }}
run: |
mock="$RUNNER_TEMP/jev-use-mock-proof"
- live="$RUNNER_TEMP/jev-use-live-proof"
python_bin="$GITHUB_WORKSPACE/libs/cua-driver/examples/jev-use/.venv/bin/python"
test -x "$python_bin"
# Match the repository's supported Linux X11 desktop stack while
- # keeping the live credential scoped to this reviewed step.
+ # keeping every provider row on the deterministic mock chooser.
xvfb-run -a --server-args="-screen 0 1920x1080x24" \
dbus-run-session -- bash -lc \
- 'openbox >/tmp/jev-use-openbox.log 2>&1 & picom --backend xrender --config /dev/null >/tmp/jev-use-picom.log 2>&1 & sleep 2; cd libs/cua-driver/examples/jev-use; "'$python_bin'" verify_setup.py --typescript --max-steps 2 --output-dir "'$mock'"; "'$python_bin'" verify_setup.py --live --typescript --max-steps 2 --output-dir "'$live'"'
- - name: Verify live bounded chooser CLI
- env:
- TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
- run: .venv/bin/python verify_choice_cli.py --live
- - name: Audit live action bound and redact evidence
+ 'openbox >/tmp/jev-use-openbox.log 2>&1 & picom --backend xrender --config /dev/null >/tmp/jev-use-picom.log 2>&1 & sleep 2; cd libs/cua-driver/examples/jev-use; "'$python_bin'" verify_setup.py --typescript --max-steps 2 --output-dir "'$mock'"'
+ - name: Verify bounded mock chooser CLI
+ run: .venv/bin/python verify_choice_cli.py
+ - name: Audit mock action bound and redact evidence
run: |
- uv run python - "$RUNNER_TEMP/jev-use-live-proof" <<'PY'
+ uv run python - "$RUNNER_TEMP/jev-use-mock-proof" <<'PY'
import json, pathlib, sys
root = pathlib.Path(sys.argv[1])
summary = json.loads((root / "summary.json").read_text())
assert summary["complete"] is True
- assert len(summary["checks"]) == 4
- live = [item for item in summary["checks"] if item["provider"] == "live"]
- assert len(live) == 2 and all(item["outcome"] == "verified" for item in live)
- live_steps = 0
- for path in root.glob("*-live.jsonl"):
- live_steps += sum(json.loads(line).get("event") == "step" for line in path.read_text().splitlines())
- assert live_steps <= 4, live_steps
+ assert summary["live_requested"] is False
+ assert summary["typescript_requested"] is True
+ assert len(summary["checks"]) == 2
+ mock = [item for item in summary["checks"] if item["provider"] == "mock"]
+ assert len(mock) == 2 and all(item["outcome"] == "verified" for item in mock)
+ mock_steps = 0
+ for path in root.glob("*-mock.jsonl"):
+ mock_steps += sum(json.loads(line).get("event") == "step" for line in path.read_text().splitlines())
+ assert mock_steps <= 4, mock_steps
forbidden = ("typesafe_api_key", "authorization", "environment", "image_base64", "screenshot")
for path in root.iterdir():
if path.name == "summary.json" or path.suffix == ".jsonl":
text = path.read_text().lower()
assert not any(value in text for value in forbidden), path
PY
- - name: Upload redacted live metadata
+ - name: Upload redacted mock metadata
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
- name: jev-use-live-${{ needs.source.outputs.sha }}
+ name: jev-use-mock-${{ needs.source.outputs.sha }}
path: |
- ${{ runner.temp }}/jev-use-live-proof/summary.json
- ${{ runner.temp }}/jev-use-live-proof/*.jsonl
+ ${{ runner.temp }}/jev-use-mock-proof/summary.json
+ ${{ runner.temp }}/jev-use-mock-proof/*.jsonl
if-no-files-found: error
retention-days: 14
diff --git a/.github/workflows/ci-jev-use.yml b/.github/workflows/ci-jev-use.yml
index ff1b0110ee..7ea76b00fc 100644
--- a/.github/workflows/ci-jev-use.yml
+++ b/.github/workflows/ci-jev-use.yml
@@ -10,6 +10,7 @@ on:
- "skills/jev-use/**"
- ".github/workflows/ci-jev-use.yml"
- ".github/workflows/authorized-live-jev-use.yml"
+ - ".github/workflows/authorized-live-jev-use-demo.yml"
push:
branches: [main]
paths:
@@ -20,6 +21,7 @@ on:
- "skills/jev-use/**"
- ".github/workflows/ci-jev-use.yml"
- ".github/workflows/authorized-live-jev-use.yml"
+ - ".github/workflows/authorized-live-jev-use-demo.yml"
workflow_dispatch:
permissions:
@@ -51,12 +53,8 @@ jobs:
- name: Install locked Python dependencies
run: uv sync --frozen
- name: Run Python unit tests without credentials
- env:
- TYPESAFE_API_KEY: ""
run: uv run python -m unittest discover -s python/tests -v
- name: Verify bounded chooser CLI in mock mode
- env:
- TYPESAFE_API_KEY: ""
run: uv run --frozen python verify_choice_cli.py
unit-typescript:
@@ -73,8 +71,6 @@ jobs:
- name: Install locked TypeScript dependencies
run: npm ci --ignore-scripts
- name: Run TypeScript unit tests
- env:
- TYPESAFE_API_KEY: ""
run: npm test
- name: Typecheck
run: npm run typecheck
@@ -89,7 +85,6 @@ jobs:
CUA_DRIVER_DANGEROUSLY_BYPASS_APPROVALS: "1"
CUA_E2E_BROWSER_NO_SANDBOX: "1"
CUA_E2E_BROWSER_STDERR: "1"
- TYPESAFE_API_KEY: ""
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
diff --git a/.github/workflows/ci-test-scripts.yml b/.github/workflows/ci-test-scripts.yml
index 0126eac944..c65a584a26 100644
--- a/.github/workflows/ci-test-scripts.yml
+++ b/.github/workflows/ci-test-scripts.yml
@@ -4,6 +4,8 @@ on:
pull_request:
paths:
- ".github/scripts/**"
+ - ".github/workflows/**"
+ - ".github/actions/**"
- "TESTING.md"
- "libs/cua-driver/rust/README.md"
- "libs/cua-driver/rust/**/Cargo.toml"
diff --git a/libs/cua-driver/docs/jev-use-validation.md b/libs/cua-driver/docs/jev-use-validation.md
index edae27d4b6..b2a1917395 100644
--- a/libs/cua-driver/docs/jev-use-validation.md
+++ b/libs/cua-driver/docs/jev-use-validation.md
@@ -405,28 +405,37 @@ only the `cua.jev_choice_v1` response fields.
`verify_choice_cli.py` launches the Python interface with the active interpreter
and an absolute script path, passes JSON on stdin, and does not use a shell. The
credential-free workflow runs that verifier in mock mode; the separately
-authorized live workflow runs it with the reviewer-gated TypeSafe secret. The
-chooser itself relies on the official SDK's environment handling and never
-reads, prints, or forwards the key.
+authorized candidate workflow also runs it in mock mode, and no GitHub Actions
+workflow supplies the TypeSafe credential. The chooser itself relies on the
+official SDK's environment handling and never reads, prints, or forwards the
+key.
Final local verification passed 34 Python tests, 24 TypeScript tests,
TypeScript typechecking, both mock chooser commands, workflow YAML parsing, and
`git diff --check`. The SDK client tests cover live request/response shaping
with local fake transports; no live TypeSafe request was made locally.
-### Live workflow credential hardening
-
-The authorized workflow resolves and installs the locked Python and Node clients
-before the reviewer-gated secret is available. Secret-bearing steps now invoke
-the resulting `.venv/bin/python` directly; they do not run uv, pip, npm, cargo,
-or another resolver, installer, or build command. The chooser verifier continues
-to launch the absolute chooser path with that interpreter and without a shell.
-All third-party actions in the workflow are pinned to immutable commits.
-
-A focused workflow contract test enumerates every action reference and every
-step containing `TYPESAFE_API_KEY`. It requires 40-character action commits,
-the preinstalled interpreter path, and the absence of resolver, installer, and
-build invocations in those steps.
+### Workflow credential boundary
+
+No GitHub Actions workflow stores, references, or uses `TYPESAFE_API_KEY`. The
+authorized workflows keep the exact-SHA trusted-branch gate, the immutable
+signed-candidate verification, and the canonical Windows/Linux certification
+checks, and they run the bounded mock chooser rows through the preinstalled
+`.venv/bin/python`; they never run a live provider row or the chooser with a
+credential. All third-party actions in the workflow are pinned to immutable
+commits.
+
+A focused workflow contract test enumerates every action reference and requires
+40-character action commits, the preinstalled interpreter path, mock-only
+chooser invocations, and the complete absence of secret references. A separate
+repository-wide guard scans every Actions workflow so the credential name
+cannot be reintroduced through another workflow file.
+
+Live TypeSafe validation is an out-of-band procedure: it runs only directly on
+a disposable Tahoe Lume guest, with the credential supplied from that guest's
+local Keychain to the bounded chooser process. That procedure is maintained
+privately and publishes hashes and outcomes only — never the key value or
+fleet details.
Final focused verification passed 36 Python tests, 24 TypeScript tests,
TypeScript typechecking, workflow YAML parsing, and `git diff --check`.
diff --git a/libs/cua-driver/examples/jev-use/python/tests/test_authorized_workflow.py b/libs/cua-driver/examples/jev-use/python/tests/test_authorized_workflow.py
index d5ced30818..7370f4d357 100644
--- a/libs/cua-driver/examples/jev-use/python/tests/test_authorized_workflow.py
+++ b/libs/cua-driver/examples/jev-use/python/tests/test_authorized_workflow.py
@@ -18,20 +18,26 @@ class AuthorizedWorkflowTest(unittest.TestCase):
self.assertTrue(action_refs)
self.assertTrue(all(re.fullmatch(r"[0-9a-f]{40}", ref) for ref in action_refs))
- def test_secret_bearing_steps_use_only_preinstalled_python(self) -> None:
- steps = re.findall(
- r"(?ms)^ - (?:id: [^\n]+\n )?name:.*?(?=^ - |\Z)",
- self.workflow,
- )
- secret_steps = [step for step in steps if "TYPESAFE_API_KEY:" in step]
- self.assertEqual(len(secret_steps), 2)
+ def test_workflow_is_credential_free(self) -> None:
+ self.assertNotIn("TYPESAFE_API_KEY", self.workflow)
+ self.assertNotIn("secrets.", self.workflow)
+ self.assertNotIn("run_live", self.workflow)
+ self.assertNotIn("--live", self.workflow)
+
+ def test_mock_steps_use_preinstalled_python_and_audit_mock_rows(self) -> None:
self.assertIn(
'python_bin="$GITHUB_WORKSPACE/libs/cua-driver/examples/jev-use/.venv/bin/python"',
self.workflow,
)
- for step in secret_steps:
- self.assertNotRegex(step, r"\b(?:uv|npm|npx|cargo|pip|python)\s+(?:run|sync|install|build)")
- self.assertRegex(step, r"(?:\.venv/bin/python|\$python_bin)")
+ self.assertIn("verify_setup.py --typescript --max-steps 2", self.workflow)
+ self.assertIn(".venv/bin/python verify_choice_cli.py", self.workflow)
+ self.assertIn('assert summary["live_requested"] is False', self.workflow)
+ self.assertIn('assert summary["typescript_requested"] is True', self.workflow)
+ mock_checks = re.search(
+ r"name: Run bounded mock checks\n(?:[^\n]*\n)*?.*?verify_setup\.py --typescript",
+ self.workflow,
+ )
+ self.assertIsNotNone(mock_checks)
if __name__ == "__main__":
diff --git a/libs/cua-driver/tests/perception-demo/README.md b/libs/cua-driver/tests/perception-demo/README.md
index 1a3052975e..dd8e5da752 100644
--- a/libs/cua-driver/tests/perception-demo/README.md
+++ b/libs/cua-driver/tests/perception-demo/README.md
@@ -5,13 +5,15 @@ demo. Independent exact-SHA workflows run and certify the canonical Windows,
Linux X11, and logged-in macOS Lume Driver harnesses without live-provider
secrets. The protected workflows verify those run IDs and their machine-readable
certification artifacts instead of rerunning the broad matrices. A protected
-job consumes an immutable review-candidate aggregate, runs the ignored visual-only test with
-the measured review Driver, and makes the API key available only to the bounded
-Jev chooser process. After decode and schema validation, each review bundle is
-encrypted separately and the artifact upload contains only the resulting
-authenticated ciphertext envelopes. Manual and reusable workflow invocations
-must also set the required boolean `run_live` acknowledgement to `true` before
-the source gate permits protected work.
+job consumes an immutable review-candidate aggregate, runs the ignored
+visual-only test with the measured review Driver, and drives every chooser
+decision through the deterministic mock chooser; no GitHub Actions workflow
+stores, references, or uses the TypeSafe credential. After decode and schema
+validation, each review bundle is encrypted separately and the artifact upload
+contains only the resulting authenticated ciphertext envelopes. Manual and
+reusable workflow invocations only need the exact reviewed SHAs, candidate
+identifiers, and canonical run IDs; no live-call acknowledgement exists because
+no external live provider call remains in Actions.
The private candidate producer runs without an environment or production
secrets on Linux, Windows, and `macos-26`, then returns both its Actions run ID
@@ -108,8 +110,8 @@ upload step.
### Resume private collection without rerunning the desktop test
-If an artifact transfer or a local reel render fails after a successful live
-run, cache the encrypted Actions artifact by its immutable ID. First verify
+If an artifact transfer or a local reel render fails after a successful
+candidate run, cache the encrypted Actions artifact by its immutable ID. First verify
the run ID, workflow path, source SHA, artifact ID, and artifact name against
the reviewed certification record. In a private, mode-0700 directory, run:
@@ -138,7 +140,7 @@ rendering. If the test failed, the artifact expired, or the candidate changed
in a way that requires recertification, a cached download is not a substitute
for a new run. Do not attach the cache, staged envelopes, or plaintext to a PR.
-Native macOS certification remains separate from the Windows/Linux live-provider
+Native macOS certification remains separate from the Windows/Linux candidate
workflow. This proof runs directly in a logged-in, TCC-authorized Lume guest. A maintainer
dispatches `.github/workflows/e2e-rust-macos.yml` in `lume` mode, whose exact-SHA gate runs
`libs/cua-driver/tests/runners/macos-lume/run-all.sh --standalone-browser` and
@@ -147,8 +149,12 @@ candidate workflow does not schedule macOS execution, and no GitHub Actions
workflow represents the macOS gate. macOS recordings remain private on the
maintainer-controlled Lume host and are collected for review outside GitHub
Actions. The exact SHA, direct run ID, result, and evidence digest are recorded
-in the private review bundle and final PR audit. Windows and Linux continue to
-exercise the bounded live Jev chooser; the direct Lume matrix is the macOS
+in the private review bundle and final PR audit. Windows and Linux exercise the
+deterministic mock chooser in Actions; live TypeSafe validation runs only
+out-of-band, directly on a disposable Tahoe Lume guest whose guest-local
+Keychain supplies the credential to the bounded chooser process. That guest
+procedure is maintained privately, records only hashes and outcomes, and never
+publishes the key value or fleet details. The direct Lume matrix is the macOS
platform acceptance gate.
## Derived reels