Skip to content

feat(workflows): author checks, typed decisions, and bounded rework - #34

Draft
Igloczek wants to merge 24 commits into
workflows/26-run-experiencefrom
workflows/27-decisions-rework
Draft

Igloczek wants to merge 24 commits into
workflows/26-run-experiencefrom
workflows/27-decisions-rework

Conversation

@Igloczek

@Igloczek Igloczek commented Oct 9, 2026 •

Copy link
Copy Markdown

Closes #27 · Parent spec #3 · Stack layer 3/5 (base: #31 workflows/26-run-experience)

Problem

The editor could only author agent sequences. Checks, typed decisions, bounded rework, and human gates were read-only, and the run view inferred which repeat route fired from its destination.

What this adds

  • Check, Decision, and Human gate authoring in the same editor, enabled only for kinds the backend advertises. The palette stays closed until capabilities load. Checks configure command, arguments, timeout, and next/unresolved routes; unsupported workspace and retry policies are shown as unavailable, not invented.
  • Typed decisions:
    • Ordered rule cards with typed field/operator/value/destination.
    • Match all / Match any with nested groups, and a visible first-match order.
    • A required Otherwise.
    • Fields come only from steps upstream of the decision and their declared report/check contracts.
    • "Reads as" explains the saved predicate, including absence semantics.
    • Backend depth and term bounds are respected, and problems are located at the exact condition (rules.N.when…).
  • Bounded rework:
    • Repeat a previous step needs Return to, Maximum repeats ("1 repeat (2 visits in total)"), and a separate At limit.
    • The flow, Route list, and run view say "↩ repeats back to X up to 1 time (first visit + 1 repeat = 2 visits), then At limit → Y".
    • Dangling targets, unbounded cycles, and a second repeat route to the same Return to are blocking, located errors.
  • Engine truthfulness:
    • The persisted trace now records which route fired and its repeat bound and outcome: admitted, limit, visit-limit, or automation-stopped.
    • A repeat counter is spent only when the repeat actually runs.
    • A single settleRoute drives both transition and allowedActions. Gates therefore offer only decisions the engine would admit as authored, and explain withheld ones (Run.withheld).
    • A crashed check without a retained result shows as unresolved, is never auto-replayed, and reruns only on explicit Retry.

Validation

  • Server (Bun):
    • WorkflowsDecisions.test.ts: check-driven repeat, At limit, and request-changes across restarts; nested first match and approve; whole-run bound; diverted repeats; gate offers at the visit limit; located validation.
    • Workflows, WorkflowsRun, WorkflowsValidation, and WorkflowsAuthoring tests pass.
    • The 6 known failures (WorkflowsMissingReportTime lostack-*, WorkflowsTimeout committed-crash) are pre-existing at the Run workflows with native threads, evidence, and recovery #26 base.
  • Plugin unit: graph.test.ts, editing.test.ts.
  • Web integration (Bun, real servers, authenticated session): WorkflowDecisions.integration.test.tsx authors the whole graph without dragging, saves the canonical predicate, starts the run, and checks repeat/At-limit route history, the crashed-check unresolved state, gate withholding, and Approve. WorkflowRun and WorkflowAuthoring still pass.
  • Typecheck, lint, and fmt are clean for touched packages.

Independent review

Three rounds by a separate Claude Opus 5.5 reviewer. MAJORs fixed:

  • diverted repeats spending counters
  • the shared repeat counter
  • a gate offering "Request changes" that the visit limit would divert

The reviewer also probed settleRoute against the previous settlement logic: 1,280 cases, 0 differences. Final verdict: APPROVED e6eb0546e09a3091df59dbc97f6e0c34b1be2e20.

Pending

  • Maintainer comprehension check (AC7): a person must identify "Repeat implementation once" and explain its At limit destination without coaching. This is pending with the maintainer, and the result will be recorded here.
  • UI evidence: the real-browser pass is pending because the T3 preview host was unavailable.

Limitations

  • Old runs show "Repeat N" without a limit, since the new trace fields are optional.
  • At the whole-run visit limit, a gate decision that would lead to an automated step is withheld (with an explanation) rather than redirected.
  • A decision source that runs only later inside the decision's own loop passes validation; it ends unresolved at runtime, with an honest message.

Implemented by Claude Opus 5.5 implementation agents and reviewed by an independent Claude Opus 5.5 agent (gilfoyle), orchestrated in Claude Code running in T3 Code.

🤖 Generated with Claude Code

@Igloczek
Igloczek added this pull request to stack #32 October 9, 2026 05:02
@Igloczek
Igloczek force-pushed the workflows/27-decisions-rework branch from e6eb054 to b0c5c71 Compare October 9, 2026 19:45
@Igloczek
Igloczek force-pushed the workflows/27-decisions-rework branch from b0c5c71 to 64e3ab3 Compare October 10, 2026 07:16
@Igloczek
Igloczek marked this pull request as ready for review October 10, 2026 13:07
Igloczek and others added 9 commits October 10, 2026 15:10
Adds the workflow plugin's library and single graph editor: target-bound
catalog paging/search with invalid-entry repair, Agent/End authoring with
a Route list and inspector, protected-value preserving canonical
read/save/export/import, structured validation problems, and bounded local
drafts with a navigation guard. Generic host facilities (page-link state,
draft storage, navigation guard, discovery/design interfaces) are verified
through the plugin fixture.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Distinct ID-collision conflicts with unused clone IDs, recoverable new
drafts listed in the library, cached skill discovery while authoring,
bounded draft storage, environment-keyed retained catalogs, redacted
search, validation-unavailable and missing-draft states, and lazy
workflow pages.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flush pending drafts on pagehide, label failed or unsupported plugin
catalogs instead of reconnecting forever, write drafts before evicting,
retry failed page chunks, and avoid clone IDs taken by invalid files.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tailwind's scanner does not expand a wildcard directory after ../, so the
plugin-* @source matched nothing and plugin-only utilities such as the
workflow editor's desktop grid were never generated. List each compiled
plugin package explicitly.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat unknown plugin support during reconnect as reconciling, explain a
missing page by connection state before blaming the client build, and
keep draft index writes within the same bounded eviction path.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer rejected the first editor after seeing it in a browser: the flow was a
numbered list padded with prose, and the pages did not look like part of T3 Code.

Workflow pages now use the host's page header, breadcrumb, card groups, menus and empty
states. Plugin navigation renders as native sidebar icon buttons and opens in the current
project. The editor shows the workflow as a React Flow graph (dagre layout) with labelled
route edges, repeat back edges and dashed At-limit edges, alongside compact Routes and
YAML views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lay the graph out only when its structure changes, match plugin navigation on route
params, keep project load errors retryable, and keep the editor title readable at
narrow widths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's no-outset-state-indicators rule rejects rings an ancestor can clip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Igloczek
Igloczek force-pushed the workflows/27-decisions-rework branch from 64e3ab3 to 9178960 Compare October 10, 2026 13:17
One handler object for every WS RPC exceeded TypeScript's instantiation
limit after the upstream sync, silently widening Ws.layer to any and
failing typecheck in server.ts. Build core and compiled plugin handlers
as separate layers over a merged group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Igloczek
Igloczek force-pushed the workflows/27-decisions-rework branch from 9178960 to 251a890 Compare October 10, 2026 18:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Igloczek
Igloczek force-pushed the workflows/27-decisions-rework branch from 251a890 to 49d0c26 Compare October 10, 2026 18:40
Igloczek and others added 6 commits October 11, 2026 02:49
Browser pass fixes: the graph fits on load and after edits, panels become
sheets below 1280px, the unsaved guard and new-workflow forms are dialogs,
schema errors land on their fields, steps can be removed from the
inspector, loops route around boxes, truncated labels get tooltips, and
problems name steps instead of ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n one step

Lanes follow definition order, selecting a group highlights only the
group, reviewer boxes carry their own problem counts, the parallel
subtitle fits, and breadcrumb focus rings get room around the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…overy

Start saved workflows from a run dialog, follow each run on the read-only workflow graph
with per-step state, taken routes and repeat counts, inspect each visit's thread, report,
check result and routing, act on human gates and recovery, and link owned threads back to
their run from the chat header. Rebuilt on the redesigned #25 editor and page chrome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show a step the run stopped at as stopped, light only the routes the recorded routing
took, use one visit count, mark steps outside the loaded history page, land View route
focus in the graph, and show full check output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ken edges

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in run views

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Igloczek and others added 2 commits October 11, 2026 11:20
…helper

Address #26 post-sync review: drop the stale publication doc comment and
replace three copy-pasted stream families with one typed helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Browser pass fixes: the library row and thread header open the start
dialog over the current page instead of navigating to Runs first, the
dialog keeps a stable height while a workflow loads, and run state badges
share one variant table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Igloczek and others added 5 commits October 11, 2026 11:21
Author check steps, ordered decision rules over typed report and check fields, and
Repeat a previous step routes with a maximum and an At limit destination. The graph draws
rule-labelled edges, compact repeat back-edges and dashed At limit edges. Runs record
which route was taken and show considered rules, repeat counts and withheld actions.
Rebuilt on the redesigned #25/#26 editor and run view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Badge routes the run visit limit diverted, keep the route time on one row
when there is no badge, let a small select shrink through a ui variant,
allow clearing a number operand, disambiguate field labels, and stop
calling failed capabilities loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion editing

Browser pass fixes: check fields fit the inspector and show unavailable
choices, empty checks drop the trailing separator, repeats read the same
everywhere, a decision cannot go to itself, nested groups keep their
parentheses, and every unreachable step is flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Author checks, typed decisions, and bounded rework

1 participant