docs(website): §7.1 Q9 — core's own news.post emitter #189
Reference in New Issue
Block a user
No description provided.
Delete Branch "docs/engagement-news-emitter-note"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A note the plan was missing, written up as an open question rather than decided. (Follows #188, which merged while this was being written — hence a second PR rather than another commit on that branch.)
The gap
news.postis a declared trigger with no caller.config/coreTriggers.jssays so in as many words ("these declare; nothing here emits yet") and Phase 6 migrated only the fourteam.*ones. A rule namingnews.postcan never fire, so on a real deployment the only in-app or email items the engine can produce today come from Teams. Phase 7 flagged it in passing; this writes it down.Why it is not a one-liner
The substance is not the call — it is the three other things a news publish already fires, and which of them the engine has any business replacing.
announceIfNewlyPublishedfans one publish four ways and they are different in kind:announce_job_legsmodule-uoownstowncrierdispatchPostHook('onSaved')registerPostHookpushDispatch.publish('news.post', …)engagementEmit.emit('core','news.post',…)registries.jsalready argues the first two apart ("a leg is a one-shot DELIVERY with retry and classification; a post hook maintains idempotent STATE"). Adding the engine makes a third distinction of the same kind, not a replacement for either.What modules keep, stated so nobody widens it by accident
A module has two doors onto a news publish — the announce leg and the post hook — and both are untouched. What it does not get is the ability to fire
news.postitself: the id's owner is core,ctx.events.emitbinds the owner at the call and never reads it from the arguments, and §7.2's one namespace gives an id exactly one owner across both facets. A module wanting its own person-facing news notification declares its own trigger throughregisterEventTriggers.Three things left open, deliberately
enableddefaults to0. Seed anews.postrule (enabled, against the standing default? or disabled with a banner, as the Team rules got?), or keep the tickle beside the emit for one release?enqueueIfNeededreturning a truthy job id is the single "newly published news" test, and the push call already piggybacks on it so an edit does not re-fire.Co-Authored-By: Claude.`news.post` is a declared trigger with no caller: `coreTriggers.js` says so in as many words, and Phase 6 migrated only the four `team.*` ones. A rule naming it can never fire, so on a real deployment the only in-app or email items the engine can produce today come from Teams. Phase 7 flagged it in passing; this writes it down properly as an open question. The substance is not the call — it is the three other things a news publish already fires, and which of them the engine has any business replacing: - the announce leg (`announce_job_legs`, `module-uo` owns `towncrier`) — a one-shot delivery to a channel of the deployment, with retry. NOT the engine's. - a module's post hook (`registerPostHook`) — idempotent state mirroring that also runs on delete and refreshes on a silent edit. NOT the engine's. - the raw `pushDispatch.publish('news.post', …)` — a per-person notification. THIS is the one that becomes an emit. So modules keep both doors onto a news publish and neither changes. What a module does not get is the ability to fire `news.post` itself — the id's owner is core, `emit` binds the owner at the call, and §7.2's one namespace gives an id exactly one owner across both facets. A module wanting its own person-facing news notification declares its own trigger. Three things to settle first, recorded rather than decided: continuity (the emit replacing the tickle stops push silently until a rule is enabled — G22's shape, and Phase 6 decision 3's), reusing the job-id transition signal rather than re-deriving it, and which phase owns it. Recommended home: Phase 11, whose title understates it — a pointer and an extra acceptance line land there too. Code: RunicGateway/website#175 Co-Authored-By: Claude <noreply@anthropic.com> (cherry picked from commit2fd5d065b7)