Repository navigation
feat: dynamic-workflow golden test cases from real Grok/Claude orchestration shapes - #16
Conversation
…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.
📝 WalkthroughWalkthroughAdded 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. ChangesDynamic workflow testcase suite
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
skills/codex-graph/testcases/README.md (1)
14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSpecify a language for the layout code fence.
Line [14] opens a fenced block without a language. Use
textfor 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
📒 Files selected for processing (28)
CHANGELOG.mddocs/dynamic-workflow-testcase-catalog.mdscripts/run_regressions.shscripts/run_windows_regressions.ps1skills/codex-graph/scripts/task_collection_harness.test.jsskills/codex-graph/testcases/README.mdskills/codex-graph/testcases/cases/adversarial-dual-validation/EXPECTATIONS.mdskills/codex-graph/testcases/cases/adversarial-dual-validation/GOAL.mdskills/codex-graph/testcases/cases/adversarial-dual-validation/topology.hint.mmdskills/codex-graph/testcases/cases/atomic-screen-fanout/EXPECTATIONS.mdskills/codex-graph/testcases/cases/atomic-screen-fanout/GOAL.mdskills/codex-graph/testcases/cases/atomic-screen-fanout/topology.hint.mmdskills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.mdskills/codex-graph/testcases/cases/disjoint-writers-worktree/GOAL.mdskills/codex-graph/testcases/cases/disjoint-writers-worktree/topology.hint.mmdskills/codex-graph/testcases/cases/nonbinding-synthesis-gate/EXPECTATIONS.mdskills/codex-graph/testcases/cases/nonbinding-synthesis-gate/GOAL.mdskills/codex-graph/testcases/cases/nonbinding-synthesis-gate/topology.hint.mmdskills/codex-graph/testcases/cases/sealed-pov-factcheck/EXPECTATIONS.mdskills/codex-graph/testcases/cases/sealed-pov-factcheck/GOAL.mdskills/codex-graph/testcases/cases/sealed-pov-factcheck/topology.hint.mmdskills/codex-graph/testcases/cases/slice-generators-join/EXPECTATIONS.mdskills/codex-graph/testcases/cases/slice-generators-join/GOAL.mdskills/codex-graph/testcases/cases/slice-generators-join/topology.hint.mmdskills/codex-graph/testcases/catalog.jsonskills/codex-graph/testcases/harness/check_workflow.jsskills/codex-graph/testcases/harness/expectations.jsskills/codex-graph/testcases/harness/testcases.test.js
| "required_node_ids": ["N1", "N2", "V1A", "V1B", "G1", "R1", "V2", "T1"], | ||
| "parallel_groups": [["V1A", "V1B"]], | ||
| "env": { "local": ["N1", "N2", "V1A", "V1B", "G1", "T1"], "worktree": [] }, |
There was a problem hiding this comment.
🗄️ 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.
| "pending_setup_resolution": true, | ||
| "terminal_guard": true, | ||
| "required_snippets": ["allSettled"], | ||
| "forbidden_snippets": [ | ||
| "apply worktree to every node" | ||
| ] |
There was a problem hiding this comment.
🎯 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.
| "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": [] |
There was a problem hiding this comment.
🗄️ 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/harnessRepository: 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.jsRepository: 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/harnessRepository: 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.jsRepository: 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] |
There was a problem hiding this comment.
📐 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 -240Repository: 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' || trueRepository: 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 -printRepository: 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}")
PYRepository: 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.mdRepository: 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.
| 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)", | ||
| ); | ||
| } |
There was a problem hiding this comment.
🎯 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.
- 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
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
skills/codex-graph/testcases/README.mdskills/codex-graph/testcases/cases/atomic-screen-fanout/GOAL.mdskills/codex-graph/testcases/cases/disjoint-writers-worktree/EXPECTATIONS.mdskills/codex-graph/testcases/harness/expectations.jsskills/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"], |
There was a problem hiding this comment.
🗄️ 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' || trueRepository: 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.
| const bindsCollectionTools = | ||
| /read_?[Tt]hread|readTask|read_task|wait_?[Tt]hread|waitTask|wait_task/.test( | ||
| scriptText, | ||
| ); |
There was a problem hiding this comment.
🟡 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.
| 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); |
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": [] }, |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
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.
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.mdsurveys 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), andtopology.hint.mmd(passesgraph_coherence.py):Harness (offline, no live Desktop run)
testcases/harness/expectations.js+check_workflow.jsCLI: static checks of a generatedworkflow.jsagainst 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.Verification
sh scripts/run_regressions.shfully green locally: validate_skill PASS, coherence selfcheck PASS, 17 + 15 node tests pass, all six hint diagrams coherent, auto-release tests OK.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/(syntheticGOAL.md, machine JSON inEXPECTATIONS.md,topology.hint.mmd), pluscatalog.json, harness (expectations.js,check_workflow.jsCLI,testcases.test.js), anddocs/dynamic-workflow-testcase-catalog.mdmapping 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, pendingclientThreadIdresolution, forbidden prompt snippets).task_collection_harness.test.jsgains 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 withgraph_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
Tests