@plainconceptsplatform/workflows 0.20.2 → 0.20.3

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 (46) hide show
  1. package/dist/index.js +0 -0
  2. package/dist/stack-defaults.js +16 -16
  3. package/dist/workflow-catalog.d.ts +1 -1
  4. package/dist/workflow-catalog.js +2 -0
  5. package/loops/actions/add-issue-labels/action.yml +50 -50
  6. package/loops/actions/agent-output.cjs +17 -17
  7. package/loops/actions/apply-agent-bundle/action.yml +24 -24
  8. package/loops/actions/apply-agent-comments/action.yml +42 -42
  9. package/loops/actions/apply-agent-labels/action.yml +55 -55
  10. package/loops/actions/apply-agent-output/action.yml +108 -108
  11. package/loops/actions/classify-route/action.yml +100 -100
  12. package/loops/actions/cleanup-artifacts/action.yml +91 -91
  13. package/loops/actions/close-agent-issues/action.yml +43 -43
  14. package/loops/actions/collect-app-errors/action.yml +297 -0
  15. package/loops/actions/collect-app-errors/group-and-redact.mjs +252 -0
  16. package/loops/actions/collect-app-errors/query-app-errors.sh +104 -0
  17. package/loops/actions/create-agent-issues/action.yml +52 -52
  18. package/loops/actions/create-issue-comment/action.yml +29 -29
  19. package/loops/actions/download-agent-output/action.yml +53 -53
  20. package/loops/actions/link-pr-to-issue/action.yml +40 -40
  21. package/loops/actions/list-open-issues/action.yml +33 -33
  22. package/loops/actions/load-issue-context/action.yml +45 -45
  23. package/loops/actions/merge-agent-pr/action.yml +49 -49
  24. package/loops/actions/push-agent-branch/action.yml +45 -45
  25. package/loops/actions/remove-issue-labels/action.yml +37 -37
  26. package/loops/actions/update-agent-issues/action.yml +58 -58
  27. package/loops/actions/validate-review-output/action.yml +35 -35
  28. package/loops/actions/validate-triage-output/action.yml +36 -36
  29. package/loops/actions/verify-app-errors/action.yml +11 -0
  30. package/loops/actions/verify-app-errors/verify-app-errors.mjs +216 -0
  31. package/loops/actions/verify-composite-actions/action.yml +9 -9
  32. package/loops/actions/verify-refine-output/action.yml +9 -9
  33. package/loops/actions/verify-route-matrix/action.yml +9 -9
  34. package/loops/actions/verify-route-matrix/verify-route-matrix.sh +88 -0
  35. package/loops/scripts/compile-agent-workflows.mjs +331 -331
  36. package/loops/templates/agentics/agentics-app-errors.yml +168 -0
  37. package/loops/templates/agentics/agentics-maintenance.yml +121 -121
  38. package/loops/templates/ci/app-ci-dotnet-next.yml +330 -330
  39. package/loops/templates/ci/app-ci-node-monorepo.yml +260 -260
  40. package/loops/templates/issues/bug_report.yml +109 -109
  41. package/loops/templates/issues/feature_request.yml +75 -75
  42. package/loops/templates/release/github-release.yml +30 -30
  43. package/loops/workflows/authorize-bot-work.yml +105 -105
  44. package/loops/workflows/shared/opencode-ci.md +206 -206
  45. package/loops/workflows/shared/platform-defaults.md +19 -19
  46. package/package.json +9 -8
