@plainconceptsplatform/workflows 0.28.11 → 0.28.12

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.
@@ -927,6 +927,21 @@ if worker_installed implement; then
927
927
  if [ "$IMPLEMENT_RETRY_OK" -eq 1 ]; then PASS=$((PASS + 1)); else FAIL=$((FAIL + 1)); fi
928
928
  fi
929
929
 
930
+ # A queued worker can start long after it was dispatched. If triage concluded
931
+ # needs-maintainer while the run waited in a queue, the issue carries review and
932
+ # the verdict must stand: the reserve step clears review blindly, so eligibility
933
+ # has to catch it first (Pliny-Bot #372).
934
+ for route in implement refine; do
935
+ worker_md="${WORKFLOWS_DIR}/agent-${route}.md"
936
+ [ -f "$worker_md" ] || continue
937
+ if grep -q 'index("review")' "$worker_md"; then
938
+ PASS=$((PASS + 1))
939
+ else
940
+ FAIL=$((FAIL + 1))
941
+ echo "FAIL: agent-${route} eligibility does not guard against the review label; a queued worker could override a triage verdict" >&2
942
+ fi
943
+ done
944
+
930
945
  if worker_installed merge-gate; then
931
946
  # A failed attempt must not strip `implement`: identify-gate-subject refuses an issue
932
947
  # without it, so the first crash would starve every retry at the subject check.
@@ -2409,7 +2424,7 @@ if [ -f "$APP_ERRORS_MJS" ]; then
2409
2424
  # values and cannot see a field somebody adds next year. Compared as a set, so reordering is
2410
2425
  # fine and an addition is not. run_id is the one that matters: it is unhashed on this
2411
2426
  # telemetry and joins to a conversation and to a person.
2412
- expected_fields="exceptionType frames fingerprint firstSeen lastSeen occurrences operationName operations problemId roleName"
2427
+ expected_fields="exceptionType frames fingerprint firstSeen lastSeen occurrences operationName operations problemId roleName topFrames message category"
2413
2428
  actual_fields="$(sed -n '/export const FINDING_FIELDS = \[/,/\];/p' "$APP_ERRORS_MJS" |
2414
2429
  grep -oE '"[a-zA-Z]+"' | tr -d '"' | sort | tr '\n' ' ' | sed 's/ $//')"
2415
2430
  if [ "$actual_fields" = "$(echo "$expected_fields" | tr ' ' '\n' | sort | tr '\n' ' ' | sed 's/ $//')" ]; then
@@ -159,6 +159,16 @@ jobs:
159
159
  exit 0
160
160
  fi
161
161
 
162
+ # A queued implement run can start long after it was dispatched. If triage concluded
163
+ # needs-maintainer while this run waited in the implement-global queue, the issue now
164
+ # carries review and the verdict must stand: the reserve step clears review blindly,
165
+ # so eligibility has to catch it first (Pliny-Bot #372).
166
+ if jq -e 'index("review")' >/dev/null <<<"$labels"; then
167
+ echo "eligible=false" >> "$GITHUB_OUTPUT"
168
+ echo "::notice::Issue #$ISSUE_NUMBER has the review label. Automated implementation skipped."
169
+ exit 0
170
+ fi
171
+
162
172
  echo "eligible=true" >> "$GITHUB_OUTPUT"
163
173
 
164
174
  reserve:
@@ -106,12 +106,7 @@ on:
106
106
  required: false
107
107
  type: string
108
108
  default: first
109
- # The gate jobs that the top-level `if:` reads. gh-aw folds that `if:` into the generated
110
- # activation job but gives activation no dependency on the jobs, so the reference resolves
111
- # to '' and the clause is false -- the agent would never run. The package's own validator
112
- # catches it after compilation; this is the line it asks for, the same one the merge gate
113
- # uses for protected_changes.
114
- needs: [still_open, size_guard]
109
+ needs: [still_open, size_guard, eligibility]
115
110
 
116
111
  jobs:
117
112
  # A route dispatched while the issue was open must not execute after it has been closed. The
@@ -138,6 +133,34 @@ jobs:
138
133
  with:
139
134
  token: ${{ github.token }}
140
135
  issue-number: ${{ inputs.issue-number }}
