Skip to content

BReg docs: the restricted-field projection rule does not match the compiled classification ceiling #1093

Description

@jeremi

What

docs/site/src/content/docs/configure/breg.mdx describes the projection member of an event contract with the sentence "Restricted fields cannot be projected." The compiler enforces no such rule. Restricted fields project fine; what the compiler derives instead is a destination classificationCeiling, and delivery is refused at activation when the compiled ceiling is higher than the ceiling the runtime configuration declares for the destination. An author who reads the page writes the wrong destination binding, or drops a field for a reason that does not exist.

The derived ceiling is the maximum of: the classification of every projected field, the classification of every field named in the event's when condition, the entity's own classification when the trigger is request_lifecycle, and internal when a request_lifecycle event may carry a reject or request-revision reason. So a request_lifecycle event on a restricted entity derives restricted even when every projected field is public.

Evidence

  • docs/site/src/content/docs/configure/breg.mdx, the projection row of the event contract member table (around line 392): "The field ids copied into the event payload's values. Restricted fields cannot be projected."
  • crates/registry-breg/src/compiler.rs, compile_event_delivery_inventory (from line 4119): the classifications vector chains event.projection with event_condition_fields(event), pushes entity.classification when event.trigger == EventTrigger::RequestLifecycle, pushes Classification::Internal when request_event_may_include_review_reason(event), and takes the maximum as classification_ceiling.
  • No event.projection.restricted diagnostic exists anywhere in crates/.
  • crates/registry-breg/src/event_destination.rs line 145 refuses activation with DeliveryCeilingWidening when delivery.classification_ceiling > config.classification_ceiling.

Proposed fix

Replace the sentence with the derivation rule, and say plainly that the consequence of projecting a restricted field is a higher destination ceiling, not a compile refusal. Add a row to docs/site/src/data/breg-events.yaml for the ceiling so the generated event reference carries it too.

Found while

Extracting reusable App Kit skills against Registry Stack v0.32.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bregBReg ownership.area:docsDocumentation site ownership.documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions