Repository navigation
Description
Guardrail class: this is the configuration surface for every class (G1–G7). By itself it adds no block.
Context
Decision: docs/decisions/governed-writable-workers.md ("The policy file"). Ruling 2 on #1636 places policy in the brain, versioned, and mounted read-only in every worker. It reverses R33's no-read rule, and R35 stays.
context/policies/ is already refused by the application route (if (folded[0] === "context", packages/ui-server/src/brain/application.ts:38) and by schedule definitions. The precedent for host-parsed Markdown under context/ is context/scheduled-tasks, which is excluded from the index (DEFAULT_EXCLUDE, packages/core/src/lib/config.ts:475).
Scope
- A zod schema,
schema_version: 1, in core, covering the keys in the decision's example:profiles,protect,release,budgets,scope,commands,egress,outward,taint,providers.- Unknown keys are refused.
releasemay name only tier B paths.profilescannot namerestricted, and no key reaches autonomous turns.- Command patterns follow
docs/decisions/confirm-patterns.md.
- Parsing goes through
parseFrontmatter. The Markdown body is ignored. - A read-only
brain policy check --jsoncommand, with a contract-tested envelope, reports whether the file is valid, any errors, the content hash and the resolved effective policy. - The server loads the policy at every turn start.
- When the file is invalid, the server keeps the last valid policy loaded in this process, or else the built-in defaults, and records a notice with the validation error.
- The policy hash is recorded on the turn.
- Profile selection for interactive and voice turns reads
profiles. context/policiesis added toDEFAULT_EXCLUDE.dirs.protectis added to the launcher's protected list from the profile issue. The confirmed authoritative-application bypass is corrected by ui-server: enforce admitted policy protection on authoritative agent writes #1743 in the same PR CONTRACT: read immutable governance policy at turn admission (#1650) #1741: captured protection also applies to curated Markdown and submitted PNG writes and their scratch cleanup. Both slices must be complete before readiness; this adds no new policy choice.docs/supported-inputs.mdand the integration contract list the file as a supported input.
Out of scope
- Enforcement of budgets, scope, commands, egress, outward actions, taint and providers. Each has its own sibling issue, which consumes the parsed policy.
- The approved-change route for agents (sibling issue).
- R34 grant files.
Acceptance criteria
- With a valid fixture policy that sets
profiles.interactive: strict, an interactive turn runsstrict. A test asserts this. - An invalid policy (an unknown key, a
releasethat names.git/config,profiles.voice: restricted) keeps the previous effective policy. A test asserts the notice and that the hash is unchanged. brain policy check --jsonreturns the documented envelope for valid, invalid and missing files, under contract tests.context/policies/governance.mdis not indexed. A test runsbrain indexover the fixture.- Mutation receipt: remove the
releasetier check and the.git/configtest fails.
Verification
bun run test in core and ui-server, the contract tests, then bun run check:pr --base origin/main.
Contract impact
Additive. A new supported input (the policy file, schema v1) and a new CLI --json envelope. CONTRACT: commit, minor changeset.
Blocked by #1649
Activity
schlessera commentedon Oct 12, 2026
Claim:
policy-1650-20261012-78381f66; branchfeat/1650-policy-reader-78381f66. Coordinated independent stacked implementation begins from the immutable #1649 candidate3eb4fc39ef8778ff978249480fa4edb4ef68731f. The existing #1649 dependency remains: any PR stays draft with Refs until corrected foundation integration and qualification. Scope is the read-only policy reader, profile/protection plumbing and their proof; sibling enforcement remains excluded. Milestone: 0.42.0.CONTRACT: read immutable governance policy at turn admission (#1650)
schlessera commentedon Oct 12, 2026
Unblocked: #1649 is closed, so
scripts/sync-project.tsis removing theblockedlabel.CONTRACT: read immutable governance policy at turn admission (#1650)
CONTRACT: read immutable governance policy at turn admission (#1650) (#…
schlessera commentedon Oct 12, 2026
Merged #1741 as
185803c4a67e1074a06007c88402cd3fdcfee0c2for 0.42.0, completing #1650, #1743 and #1744. The squash is on main with parent5876df6c81e8fe5e32f6bf1b97fa41397b29492e; tree2fd0ccc16e1ce09f3cca50ad26b9d46ab63fa9c7exactly matches the qualified combined checkout.PR CI run38297907419, attempt1, passed all14 selected jobs. Every actual checkout was
b9cfeaf182b9f7588590118e424b2d485494dbf4, with the recorded main/head parents; retention ledger was empty. The PR records original semantic failures, restored native/Docker/packed-consumer proof, independent review and job identities. Final contract and synchronization gates passed before the matching-head squash.The policy reader, admitted protection on authoritative agent writes and optional-core package correction are delivered. Separate command, policy-proposal, journal/revert, budget and scope enforcement remain programme work. Main CI run38300980826 passed all 14 selected jobs at the actual squash checkout
185803c4a67e1074a06007c88402cd3fdcfee0c2(attempt 1), including packaging, runtime, four unit shards, both browser/layout shards, captures and the final proof gate. The three closed issues and PR retain milestone0.42.0; this coordinator's claims are released. Publishing remains a maintainer-terminal action.