registrystack / registrystack/registry-stack

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

Open Beginner friendly
#1,093 0 comments 0 reactions 0 assignees View on GitHub
area:breg area:docs documentation
Dominant language
Rust
Stars
2
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
130

Description

## 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.

Contributor guide

Open the contributing guide

Research direction

Read compile_event_delivery_inventory in crates/registry-breg/src/compiler.rs first, then update the projection row in docs/site/src/content/docs/configure/breg.mdx and add the ceiling row to docs/site/src/data/breg-events.yaml. Done means the documentation matches the compiler’s classificationCeiling derivation and explains that an excessive destination ceiling blocks activation rather than projection itself.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, yaml
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.