Skip to content

Commit 899f61d

Browse files
Restrict trusted perf evidence to server main
1 parent c1b00e2 commit 899f61d

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

docs/bounded-growth.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ for at least one hour, use compose-backed resource sampling, run on a
121121
self-hosted runner with an explicit `RUNNER_ENVIRONMENT=self-hosted` provenance
122122
value, include GitHub Actions provenance (`GITHUB_REPOSITORY`, `GITHUB_REF`,
123123
`GITHUB_SHA`, `GITHUB_WORKFLOW`, `GITHUB_RUN_ID`, and `GITHUB_RUN_ATTEMPT`),
124-
have a clean tracked working tree, meet sample coverage, and have no
125-
bounded-growth assertion failures. A local run can still produce useful
124+
come from `durable-workflow/server` on `refs/heads/main`, have a clean tracked
125+
working tree, meet sample coverage, and have no bounded-growth assertion
126+
failures. A local run or feature-branch workflow can still produce useful
126127
artifacts, but it cannot satisfy the trusted long-soak evidence profile just by
127128
setting `RUNNER_ENVIRONMENT=self-hosted`.
128129
The CI smoke workflow sets `RUNNER_ENVIRONMENT=github-hosted` so those artifacts

docs/perf-runner.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ final drain counts, sample coverage, GitHub runner provenance, and the
8383
SHA-256 digest of `config/dw-bounded-growth.php`. Trusted long-soak evidence
8484
also requires `tracked_working_tree_clean=true` and GitHub Actions provenance
8585
(`GITHUB_REPOSITORY`, `GITHUB_REF`, `GITHUB_SHA`, `GITHUB_WORKFLOW`,
86-
`GITHUB_RUN_ID`, and `GITHUB_RUN_ATTEMPT`), so artifacts from uncommitted source,
87-
policy edits, or ad hoc local runs are marked ineligible for the trusted profile.
86+
`GITHUB_RUN_ID`, and `GITHUB_RUN_ATTEMPT`) from `durable-workflow/server` on
87+
`refs/heads/main`, so artifacts from uncommitted source, policy edits, feature
88+
branches, forks, or ad hoc local runs are marked ineligible for the trusted
89+
profile.
8890
The harness fails when it cannot collect at least `DW_PERF_MIN_SAMPLE_COVERAGE`
8991
of the expected periodic samples, which defaults to 80%. The final post-drain
9092
sample is included in the artifact but does not count toward the periodic sample

scripts/perf/server_soak.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,10 @@ def evidence_trust_profile(
697697
reasons.append(f"runner environment is {runner_environment}, not self-hosted")
698698
if not github_actions_provenance_present(provenance):
699699
reasons.append("GitHub Actions provenance is incomplete")
700+
if str(provenance.get("repository") or "").strip() != "durable-workflow/server":
701+
reasons.append("GitHub Actions repository is not durable-workflow/server")
702+
if str(provenance.get("ref") or "").strip() != "refs/heads/main":
703+
reasons.append("GitHub Actions ref is not refs/heads/main")
700704
if not tracked_working_tree_clean:
701705
reasons.append("tracked working tree has uncommitted changes")
702706
if periodic_sample_count < minimum_trusted_samples:
@@ -713,6 +717,7 @@ def evidence_trust_profile(
713717
"runner_environment": runner_environment,
714718
"requires_self_hosted_runner": True,
715719
"requires_github_actions_provenance": True,
720+
"requires_server_main_ref": True,
716721
"requires_compose_resource_sampling": True,
717722
"requires_clean_tracked_working_tree": True,
718723
"reasons": reasons,

tests/Unit/ServerPerfHarnessContractTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ public function test_soak_summary_records_trusted_evidence_fields(): void
5454
'minimum_duration_seconds',
5555
'requires_self_hosted_runner',
5656
'requires_github_actions_provenance',
57+
'requires_server_main_ref',
5758
'requires_compose_resource_sampling',
5859
'requires_clean_tracked_working_tree',
5960
'runner environment is unknown',
6061
'GitHub Actions provenance is incomplete',
62+
'GitHub Actions repository is not durable-workflow/server',
63+
'GitHub Actions ref is not refs/heads/main',
6164
'tracked working tree has uncommitted changes',
6265
'duration below trusted long-soak minimum',
6366
'bounded-growth assertions failed',

0 commit comments

Comments
 (0)