Part of #302 (Phase 1). Pairs with ADR-025 and the PolicyEvaluator hooks.
Problem
Behavioral rules live in two places that do not meet:
- Pod contracts:
x-claw.include blocks with enforce/guide modes (ADR-009), inlined into AGENTS.generated.md — human/agent-readable prose, invisible to any policy engine as structured input.
- A policy service needs rules in a structured, per-agent form at a known location.
Today the cllama context mount (.claw-runtime/context/<agent-id>/) carries AGENTS.md, CLAWDAPUS.md, and metadata.json. There is no rules artifact.
Proposal
claw up compiles enforce (and optionally guide) blocks into a per-agent rules artifact — e.g. rules.json — emitted into the context mount alongside the existing files. The policy contract (ADR-025) references it as the canonical rule source for that agent. Compile-time, not runtime, per Compilation Principle 1.
Open questions
- Schema: structured rule objects vs ordered raw-text rules that an LLM-backed policy service interprets. (Raw text with stable IDs + mode + provenance is probably v1.)
- Scoping: per-agent only, or pod-level defaults with service overrides mirroring the existing
x-claw inheritance model?
- Precedence between pod-declared (compiled) rules and rules added at runtime through a policy service's own management surface — does compiled win, or do they merge with provenance tags?
- Should
guide blocks be included as advisory-tier rules or excluded from enforcement entirely?
Acceptance
claw up on a pod with enforce includes produces a deterministic rules artifact per agent.
- Artifact regenerates on contract change (staleness behavior consistent with existing lifecycle guards).
- Documented in CLLAMA_SPEC alongside the policy contract.
Part of #302 (Phase 1). Pairs with ADR-025 and the PolicyEvaluator hooks.
Problem
Behavioral rules live in two places that do not meet:
x-claw.includeblocks withenforce/guidemodes (ADR-009), inlined intoAGENTS.generated.md— human/agent-readable prose, invisible to any policy engine as structured input.Today the cllama context mount (
.claw-runtime/context/<agent-id>/) carriesAGENTS.md,CLAWDAPUS.md, andmetadata.json. There is no rules artifact.Proposal
claw upcompilesenforce(and optionallyguide) blocks into a per-agent rules artifact — e.g.rules.json— emitted into the context mount alongside the existing files. The policy contract (ADR-025) references it as the canonical rule source for that agent. Compile-time, not runtime, per Compilation Principle 1.Open questions
x-clawinheritance model?guideblocks be included as advisory-tier rules or excluded from enforcement entirely?Acceptance
claw upon a pod with enforce includes produces a deterministic rules artifact per agent.