Skip to main content

Module policy

Module policy 

Source
Expand description

The canonical policy, typed: .ai/repo/policy.yaml and the profiles beside it. The policy is the one canonical input of the provider projections; the shell tool reads the same file with the same subset reader, so the two agree byte for byte on what a projection is and which hash it carries.

Structs§

ContextPolicy
context: of the policy, the part the projections need.
ExemptionClass
One exemption class: a named reason work may proceed under no intent.
FreshnessPolicy
session.freshness: of the policy: how old a continuation record may be before it stops being current.
IntentPolicy
intent: — the binding a start is held to (ADR 0111).
KnowledgePolicy
knowledge: of the policy: the bounds on the review queue of derived knowledge records.
LoadedPolicy
The policy as loaded: the typed value, where it came from, and the hash the stamps carry.
Policy
The policy, typed to what the projections consume. Every other key is carried through unread: the policy schema under share/schemas/majordomus/policy/policy.v1.schema.json owns the full shape.
ProfilesPolicy
profiles: of the policy, the part the projections need.
Projection
One declared provider projection: projections[] in the policy.
ServerPolicy
server: — what a lease contest is judged by.
SessionPolicy
session: — what the episode boundary does beyond drawing itself.

Enums§

BindingMode
How strictly a start is held to its binding.
ProjectionMode
How a projection owns its target.

Constants§

POLICY_SECTION
The manifest section that holds the policy file.
PROFILES_SECTION
The manifest section that holds the profiles directory.

Functions§

is_safe_relative
A path is inside root after lexical normalisation: no absolute path, no .. component, nothing empty.
normal_form
The normal form of a file in the layer’s YAML subset, which the policy hash covers in place of its bytes: trailing spaces, tabs and carriage returns dropped; blank lines and whole-line comments dropped; a trailing comment (a # after a space or tab) dropped from a line that holds no quote, since inside a quoted scalar # may be text. Indentation, order and every value are kept, and every line ends in a newline.
profile_files
The profile files, <profiles>/*.yaml, sorted by name. An absent directory is no profile, not an error.
repository_providers_dir
The repository-relative directory where a repository may override a provider template.
sha256_bytes_hex
Hex SHA-256 of arbitrary bytes: the same digest sha256_hex takes, for content that is not necessarily text. A file the repository tracks may hold anything, and decoding it to hash it would be a decision about its encoding that nothing here is entitled to make.
sha256_hex
Hex SHA-256 of a text.