ie-review: Grok workflow orchestrator
Lens team
| Lens | Why it ran |
|---|---|
| predictability | Always-on. |
| convention | Code review. Always-on for this surface. |
| simplicity | Always-on. |
| experience | This workflow always runs all five. Catalog would skip: no user-facing surface. |
| architecture | This workflow always runs all five. Catalog would skip: no Arch pack for rhai. |
Findings
P1 – High-impact (normal use)
| # | File | Issue | Principle | Lens | Conf |
|---|---|---|---|---|---|
| 1 | .grok/workflows/ie-review.rhai |
complete() changes shape; confirmed flips type |
api-design | predictability | 100 |
| 2 | .grok/workflows/ie-review.rhai |
Merge failure still reports a published path | wysiwyg | predictability | 100 |
| 3 | .grok/workflows/ie-review.rhai |
Cap keeps first 16, so later lenses never verify | least-astonishment | predictability | 100 |
| 4 | .grok/workflows/ie-review.rhai |
Lens prompts reinvent dispatch instead of using subagent-template.md |
convention-over-configuration | convention | 100 |
| 5 | .grok/workflows/ie-review.rhai |
Orchestrator never loads config-resolution or .intense defaults |
convention-over-configuration | convention | 100 |
| 6 | .grok/workflows/ie-review.rhai |
Merge dedupes by file+title and skips Stage 5 policy | convention-over-configuration | convention | 100 |
| 7 | .grok/workflows/ie-review.rhai |
Report phase adds a write-capable merge agent and a second write | kiss | simplicity | 75 |
-
#1 – Early exits return
confirmedas[]plus observations. Success returnsconfirmedasconfirmed.len()(a number), plus verdict, path, and scratch, and it omits observations. Merge failure returnsconfirmedas the finding array and a path, with no verdict. A caller cannot treatcomplete()as one object. Fix: use onecomplete()object on every exit. Always include summary, verdict, path (empty when unpublished), scratch,confirmed(always an array),confirmed_count, reviewed, statuses, and observations. On the success path, pass the confirmed array plus a separate count. -
#2 – Merge failure still sets
path: report_rel. Success also sets that path without checking that the merge agent wrote the file. A stale file from an earlier run then looks like this run’s report. Fix: on merge failure, set path to an empty string (or omit it) and do not namereport_rel. On success, writereport_textfrom this script and set path only when that write succeeds. -
#3 –
MAX_FINDINGSis 16.uniquekeeps lens order (predictability, then convention, then simplicity, experience, architecture). The cap loop takes the first 16. Each lens schema allows 8 findings, so two full early lenses fill the cap. Later lenses never reach Verify. Fix: sort unique by severity (P0, P1, P2, P3) then confidence descending before the cap. Push an observation that names how many findings were dropped. Pass that observation into the merge prompt. Do not cap by insertion order. -
#4 –
lens_prompt()builds a short custom prompt (read these files, Target, Hunt for). It never fillssubagent-template.mdslots: intent, scope_mode, standards_paths, run_artifact_dir, or the artifact-write output-contract. AGENTS.md and ie-review Stage 4 require dispatch from that template. Fix: replacelens_prompt()with a fill ofplugins/intent-engineering/references/subagent-template.md. Bindrun_artifact_dirto a per-run dir underartifacts.run_dir. Pass Context: review, a 2-3 line intent, scope mode, and ancestor AGENTS.md/CLAUDE.md paths. Keep Grokoutput_schemaas the machine wrapper only. -
#5 – Runtime setup sets
plugin_root,base_ref, andreport_relfrom args only. There is no walk-up, noINTENSE_CONFIG_DIR, and no merge ofways-of-working.yaml. AGENTS.md How a run works step 1: load resolved config always before lens selection. Fix: beforelet lenses, resolve config perplugins/intent-engineering/references/config-resolution.md. Walk up for.intense/, else useplugins/intent-engineering/config/defaults/. Applylenses.*,confidence_gate,artifacts.*,conventions.*, andseverity_align. PassConfig: <source>into the merge Coverage block. -
#6 –
unique[]treats two findings as the same only whenu.file == f.file && u.title == f.title. No line window, no normalize, no cross-lens promotion, noseverity_align. The merge agent is only told to drop confidence below 75. Skill Stage 5 and AGENTS.md say dedup by file+line+title, then policy, then the gate. Fix: before Verify, implement ie-review Stage 5 in Rhai. Dedup bynormalize(file)+line(+/-3)+normalize(title). Keep highest severity and confidence. Promote one confidence step when 2+ lenses agree. Applyseverity_alignthenseverity_overrides. Gate atconfidence_gate75 (P0 at 50+). Do not leave the gate as merge-prompt prose only. -
#7 – The merge prompt tells the agent to Write the published report, return the same markdown, then the workflow writes it again via
write_scratch_file. The agent iscapability_mode: read-writeonly for that extra hop. Fix: keep the merge agent read-only and have it return markdown only. Writereport_reland the scratch file in this workflow frommerged.output.report. Remove the Write-tool instruction from the merge prompt.
P2 – Moderate
| # | File | Issue | Principle | Lens | Conf |
|---|---|---|---|---|---|
| 8 | .grok/workflows/ie-review.rhai |
Dedup by file plus title hides other lenses and lines | least-astonishment | predictability | 100 |
| 9 | .grok/workflows/ie-review.rhai |
Verifier rejects vanish with no rejected list | error-handling | predictability | 75 |
| 10 | .grok/workflows/ie-review.rhai |
Report-only merge agent still has full write access | least-astonishment | predictability | 75 |
| 11 | .grok/workflows/ie-review.rhai |
confirmed count is pre-gate, not what the report keeps |
wysiwyg | predictability | 75 |
| 12 | .grok/workflows/ie-review.rhai |
Default report path overwrites the last review | least-astonishment | predictability | 100 |
| 13 | .grok/workflows/ie-review.rhai |
Default report path ignores stamp-skill two-layer convention | convention-over-configuration | convention | 100 |
| 14 | .grok/workflows/ie-review.rhai |
Lens status uses findings instead of report-template skipped/clean |
convention-over-configuration | convention | 100 |
-
#8 – If
u.file == f.file && u.title == f.titlethenseen = true. The first lens that emitted that pair wins. The/ie-reviewskill dedups on file + line(+/-3) + title and records agreeing lenses. Same title at a different line is dropped. A second lens that agreed is dropped. Fix: dedup on file + line + trimmed title. On a match, keep the higher severity and confidence and append the new lens id to alenseslist on the kept finding. Do not drop a same-title finding at a different line. Do not drop a second lens that agreed. -
#9 – The verify loop keeps a finding only when
v.success && real == trueand evidence is non-empty. Everything else is dropped. The merge prompt receives onlyconfirmed. The user-facing signal is one log line. A harness failure looks the same asreal=false. Fix: for every verdict, store{finding, real, reason, evidence, harness_ok}. Pass rejected findings and harness failures to the merge prompt as Coverage. Treatv.success != trueasverifier_failed, not asreal=false. -
#10 –
meta.when_to_use: “Report only. Does not apply fixes.” Merge is spawned withcapability_mode: read-writeand told to Write the published report. The only “do not edit product code” guard is prompt text. Fix: pick one contract and make it visible. Either keep read-write and changemeta.when_to_useto name the tree write (published report underdocs/intent-engineering/; no code fixes), or set the merge agent to read-only and write the report in this script. Do not pair “Report only / Does not apply fixes” with an unbounded write agent. -
#11 – The merge prompt tells the agent to drop findings below 75 unless P0 at 50+. The result then reports
confirmed: confirmed.len(), which is the post-verify, pre-gate list. The dashboard count can be larger than the published table. Fix: apply the confidence gate in this script (drop below 75 unless severity is P0 and confidence is 50+). Pass only gated findings to the merge prompt and tocomplete(). If a pre-gate count is needed, name itverified_count, notconfirmed. -
#12 –
report_relstarts asdocs/intent-engineering/workflow-ie-review.md.stamponly changes the path whenoutis absent. The/ie-reviewskill defaults to a stamped published file so runs do not clobber each other. Two default runs overwrite the same file. Fix: whenargs.outis omitted, setreport_reltodocs/intent-engineering/<stamp>-ie-review.md. Generate stamp from the host date plus a short target slug whenargs.stampis also omitted. Do not default to a single reusable filename. -
#13 –
report_reldefaults todocs/intent-engineering/workflow-ie-review.md; stamp yields<stamp>-ie-review.md; scratch iswrite_scratch_file("report.md"). AGENTS.md rule 5 and config-resolutionCANONICAL_ORCHESTRATOR_PATHSrequire.intense/runs/<run-id>/plusdocs/intent-engineering/<stamp>-<skill>[-scope].mdwith skill slugreview. Fix: default Layer B todocs/intent-engineering/<stamp>-review.md(SKILL_SLUGreview). Keepargs.outas the override. Write lens JSON under.intense/runs/<run-id>/(or a Grok scratch that mirrors that layout). Stop using a fixedworkflow-ie-review.mdname that overwrites the last run. -
#14 – Empty arrays become status
clean; non-empty become statusfindings.report-template.mdLens status allows onlyfailed,skipped, andclean.cleanalready covers both zero findings and listed findings.skippedis never assigned. A caller that reads statuses cannot apply the all-clear rule. Fix: emit onlyfailed,skipped, orclean. A successful lens with findings isclean(findings listed in the report). Useskippedwhen lens-catalog or config did not select the lens. Delete thefindingsstatus.
P3 – Minor
| # | File | Issue | Principle | Lens | Conf |
|---|---|---|---|---|---|
| 15 | .grok/workflows/ie-review.rhai |
Inline lens schema omits findings-schema enums | convention-over-configuration | convention | 75 |
| 16 | .grok/workflows/ie-review.rhai |
MAX_FINDINGS=16 is an unpublished drop cap |
convention-over-configuration | convention | 100 |
-
#15 –
lens_schematypeslens,principle,severity, andfix_classas plain strings andconfidenceas integer, with no enums.findings-schema.jsonis the single contract and constrains those fields. The merge prompt later tells the writer to read that file, so two contracts exist. Invalid values can pass the harness. Fix: buildoutput_schemafromplugins/intent-engineering/references/findings-schema.json. Copy the enums forlens,principle,severity,confidence, andfix_classinto the Rhai map so invalid values cannot pass the harness. -
#16 –
const MAX_FINDINGS = 16; unique findings are copied in arrival order and the rest are dropped with a log line. ie-reviewSKILL.mdhas no such cap. The README does not mention it. A late P0 can drop because a P3 arrived first. Fix: deleteMAX_FINDINGSand the first-N drop, or sort by severity then confidence before the cap and document the budget in.grok/workflows/README.md. Do not drop P0s because they arrived after P3s in lens order.
Tensions
Name the two sides. Do not pick one here.
- #4 – Grok
parallel(jobs)needs a prompt string and cannot spawn Claude Agent tools, versus the repo rule that every ie-review orchestrator fillssubagent-template.md. - #6 – Full Stage 5 in Rhai, versus the documented first-cut skeptic pipeline that does not replace
/ie-review. - #7 – KISS (template or one writer in Rhai), versus convention (an LLM can follow
report-template.mdmore closely than a Rhai string). - #9 – Fail-closed verification (drop anything unverified), versus error-handling transparency (show rejects and harness failures).
- #10 – Least-astonishment (capability matches “Report only”), versus the product rule that orchestrators publish under
docs/intent-engineering/. - #13 – The workflow README documents the fixed default path, versus AGENTS.md two-layer stamp convention that wins on conflict.
- #14 – README says five lenses run together (so skip-as-not-selected is unused), versus report-template all-clear rules that treat
skippedandcleanas different. - #15 – Grok
output_schemamust be an inline map, versus onefindings-schema.jsonas the only contract. - #16 – Repo ie-review has no drop cap, versus a Grok agent-budget cap that may be required to finish Verify.
Observations
- Experience and architecture always run. A not-applicable empty return is marked
clean, notskipped. A backend-only target can look like five clean lenses. - Always running experience and architecture is simpler than copying lens-catalog selection. Those agents already return zero findings when the surface or stack is absent. Residual tension: YAGNI (skip unused agents) versus KISS (do not reimplement selection).
- Lens status is set from the raw findings array length before empty title or file rows are dropped. Status
findingscan pair with zero accepted items. plugin_rootdefaults to the repo-relative pathplugins/intent-engineering. Another repo must pass an absolute path, or lenses read the wrong tree. That default is the Grok-runtime convention.${CLAUDE_PLUGIN_ROOT}applies inside the plugin, not this file.- The failed-lens early exit correctly refuses all-clear when no usable findings remain.
- Two notes conflict on
trimmed(). One says Rhaitrimmutates in place, sotrimmed()is not a discarded-return bug. The other sayss.trim()returns a new string, so the helper is an identity and a predictability bug. This is not in the verified list. Residual risk: confirm the Rhai runtime, then drop the helper or keep a real trim. lens_schemais a loosened inline copy offindings-schema.json. The Grok runtime needs an inline schema.scripts/check-contracts.rbdoes not cover this file, so the copy can drift.- Documented first-cut deviations, treated as reasoned not findings: report-only, no apply, one skeptic per finding, five lenses together. The first cut correctly skipped apply, config walk-up, and
severity_align. That thinning is earned. Dedup is still file+title first-wins, not the skill’s file+line window with highest severity. - This file is a Grok workflow orchestrator, not a user-facing surface. It defines meta, five parallel lens jobs, verify, and merge. There is no UI component, view, template, form, or interactive control.
pause,phase, andcompleteare runtime status hooks for the/workflowsdashboard. They are not a designed interface with loading, empty, error, focus, or keyboard states. Experience hunts do not apply. Report look-and-feel is out of scope in this file (the merge agent writes that later fromreport-template.md). - No
resources/frameworksdoc for Rhai or Grok. Stack-idiom checks skipped.
Coverage
Reviewed: .grok/workflows/ie-review.rhai (one file, full read). Detected stack is rhai (Grok workflow script).
Config: defaults (no .intense/ found). Config sources (auto): 3 files (agents = AGENTS.md + CLAUDE.md, copilot = 0, instructions = 0, workflows = .github/workflows/contracts.yml); excluded = 0.
Sampling / remote: none. No untracked paths. No Layer A run dir (this workflow does not write .intense/runs/<run-id>/).
Confidence gate: applied at merge. Drop below 75 unless severity is P0 and confidence is 50+. 16 verified findings presented; 0 dropped by the gate. Workflow confirmed count is pre-gate (see #11).
Per-lens status:
| Lens | Workflow status | Report status | Note |
|---|---|---|---|
| predictability | findings | clean | Findings listed above. findings is not a report-template status (see #14). |
| convention | findings | clean | Findings listed above. |
| simplicity | findings | clean | Findings listed above. |
| experience | clean | clean | Analyzed. No user-facing surface. Zero findings after the gate. |
| architecture | clean | skipped | SKIPPED: no architecture rule pack for rhai. Catalog Arch packs cover rails, python, laravel, express, phoenix, and react only. ruby exists in the catalog but the Arch pack is empty. No matching frameworks/<stack>-architecture.md or patterns/<stack>.yaml. |
No selected lens failed.
Verdict
Ready with fixes.
16 findings remain: 7 P1, 7 P2, 2 P3. No P0. No failed lens. Architecture is skipped (no rhai pack). Experience is clean (no UI). Do not treat this as all-clear.
Highest-impact fixes first: one complete() shape (#1), honest publish path (#2), severity-ordered cap or no cap (#3, #16), then Stage 5 merge plus config load (#5, #6) and a read-only merge writer (#7, #10).
Source: docs/intent-engineering/2026-08-12-workflow-ie-review.md