Skip to content

feat: run missions and delegated agents in a plain-folder project - #2494

Merged
yansfil merged 5 commits into
mainfrom
feat/plain-folder-missions
Nov 12, 2026
Merged

yansfil merged 5 commits into
mainfrom
feat/plain-folder-missions

Conversation

@yansfil

@yansfil yansfil commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2478
Closes #2479
Related: with-hide/hide-private#889 (paired docs/missions.md change); stacked on #2485.

Summary

A project folder that is not a Git repository could hold neither a mission nor a delegated agent: the mission was refused as an unknown project, and hide agent spawn always wanted --repo and --branch.
Now a mission made in a plain folder is a mission of general nodes only, whose workers start in the folder itself and finish by their lines, checkers and gates, with no branch, pull request or merge.
A code (change) or waiting (external) node, or a destination branch, is refused as mission_needs_git, and its next action says code work needs a Git repository.
hide agent spawn without --repo and --branch, from a pane of a plain-folder project, starts the agent in that folder; in a Git project both stay required, and the refusal (spawn_repo_required) now says so plainly.
A folder counts as plain only on its machine's own read (this machine's path read, or a device's helper); a checkout whose .git cannot be read, or one that is gone, is refused (spawn_folder_unreadable, mission_project_unknown), never treated as a plain folder.

No screenshot: no screen changes; the map and Missions screen draw these missions as they draw any other.

$ hide mission plan --json '{"nodes":[{"key":"fix","kind":"change",...}]}'   # in a plain folder
{"ok":false,"reason":"mission_needs_git","next_action":"This mission's project is a plain folder, not a Git repository: ..."}
$ hide agent spawn --parent here --intent m:synopsis --name w --kind codex --brief-file brief.md
{"ok":true, ...}   # the worker's pane opens in the folder

Review

  • Decide: help.md tells the Conductor to keep writers in one folder apart with depends_on or a separate output folder per brief; the core checks no paths (operator decision 2026-11-12).
  • Risky files:
    • hide-core/src/runtime/delivery.rs - failure path: spawn_place decides, under the runtime mutex, whether a spawn without --branch may start, from in-memory rows and path facts only; a --machine there is checked first (spawn_target, as the executor already does under the lock), and a retry of an admitted folder spawn skips the folder judgment.
    • hide-core/src/runtime/projects.rs - checkout_kind: Folder only on the node's answer (catalog_paths.project / device_facts), never inferred from a row that is merely not Git.
    • hide-core/src/coordination/mod.rs - ledger wire: a folder spawn writes branch = the folder plus folder: true, so a build before this one still loads the ledger (it requires a non-empty branch).
    • hide-core/src/coordination/executor.rs - calls outside the engine contract: a folder spawn opens a folder owner tab (OwnerOpen::for_checkout) instead of a worktree; no worktree_path or create_worktree call is made.
    • hide-core/src/coordination/naming.rs - a folder child's tab is now named; its owner workspace name is left alone.
  • Cost: none on a hot path; a mission create and a spawn each scan the workspace rows once (checkout_kind), as the catalog lookup already did.

Tests

  • Layer: core runtime tests over a faked engine and device, the layer that owns admission and the ledger; the CLI parse test in hided/src/agent_cli.rs.
  • Catches: making the plain-folder node check false fails a_plain_folder_project_runs_a_mission_of_general_nodes_and_refuses_code_nodes; letting a Git project's spawn through without a branch fails a_git_project_keeps_repo_and_branch_required (both planted and seen to fail).
    Reading a not-Git row as a folder again fails a_checkout_its_machine_could_not_read_makes_no_plain_folder_mission and the unreadable cases in a_git_project_keeps_repo_and_branch_required; judging a retry's folder again fails the Git-turned retry in a_spawn_without_repo_or_branch_starts_the_child_in_the_callers_folder; a_caller_here_starts_a_child_in_a_devices_plain_folder covers --machine with --repo alone and an unknown machine.
  • Repeat: the repeat lane on this PR runs the changed tests.
  • Waits: none; the spawn tests run Prepared::run with the existing 30 s bound.

