Commit 6f26e07
committed
feat(triggers): run.command dispatches a registered extension command (#189)
The producer half of issue #189 Gap 2 (the runner protocol merged as
#192): a trigger may now name a registered pi extension command instead of
a flow, on all four trigger kinds.
Parse (shared validator, both services fail identically): exactly one of
run.flow or run.command, refused before every flow check so a command-only
entry never sees the wrong error; the value is validated exactly as the
runner validates PI_COMMAND (non-empty, no leading slash, no surrounding
whitespace, no control characters DEL included) so a file that loads never
refuses in-container; run.task, run.instructions and run.resume are
refused beside command, each naming both fields; everything else stays
orthogonal; an unflagged trigger normalizes byte-identically.
Prompt: a command job's prompt is exactly /name args, local and forge
alike, no envelope, no pointer, no trailing newline; the delivery rides
/job/event.json as the handler's data channel. CONST-ISSUE-TEXT-IS-DATA is
preserved and arguably strengthened: payload text reaches a command job
only as a file the handler chooses to parse, never as prompt prose.
Never AI-reachable, stricter than flows and BUILT rather than fallen out
(the OQ-022 inversion, now recorded there): chain requests carrying a
command key refuse outright as chain-command-refused before the charset
check, with no opt-in, and dispatch_run refuses a slash-leading flow with
a readable message on both invocation paths while remaining structurally
incapable of naming a command. Commands may chain OUT through their own
outbox; nothing chains INTO a command.
Receiver: knownFlows collects only flow-carrying rules; all four forge
gates (github, gitlab, forgejo, azure) dispatch command rules with the
comment phrase-plus-flow override channel INERT on them, so a collaborator
can neither retarget nor veto a command by appending words. Worker: cron
and forge job data carry command; both dedup keys use a cmd: prefix so a
command and a flow of one name cannot collide; image-preflight refuses a
command job on an image not declaring the commands capability, pre-spend,
as job-image-commands-unsupported; doctor counts command triggers and says
where they are verifiable. Admin: display and TUI show /name; the graph
carries command for issue #188; writeTriggers inherits the exclusion.
Specs: INT-TRIGGERS-FILE-CONTRACT AMENDED (the command clause on the
run.image no-model-callable-path template), INT-OUTBOX-CONTRACT AMENDED,
DES-COMMAND-ENTRY-POINT AMENDED (producer half), DES-AI-TRIGGER-FLOW-GATE
AMENDED, DES-JOB-OUTBOX-CHAINING AMENDED,
DES-TRIGGER-INSTRUCTION-IN-THE-ENVELOPE AMENDED (the byte-for-byte
objection answered: command prompts are NEW prompts), OQ-022 AMENDED,
REQ-AI-TRIGGERED-RUNS, REQ-CRON-SCHEDULED-JOBS and REQ-TRIGGER-AUTHOR-GATE
AMENDED. UNCHANGED, checked: DES-TRIGGERS-UNIFIED-FILE,
REQ-DEPLOYMENT-BOOTSTRAP, OQ-008, OQ-019 (its (b) stays open), OQ-009.
docs/workflows.md doctrine rewritten (run.flow and run.command are the two
entry points; the nobody-to-type-it premise refuted at the pin), both
READMEs and docs/job-image.md updated, triggers.example.json gains a cron
command entry.
Signed-off-by: Rob Boerman <robboerman@live.nl>1 parent d6a816a commit 6f26e07
50 files changed
Lines changed: 1699 additions & 151 deletions
File tree
- admin
- src
- test
- docs
- receiver
- src
- test
- specs
- worker
- src
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
142 | 148 | | |
143 | | - | |
144 | | - | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
150 | | - | |
| 156 | + | |
| 157 | + | |
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
196 | 210 | | |
197 | 211 | | |
198 | 212 | | |
| |||
282 | 296 | | |
283 | 297 | | |
284 | 298 | | |
285 | | - | |
286 | | - | |
| 299 | + | |
| 300 | + | |
287 | 301 | | |
288 | 302 | | |
289 | 303 | | |
290 | 304 | | |
291 | | - | |
292 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
293 | 308 | | |
294 | | - | |
295 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
296 | 312 | | |
297 | 313 | | |
298 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
| 375 | + | |
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
| |||
0 commit comments