Commit Graph

313 Commits

Author SHA1 Message Date
Peter Pistorius 4280c4253e chore: fix README formatting 2026-03-13 15:14:02 +02:00
Peter Pistorius 9441452c07 chore: prepare initial release 2026-03-13 15:11:14 +02:00
Peter Pistorius 5fb1020908 Merge pull request #49 from redwoodjs/move-packages
chore: move cli and dtu-github-actions into packages/
2026-03-13 00:09:49 +02:00
Peter Pistorius c8dd79f478 chore: move cli and dtu-github-actions into packages/ 2026-03-13 00:07:29 +02:00
Peter Pistorius f5aa92021f Merge pull request #48 from redwoodjs/paths-filter
feat: add paths/paths-ignore filtering to isWorkflowRelevant
2026-03-12 23:59:47 +02:00
Peter Pistorius e2fdc0c359 feat: add paths/paths-ignore filtering to isWorkflowRelevant 2026-03-12 23:33:07 +02:00
Peter Pistorius 40fc512690 Merge pull request #46 from redwoodjs/pp-rename-to-agent-ci
Rename machinen to agent-ci
2026-03-12 23:11:30 +02:00
Peter Pistorius 17e03d6102 Make pause-on-failure an opt-in flag, exit-on-failure is now the default
- Flip pauseOnFailure default to false in cli.ts and local-job.ts
- Replace --exit-on-failure/-x with --pause-on-failure/-p
- Add .agents/rules.md requiring /agent-ci before completing work
- Rename verify workflow to agent-ci (aliased as validate) with -p flag
2026-03-12 23:09:21 +02:00
Peter Pistorius 5b8acda506 Rename machinen to agent-ci
- Rename package from 'machinen' to 'agent-ci' across all source, tests, scripts, configs, and docs
- Rename CLI binary from 'machinen' to 'agent-ci'
- Rename .machinen → .agent-ci, .env.machinen → .env.agent-ci, MACHINEN_* → AGENT_CI_*
- Rename --runner flag to --name/-n (--runner still accepted for compat)
- agent-ci-dev script now builds DTU before running CLI
- Extract YAML compatibility tables to cli/compatibility.md
- Expand CLI usage docs with per-command flag tables
- Document DOCKER_HOST support for remote Docker
2026-03-12 22:35:26 +02:00
Peter Pistorius d88c47dadc Merge pull request #45 from redwoodjs/pp-agent-mode-quiet
feat: agent mode + DTU tarball route
2026-03-10 23:15:10 +02:00
Peter Pistorius 6e69d5e473 feat: suppress animated rendering in agent mode, add DTU tarball route (#44)
When running inside an AI agent (AI_AGENT=1 or --quiet/-q flag), replace
the 80ms logUpdate render loop with a synchronous callback that emits
plain-text step progress to stderr. This avoids massive token waste from
animated spinners/trees that are meaningless to LLMs.

Agent-mode output includes: runner start with log path, step progress
(running/completed/failed), and pause-on-failure details with retry command.

Also adds a tarball route to the DTU so actions/checkout doesn't 404 — it
returns an empty tar.gz since the workspace is already bind-mounted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:03:58 +00:00
Peter Pistorius 514c33b21c Merge pull request #43 from redwoodjs/pp-issue-28-runner-boot-time
feat: add boot timing debug logs for runner startup
2026-03-10 22:12:38 +02:00
Peter Pistorius bb19322564 Test. 2026-03-10 19:53:50 +00:00
Peter Pistorius 873d4a4f11 Merge pull request #42 from redwoodjs/pp-devcontainers
Add devcontainer-based agent workflow
2026-03-10 16:43:00 +02:00
Peter Pistorius aac7169fe3 Merge main and resolve conflicts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:41:27 +02:00
Peter Pistorius ec5dc76695 Merge pull request #41 from redwoodjs/pp-split-ui-and-logic
feat(cli): split UI/logic, fix direct container DTU connectivity
2026-03-10 16:37:12 +02:00
Peter Pistorius 8283ee0c0c feat(cli): split UI/logic, fix direct container DTU connectivity, show runner names
- Replace RenderContext with RunStateStore + pure state-renderer (no I/O in render)
- Fix direct container jobs failing to connect to ephemeral DTU (was hardcoded to 127.0.0.1:80)
- Bind ephemeral DTU to 0.0.0.0 so containers can reach it via bridge network
- Show runner name (dimmed) alongside job name in multi-job collapsed output
- Use project-relative .machinen dir inside Docker for correct bind-mount paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:34:51 +00:00
Peter Pistorius 3a93aaeb16 Update deps. 2026-03-10 13:43:18 +02:00
Peter Pistorius 4ba45d946b Ignore temporary devcontainer file. 2026-03-10 13:31:45 +02:00
Peter Pistorius b35be988e3 Allow unssafe Claude. 2026-03-10 13:17:55 +02:00
Peter Pistorius f58618c67f Add dev containers script. 2026-03-10 13:04:04 +02:00
Peter Pistorius 7b66daedc9 feat(cli): unified multi-runner tree rendering
- Add RenderContext class that composites multiple workflow trees
  into a single logUpdate frame, grouped by workflow name
- Multi-job workflows always share a RenderContext so all runners
  appear in one composite tree (fixes overwriting bug)
- --all mode runs workflows in parallel via Promise.allSettled
- Completed jobs collapse to a single ✓/✗ summary line
- Paused jobs show retry hint as child node
- Suppress console.log/emit in shared context to prevent logUpdate
  cursor corruption
- handleRun returns JobResult[] with single summary at the end
- Add warm-cache serialization for --all mode
- Add taskId to buildJob in multi-job path
- Simplify machinen-dev script to run tsx directly
2026-03-10 00:15:10 +02:00
Peter Pistorius 0b0573b50f fix(cli): correct step numbering, show runner name, fix layout shift
- Skip 'Complete job' in main loop; add it last with correct number
- Show 'Post Setup' and 'Complete job' only after job finishes
- Display runner name (containerName) in boot spinner and tree
- Remove elapsed timer from workflow root label
- Use renderTree() for boot spinner to prevent layout shift
- Add 1-space left padding to tree renderer output
- Update tree-renderer tests for new padding
2026-03-09 22:53:07 +02:00
Peter Pistorius ad0745fe72 feat: implement --all flag to discover and run relevant workflows
Discovers all .yml/.yaml files in .github/workflows/, filters by
pull_request/push triggers matching the current branch via
isWorkflowRelevant, and runs each sequentially.
2026-03-09 22:28:38 +02:00
Peter Pistorius d81da85fc9 chore: improve README docs, add machinen-dev alias, default pause-on-failure
- Document workflow relevance criteria for --all in README
- Add machinen-dev script alias to root package.json
- Make --pause-on-failure the default, add --exit-on-failure/-x to opt out
- Remove unused dev script, concurrently, and wait-on deps
- Move tagline from root README to cli/README
2026-03-09 22:22:18 +02:00
Peter Pistorius ed64ce2362 Add license. 2026-03-09 21:18:19 +02:00
Peter Pistorius 355e9e83a5 Merge pull request #37 from redwoodjs/pp-retry-from
feat: --from-step retry, pause-on-failure UI, and step log segmentation
2026-03-09 21:00:37 +02:00
Peter Pistorius 2d31ac8747 fix: reset retry-proof value.txt to pass 2026-03-09 20:59:23 +02:00
Peter Pistorius c935d7c358 fix: segment step logs in DTU so failing steps get named log files
The runner sends step output via the Job-level feed (Job UUID as
recordId), which the DTU couldn't map to a step name. Now the
timeline handler tracks the currently in-progress step, and
writeStepOutputLines falls back to it when the feed recordId has
no direct mapping. This gives failing/paused steps their own
properly named log files (e.g. Run-assertion-test.log) instead of
an opaque UUID file.

Also adds Enter-to-retry: pressing Enter in the terminal while
paused triggers a workspace sync and retry signal directly.
2026-03-09 20:56:10 +02:00
Peter Pistorius 3efb688a3a feat: show failure output and Enter-to-retry in pause-on-failure UI
When a step pauses on failure, the tree UI now shows:
- Last 20 lines of step output below the tree (assertion errors,
  code context, etc.) matching the end-of-job summary quality
- Press Enter to retry directly from the paused terminal
- Ctrl+C to abort

The step log is resolved via sanitized name with fallback to the
most recently modified .log file (the DTU writes logs under feed
UUIDs that differ from timeline record IDs).
2026-03-09 20:38:47 +02:00
Peter Pistorius bd21f4d0bc feat: add --from-step and --from-start options to retry command
Allows rewinding to an earlier step when retrying a paused runner:
- --from-step <N>: skip steps before N, re-run from step N onwards
- --from-start: re-run all run: steps from the beginning

Each wrapped step embeds a 1-based index matching the tree UI and
checks a from-step signal file on entry. Steps below the target
exit 0 (skip), the matching step deletes the signal and continues.

Closes #35
2026-03-09 18:32:15 +02:00
Peter Pistorius dd3edb27be Merge pull request #36 from redwoodjs/pp-readme-and-retry-sync
docs: rewrite CLI README + feat: sync source on retry
2026-03-09 17:19:04 +02:00
Peter Pistorius 7a5e5d25d7 fix: change retry-proof trigger to workflow_dispatch
This workflow is designed to fail initially (value.txt = 'fail') and
is only meant for local machinen testing, not CI.
2026-03-09 17:15:43 +02:00
Peter Pistorius 290cd13d91 feat: Add releasing workflow. 2026-03-09 16:11:47 +02:00
Peter Pistorius e03d23cfbe feat: sync source changes on retry
When running 'machinen retry', the CLI now rsyncs local source files
into the run's workspace before sending the retry signal. This ensures
local code edits are visible inside the container without requiring a
full workflow restart.

Uses git ls-files + rsync to respect .gitignore and handle deletions,
while preserving node_modules and .git in the workspace.
2026-03-09 16:10:06 +02:00
Peter Pistorius 9dff4b1955 feat: add retry-proof experiment
Minimal vitest test that reads a fixture file and asserts its value,
designed to validate the pause-on-failure retry mechanism end-to-end.

- .github/workflows/retry-proof.yml
- experiments/retry-proof/ (package, test, fixture)
- Added retry-proof to pnpm workspace
2026-03-09 16:09:51 +02:00
Peter Pistorius 67e2d800f7 docs: rewrite CLI README
- Hero description: local-first CI with 1:1 GitHub Actions API parity
- Why section: pause-on-failure, retry failed steps, ideal for AI agents
- Installation and usage instructions
- YAML compatibility placeholder
2026-03-09 16:09:38 +02:00
Peter Pistorius cb650a694c Merge pull request #33 from redwoodjs/pp-speed-up-node-cache
feat: generalize package manager caching for NPM, Yarn, and Bun
2026-03-09 13:21:04 +02:00
Peter Pistorius c6dd68ddb8 feat: generalize package manager caching for NPM, Yarn, and Bun
- Extend computeLockfileHash() to detect package-lock.json, yarn.lock, bun.lock
- Replace PNPM-only .modules.yaml sentinel with universal hasInstallSentinel()
  that checks .package-lock.json (NPM), .yarn-integrity (Yarn), .cache (Bun)
- Add NPM and Bun global cache bind-mounts into containers
- Extend virtualCachePatterns to skip tar for all PM cache keys
- Add benchmark scripts in experiments/pkg-cache-bench/
- 176 tests pass, TypeScript clean
2026-03-09 13:19:46 +02:00
Peter Pistorius 9f525bffde Merge pull request #31 from redwoodjs/pp-retry-on-failure
feat: add --pause-on-failure flag with retry/abort commands
2026-03-09 09:58:56 +02:00
Peter Pistorius cbf772a08a feat: add --pause-on-failure flag with retry/abort commands (#27)
When enabled, run: steps are wrapped in a bash retry loop that pauses
execution on failure and waits for an external signal before continuing.

- New step-wrapper utility wraps run: step scripts in a retry loop
- Signals directory bind-mounted for container ↔ CLI IPC
- CLI polls for paused signal and renders ⏸ icon with frozen timer
- Yellow 'Step failed attempt #N' child leaf in the tree output
- machinen retry --runner <name> / machinen abort --runner <name>
- Validates container is still running before sending signals
- Optional attempt field on JobResult for reporter

Closes #27
2026-03-09 09:56:00 +02:00
Justin van der Merwe c07f2bf40b Add test generation command and e2e test infrastructure for derive
## Problem

derive had zero test infrastructure -- no vitest config, no test harness, no test files. We also had no mechanism to generate tests from the Gherkin specs that derive produces, which is the natural next step in the derive pipeline (conversations -> specs -> tests).

## Solution

We built e2e test infrastructure and a `derive tests` command, then dogfooded the command to generate the bulk of the test suite from derive's own specs.

**Hand-written foundation (2 test files, 6 tests)** -- We wrote two test files manually: `derive-one-shot.test.ts` (spec pipeline e2e) and `derive-tests.test.ts` (test generation command e2e). These establish the conventions, patterns, and infrastructure that generated tests build on. Supporting infrastructure includes:

- Three env var overrides (`CLAUDE_BIN`, `CLAUDE_PROJECTS_DIR`, `MACHINEN_DB`) for full isolation from the host system
- Two deterministic substitute binaries that replace `claude -p` in tests: `fake-claude-gen-specs` (keyword extraction -> Gherkin template) and `fake-claude-gen-tests` (reads specs, writes vitest files)
- A reusable test harness (`setupDeriveTest`) that handles temp directory setup, git init, JSONL fixture writing, derive invocation, and cleanup

**`derive tests` command** -- Spawns an agentic `claude -p` session with full filesystem tools, letting Claude read specs and existing test conventions, then write test files directly. Source code isolation is enforced by convention-based system prompt instruction (Claude reads only specs, tests, and config -- not implementation source). The command is independent of git state and conversation discovery -- it operates purely on spec files on disk.

**Generated test suite (8 test files, 30 tests)** -- We ran `derive tests --scope derive` against derive's own 10 `.feature` spec files. Claude read the specs and the two hand-written tests to learn the conventions, then generated 8 additional test files covering: CLI context detection, conversation discovery, incremental updates, multi-file spec storage, one-shot edge cases, reset mode, scope flag, and spec file location. 36 tests pass across 10 files total.

**Bug fixes discovered during manual testing** -- Running `derive tests` against the real Claude CLI surfaced two bugs: a `--` args leak where pnpm passed `--` as a literal argv element (preventing `derive tests` from dispatching), and an inaccurate `--keep-spec` spec scenario (it preserves content as LLM context, not files on disk). Both were corrected, along with the spec and one generated test that reflected the wrong semantics.

<img width="701" height="737" alt="Screenshot 2026-03-09 at 01 03 48" src="https://github.com/user-attachments/assets/0e7e5fce-10d3-424a-ae45-e126fed0a9a7" />
2026-03-09 01:08:45 +02:00
justinvdm 7b32f1e61f Remove empty JSON files. 2026-03-09 01:06:29 +02:00
justinvdm 76f0957bef Rename the project to match the new name. 2026-03-09 01:06:01 +02:00
justinvdm 5d73beb348 Implement e2e test infrastructure and derive tests command. 2026-03-09 00:33:48 +02:00
justinvdm 073ef8e906 Add test generation command and e2e test infrastructure for derive. 2026-03-09 00:20:01 +02:00
justinvdm ac9bd7c43f Clarify CLI behavior and documentation. 2026-03-09 00:18:20 +02:00
justinvdm 8f23e9d474 Update CLI context detection and conversation discovery tests. 2026-03-09 00:09:33 +02:00
Peter Pistorius e6f43a31eb Merge pull request #29 from redwoodjs/pp-clean-up-logging
Parallelize host-side prep for faster runner boot
2026-03-08 14:55:08 +02:00
Peter Pistorius 4c6cee4df5 Try to improve performance. 2026-03-08 14:39:46 +02:00