Evidence

  • Verified:
    • cargo nextest over hide-core and hided before the review fixes: 5415 of 5416 passed, the one failure the committed CLI contract, regenerated here.
    • After the review fixes, 636 filtered mission, spawn, naming, refusal and contract tests: 634 passed on the first run; the contract (regenerated) and one node_session_activity deadline under load then passed alone. No existing test changes beyond the Option wraps of repo/branch.
    • The plain-folder mission test runs research, no-preset, verify and deploy general nodes through create, plan, start, record, a gate and close done.
    • Folder spawns on this machine, beside the caller, and on a device (after its facts are read; before that spawn_project_loading) start in the folder, and a retry returns the same agent.
    • Live, on an isolated candidate (this branch's build in a private hide.app, private HOME and state folder, a real Codex worker) with a folder outside any Git repository (git rev-parse exit 128):
      the Conductor's mission create took the folder as its project; change and external plans were refused mission_needs_git;
      agent spawn --parent here --intent mission-1:synopsis with no --repo/--branch opened the worker in the folder;
      it wrote synopsis.md there and recorded its line, and Hide closed the mission done. No candidate process was left.
    • scripts/verify-cargo.sh lint (fmt and clippy) clean.
  • Not verified:
    • Windows and Linux: no system-specific code was added (the folder path goes through the same owner tab as a Git checkout), so their CI lanes are the check.
    • A worker kind never trusted in the folder asks its own folder-trust question at start; Hide records trust only for the worktrees it makes.
    • The phone draws plain-folder missions with no change and was not opened.
    • In the live run the worker's first record, 14 s after its start, came before the Conductor's bind and was refused mission_criterion_not_yours; its brief said to retry. This race is the same in a Git mission and is not changed here.
    • The live run's Conductor was a shell with a hook-given identity, not a model; the candidate's Codex config carried the operator's danger-full-access and approval_policy = "never", without which Codex held the worker's hide call for an approval.

Breaking change

None for a Git project. Downgrade limits, written in docs/INSTALL.md: a build before this drops a mission's plain_folder (its plan admits code nodes again), and reads a folder spawn's record as a branch named after the folder.

A registered project that is not a Git repository can now hold a mission
and take a delegated agent.

- The mission's project is the plain folder itself when no Git project
  holds the checkout; the mission stores `plain_folder` (additive).
- In such a mission only general nodes are planned: a change or external
  node, or a destination branch, is refused as `mission_needs_git`, whose
  next action says a code node needs a Git repository.
- `hide agent spawn` without --repo and --branch, from a pane of a plain
  folder project (or with --repo naming one), starts the agent in that
  folder under a folder owner tab. In a Git project both stay required
  (`spawn_repo_required`); a folder whose facts are still being read
  answers `spawn_project_loading`.
- The ledger keeps a folder spawn readable by older builds: its branch
  repeats the folder and `folder: true` marks it.
- Mission help says Git is the floor for code and how writers in one
  folder avoid overwriting each other.

Closes #2478
Closes #2479
A project row that is not Git said only that no repository was listed
for it, so a Git checkout its node could not read (a .git link to a
missing repository) became a plain-folder mission for good.

- checkout_kind reads the node's answer: this machine's path facts, or
  the device helper's, must say the folder is a Project of kind Folder;
  a path found gone or whose Project could not be read is unreadable,
  and one not answered yet is unread.
- A spawn into an unreadable folder is refused `spawn_folder_unreadable`
  instead of waiting as loading forever.
- A spawn naming another machine is checked against that machine first,
  so an unknown or away device answers machine_unknown or
  machine_unavailable.
- The same folder spawn asked again answers its agent from the ledger
  without judging the folder again.
- The spawn_repo_required and repository_unavailable next actions no
  longer send a caller between each other for an unregistered folder.
Base automatically changed from feat/mission-node-presets to main November 12, 2026 13:47
…sions

# Conflicts:
#	contracts/hide-cli.json
#	hide-core/src/runtime/tests/beside_spawn.rs
@yansfil
yansfil added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit a11f0d6 Nov 12, 2026
40 checks passed
@yansfil
yansfil deleted the feat/plain-folder-missions branch November 12, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant