Skip to content

fix: align job creation directory with MCP server project root - #330

Merged
nhorton merged 5 commits into
mainfrom
worktree-fix-job-creation-root-mismatch
Apr 3, 2026
Merged

fix: align job creation directory with MCP server project root#330
nhorton merged 5 commits into
mainfrom
worktree-fix-job-creation-root-mismatch

Conversation

@nhorton

@nhorton nhorton commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make_new_job.sh used git rev-parse --show-toplevel to decide where to create jobs, but the MCP server uses listRoots for discovery — these diverge when the session root ≠ git root (nested repos, cd changes, non-git parent dirs), making newly created jobs invisible
  • Added project_root field to ActiveStepInfo so agents always know the MCP server's canonical root
  • Changed make_new_job.sh to require --project-root DIR instead of inferring from git
  • Updated step instructions and JOBS-REQ-001 requirement spec

Test plan

  • All 347 existing tests pass
  • make_new_job.sh --project-root /tmp/test test_job creates job in correct location
  • make_new_job.sh test_job (without flag) exits with error
  • Manual: start Claude Code in parent dir, create job via workflow, verify get_workflows finds it

🤖 Generated with Claude Code

nhorton and others added 5 commits April 2, 2026 15:56
make_new_job.sh used git rev-parse --show-toplevel to decide where to
create jobs, while the MCP server uses listRoots for discovery. These
diverge when the session root differs from the git root (nested repos,
cd changes, non-git parent dirs), causing newly created jobs to be
invisible to get_workflows/start_workflow.

Add project_root to ActiveStepInfo so agents always know the MCP
server's canonical root. Change make_new_job.sh to require
--project-root instead of inferring it from git.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add project_root to ActiveStepInfo in doc/mcp_interface.md
- Add mypy-required None checks in test_server.py
- Remove invalid kwargs from StartWorkflowResponse in test
- Update traceability comment to reference JOBS-REQ-001.3.10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, write_instruction_files deleted ALL .md files on each
invocation, even ones with .passed markers. This meant passed reviews
lost their instruction files, and concurrent review agents could lose
their files mid-flight.

Now .md files with a corresponding .passed marker are preserved during
cleanup. Updated REVIEW-REQ-009.5 to require this behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Code expands @file references relative to the main repo root,
not the worktree root. The formatter now detects git worktrees via
git rev-parse --git-common-dir and makes instruction file paths
relative to the main working tree, so review agents can find them.

Added REVIEW-REQ-006.3.5 for this behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All step instructions (implement, iterate, learn, repair) now use
[project_root]/.deepwork/jobs/ instead of bare .deepwork/jobs/ paths,
consistent with the define step fix. Also updated doc/architecture.md
to reflect the new cleanup behavior for .passed review files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nhorton
nhorton added this pull request to the merge queue Apr 3, 2026
Merged via the queue into main with commit 5bf42d2 Apr 3, 2026
5 checks passed
@nhorton
nhorton deleted the worktree-fix-job-creation-root-mismatch branch April 3, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant