@plainconceptsplatform/workflows 1.0.11 → 1.0.13

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/dist/index.js CHANGED
File without changes
@@ -135,6 +135,11 @@ for (const file of readdirSync(workflowDirectory)) {
135
135
  }
136
136
  const patched = content
137
137
  .replace(/^(# This file was automatically generated by gh-aw[^\n]*\n)/m, `$1${SENTINEL}\n`)
138
+ // Workflow affinity: every agent job carries a per-run label so the scaler can pin a
139
+ // whole run to one VM, and the base label moves to agents-aw so a CI-only job
140
+ // (agents-arc) can never land on a run's dedicated VM. Done post-compile because
141
+ // gh-aw's frontmatter runs-on is a plain scalar. The function form keeps ${{ }} literal.
142
+ .replace(/runs-on: agents-arc/g, () => 'runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]')
138
143
  // The engine command is normalized to one shape:
139
144
  // - OPENCODE_DISABLE_MODELS_FETCH=1: opencode otherwise fetches its model
140
145
  // registry from https://models.opencode.ai/api.json at startup and blocks
@@ -2,12 +2,13 @@
2
2
  # Runners this repository actually has.
3
3
  #
4
4
  # actionlint knows GitHub's own labels and rejects everything else, so a workflow that
5
- # names one of our runner groups was reported as an error on every pull request. Both
6
- # of these are real: agents-arc runs the agentic workflows, RunnerLandingZone runs the
7
- # work router. Listing them here is how actionlint is told a label is self-hosted
8
- # rather than a typo, and it keeps that knowledge in a file the workflow generator
9
- # does not overwrite.
5
+ # names one of our runner groups was reported as an error on every pull request. All of
6
+ # these are real: agents-arc runs CI/Deploy, agents-aw runs the agent workflows,
7
+ # RunnerLandingZone runs the work router. Listing them here is how actionlint is told a
8
+ # label is self-hosted rather than a typo, and it keeps that knowledge in a file the
9
+ # workflow generator does not overwrite.
10
10
  self-hosted-runner:
11
11
  labels:
12
12
  - agents-arc
13
+ - agents-aw
13
14
  - RunnerLandingZone
@@ -34,7 +34,7 @@ jobs:
34
34
  github.event.label.name == 'refine') &&
35
35
  !contains(github.event.issue.labels.*.name, 'bot-working') &&
36
36
  !endsWith(github.actor, '[bot]')
37
- runs-on: agents-arc
37
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
38
38
  timeout-minutes: 5
39
39
  concurrency:
40
40
  group: authorize-${{ github.event.issue.number }}
@@ -198,6 +198,15 @@ pre-agent-steps:
198
198
 
199
199
  printf '%s\n' "$merged" > "$CONFIG"
200
200
 
201
+ # A tracked config now differs from HEAD, so the agent sees it in `git diff`, takes it for
202
+ # a stray change and reverts it with `git checkout`. That drops the CI agent and its
203
+ # permissions mid-run: the next shell call is refused and the run falls back to the
204
+ # default agent with no key (Pliny-Bot run 37674193415). skip-worktree hides the file
205
+ # from status and diff and makes `git checkout -- opencode.jsonc` refuse the path.
206
+ if git ls-files --error-unmatch "$CONFIG" > /dev/null 2>&1; then
207
+ git update-index --skip-worktree "$CONFIG"
208
+ fi
209
+
201
210
  # gh-aw's own "Write OpenCode Config" step runs next and merges its base config with
202
211
  # `$existing * $base`. Base wins on conflicting keys, but it defines neither `model`
203
212
  # nor this provider, so both survive and `awf-proxy` is added alongside.
@@ -267,7 +267,7 @@ permissions:
267
267
  jobs:
268
268
  # Public repositories must check repository permission before an event can start a model.
269
269
  authorize:
270
- runs-on: agents-arc
270
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
271
271
  timeout-minutes: 5
272
272
  permissions:
273
273
  contents: read
@@ -370,7 +370,7 @@ jobs:
370
370
  esac
371
371
 
372
372
  classify:
373
- runs-on: agents-arc
373
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
374
374
  timeout-minutes: 5
375
375
  permissions:
376
376
  contents: read
@@ -428,7 +428,7 @@ jobs:
428
428
  check-implement-pr:
429
429
  needs: [classify, authorize]
430
430
  if: needs.classify.outputs.route == 'implement' && needs.authorize.outputs.trusted == 'true'
431
- runs-on: agents-arc
431
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
432
432
  timeout-minutes: 3
433
433
  permissions:
434
434
  contents: read
@@ -519,7 +519,7 @@ jobs:
519
519
  dispatch-triage:
520
520
  needs: [classify, authorize]
521
521
  if: needs.classify.outputs.route == 'triage' && needs.authorize.outputs.is_outside_collaborator == 'true'
522
- runs-on: agents-arc
522
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
523
523
  timeout-minutes: 5
524
524
  permissions:
525
525
  actions: write
@@ -669,7 +669,7 @@ jobs:
669
669
  if: >
670
670
  needs.classify.outputs.route == 'bot-approve' &&
671
671
  (github.actor == 'app/github-actions' || github.actor == 'platform-devbox[bot]')
672
- runs-on: agents-arc
672
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
673
673
  timeout-minutes: 5
674
674
  permissions:
675
675
  actions: write
@@ -726,7 +726,7 @@ jobs:
726
726
  github.event.pull_request.head.repo.full_name == github.repository
727
727
  )
