Skip to content

feat(policy): parse and validate policy.toml - #88

Merged
PiquelChips merged 1 commit into
mainfrom
feat/land-policy
Nov 22, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
feat/land-policy

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

init writes a policy.toml to the policy target, but nothing reads it: who orders each target, and what landing on it requires, are only words in the design. This gives the file its schema, so the landing queue can check it.

The schema:

  • [nodes]: each node's ed25519 public key.
  • [groups]: users and nodes, for requirements and path rules.
  • [targets.<name>]: the node that is the target's authority, and the statements landing on it requires. A target without a table has the authority of policy and requires nothing.
  • [[paths]]: ordered rules of what each grantee may do under a path. They're parsed and checked, but not enforced yet.

The policy in force is the one at the head of policy. Parsing checks every name the policy refers to: an authority must be a node with a key, a group must be defined, and unknown keys are errors, so a typo never drops a requirement. NodePublicKey and Verdict now parse as they display, and the policy init writes sketches groups and requirements in comments.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

`init` writes a `policy.toml` to the `policy` target, but nothing read
it: who orders each target, and what landing on it requires, were only
words in the design.

`Policy` gives the file its schema: `[nodes]` with each node's public
key, `[groups]` of users and nodes, a `[targets.<name>]` table with the
node that is the target's authority and the statements landing on it
requires, and ordered `[[paths]]` rules. A target without a table has
the authority of `policy` and requires nothing. The policy in force is
the one at the head of `policy`.

Parsing checks every name the policy refers to: an authority must be a
node with a key, a group must be defined, and unknown keys are errors,
so a typo never drops a requirement. Path rules are parsed and checked,
but not enforced yet. `NodePublicKey` and `Verdict` parse as they
display, for the file's values, and the policy `init` writes now
sketches groups and requirements in comments.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 55b651a8-998e-418e-8168-c283d41b5670
Commits

Reviewing files that changed from the base of the PR and between b4418b2 and 267492b.

Files selected for processing: 6

  • apps/origin-src/src/lib.rs
  • apps/origin-src/src/policy.rs
  • apps/origin-src/src/workspace/mod.rs
  • crates/origin-shared/src/object/acceptance.rs
  • crates/origin-shared/src/object/mod.rs
  • crates/origin-shared/src/object/statement.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips merged commit 8db2fa3 into main Nov 22, 2026
6 checks passed
@PiquelChips
PiquelChips deleted the feat/land-policy branch November 22, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant