diff --git a/Makefile b/Makefile index 17aa2dd1..be6a06f9 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,10 @@ # make agents-on # re-enable + load them again # make loop-status # is the loop running? (+ supervision mode) tail of its latest iteration log # make agents-uninstall # bootout + disable + delete installed plists (repo copies kept) -# make loop-start # start the Go selfbuild loop (./devagent-go loop) in the background -# make loop-stop # stop the background selfbuild loop +# make up # seed the lane from docs/PRD.md + start the driver (proven alive) +# make down # stop what `make up` recorded +# make loop-start # alias of `make up` +# make loop-stop # alias of `make down` # make loop-status # is the loop running? tail of its latest iteration log # make loop-log # tail -f the running loop's driver output # make daemon-start # start the FR-CTRL daemon (./devagent-go daemon) in the background @@ -39,26 +41,25 @@ WATCHDOG_LABELS := \ ALL_LABELS := $(DEVAGENT_LABELS) $(WATCHDOG_LABELS) -.PHONY: loop-start loop-stop loop-status loop-log daemon-start daemon-stop +.PHONY: up down loop-start loop-stop loop-status loop-log daemon-start daemon-stop # --- Selfbuild loop (background) -------------------------------------------- # The loop runs via hub-managed nohup; workers default to visible herdr panes # (attach with `devagent attach `), headless via DEVAGENT_VISIBILITY=headless. LOOP_LOG_DIR := .selfbuild/logs -loop-start: - @if pgrep -f "devagent-go loop" >/dev/null 2>&1; then \ - echo "selfbuild loop already running (pid $$(pgrep -f 'devagent-go loop' | head -1))"; exit 0; \ - fi +# Thin wrappers over the binary's own lifecycle commands (issue #371): the +# muscle memory survives, but there is now ONE start path. `up` seeds the work +# lane from docs/PRD.md and proves the driver is alive (loop lock + heartbeat) +# instead of printing a pid; `down` signals the pids it recorded, so the old +# `pkill -f "devagent-go loop"` is retired — a pattern kill also hits drivers +# started from another checkout (issue #354). +up loop-start: @if [ ! -x ./devagent-go ]; then echo "no ./devagent-go — run: make build" >&2; exit 1; fi - @mkdir -p "$(LOOP_LOG_DIR)" - @nohup ./devagent-go loop >> "$(LOOP_LOG_DIR)/driver.log" 2>&1 & \ - echo "selfbuild loop started (pid $$!) — log: $(LOOP_LOG_DIR)/driver.log; TUI: devagent tui" + @./devagent-go up --no-daemon -loop-stop: - @if pgrep -f "devagent-go loop" >/dev/null 2>&1; then \ - pkill -f "devagent-go loop" && echo "selfbuild loop stopped"; \ - else echo "selfbuild loop not running"; fi +down loop-stop: + @if [ -x ./devagent-go ]; then ./devagent-go down; else pkill -f "devagent-go loop" && echo "selfbuild loop stopped"; fi loop-status: @if pgrep -f "devagent-go loop" >/dev/null 2>&1; then \ diff --git a/README.md b/README.md index 55614751..0cd29067 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,52 @@ Tracked in the [roadmap](docs/PRD.md#17-roadmap) and the [Grok Bot & control app - **Bot-style UX floor** — named persistent agent identities, teach-once routines, visible bot-to-bot handoff (§20.1, Q45) - **Durable knowledge-graph context** — whether the LeanKG digest persists across runs or stays per-run (Q28) +## Run the automated driver (one command) + +```bash +make build # -> ./devagent-go + +devagent up # check prerequisites → queue your PRD items → start the driver +devagent up --scout # ...and run the 24/7 researcher beside it (FR-SCOUT-01) +devagent up --dry-run # print that plan without touching anything +devagent status # what is running, what it is doing, what happens next +devagent down # stop exactly what `up` started +``` + +`devagent up` is the whole setup: it runs the `devagent init` prerequisite +gate (a missing worker CLI aborts the start instead of burning tokens on work +that can never be dispatched), creates the loop state and queue directories, +ingests your `docs/PRD.md` into the work lane, prints the lane census (pending +rows, open PRD items, open `selfbuild` issues — the number that says whether +the next ten hours ship product or plumbing), brings up the localhost daemon +the TUI reads, and starts the self-build driver detached — launched from the +same binary you just ran, so nothing has to be installed on `PATH`. + +Then it proves the start instead of reporting a pid: a green line means the +driver holds the loop lock and has published a heartbeat naming its iteration +and phase (`driver running (pid 31815) — holds the loop lock, iteration 2, +phase queue-empty`); a driver that halts at its own gate fails `up` with the +halt line from its log. `--wait 0` skips that proof for scripted starts. + +**Tell it what to build in the PRD.** An open checkbox anywhere in +`docs/PRD.md` is an instruction; the driver picks items top-of-file first, +implements each against its own pipeline, and ships a PR that updates the PRD +and ticks that checkbox: + +```markdown +- [ ] Add a `--watch` mode to `devagent status` + - one line per iteration, exits on SIGINT +``` + +```bash +devagent prd-intake --dry-run # preview what your PRD currently queues +devagent prd-intake # queue it — the next iteration claims it +``` + +Everything the driver does per iteration is in +[docs/SELF-BUILD-LOOP.md](docs/SELF-BUILD-LOOP.md); `devagent loop` remains +the foreground form of the same driver. + ## Factory (24/7 scout + Orca workers) ```bash diff --git a/docs/PRD.html b/docs/PRD.html index ce0ec3dd..a71b0335 100644 --- a/docs/PRD.html +++ b/docs/PRD.html @@ -1471,6 +1471,18 @@

