@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
@@ -0,0 +1,11 @@
1
+ ---
2
+ thinking: high
3
+ ---
4
+
5
+ You are the planning role for one workflow step.
6
+
7
+ Stay within the step's declared permissions. Establish facts before conclusions,
8
+ separate assumptions from evidence, and inspect existing conventions before
9
+ proposing changes. Produce a small, executable plan that maps requirements to
10
+ verification. Do not implement changes or broaden scope before the workflow's
11
+ approval gate.
@@ -0,0 +1,10 @@
1
+ ---
2
+ thinking: xhigh
3
+ ---
4
+
5
+ You are the independent review role for one workflow step.
6
+
7
+ Remain read-only unless the step explicitly grants a different authority.
8
+ Independently verify each requirement, inspect the relevant diff and execution
9
+ evidence, and report only concrete gaps with a precise location and falsifiable
10
+ reason. Do not implement fixes or approve claims without evidence.
@@ -0,0 +1,10 @@
1
+ ---
2
+ thinking: medium
3
+ ---
4
+
5
+ You are the investigation role for one workflow step.
6
+
7
+ Stay read-only. Gather the smallest set of decisive evidence, distinguish facts
8
+ from hypotheses, and name the next check that would falsify an uncertainty.
9
+ Report relevant conventions, risks, and open questions without proposing
10
+ unverified implementation details.
@@ -0,0 +1,11 @@
1
+ ---
2
+ thinking: high
3
+ ---
4
+
5
+ You are the implementation role for one workflow step.
6
+
7
+ Treat the approved workflow artifact and declared permissions as the complete
8
+ authority. Make the smallest coherent change, preserve unrelated work, and
9
+ validate observable behavior with the declared focused checks. Surface a
10
+ blocker with decisive evidence instead of inventing scope, credentials, or
11
+ external side effects.
@@ -0,0 +1,10 @@
1
+ ---
2
+ thinking: low
3
+ ---
4
+
5
+ You are the workspace preparation role for one workflow step.
6
+
7
+ Inspect the current repository state before mutation. Create or reuse only the
8
+ workflow-owned workspace described by the step, preserve unrelated changes,
9
+ and return the exact absolute workspace path required by the completion
10
+ contract. Stop with decisive evidence when ownership or safety is ambiguous.
@@ -0,0 +1,84 @@
1
+ version: 1
2
+ id: investigate
3
+ command: investigate
4
+ description: 'Derive, approve, investigate, and independently validate an evidence-backed finding. Example: /investigate PROJ-123 Root cause of elevated 500 error rates in checkout service'
5
+ start: retrieve
6
+ maxStepVisits: 12
7
+ summaryMaxChars: 30000
8
+ steps:
9
+ retrieve:
10
+ title: Retrieve investigation scope and Jira evidence
11
+ prompt:
12
+ file: steps/investigate/retrieve.md
13
+ agent: scout
14
+ permissions:
15
+ tools: [read, ls, bash, mcp]
16
+ mcp: [atlassian, context7, sourcegraph, glean, grafana]
17
+ extensions: [/]
18
+ skills: [jira-ticket, start-triage, search-code-sourcegraph, caveman]
19
+ bash:
20
+ mode: unrestricted
21
+ gate:
22
+ provider: plannotator
23
+ submitOutcome: submit
24
+ approvedOutcome: approved
25
+ rejectedOutcome: changes-requested
26
+ timeoutMs: 30000
27
+ artifactContract:
28
+ maxChars: 6000
29
+ requiredSubstrings:
30
+ - '## Brief description'
31
+ - '## Goals'
32
+ - '## Boundaries'
33
+ - '## Evidence & sources'
34
+ - '## Report destination'
35
+ - '## Open evidence gaps'
36
+ forbiddenSubstrings:
37
+ - 'The complete gate artifact is the exact Markdown saved at'
38
+ onValidationFailure: retry
39
+ transitions:
40
+ approved: investigate
41
+ changes-requested: retrieve
42
+ retry: retrieve
43
+ blocked: $pause
44
+ investigate:
45
+ title: Investigate approved scope and write findings
46
+ prompt:
47
+ file: steps/investigate/investigate.md
48
+ agent: worker
49
+ permissions:
50
+ tools: [read, ls, bash, write, mcp]
51
+ mcp: [atlassian, context7, sourcegraph, glean, grafana, gitlab]
52
+ extensions: [/]
53
+ skills:
54
+ [
55
+ coding-standards,
56
+ systematic-debugging,
57
+ start-triage,
58
+ grafana-logs,
59
+ search-code-sourcegraph,
60
+ caveman,
61
+ ]
62
+ bash:
63
+ mode: unrestricted
64
+ transitions:
65
+ ready: validate
66
+ retry: investigate
67
+ blocked: $pause
68
+ validate:
69
+ title: Independently validate investigation findings
70
+ prompt:
71
+ file: steps/investigate/validate.md
72
+ agent: reviewer
73
+ permissions:
74
+ tools: [read, ls, bash, mcp]
75
+ mcp: [atlassian, sourcegraph, glean, gitlab]
76
+ extensions: [/]
77
+ skills: [verification-before-completion, caveman]
78
+ bash:
79
+ mode: unrestricted
80
+ transitions:
81
+ approved: $done
82
+ gaps: investigate
83
+ retry: validate
84
+ blocked: validate
@@ -0,0 +1,75 @@
1
+ version: 1
2
+ id: jira
3
+ command: jira
4
+ description: 'Draft, approve, and create a Jira Epic with ordered Stories. Example: /jira ACTB Implement multi-region failover for pricing service'
5
+ start: draft
6
+ maxStepVisits: 12
7
+ summaryMaxChars: 30000
8
+ steps:
9
+ draft:
10
+ title: Normalize Epic and Story input
11
+ prompt:
12
+ file: steps/jira/draft.md
13
+ agent: scout
14
+ permissions:
15
+ tools: [read, ls, bash]
16
+ mcp: []
17
+ extensions: [/]
18
+ skills: [jira-ticket, caveman]
19
+ bash:
20
+ mode: unrestricted
21
+ transitions:
22
+ ready: plan
23
+ retry: draft
24
+ blocked: $pause
25
+ plan:
26
+ title: Validate Jira schema and approve Epic and Story plan
27
+ prompt:
28
+ file: steps/jira/plan.md
29
+ agent: planner
30
+ permissions:
31
+ tools: [read, ls, bash, mcp]
32
+ mcp: [atlassian]
33
+ extensions: [/]
34
+ skills: [jira-ticket, caveman]
35
+ bash:
36
+ mode: unrestricted
37
+ gate:
38
+ provider: plannotator
39
+ submitOutcome: submit
40
+ approvedOutcome: approved
41
+ rejectedOutcome: changes-requested
42
+ timeoutMs: 30000
43
+ artifactContract:
44
+ maxChars: 16000
45
+ requiredSubstrings:
46
+ - '# Create Jira Epic and Stories'
47
+ - '## Jira field contract'
48
+ - '## Epic'
49
+ - '## Ordered Stories'
50
+ - '## Creation sequence'
51
+ - '## Safety limits'
52
+ forbiddenSubstrings:
53
+ - 'The complete gate artifact is the exact Markdown saved at'
54
+ onValidationFailure: retry
55
+ transitions:
56
+ approved: create
57
+ changes-requested: plan
58
+ retry: plan
59
+ blocked: $pause
60
+ create:
61
+ title: Create approved Jira Epic and Stories
62
+ prompt:
63
+ file: steps/jira/create.md
64
+ agent: worker
65
+ permissions:
66
+ tools: [read, ls, bash, mcp]
67
+ mcp: [atlassian]
68
+ extensions: [/]
69
+ skills: [jira-ticket, caveman]
70
+ bash:
71
+ mode: unrestricted
72
+ transitions:
73
+ ready: $done
74
+ retry: create
75
+ blocked: $pause
@@ -1,149 +1,142 @@
1
1
  version: 1
