Skip to content

Simplify the dev plugin; make remote runs watchable and resumable - #8

Merged
tobrun merged 26 commits into
mainfrom
simplify-dev
Nov 13, 2026
Merged

tobrun merged 26 commits into
mainfrom
simplify-dev

Conversation

@tobrun

@tobrun tobrun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

This branch simplifies the dev plugin and restarts remote as one self-finishing run per fleet instance.

Dev plugin simplification (D-simplify, recorded in docs/decisions.md)

  • 12 skills become 6: to-pitch, to-quiz, reflect, and scope-review are removed, scope-quick folds into scope's small path, and ship-quick becomes ship's quick mode.
  • scope, build, and ship are rewritten around outcomes; build writes its e2e report as JSON.
  • commit is trimmed and no longer maintains architecture and dependency maps; the ledger is docs/decisions.md and docs/contracts.md only.
  • skill-metrics.py and the run journal are gone.
  • pr-evidence no longer reads an app named todo as a placeholder.

Remote, started over (D-remote-restart)

The phased design (dispatch, a session per phase, a build gate, collect, resume rounds, local, run records on the laptop) is replaced; the earlier remote commits on this branch are superseded by the last one.

  • You pick the instance: /dev:remote 1 {plan or task} runs on the first fleet instance. An instance holds one run, and everything after that is addressed by its number; the laptop keeps no run state.
  • A run is one unattended yolo session: it builds and ships a scoped plan, or scopes a task itself first, and opens the pull request from the instance.
  • The runner decides when it is finished: each time the session ends it checks that the tree is clean and a PR for the branch is open at HEAD, and resumes the same session with what is missing. A run ends done, blocked (the session recorded a hard stop), or failed once the configured sessions are spent. A tool the instance lacks becomes an open call in a draft PR instead of a failed run.
  • continue puts any ended run back to work in its own session and checkout, with an optional instruction; pull fast-forwards the local branch and merges plan files without overwriting a local edit, in any state.
  • Transport: commits cross as git bundles and files as tar streams over incus exec; the host's exchange clone and fleet sync/fetch are no longer used. Uncommitted work no longer refuses a start; it is listed as not sent.
  • Desktop viewer stays: a terminal on the instance's desktop follows the session live over noVNC, including why the runner sent a session back to work.
  • remote.py runs on Python 3.10.

Scope and build

  • scope commits the ledger entries it records, on the work branch (creating dev/{plan-name} with consent when on the default branch), so remote and build start from a clean tree instead of refusing on uncommitted changes.
  • build names a new branch dev/{plan-name}, matching remote.

Test plan

  • scripts/validate.sh passes, with the regenerated Codex distribution
  • Remote tests (fake incus, fleet, systemctl, gh, gnome-terminal, claude) cover a plan and a task run to their PR, a session sent back for a missing PR, uncommitted work, a gateway error and a crash, attempts running out, blocked runs, continue in every end state and without a transcript, pull with fast-forward, divergence and plan conflicts, instance numbering, and the viewer's lifetime; they pass on Python 3.10 and 3.14
  • One real run on a fleet instance end to end (held back while the fleet is busy)

🤖 Generated with Claude Code

What: delete factory/ and its generated Codex distribution, drop its marketplace entries and its validate.sh checks, and stop the Codex generator from building it. The generator also gains the remote skill's UI entry.

Why: dev:yolo replaced Factory as the unattended scope-build-ship run (D-retire-factory-for-yolo), so the second pipeline was dead weight in every build and validation run.
What: replace CLAUDE.md with AGENTS.md, addressed to Claude Code, Codex, and Pi, and drop the examples/ folder the structure tree listed but no skill has.

Why: the repository ships to three agents, and AGENTS.md is the file all of them read.
What: a remote skill that dispatches a scoped plan's build and ship to a desktop Incus workspace, runs each phase as a fresh headless session under an unattended contract, publishes from the sandbox when its git credentials can push (otherwise leaves publication to the laptop), and collects the branch, reports, and logs back. The runner re-runs build's check-tests gate before ship, names gateway errors, and records the PR it opened. Bumps the plugin to 3.10.0.

Why: scope stays interactive on the laptop while the long unattended phases run on the desktop's sandboxes, which hold their own allocated git credentials.
What: a shared execution reference for branch, push, and confidence authority; runner receipts and scenario mapping for build's test evidence; a single-writer refinement script for scope-review; review-protocol and evidence checks with their tests; changed-logic mutation testing with survivor triage (D-mutation-focused) and its harden study; a .gitignore policy that tracks only .dev/config.yaml; bootstrap probe and template updates; the regenerated Codex distributions; and the docs, dev README, and decision ledger entries for the factory retirement and the remote skill.

