githubnext / githubnext/ado-aw

compile: directory argument silently no-ops instead of auto-discovering or erroring

Open
#867 0 comments 0 reactions 0 assignees View on GitHub
bug rust
Dominant language
Rust
Stars
23
Forks
8
Avg merge
4d 9h
Merged PRs (30d)
22

Description

## Summary

`ado-aw compile ` silently produces `0 compiled, N skipped` instead of either (a) auto-discovering the `*.md` files in that directory, or (b) failing loudly with a clear "expected a file, got a directory" error.

## Repro

```bash
$ ado-aw compile tests/safe-outputs/
# Detects 26 lock files, reports "(up to date)" for each, then
# emits "Warning: source ... not found for ... skipping" for each,
# and exits 0 with "0 compiled, 26 skipped, 0 failed".
```

`tests/safe-outputs/README.md` (line 102–107) currently documents this exact form as the canonical recompile command:

```bash
# Recompile every fixture in this directory (idempotent):
cargo run -- compile tests/safe-outputs/
```

…so the README is also out of sync with actual behavior.

## What works today

- `ado-aw compile ` — single file, works as documented.
- `ado-aw compile` (no args) — autodiscovers from cwd, works as documented.
- Per-file loop: `for md in tests/safe-outputs/*.md; do ado-aw compile --force "$md"; done` — works but is awkward.
- `cd tests/safe-outputs/ && ado-aw compile` — autodiscovers the 26 lock files but their `source: tests/safe-outputs/...` headers are relative to repo root, so each one is skipped with a "source not found" warning.

## Observed in the wild

The `recompile-safe-output-fixtures` agentic workflow (PR #863, fixed in #864) was triggered against release `v0.31.1` and silently did nothing because it used the documented `compile tests/safe-outputs/` form. Full log: https://github.com/githubnext/ado-aw/actions/runs/27020309715/job/79746499042.

The agent then correctly inspected the lock files, saw `version=0.31.1` matching the latest release, and emitted `noop` — masking the fact that the compile invocation never did any work. A subsequent integrity check would have caught the masking, but the root cause is the silent skip on a directory argument.

## Proposed behaviour

When `path` resolves to an existing directory:

1. Walk it (non-recursively, or recursively — match the autodiscovery behaviour) for `*.md` files that are agentic-pipeline sources.
2. Compile each.
3. Print the same per-file summary lines that the no-args form prints.

If walking yields zero candidates, exit with a non-zero code and a clear error rather than `0 compiled, 0 skipped`.

## Less-good alternatives

- **Reject directory args** with a hard error and a hint pointing at the no-args form. Better than the current silent-skip behaviour but worse than DWIM.
- **Update only the README** to document the per-file loop. Doesn't fix the surprise for everyone else.

## Workaround for now

```bash
for md in tests/safe-outputs/*.md; do
ado-aw compile --force "$md"
done
```

This is what the `recompile-safe-output-fixtures` workflow now does (PR forthcoming after this issue is filed).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.