728
728
  )
729
- runs-on: agents-arc
729
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
730
730
  timeout-minutes: 10
731
731
  permissions:
732
732
  contents: read
@@ -918,7 +918,7 @@ jobs:
918
918
  reconcile-bot-pr-runs:
919
919
  needs: classify
920
920
  if: needs.classify.outputs.route == 'reconcile-bot-pr-runs'
921
- runs-on: agents-arc
921
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
922
922
  timeout-minutes: 5
923
923
  permissions:
924
924
  contents: read
@@ -1145,7 +1145,7 @@ jobs:
1145
1145
  audit-close:
1146
1146
  needs: classify
1147
1147
  if: needs.classify.outputs.route == 'audit-close'
1148
- runs-on: agents-arc
1148
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
1149
1149
  timeout-minutes: 15
1150
1150
  concurrency:
1151
1151
  group: audit-close
@@ -1170,7 +1170,7 @@ jobs:
1170
1170
  cleanup-artifacts:
1171
1171
  needs: classify
1172
1172
  if: needs.classify.outputs.route == 'cleanup-artifacts' && !github.event.repository.fork
1173
- runs-on: agents-arc
1173
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
1174
1174
  timeout-minutes: 15
1175
1175
  concurrency:
1176
1176
  group: cleanup-artifacts
@@ -1194,7 +1194,7 @@ jobs:
1194
1194
  housekeeping:
1195
1195
  needs: classify
1196
1196
  if: needs.classify.outputs.route == 'housekeeping' && !github.event.repository.fork
1197
- runs-on: agents-arc
1197
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
1198
1198
  timeout-minutes: 15
1199
1199
  concurrency:
1200
1200
  group: housekeeping
@@ -1235,7 +1235,7 @@ jobs:
1235
1235
  validate:
1236
1236
  needs: classify
1237
1237
  if: needs.classify.outputs.route == 'validate'
1238
- runs-on: agents-arc
1238
+ runs-on: [agents-aw, "affinity-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}"]
1239
1239
  timeout-minutes: 10
1240
1240
  permissions:
1241
1241
  contents: read
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plainconceptsplatform/workflows",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Install and update Platform GitHub agentic workflows.",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -25,6 +25,13 @@
25
25
  "loops",
26
26
  "README.md"
27
27
  ],
28
+ "scripts": {
29
+ "build": "tsc --project tsconfig.build.json && node ./scripts/copy-loops.mjs",
30
+ "test": "vitest run",
31
+ "typecheck": "tsc --noEmit --project tsconfig.json",
32
+ "release": "pnpm build && pnpm test && npm publish --access public",
33
+ "prepack": "node ./scripts/copy-loops.mjs"
34
+ },
28
35
  "engines": {
29
36
  "node": ">=20.19"
30
37
  },
@@ -35,11 +42,5 @@
35
42
  "@types/node": "^22.0.0",
36
43
  "typescript": "^5.8.0",
37
44
  "vitest": "^3.0.0"
38
- },
39
- "scripts": {
40
- "build": "tsc --project tsconfig.build.json && node ./scripts/copy-loops.mjs",
41
- "test": "vitest run",
42
- "typecheck": "tsc --noEmit --project tsconfig.json",
43
- "release": "pnpm build && pnpm test && npm publish --access public"
44
45
  }
45
- }
46
+ }