2
2
  id: mr-comment
3
3
  command: mr-comment
4
- description: Fetch review comments, approve fixes, edit the current checkout, verify, push, and reply
4
+ description: 'Fetch unresolved MR or PR comments, approve a fix plan, implement, verify, push, and reply. Example: /mr-comment https://gitlab.com/org/repo/-/merge_requests/123'
5
5
  start: fetch
6
- maxStepVisits: 4
7
- summaryMaxChars: 50000
6
+ maxStepVisits: 10
7
+ summaryMaxChars: 30000
8
8
  steps:
9
9
  fetch:
10
- title: Fetch merge-request or pull-request comments
10
+ title: Fetch merge-request or pull-request evidence
11
11
  prompt:
12
12
  file: steps/mr-comment/fetch.md
13
- subagent:
14
- agent: scout
15
- context: fresh
16
- timeoutMs: 1800000
13
+ agent: scout
17
14
  permissions:
18
- tools: [read, ls, bash]
19
- mcp: [gitlab, github]
15
+ tools: [read, ls, bash, mcp]
16
+ mcp: [gitlab, context7]
17
+ extensions: [/]
18
+ skills: [caveman]
20
19
  bash:
21
- mode: allow-list
22
- allow:
23
- - executable: git
24
- argsPrefixes:
25
- [
26
- [status],
27
- [diff],
28
- [log],
29
- [show],
30
- [grep],
31
- [ls-files],
32
- [remote, -v],
33
- [remote, get-url],
34
- [rev-parse],
35
- ]
36
- - executable: glab
37
- argsPrefixes: [[mr, view], [mr, diff], [api]]
38
- - executable: gh
39
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
40
- - executable: curl
41
- requires:
20
+ mode: unrestricted
21
+ transitions:
22
+ ready: checkout-source
23
+ retry: fetch
24
+ blocked: $pause
25
+ checkout-source:
26
+ title: Check out the reviewed source branch
27
+ prompt:
28
+ file: steps/mr-comment/checkout-source.md
29
+ agent: worker
30
+ workspace:
31
+ bindOn:
32
+ - ready
33
+ allowedRoots:
34
+ - ~/repositories/worktrees
35
+ - .
36
+ permissions:
42
37
  tools: [read, ls, bash]