Commands

Show effective configuration (workers, budgets, credentials presence) + +devagent up / devagent down +One command to check prerequisites, seed the work lane from +docs/PRD.md, and start/stop the self-build driver + daemon +(FR-SIMPLE-07) + + +devagent prd-intake +Queue the operator's open - [ ] items in +docs/PRD.md as loop work (FR-SIMPLE-08; deterministic, +idempotent, --dry-run/--json) +

Flags (run)

@@ -2435,6 +2447,31 @@

Phase 5 — (FR-TUI-P-01..12, PR #268). The network sandbox allowlist (#180, P2) is the remaining Phase 4 leftover. Shipped from this phase: Grok/xAI worker adapter (internal/workers/grok.go),

+

Go-port gap audit (2026-09-13): a code-level audit +of the Go surface found the following specced-but-stubbed seams, each +now tracked as an issue (issue-first per the tracker note above) — +serve webhook-triggered dispatch still prints the FR-GO-07 +#194 deviation stub and never calls the pipeline (#356, +internal/cli/actions_serve.go:220); +init --smoke reports hardcoded +fixtureOK/gatesOK := true, so the FR-SIMPLE-01 +"verified smoke" verifies nothing (#357, +internal/commands/init.go:131); the daemon/executor +worker-reaper seams are nil by default, so stale-worker reaping silently +skips on paths that don't inject a dispatcher (#358, FR-GO-05); +spawn.visibility in devagent.json resolves env-only — the +SpawnVisibilityConfig global is read but never assigned +(#359); the Grok cost-ledger seam OnCost (FR-GROK-03) is +invoked but never set, so per-run cost never reaches the ledger (#363); +herdr-sweep --orphan-brokers remains Node-only per the +HERDR.md status note (#360); FR-CTX-01..05 remain unimplemented (#368, +see §20.1); and docs/PRODUCTION-READINESS.md still describes the retired +Node tree, so no Go-era readiness verdict exists (#362). Lower-priority +convergence work, also issue-first: lessons-digest dedupe + eval guard +(#361), Windows parity (#364), parity-shim convergence + vestigial +exit-3 machinery (#365), ClaudeCode adapter hardening (#366), +internal/cli + cmd/devagent test coverage (#367), War Room as a +first-class Go command (#369).