Skip to content

Planner becomes the sole case-SDD author - #2431

Draft
abhiram-vad wants to merge 10 commits into
mainfrom
feat/planner-sole-sdd-author
Draft

Planner becomes the sole case-SDD author#2431
abhiram-vad wants to merge 10 commits into
mainfrom
feat/planner-sole-sdd-author

Conversation

@abhiram-vad

@abhiram-vad abhiram-vad commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Phase 0 case-design authoring moves from uipath-maestro-case to uipath-planner. maestro-case delegates the design conversation at runtime (same context window — the in-memory model crosses the skill boundary for free), consumes the confirmed model, and lands sdd.md + tasks/tasks.md + registry-resolved.json + solution init in ONE batched write. Planner does FULL tenant resolution at design time (registry pull, per-resource cache lookups, connections, ambiguity/empty gate at Case Review), so Phase 1 becomes verify-only. Subsumes and closes #2305 (its case-sdd-template + guide content is carried forward in commit 1, plus the Testing/NFR un-nesting fix).

Decisions (locked 2026-07-30 design review)

  1. Full resolution in planner — resolution machinery lives once, in planner; maestro-case keeps only staleness re-resolution and the create-on-missing build execution.
  2. Eval split at the returned-SDD boundary — design evals (prompt → confirmed sdd.md) run in the planner suite; build evals (sdd.md fixture → plan/caseplan) stay in maestro-case.

What changed

Side Change
planner NEW case-design-lane-guide.md (delegated SDD-only / direct / draft / finalization entries, design-time resolution gate, template gate, terminal-step fork), NEW case-authoring-rules-guide.md (ported authoring rules), NEW case-sdd-examples.md, Entry Guard step 0 (delegation detect), Rule 13
maestro-case phase-0-interview.md deleted; Rule 1 = delegation + ONE batched write; Rule 15 flipped (never-auto-invoke → delegation contract + degraded path: planner absent → ask for sdd.md & stop); Rule 3 verify-only w/ planner ledger; Rule 17 short-circuit on recorded gateDecision; validate-loop guard + in-session schema memo in phased-execution.md
tests 6 design tasks → tests/tasks/uipath-planner/; procurement_sla_interruptsdesign_delegation_procurement (cross-skill DAG-1 eval); NEW build_from_planner_sdd (Planner-Handoff sdd.md must not hijack into Lane A)

Verification (local coder-eval, Bedrock, single replicates)

Run Result
migrated case_finalize_draft (planner-authored) SUCCESS 1.0 — 8/8 incl. sdd_check, name-contract, LLM judge
same task on baseline main FAILURE 0.783 — baseline wrote backticked <UNRESOLVED>, breaking the name-contract check
NEW build_from_planner_sdd SUCCESS 1.0 — 7/7; staged sdd.md byte-identical, full T01–T12 plan, no Lane A hijack
_shared unit tests 81 passed
repo validators check-skill-status, description hooks (planner 977 chars), link sweep — all green

Not yet run: interactive DAG-1 live-tenant E2E (50–90 min class), interview design evals + 3 finalize variants (same code paths as the verified one), activation-gate recall (CI — both descriptions changed, double gate expected).

Closes #2305

🤖 Generated with Claude Code

Perf commit (added after transcript mining)

The migration eval transcripts exposed three latency sinks; commit 5 fixes them at doc level and re-measures on the same finalize eval:

Run Result Wall clock Turns
baseline main FAILURE 0.783 (backticked <UNRESOLVED> broke the name-contract check) 1106 s 63
migrated, pre-fix SUCCESS 1.0 2995 s (auto-compaction mid-render) 114
migrated, post-fix SUCCESS 1.0 527 s 12

Fixes: write-early section-batched SDD render (seed Status: draft → per-section appends → gate on-disk → ready flip last, with a compaction-recovery protocol), hard finalize read budget (lane-guide finalize sections + draft + template only), plain <UNRESOLVED> markers (template de-backticked — this defect also failed the baseline run), immediate delegation before any maestro-case reference reads, and plugin read-once for build phases (observed 10–26× planning.md/impl-json.md re-reads per build).

abhiram-vad and others added 10 commits August 3, 2026 09:42
…tion (1/4)

Planner becomes the sole case-SDD author. Adds the conversational case
design lane (Listen/Sketch/one Case Review confirmation) with three entry
modes (delegated SDD-only from uipath-maestro-case, direct design, draft
finalization), full design-time tenant resolution (registry pull, cache
lookups, connections, ambiguity/empty gate at review time), the case
authoring rules (ported from maestro-case sdd-generation-rules), worked
I/O examples, and the blueprint-shaped case SDD template carried forward
from #2305 with the Testing/NFR un-nesting fix. Delegated mode renders
SDD text in memory and hands back — the caller owns the write.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… 1 (2/4)

When sdd.md is absent, entry delegates the design conversation to
uipath-planner (SDD-only mode) and lands the returned model in ONE
batched write (sdd.md + tasks/tasks.md + registry-resolved.json +
solution init). Degraded path: planner absent → ask for sdd.md and stop.
phase-0-interview.md is deleted; the draft-finalization carve-out and
'never auto-invoke uipath-planner' rule are retired. Phase 1 becomes
verify-only against the planner's resolution ledger (re-resolve only on
staleness/cross-session); the Rule-17 gate short-circuits on recorded
design-time gate decisions. Rides along: validate-loop guard (never
re-validate without an intervening edit) and the in-session schema memo
(never re-run an identical tasks describe / case spec).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Design-side tasks move to the planner suite: the two phase-0 interview
evals (candidate_interview, loan_origination) and the four
finalize-from-draft variants. procurement_sla_interrupts stays in
maestro-case renamed design_delegation_procurement — it exercises the
runtime delegation (DAG 1). New build_from_planner_sdd task proves a
Planner-Handoff-bearing sdd.md does not hijack maestro-case into Lane A
task derivation. Moved checkers bootstrap sys.path against the
maestro-case _shared dir; _shared unit tests parameterize checker paths.

Local verification (Bedrock, single replicates): migrated finalize_draft
1.0 SUCCESS 8/8 vs baseline main 0.783 FAILURE (backticked <UNRESOLVED>
broke the name-contract checker); build_from_planner_sdd 1.0 SUCCESS 7/7.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Skill descriptions changed in commits 1-2 (both skills — expect the
double activation-gate recall eval); CODEOWNERS follows the moved test
paths. skill-status.json unchanged: both skills keep their status.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Transcript-mined fixes from the migration eval runs. The 50-min finalize
run decomposed as: 17.5 min composing the whole SDD in-head before any
Write (destroyed by auto-compaction), ~20 min post-compaction flailing
(skill re-invocation, filesystem hunts, orphaned background tasks), and
a 1015-line authoring-guide read the finalize path never needed.

- Case SDD writes are now write-early + section-batched: seed with
  Status: draft, per-section Edit-appends, conformance gate on the
  on-disk file, ready flip last. Compaction recovery = resume from the
  partial file; never re-invoke skills or re-read applied guides.
- Hard finalize read budget: lane-guide finalize sections + draft +
  template, once each; authoring-rules guide and examples explicitly
  excluded. Delegation happens before any maestro-case reference reads.
- Plain <UNRESOLVED> markers: template placeholders de-backticked and
  the rule stated in the gate — backticked markers broke the
  name-contract checker on both the baseline and one fixed-run attempt.
- Build phases: read each plugin planning.md/impl-json.md once per
  plugin type, not per T-entry (observed 10-26x re-reads per build).

Measured on the same finalize eval (Bedrock, single replicates):
pre-fix 2995s/114 turns SUCCESS 1.0 -> post-fix 527s/12 turns SUCCESS
1.0 (5.7x), vs baseline main 1106s/63 turns FAILURE 0.783.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gates

sdd-generation-rules.md (maestro-case) drops the 10 authoring-only
sections the planner now owns (task-type choosing + override priority,
authority hierarchy, source ledger, domain fidelity, architect's lens,
finalization checklist, worked reasoning, inputs, anti-patterns):
1015 -> 774 lines. What remains is the build-side parse contract the
plugins and validators cite (content rules, outputs grammar, lineage,
logical integrity, review-item shape, I/O completeness) — all inbound
anchors verified. Dangling references to cut sections rewritten.