Why: the 2026-10-31 skills assessment found drift between what the skills promised and what their checkers enforced, and duplicated policy across skills; these changes repair that before the skills are simplified.
What: a Simplification section with seven decisions - six skills instead of twelve, no presentation renders, no run memory, the gauntlet and verifier batch kept, only decisions.md and contracts.md maintained, and no reverse mode - and supersession marks on the memory decisions and D-change-set-brief.

Why: the user chose to simplify the dev plugin now that current models no longer need much of its scaffolding; the ledger records each cut against what it replaces.
What: delete the four skills with their templates, references, scripts (claims.py, apply-refinements.py), evals, and tests; drop every recommendation of them from scope, build, ship, and yolo; and update the plan layout, the READMEs, the marketplace and plugin descriptions, the Codex generator, and the architecture doc. The run journal itself stays until skill-metrics.py is removed.

Why: D-simplify-presentation and D-simplify-memory - the presentation skills never gated anything, the claims loop only served reflect, and scope already runs a fresh-context spec reviewer, which absorbs scope-review as an optional deeper pass (D-simplify-dev).
…o it

What: scope now has a full path and a small path (the old scope-quick: no interview, no reviewer, at most one question), an optional deeper review with four lenses and a verifier per finding (what scope-review offered), and five short sections that state outcomes instead of choreography. Removed: the background explorers, the blind-spot subagent, the per-decision evidence batch, the sizing ritual, the contamination rule and the retrospective, the HTML render, the architecture and dependency-map hooks, and reverse mode with the git-history bootstrap. Kept: the spec written as the run goes, the argued decisions in ledger notation, the Validation block, layer-tagged tests lines, lint-spec.py, and promotion to docs/decisions.md and docs/contracts.md. The scope-quick evals move into scope.json.

Why: D-simplify-dev and D-simplify-reverse-mode - current models plan and explore without being told how, and the spec, its lint, and the ledger are the parts worth keeping.
… quick mode

What: ship keeps its three phases - the gauntlet with mutation testing on by default, the lens panel with its separate verifier batch and aggregate-findings.py, two remediation rounds, and the PR with pr-evidence.py check - stated as outcomes in 79 lines instead of 153. ship-quick becomes ship's quick mode (one validation run, one reviewer, a PR update); remote keeps its ship-quick dispatch token and runs /dev:ship quick. Removed: the HTML review render and its schema, the opt-in Workflow-tool orchestration variant, and the dependency-rules check, which read docs/dependencies.md. The ship-quick evals move into ship.json.

Why: D-simplify-dev, D-simplify-gauntlet, and D-simplify-review - the gauntlet and the verified panel are the guards worth keeping; the rest restated what the references already own.
… as JSON

What: build states its workflow, change-set loop, e2e pass, notes, and closing message in 77 lines instead of 113; parallel.md uses the waves lint-spec.py prints instead of re-deriving them and drops change-set-brief.py, so each agent reads the spec and notes by path. The e2e report becomes /tmp/{project-slug}/reports/{plan-name}-e2e.json in the same schema; pr-evidence.py reads it as JSON (its JS-literal and node fallbacks go), and the HTML template and the shared reporting reference are deleted. Build no longer updates docs/architecture.md.

Why: D-simplify-dev, D-simplify-presentation, and D-simplify-docs - the brief script and HTML render served reading convenience, not proof; the receipts, check-tests.py, and the wave gate stay.
What: remove dev/skills/remote/scripts/view.py from the index; the file stays on disk unchanged.

Why: another session was writing it while the ship rewrite was staged with git add -A, so an early copy landed in 5a9a529 without the remote.py and test changes that use it, and without its generated Codex copy. It belongs to that session's own commit.
…ndency maps

What: commit states its five steps in 56 lines instead of 101; its sync reference folds spec and doc sync into one paragraph, keeps ledger capture for docs/decisions.md and docs/contracts.md, and drops the architecture sync. architecture-check.py and the architecture and dependency-rules references are deleted; bootstrap's architecture and dependencies concepts now cite ship's architecture lens as their dev source.

Why: D-simplify-docs - the workflow maintains only docs/decisions.md and docs/contracts.md; architecture and dependency maps drifted with every change and cost a sync step in build and commit.
…pass

