@wichayutdew/pi-workflows 2.5.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +34 -1
  2. package/dist/index.js +1315 -2467
  3. package/examples/starter-kit/agents/planner.md +11 -0
  4. package/examples/starter-kit/agents/reviewer.md +10 -0
  5. package/examples/starter-kit/agents/scout.md +10 -0
  6. package/examples/starter-kit/agents/worker.md +11 -0
  7. package/examples/starter-kit/agents/workspace-preparer.md +10 -0
  8. package/examples/starter-kit/investigate.workflow.yaml +84 -0
  9. package/examples/starter-kit/jira.workflow.yaml +75 -0
  10. package/examples/starter-kit/mr-comment.workflow.yaml +86 -93
  11. package/examples/starter-kit/mr-review.workflow.yaml +52 -88
  12. package/examples/starter-kit/settings.yaml +4 -0
  13. package/examples/starter-kit/steps/investigate/investigate.md +40 -0
  14. package/examples/starter-kit/steps/investigate/retrieve.md +28 -0
  15. package/examples/starter-kit/steps/investigate/validate.md +20 -0
  16. package/examples/starter-kit/steps/jira/create.md +25 -0
  17. package/examples/starter-kit/steps/jira/draft.md +18 -0
  18. package/examples/starter-kit/steps/jira/plan.md +30 -0
  19. package/examples/starter-kit/steps/mr-comment/checkout-source.md +14 -0
  20. package/examples/starter-kit/steps/mr-comment/fetch.md +11 -28
  21. package/examples/starter-kit/steps/mr-comment/implement.md +9 -26
  22. package/examples/starter-kit/steps/mr-comment/plan.md +46 -55
  23. package/examples/starter-kit/steps/mr-comment/publish.md +11 -31
  24. package/examples/starter-kit/steps/mr-comment/verify.md +7 -34
  25. package/examples/starter-kit/steps/mr-review/fetch.md +13 -21
  26. package/examples/starter-kit/steps/mr-review/publish-approved.md +18 -0
  27. package/examples/starter-kit/steps/mr-review/review-for-approval.md +53 -0
  28. package/examples/starter-kit/steps/mr-review/verify-published.md +16 -0
  29. package/examples/starter-kit/steps/shared/prepare-workspace.md +11 -89
  30. package/examples/starter-kit/steps/shared/publish-remote.md +16 -0
  31. package/examples/starter-kit/steps/ticket/implement.md +10 -23
  32. package/examples/starter-kit/steps/ticket/plan.md +49 -98
  33. package/examples/starter-kit/steps/ticket/verify.md +14 -65
  34. package/examples/starter-kit/steps/work/implement.md +11 -22
  35. package/examples/starter-kit/steps/work/plan.md +43 -59
  36. package/examples/starter-kit/steps/work/verify.md +14 -25
  37. package/examples/starter-kit/ticket.workflow.yaml +57 -61
  38. package/examples/starter-kit/work.workflow.yaml +49 -57
  39. package/package.json +9 -19
  40. package/schemas/workflow.schema.json +63 -15
  41. package/scripts/patch-herdr-agent-state.mjs +36 -0
  42. package/src/agents/profile.ts +98 -0
  43. package/src/config/ceiling.ts +0 -82
  44. package/src/config/types.ts +15 -53
  45. package/src/config/validation/settings.ts +2 -14
  46. package/src/config/validation/step.ts +129 -8
  47. package/src/config/validation/workflow.ts +1 -10
  48. package/src/engine/run-workflow-validation.ts +0 -3
  49. package/src/engine/state-types.ts +1 -1
  50. package/src/harness/action-context.ts +1 -13
  51. package/src/harness/artifact-contract.ts +46 -0
  52. package/src/harness/delegation-control-actions.ts +4 -63
  53. package/src/harness/delegation-plan.ts +26 -80
  54. package/src/harness/delegation-response-actions.ts +22 -135
  55. package/src/harness/dependencies.ts +1 -12
  56. package/src/harness/gate-submission-action.ts +28 -0
  57. package/src/harness/status-actions.ts +20 -0
  58. package/src/harness/step-execution-actions.ts +2 -9
  59. package/src/harness/types.ts +2 -40
  60. package/src/harness.ts +2 -17
  61. package/src/herdr-workflow-state.ts +65 -0
  62. package/src/index.ts +4 -9
  63. package/src/integrations/subagents/child-policy-validation.ts +6 -7
  64. package/src/integrations/subagents/child-runtime-dependencies.ts +1 -1
  65. package/src/integrations/subagents/child-runtime-policy.ts +1 -7
  66. package/src/integrations/subagents/child-runtime.ts +18 -9
  67. package/src/integrations/subagents/client.ts +240 -98
  68. package/src/integrations/subagents/protocol-events.ts +32 -15
  69. package/src/integrations/subagents/protocol.ts +1 -1
  70. package/src/preflight.ts +0 -8
  71. package/src/prompt/main-workflow-notice.ts +8 -15
  72. package/src/prompt/step-task.ts +7 -6
  73. package/src/workflow-status/format-status.ts +5 -1
  74. package/src/workflow-status/render-step-detail.ts +94 -0
  75. package/src/workflow-status/types.ts +1 -0
  76. package/src/workflow-status/view.ts +49 -14
  77. package/agents/step.md +0 -32
  78. package/examples/mr-comments.workflow.yaml +0 -125
  79. package/examples/prompts/mr-comments/implement.md +0 -17
  80. package/examples/prompts/mr-comments/inspect.md +0 -5
  81. package/examples/prompts/mr-comments/plan.md +0 -54
  82. package/examples/prompts/mr-comments/verify.md +0 -9
  83. package/examples/settings.yaml +0 -27
  84. package/examples/starter-kit/steps/mr-review/publish.md +0 -48
  85. package/examples/starter-kit/steps/mr-review/review.md +0 -76
  86. package/examples/starter-kit/steps/mr-review/verify.md +0 -35
  87. package/src/config/validation/subagent.ts +0 -288
  88. package/src/harness/delegation-failure.ts +0 -248
  89. package/src/harness/delegation-recovery-validation.ts +0 -161
  90. package/src/harness/delegation-retry-policy.ts +0 -120
  91. package/src/integrations/subagents/client-delegation.ts +0 -181
  92. package/src/integrations/subagents/client-messages.ts +0 -66
  93. package/src/integrations/subagents/client-types.ts +0 -36
  94. package/src/integrations/subagents/diagnostic-format.ts +0 -45
  95. package/src/integrations/subagents/diagnostic-text.ts +0 -114
  96. package/src/integrations/subagents/diagnostic-types.ts +0 -83
  97. package/src/integrations/subagents/diagnostics.ts +0 -26
  98. package/src/integrations/subagents/failure-correlation.ts +0 -285
  99. package/src/integrations/subagents/failure-transcript.ts +0 -252
  100. package/src/integrations/subagents/hidden-bash-failure.ts +0 -98
  101. package/src/integrations/subagents/replay-audit.ts +0 -146
  102. package/src/integrations/subagents/replay-safety.ts +0 -67
  103. package/src/integrations/subagents/session-diagnostics.ts +0 -357
