@plainconceptsplatform/workflows 0.6.1 → 0.16.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.
- package/README.md +105 -88
- package/dist/catalog-installation.d.ts +39 -2
- package/dist/catalog-installation.js +172 -109
- package/dist/index.js +128 -73
- package/dist/package-baseline.d.ts +25 -0
- package/dist/package-baseline.js +138 -0
- package/dist/route-processing.d.ts +0 -2
- package/dist/route-processing.js +22 -91
- package/dist/stack-defaults.js +18 -12
- package/dist/tui.js +27 -43
- package/dist/worker-env.d.ts +46 -0
- package/dist/worker-env.js +179 -0
- package/dist/workflow-catalog.d.ts +4 -2
- package/dist/workflow-catalog.js +5 -3
- package/loops/actions/add-issue-labels/action.yml +20 -0
- package/loops/actions/audit-close/action.yml +180 -128
- package/loops/actions/classify-route/classify-route.sh +8 -2
- package/loops/actions/housekeeping/action.yml +251 -0
- package/loops/actions/merge-agent-pr/action.yml +13 -0
- package/loops/actions/report-workflow-errors/action.yml +385 -0
- package/loops/actions/validate-merge-gate-output/validate-merge-gate-output.sh +13 -1
- package/loops/actions/validate-triage-output/action.yml +1 -1
- package/loops/actions/validate-triage-output/validate-triage-output.sh +9 -5
- package/loops/actions/verify-composite-actions/verify-composite-actions.sh +53 -0
- package/loops/actions/verify-route-matrix/verify-route-matrix.sh +847 -170
- package/loops/templates/agentics/agentics-error-report.yml +97 -0
- package/loops/templates/opencode/opencode.ci.json +1 -1
- package/loops/workflows/agent-apply-review.md +452 -469
- package/loops/workflows/agent-audit.md +201 -213
- package/loops/workflows/agent-implement.md +616 -640
- package/loops/workflows/agent-merge-gate.md +830 -844
- package/loops/workflows/agent-refine.md +599 -633
- package/loops/workflows/agent-release.md +244 -258
- package/loops/workflows/agent-triage.md +476 -447
- package/loops/workflows/authorize-bot-work.yml +26 -6
- package/loops/workflows/work-router.yml +1185 -1038
- package/package.json +9 -8
- package/dist/action-validation.test.d.ts +0 -1
- package/dist/action-validation.test.js +0 -87
- package/dist/catalog-installation.test.d.ts +0 -1
- package/dist/catalog-installation.test.js +0 -485
- package/dist/catalog-listing.test.d.ts +0 -1
- package/dist/catalog-listing.test.js +0 -150
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -273
- package/dist/repository-inspection.test.d.ts +0 -1
- package/dist/repository-inspection.test.js +0 -77
- package/dist/route-processing.test.d.ts +0 -1
- package/dist/route-processing.test.js +0 -283
- package/dist/stack-defaults.test.d.ts +0 -1
- package/dist/stack-defaults.test.js +0 -266
- package/dist/tui.test.d.ts +0 -1
- package/dist/tui.test.js +0 -249
- package/dist/workflow-catalog.test.d.ts +0 -1
- package/dist/workflow-catalog.test.js +0 -29
- package/loops/actions/stale-recovery/action.yml +0 -288
- package/loops/actions/update-changelog/action.yml +0 -113
|
@@ -1,213 +1,201 @@
|
|
|
1
|
-
---
|
|
2
|
-
# Managed by @plainconceptsplatform/workflows. Source: loops/workflows/agent-audit.md. Update with `workflows update --force`; consumer edits may be overwritten.
|
|
3
|
-
env:
|
|
4
|
-
REPO_RULES: "Read-only repository audit. Report only reproducible, actionable defects with evidence.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
classDef action fill:#eef0ff,stroke:#554cff,stroke-width:2px,color:#172033
|
|
203
|
-
classDef decision fill:#fff8e8,stroke:#c75b00,stroke-width:2px,color:#172033
|
|
204
|
-
classDef idle fill:#202c40,stroke:#738198,stroke-width:2px,color:#ffffff
|
|
205
|
-
classDef failure fill:#fff0f0,stroke:#ef2929,stroke-width:2px,color:#8b1a2a
|
|
206
|
-
classDef success fill:#e8f8ec,stroke:#18883c,stroke-width:2px,color:#145a32
|
|
207
|
-
class auditStart start
|
|
208
|
-
class auditTracked,auditRun,auditPropose action
|
|
209
|
-
class auditBackpressure,auditTriage decision
|
|
210
|
-
class auditQuiet,auditIdle idle
|
|
211
|
-
class auditFail failure
|
|
212
|
-
class auditReport success
|
|
213
|
-
```
|
|
1
|
+
---
|
|
2
|
+
# Managed by @plainconceptsplatform/workflows. Source: loops/workflows/agent-audit.md. Update with `workflows update --force`; consumer edits may be overwritten.
|
|
3
|
+
env:
|
|
4
|
+
REPO_RULES: "Read-only repository audit. Report only reproducible, actionable defects with evidence. Do not modify files, commit, push, or run write operations."
|
|
5
|
+
# Split out of REPO_RULES, which carried both the read-only discipline above and the list
|
|
6
|
+
# below. All four consuming repositories had customised the list and none could touch it
|
|
7
|
+
# without restating the discipline; they are different kinds of rule with different owners.
|
|
8
|
+
# One line: gh-aw joins a multi-line env value onto a single line when it compiles the lock.
|
|
9
|
+
AUDIT_FOCUS: "Architectural layer violations and dependencies pointing the wrong way. Missing or misleading tests around behaviour that already shipped. Security gaps: unvalidated input, missing authorization, secrets in code. Performance anti-patterns, N+1 queries in particular. Documentation that no longer matches the code it describes."
|
|
10
|
+
AUDIT_MARKER: "<!-- agent-audit -->"
|
|
11
|
+
GIT_AUTHOR_NAME: "github-actions[bot]"
|
|
12
|
+
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
13
|
+
GIT_COMMITTER_NAME: "github-actions[bot]"
|
|
14
|
+
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
15
|
+
description: |
|
|
16
|
+
Read-only repository audit. Finds 5-7 problems, scores each 1-10, files a single issue
|
|
17
|
+
with all findings listed and the top 3 refined as actionable user stories. The issue is
|
|
18
|
+
labelled `audit` + `bug` + `refine`, so Refine sizes it and splits a multi-defect report
|
|
19
|
+
into one estimated issue per finding rather than one pull request that has to fix them all. Replaces .loops/recipes/guardrails-audit-loop.yaml.
|
|
20
|
+
|
|
21
|
+
Router-only worker: triggered exclusively via workflow_call from work-router.yml.
|
|
22
|
+
Contract input: trigger-kind(scheduled|manual).
|
|
23
|
+
The router owns the weekly Monday schedule and manual dispatch.
|
|
24
|
+
|
|
25
|
+
The `skip-if-match` below is backpressure, so the audit stops filing reports while three
|
|
26
|
+
are still unactioned.
|
|
27
|
+
|
|
28
|
+
name: "Agent: Audit"
|
|
29
|
+
|
|
30
|
+
# Shared: network policy only. This workflow owns its Safe Outputs and OpenCode configuration.
|
|
31
|
+
# permissions, engine, model and runs-on cannot be shared , see shared/platform-defaults.md.
|
|
32
|
+
imports:
|
|
33
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.87.5
|
|
34
|
+
- shared/platform-defaults.md
|
|
35
|
+
- shared/opencode-ci.md
|
|
36
|
+
|
|
37
|
+
on:
|
|
38
|
+
workflow_call:
|
|
39
|
+
inputs:
|
|
40
|
+
trigger-kind:
|
|
41
|
+
description: "Audit trigger: scheduled or manual"
|
|
42
|
+
required: false
|
|
43
|
+
type: string
|
|
44
|
+
default: manual
|
|
45
|
+
|
|
46
|
+
# Rung 1. Do not pile reports on top of unactioned reports.
|
|
47
|
+
#
|
|
48
|
+
# `-label:stale-audit` is what keeps this backpressure from becoming a stop. Three reports
|
|
49
|
+
# nobody ever actioned used to disable the weekly audit for good: the query counted them
|
|
50
|
+
# forever, the run skipped with a green tick, and no report was ever filed again. The
|
|
51
|
+
# janitor labels a report `stale-audit` once it has sat open past its budget, which both
|
|
52
|
+
# frees the slot and lists the report in the "Needs a human" digest. Backpressure now
|
|
53
|
+
# means "three live reports", not "three reports, ever".
|
|
54
|
+
skip-if-match:
|
|
55
|
+
query: "is:issue is:open label:audit -label:stale-audit"
|
|
56
|
+
max: 3
|
|
57
|
+
|
|
58
|
+
runs-on: agents-arc
|
|
59
|
+
runs-on-slim: agents-arc
|
|
60
|
+
|
|
61
|
+
secrets:
|
|
62
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
63
|
+
|
|
64
|
+
engine:
|
|
65
|
+
id: opencode
|
|
66
|
+
version: "1.2.14"
|
|
67
|
+
env:
|
|
68
|
+
OPENAI_BASE_URL: https://forge.plainconcepts.com/v1
|
|
69
|
+
|
|
70
|
+
model: openai/glm-5-3
|
|
71
|
+
|
|
72
|
+
max-turns: 300
|
|
73
|
+
max-turn-cache-misses: 3000
|
|
74
|
+
max-ai-credits: 5000
|
|
75
|
+
|
|
76
|
+
permissions: read-all
|
|
77
|
+
|
|
78
|
+
steps:
|
|
79
|
+
- name: List what is already tracked
|
|
80
|
+
uses: ./.github/actions/list-open-issues
|
|
81
|
+
with:
|
|
82
|
+
token: ${{ github.token }}
|
|
83
|
+
repo: ${{ github.repository }}
|
|
84
|
+
|
|
85
|
+
jobs:
|
|
86
|
+
conclude:
|
|
87
|
+
needs: [activation, agent, safe_outputs]
|
|
88
|
+
if: >
|
|
89
|
+
needs.agent.result == 'success' &&
|
|
90
|
+
needs.safe_outputs.result == 'success' &&
|
|
91
|
+
needs.safe_outputs.outputs.process_safe_outputs_processed_count != '0'
|
|
92
|
+
runs-on: agents-arc
|
|
93
|
+
permissions:
|
|
94
|
+
contents: read
|
|
95
|
+
issues: write
|
|
96
|
+
steps:
|
|
97
|
+
- name: Checkout workflow actions
|
|
98
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
99
|
+
with:
|
|
100
|
+
persist-credentials: false
|
|
101
|
+
- name: Create bot token
|
|
102
|
+
id: app-token
|
|
103
|
+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
|
104
|
+
with:
|
|
105
|
+
client-id: ${{ secrets.BOT_APP_ID }}
|
|
106
|
+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
|
|
107
|
+
# No apply-agent-output here. The safe_outputs job already created the issue and
|
|
108
|
+
# exposes its number; calling the action with create-issues would file a second copy
|
|
109
|
+
# of the same report. It was only needed while staged: true suppressed the native
|
|
110
|
+
# write, and staged is gone.
|
|
111
|
+
- name: Apply audit labels to created issues
|
|
112
|
+
if: needs.safe_outputs.outputs.created_issue_number != ''
|
|
113
|
+
uses: ./.github/actions/add-issue-labels
|
|
114
|
+
with:
|
|
115
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
116
|
+
issue-number: ${{ needs.safe_outputs.outputs.created_issue_number }}
|
|
117
|
+
labels: |
|
|
118
|
+
audit
|
|
119
|
+
bug
|
|
120
|
+
refine
|
|
121
|
+
|
|
122
|
+
safe-outputs:
|
|
123
|
+
# A failed run is already a red run. An issue per failure buries the real backlog
|
|
124
|
+
# under noise nobody closes.
|
|
125
|
+
report-failure-as-issue: false
|
|
126
|
+
threat-detection: false
|
|
127
|
+
create-issue:
|
|
128
|
+
max: 1
|
|
129
|
+
|
|
130
|
+
# The fleet is two machines, so this clock is also how long a stuck run can hold half of it.
|
|
131
|
+
# 240 went on to every worker at once when the provider was slow, which fixed the deaths and
|
|
132
|
+
# made every worker equally expensive to hang. These numbers are per worker: enough headroom
|
|
133
|
+
# for a slow gateway on the work it actually does, and not four hours for a run that reads one
|
|
134
|
+
# issue. Turns remain the guard against a confused agent looping; for a custom model the credit
|
|
135
|
+
# ceiling is models.dev fallback pricing and guards nothing.
|
|
136
|
+
#
|
|
137
|
+
# Sweeps the repository read-only and writes one findings issue. Observed around 45 minutes.
|
|
138
|
+
timeout-minutes: 90
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
1. Call skill("pc-repo-audit"), then run `/repo-audit` as a read-only audit of this
|
|
142
|
+
repository. Do not modify any file, do not commit, and do not push.
|
|
143
|
+
|
|
144
|
+
2. Apply repository documentation and established conventions while auditing. Focus on
|
|
145
|
+
concrete defects and avoid recommendations that weaken security, tests, or checks.
|
|
146
|
+
Adhere to ${{ env.REPO_RULES }}. Look for: ${{ env.AUDIT_FOCUS }}
|
|
147
|
+
|
|
148
|
+
From the audit report, find **5 to 7 problems**. For each finding, verify it meets ALL
|
|
149
|
+
of these criteria before keeping it:
|
|
150
|
+
- A specific, reproducible problem in a specific file or component.
|
|
151
|
+
- Has real impact: security risk, data loss, crash, or broken functionality.
|
|
152
|
+
- Something a developer could pick up and fix without further investigation.
|
|
153
|
+
Discard anything vague, stylistic, theoretical, or nice-to-have. If you cannot find 5 that
|
|
154
|
+
meet this bar, file as many as you can. If you find zero, call `noop` and stop , that is a
|
|
155
|
+
good result.
|
|
156
|
+
|
|
157
|
+
3. **Score each surviving finding from 1 to 10**, based on:
|
|
158
|
+
| Factor | Weight |
|
|
159
|
+
|---|---|
|
|
160
|
+
| Severity (how bad is the impact?) | high |
|
|
161
|
+
| Likelihood (how often does it trigger?) | medium |
|
|
162
|
+
| Blast radius (how many users/components affected?) | medium |
|
|
163
|
+
| Ease of fix (can it be fixed in one PR?) | low bonus |
|
|
164
|
+
|
|
165
|
+
Write the score next to each finding in your reasoning.
|
|
166
|
+
|
|
167
|
+
4. Read `/tmp/gh-aw/agent/open-issues.json`, which lists every open issue with its title and
|
|
168
|
+
labels. Discard any finding already tracked there. Exact-title duplicates are rejected for
|
|
169
|
+
you; your job is the ones worded differently that mean the same thing.
|
|
170
|
+
|
|
171
|
+
Open issues only cover what is still open, so a finding reported weeks ago and closed
|
|
172
|
+
without a fix, or deliberately rejected, would come back every single run. Before scoring,
|
|
173
|
+
call `memory_smart_search` for prior audits of this repository and drop any finding that
|
|
174
|
+
was already reported and consciously not acted on. After you have decided what to file,
|
|
175
|
+
call `memory_save` once with a compact record of this audit: the date, each finding's file
|
|
176
|
+
and one-line description, and its disposition (filed, already tracked, or previously
|
|
177
|
+
rejected). Keep it short; it is read by the next audit, not by a person.
|
|
178
|
+
|
|
179
|
+
A finding you have reported before and that is genuinely still broken IS worth filing
|
|
180
|
+
again. What this prevents is re-filing something the team looked at and chose to live
|
|
181
|
+
with, which is the noise that makes an audit backlog get ignored.
|
|
182
|
+
|
|
183
|
+
5. Call `create_issue` **once** with title "Audit: <date>". Do NOT specify labels , the
|
|
184
|
+
conclude job will apply them. The body MUST have two sections:
|
|
185
|
+
|
|
186
|
+
**Section 1 , All findings:** A numbered list of every finding (5-7) with its score,
|
|
187
|
+
file path, and a one-line description. Order by score descending.
|
|
188
|
+
|
|
189
|
+
**Section 2 , Top 3 to implement:** Call skill("pc-plan-story") and refine the top 3
|
|
190
|
+
findings by score into user stories in Mike Cohn's As a / I want to / so that format
|
|
191
|
+
with Given/When/Then acceptance criteria, edge cases, and likely files to change. Mark
|
|
192
|
+
this section clearly with a heading like `## Top 3 , To Implement`.
|
|
193
|
+
|
|
194
|
+
The issue you file goes to Refine, not straight to implementation. Refine sizes it and,
|
|
195
|
+
because a report of several unrelated defects across different files is exactly the shape
|
|
196
|
+
that does not land as one pull request, splits it into one properly estimated issue per
|
|
197
|
+
finding. Write each finding so it survives that split: self-contained, naming its own
|
|
198
|
+
files and its own acceptance criteria, never "as above" or "same as finding 2".
|
|
199
|
+
|
|
200
|
+
6. If nothing met the bar, call `noop` and stop. Filing nothing is the right outcome when
|
|
201
|
+
the codebase is clean.
|