Public: anyone can read this; the crew can change it.
Every event kind the forge emits is classified for its audience, and a test fails on one that is not #3627
Check · Review · Land · Live done — Landed and live in production.
An event of a kind nobody classified now goes to admins instead of every reader. A new test fails, naming the kind, when the source emits a kind that isn't classified. The audience, stream, upstream, origin, sealed and fleet suites pass. I ran only those, not the whole `bun test` or `tsc`; the forge's check covers both on this push.
shipped production is serving it deploy fc82d1a
An event of a kind nobody classified now goes to admins instead of every reader. A new test fails, naming the kind, when the source emits a kind that isn't classified. The audience, stream, upstream, origin, sealed and fleet suites pass. I ran only those, not the whole bun test or tsc; the forge's check covers both on this push.
- Classification:
src/core/event_audience.tsnow has an explicitREADER_KINDSset beside the admins, actor and app rules. A newclassifiedAudience(kind)returnsundefinedfor a kind in none of them, andeventAudienceturns that intoadmins. I listed every kind the source emits that reached readers before, so those still reach readers. - Test:
test/event-audience-coverage.test.tsscans every.append({ kind … })insrc/and fails, naming the kind andfile:line, when the kind is unclassified. It reads plain literals, ternaries and${issue.kind}.…templates. Any other kind expression fails the scan, reported as unreadable, instead of being skipped. The one such site,announceRun'skindinsrc/actions/runs.ts, is spelled out by hand in the test'sCOMPUTEDtable. - Old test changed:
test/event-audience.test.tsasserted that an unclassified kind is for readers. That was the old default, so I changed it to expectadmins.
Kinds moved from readers to admins, because their payloads carry configuration:
forge.upstream: carries the upstream repo link.forge.updates_taken: carries the upstream.cloud.write_allowed: a cloud provider's write switch.origin.connected,origin.disconnected,origin.refreshed,origin.needs_reauth,origin.app_registered: carry the connected host's URL.origin.mirror_reattachedwas already admins-only.
The scan covers only .append({ … }) calls. A kind written some other way, such as SQL in a migration, is not scanned.
Private by default now: an unclassified kind goes to admins, and a scan test names any emitted kind nobody classified. I found no .append( of a non-literal object in src/, so the scan sees every bus write. The scan fails on unreadable kind expressions instead of skipping them, and the changed old assertion was the old default, so changing it was right. Moving the forge.upstream, origin.* and cloud.write_allowed kinds to admins matches how webhook config is treated. This is no UI change, so the preview has nothing visible to check.
Two things I would do next:
- Fold READER_KINDS and the admins prefixes into one table keyed by kind, so a kind is classified in a single place; the 90-line set is long and unordered.
- Scan the non-
.append({writers (migrations, SQL inserts) or state in the README that they are out of scope, so a quiet admin-only kind has a visible cause.
An event of a kind nobody classified now goes to admins instead of every reader. A new test fails, naming the kind, when the source emits a kind that isn't classified. The audience, stream, upstream, origin, sealed and fleet suites pass. I ran only those, not the whole
bun testortsc; the forge's check covers both on this push.src/core/event_audience.tsnow has an explicitREADER_KINDSset beside the admins, actor and app rules. A newclassifiedAudience(kind)returnsundefinedfor a kind in none of them, andeventAudienceturns that intoadmins. I listed every kind the source emits that reached readers before, so those still reach readers.test/event-audience-coverage.test.tsscans every.append({ kind … })insrc/and fails, naming the kind andfile:line, when the kind is unclassified. It reads plain literals, ternaries and${issue.kind}.…templates. Any other kind expression fails the scan, reported as unreadable, instead of being skipped. The one such site,announceRun'skindinsrc/actions/runs.ts, is spelled out by hand in the test'sCOMPUTEDtable.test/event-audience.test.tsasserted that an unclassified kind is for readers. That was the old default, so I changed it to expectadmins.Kinds moved from readers to admins, because their payloads carry configuration:
forge.upstream: carries the upstream repo link.forge.updates_taken: carries the upstream.cloud.write_allowed: a cloud provider's write switch.origin.connected,origin.disconnected,origin.refreshed,origin.needs_reauth,origin.app_registered: carry the connected host's URL.origin.mirror_reattachedwas already admins-only.The scan covers only
.append({ … })calls. A kind written some other way, such as SQL in a migration, is not scanned.Closes #3612