136
+ # A queued refine run can start long after it was dispatched. If triage concluded
137
+ # needs-maintainer while this run waited in a queue, the issue now carries review and
138
+ # the verdict must stand: the reserve step clears review blindly, so eligibility has to
139
+ # catch it first (Pliny-Bot #372).
140
+ eligibility:
141
+ needs: [still_open]
142
+ if: needs.still_open.outputs.open == 'true'
143
+ runs-on: agents-arc
144
+ permissions:
145
+ issues: read
146
+ outputs:
147
+ eligible: ${{ steps.check.outputs.eligible }}
148
+ steps:
149
+ - name: Check if the issue is parked for review
150
+ id: check
151
+ env:
152
+ GH_TOKEN: ${{ github.token }}
153
+ ISSUE_NUMBER: ${{ inputs.issue-number }}
154
+ run: |
155
+ set -euo pipefail
156
+ labels=$(gh issue view "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" --json labels \
157
+ --jq '[.labels[].name]')
158
+ if jq -e 'index("review")' >/dev/null <<<"$labels"; then
159
+ echo "eligible=false" >> "$GITHUB_OUTPUT"
160
+ echo "::notice::Issue #$ISSUE_NUMBER has the review label. Automated refinement skipped."
161
+ exit 0
162
+ fi
163
+ echo "eligible=true" >> "$GITHUB_OUTPUT"
141
164
  # The size gate, rung 4. Measures the issue before any model starts, because an oversized
142
165
  # body does not fail fast on its own: it produces an agent that explores for seventeen
143
166
  # minutes and then dies mid-generation at the provider's response cap having written
@@ -145,8 +168,8 @@ jobs:
145
168
  # shell, no network beyond one issue read; over either limit it is a refusal, not a
146
169
  # smaller attempt.
147
170
  size_guard:
148
- needs: [still_open]
149
- if: needs.still_open.outputs.open == 'true'
171
+ needs: [still_open, eligibility]
172
+ if: needs.still_open.outputs.open == 'true' && needs.eligibility.outputs.eligible == 'true'
150
173
  runs-on: agents-arc
151
174
  timeout-minutes: 5
152
175
  permissions:
@@ -188,8 +211,8 @@ jobs:
188
211
  # replies re-enters rerefine through the comment route, and the classifier ignores
189
212
  # bot comments, so this comment cannot re-trigger the worker.
190
213
  refuse_big_issue:
191
- needs: [still_open, size_guard]
192
- if: needs.still_open.outputs.open == 'true' && needs.size_guard.outputs.too_big == 'true'
214
+ needs: [still_open, size_guard, eligibility]
215
+ if: needs.still_open.outputs.open == 'true' && needs.eligibility.outputs.eligible == 'true' && needs.size_guard.outputs.too_big == 'true'
193
216
  runs-on: agents-arc
194
217
  timeout-minutes: 5
195
218
  permissions:
@@ -241,8 +264,8 @@ jobs:
241
264
  issue-number: ${{ inputs.issue-number }}
242
265
  labels: ${{ env.WORKING_LABEL }}
243
266
  reserve:
244
- needs: [still_open, size_guard]
245
- if: needs.still_open.outputs.open == 'true' && needs.size_guard.outputs.too_big != 'true'
267
+ needs: [still_open, size_guard, eligibility]
268
+ if: needs.still_open.outputs.open == 'true' && needs.eligibility.outputs.eligible == 'true' && needs.size_guard.outputs.too_big != 'true'
246
269
  runs-on: agents-arc
247
270
  permissions:
248
271
  contents: read
@@ -497,9 +520,10 @@ jobs:
497
520
  # clause every refused issue also looped here -- one human-label visit produced eight
498
521
  # refusal comments and eight "Attempt N of 5" comments, none of which could succeed
499
522
  # (Pliny-Bot #322).
500
- needs: [activation, agent, safe_outputs, validate_output, size_guard]
523
+ needs: [activation, agent, safe_outputs, validate_output, size_guard, eligibility]
501
524
  if: >
502
525
  always() &&
526
+ needs.eligibility.outputs.eligible == 'true' &&
503
527
  needs.size_guard.outputs.too_big != 'true' &&
504
528
  (
505
529
  needs.agent.result != 'success' ||
@@ -629,7 +653,7 @@ jobs:
629
653
  # the implicit success(): a refused skip no longer poisons the agent, while any real
630
654
  # failure -- size_guard erroring, the refusal job erroring mid-refuse, reserve failing --
631
655
  # still blocks it and lands in incomplete.
632
- if: inputs.issue-number != '' && needs.still_open.outputs.open == 'true' && needs.size_guard.outputs.too_big != 'true' && !failure()
656
+ if: inputs.issue-number != '' && needs.still_open.outputs.open == 'true' && needs.eligibility.outputs.eligible == 'true' && needs.size_guard.outputs.too_big != 'true' && !failure()
633
657
 
634
658
  runs-on: agents-arc
635
659
  runs-on-slim: agents-arc
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plainconceptsplatform/workflows",
3
- "version": "0.28.11",
3
+ "version": "0.28.12",
4
4
  "description": "Install and update Platform GitHub agentic workflows.",
5
5
  "keywords": [
6
6
  "github-actions",