forgedock 1.8.1 → 1.8.2

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 (67) hide show
  1. package/bin/engine/admission.mjs +57 -1
  2. package/bin/engine/admission.test.mjs +60 -0
  3. package/commands/analytics.md +3 -1
  4. package/commands/audit-agents.md +3 -1
  5. package/commands/audit.md +10 -8
  6. package/commands/autopilot.md +16 -14
  7. package/commands/ci-audit.md +4 -2
  8. package/commands/cleanup.md +1 -1
  9. package/commands/deploy-pr.md +31 -11
  10. package/commands/geo-audit.md +3 -1
  11. package/commands/incident-response.md +3 -1
  12. package/commands/issue.md +4 -2
  13. package/commands/milestone.md +8 -6
  14. package/commands/orchestrate/config.md +2 -2
  15. package/commands/orchestrate/phase-1-resolve.md +56 -12
  16. package/commands/orchestrate/phase-3-dependency.md +15 -5
  17. package/commands/orchestrate/phase-4-execution.md +593 -78
  18. package/commands/orchestrate/phase-5-cleanup.md +4 -2
  19. package/commands/orchestrate/phase-6-report.md +7 -3
  20. package/commands/orchestrate.md +13 -9
  21. package/commands/pipeline-health/phase-4-proposals.md +6 -4
  22. package/commands/pipeline-health/phase-5-report.md +4 -2
  23. package/commands/pipeline-health.md +9 -7
  24. package/commands/pipeline-resume.md +4 -2
  25. package/commands/qa-sweep.md +3 -1
  26. package/commands/quality-gate.md +4 -3
  27. package/commands/recover-orphans.md +172 -13
  28. package/commands/review-pr-agents.md +6 -4
  29. package/commands/review-pr-staging.md +13 -5
  30. package/commands/review-pr.md +187 -19
  31. package/commands/rollback.md +3 -1
  32. package/commands/security-audit.md +3 -1
  33. package/commands/signal-planner.md +6 -4
  34. package/commands/sync-ecosystem.md +4 -2
  35. package/commands/test-gate.md +4 -2
  36. package/commands/upgrade-deps.md +3 -1
  37. package/commands/validate.md +3 -1
  38. package/commands/work-on/build/architect.md +81 -19
  39. package/commands/work-on/build/context.md +61 -18
  40. package/commands/work-on/build/implement.md +62 -18
  41. package/commands/work-on/build/validate.md +240 -60
  42. package/commands/work-on/build.md +344 -146
  43. package/commands/work-on/close.md +617 -246
  44. package/commands/work-on/decompose.md +239 -41
  45. package/commands/work-on/investigate.md +377 -61
  46. package/commands/work-on/remediate.md +42 -9
  47. package/commands/work-on/review.md +240 -29
  48. package/commands/work-on-monolithic.md +48 -7
  49. package/commands/work-on.md +180 -2014
  50. package/docs/CODEX.md +2 -0
  51. package/docs/CONFIG.md +11 -0
  52. package/package.json +1 -1
  53. package/scripts/build-spec-graph.mjs +11 -4
  54. package/scripts/check-spec-markers.sh +11 -1
  55. package/scripts/checkbox-sections.test.sh +8 -23
  56. package/scripts/extract-affected-files.sh +5 -2
  57. package/scripts/extract-affected-files.test.sh +27 -0
  58. package/scripts/forge-root.test.sh +176 -0
  59. package/scripts/is-docs-only.sh +31 -0
  60. package/scripts/is-docs-only.test.sh +64 -0
  61. package/scripts/lint-dispatch-prompt.sh +217 -0
  62. package/scripts/lint-dispatch-prompt.test.sh +307 -0
  63. package/scripts/validate-spec-graph.sh +3 -2
  64. package/scripts/verify-phase-trail.sh +282 -0
  65. package/scripts/verify-phase-trail.test.sh +298 -0
  66. package/scripts/wait-ci-green.sh +98 -0
  67. package/scripts/wait-ci-green.test.sh +99 -0
@@ -8,6 +8,8 @@ install: internal
8
8
 
9
9
  # /work-on-monolithic — Full Issue Pipeline (Single Prompt)
10
10
 
