From 95e663c1c386f52d142a387047f59354b70bebdf Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Tue, 10 Nov 2026 13:23:46 +0000 Subject: [PATCH 1/8] Record the root's preview template decisions after D7's prototype --- docs/agents/plans/security-0.4/d-build-proof.md | 16 ++++++++++++---- docs/agents/plans/security-0.4/d-plan.md | 16 +++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/docs/agents/plans/security-0.4/d-build-proof.md b/docs/agents/plans/security-0.4/d-build-proof.md index 48f018f465..f111b129c2 100644 --- a/docs/agents/plans/security-0.4/d-build-proof.md +++ b/docs/agents/plans/security-0.4/d-build-proof.md @@ -294,9 +294,11 @@ PreviewRule purpose: Rule services [PreviewService] name ServiceName template PayloadDigest the preview's spec with derived fields as placeholders (below) + setup Option the same with its Setup Commands, for a first creation policy BuildPolicy secrets Option inherit [String] parent Sealed keys this Service may open in a preview + generated {key: Generator} Generated Values, each `secret(LEN, "CHARSET")` ``` **Who is trusted.** The signed list of GitHub account IDs. Cloud's membership rows cannot add to it. For a `push` run, `actor_id` is the account that pushed. For a re-run it stays the original actor, so a re-run cannot change who is trusted. A bot is trusted only if its ID is in the list. Ployz's own App bot is never added by default. @@ -305,18 +307,24 @@ PreviewRule purpose: Rule ### Derived fields, checked before hashing -A preview's spec differs from its parent's in three fields Cloud used to choose: the Namespace, preview hostnames, and the Sealed identity's Environment. Under a preview rule, the Machine derives each one itself from the signed rule and facts it verified, checks the spec holds exactly that value, and only then hashes. +A preview's spec differs from its parent's in fields Cloud used to choose: the Namespace, preview hostnames, the Sealed identity's Environment, and Generated Values. Under a preview rule, the Machine derives or checks each one itself from the signed rule and facts it verified, checks the spec holds exactly that value, and only then hashes. - **Preview key.** For a trusted push, `branch:`, from the verified `ref` claim. For a review, the key the signed review names, `branch:` or `fork:`. - **Namespace.** `pv--`. The rule ID is 128 random bits from the approver's client, so Cloud cannot choose it to collide with another rule's. That pattern is reserved. A Machine refuses any creation in a Namespace of that form unless it is admitted under the preview rule it derives from. It also refuses a preview-rule creation in any other Namespace. Thread C's deploy approval and the automatic deploy rule refuse reserved Namespaces, and Cloud's Namespace allocator never hands one to an ordinary Environment. So preview code can only land in a Namespace that holds nothing but that preview's own Containers and Volumes. A preview's Ordinary and Provisioned Volumes get their physical names from the Namespace (`ScopedVolumeSource::physical_name`, `ployz-core/src/domain/volume.rs:104`). So preview code cannot mount a production Volume of those kinds. - **Hostnames.** Each Ingress hostname in a preview spec must be `