Planner: the authoring guide's duplicated template-gate shape compresses
to a pointer at the lane guide's single source; a read map at the top
scopes reads per activity (finalization reads none of the file).

maestro-case: stale 'Phase 0' labels renamed to design delegation
across SKILL.md, planning.md, brownfield.md, registry-discovery.md, and
the SLA plugin; the Case Review section list is enumerated once (Rule 1)
instead of three times.

Re-verified after the cuts (Bedrock, single replicates):
finalize_draft SUCCESS 0.99 (543s/11 turns), build_from_planner_sdd
SUCCESS 1.0 (161s/11 turns). Link+anchor sweep clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…shared

The migrated planner design evals were still reaching into the
maestro-case test folder: YAML graders called
tests/tasks/uipath-maestro-case/_shared/sdd_check.py, four checkers
sys.path-bootstrapped across suites, and the maestro-case _shared unit
test file reached back into planner task dirs. Per-folder ownership now
holds:

- tests/tasks/uipath-planner/_shared/ created: entry_rule_check.py MOVES
  (only planner checkers use it); case_check.py / sdd_check.py /
  test_sdd_check.py are planner-owned copies (both suites use them);
  test_finalize_checkers.py carries the picker/reject/parser behavioral
  matrix split out of test_reentry_reachability_checks.py.
- maestro-case _shared keeps only what its own suite uses; its unit test
  file retains the caseplan-emit JMESPath matrix.
- All planner checkers and YAML grader paths repointed inside their
  suite; CODEOWNERS row added for the new _shared.

Verified: 42 + 52 unit tests pass per suite; planner sdd_check copy
re-graded a real run artifact identically; both changed YAMLs pass
TaskDefinition schema; cross-folder grep clean (comments only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…versight carve-out ambiguity

Found by a live E2E run of the migrated flow (loan origination, published
to Studio Web): the agent paired return-to-origin with Interrupting: No
on an SLA parallel-oversight lane. The carved-out oversight exception
sentence read as if it also relaxed the returning-lane rule; CLI validate
is blind to the pair (passed Valid), only the sdd_check grader catches
it. Both copies (planner authoring guide + maestro-case build contract)
now state: oversight lanes complete exit-only; return-to-origin always
requires Interrupting: Yes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…undary

Design decision (session, 2026-08-03): replace the in-conversation
SDD-only hand-back with a simpler, durable contract. uipath-maestro-case
spawns uipath-planner as ONE subagent; the subagent runs the Case Design
Lane best-assumption (no user reachable), does full design-time
resolution, WRITES sdd.md at the working root via the write-early
cadence, and returns the Case Review packet + decisions + resolution
ledger (fenced JSON) in its final report. maestro-case then presents the
returned review to the real user as the single confirmation (Rule 11
build options), reads sdd.md once as sole input, and builds; corrections
re-delegate as targeted sdd.md edits. Planner now ALWAYS writes the SDD
in every mode; the model no longer crosses the skill boundary — the file
is the artifact at the seam (compaction-proof), the review is the
approval payload, the ledger still powers verify-only Phase 1 (the
~/.uip cache is machine-global, so the subagent's pull is the session's
pull). Degraded path unchanged. Cross-skill eval gains an allowed_tools
override (Agent/Task) so the subagent can spawn under coder-eval.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…g files

Per review direction: the migration is a clear lift and shift, not a
copy. Removed from uipath-maestro-case: sdd-generation-rules.md (the
authoring/content contract — planner's case-authoring-rules-guide.md is
now the single home), sdd-template.md, sdd-template-examples.md; moved
sdd-viewer.html to planner (the SDD author owns the review surface, lane
guide § HTML preview restored). All 11 inbound reference sites repointed:
build-load-bearing links now target build-side homes (io-binding Check 5,
io-binding planning projection grammar, global-vars impl-json category
semantics); design-side concepts (logical-integrity divert contract,
Section 4 roll-up, SLA response model) become textual mentions of the
planner-owned contract — no cross-skill file links, per self-containment.

tests/pytest.ini adds importlib import mode so the two per-suite _shared
packages collect in one run; the moved parser test imports its checker
by file path. 94/94 unit tests pass; link sweep and description/status
hooks green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant