@soleur/opencode 3.354.19 → 3.354.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.354.19",
3
+ "version": "3.354.21",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,7 @@ description: "This skill should be used when enhancing an existing plan with par
11
11
  **Grok Build (`plugins/soleur/lib/harness.ts` `invokeSkill()`):** Read this SKILL.md in this process and run it to completion. A one-segment `soleur:<name>` in this document names a SKILL — on Grok Build, Read `plugins/soleur/skills/<name>/SKILL.md` in this process; it is not a nested tool_use. A multi-segment id such as `soleur:<domain>:<name>` names an AGENT: spawn it, never Read it, and on Grok Build spawn_subagent takes the id with its colons replaced by hyphens (`agentIdToGrokSubagentType`). **Claude Code:** Skill tool for a skill (`soleur:<name>`), Task tool with `subagent_type` for an agent. Forbidden is executing a subset, not the Read.
12
12
  <!-- grok-harness-invoke:end -->
13
13
 
14
- > **Dynamic-workflow alternative (opt-in).** A [`Workflow`-tool](https://claude.com/blog/introducing-dynamic-workflows-in-claude-code) port of this skill lives at [`workflows/deepen-plan.workflow.js`](./workflows/deepen-plan.workflow.js) — deterministic fan-out, journaled resume, schema-validated output. Run it with `Workflow({ scriptPath: "plugins/soleur/skills/deepen-plan/workflows/deepen-plan.workflow.js", args: ... })`. The prose skill below stays the default; the two coexist during calibration. **Known divergence:** the port's `GATES` covers §§4.6–4.9 only; §4.10–4.12 are prose-only — a workflow run never enforces them. See [`knowledge-base/project/specs/archive/20261013-032858-feat-review-workflow-prototype/spec.md`](../../../../knowledge-base/project/specs/archive/20261013-032858-feat-review-workflow-prototype/spec.md).
14
+ > **Dynamic-workflow alternative (opt-in).** A [`Workflow`-tool](https://claude.com/blog/introducing-dynamic-workflows-in-claude-code) port of this skill lives at [`workflows/deepen-plan.workflow.js`](./workflows/deepen-plan.workflow.js) — deterministic fan-out, journaled resume, schema-validated output. Run it with `Workflow({ scriptPath: "plugins/soleur/skills/deepen-plan/workflows/deepen-plan.workflow.js", args: ... })`. The prose skill below stays the default; the two coexist during calibration. **Known divergence:** the port's `GATES` covers §§4.6–4.9 + the §4.13 mirror; §4.10–4.12 are prose-only — a workflow run never enforces them. See [`knowledge-base/project/specs/archive/20261013-032858-feat-review-workflow-prototype/spec.md`](../../../../knowledge-base/project/specs/archive/20261013-032858-feat-review-workflow-prototype/spec.md).
15
15
 
16
16
  # Deepen Plan - Power Enhancement Mode
17
17
 
@@ -329,7 +329,7 @@ Tier advisory (ADR-053 / ADR-110): spawn both passes with semantic tier `standar
329
329
 
330
330
  If the plan's Overview, Problem Statement, or Hypotheses contain any of the trigger patterns `SSH`, `connection reset`, `kex`, `firewall`, `unreachable`, `timeout`, `502`, `503`, `504`, `handshake`, `EHOSTUNREACH`, `ECONNRESET` (case-insensitive), read `plugins/soleur/skills/plan/references/plan-network-outage-checklist.md` and spawn a dedicated "Network-Outage Deep-Dive" research agent in parallel with the other deepen agents.
331
331
 
332
- **Resource-shape trigger (implicit SSH dependency).** Also fire this gate when the plan drives `terraform apply` (with or without `-target=`) on any resource whose definition contains `provisioner "file"`, `provisioner "remote-exec"`, or a `connection { type = "ssh" ... }` block. The provisioner block makes SSH a hard apply-time dependency that the prose-only keyword scan won't detect — the plan body need not mention SSH at all and apply still fails on `connection reset by peer` if the operator's egress IP has drifted out of the firewall allowlist. **Why:** #3061 — plan body had zero SSH keywords; apply on `terraform_data.deploy_pipeline_fix` (file+remote-exec provisioners) still hit a handshake reset because Phase 4.5 didn't fire.
332
+ **Resource-shape trigger (implicit SSH dependency).** Also fire this gate when the plan drives `terraform apply` (with or without `-target=`) on any resource whose definition contains `provisioner "file"`, `provisioner "remote-exec"`, or a `connection { type = "ssh" ... }` block. The provisioner block makes SSH a hard apply-time dependency the prose-only keyword scan won't detect — the plan body need not mention SSH for apply to hit `connection reset by peer` on a drifted egress IP. **Why:** #3061 — plan body had zero SSH keywords; apply on `terraform_data.deploy_pipeline_fix` (file+remote-exec provisioners) still hit a handshake reset because Phase 4.5 didn't fire.
333
333
 
334
334
  The deep-dive agent's task:
335
335
 
@@ -534,11 +534,13 @@ Halt deepen-plan; do NOT proceed to Phase 5.
534
534
  echo 'SOLEUR_RULE_APPLIED rule=wg-ui-feature-requires-pen-wireframe note=UI feature must ship a committed .pen wireframe, never skipped'
535
535
  ```
536
536
 
537
+ **Step 5 — Pass-through.** Non-UI plan, or `.pen` committed → proceed. No telemetry on pass. **Why:** #4819.
538
+
537
539
  ### 4.10. Encryption Posture Halt (Conditional)
538
540
 
539
541
  Symmetric to Phase 4.7 above; this gate is what makes plan Phase 2.11 load-bearing. Fires only when the plan introduces a persistent data store or a new cross-component/network connection.
540
542
 
541
- **Step 1 — Trigger.** Fires when the plan's `## Files to Edit` / `## Files to Create` match one of `\.tf$`, `supabase/migrations/.*\.sql$`, `cloud-init.*\.ya?ml$`, `docker-compose.*\.ya?ml$`, OR the plan prose names a store class (volume, database, bucket, queue, cache, backup target, log sink) or a new cross-component connection. No match on any of the above → skip silently (pass-through).
543
+ **Step 1 — Trigger.** Fires when the plan's `## Files to Edit` / `## Files to Create` match one of `\.tf$`, `supabase/migrations/.*\.sql$`, `cloud-init.*\.ya?ml$`, `docker-compose.*\.ya?ml$`, OR the plan prose names a store class (volume, database, bucket, queue, cache, backup target, log sink) or a new cross-component connection. No match → skip silently.
542
544
 
543
545
  **Step 2 — Locate the section.** Grep the target plan file:
544
546
 
@@ -571,10 +573,6 @@ echo 'SOLEUR_RULE_APPLIED rule=encryption-posture-design-time-default note=Every
571
573
 
572
574
  **Why:** ADR-140 and `knowledge-base/project/plans/archive/20261013-041741-2026-07-23-feat-encryption-posture-design-time-default-plan.md` (Plan Review Revisions R1-R11). A declaration-only gate without Layer A (`lint-encryption-posture.py`, repo-root `scripts/`, resolving every citation against real code) and Layer B (live provider/host reconciliation) reproduces #6588 exactly — legal docs declared LUKS while the volume was plaintext ext4. This deepen-plan halt is the design-time half; it stops an underspecified or boilerplate posture from ever reaching `soleur:work`.
573
575
 
574
- **Step 5 — Pass-through.** Non-UI plan, or a committed `.pen` present → proceed normally. No telemetry on pass.
575
-
576
- **Why:** #4819 — the one-shot path skips brainstorm, so plan Phase 2.5 is the sole producer; this halt is the independent verifier that a UI feature did not reach implementation with zero wireframes (the silent-skip class the feature kills).
577
-
578
576
  ### 4.11. Guard Contract Halt (Conditional)
579
577
 
580
578
  Fires when the plan's deliverable includes a **guard, gate, lint, drift-check or anti-vacuity control** (plan Phase 2.12). This is the design-time verifier that a guard-shaped plan carries a usable Guard Contract before `soleur:work` writes any guard code.
@@ -624,10 +622,8 @@ awk 'BEGIN{f=0} /^[[:space:]]*```/{f=!f; next} !f' "$PLAN_FILE" | grep -c '^## S
624
622
  Read the printed COUNT, not the exit code — `grep -c` exits 1 on `0`, which is a verdict, not a command failure. `0` → absent → HALT; `>1` → malformed → HALT ("plan carries N duplicate live `## Scope Check` sections — keep one"). On `0`, halt with:
625
623
 
626
624
  > Error: Plan has no compliant `## Scope Check` section. Per plan Phase 2.4 every plan emits
627
- > one (see `plugins/soleur/skills/plan/references/plan-scope-check.md`; the schema ships in
628
- > `plan-issue-templates.md`). Re-run
629
- > `soleur:plan`, or add the section by hand — it maps asks the plan already
630
- > contains — then re-run deepen-plan.
625
+ > one (see `plugins/soleur/skills/plan/references/plan-scope-check.md`; schema in
626
+ > `plan-issue-templates.md`). Re-run `soleur:plan` or add the section by hand, then re-run.
631
627
 
632
628
  **Step 3 — Verify it mechanically.** Reject and HALT (same message shape; first line names the failing row; recovery: fix it in the plan file, then re-run) when ANY of:
633
629
 
@@ -647,10 +643,14 @@ echo 'SOLEUR_RULE_APPLIED rule=plan-scope-check-blocks-unmapped-asks note=deepen
647
643
 
648
644
  No telemetry on pass — the gate only records when it activates.
649
645
 
650
- **Step 6 — Pass-through.** Section present, mechanically compliant, adequate → proceed normally.
646
+ **Step 6 — Pass-through.** Compliant → proceed.
651
647
 
652
648
  **Why:** #9398 — on PR #9339 a brief listing tasks a–f grew a destructive `--attest` rung nobody asked for; the catch cost an 11-seat review and ~8 CI cycles. The deepen halt is what makes "an unmapped item blocks the plan unless justified" load-bearing rather than advisory.
653
649
 
650
+ ### 4.13. Task-Design Halt (Conditional)
651
+
652
+ Trigger + reject contract: [plan/references/task-design-gate.md](../plan/references/task-design-gate.md) (Detection table, UNFENCED count). On trigger HALT `"Phase 4.13 reject: <field/section> — <failure mode>"`; emit `SOLEUR_RULE_APPLIED rule=task-design-design-time-default note=Every new autonomous task MUST answer the six task-design questions at plan time`; else pass silent. **Why:** #11015.
653
+
654
654
  ### 5. Discover and Run ALL Review Agents
655
655
 
656
656
  <thinking>
@@ -64,6 +64,7 @@ const outPath = inPlace
64
64
  // - observability → hr-observability-as-plan-quality-gate (§4.7, code/infra only)
65
65
  // - patShape → hr-github-app-auth-not-pat (§4.8, ALWAYS)
66
66
  // - uiWireframe → wg-ui-feature-requires-pen-wireframe (§4.9, UI surface only)
67
+ // - taskDesign → plan §2.9.3 / deepen-plan §4.13 (§4.13 mirror, new autonomous-task surfaces only)
67
68
  // A gate that is "applicable && !satisfied" blocks the fan-out; the workflow
68
69
  // returns the SKILL's halt payload and never spends the research budget.
69
70
  // ---------------------------------------------------------------------------
@@ -103,6 +104,16 @@ const GATES = {
103
104
  'run the producer (brainstorm Phase 3.55 or plan Phase 2.5; Pencil auto-installs via pencil-setup --auto), commit the ' +
104
105
  '.pen under knowledge-base/product/design/{domain}/, and reference it in the plan FRs. No Markdown/ASCII fallback.',
105
106
  },
107
+ taskDesign: {
108
+ rule: 'skill-enforced: plan Phase 2.9.3 + deepen-plan Phase 4.13',
109
+ halt:
110
+ 'Plan creates a NEW autonomous-task surface (per the Detection table in ' +
111
+ 'plugins/soleur/skills/plan/references/task-design-gate.md — new workflow file, Inngest function, ' +
112
+ 'registered check/reminder arm, pg_cron, host timer, daemon, TF-emitted workflow) but is missing a `## Task Design` ' +
113
+ 'section, or the section lacks a `- task:` item per created task, a required field (trigger, services, next, ' +
114
+ 'human_reentry, dedupe, source_dedupe) is absent/empty/placeholder, or `dedupe` names only `concurrency: group:` ' +
115
+ 'with no semantic mechanism. See task-design-gate.md for the contract; add the section and re-run.',
116
+ },
106
117
  }
107
118
 
108
119
  // ---------------------------------------------------------------------------
@@ -127,16 +138,17 @@ const PARSE_SCHEMA = {
127
138
  properties: {
128
139
  exists: { type: 'boolean', description: 'true if the plan file was readable' },
129
140
  planTitle: { type: 'string', description: 'the plan H1 / feature name, or the basename if no H1' },
130
- // The four pre-fan-out hard gates (SKILL §§4.6–4.9).
141
+ // The pre-fan-out hard gates (SKILL §§4.6–4.9 + the §4.13 taskDesign mirror).
131
142
  gates: {
132
143
  type: 'object',
133
- required: ['userBrandImpact', 'observability', 'patShape', 'uiWireframe'],
144
+ required: ['userBrandImpact', 'observability', 'patShape', 'uiWireframe', 'taskDesign'],
134
145
  additionalProperties: false,
135
146
  properties: {
136
147
  userBrandImpact: GATE_VERDICT,
137
148
  observability: GATE_VERDICT,
138
149
  patShape: GATE_VERDICT,
139
150
  uiWireframe: GATE_VERDICT,
151
+ taskDesign: GATE_VERDICT,
140
152
  },
141
153
  },
142
154
  technologies: {
@@ -237,11 +249,12 @@ ${planPath}
237
249
 
238
250
  If the file is unreadable, return exists=false with an empty sections array.
239
251
 
240
- STEP 1 — Run the four pre-fan-out hard gates. For each, set { applicable, satisfied, detail }:
252
+ STEP 1 — Run the pre-fan-out hard gates. For each, set { applicable, satisfied, detail }:
241
253
  - userBrandImpact (ALWAYS applicable): the plan MUST contain a non-empty \`## User-Brand Impact\` section whose threshold line is one of none / "single-user incident" / "aggregate pattern", with no placeholder-only bullets, and (when threshold=none AND the diff/Files-to-Edit touch a sensitive path) a "threshold: none, reason: <one sentence>" scope-out bullet. applicable=true always; satisfied=false if the section is missing, empty, placeholder-only, has an invalid threshold, or is none-without-scope-out.
242
254
  - observability (applicable ONLY when the plan's Files-to-Edit touch production code/infra — i.e. NOT pure-docs: not all paths under knowledge-base/, docs/, README.md, CHANGELOG.md, or *.md outside plugins/*/skills and apps/*): a \`## Observability\` section with all 5 fields (liveness_signal, error_reporting, failure_modes, logs, discoverability_test), no placeholder values (TODO/TBD/N/A/placeholder/"manual operator check"), no empty field, and discoverability_test.command must NOT require ssh. It must also be executable by preflight Check 10, which runs it in a sandbox behind a deny-by-default allowlist: the first whitespace-delimited token of its dequoted, normalized value is one of curl bash grep rg jq python3 node bun printf git, with no path-shaped exemption. The OPTIONAL discoverability_test.credentials_required sub-field declares a probe whose property has no unauthenticated substitute ("<scope> — <justification>"), making Check 10 skip without executing; it is checked only when present, must not be placeholder text, and does NOT override the ssh reject. Two further rejects (#8412) bind ONLY a discoverability_test this run authors or amends — against a pre-existing block, report them as findings and leave satisfied unchanged: (a) command must be able to finish inside Check 10's 15-second `timeout 15s` cap, so a whole test suite or full build is rejected (wrapping a suite in a script satisfies the verb allowlist, not the cap); (b) expected_output must be the LITERAL string(s) the command prints, not prose describing them, because Check 10 asks whether any token of expected_output is a substring of stdout and a sentence can never match. If pure-docs, applicable=false, satisfied=true.
243
255
  - patShape (ALWAYS applicable): grep the plan for PAT-shaped TF vars / env vars / literal tokens — \`var.*_(token|pat)\`, \`TF_VAR_(GITHUB|GH)_(TOKEN|PAT|AUTH)\`, literal \`ghp_<40>\` or \`github_pat_<82+>\` (placeholder forms like ghp_XXX are allowed). satisfied=false if any real PAT-shape matches.
244
256
  - uiWireframe (applicable ONLY when the plan's Files-to-Edit/Create touch a UI surface — tsx/jsx/css under app/components, or UI-surface terms): the plan must reference a committed \`knowledge-base/product/design/**.pen\` wireframe (confirm committed via \`git ls-files --error-unmatch <path>\`). If no UI surface, applicable=false, satisfied=true.
257
+ - taskDesign (applicable ONLY when the plan creates a NEW autonomous-task surface per the Detection table in plugins/soleur/skills/plan/references/task-design-gate.md — any new .github/workflows/*.yml, a new Inngest function file or registration, a CHECK_REGISTRY/reminder arm, pg_cron, host cron.d/.timer, a setInterval daemon, or a TF-emitted workflow): the plan must contain an UNFENCED \`## Task Design\` section (outside ALL fence forms) with a \`tasks:\` list of one \`- task:\` item per created task, all of trigger/services/next/human_reentry/dedupe/source_dedupe present and non-placeholder (case-insensitive incl. WIP/FIXME/none/see above), and \`dedupe\` naming a semantic mechanism beyond \`concurrency: group:\`. Create-time only — no retrofit. If no new surface, applicable=false, satisfied=true.
245
258
 
246
259
  STEP 2 — Extract the technologies/frameworks named in the plan (Rails, React, Next.js, TypeScript, Python, Postgres, Terraform, Supabase, etc.).
247
260
 
@@ -152,7 +152,7 @@ Runs after premise validation and before the Phase 1 fan-out, for the same reaso
152
152
 
153
153
  **3. Cut before researching.** Any mechanism that buys no property in the list, or buys one an existing mechanism already covers, is removed here — not researched, not designed, not reviewed. Record each cut in one line (mechanism → property → what already covers it) as the **Cut List**. Emit both lists into the research-insights scratch, exactly as Phase 0.6 emits its Premise Validation note; Phase 1.7 persists them into `## Research Insights`, which is where `plan-review` reads them. A mechanism the ask did not name but the plan later invents is caught by Step 2's re-read of this list, not here.
154
154
 
155
- **Why:** #7418 / ADR-176 — the plan delivered a five-value cursor vocabulary, two decision tables, a resume cap with a strict-advance rule, a bounded-deletion rule, and a branch selector with a tiebreak. The second property was already free: `## Acceptance Criteria` appears in all three detail-level templates, is written last, and `soleur:one-shot` was already asserting on it. The plan never compared its new mechanism against the one already in the codebase; a twelve-agent review then found twelve blocking defects behind a 285/285 green suite, and **nine of them dissolved with the machinery** when the redesign landed. See `knowledge-base/project/learnings/2026-08-10-i-fixed-the-guard-twice-and-my-test-could-not-see-either-fix.md`.
155
+ **Why:** #7418 / ADR-176 — the plan never compared its new mechanism against the one already in the codebase; a twelve-agent review then found twelve blocking defects behind a 285/285 green suite, and **nine of them dissolved with the machinery** when the redesign landed. See `knowledge-base/project/learnings/2026-08-10-i-fixed-the-guard-twice-and-my-test-could-not-see-either-fix.md`.
156
156
 
157
157
  ### 0.6c. Value-Proposition Measurement (Conditional)
158
158
 
@@ -709,6 +709,10 @@ If the plan's Files-to-Edit touch a surface the operator/agent CANNOT directly i
709
709
 
710
710
  This is the affected-surface extension of `hr-observability-as-plan-quality-gate` — the diagnosis-first discipline for blind surfaces, enforced at review by `soleur:engineering:review:observability-coverage-reviewer` §Step 4.6. **Why:** #5733 — 6 blind server-side fixes over ~2 weeks because the failing agent-sandbox surface emitted no discriminating telemetry; one in-sandbox event decided the root cause the moment it shipped. See `knowledge-base/project/learnings/best-practices/2026-07-01-blind-surface-needs-structured-probe-before-nth-fix.md`.
711
711
 
712
+ #### 2.9.3. Task-Design Gate (Conditional)
713
+
714
+ [skill-enforced: plan Phase 2.9.3 + deepen-plan Phase 4.13] A `## Files to Create`/`## Files to Edit` entry creating a NEW autonomous-task surface (any new `.github/workflows/*.yml`, Inngest function, registered check, pg_cron, host timer, daemon) emits `## Task Design`: [references/task-design-gate.md](./references/task-design-gate.md).
715
+
712
716
  ### 2.10. Architecture Decision (ADR / C4) Gate
713
717
 
714
718
  > **Rule `wg-architecture-decision-is-a-plan-deliverable` — migrated out of `AGENTS.rules.md` on 2026-09-10 (PR #8034).**
@@ -143,6 +143,26 @@ exception: # present ONLY when mechanism is plaintext-exception OR ce
143
143
  expires_on: # YYYY-MM-DD — <=90 days out; Layer A FAILs an expired exception
144
144
  ```
145
145
 
146
+ ## Task Design
147
+
148
+ ```yaml
149
+ # Required when the plan creates a NEW autonomous-task surface — see the Detection table
150
+ # in plugins/soleur/skills/plan/references/task-design-gate.md (any new
151
+ # .github/workflows/*.yml, new Inngest function file/registration, CHECK_REGISTRY or
152
+ # reminder arm, pg_cron, host cron.d/.timer, setInterval daemon, TF-emitted workflow).
153
+ # Create-time only — no retrofit onto existing tasks.
154
+ tasks:
155
+ - task: # name/slug of the autonomous task being created
156
+ trigger: # what fires it — cron / event / label / dispatch / upstream run
157
+ services: # services or data surfaces it reads from and writes to
158
+ next: # what it triggers next ("nothing" is a valid answer)
159
+ human_reentry: # how a human resumes, redirects or stops it mid-run
160
+ dedupe: # mechanism preventing semantic double-work — MUST name something beyond
161
+ # `concurrency: group:` (it serializes overlapping RUNS, not the work itself)
162
+ source_dedupe: # how the ticket source dedupes this task, or the literal "not a ticket source"
163
+ # one `- task:` list item per created task
164
+ ```
165
+
146
166
  ## Guard Contract
147
167
 
148
168
  Required when the deliverable includes a guard, gate, lint, drift-check or
@@ -378,6 +398,26 @@ exception: # present ONLY when mechanism is plaintext-exception OR ce
378
398
  expires_on: # YYYY-MM-DD — <=90 days out; Layer A FAILs an expired exception
379
399
  ```
380
400
 
401
+ ## Task Design
402
+
403
+ ```yaml
404
+ # Required when the plan creates a NEW autonomous-task surface — see the Detection table
405
+ # in plugins/soleur/skills/plan/references/task-design-gate.md (any new
406
+ # .github/workflows/*.yml, new Inngest function file/registration, CHECK_REGISTRY or
407
+ # reminder arm, pg_cron, host cron.d/.timer, setInterval daemon, TF-emitted workflow).
408
+ # Create-time only — no retrofit onto existing tasks.
409
+ tasks:
410
+ - task: # name/slug of the autonomous task being created
411
+ trigger: # what fires it — cron / event / label / dispatch / upstream run
412
+ services: # services or data surfaces it reads from and writes to
413
+ next: # what it triggers next ("nothing" is a valid answer)
414
+ human_reentry: # how a human resumes, redirects or stops it mid-run
415
+ dedupe: # mechanism preventing semantic double-work — MUST name something beyond
416
+ # `concurrency: group:` (it serializes overlapping RUNS, not the work itself)
417
+ source_dedupe: # how the ticket source dedupes this task, or the literal "not a ticket source"
418
+ # one `- task:` list item per created task
419
+ ```
420
+
381
421
  ## Guard Contract
382
422
 
383
423
  Required when the deliverable includes a guard, gate, lint, drift-check or
@@ -628,6 +668,26 @@ exception: # present ONLY when mechanism is plaintext-exception OR ce
628
668
  expires_on: # YYYY-MM-DD — <=90 days out; Layer A FAILs an expired exception
629
669
  ```
630
670
 
671
+ ## Task Design
672
+
673
+ ```yaml
674
+ # Required when the plan creates a NEW autonomous-task surface — see the Detection table
675
+ # in plugins/soleur/skills/plan/references/task-design-gate.md (any new
676
+ # .github/workflows/*.yml, new Inngest function file/registration, CHECK_REGISTRY or
677
+ # reminder arm, pg_cron, host cron.d/.timer, setInterval daemon, TF-emitted workflow).
678
+ # Create-time only — no retrofit onto existing tasks.
679
+ tasks:
680
+ - task: # name/slug of the autonomous task being created
681
+ trigger: # what fires it — cron / event / label / dispatch / upstream run
682
+ services: # services or data surfaces it reads from and writes to
683
+ next: # what it triggers next ("nothing" is a valid answer)
684
+ human_reentry: # how a human resumes, redirects or stops it mid-run
685
+ dedupe: # mechanism preventing semantic double-work — MUST name something beyond
686
+ # `concurrency: group:` (it serializes overlapping RUNS, not the work itself)
687
+ source_dedupe: # how the ticket source dedupes this task, or the literal "not a ticket source"
688
+ # one `- task:` list item per created task
689
+ ```
690
+
631
691
  ## Guard Contract
632
692
 
633
693
  Required when the deliverable includes a guard, gate, lint, drift-check or
@@ -137,7 +137,7 @@
137
137
  - When a plan proposes a fix to a flaky negative-substring assertion over output that embeds RNG-derived strings (`randomUUID()`, `nanoid()`, `Math.random().toString(36)`), enumerate the RNG's emitted alphabet (`randomUUID()` v4 → `[0-9a-f]`, `nanoid` default → `[A-Za-z0-9_-]`, `Math.random().toString(36)` → `[0-9a-z]`) and weigh at least one **data-side fix** (rename the fixture literal to a character outside that alphabet) ahead of any **assertion-side fix** (word-boundary regex, line-anchored regex, deterministic-RNG spy). Data-side fixes are collision-proof by construction with zero regex-semantics to audit; assertion-side fixes carry residual template-shape risk. **Why:** PR #3615 — plan adopted the issue body's proposed `/\bb\.png\b/` regex and produced a 320-line analysis (truth-table + probability math + deferred-spy follow-up issue) for a flake on a fixture filename. Multi-agent review's soleur:engineering:review:code-simplicity-reviewer (1 of 11) surfaced that renaming the fixture from `b.png` to `z.png` was strictly simpler: UUIDs are hex-only, no suffix can end in `z`, original `toContain("z.png")` becomes collision-proof. Net diff dropped from 341/-1 to 3/-3; deferred follow-up #3617 closed as wontfix. See `knowledge-base/project/learnings/2026-05-11-rename-fixture-beats-regex-for-rng-substring-flake.md`.
138
138
  - When a plan AC uses `diff <(awk '/^heading/,/^delimiter$/' ...)` (region-replacement diff against canonical), enumerate **every paragraph the awk range captures** in the edit instructions — not just the named section's heading + body. Awk ranges greedily include trailing/leading paragraphs that semantically belong to neighboring sections but physically sit inside the range. AC region MUST equal edit-instruction region; otherwise the AC detects drift the implementation cannot fix without scope expansion. Two alignments: tighten the AC range to a tighter delimiter (`<!-- End: ... -->` instead of `^---$`), or expand the edit instructions to cover everything inside the range. **Why:** PR #3669 — plan prescribed "replace GDPR §3.8 heading + body lines 104-107" but the AC's awk range `/^### 3\.8/,/^---$/` also captured the §3.7 balancing-test paragraph that canonical relocated post-§3.8; required a follow-up paragraph relocation at soleur:work time. See `knowledge-base/project/learnings/2026-05-12-region-replacement-acs-must-enumerate-trailing-paragraphs.md`.
139
139
  - When a plan AC greps for a date string spanning hero + body Last-Updated lines on Eleventy mirror legal docs, tolerate both punctuation forms in the regex (`Last Updated[: *]+May 12, 2026`) or split into two separate count assertions per location. Hero uses `<p>... Last Updated May 12, 2026</p>` (no colon), body uses `**Last Updated:** May 12, 2026` (with `:**`); a literal `'Last Updated May 12, 2026'` regex matches only the hero. **Why:** PR #3669 — plan AC9 prescribed `grep -cE 'Last Updated May 12, 2026' ... returns 2,2,2` but the body form is unmatchable as-written; recovery required trusting the AC's spirit via a separate `grep -n 'Last Updated'` call. See same learning file.
140
- - For drift-remediation runbooks targeting `apps/web-platform/infra/` via Doppler `prd_terraform`, prescribe the canonical invocation triplet verbatim — never just `doppler run -- terraform plan/apply`. The triplet: (1) `export AWS_ACCESS_KEY_ID=$(doppler secrets get AWS_ACCESS_KEY_ID -p soleur -c prd_terraform --plain)` + same for `AWS_SECRET_ACCESS_KEY` (R2 backend creds, must be raw — `tf-var` would mangle them to `TF_VAR_aws_*` and the S3 backend silently fails to authenticate), (2) `terraform init -input=false`, (3) `doppler run -p soleur -c prd_terraform --name-transformer tf-var -- terraform <plan|apply>`. Without `--name-transformer tf-var`, `terraform plan` errors immediately with ~13 `No value for required variable` failures (`cf_api_token_*`, `cf_zone_id`, `cf_account_id`, `webhook_deploy_secret`, `doppler_token`, `cf_notification_email`, `resend_api_key`, etc.). **Why:** #3371 plan cited the precedent (#3061 runbook) but copy-pasted only the `prd_terraform` config name, not the flag or the AWS exports — Phase 1 plan crashed at the keyboard. See `knowledge-base/project/learnings/2026-05-09-drift-runbook-canonical-tf-invocation-and-fresh-plan.md`.
140
+ - For drift-remediation runbooks targeting `apps/web-platform/infra/` via Doppler `prd_terraform`, split the prescribed invocation by READ vs WRITE: for `plan`/`init`/`state pull`/`refresh` keep the `prd_terraform` `AWS_*` export (the post-O5b pair is read-only — sufficient for reads), but for any state-writing invocation (`apply`/`import`/`destroy`/`untaint`/`refresh`/`taint`/`state push`/`state mv`/`state rm`/`state replace-provider`/`workspace new`/`workspace delete`) prescribe the Tier-B form — `export AWS_ACCESS_KEY_ID=$(doppler secrets get TF_STATE_AWS_ACCESS_KEY_ID -p soleur-infra-privileged -c prd --plain)` + same for `TF_STATE_AWS_SECRET_ACCESS_KEY`, plus the nested loader `doppler run -p soleur-infra-privileged -c prd --name-transformer tf-var -- doppler run -p soleur -c prd_terraform --name-transformer tf-var --preserve-env -- terraform <apply|…>` (the inner `--preserve-env` keeps Tier-B `TF_VAR_*` values ahead of prd_terraform's plantable copies; `doppler_token_tf` lives only in Tier B). The `prd_terraform` `AWS_*` pair went read-only at the O5b credential-tier cutover (#8209/ADR-241) and 403s an apply's state `PutObject` mid-run — the full recipe is `knowledge-base/engineering/operations/runbooks/infra-credential-tiers-8209.md` §Local Terraform invocation. Without `--name-transformer tf-var`, `terraform plan` errors immediately with ~13 `No value for required variable` failures (`cf_api_token_*`, `cf_zone_id`, `cf_account_id`, `webhook_deploy_secret`, `doppler_token`, `cf_notification_email`, `resend_api_key`, etc.). **Why:** #3371 plan cited the precedent (#3061 runbook) but copy-pasted only the `prd_terraform` config name, not the flag or the AWS exports — Phase 1 plan crashed at the keyboard; #10990 — the unqualified recipe re-armed the read-only pair into two bootstrap scripts' apply legs. See `knowledge-base/project/learnings/2026-05-09-drift-runbook-canonical-tf-invocation-and-fresh-plan.md`.
141
141
  - For drift-remediation plans whose Acceptance Criteria asserts an exact `Plan: N to add, M to change, K to destroy` line copied from a drift-detector snapshot, re-run `terraform plan` against live state immediately before publishing the runbook. Drift snapshots are read-only artifacts captured on the `0 6,18 * * *` cron — up to 12h stale on a fast author, days stale when triage runs after the auto-filed issue. If the live plan diverges from the snapshot at publish time, either (a) the drift was already applied — skip the runbook, verify with curl/file-hash/systemd-unit, close the parent issue; or (b) unrelated drift accumulated — file a follow-up issue and keep scope narrow per `hr-menu-option-ack-not-prod-write-auth`. **Why:** #3371 plan referenced a 2026-05-06 19:48 UTC snapshot for a 2026-05-09 runbook; by apply-time the original target was already in state and 2 unrelated drifts had accumulated; Phase 1 had to be re-scoped at execution. See `knowledge-base/project/learnings/2026-05-09-drift-runbook-canonical-tf-invocation-and-fresh-plan.md`.
142
142
  - For retirement-cleanup plans (sweeps that drop a retired/fabricated AGENTS.md rule-ID citation from operator-facing files), the AC verification grep MUST scan the full class on the edited files, not just the named target ID. Two greps: (a) every retired ID from the retired-rule registry at the repo root — excluding ids listed in [migrated-rule-ids.txt](../../../../scripts/migrated-rule-ids.txt) (migrated, still ACTIVE; they also carry a "NOT a retirement" row in the retired registry) — against each edited file, and (b) every rule-ID-shaped token (`\b(hr|wg|cq|rf|pdr|cm)-[a-z0-9-]+\b`) that does not resolve to an active `[id: ...]` in AGENTS.md or to a row in [migrated-rule-ids.txt](../../../../scripts/migrated-rule-ids.txt). Named-target-only greps return false-pass for the class — the same files often contain other retired or fabricated citations the issue body never enumerated. **Why:** PR #3491 — plan AC verified only the 5 named retired IDs; multi-agent review caught 5 additional retired/fabricated active citations in the same edited files (3 in files the PR was already modifying, 1 fabricated in this skill itself). See `knowledge-base/project/learnings/2026-05-09-retirement-cleanup-grep-must-scan-full-class-not-named-id.md`.
143
143
  - When a plan prescribes BOTH a contract-changing edit (function return-code semantics, signature change, schema field, env-var contract) AND a contract-consumer edit (consumer of the new return code, new arg, new field), the contract-changing phase MUST come BEFORE the consumer phase — even when the entire PR is single-merge atomic. Plans are read sequentially during `soleur:work`; out-of-order phases produce dead code or fail tests in the consumer phase before the contract phase has shipped. Atomic merge ≠ atomic per-phase TDD. The natural temptation is to group phases by file (consumers + infrastructure) instead of by dependency direction; resist. **Why:** #3509 plan-review — initial draft put hook emission (Phase 2) ahead of the `rotate_if_needed` return-code change (Phase 3); Kieran-rails-reviewer caught it. The Phase 2 `if ! rotate_if_needed` wrapper would have been dead code at Phase 2 boundary. See `knowledge-base/project/learnings/2026-05-10-plan-phase-order-load-bearing-when-contract-changes.md`.
@@ -0,0 +1,75 @@
1
+ # Task-Design Gate (Conditional) — canonical contract
2
+
3
+ Loaded by plan §2.9.3 (emit) and deepen-plan §4.13 (halt). This file is the
4
+ CANONICAL copy of the gate contract; the `## Task Design` schema blocks in
5
+ `plan-issue-templates.md` (all three templates, after `## Encryption Posture`)
6
+ are verbatim schema copies (comment prologue aside).
7
+
8
+ Every plan that creates a NEW autonomous-task surface MUST emit a `## Task Design`
9
+ section — one `- task:` list item per created task (one file CAN create several:
10
+ N functions in one file ⇒ N items). **Create-time only**: never a retrofit onto
11
+ existing tasks.
12
+
13
+ ## Detection
14
+
15
+ Detection is file-list + diff-scoped — `## Files to Create` / `## Files to Edit`
16
+ are the canonical headings. A plan that merely *mentions* these paths does not
17
+ fire. Trigger surfaces:
18
+
19
+ | Substrate | Signal |
20
+ |---|---|
21
+ | GHA workflow | a `## Files to Create` `.github/workflows/*.yml` (ANY new workflow — `scheduled-*` is convention, not enforcement; 14+ live autonomous workflows carry other names) OR a `## Files to Edit` adding a `schedule:`/`on:` trigger block to an existing workflow |
22
+ | Inngest function | a `## Files to Create` `.ts` under `apps/*/server/inngest/functions/` — `cron-*`/`oneshot-*`/`event-*`/unprefixed all count; a new `_`-prefixed file that adds `createFunction(`, or a function registered via an edit to `app/api/inngest/route.ts` or a `server/index.ts` `inngest.send` arm |
23
+ | Registered check | a `## Files to Edit` adding a `CHECK_REGISTRY` key in `event-scheduled-reminder.ts`, an arming record for a named-check, or a plan step arming a reminder via `scripts/arm-checkpoint.sh` / `POST /api/internal/schedule-reminder` (the API-arm path creates no file — the plan step is the signal) |
24
+ | pg_cron | a `supabase/migrations/*.sql` create/edit adding `cron.schedule(` |
25
+ | Host scheduler | a `cloud-init*`/infra create/edit adding `/etc/cron.d/` or a `.timer` `OnCalendar=` |
26
+ | In-process daemon | a `server/*.ts` create/edit adding a `setInterval(`-driven periodic task |
27
+ | Terraform-emitted | a `.tf` adding `github_repository_file` writing a `.github/workflows/*.yml` |
28
+
29
+ The non-`_` rule for Inngest files: shared code SHOULD be `_`-prefixed
30
+ (`_cron-shared.ts`), so a new non-`_` file is *presumed* a function — four
31
+ existing helpers break the rule today (`github-event-strategies.ts`,
32
+ `oauth-probe-sentinels.ts`, `action-required-sla-policy.ts`,
33
+ `content-promotion.ts`); over-fire on a new helper is the safe direction, and
34
+ new helpers should be named `_<name>.ts`.
35
+
36
+ ## Required schema (canonical)
37
+
38
+ ```yaml
39
+ tasks:
40
+ - task: # name/slug of the autonomous task being created
41
+ trigger: # what fires it — cron / event / label / dispatch / upstream run
42
+ services: # services or data surfaces it reads from and writes to
43
+ next: # what it triggers next ("nothing" is a valid answer)
44
+ human_reentry: # how a human resumes, redirects or stops it mid-run
45
+ dedupe: # mechanism preventing semantic double-work — MUST name something beyond
46
+ # `concurrency: group:` (it serializes overlapping RUNS, not the work itself)
47
+ source_dedupe: # how the ticket source dedupes this task, or the literal "not a ticket source"
48
+ # one `- task:` list item per created task
49
+ ```
50
+
51
+ ## Reject conditions (deepen-plan §4.13)
52
+
53
+ Section missing entirely while detection fires; more than one unfenced
54
+ `## Task Design` section (malformed); a created task with no `- task:` item
55
+ naming it; a field absent, empty, or matching (case-insensitive)
56
+ `^\s*<field>:\s*(TODO|TBD|N/A|placeholder|WIP|FIXME|TBC|\?\?\?|-|none|see above)\s*$`;
57
+ a `dedupe` answer naming ONLY `concurrency: group:` / workflow-level
58
+ concurrency, or asserting idempotency without naming a mechanism (idempotency
59
+ precheck, marker dedupe, immutable ticket key); a `## Task Design` appearing
60
+ inside a code construct does not count — count UNFENCED `## Task Design`
61
+ headings outside ALL fence forms (```` ``` ````, `~~~`, `>` blockquote,
62
+ 4-space indent).
63
+
64
+ ## Skip silently
65
+
66
+ When the plan creates no new autonomous-task surface per the table above.
67
+
68
+ ## Recovery
69
+
70
+ Add the `## Task Design` section per `plan-issue-templates.md` (or fix the
71
+ rejected field), then re-run deepen-plan.
72
+
73
+ **Why:** #11015 — every answer to the six task-design questions exists somewhere in the
74
+ machinery (`concurrency: group:`, idempotency prechecks, `action-required` re-entry,
75
+ dedupe markers), but none was required at design time.
@@ -106,7 +106,19 @@ Inspect `$ARGUMENTS`:
106
106
 
107
107
  **Step 0b: Check arguments (recurring mode)**
108
108
 
109
- If `$ARGUMENTS` contains `--name`, `--skill`, `--cron`, and `--model` flags, extract values directly and skip to Step 2. Validate each value using the same rules below. If any required flag is missing, proceed to Step 1 for the missing parameters only. Optional flags: `--timeout` (minutes, default 30) and `--max-turns` (default 30).
109
+ If `$ARGUMENTS` contains `--name`, `--skill`, `--cron`, and `--model` flags, extract values directly, run the task-design check below, then skip to Step 2. Validate each value using the same rules below. If any required flag is missing, proceed to Step 1 for the missing parameters only. Optional flags: `--timeout` (minutes, default 30) and `--max-turns` (default 30).
110
+
111
+ **Task-design flags (recurring mode).** Every generated workflow stamps a `# Task design:` header (Step 3a) carrying answers to the six task-design questions. `trigger` is derived from the collected `--cron` + `workflow_dispatch`; the other five come from Step 1's questions or these flags:
112
+
113
+ - `--design-services <text>` — services the task reads from / writes to
114
+ - `--design-next <text>` — what the task triggers next (`nothing` is a valid answer)
115
+ - `--design-reentry <text>` — how a human resumes, redirects or stops it mid-run
116
+ - `--design-dedupe <text>` — the mechanism preventing semantic double-work. MUST name something beyond `concurrency: group:` (e.g. an idempotency precheck, a marker dedupe, an immutable ticket key) — `concurrency:` only serializes overlapping RUNS, it does not stop the same work being done twice.
117
+ - `--design-source-dedupe <text>` — how the ticket source dedupes the task, or the literal `not a ticket source`.
118
+
119
+ Every `--design-*` value and every Step 1 design answer MUST match `^[\x20-\x7e]{1,400}$` — single printable line, no CR/LF. A newline escapes the `# Task design:` comment into raw workflow YAML; this regex is the same class of load-bearing injection defense as Step 0c's flag regexes.
120
+
121
+ In a non-interactive context (flags supplied, no operator answering Step 1), a **missing, placeholder (`TODO`/`TBD`/`N/A`), or concurrency-only `dedupe` design answer is a hard error** — emit `ERROR: missing or invalid task-design answer for <question> (pass --design-<flag> or run interactively)` and stop. This mirrors `--once`'s no-fallback posture: a task must never be created with unwritten design answers. The requirement applies to **newly created** tasks only — existing `.github/workflows/scheduled-*.yml` files are not retroactively gated.
110
122
 
111
123
  **Step 0c: Check arguments (one-time mode)**
112
124
 
@@ -198,6 +210,18 @@ One-time mode does not pass through Step 1 — all flags are mandatory at the co
198
210
 
199
211
  6. **Max turns** — Maximum number of agent turns before stopping. Default: 30. Validate: positive integer, minimum 5 turns. Budget formula: plugin overhead (~10 turns) + task tool calls + error buffer (~5). Multi-platform data collection or PR-based persist workflows typically need 40-50 turns.
200
212
 
213
+ 7. **Services read/written** — Which services or data surfaces the task reads from and writes to (e.g. "reads Sentry issues, writes GitHub issue comments"). Stamped into the `# Task design:` header.
214
+
215
+ 8. **Triggers next** — What this task triggers next when it finishes (another task, a PR, a notification). `nothing` is a valid, complete answer.
216
+
217
+ 9. **Human re-entry** — How a human resumes, redirects or stops the task mid-run (e.g. "comment on the tracking issue", "`gh workflow run` / `soleur:cron-delete`").
218
+
219
+ 10. **Dedupe** — The mechanism preventing semantic double-work. The answer MUST name something beyond `concurrency: group:` — that only serializes overlapping runs; it does not stop the same work being done twice (e.g. an idempotency precheck, a marker/dedupe comment, an immutable ticket key).
220
+
221
+ 11. **Source dedupe** — How the ticket source dedupes this task if it files tickets, or the literal `not a ticket source` when the task never creates tickets.
222
+
223
+ Validate: items 7-11 each MUST be a single printable line (`^[\x20-\x7e]{1,400}$`) — a newline escapes the `# Task design:` comment into raw workflow YAML. Items 7-11 may be skipped when the corresponding `--design-*` flags (Step 0b) already carry answers.
224
+
201
225
  **Step 2: Resolve action SHAs**
202
226
 
203
227
  Pin GitHub Actions to commit SHAs for supply-chain security. For each action (`actions/checkout@v4`, `anthropics/claude-code-action@v1`), resolve the SHA:
@@ -230,6 +254,13 @@ gh repo view --json owner,name --jq '"\(.owner.login)/\(.name)"'
230
254
  Create `.github/workflows/scheduled-<NAME>.yml` with this content, replacing all `<PLACEHOLDER>` values:
231
255
 
232
256
  ```yaml
257
+ # Task design:
258
+ # trigger: cron '<CRON_EXPRESSION>' + workflow_dispatch
259
+ # services: <DESIGN_SERVICES>
260
+ # next: <DESIGN_NEXT>
261
+ # human_reentry: <DESIGN_REENTRY>
262
+ # dedupe: <DESIGN_DEDUPE>
263
+ # source_dedupe: <DESIGN_SOURCE_DEDUPE>
233
264
  name: "Scheduled: <DISPLAY_NAME>"
234
265
 
235
266
  on:
@@ -332,6 +363,13 @@ Create `.github/workflows/scheduled-<NAME>.yml` with this content, replacing all
332
363
  <!-- once-template-begin -->
333
364
 
334
365
  ```yaml
366
+ # Task design:
367
+ # trigger: one-time cron '<ONE_TIME_CRON>' + workflow_dispatch (D3 date guard pins the year)
368
+ # services: reads the pinned issue comment via gh api (D1); writes issue comments and the D4 neutralization commit (contents/issues/pull-requests: write)
369
+ # next: nothing — self-neutralizes on first successful fire (D4)
370
+ # human_reentry: the pinned issue-comment thread ($ISSUE_NUMBER / $COMMENT_ID, D5-pinned)
371
+ # dedupe: D3 date guard + D4 self-strip of the schedule: trigger + concurrency: group schedule-once-<NAME>
372
+ # source_dedupe: not a ticket source — fires once against a pre-existing comment, never files tickets
335
373
  name: "Scheduled (once): <DISPLAY_NAME>"
336
374
 
337
375
  on:
@@ -1165,7 +1165,7 @@ Inform the operator: "PR touches `terraform_data.deploy_pipeline_fix` trigger fi
1165
1165
  Same as interactive — surface a tracking comment on the PR noting the auto-apply will fire on merge, then proceed. The comment also names the kill-switch and the fallback terminal command for the rare auto-apply failure case.
1166
1166
 
1167
1167
  ```bash
1168
- TRACKING_MSG=$'[deploy_pipeline_fix-drift-gate] This PR touches a trigger file. `apply-deploy-pipeline-fix.yml` will auto-apply on merge — no action required. To skip the auto-apply, add `[skip-deploy-fix-apply]` to a commit message. If the auto-apply fails (transient outage), run the workflow manually from the Actions tab, or as a last resort: `doppler run -p soleur -c prd_terraform -- terraform apply -target=terraform_data.deploy_pipeline_fix -input=true`.'
1168
+ TRACKING_MSG=$'[deploy_pipeline_fix-drift-gate] This PR touches a trigger file. `apply-deploy-pipeline-fix.yml` will auto-apply on merge — no action required. To skip the auto-apply, add `[skip-deploy-fix-apply]` to a commit message. If the auto-apply fails (transient outage), run the workflow manually from the Actions tab, or as a last resort the canonical Tier-B apply from `knowledge-base/engineering/operations/runbooks/infra-credential-tiers-8209.md` §Local Terraform invocation — export `AWS_*` from `TF_STATE_AWS_*` (soleur-infra-privileged/prd; the `prd_terraform` pair is read-only post-O5b and a bare `doppler run -c prd_terraform -- terraform apply` 403s the state PutObject mid-run) then `doppler run -p soleur-infra-privileged -c prd --name-transformer tf-var -- doppler run -p soleur -c prd_terraform --name-transformer tf-var --preserve-env -- terraform apply -target=terraform_data.deploy_pipeline_fix -input=true`.'
1169
1169
  if ! gh pr comment "$PR_NUMBER" --body "$TRACKING_MSG" 2>/dev/null; then
1170
1170
  echo "$TRACKING_MSG" >&2
1171
1171
  if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then