11
+ > **Skill names**: `{FORGE_SKILL_PREFIX}` is `forgedock:` (plugin install) or empty (`install.sh`), resolved once per run by `commands/work-on.md` § Skill Name Resolution. If the skill is not found under either name, STOP and report "skill not found" — never run the phase inline.
12
+
11
13
  **Input**: $ARGUMENTS
12
14
 
13
15
  Orchestrator for the full issue lifecycle: investigate → build → review → merge → close. GitHub issues are the persistent context layer — read existing comments before starting, write structured reports back, use `workflow:*` labels to track state.
@@ -157,10 +159,24 @@ gh api repos/{GH_REPO}/issues/{NUMBER}/comments --jq '.[] | select(.body | conta
157
159
  | Bug + services/ | Backend Fix | Direct |
158
160
  | Refactor/docs | Maintenance | Direct |
159
161
 
162
+ Then classify COMPLEXITY_BAND with the same table as `work-on/build.md` B0.5 (TRIVIAL: single doc/config file, no logic; STANDARD: 1–5 files, existing patterns; COMPLEX: 6+ files, new abstractions, cross-service, schema changes) and post the `FORGE:FAST_PATH` marker. `scripts/verify-phase-trail.sh` reads the band from it and fails the review-pr merge gate when it is absent (forge#3148):
163
+
164
+ ```bash
165
+ FP_BODY="<!-- FORGE:FAST_PATH -->
166
+ ## Fast-Path Classification
167
+
168
+ **COMPLEXITY_BAND**: {TRIVIAL|STANDARD|COMPLEX}
169
+ **Task type**: {TASK_TYPE}
170
+ **Affected file count**: {N}
171
+ **Rationale**: {one-sentence explanation of classification decision}
172
+ **Phases skipped**: {3C.5, 3C.6 for TRIVIAL | none — full pipeline}"
173
+ gh issue comment {NUMBER} {GH_FLAG} --body "$FP_BODY" # <!-- allowlist:check-command-side-effects -->
174
+ ```
175
+
160
176
  ### 3C: Builder Contract (MANDATORY)
161
177
  Post `<!-- FORGE:CONTRACT -->` comment with: task type, proposed approach, deliverables table (file/change/why), acceptance criteria, quality considerations.
162
178
 
163
- ### 3C.5: Context Gathering (max 2 minutes)
179
+ ### 3C.5: Context Gathering (max 2 minutes — MANDATORY for STANDARD/COMPLEX, skip for TRIVIAL)
164
180
 
165
181
  Surface institutional memory before writing code. For each affected file:
166
182
  ```bash
@@ -172,9 +188,9 @@ for ISSUE_NUM in {related_issue_numbers}; do
172
188
  done
173
189
  ```
174
190
 
175
- Post `<!-- FORGE:CONTEXT -->` comment with findings (or skip if no relevant history).
191
+ Post `<!-- FORGE:CONTEXT -->` comment with findings. For STANDARD/COMPLEX it is required even when no relevant history is found (say so in the comment): the merge gate checks for it.
176
192
 
177
- ### 3C.6: Architecture Plan
193
+ ### 3C.6: Architecture Plan (MANDATORY for STANDARD/COMPLEX — skip for TRIVIAL)
178
194
 
179
195
  For multi-file changes, trace ALL affected code paths before writing code:
180
196
  - Map the call chain: entry point → middleware → handler → service → model → response
@@ -183,7 +199,7 @@ For multi-file changes, trace ALL affected code paths before writing code:
183
199
 
184
200
  Post `<!-- FORGE:ARCHITECT -->` comment with the implementation plan.
185
201
 
186
- For single-file or trivial changes, skip this step.
202
+ Skip this step only when COMPLEXITY_BAND is TRIVIAL. For STANDARD/COMPLEX, the merge gate checks for the `FORGE:ARCHITECT` comment.
187
203
 
188
204
  ### 3D: Set building label
189
205
  ```bash
@@ -209,10 +225,25 @@ Route by task type. Read the investigation report and contract. Implement the fi
209
225
  ### 3F.5: Quality Gate
210
226
  Invoke quality-gate on changed files:
211
227
  ```
212
- Skill(skill="quality-gate", args="{changed_files} --worktree {WORKTREE_PATH}")
228
+ Skill(skill="{FORGE_SKILL_PREFIX}quality-gate", args="{changed_files} --worktree {WORKTREE_PATH}")
213
229
  ```
214
230
  Fix HIGH/MEDIUM findings. Max 2 iterations. Skip for 1-file config/docs edits.
215
231
 
232
+ Then post the `FORGE:QUALITY_GATE` marker with the real gate result (same contract as `work-on/build/validate.md` V1/V5). Post it even when the gate was skipped (`**Result**: PASS (skipped — single config/docs file)`). The merge gate requires it unless the whole diff is docs-only (forge#3148):
233
+
234
+ ```bash
235
+ QG_BODY="<!-- FORGE:QUALITY_GATE -->
236
+ ## Quality Gate Result
237
+
238
+ **Result**: {PASS|FAIL}
239
+ **Iterations**: {N}
240
+ **Commands run**: {quality-gate invocation actually executed}
241
+ **Findings remaining**: {none | summary}"
242
+ gh issue comment {NUMBER} {GH_FLAG} --body "$QG_BODY" # <!-- allowlist:check-command-side-effects -->
243
+ ```
244
+
245
+ If the gate still reports HIGH/MEDIUM findings after 2 iterations, post `**Result**: FAIL`, add `needs-human`, and STOP.
246
+
216
247
  ### 3G: Format and verify
217
248
  - Python: `black` + `isort` + `py_compile`
218
249
  - TypeScript (primary repo): `prettier --write` + `tsc --noEmit` (BLOCKING if fails)
@@ -278,13 +309,23 @@ gh issue edit {NUMBER} {GH_FLAG} --add-label "workflow:in-review" --remove-label
278
309
  ### 5A: Re-read state from GitHub (MANDATORY)
279
310
  ### 5B: Invoke /review-pr with --auto-merge
280
311
  ```
281
- Skill(skill="review-pr", args="{PR_NUMBER} --auto-merge --issue {NUMBER} --base {PR_BASE} --gh-flag {GH_FLAG}")
312
+ if DRY_RUN=true:
313
+ record "Would invoke review-pr --auto-merge for PR #{PR_NUMBER}; skipped (dry-run)."
314
+ else:
315
+ Skill(skill="{FORGE_SKILL_PREFIX}review-pr", args="{PR_NUMBER} --auto-merge --issue {NUMBER} --base {PR_BASE} --gh-flag {GH_FLAG}")
282
316
  ```
283
317
 
284
318
  ### 5C: Verify merge and close (recovery)
319
+
320
+ **`REVIEW_RESULT: status: PHASE_TRAIL_FAILED`** (forge#3148): review-pr's Phase 8 refused the merge because a phase marker is missing. The PR is intentionally unmerged — do NOT run the `gh pr merge` recovery below, which would merge around the gate. Re-run each phase named on the `MISSING: <marker> -> <action>` lines (never hand-post a marker), then re-run 5B once. If it returns `PHASE_TRAIL_FAILED` again, add `needs-human` and STOP; review-pr has already posted the `FORGE:PHASE_TRAIL_FAILED` comment.
321
+
322
+ **`REVIEW_RESULT: status: BLOCKED` with a phase-trail or auto-merge-gate blocker** (any blocker containing "phase trail", or "auto-merge requires --issue"; forge#3147): the gate refused or could not run. Do NOT re-run phases and do NOT run the manual merge below. Add `needs-human` and STOP.
323
+
324
+ Otherwise:
285
325
  - PR MERGED + issue CLOSED → proceed to Phase 6/7
286
326
  - PR MERGED + issue OPEN → close issue manually
287
- - PR NOT MERGED → `gh pr merge --merge {GH_FLAG}`, close issue. If merge fails → post comment, add `needs-human`, STOP.
327
+ - PR NOT MERGED + review returned `REVIEW_RESULT: status: COMPLETE` → run `scripts/wait-ci-green.sh {PR_NUMBER} {GH_FLAG}` (resolved from the plugin root); only on exit 0 merge with `--merge --match-head-commit <the CI_GATE_HEAD it printed>` and close the issue. A non-zero gate (or a "ci gate" / "stale review" blocker) → do NOT merge; post the gate output, add `needs-human`, STOP. If the merge fails → post comment, add `needs-human`, STOP.
328
+ - PR NOT MERGED + any other, missing, or unparseable `REVIEW_RESULT` → do NOT merge (an unrecognized refusal must never fall through to a manual merge). Add `needs-human` and STOP.
288
329
 
289
330
  ### 5D: Project board update (Workflow=Merged, Status=Done)
290
331