- Per-step timeout: `### Step 5: Build (timeout: 10m)` overrides the
global timeout for individual steps. Uses `timeout` command + heredoc
in the session script to avoid quoting issues.
- Env seeding: `runbook.json` `env` field injects environment variables
into all steps via `export` at the top of the session script.
Deterministic key ordering via sortedKeys().
Three DX improvements for runbook runner:
- --fail-fast: two-layer stop-on-failure (bash __rb_stop flag +
Go assertion loop) skips remaining steps after first failure,
reducing noise in long runbooks
- -v/-vv: verbose output showing assertion details (level 1) and
stdout/stderr snippets (level 2) for easier debugging
- --output/-o: write JSON report to file while still printing
plain text summary to stdout, useful for CI artifact collection
Skip re-running unchanged steps when debugging runbooks.
--steps 1,3,5 runs only specified steps; --from N runs from step N onwards.
Filtered steps are marked skipped. Flags are mutually exclusive.
Three runbook CLI improvements addressing top pain points from
verification:
- Auto-prepend (?m) to regex assertions so ^/$ match line boundaries
instead of string boundaries (skip if pattern already has flags)
- Track heredoc delimiters in parser so embedded ``` inside heredocs
don't prematurely close code blocks
- Remove set -e from step subshells — exit code is now the last
command's exit code, eliminating need for CMD_EXIT workarounds
Resolves opportunities #103, #105, #106.
Add a build hook that runs once before all runbooks, enabling
automatic binary rebuild. Lifecycle is now:
build (once) → [per runbook: setup → steps → teardown]
Build hook uses os/exec directly (not session executor), outputs
to stderr, and aborts immediately on failure.
Fix all 17 runbooks to pass in devcontainer:
- Adapt to session executor's set -eo pipefail (use cmd || EXIT=$?
pattern for expected non-zero exits)
- Replace embedded ```bash in heredocs with printf to avoid
confusing the runbook parser
- Fix negated assertion gotchas (Not FAIL, No such file)
- Remove fragile verify code blocks (multi-block merge issues)
- Fix step number collision (7b → 8, renumber subsequent)
- Use -s flag for batch installs instead of repeated --force
- Add (?m) flag for multi-line regex assertions
Disable TUI when hooks are active (hooks need session executor for
env persistence). Show [setup]/[teardown] status in plain text output.
Fix negative step numbers in marker regex for synthetic steps.
Add setup and teardown commands that run before/after each runbook.
Config file (runbook.json) provides persistent defaults; CLI flags
override. Setup env vars persist to all steps via session executor.
Setup failure skips all steps; teardown failure is informational only.
Removed Step 0 from atomgit runbook — init is now in runbook.json.
Prefix-based dispatch: exit_code: N, regex: <pattern>, jq: <expr>
fall through to substring match. Assertions always run when defined
and determine pass/fail regardless of exit code. Supports negation
(!0 for exit_code, Not/NOT for substring).
Single bash process runs all auto steps sequentially. Each step uses a
subshell with EXIT trap to persist env via export -p. Marker-based
output parsing splits per-step stdout/stderr. Existing runbooks work
without rewriting.
Extract shared helpers (truncateText, formatDurationMs, stepFailReason,
checkAssertions) and status/executor constants into helpers.go. Remove
7 duplicate functions across reporter_tui.go and reporter_plain.go.
Replace all magic strings with typed constants for compile-time safety.
WriteSingleReport prints per-step results with status icons,
duration, and failure reasons. WritePlainSummary aggregates
multiple runbook results into a compact batch summary.
Replace placeholder main.go with full CLI that supports:
- Single file or directory of *_runbook.md files
- TUI mode (default for single files), plain text, and JSON output
- --dry-run for parse-and-classify without execution
- Per-step timeout with --timeout flag
- Exit code 1 on any failure
Line-by-line state machine parser (bufio.Scanner + regex) that handles all
17 real E2E runbook files. Supports multiple heading formats (## Step N,
### N., ### Nb., double-labeling), multi code blocks per step (merged with
\n---\n separator), Expected/bold-Expected variants, inline markdown
stripping, and stops at Pass/Fail Criteria sections.