consent-plane: enforce terminal surface envelope - #33
Merged
Conversation
Adds consent-plane/surface.yaml (surface_id=terminal) + a verifier that FAILS CI if the envelope's containment is weakened (proven both ways), + the consent-plane-surface workflow. Conforms to socioprophet-agent-standards consent-plane/001 + sourceos-spec isolation-spaces-and-taints.
There was a problem hiding this comment.
Pull request overview
Adds a “consent-plane terminal surface” envelope to sourceos-shell and wires CI to enforce it by validating consent-plane/surface.yaml against hard containment invariants.
Changes:
- Add
consent-plane/surface.yamldefining the terminal surface envelope (deny purposes + denied spaces). - Add
consent-plane/verify_surface.pyto validate the envelope and fail CI if invariants are weakened. - Add a GitHub Actions workflow to run the verifier on PRs and pushes to
main.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
consent-plane/verify_surface.py |
Implements CI validation of the surface envelope invariants. |
consent-plane/surface.yaml |
Declares the repo’s terminal surface envelope configuration. |
.github/workflows/consent-plane-surface.yml |
Runs the verifier in CI for PRs and pushes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+7
| surface_id, so CI FAILS if the surface's containment is weakened. Conforms to | ||
| socioprophet-agent-standards consent-plane/001 + sourceos-spec | ||
| isolation-spaces-and-taints. Proven both ways by consent-plane/self_test.py. |
Comment on lines
+17
to
+27
| # Minimum containment each surface MUST assert (subset checks). | ||
| EXPECTED = { | ||
| "terminal": {"deny_purposes": {"egress", "operate"}, | ||
| "space_deny": {"kernel-space", "system-space"}}, | ||
| "notes": {"deny_purposes": {"egress", "operate"}, | ||
| "space_deny": {"kernel-space", "system-space", "data-namespace"}, | ||
| "consent_required": "per-purpose"}, | ||
| "browser": {"deny_purposes": {"implement", "operate"}, | ||
| "space_deny": {"kernel-space", "system-space", "user-space", "data-namespace"}, | ||
| "untrusted_input": True}, | ||
| } |
Comment on lines
+31
to
+33
| cp = yaml.safe_load(cfg.read_text()) or {} | ||
| sid = cp.get("surface_id") | ||
| errors: list[str] = [] |
Comment on lines
+39
to
+43
| got = cp.get(key) | ||
| if isinstance(want, set): | ||
| have = set(got or []) | ||
| if not want <= have: | ||
| errors.append(f"{key} must include {sorted(want)}; missing {sorted(want - have)}") |
Comment on lines
+13
to
+14
| - run: pip install pyyaml | ||
| - run: python3 consent-plane/verify_surface.py |
…/non-list, add self_test Copilot: (1) pin EXPECTED_SURFACE so surface.yaml can't be switched to a weaker surface; (2) fail cleanly (not a traceback) on a non-mapping surface.yaml and non-list set-fields; (3) add consent-plane/self_test.py so the 'proven both ways' claim is real (passes on the envelope; fires on weakening + surface switch); (4) workflow uses 'python -m pip' + runs the self_test + least-privilege perms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the consent-plane terminal surface real and enforced in
sourceos-shell.consent-plane/surface.yaml— the envelope (surface_id=terminal, deny_purposes, space_deny).consent-plane/verify_surface.py— fails CI if containment is weakened (verified both ways)..github/workflows/consent-plane-surface.yml— runs the verifier on PR/push.Conforms to
socioprophet-agent-standardsconsent-plane/001 (agent-standards#28) +sourceos-specisolation-spaces contract (sourceos-spec#254).