38
+ mcp: []
39
+ extensions: [/]
40
+ skills: [using-git-worktrees, caveman]
41
+ bash:
42
+ mode: unrestricted
43
43
  transitions:
44
44
  ready: plan
45
+ retry: checkout-source
45
46
  blocked: $pause
46
-
47
47
  plan:
48
- title: Propose a complete comment-fix plan
48
+ title: Propose a complete review-comment fix plan
49
49
  prompt:
50
50
  file: steps/mr-comment/plan.md
51
- subagent:
52
- agent: planner
53
- context: fresh
54
- timeoutMs: 1800000
51
+ agent: planner
55
52
  permissions:
56
- tools: [read, ls, bash]
57
- mcp: [gitlab, github]
53
+ tools: [read, ls, bash, mcp]
54
+ mcp: [gitlab, sourcegraph, context7]
55
+ extensions: [/]
56
+ skills:
57
+ [
58
+ coding-standards,
59
+ writing-plans,
60
+ receiving-code-review,
61
+ search-code-sourcegraph,
62
+ caveman,
63
+ ]
58
64
  bash:
59
- mode: allow-list
60
- allow:
61
- - executable: git
62
- argsPrefixes:
63
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
64
- - executable: glab
65
- argsPrefixes: [[mr, view], [mr, diff], [api]]
66
- - executable: gh
67
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
68
- - executable: curl
69
- requires:
70
- tools: [read, ls, bash]
65
+ mode: unrestricted
71
66
  gate:
72
67
  provider: plannotator
