@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.
Files changed (57) hide show
  1. package/README.md +105 -88
  2. package/dist/catalog-installation.d.ts +39 -2
  3. package/dist/catalog-installation.js +172 -109
  4. package/dist/index.js +128 -73
  5. package/dist/package-baseline.d.ts +25 -0
  6. package/dist/package-baseline.js +138 -0
  7. package/dist/route-processing.d.ts +0 -2
  8. package/dist/route-processing.js +22 -91
  9. package/dist/stack-defaults.js +18 -12
  10. package/dist/tui.js +27 -43
  11. package/dist/worker-env.d.ts +46 -0
  12. package/dist/worker-env.js +179 -0
  13. package/dist/workflow-catalog.d.ts +4 -2
  14. package/dist/workflow-catalog.js +5 -3
  15. package/loops/actions/add-issue-labels/action.yml +20 -0
  16. package/loops/actions/audit-close/action.yml +180 -128
  17. package/loops/actions/classify-route/classify-route.sh +8 -2
  18. package/loops/actions/housekeeping/action.yml +251 -0
  19. package/loops/actions/merge-agent-pr/action.yml +13 -0
  20. package/loops/actions/report-workflow-errors/action.yml +385 -0
  21. package/loops/actions/validate-merge-gate-output/validate-merge-gate-output.sh +13 -1
  22. package/loops/actions/validate-triage-output/action.yml +1 -1
  23. package/loops/actions/validate-triage-output/validate-triage-output.sh +9 -5
  24. package/loops/actions/verify-composite-actions/verify-composite-actions.sh +53 -0
  25. package/loops/actions/verify-route-matrix/verify-route-matrix.sh +847 -170
  26. package/loops/templates/agentics/agentics-error-report.yml +97 -0
  27. package/loops/templates/opencode/opencode.ci.json +1 -1
  28. package/loops/workflows/agent-apply-review.md +452 -469
  29. package/loops/workflows/agent-audit.md +201 -213
  30. package/loops/workflows/agent-implement.md +616 -640
  31. package/loops/workflows/agent-merge-gate.md +830 -844
  32. package/loops/workflows/agent-refine.md +599 -633
  33. package/loops/workflows/agent-release.md +244 -258
  34. package/loops/workflows/agent-triage.md +476 -447
  35. package/loops/workflows/authorize-bot-work.yml +26 -6
  36. package/loops/workflows/work-router.yml +1185 -1038
  37. package/package.json +9 -8
  38. package/dist/action-validation.test.d.ts +0 -1
  39. package/dist/action-validation.test.js +0 -87
  40. package/dist/catalog-installation.test.d.ts +0 -1
  41. package/dist/catalog-installation.test.js +0 -485
  42. package/dist/catalog-listing.test.d.ts +0 -1
  43. package/dist/catalog-listing.test.js +0 -150
  44. package/dist/index.test.d.ts +0 -1
  45. package/dist/index.test.js +0 -273
  46. package/dist/repository-inspection.test.d.ts +0 -1
  47. package/dist/repository-inspection.test.js +0 -77
  48. package/dist/route-processing.test.d.ts +0 -1
  49. package/dist/route-processing.test.js +0 -283
  50. package/dist/stack-defaults.test.d.ts +0 -1
  51. package/dist/stack-defaults.test.js +0 -266
  52. package/dist/tui.test.d.ts +0 -1
  53. package/dist/tui.test.js +0 -249
  54. package/dist/workflow-catalog.test.d.ts +0 -1
  55. package/dist/workflow-catalog.test.js +0 -29
  56. package/loops/actions/stale-recovery/action.yml +0 -288
  57. package/loops/actions/update-changelog/action.yml +0 -113
@@ -17,13 +17,22 @@ permissions:
17
17
 
18
18
  jobs:
19
19
  authorize:
20
- # Only trigger for work labels from HUMANS (not bots),
21
- # and only if neither another bot run nor human review currently owns the issue.
20
+ # Only trigger for work labels from HUMANS (not bots), and only if another bot run does not
21
+ # already own the issue.
22
+ #
23
+ # `review` is deliberately NOT excluded. It used to be, and that made the label a one-way
24
+ # door: the classifier refuses to route while `review` is set, so a person adding `refine`
25
+ # to a parked issue got no run, no comment and no error anywhere. Triage's own
26
+ # needs-maintainer verdict tells the maintainer to add `refine`, which could not work.
27
+ #
28
+ # A person adding a work label IS the human review the label was waiting for, so this
29
+ # workflow clears it below before handing the issue to the bot. The classifier's own guard
30
+ # stays as it is: it exists to stop the *bot* re-triggering itself, and by the time
31
+ # bot-working is added `review` is already gone.
22
32
  if: >
23
33
  (github.event.label.name == 'implement' ||
24
34
  github.event.label.name == 'refine') &&
25
35
  !contains(github.event.issue.labels.*.name, 'bot-working') &&
26
- !contains(github.event.issue.labels.*.name, 'review') &&
27
36
  !endsWith(github.actor, '[bot]')
28
37
  runs-on: ubuntu-latest
29
38
  timeout-minutes: 5
@@ -70,7 +79,7 @@ jobs:
70
79
  app-id: ${{ secrets.BOT_APP_ID }}
71
80
  private-key: ${{ secrets.BOT_PRIVATE_KEY }}
72
81
 
73
- - name: Bot adds bot-working label
82
+ - name: Bot takes the issue over
74
83
  if: steps.check.outputs.authorized == 'true'
75
84
  env:
76
85
  GH_TOKEN: ${{ steps.app-token.outputs.token }}
@@ -78,8 +87,19 @@ jobs:
78
87
  LABEL: ${{ github.event.label.name }}
79
88
  run: |
80
89
  set -euo pipefail
81
-
90
+
91
+ # Clear review FIRST. A person adding a work label is the human review the label was
92
+ # waiting for, and the classifier refuses to route an issue that still carries it, so
93
+ # removing it here is what makes the hand-off work at all. It also has to happen
94
+ # before bot-working, because that is the event the classifier reads: adding
95
+ # bot-working first would raise an event whose payload still shows review.
96
+ # --remove-label on an absent label is a no-op, so this is safe on a fresh issue.
97
+ # `stalled` goes with it: a person taking the issue on restarts the work, so the
98
+ # marker the janitor retries on must not survive into the new run.
99
+ gh issue edit "$ISSUE_NUMBER" --remove-label "review" --remove-label "stalled" 2>/dev/null ||
100
+ echo "::notice::no review or stalled label to clear on #$ISSUE_NUMBER"
101
+
82
102
  echo "Adding bot-working label to issue #$ISSUE_NUMBER (triggered by $LABEL)"
83
103
  gh issue edit "$ISSUE_NUMBER" --add-label "bot-working"
84
-
104
+
85
105
  echo "::notice::bot-working label added - bot will now own the $LABEL workflow"