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

fix: per-node environment + pending clientThreadId resolution - #14

Merged
jnyross merged 2 commits into
mainfrom
fix/per-node-environment-pending-setup
Aug 9, 2026
Merged

jnyross merged 2 commits into
mainfrom
fix/per-node-environment-pending-setup

Conversation

@jnyross

@jnyross jnyross commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Lisbon family dogfood v4 (skill 0.4.4 / #13) blocked before collection: all three research workers stayed pending_setup with clientThreadId only. Frozen graph applied environment: worktree to every create_thread, including read-only research nodes. v3 used local for research and got ready threadIds.

Root cause was skill guidance that could be read as graph-level (“worktree when the graph can write”) rather than per-node.

Changes

  • Per-node environment: read-only → local; writers → worktree; never global worktree because one writer exists
  • Prefer root-orchestrator writes for final project-root artifacts (latent P1: report stranded in worktree)
  • Pending setup: correlate by clientThreadId when listed; allow run-tag match while projectId absent during loading; chat-scale vs provisioning-scale bounds
  • Validator phrases so the guidance cannot regress silently
  • CHANGELOG Unreleased note

Evidence

  • Lab: mac-vm-harness--codexgraph-test commit 2f51adf / candidates/frozen-lisbon-v4/
  • Terminal: blocked, Required research starts failed: N2A, N2B, N2C, handles preserved

Test plan


Open in Devin Review

Note

Low Risk
Changes are limited to skill documentation, reference patterns, and validator string checks—no runtime orchestration or application code.

Overview
Fixes Lisbon dogfood v4 guidance where read-only research workers inherited a graph-wide worktree environment and stayed pending_setup with only clientThreadId.

Per-node environments: read-only nodes use local; nodes that write repo files use worktree with disjoint scopes—never worktree on every create because one writer exists. Final project-root artifacts should be written from the root orchestrator (or a single integration owner), not only inside a disposable worker worktree.

Pending setup resolution is tightened: poll with chat-scale bounds for local starts and provisioning-scale bounds for worktree; match run tags in title/summary without requiring projectId on early list rows; correlate by clientThreadId when listed. Example handle shape and findExactThread logic in task-lifecycle.md reflect this.

validate_skill.py gains required phrases so this guidance cannot regress silently; CHANGELOG records the unreleased fix.

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

Summary by CodeRabbit

  • New Features

    • Saved-project workflows now select execution environments per task node, using isolated workspaces for repository-writing tasks.
    • Improved task setup matching during provisioning using run tags and client thread identifiers.
    • Added guidance for coordinating disjoint writing scopes and root-owned final artifacts.
  • Documentation

    • Updated task lifecycle and Code Mode guidance with environment-specific setup and polling behavior.
    • Expanded validation checks to verify the new workflow requirements.

Lisbon dogfood v4 blocked with N2A–N2C stuck in pending_setup after
create_thread returned only clientThreadId. Generation applied worktree
to every node because one writer existed; skill text had allowed a
graph-level reading. Research workers need local; writers alone need
worktree. Also: pending match must not require projectId while setup
loads, may correlate by clientThreadId, and worktree needs a longer
provisioning-scale resolve bound.

Refs: frozen-lisbon-v4 terminal ee3f60e0… / CRITIQUE-v4.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR documents per-node task environments, strengthens pending task setup correlation, updates skill validation requirements, and adds an Unreleased changelog entry.

Changes

Task lifecycle guidance

Layer / File(s) Summary
Per-node task environments
skills/codex-graph/SKILL.md, skills/codex-graph/references/code-mode-script-patterns.md, skills/codex-graph/references/task-lifecycle.md
Read-only nodes use local environments. Repository-writing nodes use isolated worktrees. Task handles retain the selected environment.
Pending setup resolution
skills/codex-graph/SKILL.md, skills/codex-graph/references/code-mode-script-patterns.md, skills/codex-graph/references/task-lifecycle.md
Pending tasks use exact project IDs when available, support run-tag matching, correlate by clientThreadId, normalize project and thread fields, and apply environment-specific polling bounds.
Validation and release documentation
skills/codex-graph/scripts/validate_skill.py, CHANGELOG.md
Validation requires the new per-node, provisioning-scale, reread, and client-thread guidance. The changelog records the updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: per-node environment selection and pending clientThreadId resolution.
Description check ✅ Passed The description explains the problem, changes, evidence, validation results, and planned follow-up, with only minor template differences.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/per-node-environment-pending-setup

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.

cursor[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Handle.environment stores the spawn target object ({ type }), not the
string "worktree", so the pending-setup ternary never selected
provisioning-scale polling. Document the field on the handle, copy it
from the node in startRequiredNode, and key bounds on environment.type.

@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/scripts/validate_skill.py`:
- Around line 178-179: Extend the validation checks in validate_skill.py for
each environment-contract mapping to require its complete clause, not just
generic phrases such as “per node” or “provisioning-scale”. Require read-only
nodes to specify local execution, repository-writing nodes to specify worktrees,
and local starts to specify chat-scale polling, covering the related checks near
the existing mapping phrase lists.
🪄 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: 47730d7c-85e0-4055-90e6-da3dfd2ca9d1

📥 Commits

Reviewing files that changed from the base of the PR and between 0d2c8f5 and 345a22a.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • skills/codex-graph/SKILL.md
  • skills/codex-graph/references/code-mode-script-patterns.md
  • skills/codex-graph/references/task-lifecycle.md
  • skills/codex-graph/scripts/validate_skill.py

Comment on lines +178 to +179
"per node",
"provisioning-scale",

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 | ⚡ Quick win

Require the validator to check the complete environment contract.

The new checks only require generic phrases such as per node and provisioning-scale. They do not require local execution for read-only nodes, worktrees for repository-writing nodes, or chat-scale polling for local starts. A later edit can remove these mappings and still pass validation. Add checks for each required mapping clause.

Also applies to: 211-215, 256-258

🤖 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/scripts/validate_skill.py` around lines 178 - 179, Extend
the validation checks in validate_skill.py for each environment-contract mapping
to require its complete clause, not just generic phrases such as “per node” or
“provisioning-scale”. Require read-only nodes to specify local execution,
repository-writing nodes to specify worktrees, and local starts to specify
chat-scale polling, covering the related checks near the existing mapping phrase
lists.

@jnyross
jnyross merged commit 1a1828a into main Aug 9, 2026
4 checks passed
@jnyross
jnyross deleted the fix/per-node-environment-pending-setup branch August 9, 2026 19:14
jnyross added a commit that referenced this pull request Aug 9, 2026
…es (#16)

* feat: dynamic-workflow golden test cases from real Grok/Claude orchestration 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.

* fix: harden expectations checker per PR #16 review

- 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

* fix: fail collection checks when read/wait tools are absent

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.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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
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