73
68
  submitOutcome: submit
74
69
  approvedOutcome: approved
75
70
  rejectedOutcome: changes-requested
76
71
  timeoutMs: 30000
72
+ artifactContract:
73
+ maxChars: 10000
74
+ requiredSubstrings:
75
+ - '## Review summary'
76
+ - '## Comment decisions'
77
+ - '## Implementation plan'
78
+ - '## Validation'
79
+ - '## Replies and remote actions'
80
+ - '## Risks'
81
+ - '## Execution appendix (machine-readable)'
82
+ forbiddenSubstrings:
83
+ - 'The complete gate artifact is the exact Markdown saved at'
84
+ onValidationFailure: retry
77
85
  transitions:
78
86
  approved: implement
79
87
  changes-requested: plan
88
+ retry: plan
80
89
  blocked: $pause
81
-
82
90
  implement:
83
- title: Implement the approved comment fixes
91
+ title: Implement approved review-comment fixes
84
92
  prompt:
85
93
  file: steps/mr-comment/implement.md
86
- subagent:
87
- agent: worker
88
- context: fresh
89
- timeoutMs: 7200000
90
- artifacts: true
94
+ agent: worker
91
95
  permissions:
92
- tools: [read, ls, bash, edit, write]
93
- mcp: [gitlab, github]
96
+ tools: [read, ls, bash, edit, write, mcp]
97
+ mcp: [context7]
98
+ extensions: [/]
99
+ skills:
100
+ [coding-standards, test-driven-development, lint-commands, caveman]
94
101
  bash:
95
102
  mode: unrestricted
96
- requires:
97
- tools: [read, ls, bash, edit, write]
98
103
  transitions:
99
104
  ready: verify
105
+ retry: implement
100
106
  blocked: $pause
101
-
102
107
  verify:
103
- title: Independently verify comment handling
108
+ title: Independently verify review-comment handling
104
109
  prompt:
105
110
  file: steps/mr-comment/verify.md
106
- subagent:
107
- agent: reviewer
108
- context: fresh
109
- timeoutMs: 3600000
111
+ agent: reviewer
110
112
  permissions:
111
113
  tools: [read, ls, bash]
112
- mcp: [gitlab, github]
114
+ mcp: []
115
+ extensions: [/]
116
+ skills: [verification-before-completion, lint-commands, caveman]
113
117
  bash:
114
118
  mode: unrestricted
115
- requires:
116
- tools: [read, ls, bash]
117
119
  transitions:
118
- ready: publish
120
+ ready: deliver
119
121
  no-actions: $done
120
122
  failed: implement
121
- blocked: $pause
122
-
123
- publish:
124
- title: Push verified work and reply to comments
123
+ retry: verify
124
+ blocked: verify
125
+ deliver:
126
+ title: Push the verified commit and reply to review comments
125
127
  prompt:
126
128
  file: steps/mr-comment/publish.md
127
- subagent:
128
- agent: worker
129
- context: fresh
130
- timeoutMs: 1800000
129
+ agent: worker
131
130
  permissions:
132
- tools: [read, ls, bash]
133
- mcp: [gitlab, github]
131
+ tools: [read, ls, bash, mcp]
132
+ mcp: [gitlab]
133
+ extensions: [/]
134
+ skills: [commit-format, caveman]
134
135
  bash:
135
- mode: allow-list
136
- allow:
137
- - executable: git
138
- argsPrefixes: [[status], [rev-parse], [show], [ls-remote], [push]]
139
- - executable: glab
140
- argsPrefixes: [[mr, view], [api]]
141
- - executable: gh
142
- argsPrefixes: [[pr, view], [api]]
143
- - executable: curl
144
- requires:
145
- tools: [read, ls, bash]
136
+ mode: unrestricted
146
137
  transitions:
147
138
  published: $done
148
139
  no-actions: $done
140
+ retry: deliver
141
+ superseded: $pause
149
142
  blocked: $pause
