Skip to content

Commit 157f53f

Browse files
authored
Merge pull request #356 from PhysShell/claude/p022-hostqual
feat(step7): host qualification and the execution binding, kept apart
2 parents 80587c8 + bc9eb3c commit 157f53f

9 files changed

Lines changed: 3976 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: P-022 merge gate
2+
3+
# The merge order for the #263 preregistration, as a check rather than an
4+
# agreement. `mergegate.py` is run against the commit a merge would PRODUCE —
5+
# for a pull_request event that is `github.sha`, the merge ref, not the branch
6+
# head — because a PR number proves someone pressed a button and says nothing
7+
# about what the merged tree contains.
8+
#
9+
# Two jobs, and the gate needs the controls: a gate whose own controls are
10+
# failing must not be the thing that says a merge is safe. A failed controls job
11+
# leaves the gate job unreported, which a required check reads as unsatisfied.
12+
#
13+
# This workflow is one half of the wiring. The other half is a ruleset requiring
14+
# these two checks; without it the job reports and nothing is prevented. The
15+
# names below are the contexts that ruleset must name:
16+
#
17+
# P-022 merge gate controls
18+
# P-022 merge gate
19+
#
20+
# Least privilege as elsewhere in this repository: read-only, and every
21+
# third-party `uses:` pinned to a commit SHA with its version in a comment.
22+
23+
permissions:
24+
contents: read
25+
26+
on:
27+
pull_request:
28+
workflow_dispatch:
29+
30+
jobs:
31+
controls:
32+
name: P-022 merge gate controls
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
36+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
37+
with:
38+
python-version: "3.11"
39+
- name: the gate's own controls (fixtures ship the real tools and mutate them)
40+
run: python tests/test_step7_mergegate.py
41+
- name: the wiring's controls (applicability and co-change)
42+
run: python tests/test_step7_mergegate_ci.py
43+
44+
gate:
45+
name: P-022 merge gate
46+
needs: controls
47+
runs-on: ubuntu-latest
48+
steps:
49+
# Full history: the co-change rule compares the gate's own files against
50+
# the base commit, which a shallow clone would not carry.
51+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
52+
with:
53+
fetch-depth: 0
54+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
55+
with:
56+
python-version: "3.11"
57+
- name: the gate, against the commit this merge would produce
58+
env:
59+
# Read through the environment rather than interpolated into the
60+
# script body, so nothing from the event can be read as shell.
61+
MERGE_COMMIT: ${{ github.sha }}
62+
BASE_COMMIT: ${{ github.event.pull_request.base.sha }}
63+
run: |
64+
set -euo pipefail
65+
if [ -n "${BASE_COMMIT}" ]; then
66+
python scripts/step7/mergegate_ci.py --repo . \
67+
--commit "${MERGE_COMMIT}" --base "${BASE_COMMIT}"
68+
else
69+
python scripts/step7/mergegate_ci.py --repo . --commit "${MERGE_COMMIT}"
70+
fi
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"_EXAMPLE": "EXAMPLE / NOT EVIDENCE. This file is a shape to copy, never a declaration. It lives outside docs/evidence/ so it cannot be mistaken for one, and it carries no real environment id, fingerprint, operator or host name. A real declaration is signed off by an operator who has checked every line of it, and is content-addressed into a host qualification.",
3+
"_FORM": "This is the PHYSICAL-HOST form: is_vm is false, so the four VM-only fields are explicit 'n/a: <reason>' strings. On a VM invert it — is_vm true, and fixed_vcpu, fixed_ram, live_migration_disabled and dynamic_memory_disabled must ALL be literal true. A VM that cannot promise fixed vCPU, fixed RAM, no live migration and no dynamic memory is not a measurement host, and 'n/a' is not available there.",
4+
"_DECLARED": "Everything here is DECLARED evidence. A guest operating system cannot establish that nobody else is using the machine or that the hypervisor will not migrate it; the checker validates shape and value and binds these bytes by sha256, and never calls them machine proof.",
5+
"_SESSION": "Per-session facts are NOT here. 'No campaign workload is running', 'no interactive user', 'no prohibited background job' are properties of a moment, not of a machine, and belong in own.net/p022/session-declaration, taken fresh for each session.",
6+
7+
"kind": "own.net/p022/host-provisioning",
8+
"schema": 1,
9+
10+
"environment_id": "EXAMPLE-environment-id-assigned-by-the-owner",
11+
"host_fingerprint": "sha256:EXAMPLE-copy-the-value-the-environment-manifest-observed",
12+
13+
"dedicated_to_p022": true,
14+
"no_concurrent_user_workload": true,
15+
"hosted_ci_runner": false,
16+
17+
"virtualization": {
18+
"is_vm": false,
19+
"fixed_vcpu": "n/a: physical host, no hypervisor allocates its CPUs",
20+
"fixed_ram": "n/a: physical host, installed memory does not balloon",
21+
"live_migration_disabled": "n/a: physical host, nothing can migrate it",
22+
"dynamic_memory_disabled": "n/a: physical host, no dynamic memory to disable"
23+
},
24+
25+
"operator": "EXAMPLE-operator-name",
26+
"recorded_at": "EXAMPLE-2026-01-01T00:00:00+00:00"
27+
}

0 commit comments

Comments
 (0)