Skip to content

Graph-engineering upgrades: model tiering, budget hard-stops, workflow diagrams - #12

Merged
dominno merged 3 commits into
mainfrom
claude/graph-tiering
Jul 24, 2026
Merged

dominno merged 3 commits into
mainfrom
claude/graph-tiering

Conversation

@dominno

@dominno dominno commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Distills the actionable parts of a "graph engineering" writeup (Slate / Random Labs) into our existing Workflow runtime — which already is a graph runtime (nodes = agents, edges = data hand-offs, parallel/pipeline, scoped failure). Three real gaps were closed, then the change was run through our own /improve-skills gate, which caught a security regression that is fixed here too.

What changed

Model tiering (all 6 workflows)

  • High-volume fan-out nodes (critics, per-story evidence, per-dimension gaps, per-category E2E cases, meta-critics) → model: 'sonnet'.
  • High-stakes gates/judgment (adversarial verifiers, status verifier, synthesis) → model: 'opus'.
  • Tiers are FANOUT_MODEL/JUDGE_MODEL constants, overridable via args.models = { fanout, judge }.
  • Deliberate exception: the loop-iteration implementer writes real code, so it inherits the session model rather than being silently downgraded.

Budget as a hard stop (soft + hard control)

  • Guarded on budget.total (null ⇒ no cap, so no accidental Infinity loop).
  • improve-skills skips the verify fan-out below a token floor and routes findings to needsDesign (unverified ⇒ never auto-applied).
  • loop-iteration escalates all items below its floor instead of failing mid-fix.
  • Fail-safe direction preserved: a budget stop never approves unverified work.

Diagram-first

  • New docs/workflow-graphs.md: a Mermaid node/edge graph for every workflow, annotated with the per-node model tier — the "see the graph before you run it" view, version-controlled next to the scripts.

Gate findings applied (from /improve-skills run on this diff — 1 blocker + 7 important)

  • BLOCKER — loop-iteration denylist bypass: the deterministic gate trusted the implementer's self-reported changedFiles, but the caller applies the real diff. An under-reported file list touching a denylisted path (.claude/, .env) could slip past. Now parses paths from the actual diff (parseDiffPaths) and gates on the union of diff-paths + changedFiles. Unit-tested: a diff editing .claude/loop.md while changedFiles omits it now escalates.
  • Ported the JSON-string args normalization to the other 5 workflows (was only in improve-skills), rewiring every args.X read to the normalized a so the args.models override no longer silently no-ops.
  • workflow-dsl lens now also checks model-tiering + budget-guard fail-safety; consistency-dry lens and /dream lint now check docs/workflow-graphs.md for drift vs the scripts; added the diagram to improve-skills DEFAULT_TARGETS (the drift check was documented but not wired).
  • improve-skills.md now documents the budgetStop return field and instructs disclosing a skipped-verification run.

Nice-to-haves

  • Fan-out agent labels now include the map index (${key}-${i}) for consistency with the project's own DSL rule.
  • Diagram note that uiInScope:false drops the 5 UI critics.
  • skills-index.md documents the args.models override once.

Memory wiki

  • Filed the tiering, soft/hard-budget, diagram-drift, and "a deterministic gate is only as trustworthy as the input it reads — derive checked paths from the applied artifact (the diff), not a self-report" conventions in topics/workflow.md + log.md.

Not adopted (out of scope)

The post's quant/hedge-fund framing and the standalone Slate runtime — we already have the graph runtime, and the trading claims overstate what orchestration solves (data quality, transaction costs, and overfitting remain the hard part).

Verification

  • All six workflow scripts validated (node --check wrapped in the async-function harness).
  • The denylist-union blocker fix has a unit test (attack case escalates; clean case passes).
  • The change was dogfooded through /improve-skills on the new tiering itself (21 agents, Sonnet fan-out + Opus verify), and every confirmed finding is fixed in this branch.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 3 commits July 23, 2026 19:47
Distilled the actionable parts of a "graph engineering" writeup (our Workflow
tool already is a graph runtime) into three concrete improvements:

- Model tiering across all 6 workflows: high-volume fan-out nodes (critics,
  per-story evidence, per-dimension gaps, per-category E2E cases, meta-critics)
  run model:'sonnet'; the high-stakes gates/judgment (adversarial verifiers,
  status verifier, synthesis) run model:'opus'. Tiers are FANOUT_MODEL/
  JUDGE_MODEL constants overridable via args.models. The loop-iteration
  implementer is the deliberate exception — it writes real code, so it inherits
  the session model rather than being silently downgraded.
- Budget as a hard stop for the expensive fan-outs, guarded on budget.total
  (null => no cap): improve-skills skips the verify phase below a token floor
  and routes findings to needsDesign (unverified, never auto-applied);
  loop-iteration escalates all items below its floor instead of failing
  mid-fix. Fail-safe direction preserved — a budget stop never approves
  unverified work.
- docs/workflow-graphs.md: Mermaid node/edge diagram for every workflow with
  the per-node model tier (the "see the graph before you run" view).

Filed the tiering, soft/hard-budget, and diagram-drift conventions in the
memory wiki. Syntax validated for all six scripts.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
… drift checks

Ran /improve-skills over the graph-engineering diff (on the new tiering itself);
it confirmed 1 blocker + 7 important. Applied all:

- BLOCKER (loop-iteration): the deterministic denylist gate trusted the
  implementer's self-reported changedFiles, but the caller applies the real
  diff. An under-reported file list touching a denylisted path (.claude/, .env)
  could bypass the gate. Now parse paths from the actual diff (parseDiffPaths)
  and gate on the UNION of diff-paths + changedFiles. Unit-tested: a diff that
  edits .claude/loop.md while changedFiles omits it now escalates. Same
  "give the checker the real artifact, not the self-report" rule — it applies
  to the deterministic gate, not just the LLM verifier.
- Ported the JSON-string args normalization (previously only in improve-skills)
  to critic-panel, gap-analysis, e2e-design, scan-docs, loop-iteration, rewiring
  every args.X read to the normalized `a` so the args.models tiering override
  no longer silently no-ops when args arrive as a JSON string.
- workflow-dsl lens now also checks model-tiering + budget-guard fail-safety;
  consistency-dry lens and /dream lint now check docs/workflow-graphs.md for
  drift vs the scripts; added docs/workflow-graphs.md to DEFAULT_TARGETS (the
  drift check was documented but not wired).
- improve-skills.md now documents budgetStop and instructs disclosing a
  skipped-verification run (needsDesign items are UNVERIFIED, not design-pending).

All six workflow scripts validated; the denylist union fix unit-tested.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
Low-severity polish confirmed (recorded) by the /improve-skills gate:

- Fan-out agent labels now include the map index for consistency with the
  project's own documented DSL rule ("always include the map index"): critic:,
  meta:, gap:, e2e: labels switch from ${key} to ${key}-${i} in critic-panel,
  improve-skills, gap-analysis, e2e-design. Harmless today (keys are unique),
  but aligns every fan-out with the Verify-phase pattern in the same files.
- docs/workflow-graphs.md: note under the critic-panel diagram that
  uiInScope:false drops the 5 UI-facing critics (the 10-node graph is the
  default/full case).
- skills-index.md: document the args.models = { fanout, judge } tiering
  override once, in the shared workflows note, so it's discoverable without
  reading the .js source.

Syntax validated for all six scripts.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
@dominno
dominno merged commit 9ffdb11 into main Jul 24, 2026
5 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.

2 participants