@@ -1,132 +1,96 @@
1
1
  version: 1
2
2
  id: mr-review
3
3
  command: mr-review
4
- description: Fetch, approve, publish, and verify one hosted code review
4
+ description: 'Fetch, approve, publish, and verify one hosted code review. Example: /mr-review https://gitlab.com/org/repo/-/merge_requests/123'
5
5
  start: fetch
6
- maxStepVisits: 3
6
+ maxStepVisits: 10
7
7
  summaryMaxChars: 50000
8
8
  steps:
9
9
  fetch:
10
10
  title: Fetch complete hosted-review evidence
11
11
  prompt:
12
12
  file: steps/mr-review/fetch.md
13
- subagent:
14
- agent: scout
15
- context: fresh
16
- timeoutMs: 1800000
13
+ agent: scout
17
14
  permissions:
18
- tools: [read, ls, bash]
19
- mcp: [gitlab, github]
15
+ tools: [read, ls, bash, mcp]
16
+ mcp: [gitlab, context7]
17
+ extensions: [/]
18
+ skills: [caveman]
20
19
  bash:
21
- mode: allow-list
22
- allow:
23
- - executable: git
24
- argsPrefixes:
25
- [
26
- [status],
27
- [diff],
28
- [log],
29
- [show],
30
- [grep],
31
- [ls-files],
32
- [remote, -v],
33
- [remote, get-url],
34
- [rev-parse],
35
- ]
36
- - executable: glab
37
- argsPrefixes: [[mr, view], [mr, diff], [api]]
38
- - executable: gh
39
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
40
- - executable: curl
41
- requires:
42
- tools: [read, ls, bash]
20
+ mode: unrestricted
43
21
  transitions:
44
22
  fetched: review
45
23
  blocked: $pause
46
-
47
24
  review:
48
- title: Produce and approve a complete review
25
+ title: Produce and approve the complete hosted review
49
26
  prompt:
50
- file: steps/mr-review/review.md
51
- subagent:
52
- agent: reviewer
53
- context: fresh
54
- timeoutMs: 1800000
27
+ file: steps/mr-review/review-for-approval.md
28
+ agent: reviewer
55
29
  permissions:
56
- tools: [read, ls, bash]
57
- mcp: [gitlab, github]
30
+ tools: [read, ls, bash, mcp]
31
+ mcp: [gitlab, sourcegraph, context7]
32
+ extensions: [/]
33
+ skills:
34
+ [
35
+ coding-standards,
36
+ requesting-code-review,
37
+ search-code-sourcegraph,
38
+ caveman,
39
+ ]
58
40
  bash:
59
- mode: allow-list
60
- allow:
61
- - executable: git
62
- argsPrefixes:
63
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
64
- - executable: glab
65
- argsPrefixes: [[mr, view], [mr, diff], [api]]
66
- - executable: gh
67
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
68
- - executable: curl
69
- requires:
70
- tools: [read, ls, bash]
41
+ mode: unrestricted
71
42
  gate:
72
43
  provider: plannotator
73
44
  submitOutcome: submit
74
45
  approvedOutcome: approved
75
46
  rejectedOutcome: changes-requested
76
47
  timeoutMs: 30000
48
+ artifactContract:
49
+ maxChars: 8000
50
+ requiredSubstrings:
51
+ - '# Review:'
52
+ - '## Verdict'
53
+ - '## Findings'
54
+ - '## Validation'
55
+ - '## Publication contract'
56
+ - '## Safety boundaries'
57
+ forbiddenSubstrings:
58
+ - 'The complete gate artifact is the exact Markdown saved at'
59
+ onValidationFailure: retry
77
60
  transitions:
78
61
  approved: publish
79
62
  changes-requested: review
63
+ retry: review
80
64
  blocked: $pause
81
-
82
65
  publish:
83
- title: Publish the approved review
66
+ title: Publish the approved hosted review
84
67
  prompt:
