Skip to content

Require a software project before an issue starts; launch a task's session in its project folder - #4404

Merged
mstomar125 merged 1 commit into
mainfrom
issue-4394-project-before-start
Nov 30, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-4394-project-before-start

Conversation

@mstomar125

@mstomar125 mstomar125 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

An issue cannot go in_progress without a software project (its own or its direct parent task's), and nodespace session launch --task now runs in that project's folder.

What changed

  • New core Play "Require a repository before an issue is started" (ISSUE_PROJECT_PLAY_ID), an invariant reject registered for issue only. It refuses status = in_progress unless node.project or node.child_of.project is a software-project. A plain project does not satisfy it; one level up only; the message says what to link. Plain tasks are never checked. Seeded like the other rules, so a user can edit or switch it off. The title avoids the word "project" so a keyword search for a project does not hit it (same reason the decision gate Plays were retitled).
  • Daemon LaunchSession (agent_session_service.rs): with a task and no --project, the folder is the task's own software project's checkout_path, else its direct parent's. The task's own link wins. A named --project still decides. A plain task with neither launches in the private folder as today; an issue with neither is refused (failed_precondition, naming the missing link).
  • CLI help text for --project / --task and the generated skill CLI reference updated.
  • Existing tests that start or list issues now link them to a software project (workflow_seeds.rs, issue_and_software_project_test.rs). The "ready" search carries a permitted filter, so an issue with no software project is no longer listed as ready, since it cannot be started. That follows from the rule and is asserted in ready_tasks_lists_a_ready_issue.

Shape change class

additive / seeded_content: one new seeded Play (seeded.e7c3b95a-...), change-log entry issue-project-play-seeded, current.json regenerated, shape:check passes. Nothing about the plan type or the decision in_effect gates is touched. No dependency on the nested-checklist engine work: the rule reads node.project and node.child_of.project as main has them today.

What a 0.3.14 daemon / Sync device does

  • 0.3.14 daemon opening a database that already has this Play: the Play is an ordinary play node with CEL rules built from constructs 0.3.14 already evaluates (has, type_chain, node.project, node.child_of.project); it evaluates and enforces the rule like any user-authored Play. It has no seed entry for it, so it is neither reset nor re-created; it stays as written.
  • Sync of the new Play row to a 0.3.14 device: a plain play node, no new field or type, so nothing refused. On that device issues cannot be started without a software project, same as here. Issue rows themselves are unchanged and sync as before.
  • A 0.3.14 daemon launching --task keeps the old behaviour (private folder); no data is changed.
  • Not verified on an actual 0.3.14 binary (not available here); the above is from reading the engine that 0.3.14 shipped, and the shape record shows no schema change.

Security-sensitive: no.

Tests and mutation checks

Play (core_model_plays_test.rs, real engine): an_issue_with_no_software_project_cannot_start, an_issue_linked_to_a_software_project_can_start, an_issue_linked_only_to_a_plain_project_cannot_start, the_project_rule_reads_one_level_and_leaves_plain_tasks_alone. Mutations, each caught: accept any project (own link), accept any project (parent link), ignore the parent clause, ignore the own clause, guard the wrong status. Dropping a 'task' in node.child_of.type_chain guard changed nothing, so it was removed.
Daemon (agent_session_service.rs unit tests): own project, parent fallback, own wins over parent, named project wins, issue refused with the message, plain task private folder. Mutations, each caught: accept plain project (after strengthening the test to assert the "not linked" message), no parent fallback, own link ignored, task beats named project, issue not refused, every task refused.
ready_tasks_lists_a_ready_issue extension: mutating the Play condition to false fails it.

Commands: cargo test for the modules above, bun run shape:check, bun run skill:gen, cargo clippy -D warnings on core/daemon/agent/cli, cargo fmt --check, and the whole workspace nextest run (6687 passed).

Notes: the implementing-a-task skill gets one wording sentence (see the agent-lane paragraph); an agent listing ready issues will simply not see unlinked ones.

Closes #4394

Review follow-ups

Sync carries the link. Since Sync 0.1.10 every relationship edge syncs, so the project link (the reverse of a software project's tasks) reaches the other devices. An earlier revision of this PR said the link was per device; all of that text is removed (Play doc comment and refusal message, launch refusal, --task help and the generated CLI reference, the implementing-a-task skill, the change-log summary, the test). Refusals now say what to do: link the issue (or its parent task) to a software project; the link syncs to your other devices. The rule re-pointing to an id property when the reference field lands is a separate item and is not part of this PR.

Agent lane, for sign-off (wording only). packages/agent/src/seeds/skills/implementing-a-task.md, STEP 1: one added sentence saying an issue linked to no software project, itself or through its parent task, is not on the ready list because it could not be started, and to link it to a software project first. No other agent file changed apart from tests that link their issues to a project.

Creation bypass. The trigger is a status change, so an issue created already in_progress with no project is not refused; moving it away and back is. Stated in the Play doc comment and the change-log; pinned by an_issue_created_in_progress_without_a_project_is_not_refused.

Missing checkout on the task route. The message gives the project id and says to launch once with --project <id> --folder <path>. --folder is accepted with --task when the task resolves a software project (stored on that project); otherwise refused.

Ready list side effect. An issue with no software project drops out of the ready list, because the ready search only lists what the rules would allow to start.

Tests. Play: subtype satisfies the rule; an issue with no project link is refused and the message names the link and how to fix it (this test no longer pins any sync wording); creation in progress. Daemon: task launch with no folder, folder gone, --folder with --task, folder with nothing to belong to, two end-to-end launch_session calls. Mutation checks: all earlier ones caught; for the changed test, rewording the fix sentence in the refusal fails it (and the no-project test). Not mutation-checked: the creation test (pins an absence of behaviour) and the CLI --folder guard.

Checks run, passing: bun run shape:gen / shape:check, bun run skill:gen, core core_model_plays (47), core issue_and_software_project (19), daemon agent_session_service (17), agent workflow_seeds (26), cargo fmt --check, clippy -D warnings on core, daemon and cli. bun run test:changed last ran in full before this wording-only change and passed. Merge stays on hold.

🤖 Generated with Claude Code

@mstomar125
mstomar125 force-pushed the issue-4394-project-before-start branch from fff5d28 to 8df6318 Compare November 30, 2026 11:11
@mstomar125
mstomar125 merged commit 6645d6a into main Nov 30, 2026
@mstomar125
mstomar125 deleted the issue-4394-project-before-start branch November 30, 2026 11:11
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.

An issue cannot start until it or its parent task is linked to a software project, and a session launched for it runs in that project's folder

1 participant