atlas-iac/scripts/ops/hermes_handoff_checks_delivery.py

385 lines
14 KiB
Python
Raw Normal View History

hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
#!/usr/bin/env python3
"""Acceptance checks for forge authority, node accounts, images, and regressions.
What the platform is allowed to do outside its own namespace: which forge
authority a worker holds, what a node account is and is not, how an image is
built and pinned, and whether the fixes the release depends on are actually
running rather than merely merged.
Where a property has no side-effect-free live probe — a merge that must never be
attempted, a branch protection the harness identity cannot read — the entry says
so in its rationale and asserts the nearest fact that *is* observable, rather
than quietly asserting nothing.
"""
from __future__ import annotations
from hermes_handoff_catalog import (
FORGE_CREDENTIAL_NAMES,
INIT_NAME_PROJECTION,
NODE_NAME_PROJECTION,
OPERATOR,
SELF,
Targets,
check,
step,
)
from hermes_handoff_model import ATTEMPT, CheckSpec
from hermes_handoff_policy import GITEA_CLIENT, projection, shell
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
def _forge(targets: Targets) -> list[CheckSpec]:
api = f"/api/v1/repos/{targets.repo}"
return [
check(
"forge.worker-holds-no-git-credential-variable",
"No forge credential is exported into the worker process",
"forge",
"names_absent",
[step("env", SELF, *shell("env_names"))],
{"step": "env", "names": FORGE_CREDENTIAL_NAMES},
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
rationale="The worker holds no forge credential at all: authenticated SCM traffic goes through the credential-isolated broker, never through the environment.",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
),
check(
"forge.identity-is-not-an-administrator",
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
"The broker's forge identity holds no administrative rights",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
"forge",
"json_field",
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
[step("user", SELF, GITEA_CLIENT, "read", "/api/v1/user")],
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
{"step": "user", "fields": {"is_admin": False}},
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
rationale="The broker holds the only forge credential the platform can use, so its identity is the one that must not be an administrator.",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
),
check(
"forge.repository-authority-is-push-only",
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
"The broker's repository authority is push-scoped, never administrative",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
"forge",
"json_field",
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
[step("repo", SELF, GITEA_CLIENT, "read", api)],
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
{
"step": "repo",
"fields": {
"permissions.admin": False,
"permissions.push": True,
"permissions.pull": True,
},
},
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
rationale="Merge, approve, close, and protection changes all require authority the broker identity is proven not to hold; the agent-side client additionally exposes no write besides draft creation.",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
),
check(
"forge.administrative-route-is-refused",
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
"An administrative forge route is refused through the broker",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
"forge",
"denied",
[
step(
"attempt",
SELF,
GITEA_CLIENT,
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
"read",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
f"{api}/branch_protections",
kind=ATTEMPT,
)
],
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
rationale="A live refusal from the broker's read allowlist, not a configuration reading. Other mandatory broker reads in this run prove the broker is healthy, so an outage cannot masquerade as this refusal across the catalog.",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
),
]
def _nodes(targets: Targets) -> list[CheckSpec]:
return [
check(
"nodes.hardening-covers-every-node",
"The node account audit runs on every node in the cluster",
"nodes",
"distinct_count",
[
step(
"coverage",
OPERATOR,
"kubectl",
"--namespace",
targets.namespace,
"get",
"pods",
"--selector",
f"app={targets.node_daemonset}",
"-o",
NODE_NAME_PROJECTION,
)
],
{
"step": "coverage",
"minimum": targets.node_count,
"total_equals": targets.node_count,
},
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
rationale="A hardened fleet with one unenrolled node is an unhardened fleet.",
),
]
def _build(targets: Targets) -> list[CheckSpec]:
pipeline = f"{targets.remote}/main:{targets.builder_pipeline}"
return [
check(
"build.builder-service-account-is-tokenless",
"The image builder service account mounts no API token",
"build",
"stdout_matches",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
[
step(
"serviceaccount",
OPERATOR,
"kubectl",
"--namespace",
targets.builder_namespace,
"get",
"serviceaccount",
targets.builder_serviceaccount,
"-o",
projection("jsonpath={.automountServiceAccountToken}"),
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
)
],
{"step": "serviceaccount", "equals": "false"},
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
),
check(
"build.builder-runs-unprivileged-with-exact-capabilities",
"The build pod is unprivileged and adds only the expected capabilities",
"build",
"names_present",
[step("pipeline", OPERATOR, "git", "show", pipeline, record=False)],
{
"step": "pipeline",
"names": (
targets.builder_capabilities,
"privileged: false",
"allowPrivilegeEscalation: false",
"automountServiceAccountToken: false",
'drop: ["ALL"]',
),
},
rationale="Exact lines, not a substring sweep: a widened capability set has to change one of these lines to take effect.",
),
check(
"build.harbor-immutability-rule-is-applied",
"The Harbor immutable-tag rule for the agent image has been applied",
"build",
"lines_match",
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
[
step(
"job",
OPERATOR,
"kubectl",
"--namespace",
targets.harbor_namespace,
"get",
"job",
targets.harbor_immutability_job,
"-o",
projection("jsonpath={.status.succeeded}"),
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
)
],
{"step": "job", "pattern": r"^[1-9][0-9]*$", "minimum": 1},
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
rationale="The job verifies the rule it creates, so a completed run is evidence the rule matched the expected contract.",
),
_release_lineage(targets),
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
]
def _release_lineage(targets: Targets) -> CheckSpec:
"""Bind the exact reviewed release from Git through the Ready pods."""
container = targets.agent_container
namespace = targets.namespace
deployment = f"deploy/{targets.agent_deployment}"
deployment_projection = projection(
(
"jsonpath={.metadata.generation}{'\\t'}{.status.observedGeneration}{'\\t'}"
"{.spec.replicas}{'\\t'}{.status.readyReplicas}{'\\t'}"
"{.metadata.annotations.deployment\\.kubernetes\\.io/revision}{'\\t'}"
f'{{.spec.template.spec.containers[?(@.name=="{container}")].image}}'
).replace("'", '"')
)
pod_projection = projection(
(
"jsonpath={range .items[*]}{.metadata.name}{'\\t'}{.status.phase}{'\\t'}"
"{range .status.conditions[?(@.type==\"Ready\")]}{.status}{end}{'\\t'}"
f'{{.spec.containers[?(@.name=="{container}")].image}}{{"\\t"}}'
f'{{.status.containerStatuses[?(@.name=="{container}")].imageID}}{{"\\t"}}'
"{.metadata.labels.pod-template-hash}{'\\n'}{end}"
).replace("'", '"')
)
replicaset_projection = projection(
(
"jsonpath={range .items[*]}{.metadata.name}{'\\t'}"
"{.metadata.annotations.deployment\\.kubernetes\\.io/revision}{'\\t'}"
"{.status.readyReplicas}{'\\t'}{.status.availableReplicas}{'\\t'}"
f'{{.spec.template.spec.containers[?(@.name=="{container}")].image}}{{"\\t"}}'
"{.metadata.labels.pod-template-hash}{'\\n'}{end}"
).replace("'", '"')
)
flux_projection = projection(
(
"jsonpath={.metadata.name}{'\\t'}{.metadata.generation}{'\\t'}"
"{.status.observedGeneration}{'\\t'}{.spec.suspend}{'\\t'}"
"{range .status.conditions[?(@.type==\"Ready\")]}{.status}{end}{'\\t'}"
"{.status.lastAppliedRevision}"
).replace("'", '"')
)
return check(
"release.exact-lineage-is-running",
"Remote main, merged reviewed PR, image, build, Flux, and running revision agree",
"release",
"release_lineage",
[
step(
"remote-main",
OPERATOR,
"git",
"ls-remote",
targets.remote,
"refs/heads/main",
),
step(
"reviewed-pr",
OPERATOR,
GITEA_CLIENT,
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
"read",
f"/api/v1/repos/{targets.repo}/pulls/{targets.reviewed_pr_number}",
),
step(
"build-source",
OPERATOR,
"git",
"rev-parse",
f"{targets.remote}/main",
),
step(
"merge-ancestry",
OPERATOR,
"git",
"merge-base",
"--is-ancestor",
targets.reviewed_head_sha,
f"{targets.remote}/main",
),
step(
"deployment",
OPERATOR,
"kubectl",
"--namespace",
namespace,
"get",
deployment,
"-o",
deployment_projection,
),
step(
"pods",
OPERATOR,
"kubectl",
"--namespace",
namespace,
"get",
"pods",
"--selector",
f"app={targets.agent_deployment}",
"-o",
pod_projection,
),
step(
"replicasets",
OPERATOR,
"kubectl",
"--namespace",
namespace,
"get",
"replicasets",
"--selector",
f"app={targets.agent_deployment}",
"-o",
replicaset_projection,
),
step(
"flux",
OPERATOR,
"kubectl",
"--namespace",
"flux-system",
"get",
"kustomization/hermes",
"-o",
flux_projection,
),
],
{
"main_sha": targets.remote_main_sha,
"head_sha": targets.reviewed_head_sha,
"head_ref": targets.reviewed_head_ref,
"pr_number": targets.reviewed_pr_number,
"image": targets.agent_image,
"build_sha": targets.build_sha,
"deployment_revision": targets.deployment_revision,
},
hermes: source handoff forge evidence through the scm broker The acceptance harness pinned a forge client that has never existed in any commit or pod (/opt/coordinator/gitea_api.py, digest f0943db4..., GIT/POST grammar, an askpass helper). Every Gitea-backed check was therefore unrunnable as merged. Point the harness at the credential-isolated SCM broker client that actually ships in the agent pod. - policy: GITEA_CLIENT=/opt/scm/gitea_api.py; trust /opt/scm/ instead of the phantom /opt/coordinator/; admit the client's real grammar (`read <api-path>`, exactly one path) with the same atlas/titan-iac pin and dot-segment rejection; bare HTTP methods are refused in every mode. The armed POST/PATCH/DELETE windows remain but are documented as deferred: the deployed client cannot execute them. - exec: pin the client digest to the sha256 of services/hermes/scm-common/scripts/gitea_api.py — the exact file the hermes-scm-boundary-v2 ConfigMap mounts at /opt/scm/gitea_api.py — so the pin is derivable from merged source and equal to the deployed client. gitea_api.py gains a narrow /api/v1/user identity read in _authorize_read (see below), so the pin is the NEW source hash 76efd16dedbeb74425b12fbbdbfaa391854771292077e0463bf22706855ae6dc. Drop the dangling GIT_ASKPASS (no helper exists; broker git needs none) and swap /opt/coordinator for /opt/scm in SAFE_PATH. - checks: all forge/baseline/lineage probes use (client, "read", path). The SELF-vantage identity checks now truthfully assert the *broker's* forge identity (the only one the platform can exercise) is not an administrator and holds push-scoped, non-administrative repository authority; the administrative-route check asserts the broker read allowlist's live refusal of branch_protections. The remote-main step keeps `origin` (the broker remote exists only in pool workspaces and the broker origin is cluster-local); its rationale now tells the operator to ensure origin fetchability. - gitea_api.py/_authorize_read: allow exactly `/api/v1/user` (no query, no sibling routes) as operation "identity" so the harness can prove the broker identity is not an administrator. The broker imports the same module, so one reviewed edit covers both sides of the boundary. - rules: DENIAL_MARKERS now match the client's real refusal lines ("SCM broker request failed with HTTP 400/403" and the no-credential rejection) and drop "gitea api returned http 403", which the client never emits; a broker 404 is deliberately not denial evidence. - ephemeral: index/verification reads use the real grammar; manual cleanup guidance now says close/delete require operator forge credentials (the client exposes no mutation besides create-draft); armed mode is documented as deferred until the probes are rebuilt on the broker's bounded mutation surface. - docs: broker vantage/evidence section, operator prerequisites (broker healthy, no /vault/secrets/gitea-token anywhere on the harness path, current ConfigMap mount, operator-side client + origin fetchability), armed-mode deferral. - tests: read-grammar accepted / GET refused in every mode, /opt/scm attestation pin proven equal to the merged source digest, real denial-marker matching, /api/v1/user identity route bounds; the repository-pin mutant probe speaks the new grammar. Full handoff + gitea + broker families pass (952 tests), mutation gate 13/13, per-file line+branch coverage >=95%, all touched sources within the 500-line cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:43:13 -03:00
rationale="A PASS requires one exact release identity across every source and running object. The remote-main step needs a fetchable origin from the operator checkout: ensure `git ls-remote origin refs/heads/main` works with the operator's own forge access before the run, or this check is NOT_RUN.",
)
hermes: add a fail-closed full-handoff acceptance harness Decides whether the Hermes platform handoff is fit to release, and refuses to round an absence of evidence up to a pass. The harness is read-only by default and classifies 71 checks PASS / FAIL / NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a harness-level problem: an unreachable vantage, a catalog entry whose evidence no longer exists, an expired deadline, or an evaluator that raised. Evidence comes from two vantages that cannot cover for each other: an external read-only operator kubeconfig, and the Hermes agent probing itself from inside its own pod. Before any check runs, the harness asks each vantage who it is and stops if they are the same principal, because dual-vantage evidence from one identity is a restatement rather than a corroboration. `--as` is rejected for every operator-side command and reachable only as the inner command of a `kubectl exec`, so impersonation can never stand in for a real self-probe. A deny check needs a live refused request, not only an authorization review. Two safety properties are structural rather than conventional, enforced where an argv becomes a subprocess: the default mode mutates nothing (mutating verbs require a server dry run; there is deliberately no live TokenRequest probe, because a successful one would mint a real credential), and no probe can pull a credential value into a report (no vault/sops/curl, secrets readable only with -o name, environment probes list names, shell only through frozen reviewed templates). Captures are bounded before they are screened, and the rendered report is re-screened before it is written. Mutation lives behind a separate arming flag with an exact confirmation phrase, a caller-supplied unique ref, a preflight that refuses a protected push target before any network call, and a cleanup whose verification is itself mandatory. A default run reports those four checks NOT_RUN. The catalog is declarative so a reviewer reads what is asserted rather than how it is plumbed, and so structural properties can be proven over every entry before a run. Catalog drift surfaces as NOT_RUN, which stops the release. docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18 on top of the merged #13 baseline, the image build and Flux rollout, the rollback point for each step, the go/no-go checklist, and the limits that are asserted rather than exercised. Validation: 295 handoff tests pass with 100% line coverage on all 15 new modules; the full unit suite is 647 passed with two failures that reproduce unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff credential screen are clean; a live read-only run against Atlas returns NO_GO for the pre-merge cluster with no unscreened fields in the report.
2026-08-17 10:14:17 +00:00
def _reliability(targets: Targets) -> list[CheckSpec]:
return [
check(
"reliability.finalization-and-replay-patches-are-deployed",
"The agent workload runs the finalization, replay, and session patches",
"reliability",
"names_present",
[
step(
"init",
OPERATOR,
"kubectl",
"--namespace",
targets.namespace,
"get",
f"deploy/{targets.agent_deployment}",
"-o",
INIT_NAME_PROJECTION,
)
],
{"step": "init", "names": targets.agent_init_containers},
rationale="The regression suites live in the repository; this asserts the fixes they cover are actually running.",
),
check(
"reliability.regression-suites-are-present-on-main",
"The decomposition and worker-recovery regression suites are on main",
"reliability",
"names_present",
[
step(
"suites",
OPERATOR,
"git",
"ls-tree",
"--name-only",
f"{targets.remote}/main",
"testing/tests/",
)
],
{
"step": "suites",
"names": (
"testing/tests/test_hermes_cli_lanes.py",
"testing/tests/test_hermes_coordinator.py",
"testing/tests/test_hermes_worker_recovery.py",
),
},
),
]
def delivery_checks(targets: Targets) -> list[CheckSpec]:
"""Return the forge, node, build, and reliability checks."""
return [
*_forge(targets),
*_nodes(targets),
*_build(targets),
*_reliability(targets),
]