85
- file: steps/mr-review/publish.md
86
- subagent:
87
- agent: worker
88
- context: fresh
89
- timeoutMs: 900000
68
+ file: steps/mr-review/publish-approved.md
69
+ agent: worker
90
70
  permissions:
91
- tools: [bash]
92
- mcp: [gitlab, github]
71
+ tools: [read, ls, bash, mcp]
72
+ mcp: [gitlab]
73
+ extensions: [/]
74
+ skills: [caveman]
93
75
  bash:
94
- mode: allow-list
95
- allow:
96
- - executable: glab
97
- argsPrefixes: [[mr, view], [api]]
98
- - executable: gh
99
- argsPrefixes: [[pr, view], [api]]
100
- - executable: curl
101
- requires:
102
- tools: [bash]
76
+ mode: unrestricted
103
77
  transitions:
104
78
  published: verify
105
79
  blocked: $pause
106
-
107
80
  verify:
108
- title: Verify or return the review for publication repair
81
+ title: Verify or return the approved review for publication repair
109
82
  prompt:
110
- file: steps/mr-review/verify.md
111
- subagent:
112
- agent: reviewer
113
- context: fresh
114
- timeoutMs: 900000
83
+ file: steps/mr-review/verify-published.md
84
+ agent: reviewer
115
85
  permissions:
116
- tools: [bash]
117
- mcp: [gitlab, github]
86
+ tools: [read, ls, bash, mcp]
87
+ mcp: [gitlab]
88
+ extensions: [/]
89
+ skills: [verification-before-completion, caveman]
118
90
  bash:
119
- mode: allow-list
120
- allow:
121
- - executable: glab
122
- argsPrefixes: [[mr, view], [api]]
123
- - executable: gh
124
- argsPrefixes: [[pr, view], [api]]
125
- - executable: curl
126
- requires:
127
- tools: [bash]
91
+ mode: unrestricted
128
92
  transitions:
129
93
  verified: $done
130
94
  failed: publish
131
95
  retry: verify
132
- blocked: $pause
96
+ blocked: verify
@@ -0,0 +1,4 @@
1
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/wichayutdew/pi-workflows/main/schemas/settings.schema.json
2
+ version: 1
3
+ allowProjectWorkflows: false
4
+ statusShortcut: ctrl+alt+c
@@ -0,0 +1,40 @@
1
+ You are the evidence-collection and report-writing stage for an approved investigation. Do not launch subagents.
2
+
3
+ Original request:
4
+ {{workflow.input}}
5
+
6
+ Approved scope artifact:
7
+ {{reviewed.artifact}}
8
+
9
+ Plannotator feedback:
10
+ {{reviewed.feedback}}
11
+
12
+ ## Report Template (`~/repositories/investigation-findings/<slug>.md`)
13
+
14
+ ```markdown
15
+ # {Investigation Title}
16
+
17
+ > {Brief summary description}
18
+
19
+ # Goal of the investigation
20
+ 1. {Goal 1}
21
+ 2. {Goal 2}
22
+
23
+ # Investigation summary that satisfy the goal
24
+ {Evidence-backed findings, concise bullets, and Mermaid diagrams for flows}
25
+
26
+ # Supporting documents
27
+ {Exact file paths with line ranges, permanent links, and code citations}
28
+
29
+ # Risks
30
+ 1. {Material risk 1 with safeguard}
31
+ 2. {Open uncertainty or limitation}
32
+ ```
33
+
34
+ ## Rules & Boundaries
35
+ 1. **Read-Only Inspection**: Gather evidence across code, docs, and search tools. Never edit repo code or mutate external systems.
36
+ 2. **Single Output File**: Write/replace only the approved report file under `~/repositories/investigation-findings/`. Never stage or commit.
37
+ 3. **Outcomes**:
38
+ - `ready`: Report written with structured claim ledger.
39
+ - `retry`: Transient tool or file-write issue.
40
+ - `blocked`: Inaccessible required evidence or unachievable scope.