You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove delivery targets and declarative filters from the first event prompt API. The current Slack event prompt path derives delivery from the Slack event envelope and only needs event id, scope, context blocks, and a prompt body.
Refs #435
Co-Authored-By: GPT-5 Codex <codex@openai.com>
Copy file name to clipboardExpand all lines: specs/event-prompts.md
+17-33Lines changed: 17 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Define how Junior runs install-owned, version-controlled prompts in response to
16
16
- Startup validation for event bindings.
17
17
- Normalized inbound event envelopes, matching, idempotency, and dispatch.
18
18
- Prompt compilation for event payloads and hydrated event context.
19
-
- Runtime policy and delivery boundaries for event-triggered runs.
19
+
- Runtime policy and Slack delivery boundaries for event-triggered runs.
20
20
21
21
## Non-Goals
22
22
@@ -36,7 +36,7 @@ As an operator who customizes a Junior install, I want to add a Markdown file un
36
36
Acceptance criteria:
37
37
38
38
1. The event binding lives in version control.
39
-
2. Startup fails if the binding references an unknown event, unsupported context block, unsupported delivery target, unsupported selector, or empty prompt body.
39
+
2. Startup fails if the binding references an unknown event, unsupported context block, unsupported selector, or empty prompt body.
40
40
3. The plugin or platform integration supplies functionality and context; the install-owned Markdown body supplies the instruction.
41
41
4. Unsupported frontmatter is rejected instead of ignored so typos do not create surprising behavior.
42
42
@@ -78,7 +78,7 @@ As a trusted plugin author, I want to expose new event functionality without own
78
78
79
79
Acceptance criteria:
80
80
81
-
1. The plugin registers an event definition, supported selectors, context blocks, and delivery targets.
81
+
1. The plugin registers an event definition, supported scope selectors, and context blocks.
82
82
2. The plugin does not read `app/events/**/*.md` directly.
83
83
3. The plugin does not choose which install bindings run.
84
84
4. Raw provider payloads and credentials stay outside the model and binding frontmatter.
@@ -99,7 +99,7 @@ An **event run** is one core-created dispatched agent run for a matching `(bindi
99
99
100
100
### Plugin Event Definitions
101
101
102
-
Junior platform integrations may register built-in event definitions. Trusted plugins may register additional event definitions from app code. Declarative `plugin.yaml` manifests must not register event definitions because event definitions may own provider-specific normalization, filtering, hydration, and delivery behavior.
102
+
Junior platform integrations may register built-in event definitions. Trusted plugins may register additional event definitions from app code. Declarative `plugin.yaml` manifests must not register event definitions because event definitions may own provider-specific normalizationand hydration behavior.
103
103
104
104
The plugin-facing shape is:
105
105
@@ -108,8 +108,6 @@ type EventDefinitions = Record<string, AgentEventDefinition>;
4. Supported context block names and hydration/rendering functions.
125
-
5. Supported delivery targets.
121
+
3. Supported context block names and hydration/rendering functions.
126
122
127
-
The current implementation must reject unsupported event definition fields. Schema-backed value validation and event-level policy controls are future extensions that must wait for executor-level enforcement.
123
+
Unsupported event definition fields must be rejected instead of treated as reserved behavior.
128
124
129
125
Plugins must not:
130
126
@@ -155,9 +151,6 @@ scope:
155
151
context:
156
152
include:
157
153
- source_message
158
-
159
-
delivery:
160
-
target: channel
161
154
---
162
155
163
156
A new root message was posted in the configured Slack channel.
The Markdown body must be non-empty after frontmatter removal. It is the event run instruction and must not contain secrets.
184
175
@@ -194,7 +185,7 @@ Validation must reject:
194
185
2. Duplicate binding ids across files.
195
186
3. Binding ids that do not match the lowercase binding id format.
196
187
4. Bindings that reference unknown events.
197
-
5.`scope`, `when`,`context.include`, or `delivery` values unsupported by the referenced event definition.
188
+
5.`scope` or`context.include` values unsupported by the referenced event definition.
198
189
6. Markdown bodies that are empty after trimming.
199
190
7. Frontmatter values that require code execution, environment expansion, or secret interpolation.
200
191
@@ -259,9 +250,7 @@ The envelope scope is `{teamId, channelId}`. The payload includes `teamId`, `cha
259
250
260
251
### Matching And Idempotency
261
252
262
-
Core matches an event envelope against enabled bindings whose `event` matches the envelope event id. Matching is deterministic and uses only event-definition-owned `scope` and `when` filter logic.
263
-
264
-
V1 filters must stay declarative and bounded. Exact matches, set membership, and substring filters are acceptable. Arbitrary code, model calls, shell commands, and remote fetches are not filter mechanisms.
253
+
Core matches an event envelope against enabled bindings whose `event` matches the envelope event id and whose `scope` selectors match the envelope scope. Matching is deterministic and must not use arbitrary code, model calls, shell commands, or remote fetches.
265
254
266
255
Multiple matching bindings are allowed. Each matching binding creates at most one event run for the source event. The idempotency key is:
Duplicate provider deliveries must return or recover the same event run for the same `(bindingId, sourceEventId)` pair.
273
262
274
-
Self-event suppression is required by default. Events authored by Junior's own bot, app, or delivery identity must not trigger event runs unless the event definition and binding explicitly allow that case.
263
+
Self-event suppression is required. Events authored by Junior's own botor app identity must not trigger event runs.
275
264
276
265
Directed user-message entry points preempt ambient event prompts. For example, a Slack root channel message that contains Junior's bot mention must route through the explicit mention path and must not also create a `slack.channel.message.created` event prompt run.
277
266
278
-
Event definitions may define per-event actor allowlists, actor denylists, and rate-limit controls. Core must enforce them before dispatch.
279
-
280
267
### Context Hydration
281
268
282
269
Bindings choose context blocks through `context.include`. Each included block must be supported by the event definition.
@@ -325,7 +312,7 @@ The compiled prompt must make these facts explicit:
325
312
326
313
### Dispatch And Delivery
327
314
328
-
Event runs use the core dispatch mechanism, but dispatch must be platform-neutral before event prompts can deliver outside Slack.
315
+
Event runs use the core dispatch mechanism.
329
316
330
317
An event run dispatch record must store:
331
318
@@ -339,12 +326,9 @@ An event run dispatch record must store:
339
326
- safe correlation metadata
340
327
- run mode `event_prompt`
341
328
342
-
Event run destinations are derived from the binding delivery target and event envelope. Delivery adapters own platform-specific final output behavior:
343
-
344
-
- Slack delivery posts to configured Slack conversations using Slack `mrkdwn`.
345
-
- GitHub delivery posts to configured source issue, PR, or review-comment targets using GitHub-flavored Markdown.
329
+
V1 event run destinations are derived from the normalized Slack event envelope. Slack delivery posts to the configured Slack conversation using Slack `mrkdwn`.
346
330
347
-
Delivery adapters must enforce final delivery idempotency using stable assistant message ids derived from the event run dispatch id.
331
+
Delivery must enforce final Slack idempotency using stable assistant message ids derived from the event run dispatch id.
348
332
349
333
Event prompt runs may complete silently when the run succeeds with no assistant-visible text and no files. Silent success is an executor-level event-run behavior: Junior marks the dispatch completed and records the skipped delivery state without calling the platform delivery adapter. Ordinary user-message turns must continue to treat empty non-side-effect output as an execution failure.
350
334
@@ -355,10 +339,10 @@ Event runs are autonomous system-actor runs.
355
339
Core must enforce:
356
340
357
341
1. Disabled interactive auth continuation for system actors.
358
-
2. No use of user OAuth tokens unless a future explicit credential-subject contract permits it for the event run.
342
+
2. No use of user OAuth tokens during event runs.
359
343
3. No schedule-management or event-binding-management tools during event runs.
360
-
4. No Slack mutating tools during event runs until binding-level tool policy is implemented below the model; final event output goes through the delivery adapter.
361
-
5. Rejection of unsupported binding and event-definition fields until new policy controls are implemented below the model.
344
+
4. No Slack mutating tools during event runs; final event output goes through the delivery adapter.
345
+
5. Rejection of unsupported binding and event-definition fields.
362
346
363
347
Prompt wording is not sufficient enforcement for tools, credentials, delivery, or repository mutation policy.
364
348
@@ -460,8 +444,8 @@ Use integration tests for:
460
444
- One event can intentionally match multiple bindings.
461
445
- Self-authored provider events are suppressed by default.
462
446
- Selected context blocks render as data and not as instruction text.
463
-
- Event runs enforce tool availability and policy controls below the model.
464
-
-Platform delivery posts to the configured target exactly once best effort.
447
+
- Event runs enforce fixed tool availability below the model.
448
+
-Slack delivery posts to the event envelope destination exactly once best effort.
0 commit comments