Skip to content

feat(landlord): dynamic-workflow runtime (ultracode-style orchestration)#8

Merged
DizzyMii merged 22 commits into
mainfrom
feat/landlord-workflows
Jun 1, 2026
Merged

feat(landlord): dynamic-workflow runtime (ultracode-style orchestration)#8
DizzyMii merged 22 commits into
mainfrom
feat/landlord-workflows

Conversation

@DizzyMii

@DizzyMii DizzyMii commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

Ports Claude Code's "ultracode" / dynamic-workflow capability into @flint/landlord: a script-driven workflow runtime that injects the same hooks on top of Flint primitives, while keeping the existing auto-decompose orchestrate() API intact.

  • Two authoring paths sharing one engine: runWorkflowScript(source) (model-written JS strings, sandbox-compiled) and defineWorkflow({ meta, run }) (typed).
  • Hooks: agent / parallel (barrier) / pipeline (no-barrier, per-item) / phase / log / args / budget / workflow (one-level nesting).
  • Structured output: agent(prompt, { schema }) forces a validated structured_output tool (ajv + retry).
  • Caps: concurrency semaphore max(1, min(16, cpus-2)) + 1000-agent lifetime cap.
  • Resume / journaling: memoryJournalStore / fileJournalStore, resumeFromRunId replays the longest unchanged agent() prefix (multi-hop safe).
  • Determinism sandbox: Date / Math.random / process / require / fs / eval / Function blocked in string scripts, plus a this-based escape block.
  • agentType registry: built-ins default / Explore / code-reviewer, custom types, per-agent model override.
  • Isolation: workdirIsolation (default) + gitWorktreeIsolation (fallback outside a repo).
  • Model-facing parity: workflowTool + WORKFLOW_TOOL_GUIDE + orchestratorAgent so any agent() can author-and-run workflows.
  • orchestrate() rebuilt on the runtime — public API unchanged, existing suites pass as-is.
  • Docs: 6 new docs/landlord/ pages + a dynamic-workflow example, VitePress + README wiring, and a changeset.

Test Plan

  • pnpm -C packages/landlord test — 82/82 across 23 files
  • pnpm -C packages/landlord typecheck — clean
  • pnpm -C packages/landlord exec biome lint src test — 0 errors
  • pnpm -C packages/landlord build — emits dist/workflow/index.js + types
  • pnpm docs:build — succeeds, no broken links
  • Backward compat: orchestrate / tenant / decompose / validate / contract suites pass unchanged

DizzyMii and others added 22 commits May 31, 2026 15:19
Port Claude Code's ultracode / dynamic-workflow capability into
@flint/landlord: a script-driven workflow runtime injecting the same
hooks (agent/parallel/pipeline/phase/log/args/budget/workflow) on top of
Flint primitives. Runtime becomes the package core; orchestrate() is
rebuilt as a built-in auto-decompose workflow on top of it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 TDD tasks building the workflow runtime in @flint/landlord: errors/types,
concurrency caps, budget bridge, events, journal/resume, registries, isolation,
structured-output schema, the agent() hook, the workflow context, meta parser +
determinism sandbox, script/typed authoring, the run engine, workflowTool, the
backward-compatible orchestrate() rebuild, and docs/changeset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When resuming from a prior run, replayed journal entries are now
written into the current run's journal before returning, making each
run's journal self-contained and enabling chains of resume beyond two hops.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auto-fixed useLiteralKeys (bracket → dot notation), useTemplate (string
concat → template literal), and formatting across src/test. Manually
refactored skipWs and parseString in meta.ts to use local `pos` variable
instead of reassigning the `i` parameter (noParameterAssign). Dropped
unused `Result` type from the import in tool.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 6 new docs pages (workflow, hooks, resume, agent-types, isolation,
workflow-tool), a dynamic-workflow example, sidebar/nav updates, README
mention of the workflow runtime, and a minor changeset entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- workflow.md: bind `const files = args` in the script (files was undefined)
- hooks.md: pass workflow() args as the second argument, not a ref field

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DizzyMii DizzyMii merged commit 55d96c4 into main Jun 1, 2026
2 checks passed
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