@miller-tech/uap 2.36.4 → 2.39.1

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 (100) hide show
  1. package/config/model-profiles/qwen38.json +3 -3
  2. package/config/model-registry.json +96 -6
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/bin/cli.js +57 -0
  5. package/dist/bin/cli.js.map +1 -1
  6. package/dist/cli/deliver.d.ts +46 -0
  7. package/dist/cli/deliver.d.ts.map +1 -1
  8. package/dist/cli/deliver.js +155 -36
  9. package/dist/cli/deliver.js.map +1 -1
  10. package/dist/cli/models.d.ts +11 -1
  11. package/dist/cli/models.d.ts.map +1 -1
  12. package/dist/cli/models.js +164 -3
  13. package/dist/cli/models.js.map +1 -1
  14. package/dist/cli/workflow.d.ts +36 -0
  15. package/dist/cli/workflow.d.ts.map +1 -0
  16. package/dist/cli/workflow.js +246 -0
  17. package/dist/cli/workflow.js.map +1 -0
  18. package/dist/delivery/run-state.d.ts +1 -1
  19. package/dist/delivery/run-state.d.ts.map +1 -1
  20. package/dist/delivery/run-state.js +1 -1
  21. package/dist/delivery/run-state.js.map +1 -1
  22. package/dist/delivery/team-solve-deliver.d.ts +83 -0
  23. package/dist/delivery/team-solve-deliver.d.ts.map +1 -0
  24. package/dist/delivery/team-solve-deliver.js +191 -0
  25. package/dist/delivery/team-solve-deliver.js.map +1 -0
  26. package/dist/inference/model-files.d.ts +111 -0
  27. package/dist/inference/model-files.d.ts.map +1 -0
  28. package/dist/inference/model-files.js +172 -0
  29. package/dist/inference/model-files.js.map +1 -0
  30. package/dist/placement/registry.d.ts +650 -0
  31. package/dist/placement/registry.d.ts.map +1 -1
  32. package/dist/placement/registry.js +21 -0
  33. package/dist/placement/registry.js.map +1 -1
  34. package/dist/workflow/loader.d.ts +34 -0
  35. package/dist/workflow/loader.d.ts.map +1 -0
  36. package/dist/workflow/loader.js +232 -0
  37. package/dist/workflow/loader.js.map +1 -0
  38. package/dist/workflow/runner.d.ts +90 -0
  39. package/dist/workflow/runner.d.ts.map +1 -0
  40. package/dist/workflow/runner.js +416 -0
  41. package/dist/workflow/runner.js.map +1 -0
  42. package/dist/workflow/types.d.ts +400 -0
  43. package/dist/workflow/types.d.ts.map +1 -0
  44. package/dist/workflow/types.js +147 -0
  45. package/dist/workflow/types.js.map +1 -0
  46. package/docs/INDEX.md +1 -0
  47. package/docs/architecture/adr/0013-declarative-workflow-layer.md +99 -0
  48. package/docs/architecture/adr/0014-loop-steps-and-team-solve-deliver.md +142 -0
  49. package/docs/benchmarks/LCB_DROID_SMOKE.md +111 -0
  50. package/docs/guides/DELIVER.md +3 -1
  51. package/docs/guides/WORKFLOWS.md +179 -0
  52. package/docs/plans/model-performance-proof-options.md +39 -0
  53. package/docs/reference/CLI.md +33 -0
  54. package/docs/reference/CONFIGURATION.md +1 -0
  55. package/docs/reference/FEATURES.md +18 -0
  56. package/examples/auto-coordinator-example.js +127 -0
  57. package/examples/demo-order-solid.ts +19 -0
  58. package/examples/order-processing-strategy-pattern.ts +186 -0
  59. package/examples/order-processor-refactored.ts +473 -0
  60. package/examples/order-solid-refactor.ts +830 -0
  61. package/examples/refactored-order-processing.ts +106 -0
  62. package/examples/run-order-processing.ts +48 -0
  63. package/examples/solid-order-processing.ts +324 -0
  64. package/examples/strategy-pattern-example.ts +100 -0
  65. package/examples/workflows/team-solve/README.md +85 -0
  66. package/examples/workflows/team-solve/check-samples.sh +50 -0
  67. package/examples/workflows/team-solve/sample/task.md +22 -0
  68. package/examples/workflows/team-solve/sample/tests/1.in +2 -0
  69. package/examples/workflows/team-solve/sample/tests/1.out +1 -0
  70. package/examples/workflows/team-solve/sample/tests/2.in +2 -0
  71. package/examples/workflows/team-solve/sample/tests/2.out +1 -0
  72. package/examples/workflows/team-solve/sample/tests/3.in +2 -0
  73. package/examples/workflows/team-solve/sample/tests/3.out +1 -0
  74. package/examples/workflows/team-solve/sample/tests/4.in +2 -0
  75. package/examples/workflows/team-solve/sample/tests/4.out +1 -0
  76. package/examples/workflows/team-solve/sample/tests/5.in +1 -0
  77. package/examples/workflows/team-solve/sample/tests/5.out +1 -0
  78. package/examples/workflows/team-solve/steps/ideate-a.md +26 -0
  79. package/examples/workflows/team-solve/steps/ideate-b.md +28 -0
  80. package/examples/workflows/team-solve/steps/plan.md +20 -0
  81. package/examples/workflows/team-solve/steps/repair.md +25 -0
  82. package/examples/workflows/team-solve/steps/review.md +29 -0
  83. package/examples/workflows/team-solve/steps/solve.md +26 -0
  84. package/examples/workflows/team-solve/workflow.yaml +78 -0
  85. package/examples/workflows/team-solve-deliver/README.md +84 -0
  86. package/examples/workflows/team-solve-deliver/steps/ideate-a.md +25 -0
  87. package/examples/workflows/team-solve-deliver/steps/ideate-b.md +28 -0
  88. package/examples/workflows/team-solve-deliver/steps/plan.md +25 -0
  89. package/examples/workflows/team-solve-deliver/steps/repair.md +20 -0
  90. package/examples/workflows/team-solve-deliver/steps/review.md +31 -0
  91. package/examples/workflows/team-solve-deliver/steps/solve.md +28 -0
  92. package/examples/workflows/team-solve-deliver/steps/verify.md +9 -0
  93. package/examples/workflows/team-solve-deliver/workflow.yaml +74 -0
  94. package/package.json +2 -1
  95. package/src/policies/enforcers/__pycache__/_common.cpython-311.pyc +0 -0
  96. package/src/policies/enforcers/__pycache__/expert_review_required.cpython-311.pyc +0 -0
  97. package/src/policies/enforcers/__pycache__/quality_metrics_gate.cpython-311.pyc +0 -0
  98. package/templates/hooks/__pycache__/deliver_autoroute.cpython-311.pyc +0 -0
  99. package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-311.pyc +0 -0
  100. package/tools/agents/scripts/anthropic_proxy.py +163 -18
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bash
2
+ # Sample harness for team-solve: run solution.py against every tests/N.in and
3
+ # compare with tests/N.out.
4
+ #
5
+ # default : print per-sample results, ALWAYS exit 0 — this is the `test`
6
+ # step: evidence for the reviewer, never a run-killer.
7
+ # --strict : exit 1 when any sample fails — this is the `verify` step, the
8
+ # run's verdict. The score is what the harness says, never what
9
+ # a model claims.
10
+ set -u
11
+ strict=0
12
+ [ "${1:-}" = "--strict" ] && strict=1
13
+
14
+ if [ ! -f solution.py ]; then
15
+ echo "MISSING solution.py — nothing to test"
16
+ [ "$strict" = 1 ] && exit 1
17
+ exit 0
18
+ fi
19
+
20
+ pass=0
21
+ fail=0
22
+ found=0
23
+ for input in tests/*.in; do
24
+ [ -e "$input" ] || continue
25
+ found=$((found + 1))
26
+ n=$(basename "$input" .in)
27
+ expected=$(cat "tests/$n.out")
28
+ actual=$(python3 solution.py < "$input" 2>&1)
29
+ if [ "$actual" = "$expected" ]; then
30
+ echo "sample $n: PASS"
31
+ pass=$((pass + 1))
32
+ else
33
+ echo "sample $n: FAIL"
34
+ echo " expected: $expected"
35
+ echo " actual: $actual"
36
+ fail=$((fail + 1))
37
+ fi
38
+ done
39
+
40
+ if [ "$found" = 0 ]; then
41
+ echo "no tests found under tests/"
42
+ [ "$strict" = 1 ] && exit 1
43
+ exit 0
44
+ fi
45
+
46
+ echo "samples: $pass pass, $fail fail (of $found)"
47
+ if [ "$strict" = 1 ] && [ "$fail" -gt 0 ]; then
48
+ exit 1
49
+ fi
50
+ exit 0
@@ -0,0 +1,22 @@
1
+ # Task: longest strictly increasing subsequence
2
+
3
+ Given a sequence of N integers, print the length of its longest strictly
4
+ increasing subsequence.
5
+
6
+ ## Input
7
+
8
+ The first integer token in the input is N (0 <= N <= 100000). It is followed
9
+ by N integer tokens a_1 ... a_N (-10^9 <= a_i <= 10^9). Tokens are separated
10
+ by whitespace and may be spread over any number of lines — read tokens, not
11
+ lines. When N is 0 there are no further tokens.
12
+
13
+ ## Output
14
+
15
+ One line: a single integer, the length of the longest strictly increasing
16
+ subsequence (0 when N is 0).
17
+
18
+ ## Notes
19
+
20
+ - A subsequence keeps the original order but need not be contiguous.
21
+ - STRICTLY increasing: equal values do not extend a subsequence.
22
+ - A correct solution must run comfortably within limits at N = 100000.
@@ -0,0 +1,2 @@
1
+ 5
2
+ 1 5 2 3 4
@@ -0,0 +1,2 @@
1
+ 6
2
+ 3 3 3 3 3 3
@@ -0,0 +1,2 @@
1
+ 8
2
+ 10 9 2 5 3 7 101 18
@@ -0,0 +1,26 @@
1
+ # Ideate A
2
+
3
+ You are IDEATOR A on a five-role team solving ONE programming problem.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the files inlined below.
7
+
8
+ Read the task (`task.md`) and the plan (`plan.md`), then propose the MOST
9
+ DIRECT PROVABLE algorithm: the simplest approach that is still correct within
10
+ the constraints, with a short argument for why it is correct (invariant or
11
+ proof sketch) and its complexity.
12
+
13
+ A second ideator works IN PARALLEL from the same plan and is instructed to
14
+ propose from a DIFFERENT algorithm family — do not try to guess or match
15
+ them. Diversity of proposals is the point; commit to your family honestly.
16
+
17
+ Your `proposal-a.md` should contain:
18
+ 1. The algorithm, step by step.
19
+ 2. Why it is correct (invariant / proof sketch, 3–6 sentences).
20
+ 3. Time and space complexity, checked against the plan's constraint target.
21
+ 4. The main risk or edge case this approach could get wrong.
22
+
23
+ Do NOT write the final code. A solver will choose between proposals later.
24
+
25
+ Reply with ONLY the complete content of `proposal-a.md` — no commentary, no
26
+ code fences, nothing outside the file.
@@ -0,0 +1,28 @@
1
+ # Ideate B
2
+
3
+ You are IDEATOR B on a five-role team solving ONE programming problem.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the files inlined below.
7
+
8
+ Read the task (`task.md`) and the plan (`plan.md`), then propose an algorithm
9
+ from a DIFFERENT algorithm family than the most obvious one (if the obvious
10
+ answer is greedy, bring the DP or the structural/graph view; if it is
11
+ simulation, bring the mathematical shortcut). It must still be correct within
12
+ the constraints; novelty is not a license to be wrong.
13
+
14
+ A second ideator works IN PARALLEL proposing the most direct approach — do
15
+ not try to guess or match them. The team wins when the solver has a real
16
+ choice.
17
+
18
+ Your `proposal-b.md` should contain:
19
+ 1. The algorithm, step by step.
20
+ 2. Why it is correct (invariant / proof sketch, 3–6 sentences).
21
+ 3. Time and space complexity, checked against the plan's constraint target.
22
+ 4. The main risk or edge case this approach could get wrong.
23
+ 5. One sentence on when this family beats the direct one.
24
+
25
+ Do NOT write the final code. A solver will choose between proposals later.
26
+
27
+ Reply with ONLY the complete content of `proposal-b.md` — no commentary, no
28
+ code fences, nothing outside the file.
@@ -0,0 +1,20 @@
1
+ # Plan
2
+
3
+ You are the PLANNER on a five-role team solving ONE programming problem.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history and
6
+ no prior conversation; work only from the files inlined below.
7
+
8
+ Read `task.md` (inlined below) and produce `plan.md` for the team:
9
+
10
+ 1. Restate the problem in your own words, precisely.
11
+ 2. The exact input and output format, with every token and whitespace rule.
12
+ 3. Constraints and the worst-case sizes that decide the complexity target.
13
+ 4. Edge cases the solution must survive (empty, minimal, maximal, adversarial).
14
+ 5. A short testing strategy: what the samples must cover.
15
+
16
+ Do NOT write the solution. Your job is to make every later role's job
17
+ unambiguous.
18
+
19
+ Reply with ONLY the complete content of `plan.md` — no commentary, no code
20
+ fences, nothing outside the file.
@@ -0,0 +1,25 @@
1
+ # Repair
2
+
3
+ You are the REPAIR WORKER on a five-role team solving ONE programming problem.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the files inlined below.
7
+
8
+ Read the task (`task.md`), the current program (`solution.py`), and the
9
+ reviewer's instructions (`repair.md`). Then produce the new `solution.py`:
10
+
11
+ 1. If `repair.md` says NO REPAIR NEEDED: re-emit `solution.py` EXACTLY as it
12
+ appears below, character for character. Do not "improve" anything — an
13
+ unrequested rewrite of a passing program is how correct work gets
14
+ destroyed.
15
+ 2. Otherwise: apply the reviewer's repair instructions and nothing more.
16
+ Minimal diff. Keep every part of the program the instructions did not
17
+ name.
18
+ 3. Re-read the program against the task's input/output format before
19
+ answering.
20
+
21
+ The deterministic sample harness runs next as the verdict; it, not any model,
22
+ decides the run.
23
+
24
+ Reply with ONLY the complete content of `solution.py` — no commentary, no
25
+ code fences, nothing outside the file.
@@ -0,0 +1,29 @@
1
+ # Review
2
+
3
+ You are the REVIEWER (team manager) on a five-role team solving ONE
4
+ programming problem.
5
+
6
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
7
+ work only from the files inlined below.
8
+
9
+ Read the task (`task.md`), the plan (`plan.md`), the current program
10
+ (`solution.py`), and the sample harness output (`test-output.log`). The
11
+ harness is deterministic ground truth — trust it over any model's claim,
12
+ including this one.
13
+
14
+ Produce `repair.md` for the repair worker:
15
+
16
+ 1. If every sample PASSED: state "NO REPAIR NEEDED" in the first line, then
17
+ one short paragraph of confidence checks (why the program matches the
18
+ plan's edge-case list, and what the hidden tests might still probe).
19
+ 2. If any sample FAILED (or the harness could not run): diagnose the
20
+ failure precisely — wrong algorithm, wrong format, off-by-one, I/O
21
+ parsing, complexity? Name the exact defect in `solution.py`, quote the
22
+ failing behavior from `test-output.log`, and give MINIMAL, concrete
23
+ repair instructions. Do not rewrite the program yourself; instruct.
24
+
25
+ Never invent facts: if the harness output is ambiguous, say exactly what to
26
+ check and how.
27
+
28
+ Reply with ONLY the complete content of `repair.md` — no commentary, no code
29
+ fences, nothing outside the file.
@@ -0,0 +1,26 @@
1
+ # Solve
2
+
3
+ You are the SOLVER on a five-role team solving ONE programming problem.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the files inlined below.
7
+
8
+ Read the task (`task.md`), the plan (`plan.md`), and BOTH proposals
9
+ (`proposal-a.md`, `proposal-b.md`). Then write the final program:
10
+
11
+ 1. Choose the proposal that is correct, simple, and provably within the
12
+ constraints — or synthesize the strongest parts of both. Judge on proof
13
+ quality, not on which letter it has.
14
+ 2. Write a complete Python 3 program. It reads from stdin and writes to
15
+ stdout, exactly as the plan's format section specifies. No files, no
16
+ network, no imports beyond the standard library.
17
+ 3. Handle every edge case the plan lists. Fast I/O only if the constraint
18
+ target actually needs it.
19
+ 4. Read your own program once more before answering: does it compile in your
20
+ head, does it terminate, does it print exactly the required tokens?
21
+
22
+ The deterministic sample harness will run next; a reviewer will judge its
23
+ output. Correctness first.
24
+
25
+ Reply with ONLY the complete content of `solution.py` — no commentary, no
26
+ code fences, nothing outside the file.
@@ -0,0 +1,78 @@
1
+ # team-solve — the GVS5H method as a static UAP workflow.
2
+ #
3
+ # Five roles, one programming problem, fresh context each, files as the only
4
+ # channel. The steps name NO model: the pin ladder (step -> workflow
5
+ # defaultModel -> CLI --model -> local fleet default, see `uap workflow run
6
+ # --help`) answers, so this same file runs on the local strata arm or any
7
+ # OpenAI-compatible endpoint.
8
+ #
9
+ # plan ──┬── ideate-a ──┬── solve ── test ── review ── repair ── verify
10
+ # └── ideate-b ──┘
11
+ #
12
+ # test: deterministic samples, captured, NEVER fails the run (evidence).
13
+ # verify: the same samples as the verdict — a nonzero exit fails the run.
14
+ name: team-solve
15
+ description: >
16
+ Five-role relay with cross-correction for one programming problem: plan,
17
+ two parallel ideations from different algorithm families, solve,
18
+ deterministic sample test, review, repair, hidden-style verify. The
19
+ GVS5H method (five small models beating a frontier single-call on
20
+ LiveCodeBench Hard) as a static workflow over the blackboard orchestrator.
21
+ parallel: 2
22
+ maxRepairsPerStep: 1
23
+ steps:
24
+ - id: plan
25
+ kind: agent
26
+ title: Planner
27
+ prompt: steps/plan.md
28
+ reads: [task.md]
29
+ writes: [plan.md]
30
+ requires: []
31
+ - id: ideate-a
32
+ kind: agent
33
+ title: Ideator A (direct family)
34
+ prompt: steps/ideate-a.md
35
+ reads: [task.md, plan.md]
36
+ writes: [proposal-a.md]
37
+ requires: [plan]
38
+ - id: ideate-b
39
+ kind: agent
40
+ title: Ideator B (different family)
41
+ prompt: steps/ideate-b.md
42
+ reads: [task.md, plan.md]
43
+ writes: [proposal-b.md]
44
+ requires: [plan]
45
+ - id: solve
46
+ kind: agent
47
+ title: Solver
48
+ prompt: steps/solve.md
49
+ reads: [task.md, plan.md, proposal-a.md, proposal-b.md]
50
+ writes: [solution.py]
51
+ requires: [ideate-a, ideate-b]
52
+ - id: test
53
+ kind: command
54
+ title: Sample test (evidence only)
55
+ command: bash "$UAP_WORKFLOW_DIR/check-samples.sh"
56
+ neverFails: true
57
+ writes: [test-output.log]
58
+ requires: [solve]
59
+ - id: review
60
+ kind: agent
61
+ title: Reviewer / manager
62
+ prompt: steps/review.md
63
+ reads: [task.md, plan.md, solution.py, test-output.log]
64
+ writes: [repair.md]
65
+ requires: [test]
66
+ - id: repair
67
+ kind: agent
68
+ title: Repair worker
69
+ prompt: steps/repair.md
70
+ reads: [task.md, solution.py, repair.md]
71
+ writes: [solution.py]
72
+ requires: [review]
73
+ - id: verify
74
+ kind: command
75
+ title: Verdict
76
+ command: bash "$UAP_WORKFLOW_DIR/check-samples.sh" --strict
77
+ writes: [verify.log]
78
+ requires: [repair]
@@ -0,0 +1,84 @@
1
+ # team-solve-deliver — the team directs the convergence loop
2
+
3
+ The two UAP engines combined: **team-solve's role structure and ledger
4
+ discipline** (fresh contexts per role, files as the only channel,
5
+ cross-correction) wrapped around **deliver's convergence machinery** (real
6
+ tools, the project's real completion gates). Roles think; loops build and
7
+ verify.
8
+
9
+ ```
10
+ plan ──┬── ideate-a ──┬── solve ── review ── repair ── verify
11
+ └── ideate-b ──┘ (loop) (judge) (loop) (loop, gates-only)
12
+ ```
13
+
14
+ - `plan` / `review` run on the judge rail (cool, deterministic).
15
+ - `ideate-a` (minimal-change family) and `ideate-b` (structural family) run
16
+ in parallel on the generator rail — the solver gets a real choice.
17
+ - `solve` and `repair` are `kind: loop` steps: each executes a caller-injected
18
+ convergence loop whose exit condition is the project's gates. `solve` is
19
+ the mission itself (the posture chain, with the team's approach steering
20
+ the instruction); `repair` is a bounded pass over the reviewer's brief
21
+ (a declared `turns:` caps it; a NO REPAIR NEEDED verdict collapses to the
22
+ loop's baseline check — zero turns, tree untouched).
23
+ - `verify` is a loop step with `verifyOnly:` — the gates alone, no executor
24
+ turns, the final verdict. Its prompt file exists to satisfy the loader's
25
+ prompt-XOR-goal rule and to document the contract; the seam never sends
26
+ it to a model.
27
+ - The workflow sets `maxRepairsPerStep: 0`: the solve loop already
28
+ converges internally, and an engine-level retry would re-run the ENTIRE
29
+ mission dispatch after it burned its turn budget. The repair step IS the
30
+ retry.
31
+ - The reviewer (`review`) receives the plan file plus a one-line solve
32
+ report — gate status, turns, whether the tree changed, a feedback tail —
33
+ and its prompt is written to judge exactly on that. No file list, no
34
+ diff: it never invents what it wasn't given.
35
+
36
+ ## How it engages (automatic)
37
+
38
+ `uap deliver` resolves a team-solve posture per mission, exactly like its
39
+ other postures (orchestrate, epics):
40
+
41
+ - `--team-solve` / `--no-team-solve` — explicit, wins over everything.
42
+ - `UAP_DELIVER_TEAM_SOLVE=0` — kill switch.
43
+ - `.uap.json` `deliver.teamSolve: 'on' | 'off' | 'auto'` — persistent
44
+ (set with `uap config`).
45
+ - Default `auto`: engage for high/critical-complexity missions whose scope
46
+ is not a named single-file edit (the ladder's "hardest tier → full loop
47
+ + escalation" row now means THIS shape) and stand down otherwise — role
48
+ overhead is real tokens; the ladder escalates with measured difficulty,
49
+ not anxiety.
50
+ - Stand-downs regardless of tier: self-gate and acceptance-primary missions
51
+ (no objective gate ladder for the roles to converge against — the verify
52
+ pass would be vacuous), lazy-solved runs, and AUTO resumes (the
53
+ interrupted run continues on its recorded posture).
54
+
55
+ When engaged, deliver injects its own machinery as the loop seams: `solve`
56
+ runs the mission through the standard dispatch (epics → orchestrated →
57
+ phased → single, per the already-resolved posture) with the approach
58
+ steering the instruction; `repair` runs a bounded convergence loop seeded
59
+ with the reviewer's brief; `verify` re-runs the gate ladder gates-only.
60
+ The banner names the RESOLVED workflow source (a project
61
+ `.uap/workflows/team-solve-deliver/` copy shadows the bundled one — you
62
+ see which ran).
63
+
64
+ ## Standalone runs fail closed
65
+
66
+ `uap workflow run team-solve-deliver` cannot execute loop steps — no
67
+ convergence-loop provider is injected outside deliver. `show` and
68
+ `--dry-run` work (the plan is inspectable data); a run exits with the
69
+ fail-closed message pointing here.
70
+
71
+ ## Layout
72
+
73
+ | file | role |
74
+ | --- | --- |
75
+ | `workflow.yaml` | the DAG: three agent roles, three loop steps, `requires:` edges, `maxRepairsPerStep: 0` |
76
+ | `steps/plan.md`, `steps/ideate-a.md`, `steps/ideate-b.md`, `steps/review.md` | role prompts (fresh-context completions) |
77
+ | `steps/solve.md`, `steps/repair.md` | LOOP DIRECTIVES — they seed the convergence executor |
78
+ | `steps/verify.md` | the gates-only contract (documentation; the seam never sends it to a model) |
79
+ | run dir (`.uap/workflow-runs/<runId>/`) | the ledger: plan.md, proposals, repair.md |
80
+
81
+ The paired experiment that would measure whether this shape beats the plain
82
+ convergence loop is option O7 in
83
+ [docs/plans/model-performance-proof-options.md](../../../docs/plans/model-performance-proof-options.md)
84
+ — same model, same tasks, single-shot vs gate loop vs this workflow.
@@ -0,0 +1,25 @@
1
+ # Ideate A (deliver variant)
2
+
3
+ You are IDEATOR A on the team delivering one engineering mission.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the mission and the plan inlined below.
7
+
8
+ Read the plan and propose the MINIMAL-CHANGE approach: the smallest,
9
+ most local change that satisfies the mission and passes the project's real
10
+ gates. Prefer extending existing patterns over introducing new structure;
11
+ name every file you would touch and why.
12
+
13
+ A second ideator works IN PARALLEL proposing a more structural approach —
14
+ do not try to guess or match them. The solver needs a real choice.
15
+
16
+ Your `proposal-a.md`:
17
+ 1. The approach, step by step, files named.
18
+ 2. Why it is correct and why it passes the gates.
19
+ 3. What it deliberately does NOT do (scope discipline is a feature).
20
+ 4. The main risk and the cheap check that catches it.
21
+
22
+ Do NOT write the implementation. The solver's loop will build it.
23
+
24
+ Reply with ONLY the complete content of `proposal-a.md` — no commentary, no
25
+ code fences, nothing outside the file.
@@ -0,0 +1,28 @@
1
+ # Ideate B (deliver variant)
2
+
3
+ You are IDEATOR B on the team delivering one engineering mission.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the mission and the plan inlined below.
7
+
8
+ Read the plan and propose the STRUCTURAL approach: the one that fixes the
9
+ root cause or leaves the codebase better placed for what comes next —
10
+ refactor the seam, extend the abstraction, pay the one-time cost — while
11
+ still satisfying the mission and passing the project's real gates. Do not
12
+ invent work the mission does not name; structural means better-placed, not
13
+ bigger.
14
+
15
+ A second ideator works IN PARALLEL proposing the minimal-change approach —
16
+ do not try to guess or match them. The solver needs a real choice.
17
+
18
+ Your `proposal-b.md`:
19
+ 1. The approach, step by step, files named.
20
+ 2. Why it is correct, why it passes the gates, and what it leaves better
21
+ placed (one or two sentences — the structural payoff).
22
+ 3. The extra cost it carries vs a local fix, honestly stated.
23
+ 4. The main risk and the cheap check that catches it.
24
+
25
+ Do NOT write the implementation. The solver's loop will build it.
26
+
27
+ Reply with ONLY the complete content of `proposal-b.md` — no commentary, no
28
+ code fences, nothing outside the file.
@@ -0,0 +1,25 @@
1
+ # Plan (deliver variant)
2
+
3
+ You are the APPROACH PLANNER on the team delivering one engineering mission.
4
+
5
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
6
+ work only from the mission statement and files inlined below.
7
+
8
+ Read the mission and produce `plan.md` for the team:
9
+
10
+ 1. Restate the mission in your own words — what changes, for whom, and what
11
+ "done" observably means.
12
+ 2. The constraints that shape the approach: language/stack, the project's
13
+ real completion gates (build, typecheck, tests, lint), files or surfaces
14
+ the mission names, and backwards-compatibility requirements.
15
+ 3. The approach: how to get from here to done in the FEWEST safe moves.
16
+ Name the files or modules the work will touch, in dependency order.
17
+ 4. The risks: the two or three ways this mission most plausibly goes wrong,
18
+ and the cheap check that catches each early.
19
+ 5. The acceptance line: one sentence an independent verifier could run.
20
+
21
+ Do NOT write the implementation. Your job is to make the ideators' and the
22
+ solver's jobs unambiguous.
23
+
24
+ Reply with ONLY the complete content of `plan.md` — no commentary, no code
25
+ fences, nothing outside the file.
@@ -0,0 +1,20 @@
1
+ # Repair (deliver variant — convergence-loop directive)
2
+
3
+ You are the REPAIR step's directive on the team delivering one engineering
4
+ mission. This instruction seeds a bounded convergence loop with real tools
5
+ against the project's REAL gates.
6
+
7
+ Everything you need is inlined below: the reviewer's instructions and the
8
+ repair brief. The gates are the exit condition.
9
+
10
+ 1. If the reviewer said NO REPAIR NEEDED: do not touch the tree. Run the
11
+ gates, confirm green, and stop. An unrequested rewrite of a passing
12
+ change is how correct work gets destroyed.
13
+ 2. Otherwise: apply the reviewer's instructions and nothing more. Minimal
14
+ diff. Every part of the change the instructions did not name stays as
15
+ the solver left it.
16
+ 3. Drive to GREEN gates. The instructions name the gate that proves the
17
+ fix — that gate passing is the repair's definition of done.
18
+
19
+ A verify-only pass runs next: the gates alone, no executor. It, not any
20
+ model's claim, decides the mission.
@@ -0,0 +1,31 @@
1
+ # Review (deliver variant)
2
+
3
+ You are the REVIEWER on the team delivering one engineering mission — a
4
+ fresh-context judge, distinct from whoever built the change.
5
+
6
+ FRESH CONTEXT: this prompt is everything you have. There is no chat history;
7
+ work only from the plan and the solve report inlined below. You did NOT
8
+ build this change; judge it as if a stranger submitted it.
9
+
10
+ The solve report is one line of facts: gate status (GREEN/NOT delivered),
11
+ turns taken, whether the tree changed, and a short feedback tail from the
12
+ gates. That is what you have — no file list, no diff. Judge ON it, never
13
+ past it, and produce `repair.md` for the repair loop:
14
+
15
+ 1. If the report shows GREEN gates and a changed tree: state "NO REPAIR
16
+ NEEDED" in the first line, then the confidence checks the report CAN
17
+ answer — does the gate status cover every gate the plan's acceptance
18
+ line named, does anything in the plan's risk list look unaddressed by
19
+ the report's feedback tail, and what should the verify pass watch for?
20
+ 2. If the report shows failure (gates red, NOT delivered) or a green run
21
+ with an UNCHANGED tree: diagnose from the feedback tail and the plan.
22
+ Give MINIMAL, concrete repair instructions — the failing gate, the
23
+ likely cause, the fix, the gate that will prove it. Do not redesign;
24
+ instruct the repair.
25
+
26
+ Never invent facts the report does not contain: if the report is ambiguous,
27
+ say exactly what the repair loop should check first. The repair loop has
28
+ tools and gates; it will verify everything you say.
29
+
30
+ Reply with ONLY the complete content of `repair.md` — no commentary, no
31
+ code fences, nothing outside the file.
@@ -0,0 +1,28 @@
1
+ # Solve (deliver variant — convergence-loop directive)
2
+
3
+ You are the SOLVE step's directive on the team delivering one engineering
4
+ mission. This instruction seeds the convergence loop: a builder with real
5
+ tools iterates against the project's REAL completion gates (build,
6
+ typecheck, tests, lint) until they pass — this text tells it what to build
7
+ and how to think about it.
8
+
9
+ Everything you need is inlined below: the mission, the plan, and BOTH
10
+ proposals. Judge on reasoning quality, not which letter a proposal has.
11
+
12
+ 1. Choose the proposal that is correct, gate-passing, and honestly scoped —
13
+ or synthesize the strongest parts of both. If the minimal change is
14
+ sound, take it; if the plan's risk list says the local fix will break,
15
+ take the structural one. Say which, and why, in one short preamble
16
+ before any tool call.
17
+ 2. Implement it. Work the files the plan names, in dependency order. Every
18
+ intermediate state should leave the tree as close to compiling as you
19
+ can make it.
20
+ 3. Drive to GREEN gates — not to "looks done". The gates are the exit
21
+ condition: build, typecheck, tests, lint. When a gate fails, fix the
22
+ cause; never weaken or skip the gate.
23
+ 4. Honor the plan's acceptance line. If mid-implementation you discover the
24
+ plan is wrong, follow the evidence — but finish green and leave the tree
25
+ coherent.
26
+
27
+ A fresh-context reviewer will judge the result against the plan; a repair
28
+ loop will apply its findings. Correctness first.
@@ -0,0 +1,9 @@
1
+ # Verify (deliver variant — gates-only verdict)
2
+
3
+ This step runs the project's REAL completion gates and nothing else: no
4
+ executor turns, no model claims, no partial credit. Build, typecheck,
5
+ tests, lint — the same gates a human would run before shipping.
6
+
7
+ The mission is delivered if and only if this pass is green. A repair that
8
+ "should have" fixed things is not delivered until these gates say so; a
9
+ regression introduced by a late repair is caught here, not shipped.