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

fix: scope mid-graph worker prompts to node-local obligations - #12

Merged
jnyross merged 2 commits into
mainfrom
fix/worker-prompt-contract-scoping
Aug 9, 2026
Merged

jnyross merged 2 commits into
mainfrom
fix/worker-prompt-contract-scoping

Conversation

@jnyross

@jnyross jnyross commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • P0 from Lisbon dogfood: mid-graph workers must receive only node-scoped obligations and handoff schema. Publication rules, multi-lane audit requirements, and root-gate semantics stay with the root (and nodes that own those steps).
  • Adds explicit scoping rule, example sentence, freeze-contract cross-ref, and anti-pattern in code-mode-script-patterns.md.
  • Validator phrases so the rule cannot regress silently.
  • P1 light: blocked terminals should include completed upstream handoffs, not only live handles (task-lifecycle.md).

Evidence

Lab: jnyross/mac-vm-testing-harness branch codexgraph-vm-test @ 7f1ae76 — candidates/frozen-lisbon-v1/ (terminal status: blocked, 3 research workers complete with 16 candidates, N3 self-blocked demanding audit results that run after synthesis). See CRITIQUE.md.

Test plan

  • python3 skills/codex-graph/scripts/validate_skill.py
  • python3 skills/codex-graph/scripts/graph_coherence.py --selfcheck
  • node --test skills/codex-graph/scripts/task_collection_harness.test.js (10/10)
  • python3 scripts/test_auto_release.py
  • CI green on PR

Note

Low Risk
Documentation and skill validation phrase checks only; no runtime orchestration or product code changes.

Overview
Mid-graph workers must not receive whole-graph acceptance (publication rules, multi-lane audit, root-gate semantics) in their prompts—only the shared contract ID, vocabulary, and this node’s obligations and handoff schema. SKILL.md, code-mode-script-patterns.md, and a new Scope worker prompts to node-local obligations section document the rule, example scoping sentence, anti-patterns (e.g. synthesis blocking on later audits), and a pitfalls bullet so workers don’t self-blocked when upstream work is already done.

Blocked terminals must carry completed upstream handoffs (compact, schema-valid), not only live handles, so resume/critique doesn’t re-read threads (task-lifecycle.md).

validate_skill.py adds required phrase checks so these lessons can’t silently drop from the references.

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

Summary by CodeRabbit

  • Documentation

    • Clarified worker responsibilities in multi-step workflows, preventing intermediate tasks from blocking on final publication or audit requirements.
    • Required shared contract information for all workflow stages while keeping publication and audit criteria with their responsible stages.
    • Documented preservation of completed upstream handoffs when workflows are blocked, supporting smoother resume and review scenarios.
  • Validation

    • Updated documentation checks to verify the new workflow guidance and handoff requirements.

Lisbon family day-trip dogfood (frozen-lisbon-v1) showed synthesis
self-blocking when the generated N3 prompt embedded the full publication
and audit contract that only the root gate owns. Document the scoping
rule, example sentence, and anti-pattern; require validator phrases;
preserve completed upstream handoffs on blocked terminals.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes scope worker obligations to each node, preserve completed upstream handoffs in blocked results, and extend validation checks for the updated lifecycle and worker guidance.

Changes

Worker and lifecycle contracts

Layer / File(s) Summary
Node-local worker obligations
skills/codex-graph/SKILL.md, skills/codex-graph/references/code-mode-script-patterns.md
The guidance shares contract fields with participating nodes. It assigns publication, audit, root, gate, research, synthesis, and formatter responsibilities to their owning nodes. It documents the mid-graph self-blocking failure mode and adds an anti-pattern warning.
Handoff preservation and contract validation
skills/codex-graph/references/task-lifecycle.md, skills/codex-graph/scripts/validate_skill.py
Blocked results retain completed upstream handoffs with live handles. The validator checks the completed-handoff phrase and node-local worker guidance.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 describes the main change: limiting mid-graph worker prompts to node-local obligations.
Description check ✅ Passed The description explains the behavior change, provides evidence, lists validation commands, and notes that CI remains pending.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/worker-prompt-contract-scoping

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.

Devin review: SKILL.md still said every worker must use the full
publication-inclusive contract, which contradicted the node-local
scoping rule. Share contract ID and fields; keep publication/audit/
root-gate obligations on the nodes that own them.
@jnyross
jnyross merged commit 7ea5de3 into main Aug 9, 2026
4 checks passed
@jnyross
jnyross deleted the fix/worker-prompt-contract-scoping branch August 9, 2026 12:09
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 <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 10, 2026
2 of 3 tasks
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.

1 participant