@plainconceptsplatform/workflows 1.0.8 → 1.0.10

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.
@@ -48,7 +48,7 @@ let thrown =
48
48
  AppExceptions
49
49
  | where TimeGenerated > window
50
50
  | extend Problem = ProblemId, Kind = ExceptionType, Stack = Details,
51
- Msg = outerMessage, Category = "";
51
+ Msg = OuterMessage, Category = "";
52
52
  let logged =
53
53
  AppTraces
54
54
  | where TimeGenerated > window
@@ -1,8 +1,9 @@
1
1
  # Managed by @plainconceptsplatform/workflows. Source: loops/templates/agentics/agentics-app-errors.yml. Update with `workflows update --force`; consumer edits may be overwritten.
2
2
  name: "Agentics: App Errors"
3
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.
4
+ # Every eight hours, ask Application Insights what the deployed application actually threw,
5
+ # and file the distinct problems as issues here, labelled so refine sizes them and implement
6
+ # fixes them.
6
7
  #
7
8
  # THIS REPORT STAYS IN THIS REPOSITORY. That is the design constraint, and it is the opposite
8
9
  # of the one in agentics-error-report.yml. That workflow exists to carry a *workflow* failure
@@ -28,14 +29,14 @@ name: "Agentics: App Errors"
28
29
  # --role "Monitoring Reader" \
29
30
  # --scope "$(az monitor log-analytics workspace show -g "$AZURE_RG" -n "$WORKSPACE" --query id -o tsv)"
30
31
 
31
- run-name: "App errors: ${{ github.event.inputs.app-env || 'pre' }}, last ${{ github.event.inputs.lookback-hours || '24' }}h"
32
+ run-name: "App errors: ${{ github.event.inputs.app-env || 'pre' }}, last ${{ github.event.inputs.lookback-hours || '8' }}h"
32
33
 
33
34
  on:
34
35
  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 * * *"
36
+ # Every eight hours: a failure should surface the same working day, not tomorrow morning.
37
+ # This runs on a GitHub-hosted runner and never touches the agent fleet, so there is no
38
+ # slot to stagger against other repositories.
39
+ - cron: "17 1,9,17 * * *"
39
40
  workflow_dispatch:
40
41
  inputs:
41
42
  app-env:
@@ -47,7 +48,7 @@ on:
47
48
  description: "How far back to look"
48
49
  required: false
49
50
  type: string
50
- default: '24'
51
+ default: '8'
51
52
  dry-run:
52
53
  description: "Work out what would be filed and file nothing"
53
54
  required: false
@@ -64,7 +65,7 @@ env:
64
65
  APP_ENV: "pre"
65
66
  # Matches the cron. A window wider than the schedule counts the same problem twice; a
66
67
  # narrower one loses whatever happened in the gap.
67
- LOOKBACK_HOURS: "24"
68
+ LOOKBACK_HOURS: "8"
68
69
  # The floor. A problem below this is real but not yet news, and a belt buried under
69
70
  # single-occurrence reports is a belt somebody switches off.
70
71
  MIN_OCCURRENCES: "5"
@@ -314,11 +314,16 @@ jobs:
314
314
  # The signal is the item counter, not `code_push_failure_count`. gh-aw treats the fallback
315
315
  # as a *successful* outcome for the item -- the dogfood run logged `Status: success`,
316
316
  # `Successful: 1` and a resolved `GH_AW_CODE_PUSH_FAILURE_COUNT: 0` while filing #11 -- so
317
- # gating on that count posted the wrong message. `create_pull_request` is the only safe
318
- # output this worker permits, so one succeeded item with no pull request number can only
319
- # mean the push fell back to an issue. Nothing produced at all leaves the counter at 0.
317
+ # gating on that count posted the wrong message.
318
+ #
319
+ # The counter alone is not enough, though: a `noop` also counts as one succeeded item, so
320
+ # "items_succeeded != 0 with no PR number" is true for a run that produced nothing to do as
321
+ # well as for a run whose push fell back to an issue. Telling a person their patch was filed
322
+ # as a separate issue when the agent actually said "already fixed on main" is the bug this
323
+ # comment exists to prevent (Odyssey #226). Distinguish them the same way the steps below
324
+ # do: gate on whether the agent actually asked for a pull request.
320
325
  - name: Flag a patch that could not be pushed
321
- if: needs.safe_outputs.outputs.created_pr_number == '' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '0' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != ''
326
+ if: needs.safe_outputs.outputs.created_pr_number == '' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '0' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '' && contains(needs.agent.outputs.output_types, 'create_pull_request')
322
327
  uses: ./.github/actions/add-issue-labels
323
328
  with:
324
329
  token: ${{ steps.app-token.outputs.token }}
@@ -327,7 +332,7 @@ jobs:
327
332
  ${{ env.REVIEW_LABEL }}
328
333
  ${{ env.STALLED_LABEL }}
329
334
  - name: Say where the patch went
330
- if: needs.safe_outputs.outputs.created_pr_number == '' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '0' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != ''
335
+ if: needs.safe_outputs.outputs.created_pr_number == '' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '0' && needs.safe_outputs.outputs.process_safe_outputs_items_succeeded != '' && contains(needs.agent.outputs.output_types, 'create_pull_request')
331
336
  uses: ./.github/actions/create-issue-comment
332
337
  with:
333
338
  token: ${{ steps.app-token.outputs.token }}
@@ -368,7 +373,7 @@ jobs:
368
373
  ${{ env.OUTPUT_NOT_APPLIED_COMMENT }}
369
374
  [View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
370
375
  - name: Release an issue the agent found nothing to do on
371
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
376
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
372
377
  uses: ./.github/actions/add-issue-labels
373
378
  with:
374
379
  token: ${{ steps.app-token.outputs.token }}
@@ -376,14 +381,14 @@ jobs:
376
381
  labels: |-
377
382
  ${{ env.REVIEW_LABEL }}
378
383
  - name: Take the implement label off a decided issue
379
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
384
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
380
385
  uses: ./.github/actions/remove-issue-labels
381
386
  with:
382
387
  token: ${{ steps.app-token.outputs.token }}
383
388
  issue-number: ${{ inputs.issue-number }}
384
389
  labels: ${{ env.IMPLEMENT_LABEL }}
385
390
  - name: Say there was nothing to do
386
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
391
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && contains(needs.agent.outputs.output_types, 'noop')
387
392
  uses: ./.github/actions/create-issue-comment
388
393
  with:
389
394
  token: ${{ steps.app-token.outputs.token }}
@@ -393,7 +398,7 @@ jobs:
393
398
  ${{ env.NOOP_COMMENT }}
394
399
  [View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
395
400
  - name: Flag a patch nobody asked to publish
396
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch == 'true'
401
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch == 'true'
397
402
  uses: ./.github/actions/add-issue-labels
398
403
  with:
399
404
  token: ${{ steps.app-token.outputs.token }}
@@ -402,7 +407,7 @@ jobs:
402
407
  ${{ env.REVIEW_LABEL }}
403
408
  ${{ env.STALLED_LABEL }}
404
409
  - name: Say the patch was never asked for
405
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch == 'true'
410
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch == 'true'
406
411
  uses: ./.github/actions/create-issue-comment
407
412
  with:
408
413
  token: ${{ steps.app-token.outputs.token }}
@@ -412,7 +417,7 @@ jobs:
412
417
  ${{ env.PATCH_WITHOUT_REQUEST_COMMENT }}
413
418
  [View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
414
419
  - name: Flag a run that produced nothing
415
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch != 'true'
420
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch != 'true'
416
421
  uses: ./.github/actions/add-issue-labels
417
422
  with:
418
423
  token: ${{ steps.app-token.outputs.token }}
@@ -421,7 +426,7 @@ jobs:
421
426
  ${{ env.REVIEW_LABEL }}
422
427
  ${{ env.STALLED_LABEL }}
423
428
  - name: Say the run produced nothing
424
- if: needs.safe_outputs.outputs.created_pr_number == '' && (needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '0' || needs.safe_outputs.outputs.process_safe_outputs_items_succeeded == '') && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch != 'true'
429
+ if: needs.safe_outputs.outputs.created_pr_number == '' && !contains(needs.agent.outputs.output_types, 'create_pull_request') && !contains(needs.agent.outputs.output_types, 'noop') && needs.agent.outputs.has_patch != 'true'
425
430
  uses: ./.github/actions/create-issue-comment
426
431
  with:
427
432
  token: ${{ steps.app-token.outputs.token }}
@@ -138,12 +138,19 @@ jobs:
138
138
  # needs-maintainer while this run waited in a queue, the issue now carries review and
139
139
  # the verdict must stand: the reserve step clears review blindly, so eligibility has to
140
140
  # catch it first (Pliny-Bot #372).
141
+ #
142
+ # BUT: when mode is rerefine, the trigger was a human comment answering a question the
143
+ # bot asked and then parked for review. That comment IS the human review the label was
144
+ # waiting for, so refusing to run would silence exactly the feedback the bot asked for
145
+ # (Odyssey #226: the bot asked a question, the user answered, and the review label
146
+ # made the router skip the answer). In rerefine mode the label is cleared and the
147
+ # refine proceeds; in first mode the triage verdict still stands.
141
148
  eligibility:
142
149
  needs: [still_open]
143
150
  if: needs.still_open.outputs.open == 'true'
144
151
  runs-on: agents-arc
145
152
  permissions:
146
- issues: read
153
+ issues: write
147
154
  outputs:
148
155
  eligible: ${{ steps.check.outputs.eligible }}
149
156
  steps:
@@ -152,11 +159,21 @@ jobs:
152
159
  env:
153
160
  GH_TOKEN: ${{ github.token }}
154
161
  ISSUE_NUMBER: ${{ inputs.issue-number }}
162
+ MODE: ${{ inputs.mode }}
155
163
  run: |
156
164
  set -euo pipefail
157
165
  labels=$(gh issue view "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" --json labels \
158
166
  --jq '[.labels[].name]')
159
167
  if jq -e 'index("review")' >/dev/null <<<"$labels"; then
168
+ if [ "$MODE" = "rerefine" ]; then
169
+ # A rerefine is triggered by a human comment on an issue the bot parked for
170
+ # review. The comment is the review: clear the label and proceed.
171
+ gh issue edit "$ISSUE_NUMBER" --remove-label "review" 2>/dev/null ||
172
+ echo "::notice::review label already gone on #$ISSUE_NUMBER"
173
+ echo "eligible=true" >> "$GITHUB_OUTPUT"
174
+ echo "::notice::Issue #$ISSUE_NUMBER had review label; cleared it for rerefine (user answered the bot)."
175
+ exit 0
176
+ fi
160
177
  echo "eligible=false" >> "$GITHUB_OUTPUT"
161
178
  echo "::notice::Issue #$ISSUE_NUMBER has the review label. Automated refinement skipped."
162
179
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plainconceptsplatform/workflows",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Install and update Platform GitHub agentic workflows.",
5
5
  "keywords": [
6
6
  "github-actions",