What: the dev README says scope offers the deeper review, and yolo's subagent preflight names the reviewers that still need one.

Why: both skills and the blind-spot pass were removed by D-simplify-dev.
What: delete skill-metrics.py, the run-journal reference, and their tests; scope, build, ship, and yolo no longer start or end a metrics run, and the dev README, plan layout, and architecture doc drop the metrics, the journal, and the .dev/config.json opt-out. The remote skill still packs and imports a sandbox journal when one exists; with nothing writing it, that path is idle, and it is left for the session currently editing remote.

Why: D-simplify-memory - the metrics and journal fed reflect, which is gone, and every timed skill paid for the calls.
What: TODO and TBD count as placeholders only in capitals, and the dev-evidence provenance marker is left out of the placeholder scan. Two tests: a body naming todo.py in its marker and captured command passes, and a capitalized TODO still fails.

Why: a yolo run on a todo CLI had real, current evidence rejected because the case-insensitive \bTODO\b matched "todo.py" in the marker's source list, so the run could not finish its PR body. Reproduced by re-running the check on that run's pr.md, which passes after the fix.
…agents

What: runner.sh exports CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=6000000 (100 minutes, ten times Claude Code's 600 s default) for every phase session, unless the environment already sets it; the full-cycle test checks every phase session sees it.

Why: run airflow-access-261113-1056-e4e3 lost its ship phase when Claude Code ended the headless session with "Background tasks still running after 600s" while a gauntlet fix agent was still working, so mutation testing, the review panel, and the PR never ran.
What: runner.sh gains open_view, which on a workspace with DISPLAY and
gnome-terminal opens a maximized terminal titled "dev:remote {run}"
running the new scripts/view.py on the run directory, at run start and
on resume. view.py follows logs/*.jsonl and status.json read-only and
prints what the agent says, its tool calls (a Bash description with the
command dimmed under it, or a heredoc's first lines), errors, API
retries, phase and build-gate changes, and how the run ended, with the
phase, state, and idle time in the window title. It waits for the
window to settle before drawing, drops a leading cd into the checkout,
prints the steps one poll sees in their real order, and names a runner
that vanished as lost. The terminal lives in the desktop session, not
the run's unit, so it outlasts the run; the next run on the workspace
closes it and resume keeps it. view.py also owns stream rendering, and
remote.py imports render_event from it for `logs`. remote.toml takes
`view = true|false`. The unattended contract tells the agent the
terminal is there, and the protocol, SKILL, and architecture docs
describe it. Tests: a fake gnome-terminal and DISPLAY passthrough in
the fake incus, cycle tests for the window's lifetime across runs and
resumes and for view = false, and unit tests for the parser and the
follower.

Why: watching a run over noVNC showed an empty desktop, because every
phase runs headless with its output in a JSONL file. The workspace
image already runs a GNOME desktop with a window manager and the
agent's session bus, so a viewer needs no host change, and following
the files read-only cannot affect the run.

Considered: running the interactive Claude Code TUI in a visible
terminal; it would drop the stream-json result the runner reads to
tell success from an API error, would not exit at the end of the
task, and would break session-id based resume and the build gate.
… them

What: dispatch's plan-file preflight now also refuses a plan directory
that is committed (git ls-files), not only one the ignore rules miss,
and its message says why plan files stay out of git (dispatch sends the
plan directory to the sandbox with the run, and collect brings it home)
and gives the exact fix: `git rm -r --cached .dev/{plan}` for a
committed plan, or the `/.dev/*` and `!/.dev/config.yaml` ignore rules
for a missing one. A new test covers the committed case; the existing
one checks the new wording.

Why: an agent that hit the old message ("plan files are not git-ignored
here") concluded the plan had to be committed to reach the sandbox,
committed it, and was then stuck between the refusal and the remote
skill's rule not to work around it. A tracked plan would also travel
through git and be swept into the PR by the sandbox's `git add -A`.

Symptoms: "remote: plan files are not git-ignored here; repair
.gitignore per plan-layout.md's ignore policy" after the plan was
committed.

Severity: moderate
…ion or a fresh start

What: `remote.py resume` starts a new round of any run that is not
running, including done, collected, and released ones. A round starts
at a point and runs the phases after it: --continue PHASE resumes that
phase's recorded Claude session, --from PHASE starts it fresh, and
without either the phase that ended continues (the one that failed or
stopped, or a finished run's last phase with a session). --prompt adds
an instruction to the first session, --phases replaces the phase list,
and --workspace and --publish override the run's. An uncollected run
resumes in place, working tree intact; a collected or released run is
restored from this machine's branch (committed, as at dispatch) and
plan directory, on its workspace when free and otherwise another, and
its logs and state go with it. Every round refreshes the plugin,
runner, and contract. runner.sh's single `run` command reads round.json
(the checkout to prepare: fresh, sync, or as-is, and the first phase's
mode, session, and prompt); `queued` marks a round starting before its
unit starts; every session id is appended to sessions.txt, and pack
brings each session's transcript (with subagents and tool results)
home, where collect keeps them under runs/{run}/sessions/ so a later
round can continue a session on any workspace. An earlier session's
uncommitted patch moves to history/ when its phase runs again, and a
continued session is told where it went. dispatch shares the new
helpers (parse_phases, committed_source, merge_base, deliver,
run_files, plan_files, start_unit) and records publish_requested. The
idle journal import (memory_dir, rewrite_paths, import_journal,
DEV_MEMORY_DIR) is gone. The fake claude keeps transcripts where Claude
Code does and fails a resume without one, as the real one does. SKILL,
protocol (Rounds, session transcripts), README, and architecture
describe it.

Why: run airflow-access-261113-1056-e4e3 ended "done" with its ship
fix agent killed mid-work and was collected; after that, "The run is
marked collected, so it cannot resume" left no way to finish it, and a
failed run could only continue the one phase that ended. Restoring
from this machine, with the transcripts collect now keeps, makes every
run recoverable and lets the operator pick where it starts.

Considered: snapshotting the plan directory and commit at every phase
boundary to rewind to them; rewinding a published branch needs a force
push, which the contract forbids, and a phase re-run reads the plan
files as they stand, as it does locally.
What: run_phase records how many lines the phase log already holds
before a session starts, and outcome() reads only the events after
that line. A fake claude mode, crash-ship-again, dies without a result
in a checkout that already shipped; a test resumes a finished run
--from ship in that mode and expects the run to fail with
"(no-result)".

Why: a phase log keeps every session the phase had (a resume, a gate
resume, a later round), and outcome() took the last result event in
the whole file. A session that crashed without writing a result was
then judged by the previous session's success, so the runner reported
"ship ended with exit 1 (ok)" or, with exit 0, marked the phase done.

Symptoms: status reason "ship ended with exit 1 (ok)" for a resumed
session that never produced a result.

Severity: moderate
What: scope's Record step ends by committing the ledger files it
changed (docs/decisions.md, docs/contracts.md) and only those, on the
current work branch, or on dev/{plan-name} created from HEAD when the
checkout is on the default branch (a branch change that waits for the
user's consent where the repository requires it), with a docs-typed
message per the commit skill's format. Applying a review's decision
reconciliation commits the ledger the same way. The plan directory
stays out of git. execution.md says a request to scope authorizes that
commit, not a push and not other pending work; scope recommends build
or remote; remote's preflight notes that scope commits its own ledger,
so tracked changes left after it are other work. A comprehension eval
covers what is committed, on which branch, and what is not.

Why: scope left the ledger files modified, so `remote dispatch`
refused on uncommitted tracked changes after every scope run, and the
user had to commit by hand before a sandbox could start. A sandbox
only receives commits, so the step that writes the ledger is the one
that has to commit it.
What: when build has to create a branch, it names it dev/{plan-name}
instead of {plan-name}.

Why: remote dispatch and scope already use dev/{plan-name} for a plan
started from the default branch, so a plan built locally and one built
in a sandbox now land on the same branch name.
What: remote.py reads remote.toml with tomllib (3.11+), with tomli when
that is installed, and otherwise with parse_flat_toml, a reader for the
flat subset the config uses: one key = value per line, the value a
string, number, boolean, or array of those, with # comments outside
strings. Anything else raises a ValueError naming the line, reported
as a refusal. A unit test checks the reader against the documented
config and two unsupported lines.

Why: the repository's declared minimum is Python 3.10, and every
remote.py command refused there with "Python 3.11+ is required to read
remote.toml", so 36 remote tests failed on both 3.10 CI jobs.

Symptoms: "remote: Python 3.11+ is required to read remote.toml" from
every remote.py command on Python 3.10.

Severity: high
What: the fake systemctl's stop sends SIGTERM to every process
descended from the unit's main process instead of only its process
group, and the tests' cleanup kills each unit's whole tree.

Why: on Linux, the runner bounds each phase with GNU timeout, which
moves the command it runs into its own process group. Signalling only
the runner's group left timeout and the fake claude running, so the
runner, waiting on that child, could not record "stopped", and the
stop, release, and resume-refusal tests failed on ubuntu while passing
on macOS, which has no timeout(1). Real systemd signals every process
in the unit's cgroup, so the runner itself was never affected.

Symptoms: "AssertionError: 'running' != 'stopped'" in
test_stop_records_stopped_and_collect_takes_what_exists on
ubuntu-latest.
…ar filters

What: extract_tar keeps tarfile's "data" filter where it exists and,
on a Python without extraction filters, checks every member before
writing anything (a path that is absolute or resolves outside the
destination refuses the collect), extracts only regular files and
directories (links, devices, and fifos are skipped), and clears setuid,
setgid, and group/other write bits, as the data filter does. A unit
test runs the fallback with a symlink, a setuid file, a ../ path, and
an absolute path.

Why: tarfile's filters arrived in 3.12 and were backported only to
3.10.12 and 3.11.4, so on the macOS runner's Python 3.10 every collect
failed. The sandbox's output is untrusted, so dropping the filter is
not an option.

Symptoms: "TypeError: TarFile.extractall() got an unexpected keyword
argument 'filter'" from remote.py collect on Python 3.10.11.

Severity: high
What: `remote.py local RUN` brings a run home and prints the command
that continues it here, in the run's worktree. It takes resume's
--continue, --from, --prompt, and --phases and picks the same default
point (the phase that ended, in its own session). An uncollected run
that is not running is collected first, which frees its workspace. To
continue a session, the collected transcript and its subagent files go
to this machine's Claude Code project directory for the worktree
($CLAUDE_CONFIG_DIR, default ~/.claude), with the sandbox checkout and
plugin paths rewritten to the worktree and the local plugin, never over
a copy already continued here; the command is `claude --resume
{session}` with a prompt saying the session moved to the operator's
machine, that the sandbox contract no longer applies, and where the
gate's last output and any uncommitted sandbox patch are. A fresh start
prints the phase's own command. The round is recorded with how "here".
collect is split into collect_run and work_checkout so local reuses
them. The fake claude records its cwd in the transcript; tests cover
continuing a failed run's session here, a fresh --from, the refusal on
a live run, and that a session continued here is not overwritten. The
SKILL (Continue here), protocol, README, and architecture describe it.

Why: a sandbox can be unable to finish: a build failed its gate round
after round because the workspace has no Docker socket for the e2e
scenarios and change sets were left unbuilt. Resuming there again
would hit the same wall, and starting over here would lose the
session's context; the work has to move to the machine that has the
tools and the operator.

Considered: launching the local session from remote.py; skills
recommend the next step rather than launch one, and the continued
session is meant to be attended in the operator's own terminal.
The phased design (dispatch, a session per phase, a build gate, collect,
resume rounds, `local`, run records on the laptop) was hard to use, fell
apart, and could not reliably continue. Replace it with the smallest
thing that finishes by itself.

`/dev:remote 1 {plan or task}` runs on the first fleet instance: the
user assigns the instance, and an instance holds one run. A run is one
unattended `/dev:yolo` session there. The instance's runner, not the
session, decides when it is finished: each time the session ends it
checks that the tree is clean and a pull request for the branch is open
at HEAD, and resumes the same session with what is missing. A run ends
as done, as blocked (the session wrote blocked.md for a hard stop), or
as failed once the configured sessions are spent.

- remote.py: start, continue, status, logs, wait, stop, pull, doctor,
  all addressed by instance number; no run ids and no laptop state
- commits cross as git bundles and files as tar streams over
  `incus exec`; the host's exchange clone and `fleet sync/fetch` are
  no longer used
- uncommitted work no longer refuses a start; it is listed as not sent
- continue puts any ended run back to work in its own session and
  checkout, with an optional instruction
- pull fast-forwards the local branch and merges plan files without
  overwriting a local edit, in any state and repeatedly
- a start keeps commits an earlier run left on the instance, and saves
  a diverged branch under refs/dev-remote/kept/
- the desktop viewer follows the single log and shows why the runner
  sent a session back to work

Decisions: D-remote-restart, D-remote-finish, D-remote-state supersede
the six earlier remote decisions.
@tobrun
tobrun merged commit 7154bbb into main Nov 13, 2026
4 checks passed
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