Skip to content
This repository was archived by the owner on Sep 28, 2026. It is now read-only.

feat: dynamic-workflow golden test cases from real Grok/Claude orchestration shapes - #16

Merged
jnyross merged 3 commits into
mainfrom
feat/dynamic-workflow-testcases
Aug 9, 2026
Merged

jnyross merged 3 commits into
mainfrom
feat/dynamic-workflow-testcases

Conversation

@jnyross

@jnyross jnyross commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

What

Turns a curated set of real dynamic multi-agent workflow shapes — Grok Rhai orchestration (destination/hotel discovery funnels, fixed-lane research DAGs) and Claude-side patterns (disjoint worktree implementers, review-scorer panels) — into CodexGraph regression/golden test cases, so the skill is exercised against real user orchestration patterns, not only the Lisbon dogfood graph.

Catalog

docs/dynamic-workflow-testcase-catalog.md surveys 13 source workflows (topology shape only — goals in the pack are synthetic and anonymized), maps each to a CodexGraph tier, topology template, and the shipped skill contracts (#11 result normalization, #12 node-local worker prompt scoping, #13 read-first collection, #14 per-node environment + pending clientThreadId resolution), and prioritizes a shortlist of six first-class cases.

Test-case pack (skills/codex-graph/testcases/)

Six case bundles, each with GOAL.md (the free-form goal $codex-graph would receive), EXPECTATIONS.md (prose + one fenced machine-readable JSON contract), and topology.hint.mmd (passes graph_coherence.py):

Case Source shape Contracts
atomic-screen-fanout one atomic verdict agent per candidate; root-owned fail-open pool policy #12 #13
slice-generators-join per-region/archetype generators, one dedupe owner #11
sealed-pov-factcheck sealed decision packs + adversarial per-pack fact-check, fail-closed evidence #12 #13
nonbinding-synthesis-gate non-binding synthesis, human ranks; inverse of the Lisbon self-block defect #12 #13
adversarial-dual-validation blind dual validators, malformed verdicts fail closed, one root gate #13
disjoint-writers-worktree local discovery + disjoint worktree writers, root-owned publication #14 #13

Harness (offline, no live Desktop run)

  • testcases/harness/expectations.js + check_workflow.js CLI: static checks of a generated workflow.js against a case contract — per-node env (global-worktree regression), read-first/read-after-wait collection, item budget ≤ 20000, terminal/repair guards, pending-setup handling, over-scoped prompt tripwires.
  • testcases/harness/testcases.test.js: 15 tests — bundle/catalog integrity plus checker positive/negative coverage for each regression class.
  • task_collection_harness.test.js: +3 pattern-derived fixtures (terminal-at-first-read screen fan-out, screen-then-POV staged cardinality with root-owned fail-open, dual validators failing closed on malformed verdicts). 17/17 green.
  • Both regression runners (POSIX + Windows) now run the new suite and lint the topology hints.

Verification

sh scripts/run_regressions.sh fully green locally: validate_skill PASS, coherence selfcheck PASS, 17 + 15 node tests pass, all six hint diagrams coherent, auto-release tests OK.


Open in Devin Review

Note

Low Risk
Test-only and documentation changes with no production runtime or auth paths modified; risk is limited to CI maintenance if expectations are too brittle.

Overview
Adds offline golden regression for the codex-graph skill: six case bundles under skills/codex-graph/testcases/cases/ (synthetic GOAL.md, machine JSON in EXPECTATIONS.md, topology.hint.mmd), plus catalog.json, harness (expectations.js, check_workflow.js CLI, testcases.test.js), and docs/dynamic-workflow-testcase-catalog.md mapping real Grok/Claude orchestration shapes to contracts #11–#14.

The harness statically checks generated workflow.js (node IDs, Promise.allSettled, per-node env, read-first collection, budgets, terminalEmitted/repairUsed, pending clientThreadId resolution, forbidden prompt snippets). task_collection_harness.test.js gains three pattern fixtures (atomic screen fan-out, screen-then-POV, dual validators fail-closed). POSIX and Windows regression scripts now run the new Node suite and lint all case topology hints with graph_coherence.py.

Reviewed by Cursor Bugbot for commit bee0ade. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added seven dynamic-workflow golden test cases covering screening, generation, fact-checking, synthesis, validation, and isolated writing scenarios.
    • Added an offline checker to validate workflow structure, execution behavior, safeguards, and output constraints.
    • Added catalogs, case documentation, expectations, and visual workflow diagrams.
  • Tests

    • Expanded automated coverage for valid and invalid workflow configurations.
    • Added regression checks for testcase validation and graph coherence across supported platforms.

…tration shapes

Turn curated Grok Rhai workflows (destination/hotel discovery funnels,
fixed-lane research DAGs) and Claude multi-agent patterns (disjoint
worktree implementers, review-scorer panels) into a maintainable
codex-graph test-case pack:

- docs/dynamic-workflow-testcase-catalog.md: source survey, shape
  analysis, tier/contract mapping, prioritized shortlist
- skills/codex-graph/testcases/: catalog.json + six case bundles
  (GOAL.md, EXPECTATIONS.md with fenced machine contract,
  topology.hint.mmd passing graph_coherence.py)
- testcases/harness/: offline expectations loader + static workflow.js
  checker (per-node env #14, read-first collection #13, node-local
  prompt scoping #12, result normalization #11) with CLI and 15 tests
- task_collection_harness.test.js: three pattern-derived fixtures
  (atomic screen fan-out terminal-at-first-read, screen-then-POV
  staged cardinality with root-owned fail-open, adversarial dual
  validators failing closed on malformed verdicts)
- both regression runners execute the new suite and lint the hints

Goals are synthetic and anonymized; no live Desktop run required.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added seven cataloged dynamic-workflow test cases, six testcase bundles, an offline expectation checker, collection tests, topology-hint validation, documentation, and POSIX and Windows regression integration.

Changes

Dynamic workflow testcase suite

Layer / File(s) Summary
Catalog and testcase contracts
docs/dynamic-workflow-testcase-catalog.md, skills/codex-graph/testcases/..., skills/codex-graph/testcases/catalog.json
Documents workflow patterns and adds testcase goals, machine-readable expectations, and Mermaid topology hints for screening, generation, fact-checking, synthesis, validation, and isolated writers.
Offline expectation checker
skills/codex-graph/testcases/harness/...
Adds testcase loading, expectation parsing, static workflow validation, JSON CLI verdicts, and positive and negative tests for topology, environments, collection rules, budgets, repair, terminal guards, and prompt constraints.
Regression and collection coverage
skills/codex-graph/scripts/task_collection_harness.test.js, scripts/run_regressions.sh, scripts/run_windows_regressions.ps1, CHANGELOG.md
Adds collection tests for nested handoffs, survivor routing, fail-open screening, and fail-closed validator joins. Both regression runners execute the testcase harness and topology-hint checks.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RegressionRunner
  participant TestcaseHarness
  participant WorkflowFixture
  RegressionRunner->>TestcaseHarness: run testcase and topology checks
  TestcaseHarness->>WorkflowFixture: load case contract and workflow text
  WorkflowFixture-->>TestcaseHarness: expectations and generated workflow
  TestcaseHarness-->>RegressionRunner: pass or fail result
Loading

Possibly related PRs

  • jnyross/codex-graph#9: Adds the graph-coherence integration extended here with testcase topology-hint validation.
  • jnyross/codex-graph#10: Adds the POSIX regression runner extended here with testcase harness and graph-coherence checks.
  • jnyross/codex-graph#12: Relates to the validator checks for node-local prompt scope and root-only publication or gate responsibilities.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: dynamic-workflow golden test cases based on Grok and Claude orchestration patterns.
Description check ✅ Passed The description explains the changes, test coverage, validation results, and offline test execution, although it uses headings different from the template.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dynamic-workflow-testcases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
skills/codex-graph/testcases/README.md (1)

14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Specify a language for the layout code fence.

Line [14] opens a fenced block without a language. Use text for the directory tree so the MD040 check passes.

Proposed change
-```
+```text
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/README.md` at line 14, Update the fenced
directory-tree block in the README to specify the text language by changing its
opening fence to use text, while leaving the block contents unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md`:
- Around line 40-42: Add X1 to required_node_ids so the fail-closed terminal is
mandatory, and add V2 to env.local so the re-validation step is enforced as
local. Also include X1 in env.local if terminal nodes are environment-scoped;
leave R1 omitted only if the intentional root-local writable exception remains.

In
`@skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md`:
- Around line 59-64: Update the machine contract in EXPECTATIONS.md to require
"single_repair": true alongside the existing topology expectations, and add a
negative fixture that removes the repairUsed guard so the checker rejects
workflows lacking that guard.

In
`@skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md`:
- Around line 42-46: Update the expectations contract to include X1 in
required_node_ids and add R1 and V2 to env.local, preserving the existing V1A
and V1B entries. If X1 is not an actual node and only labels the topology
diagram, remove X1 from the topology instead.

In `@skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd`:
- Line 4: Update the topology labels around N2A–N2C to identify them as
representative generators, and revise the wording so it does not imply only
three slices named A, B, and N; reflect that the fixed input contains six region
slices and four archetype slices.

In `@skills/codex-graph/testcases/catalog.json`:
- Line 16: Align the contract metadata for atomic-screen-fanout and
adversarial-dual-validation across skills/codex-graph/testcases/catalog.json
lines 16 and 68, docs/dynamic-workflow-testcase-catalog.md lines 67-71,
skills/codex-graph/testcases/README.md lines 49-53, and both EXPECTATIONS.md
files at the specified ranges; consistently add `#11/`#12 where required by the
case expectations or remove those claims everywhere. Add a consistency assertion
in skills/codex-graph/testcases/harness/testcases.test.js that fails CI when
catalog, documentation, indexes, and machine-readable expectations drift.

In `@skills/codex-graph/testcases/harness/expectations.js`:
- Around line 136-165: Update the environment validation around expectations.env
to inspect each declared node’s actual environment binding rather than only
aggregate localCount and worktreeCount. Require every env.local node to use a
local environment, every env.worktree node to use a worktree environment, and
reject mismatches such as writers using local or discovery nodes using worktree;
add negative fixtures covering both swapped bindings.

In `@skills/codex-graph/testcases/README.md`:
- Around line 73-77: Update checkWorkflowText so read_after_wait validates that
every wait-thread call is followed by a read-thread call, not just the first
wait. Add a negative fixture containing two waits with no read after the second,
and update the catalog expectations accordingly. In
skills/codex-graph/testcases/README.md:73-77 and
docs/dynamic-workflow-testcase-catalog.md:60-63, document the every-wait
requirement; update
skills/codex-graph/testcases/cases/atomic-screen-fanout/EXPECTATIONS.md:25-26
and
skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md:28-29
to match the existing case expectations.

---

Nitpick comments:
In `@skills/codex-graph/testcases/README.md`:
- Line 14: Update the fenced directory-tree block in the README to specify the
text language by changing its opening fence to use text, while leaving the block
contents unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 74741a98-c8c1-4d42-8f47-133f6ea9db72

📥 Commits

Reviewing files that changed from the base of the PR and between a3fce5d and 4d0c48b.

📒 Files selected for processing (28)
  • CHANGELOG.md
  • docs/dynamic-workflow-testcase-catalog.md
  • scripts/run_regressions.sh
  • scripts/run_windows_regressions.ps1
  • skills/codex-graph/scripts/task_collection_harness.test.js
  • skills/codex-graph/testcases/README.md
  • skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/adversarial-dual-validation/GOAL.md
  • skills/codex-graph/testcases/cases/adversarial-dual-validation/topology.hint.mmd
  • skills/codex-graph/testcases/cases/atomic-screen-fanout/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/atomic-screen-fanout/GOAL.md
  • skills/codex-graph/testcases/cases/atomic-screen-fanout/topology.hint.mmd
  • skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/disjoint-writers-worktree/GOAL.md
  • skills/codex-graph/testcases/cases/disjoint-writers-worktree/topology.hint.mmd
  • skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/GOAL.md
  • skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/topology.hint.mmd
  • skills/codex-graph/testcases/cases/sealed-pov-factcheck/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/sealed-pov-factcheck/GOAL.md
  • skills/codex-graph/testcases/cases/sealed-pov-factcheck/topology.hint.mmd
  • skills/codex-graph/testcases/cases/slice-generators-join/EXPECTATIONS.md
  • skills/codex-graph/testcases/cases/slice-generators-join/GOAL.md
  • skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd
  • skills/codex-graph/testcases/catalog.json
  • skills/codex-graph/testcases/harness/check_workflow.js
  • skills/codex-graph/testcases/harness/expectations.js
  • skills/codex-graph/testcases/harness/testcases.test.js

Comment on lines +40 to +42
"required_node_ids": ["N1", "N2", "V1A", "V1B", "G1", "R1", "V2", "T1"],
"parallel_groups": [["V1A", "V1B"]],
"env": { "local": ["N1", "N2", "V1A", "V1B", "G1", "T1"], "worktree": [] },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Declare the failure terminal and re-validation environment.

X1 is the fail terminal in the design and topology, but required_node_ids lists only T1. V2 is a validator, but env.local omits it. The required-node check in skills/codex-graph/testcases/harness/testcases.test.js only validates IDs listed in required_node_ids, so the generated workflow can omit the fail-closed terminal. The environment check also cannot enforce local scope for an omitted node.

Add X1 to required_node_ids and add V2 to env.local. Add X1 to env.local if terminal nodes are environment-scoped. Keep R1 omitted only if the root-local writable exception is intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md`
around lines 40 - 42, Add X1 to required_node_ids so the fail-closed terminal is
mandatory, and add V2 to env.local so the re-validation step is enforced as
local. Also include X1 in env.local if terminal nodes are environment-scoped;
leave R1 omitted only if the intentional root-local writable exception remains.

Comment on lines +59 to +64
"pending_setup_resolution": true,
"terminal_guard": true,
"required_snippets": ["allSettled"],
"forbidden_snippets": [
"apply worktree to every node"
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add the repair guard to the machine contract.

topology.hint.mmd Lines 12-15 defines one repair branch. This contract omits "single_repair": true. The checker can therefore accept a workflow that omits the repairUsed guard. Add the flag and a negative fixture that removes the guard.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md`
around lines 59 - 64, Update the machine contract in EXPECTATIONS.md to require
"single_repair": true alongside the existing topology expectations, and add a
negative fixture that removes the repairUsed guard so the checker rejects
workflows lacking that guard.

Comment on lines +42 to +46
"required_node_ids": ["N1", "N2A", "N2B", "N2C", "N3", "V1A", "V1B", "G1", "R1", "V2", "T1"],
"parallel_groups": [["N2A", "N2B", "N2C"], ["V1A", "V1B"]],
"env": {
"local": ["N1", "N2A", "N2B", "N2C", "N3", "V1A", "V1B", "G1", "T1"],
"worktree": []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- expectation file ---'
sed -n '1,220p' skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md
printf '%s\n' '--- harness checker ---'
sed -n '80,190p' skills/codex-graph/testcases/harness/expectations.js
printf '%s\n' '--- related testcase files ---'
find skills/codex-graph/testcases/cases/nonbinding-synthesis-gate -maxdepth 2 -type f -print
printf '%s\n' '--- topology/node references ---'
rg -n -C 3 'X1|V1A|V1B|R1|V2|required_node_ids|parallel_groups|env' skills/codex-graph/testcases/cases/nonbinding-synthesis-gate skills/codex-graph/testcases/harness

Repository: jnyross/codex-graph

Length of output: 20965


🏁 Script executed:

#!/bin/bash
set -eu
sed -n '1,220p' skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md
sed -n '80,190p' skills/codex-graph/testcases/harness/expectations.js

Repository: jnyross/codex-graph

Length of output: 6382


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- files ---'
find skills/codex-graph/testcases/cases/nonbinding-synthesis-gate -maxdepth 2 -type f -print
printf '%s\n' '--- expectations ---'
cat -n skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md
printf '%s\n' '--- checker ---'
cat -n skills/codex-graph/testcases/harness/expectations.js | sed -n '90,180p'
printf '%s\n' '--- references ---'
rg -n -C 4 'X1|V1A|V1B|R1|V2|required_node_ids|parallel_groups|env' skills/codex-graph/testcases/cases/nonbinding-synthesis-gate skills/codex-graph/testcases/harness

Repository: jnyross/codex-graph

Length of output: 23140


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import json, re

p = Path("skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md")
text = p.read_text()
print("EXPECTATIONS_LINES")
for i, line in enumerate(text.splitlines(), 1):
    if 1 <= i <= 120:
        print(f"{i}: {line}")

# Extract the first JSON object in the markdown and compare its declared sets.
m = re.search(r"\{.*\}", text, re.S)
if not m:
    raise SystemExit("No JSON object found")
data = json.loads(m.group(0))
required = set(data.get("required_node_ids", []))
local = set(data.get("env", {}).get("local", []))
print("required_node_ids=", sorted(required))
print("env.local=", sorted(local))
print("required_not_local=", sorted(required - local))

# Inspect all textual node IDs in the expectation document.
node_ids = sorted(set(re.findall(r"\b(?:N\d+[A-Z]?|V\d+[A-Z]?|G\d+|R\d+|T\d+|X\d+)\b", text)))
print("node_ids_in_document=", node_ids)
print("document_nodes_not_required=", sorted(set(node_ids) - required))
PY
printf '%s\n' 'EXPECTATIONS_CHECKER'
cat -n skills/codex-graph/testcases/harness/expectations.js | sed -n '90,180p'

Repository: jnyross/codex-graph

Length of output: 6890


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import json, re

root = Path("skills/codex-graph/testcases/cases")
for p in root.glob("*/EXPECTATIONS.md"):
    text = p.read_text()
    m = re.search(r"\{.*\}", text, re.S)
    if not m:
        continue
    try:
        d = json.loads(m.group(0))
    except Exception:
        continue
    ids = d.get("required_node_ids", [])
    if any(i.startswith("X") for i in ids) or "X1" in text:
        print(p)
        print("required_node_ids:", ids)
        print("env.local:", d.get("env", {}).get("local", []))
        print("env.worktree:", d.get("env", {}).get("worktree", []))
PY
printf '%s\n' '--- topology ---'
cat -n skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/topology.hint.mmd
printf '%s\n' '--- contract validation tests ---'
sed -n '70,115p' skills/codex-graph/testcases/harness/testcases.test.js

Repository: jnyross/codex-graph

Length of output: 2706


Synchronize the machine contract with the topology.

Add X1 to required_node_ids and add R1 and V2 to env.local. V1A and V1B are already listed in env.local. The checker validates only that some local environment exists, so it does not detect these per-node omissions. If X1 is only a diagram label, remove it from the topology.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.md`
around lines 42 - 46, Update the expectations contract to include X1 in
required_node_ids and add R1 and V2 to env.local, preserving the existing V1A
and V1B entries. If X1 is not an actual node and only labels the topology
diagram, remove X1 from the topology instead.

flowchart TD
N1[Freeze slices quotas and seed list] --> N2A[Generate candidates for slice A]
N1 --> N2B[Generate candidates for slice B]
N1 --> N2C[Generate candidates for slice N]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

rg -n -C 4 'N2C|slice [A-Z]|Generate candidates for slice' skills/codex-graph/testcases/cases/slice-generators-join
printf '\n--- files ---\n'
git ls-files 'skills/codex-graph/testcases/cases/slice-generators-join'

Repository: jnyross/codex-graph

Length of output: 3868


🏁 Script executed:

sed -n '1,160p' skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd
printf '\n--- related topology hints ---\n'
rg -n -C 3 'Generate candidates|slice [A-Z]|topology' skills/codex-graph/testcases/cases -g '*.hint.mmd' | head -240

Repository: jnyross/codex-graph

Length of output: 1356


🏁 Script executed:

#!/bin/bash
set -eu
file='skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd'
printf '%s\n' '--- topology.hint.mmd ---'
cat -n "$file"
printf '%s\n' '--- case files and slice references ---'
git ls-files 'skills/codex-graph/testcases/cases/slice-generators-join' | while IFS= read -r f; do
  printf '\n### %s\n' "$f"
  rg -n -C 2 'slice|Slice|N2C|Generate candidates|join' "$f" || true
done
printf '%s\n' '--- repository-wide matching labels ---'
rg -n -C 2 'Generate candidates for slice (A|B|N|C|D)|slice (A|B|N)' skills/codex-graph/testcases -g '*.mmd' -g '*.json' -g '*.yaml' -g '*.yml' -g '*.txt' || true

Repository: jnyross/codex-graph

Length of output: 4305


🏁 Script executed:

cat -n skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd
find skills/codex-graph/testcases/cases/slice-generators-join -maxdepth 1 -type f -print

Repository: jnyross/codex-graph

Length of output: 768


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
p = Path("skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd")
print(p.read_text())
for q in sorted(p.parent.iterdir()):
    if q.is_file():
        print(f"\n--- {q.name} ---")
        text = q.read_text(errors="replace")
        for i, line in enumerate(text.splitlines(), 1):
            if any(term in line.lower() for term in ("slice", "candidate", "join", "topology")):
                print(f"{i}: {line}")
PY

Repository: jnyross/codex-graph

Length of output: 1945


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- GOAL.md ---'
cat -n skills/codex-graph/testcases/cases/slice-generators-join/GOAL.md
printf '%s\n' '--- EXPECTATIONS.md design section ---'
sed -n '1,25p' skills/codex-graph/testcases/cases/slice-generators-join/EXPECTATIONS.md

Repository: jnyross/codex-graph

Length of output: 2879


Label N2A–N2C as representative generators. The fixed input has six region slices and four archetype slices, not three slices named A, B, and N.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmd`
at line 4, Update the topology labels around N2A–N2C to identify them as
representative generators, and revise the wording so it does not imply only
three slices named A, B, and N; reflect that the fixed input contains six region
slices and four archetype slices.

Comment on lines +136 to +165
const env = expectations.env;
if (env) {
const localCount = (scriptText.match(LOCAL_ENV_RE) ?? []).length;
const worktreeCount = (scriptText.match(WORKTREE_ENV_RE) ?? []).length;
if ((env.worktree ?? []).length === 0) {
add(
"env:no-worktree",
worktreeCount === 0,
worktreeCount === 0
? "read-only graph creates no worktree environments"
: `read-only graph creates ${worktreeCount} worktree environment(s)`,
);
} else {
add(
"env:worktree-writers",
worktreeCount > 0,
worktreeCount > 0
? "writer nodes use worktree environments"
: "writers declared but no worktree environment created",
);
}
if ((env.local ?? []).length > 0) {
add(
"env:local-nodes",
localCount > 0,
localCount > 0
? "local environments present"
: "local nodes declared but no local environment created (global-worktree regression, #14)",
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Bind each environment check to its required node.

Lines 138-165 only count local and worktree declarations. A script passes when W1 and W2 use local environments, as long as one unrelated worktree declaration exists. It can also pass when discovery nodes use worktrees. This does not enforce the #14 per-node contract.

Check each declared node's environment binding. Add negative fixtures that swap a writer to local and a discovery node to worktree.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/harness/expectations.js` around lines 136 - 165,
Update the environment validation around expectations.env to inspect each
declared node’s actual environment binding rather than only aggregate localCount
and worktreeCount. Require every env.local node to use a local environment,
every env.worktree node to use a worktree environment, and reject mismatches
such as writers using local or discovery nodes using worktree; add negative
fixtures covering both swapped bindings.

Comment thread skills/codex-graph/testcases/README.md Resolved
- collection:read-first / read-after-wait judge await-adjacent call
  sites only; parameter lists, bindings, and comments can no longer
  flip the verdict (v3 param-swap now fails; wrapper-based correct
  collectors are no longer false-failed)
- setup:pending-resolution requires bounded-resolution evidence
  (attempts constant or task-list poll) alongside the clientThreadId
  identifier; mentions-only scripts fail
- checkWorkflowText refuses vacuous ok on an empty contract
- atomic-screen-fanout goal genericized (composition/origin/month)
- disjoint-writers-worktree contract declares its drawn repair path
  (single_repair, R1, V2)
- four new negative/positive controls in testcases.test.js; README
  semantics updated to match the strengthened checks
cursor[bot]

This comment was marked as resolved.

Await-adjacent matching correctly skips wrapper collectors, but treated
scripts with no read/wait bindings the same way and green-lit #13.
Require tool bindings when there are no await-adjacent call sites.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md`:
- Line 48: Update the env machine-contract assignments to include environment
mappings for nodes R1 and V2, using the topology’s intended environments, before
retaining them in required_node_ids.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f76743e-a93d-48fa-9f5b-de8d6f68147c

📥 Commits

Reviewing files that changed from the base of the PR and between 4d0c48b and 6cd132c.

📒 Files selected for processing (5)
  • skills/codex-graph/testcases/README.md
  • skills/codex-graph/testcases/cases/atomic-screen-fanout/GOAL.md
  • skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md
  • skills/codex-graph/testcases/harness/expectations.js
  • skills/codex-graph/testcases/harness/testcases.test.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/codex-graph/testcases/cases/atomic-screen-fanout/GOAL.md
  • skills/codex-graph/testcases/harness/expectations.js

"case_id": "disjoint-writers-worktree",
"task_family": "feature or refactor",
"baseline_tier": "L2",
"required_node_ids": ["N1", "D1", "D2", "W1", "W2", "V1", "G1", "R1", "V2", "T1"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

case_dir='skills/codex-graph/testcases/cases/disjoint-writers-worktree'

rg -n -C 3 '\b(R1|V2)\b' \
  "$case_dir" \
  'skills/codex-graph/testcases/catalog.json' \
  'docs/dynamic-workflow-testcase-catalog.md' || true

Repository: jnyross/codex-graph

Length of output: 1864


🏁 Script executed:

#!/bin/bash
set -euo pipefail

case_dir='skills/codex-graph/testcases/cases/disjoint-writers-worktree'

printf '%s\n' '--- EXPECTATIONS.md ---'
cat -n "$case_dir/EXPECTATIONS.md"

printf '%s\n' '--- topology.hint.mmd ---'
cat -n "$case_dir/topology.hint.mmd"

printf '%s\n' '--- case files ---'
git ls-files "$case_dir"

Repository: jnyross/codex-graph

Length of output: 4381


Add R1 and V2 to the machine contract.

The topology defines both nodes, but env does not assign either node to an environment. Add the appropriate assignments before listing them in required_node_ids.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.md`
at line 48, Update the env machine-contract assignments to include environment
mappings for nodes R1 and V2, using the topology’s intended environments, before
retaining them in required_node_ids.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines +181 to +184
const bindsCollectionTools =
/read_?[Tt]hread|readTask|read_task|wait_?[Tt]hread|waitTask|wait_task/.test(
scriptText,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Workflow checker approves scripts that never read results, the very failure it exists to catch

A generated script that only mentions a waiting tool and never a reading one is still treated as acceptable (bindsCollectionTools at skills/codex-graph/testcases/harness/expectations.js:181-184), so a wait-only workflow passes the read-first and read-after-wait checks instead of failing.

Impact: The regression check meant to catch "never reads the worker's answer" workflows silently approves them when the tool calls sit inside helper functions.

Why the wrapper escape hatch is too wide

bindsCollectionTools matches ANY of the read or wait tool names. When a script wraps its tool calls in helpers (e.g. async function waitFor(h){ return waitThreads.call(...) } and only await waitFor(h) at the call site), both firstRead and firstWait are -1, so both collection:read-first (skills/codex-graph/testcases/harness/expectations.js:186-192) and collection:read-after-wait (skills/codex-graph/testcases/harness/expectations.js:209-216) resolve to ok = bindsCollectionTools = true — even though the script contains no read at all, because the wait binding alone satisfies the regex. The intent (comment at lines 176-178, README lines 76-82) is that only genuinely wrapper-based collectors go unjudged; requiring a read-tool binding (read_?[Tt]hread|readTask|read_task) rather than any collection binding restores the tripwire.

Suggested change
const bindsCollectionTools =
/read_?[Tt]hread|readTask|read_task|wait_?[Tt]hread|waitTask|wait_task/.test(
scriptText,
);
const bindsCollectionTools =
/read_?[Tt]hread|readTask|read_task/.test(scriptText) &&
/wait_?[Tt]hread|waitTask|wait_task/.test(scriptText);
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

"baseline_tier": "L3",
"required_node_ids": ["N1", "N2", "V1A", "V1B", "G1", "R1", "V2", "T1"],
"parallel_groups": [["V1A", "V1B"]],
"env": { "local": ["N1", "N2", "V1A", "V1B", "G1", "T1"], "worktree": [] },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Review test case rejects a design its own written rules call acceptable

The dual-validation case declares an empty list of isolated working copies ("worktree": [] at skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md:42), which the checker reads as "none allowed anywhere", so the explicitly permitted variant that gives the revision step its own isolated copy is scored as a failure.

Impact: A workflow the case text describes as conforming is reported as broken by the automated check.

Contract vs. checker semantics

The prose at skills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.md:14-18 states that R1 may need a writable environment and that "the machine contract below pins only the read-only lanes". But checkWorkflowText treats an empty env.worktree list as a hard prohibition: skills/codex-graph/testcases/harness/expectations.js:142-149 adds env:no-worktree with ok = worktreeCount === 0 whenever the list is empty. There is no "unspecified" encoding, so any script that provisions a worktree for R1 fails the case. Either drop env from this case's contract, list R1 under worktree, or add an explicit way to express "unconstrained" in the checker.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@jnyross
jnyross merged commit c27a4d4 into main Aug 9, 2026
4 checks passed
@jnyross
jnyross deleted the feat/dynamic-workflow-testcases branch August 9, 2026 20:13
jnyross added a commit that referenced this pull request Aug 9, 2026
PRs #14 and #16 added manual Unreleased bullets; the release workflow
prepended [0.4.5] and [0.5.0] for the same changes without folding them
in. The changelog is generated from commit subjects at release time, so
the manual section is pure duplication.
jnyross added a commit that referenced this pull request Aug 9, 2026
Follow-ups from PR #16 delta verification:

- read-after-wait no longer false-fails mixed wrapper collectors:
  helper names bound to exactly one tool (function-like binding or a
  declared function whose bounded body window references the tool)
  resolve as call sites for that tool; ambiguous helpers touching both
  tools vote for neither. frozen-lisbon-v4's genuine read->wait->read
  (wrapped reads, direct wait) now passes; frozen-lisbon-v3 and its
  param-swapped variant still fail read-first.
- declaring collection expectations now requires at least one resolved
  call site (collection:call-sites); a comment-only stub that
  textually satisfies every marker fails with a distinct reason
  instead of sailing through the ordering carve-out.
- helper classification guards: result assignments (const readResult =
  await readThread.call) are not helpers; function body windows cut at
  the next top-level declaration to prevent neighbour bleed.
- three new mutation tests (mixed-wrapper pass, wait-first mixed fail,
  call-free stub fail); README semantics updated; CHANGELOG bullet.
jnyross added a commit that referenced this pull request Aug 9, 2026
PRs #14, #16, #17, #18, and #20 added manual Unreleased bullets; the
release workflow prepended [0.4.5] through [0.5.4] for the same changes
without folding them in. The changelog is generated from commit subjects
at release time, so the manual section is pure duplication. Also
document the convention in the README versioning section so it stops
recurring.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants