Repository navigation
feat(sessions): groupLabels: label sessions by owning group for dashboard badges - #39
Conversation
…th their group's label
An optional `groupLabels` map in the policy ({"22": {"label": "pit"}}) gives
groups a display label. Session lists, and the metadata and catalog views of one
session, then carry `relaygate: {gid, label}` for each readable session a
labeled group owns, so a dashboard can badge them. Labels grant nothing; no
defaults; unlabeled sessions and other views pass unchanged (single-session
views byte for byte); an upstream `relaygate` key is dropped. Validated by the
loader and POST /admin/v1/policy/validate (known gids, 1-24 plain characters).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
What
groupLabels, keyed by gid in decimal:"groupLabels": {"22": {"label": "pit", "description": "..."}}. Label is 1-24 chars of letters, digits, space,.,_,-(starts with a letter or digit, no trailing space);descriptionoptional, <=200 chars, never sent to readers. Every key must be a defined group. Validated byparsePolicy, so both the loader andPOST /admin/v1/policy/validate(and Control-owned policies) enforce it. No defaults. The field is.optional(), so the policy hash of an existing policy is unchanged.relaygate: {"gid": <n>, "label": "<label>"}:GET /sessions/v1/sessions(which relaygate already re-serialises after filtering);GET /sessions/v1/sessions/:id/metadataand.../catalog(the dashboard's detail header reads catalog through relay-control).relaygatekey coming from Sessions is dropped so only relaygate can say it. The owner is never named.examples/policy.pit.jsonlabels gid 22.Why
So the dashboard (relay-web, via relay-control) can show a group badge such as "pit" on sessions. Companion PRs follow in relay-control (pass the field through the catalog route) and relay-web (badge + filter).
Tests
npm run typecheck,npx vitest run(151 pass): list labeling only for readable labeled sessions, metadata/catalog labeling, byte-for-byte passthrough when unlabeled, forged upstream key dropped, no labels withoutgroupLabels, validator cases (unknown gid, bad label charset/length, leading-zero key, unknown fields), admin validate route.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds optional
groupLabelsto policies so the dashboard can badge sessions by their owning group, without changing any access decisions.groupLabels, keyed by gid in decimal, with a 1-24 characterlabeland optionaldescription(never sent to readers). Validated by the loader andPOST /admin/v1/policy/validate; unknown gids, bad label characters, and unknown fields are rejected.relaygate: {"gid", "label"}to each session a labeled group owns: every item ofGET /sessions/v1/sessionsand the top-level object of.../metadataand.../catalog. Unlabeled sessions and other views pass unchanged; arelaygatekey from Sessions is dropped so only relaygate can write it.Written for commit e196af4. Summary will update on new commits.