@@ -17,6 +17,7 @@ import { padAnsi } from './layout.ts';
17
17
  import { renderBoard, renderEmptyBoard } from './render-board.ts';
18
18
  import { buildPathEntries } from './render-path.ts';
19
19
  import {
20
+ renderLiveWorkerActivity,
20
21
  renderStepDetail,
21
22
  selectedStepDetail,
22
23
  stepTranscriptCacheKey,
@@ -45,7 +46,7 @@ export type WorkflowStatusViewDependencies = {
45
46
 
46
47
  type ViewportState = {
47
48
  readonly isClosed: boolean;
48
- readonly mode: 'board' | 'detail';
49
+ readonly mode: 'board' | 'detail' | 'live';
49
50
  readonly selectedIndex: number;
50
51
  readonly scrollOffset: number;
51
52
  readonly viewportRows: number;
@@ -196,7 +197,9 @@ export class WorkflowStatusView implements Component {
196
197
  return;
197
198
  }
198
199
  if (matchesKey(data, 'escape')) {
199
- if (this.state.mode === 'detail') {
200
+ if (this.state.mode === 'live') {
201
+ this.showDetail();
202
+ } else if (this.state.mode === 'detail') {
200
203
  this.showBoard();
201
204
  } else {
202
205
  this.close();
@@ -206,7 +209,12 @@ export class WorkflowStatusView implements Component {
206
209
  const pageSize = Math.max(1, this.state.viewportRows - 2);
207
210
  const contentHeight = Math.max(1, this.state.viewportRows - 1);
208
211
  const halfPageSize = Math.max(1, Math.floor(contentHeight / 2));
209
- if (this.state.mode === 'detail') {
212
+ if (this.state.mode === 'detail' || this.state.mode === 'live') {
213
+ if (matchesKey(data, Key.tab)) {
214
+ if (this.state.mode === 'detail') this.showLive();
215
+ else this.showDetail();
216
+ return;
217
+ }
210
218
  if (data === 'gg' || (data === 'g' && this.pendingDetailTopKey)) {
211
219
  this.pendingDetailTopKey = false;
212
220
  this.setScrollOffset(0);
@@ -220,7 +228,8 @@ export class WorkflowStatusView implements Component {
220
228
  if (data === 'G') {
221
229
  this.setScrollOffset(Number.MAX_SAFE_INTEGER);
222
230
  } else if (matchesKey(data, Key.left) || data === 'h') {
223
- this.showBoard();
231
+ if (this.state.mode === 'live') this.showDetail();
232
+ else this.showBoard();
224
233
  } else if (matchesKey(data, Key.down) || data === 'j') {
225
234
  this.setScrollOffset(this.state.scrollOffset + 1);
226
235
  } else if (matchesKey(data, Key.up) || data === 'k') {
@@ -288,14 +297,21 @@ export class WorkflowStatusView implements Component {
288
297
  this.transcriptCache,
289
298
  contentWidth,
290
299
  )
291
- : renderBoard(
292
- this.theme,
293
- snapshot,
294
- contentWidth,
295
- false,
296
- this.statusShortcutLabel,
297
- this.state.selectedIndex,
298
- )
300
+ : this.state.mode === 'live'
301
+ ? renderLiveWorkerActivity(
302
+ this.theme,
303
+ snapshot,
304
+ this.state.selectedIndex,
305
+ contentWidth,
306
+ )
307
+ : renderBoard(
308
+ this.theme,
309
+ snapshot,
310
+ contentWidth,
311
+ false,
312
+ this.statusShortcutLabel,
313
+ this.state.selectedIndex,
314
+ )
299
315
  : renderEmptyBoard(this.theme, contentWidth);
300
316
  if (snapshot && this.state.mode === 'detail') {
301
317
  this.ensureSelectedTranscripts(snapshot);
@@ -311,8 +327,10 @@ export class WorkflowStatusView implements Component {
311
327
  this.statusShortcutLabel,
312
328
  this.theme,
313
329
  this.state.mode === 'detail'
314
- ? '↑↓/jk · Ctrl+D/U half-page · gg/G top/bottom · PgUp/PgDn · ←/h/Esc'
315
- : '↑/↓ or j/k select · Enter/→/l inspect · PgUp/PgDn',
330
+ ? '↑↓/jk · Ctrl+D/U half-page · gg/G top/bottom · PgUp/PgDn · Tab live · ←/h/Esc'
331
+ : this.state.mode === 'live'
332
+ ? '↑↓/jk · Ctrl+D/U half-page · gg/G top/bottom · PgUp/PgDn · Tab/←/h/Esc overview'
333
+ : '↑/↓ or j/k select · Enter/→/l inspect · PgUp/PgDn',
316
334
  );
317
335
  this.state = page.state;
318
336
  return page.lines;
@@ -376,6 +394,23 @@ export class WorkflowStatusView implements Component {
376
394
  this.tui.requestRender(true);
377
395
  }
378
396
 
397
+ private showDetail(): void {
398
+ if (this.state.mode === 'detail') return;
399
+ this.pendingDetailTopKey = false;
400
+ this.state = { ...this.state, mode: 'detail', scrollOffset: 0 };
401
+ this.tui.requestRender(true);
402
+ }
403
+
404
+ private showLive(): void {
405
+ const snapshot = this.getSnapshot();
406
+ if (!snapshot) return;
407
+ const entry = buildPathEntries(snapshot)[this.state.selectedIndex];
408
+ if (!entry?.isCurrent || snapshot.execution?.kind !== 'subagent') return;
409
+ this.pendingDetailTopKey = false;
410
+ this.state = { ...this.state, mode: 'live', scrollOffset: 0 };
411
+ this.tui.requestRender(true);
412
+ }
413
+
379
414
  private ensureSelectedTranscripts(
380
415
  snapshot: NonNullable<ReturnType<SnapshotProvider>>,
381
416
  ): void {
package/agents/step.md DELETED
@@ -1,32 +0,0 @@
1
- ---
2
- name: step
3
- package: pi-workflows
4
- description: Executes one declarative Pi Workflows step under child-side policy
5
- systemPromptMode: append
6
- inheritProjectContext: true
7
- inheritSkills: false
8
- defaultContext: fresh
9
- completionGuard: false
10
- ---
11
-
12
- Execute the supplied workflow step exactly as instructed.
13
-
14
- The Pi Workflows child runtime selects and enforces the step's tools, MCP
15
- selectors, Bash policy, extension tools, skills, outcomes, and completion
16
- contract. Do not broaden those permissions. Follow the supplied workflow prompt
17
- when choosing an outcome; outcome names have no built-in domain meaning.
18
-
19
- Each step is an isolated, non-interactive child using its configured Pi
20
- Subagents profile and workflow prompt. Complete delegated work through
21
- pi-subagents' `structured_output`; `workflow_complete_step` belongs to
22
- main-agent workflow steps. Never call `contact_supervisor`,
23
- `subagent_supervisor`, or `intercom`. The workflow prompt defines artifact
24
- content and format, acceptance criteria, and the meaning of every outcome.
25
-
26
- For a non-success outcome, treat `summary` as an operator handoff, not a
27
- diagnostic transcript: lead with a plain-language decision, list each
28
- independent issue with its decisive evidence and the concrete action/owner, and
29
- end with the safe next move. Omit policy narration, raw logs, successful-check
30
- or clean-state notes, and assertions that the child lacks authority; state the
31
- prerequisite that would unblock it. Mention a passed check only when it directly
32
- explains the remaining issue.
@@ -1,125 +0,0 @@
1
- # yaml-language-server: $schema=../schemas/workflow.schema.json
2
- version: 1
3
- id: mr-comments
4
- command: mr-comments
5
- description: Inspect merge-request feedback, plan changes, implement, and verify
6
- start: inspect
7
- maxStepVisits: 5
8
- summaryMaxChars: 4000
9
- steps:
10
- inspect:
11
- title: Inspect merge request
12
- prompt:
13
- file: prompts/mr-comments/inspect.md
14
- subagent:
15
- agent: scout
16
- context: fresh
17
- timeoutMs: 600000
18
- turnBudget:
19
- maxTurns: 12
20
- graceTurns: 2
21
- permissions:
22
- tools: [read, grep, bash]
23
- mcp: [gitlab/get_merge_request, gitlab/list_merge_request_discussions]
24
- bash:
25
- mode: allow-list
26
- allow:
27
- - executable: git
28
- argsPrefixes:
29
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
30
- - executable: rg
31
- argsPrefix: []
32
- requires:
33
- tools: [read, bash, mcp]
34
- transitions:
35
- ready: plan
36
- blocked: $pause
37
- plan:
38
- title: Plan the change
39
- prompt:
40
- file: prompts/mr-comments/plan.md
41
- subagent:
42
- agent: planner
43
- context: fresh
44
- timeoutMs: 600000
45
- turnBudget:
46
- maxTurns: 16
47
- graceTurns: 2
48
- permissions:
49
- tools: [read, grep, bash]
50
- mcp: [gitlab/get_merge_request, gitlab/list_merge_request_discussions]
51
- skills: [superpowers:brainstorming]
52
- bash:
53
- mode: allow-list
54
- allow:
55
- - executable: git
56
- argsPrefixes:
57
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
58
- - executable: rg
59
- argsPrefix: []
60
- requires:
61
- tools: [read, mcp]
62
- skills: [superpowers:brainstorming]
63
- gate:
64
- provider: plannotator
65
- submitOutcome: submit
66
- approvedOutcome: approved
67
- rejectedOutcome: changes-requested
68
- timeoutMs: 30000
69
- transitions:
70
- approved: implement
71
- changes-requested: plan
72
- blocked: $pause
73
- implement:
74
- title: Implement the approved plan
75
- prompt:
76
- file: prompts/mr-comments/implement.md
77
- subagent:
78
- agent: worker
79
- context: fresh
80
- timeoutMs: 1200000
81
- artifacts: true
82
- permissions:
83
- tools: [read, grep, edit, write, bash]
84
- skills: [superpowers:test-driven-development]
85
- bash:
86
- mode: allow-list
87
- allow:
88
- - executable: git
89
- argsPrefixes: [[status], [diff]]
90
- - executable: npm
91
- argsPrefix: [test]
92
- requires:
93
- tools: [read, edit, bash]
94
- skills: [superpowers:test-driven-development]
95
- transitions:
96
- ready: verify
97
- retry: implement
98
- blocked: $pause
99
- verify:
100
- title: Verify the result
101
- prompt:
102
- file: prompts/mr-comments/verify.md
103
- subagent:
104
- agent: reviewer
105
- context: fresh
106
- timeoutMs: 600000
107
- turnBudget:
108
- maxTurns: 16
109
- graceTurns: 2
110
- permissions:
111
- tools: [read, grep, bash]
112
- bash:
113
- mode: allow-list
114
- allow:
115
- - executable: git
116
- argsPrefixes: [[status], [diff]]
117
- - executable: npm
118
- argsPrefix: [test]
119
- requires:
120
- tools: [read, bash]
121
- transitions:
122
- passed: $done
123
- failed: implement
124
- retry: verify
125
- blocked: $pause
@@ -1,17 +0,0 @@
1
- Implement the approved plan with a small, coherent diff.
2
-
3
- Approved review artifact:
4
-
5
- {{reviewed.artifact}}
6
-
7
- Use repository conventions and the allowed skill. Add or update focused tests
8
- where practical. Treat the approved plan as the final contract. Apply TDD with
9
- commands permitted by this step's declarative Bash allow-list. Do not perform
10
- remote actions.
11
- Complete with `ready` when implementation and focused checks are complete;
12
- include a compact verification handoff in the summary.
13
- Complete with `retry` when the approved contract remains valid and another
14
- bounded attempt can safely continue unfinished work. The `replan` outcome is
15
- unavailable. When the approved contract is missing, stale, contradictory, or
16
- requires a material change to its targets or authority,
17
- complete with `blocked` and preserve the existing worktree for follow-up.
@@ -1,5 +0,0 @@
1
- Inspect the merge request described by:
2
-
3
- {{workflow.input}}
4
-
5
- Read the relevant discussion and repository state. Separate facts from assumptions. Do not modify files. When the requested work is clear, complete with `ready`. If identity, access, or requirements are unresolved, complete with `blocked`.
@@ -1,54 +0,0 @@
1
- Create a concrete, decision-ready implementation plan from the inspected
2
- feedback. The previously rejected artifact is:
3
-
4
- {{gate.artifact}}
5
-
6
- Account for previous Plannotator feedback:
7
-
8
- {{gate.feedback}}
9
-
10
- When feedback is non-empty, revise the rejected artifact and submit the complete
11
- proposal for another review. Each rejection returns to this same planning step.
12
-
13
- Write the artifact for a human reviewer first. Use this order:
14
-
15
- # <Short outcome-oriented title>
16
-
17
- ## Review summary
18
-
19
- In three to five plain-language bullets, explain the desired result, why it
20
- matters, what is in scope, and what is deliberately out of scope.
21
-
22
- ## Review focus
23
-
24
- List only choices that materially affect behavior, scope, risk, or an
25
- irreversible action. For each choice, give the recommendation, useful
26
- alternatives, and consequence. Say `No decisions needed` when there are none.
27
-
28
- ## Proposed changes
29
-
30
- Use a short numbered list. Name the exact file or symbol, state its observable
31
- change and reason, and give the corresponding acceptance criterion. Use
32
- checkboxes only for acceptance criteria, not for scope, evidence, risks, or
33
- every sentence.
34
-
35
- ## Validation
36
-
37
- Explain the focused and independent checks in reviewer language. State what
38
- each check proves; keep exact shell metadata out of this narrative.
39
-
40
- ## Risks
41
-
42
- List only material risks, with a concrete safeguard or rollback signal for
43
- each. Cite decisive evidence inline instead of dumping raw exploration logs or
44
- labeling every bullet `FACT`, `HYPOTHESIS`, or `UNKNOWN`.
45
-
46
- Do not leave `UNKNOWN`, `TBD`, or implementation-time research in the plan. If
47
- the allowed resources cannot resolve required access, provenance, repository
48
- state, resource identity, or targets, complete with `blocked` instead of
49
- submitting an incomplete plan. A user choice may remain only in Review focus
50
- with evidence and an adopted recommendation.
51
-
52
- When ready, call `structured_output` with a `value` whose outcome is `submit`
53
- and whose `artifact` is the full Markdown plan. This format is defined by this
54
- workflow prompt; Pi Workflows treats the artifact as opaque.
@@ -1,9 +0,0 @@
1
- Review the implementation against the requested merge-request feedback and
2
- approved plan:
3
-
4
- {{reviewed.artifact}}
5
-
6
- Inspect the diff and run checks permitted by this step's declarative Bash
7
- allow-list. Complete with `passed` only when evidence supports completion.
8
- Complete with `failed` to return to implementation with a compact actionable
9
- summary, or `blocked` when the workflow or environment must be repaired.
@@ -1,27 +0,0 @@
1
- # yaml-language-server: $schema=../schemas/settings.schema.json
2
- version: 1
3
- allowProjectWorkflows: false
4
- statusShortcut: ctrl+alt+w
5
- permissionCeiling:
6
- tools: [read, grep, bash]
7
- mcp: []
8
- extensions: []
9
- skills: []
10
- bash:
11
- mode: allow-list
12
- allow:
13
- - executable: git
14
- argsPrefixes:
15
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
16
- - executable: rg
17
- argsPrefix: []
18
- subagent:
19
- agents: [scout, planner, worker, reviewer]
20
- contexts: [fresh]
21
- models: []
22
- maxTimeoutMs: 900000
23
- maxTurns: 40
24
- maxGraceTurns: 3
25
- maxToolCalls: 100
26
- artifacts: false
27
- retryToolFailures: false
@@ -1,48 +0,0 @@
1
- You publish only the exact Plannotator-approved hosted review. Do not change
2
- local repository state.
3
-
4
- Review input:
5
- {{workflow.input}}
6
-
7
- Approved review:
8
- {{reviewed.artifact}}
9
-
10
- Approval feedback:
11
- {{reviewed.feedback}}
12
-
13
- Previous step handoff:
14
- {{last.summary}}
15
-
16
- Parse the approved Publication contract. Refresh the same review and head SHA
17
- through configured read-only MCP/CLI/cURL calls. For every action, first query
18
- the public review collections and skip it only when its exact marker, body,
19
- head, and anchor are already observable.
20
-
21
- Execute each remaining approved action once through its exact MCP tool/input or
22
- standalone `glab`, `gh`, or authenticated cURL command. Require a successful
23
- same-host, review-correlated response and record its remote identifier or URL.
24
- Never alter the approved body, target another head or anchor, expose
25
- credentials, approve, merge, resolve, close, delete, push, cross hosts, or add
26
- an unlisted action.
27
-
28
- For a GitLab inline discussion, the API requires `position` as a nested object.
29
- Prefer an exact configured GitLab MCP mutation whose schema accepts that object.
30
- When using `glab api`, submit every discussion field as multipart form data with
31
- `--form`, including `position[base_sha]`, `position[start_sha]`,
32
- `position[head_sha]`, `position[position_type]`, both paths, and the applicable
33
- line. Do not use `--field` or `--raw-field` for any `position[...]` key: those
34
- flags serialize JSON scalar keys and do not construct GitLab's nested position,
35
- which can create an unanchored general discussion. Before calling
36
- `structured_output`, fetch the returned discussion and require its note to have
37
- the approved position/path/line as well as the approved body and marker.
38
-
39
- After a mutation-capable call is attempted, ambiguity is `blocked`; do not
40
- blindly replay it. Call `structured_output` alone with outcome `published` only
41
- after every approved effect succeeded now or was proven already present.
42
- Summarize the URL/head, per-action pre-state, attempted/skipped result, exact
43
- correlation, and remaining work. When the previous handoff is an actionable
44
- verification finding, treat it as a corrective publication handoff: re-check
45
- the exact approved effect and retry only when its absence is conclusive. Never
46
- use it to alter the approved content, target, or action list. Use `blocked`
47
- with the same ledger when freshness, execution, or correlation is ambiguous or
48
- unsafe.
@@ -1,76 +0,0 @@
1
- You are the independent code-review child. Produce one complete review proposal
2
- before Plannotator opens. Do not modify local or remote state.
3
-
4
- Review input:
5
- {{workflow.input}}
6
-
7
- Fetched evidence:
8
- {{last.summary}}
9
-
10
- Previously rejected artifact:
11
- {{gate.artifact}}
12
-
13
- Feedback from a previously rejected review:
14
- {{gate.feedback}}
15
-
16
- When feedback is non-empty, revise the rejected artifact against current
17
- evidence and submit the complete review proposal for another review. Each
18
- rejection returns to this same review step.
19
-
20
- Treat the fetched packet as evidence, not a verdict. Refresh the same-host head
21
- SHA, diff, checks, and discussions with configured read-only MCP/CLI/cURL calls.
22
- Inspect changed code, callers, tests, repository instructions, and relevant
23
- history. Review correctness, regressions, security, concurrency, compatibility,
24
- maintainability, and missing tests. Remove false, stale, duplicate,
25
- stylistic-only, and non-actionable findings.
26
-
27
- This user-owned prompt defines the Plannotator artifact:
28
-
29
- 1. `# Review: <short verdict>`
30
- 2. `## Verdict`
31
- 3. `## Findings` — severity, exact changed-line anchor, causal problem, impact,
32
- evidence, and smallest useful requested change; write `No actionable
33
- findings.` when clean.
34
- 4. `## Validation`
35
- 5. `## Publication contract`
36
- 6. `## Safety boundaries`
37
-
38
- `## Publication contract` contains one fenced `json` object with an `actions`
39
- array. Each action chooses one configured mechanism:
40
-
41
- ```json
42
- {
43
- "actions": [
44
- {
45
- "mechanism": "mcp or bash",
46
- "server": "gitlab or github when mechanism is mcp",
47
- "tool": "exact configured MCP tool when mechanism is mcp",
48
- "input": {},
49
- "command": "exact standalone glab, gh, or curl command when mechanism is bash",
50
- "effect": {
51
- "host": "same host as the review",
52
- "reviewUrl": "canonical review URL",
53
- "headSha": "reviewed head SHA",
54
- "kind": "inline-comment or review-summary",
55
- "path": "changed path when inline",
56
- "line": 1,
57
- "body": "exact public text",
58
- "marker": "stable unique marker"
59
- }
60
- }
61
- ]
62
- }
63
- ```
64
-
65
- Omit fields that do not apply to the selected mechanism or effect. Include one
66
- inline public comment per approved finding, or one ordinary public
67
- non-approving summary when clean. Every remote input and exact effect must be
68
- fully present with no placeholders or credentials. The actions may only post
69
- this review on the same host and head; never approve, merge, resolve, close,
70
- delete, force-push, cross hosts, or perform an unlisted mutation.
71
-
72
- Call `structured_output` alone with outcome `submit`. Put the complete Markdown
73
- review in `artifact` and a self-contained review/publication handoff in
74
- `summary`. Use `blocked` when current evidence cannot support a safe,
75
- publishable review. A rejected proposal is revised here; never restart the
76
- workflow or create a new workspace.
@@ -1,35 +0,0 @@
1
- You are the final read-only verification child for the published hosted review.
2
- Do not execute a publication action or mutate local or remote state.
3
-
4
- Review input:
5
- {{workflow.input}}
6
-
7
- Approved review:
8
- {{reviewed.artifact}}
9
-
10
- Publication ledger:
11
- {{last.summary}}
12
-
13
- Parse the approved Publication contract and refresh the same review through
14
- configured read-only MCP/CLI/cURL calls. Require the current head SHA to match
15
- the approved artifact. Independently query the public discussion, note, or
16
- review collections and prove every exact marker, body, head, effect kind,
17
- optional path/line anchor, and remote identifier. The publication ledger alone
18
- is not proof.
19
-
20
- Call `structured_output` alone with:
21
-
22
- - `verified` only when all approved effects are observable exactly once or in
23
- the explicitly idempotent form described by the contract;
24
- - `failed` for an actionable, unambiguous missing or mismatched approved
25
- effect. Its self-contained summary becomes the next publication worker's
26
- corrective handoff, so include the expected and observed state, exact
27
- evidence, and the smallest safe repair;
28
- - `retry` for a transient read-only verification failure after safe equivalent
29
- checks were attempted;
30
- - `blocked` only when the review, head, target, or remote result is stale,
31
- ambiguous, or unsafe to repair automatically.
32
-
33
- For `verified` and `failed`, summarize the canonical URL, current head,
34
- verified or missing remote identifiers/URLs and anchors, action count, and
35
- final verdict. Do not mutate state yourself.