@@ -0,0 +1,168 @@
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/templates/agentics/agentics-app-errors.yml. Update with `workflows update --force`; consumer edits may be overwritten.
2
+ name: "Agentics: App Errors"
3
+
4
+ # Once a day, ask Application Insights what the deployed application actually threw, and file
5
+ # the distinct problems as issues here, labelled so refine sizes them and implement fixes them.
6
+ #
7
+ # THIS REPORT STAYS IN THIS REPOSITORY. That is the design constraint, and it is the opposite
8
+ # of the one in agentics-error-report.yml. That workflow exists to carry a *workflow* failure
9
+ # out of a private repository into the public package, so it is built to send almost nothing.
10
+ # An application's exceptions are this repository's own business: they are filed here, beside
11
+ # the code that threw them, and nothing about them travels anywhere.
12
+ #
13
+ # The job is deterministic -- no model runs -- for the same reason that one is: a model
14
+ # summarising a stack trace paraphrases it, and a paraphrased stack trace is a wrong issue
15
+ # that costs somebody an afternoon. The agent work happens afterwards, on the belt, where
16
+ # refine reads the issue and implement fixes it.
17
+ #
18
+ # To turn it off: delete this file, or clear APP_ENV below.
19
+ #
20
+ # BEFORE THE FIRST RUN the deploy identity needs Monitoring Reader on the Log Analytics
21
+ # workspace. It can create the workspace and cannot read it, which is not a contradiction:
22
+ # creating is a control-plane right and querying is a data-plane one. Either add the role
23
+ # assignment to infra/bicep, or once per environment:
24
+ #
25
+ # az role assignment create \
26
+ # --assignee-object-id "$(az ad sp show --id "$AZURE_CLIENT_ID" --query id -o tsv)" \
27
+ # --assignee-principal-type ServicePrincipal \
28
+ # --role "Monitoring Reader" \
29
+ # --scope "$(az monitor log-analytics workspace show -g "$AZURE_RG" -n "$WORKSPACE" --query id -o tsv)"
30
+
31
+ run-name: "App errors: ${{ github.event.inputs.app-env || 'pre' }}, last ${{ github.event.inputs.lookback-hours || '24' }}h"
32
+
33
+ on:
34
+ schedule:
35
+ # An hour after the workflow error report, so a morning's reading arrives together. This
36
+ # runs on a GitHub-hosted runner and never touches the agent fleet, so there is no slot to
37
+ # stagger against other repositories.
38
+ - cron: "41 7 * * *"
39
+ workflow_dispatch:
40
+ inputs:
41
+ app-env:
42
+ description: "Which deployed environment to read"
43
+ required: false
44
+ type: string
45
+ default: 'pre'
46
+ lookback-hours:
47
+ description: "How far back to look"
48
+ required: false
49
+ type: string
50
+ default: '24'
51
+ dry-run:
52
+ description: "Work out what would be filed and file nothing"
53
+ required: false
54
+ type: boolean
55
+ default: false
56
+
57
+ permissions:
58
+ contents: read
59
+
60
+ env:
61
+ # Which infra/<env>.env is read, and the word that appears in issue titles. Clearing it
62
+ # turns the workflow into a no-op that says so, which is what a repository with no
63
+ # Application Insights should get.
64
+ APP_ENV: "pre"
65
+ # Matches the cron. A window wider than the schedule counts the same problem twice; a
66
+ # narrower one loses whatever happened in the gap.
67
+ LOOKBACK_HOURS: "24"
68
+ # The floor. A problem below this is real but not yet news, and a belt buried under
69
+ # single-occurrence reports is a belt somebody switches off.
70
+ MIN_OCCURRENCES: "5"
71
+ MIN_OPERATIONS: "1"
72
+ # The ceiling on NEW issues per run. Whatever is left over is named in the job summary and
73
+ # picked up tomorrow, never dropped in silence.
74
+ MAX_FINDINGS: "3"
75
+ # Backpressure, the audit's rule: do not pile reports on top of unactioned reports.
76
+ MAX_OPEN: "5"
77
+ # The prefix that marks a stack frame as this repository's own, for example "Pliny" or
78
+ # "Numa". EMPTY PUBLISHES NO FRAMES AT ALL, which loses detail rather than putting somebody
79
+ # else's file paths into an issue. Set it once and the issues get much more useful.
80
+ OWN_CODE_PREFIX: ""
81
+ # What the issues carry. The first is what backpressure counts; the rest are what puts the
82
+ # finding on the belt.
83
+ ERROR_LABEL: "app-error"
84
+ BELT_LABELS: "bug,refine"
85
+
86
+ jobs:
87
+ collect:
88
+ # Fork of a consumer: not their Azure, not their issues.
89
+ if: "!github.event.repository.fork"
90
+ runs-on: ubuntu-latest
91
+ timeout-minutes: 20
92
+ # Load bearing, not decoration. The federated credential on the deploy identity trusts the
93
+ # subject `repo:<org>/<repo>:environment:<name>`, so without this the OIDC token is issued
94
+ # with a subject Azure will not accept and the login fails with nothing useful to read.
95
+ environment: ${{ github.event.inputs.app-env || 'pre' }}
96
+ concurrency:
97
+ group: agentics-app-errors
98
+ cancel-in-progress: false
99
+ permissions:
100
+ contents: read
101
+ # Filing here, with this repository's own token. No App token, no upstream.
102
+ issues: write
103
+ # For azure/login.
104
+ id-token: write
105
+ steps:
106
+ - name: Checkout
107
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
108
+ with:
109
+ persist-credentials: false
110
+
111
+ # Non-secret deployment identifiers: AZURE_RG, WORKLOAD, ENV_TOKEN, INSTANCE. The same
112
+ # file and the same mechanism the deploy workflows use, so the resource names here can
113
+ # never drift from the ones that were actually deployed.
114
+ - name: Load environment config
115
+ id: config
116
+ env:
117
+ APP_ENV_NAME: ${{ github.event.inputs.app-env || env.APP_ENV }}
118
+ run: |
119
+ set -euo pipefail
120
+ if [ -z "$APP_ENV_NAME" ] || [ ! -f "infra/${APP_ENV_NAME}.env" ]; then
121
+ echo "::warning::No infra/${APP_ENV_NAME}.env, so there is nothing to read. Clear APP_ENV or add the file."
122
+ echo "ready=false" >> "$GITHUB_OUTPUT"
123
+ exit 0
124
+ fi
125
+ grep -vE '^\s*#|^\s*$' "infra/${APP_ENV_NAME}.env" >> "$GITHUB_ENV"
126
+ echo "APP_ENV_NAME=${APP_ENV_NAME}" >> "$GITHUB_ENV"
127
+ echo "ready=true" >> "$GITHUB_OUTPUT"
128
+
129
+ - name: Azure login (OIDC)
130
+ if: steps.config.outputs.ready == 'true'
131
+ uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0
132
+ with:
133
+ client-id: ${{ vars.AZURE_CLIENT_ID }}
134
+ tenant-id: ${{ vars.AZURE_TENANT_ID }}
135
+ subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
136
+
137
+ - name: Resolve the workspace
138
+ id: workspace
139
+ if: steps.config.outputs.ready == 'true'
140
+ run: |
141
+ set -euo pipefail
142
+ # The Bicep naming convention, the same line app-deploy-env.yml uses to derive the
143
+ # App Insights name. Reading the name from the convention rather than from a
144
+ # variable is what stops this pointing at a workspace nobody deploys to.
145
+ NAME="${WORKLOAD}-${ENV_TOKEN}-log-${INSTANCE}"
146
+ # The customerId, which is the GUID a query is addressed to. Not the resource id.
147
+ if ! ID="$(az monitor log-analytics workspace show \
148
+ --resource-group "$AZURE_RG" --workspace-name "$NAME" \
149
+ --query customerId --output tsv 2>/dev/null)"; then
150
+ echo "::warning::No workspace ${NAME} in ${AZURE_RG}, so nothing was queried."
151
+ ID=""
152
+ fi
153
+ echo "id=${ID}" >> "$GITHUB_OUTPUT"
154
+
155
+ - uses: ./.github/actions/collect-app-errors
156
+ with:
157
+ token: ${{ github.token }}
158
+ workspace-id: ${{ steps.workspace.outputs.id }}
159
+ environment: ${{ env.APP_ENV_NAME || env.APP_ENV }}
160
+ lookback-hours: ${{ github.event.inputs.lookback-hours || env.LOOKBACK_HOURS }}
161
+ min-occurrences: ${{ env.MIN_OCCURRENCES }}
162
+ min-operations: ${{ env.MIN_OPERATIONS }}
163
+ max-findings: ${{ env.MAX_FINDINGS }}
164
+ max-open: ${{ env.MAX_OPEN }}
165
+ label: ${{ env.ERROR_LABEL }}
166
+ extra-labels: ${{ env.BELT_LABELS }}
167
+ own-code-prefix: ${{ env.OWN_CODE_PREFIX }}
168
+ dry-run: ${{ github.event.inputs.dry-run || 'false' }}
@@ -1,121 +1,121 @@
1
- # Managed by @plainconceptsplatform/workflows. Source: loops/templates/agentics/agentics-maintenance.yml. Update with `workflows update --force`; consumer edits may be overwritten.
2
- # Derived from the gh-aw v0.83.4 maintenance workflow.
3
- # Copy provenance is documented in docs/ownership.md.
4
- name: Agentic Maintenance
5
-
6
- on:
7
- schedule:
8
- - cron: "37 0 * * *"
9
- workflow_dispatch:
10
- inputs:
11
- operation:
12
- description: Optional maintenance operation to run
13
- required: false
14
- type: choice
15
- default: ""
16
- options:
17
- - ""
18
- - disable
19
- - enable
20
- - update
21
- - upgrade
22
- - safe_outputs
23
- - create_labels
24
- - activity_report
25
- - close_agentic_workflows_issues
26
- - clean_cache_memories
27
- - update_pull_request_branches
28
- - validate
29
- - forecast
30
- run_url:
31
- description: Run URL or run ID required for safe_outputs
32
- required: false
33
- type: string
34
- default: ""
35
- workflow_call:
36
- inputs:
37
- operation:
38
- required: false
39
- type: string
40
- default: ""
41
- run_url:
42
- required: false
43
- type: string
44
- default: ""
45
-
46
- permissions: {}
47
-
48
- jobs:
49
- close-expired-discussions:
50
- if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
51
- runs-on: ubuntu-latest
52
- permissions:
53
- discussions: write
54
- steps:
55
- - name: Setup Scripts
56
- uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
57
- with:
58
- destination: ${{ runner.temp }}/gh-aw/actions
59
- - name: Close expired discussions
60
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
61
- with:
62
- script: |
63
- const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
64
- setupGlobals(core, github, context, exec, io, getOctokit);
65
- const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_discussions.cjs');
66
- await main();
67
- close-expired-issues:
68
- if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
69
- runs-on: ubuntu-latest
70
- permissions:
71
- issues: write
72
- steps:
73
- - name: Setup Scripts
74
- uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
75
- with:
76
- destination: ${{ runner.temp }}/gh-aw/actions
77
- - name: Close expired issues
78
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
79
- with:
80
- script: |
81
- const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
82
- setupGlobals(core, github, context, exec, io, getOctokit);
83
- const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_issues.cjs');
84
- await main();
85
- close-expired-pull-requests:
86
- if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
87
- runs-on: ubuntu-latest
88
- permissions:
89
- pull-requests: write
90
- steps:
91
- - name: Setup Scripts
92
- uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
93
- with:
94
- destination: ${{ runner.temp }}/gh-aw/actions
95
- - name: Close expired pull requests
96
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
97
- with:
98
- script: |
99
- const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
100
- setupGlobals(core, github, context, exec, io, getOctokit);
101
- const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs');
102
- await main();
103
- cleanup-cache-memory:
104
- if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '' || inputs.operation == 'clean_cache_memories') }}
105
- runs-on: ubuntu-latest
106
- permissions:
107
- actions: write
108
- steps:
109
- - name: Setup Scripts
110
- uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
111
- with:
112
- destination: ${{ runner.temp }}/gh-aw/actions
113
- - name: Cleanup outdated cache-memory entries
114
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
115
- with:
116
- script: |
117
- const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
118
- setupGlobals(core, github, context, exec, io, getOctokit);
119
- const { main } = require('${{ runner.temp }}/gh-aw/actions/cleanup_cache_memory.cjs');
120
- await main();
121
- #
1
+ # Managed by @plainconceptsplatform/workflows. Source: loops/templates/agentics/agentics-maintenance.yml. Update with `workflows update --force`; consumer edits may be overwritten.
2
+ # Derived from the gh-aw v0.83.4 maintenance workflow.
3
+ # Copy provenance is documented in docs/ownership.md.
4
+ name: Agentic Maintenance
5
+
6
+ on:
7
+ schedule:
8
+ - cron: "37 0 * * *"
9
+ workflow_dispatch:
10
+ inputs:
11
+ operation:
12
+ description: Optional maintenance operation to run
13
+ required: false
14
+ type: choice
15
+ default: ""
16
+ options:
17
+ - ""
18
+ - disable
19
+ - enable
20
+ - update
21
+ - upgrade
22
+ - safe_outputs
23
+ - create_labels
24
+ - activity_report
25
+ - close_agentic_workflows_issues
26
+ - clean_cache_memories
27
+ - update_pull_request_branches
28
+ - validate
29
+ - forecast
30
+ run_url:
31
+ description: Run URL or run ID required for safe_outputs
32
+ required: false
33
+ type: string
34
+ default: ""
35
+ workflow_call:
36
+ inputs:
37
+ operation:
38
+ required: false
39
+ type: string
40
+ default: ""
41
+ run_url:
42
+ required: false
43
+ type: string
44
+ default: ""
45
+
46
+ permissions: {}
47
+
48
+ jobs:
49
+ close-expired-discussions:
50
+ if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
51
+ runs-on: ubuntu-latest
52
+ permissions:
53
+ discussions: write
54
+ steps:
55
+ - name: Setup Scripts
56
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
57
+ with:
58
+ destination: ${{ runner.temp }}/gh-aw/actions
59
+ - name: Close expired discussions
60
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
61
+ with:
62
+ script: |
63
+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
64
+ setupGlobals(core, github, context, exec, io, getOctokit);
65
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_discussions.cjs');
66
+ await main();
67
+ close-expired-issues:
68
+ if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
69
+ runs-on: ubuntu-latest
70
+ permissions:
71
+ issues: write
72
+ steps:
73
+ - name: Setup Scripts
74
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
75
+ with:
76
+ destination: ${{ runner.temp }}/gh-aw/actions
77
+ - name: Close expired issues
78
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
79
+ with:
80
+ script: |
81
+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
82
+ setupGlobals(core, github, context, exec, io, getOctokit);
83
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_issues.cjs');
84
+ await main();
85
+ close-expired-pull-requests:
86
+ if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }}
87
+ runs-on: ubuntu-latest
88
+ permissions:
89
+ pull-requests: write
90
+ steps:
91
+ - name: Setup Scripts
92
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
93
+ with:
94
+ destination: ${{ runner.temp }}/gh-aw/actions
95
+ - name: Close expired pull requests
96
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
97
+ with:
98
+ script: |
99
+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
100
+ setupGlobals(core, github, context, exec, io, getOctokit);
101
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs');
102
+ await main();
103
+ cleanup-cache-memory:
104
+ if: ${{ !(github.event.repository.fork) && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '' || inputs.operation == 'clean_cache_memories') }}
105
+ runs-on: ubuntu-latest
106
+ permissions:
107
+ actions: write
108
+ steps:
109
+ - name: Setup Scripts
110
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
111
+ with:
112
+ destination: ${{ runner.temp }}/gh-aw/actions
113
+ - name: Cleanup outdated cache-memory entries
114
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
115
+ with:
116
+ script: |
117
+ const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
118
+ setupGlobals(core, github, context, exec, io, getOctokit);
119
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/cleanup_cache_memory.cjs');
120
+ await main();
121
+ #