8000 CI: add a macos job (host tests + conformance) by adeelahmad · Pull Request #58 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# shellcheck — lints every gate script (errors fail the build)
# plugin — JSON sanity + eval-suite validation + `claude plugin validate --strict`
# hosts — Codex hooks emulation + OpenCode plugin end-to-end (no network, no tokens)
# macos — the host tests and the conformance fixtures on macOS (symlinked /var temp dirs,
# BSD userland): the v0.12.0 release run found two bugs Linux CI never saw
name: CI

on:
Expand Down Expand Up @@ -70,6 +72,28 @@ jobs:
- name: Codex hooks emulation + OpenCode plugin end-to-end
run: make test-hosts

macos:
name: macos (hosts · conformance)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
plugin/tools/ctx-symbols
plugin/tools/md-db
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Host tests (budget, events, Codex hooks, OpenCode plugin)
run: make test-hosts
- name: Conformance fixtures (ROADMAP §6)
run: make conformance

plugin:
name: plugin (json · evals · validate)
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tag in lockstep. Tag releases as `vMAJOR.MINOR.PATCH`.
## [Unreleased]

### Added
- CI `macos` job: `make test-hosts` and `make conformance` on macos-latest. Reason: the v0.12.0 release run on a Mac found two bugs (symlinked temp dirs, another checkout's shims on PATH) that the Linux jobs never saw.
- `gate-supervisor-scope` blocks the supervisor from writing an agent's `output.md` block, with Write/Edit or with a shell redirect or `tee` while a sprint is live; it names the way out (re-dispatch the agent). Reading `output.md`, appending `init.md`, a dispatched agent's append and a worker's shell in its linked task worktree (Codex, OpenCode) all pass. Reason: live run 29, the supervisor appended a final-gate block itself after the final gate's report was lost; SKILL.md's prose rule is now a gate, like never-commit-on-main. Test: `scripts/test/supervisor-scope.test.py`.
- `gate-final` now checks comms for a final-gate worker dispatched under a task contract: its latest `output.md` block must be its own, with the shell-heredoc instruction when it is not. The final-gate persona gains a Report section and the finish order (append, then selfcheck). SKILL.md runs the planning roles in the foreground and says never to write an agent's block. Reason: live run 29, the final gate's Write was refused, its report stayed in a discarded worktree copy, its stop passed and the supervisor wrote the sign-off block itself; the supervisor also spent 5 turns polling for the planners' files. Test: two conformance cases (§6.6).
- `aloop budget contract <TASK_ID> --role R --story DIR [--scope G] [--attempt N] [--symbols S]` writes the supervisor's task contract (`<run-data>/state/tasks/<TASK_ID>.env`) with `BASE_REF=HEAD` and the resolved `BUDGET_*` (the story's tasks.md `budget:` line wins), refuses a run-data or missing story dir and an unknown role, and prints one line. SKILL.md tells the supervisor to use it instead of a heredoc. Reason: live run 26's supervisor hand-wrote 9 contracts (about 400 characters each of keys the harness owns), model output re-read on every later turn. Test: `scripts/test/budget-contract.test.py`.
Expand Down Expand Up @@ -53,6 +54,9 @@ tag in lockstep. Tag releases as `vMAJOR.MINOR.PATCH`.
- `make conformance` now covers ROADMAP §6.1 and §6.10–6.20 (except 6.15) by running the focused test of the tool that holds each item. Before this, its report said those items "do not exist yet", though they shipped in v0.12.0. It now reports 74 checks across 19 of the 20 items. §6.15 (re-decomposition) stays explicit: it is measured by live runs. CI's rust job sets up Node 22 for the OpenCode test.

### Fixed
- `gate-supervisor-scope` fails closed when `date` prints a non-number. Before this fix, bash 3.2 (the default `/bin/bash` on macOS) treated the bad lock-age check as "stale" and allowed the write. The new macOS CI job caught it.
- `e2e-live.sh` runs on a Mac: it used GNU `timeout`, which macOS lacks, so the supervisor CLI never started. It now falls back to `gtimeout`, then to a perl alarm. The new macOS CI job caught it.
- `gate-red-verify` suggests `pub fn` (not `pub struct`) for a missing lowercase name on macOS: its `[A-Z]*` pattern also matched lowercase names in a UTF-8 locale. It now uses `[[:upper:]]*`. A failing conformance check now prints its full block. The new macOS CI job caught it.
- `stats sprint-close` and the sprint charge compare story dirs by realpath, so a project reached through a symlink (every macOS temp dir: `/var` → `/private/var`) no longer counts 0 attempts, and `sprint1` no longer matches `sprint10`. Reason: `budget-soft-telemetry.test.py` failed on a Mac release run.
- `ensure-tools --resolve` skips any aloop plugin `bin/` on PATH, not only its own: another checkout's `ctx-symbols` shim ahead on PATH made `make conformance` hang. Reason: Mac release run.
- `e2e-live.sh` runs the supervisor CLI without the parent Claude Code session's id, SDK URL, memory store and messaging socket. Reason: live runs 32-34, started from an agent session, reported that session's id and recalled its team memory, so the measured supervisor was not a clean one.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ make publish # pushes branch + tags
- **shellcheck** — lints every gate script (`plugin/bin/*`), errors fail the build.
- **hosts** — byte-compiles the Python hooks, then Codex hooks emulation + the OpenCode
plugin end-to-end (no network, no tokens).
- **macos** — the same host tests and the conformance fixtures on macOS, where temp dirs sit
behind a symlink and the userland is BSD.
- **plugin** — JSON sanity on the manifest + marketplace, eval-suite validation, version
lockstep, then `claude plugin validate ./plugin --strict`.

Expand Down
2 changes: 1 addition & 1 deletion docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ original plan.
| **M5 — Narrow context** | v0.16 | Session 6: semantic execution map, shadow workspace, `target` / `context` CLI (§4.6) | done: targets, shadow workspace, `target`/`context`, LSP seam, GREEN scope from targets, and tasks.md/validate.md/plan.md rendered from the semantic plan (`targets render`; tests: `semantic-targets`, `lsp-adapter`, `targets-scope`, `plan-render`) |
| **M6 — Audit** | v0.17 | Sessions 7–8: event stream, rationale, authority, lineage query (§4.7); provider seam (§4.8) | done: `aladdin.event/1` stream, decisions, authority, lineage, `events trace SHA`, commit messages and graph export (§4.7); impact provider seam (§4.8) |
| **M7 — Any host** | v0.18 | Session 9: `HostAdapter`, capability matrix, `.aladdin/config.yaml`, host swap, metrics (§4.9–4.10) | done: `HostAdapter` + `host check` in CI, capability matrix, usage accuracy, `.aladdin/config.yaml` with migration, `host swap`, the full metrics table incl. context-window share (tests: `host-adapter`, `portable-config`, `host-swap`, `metrics`) |
| **M8 — Aladdin 1.0** | v1.0 | Session 10: `/aladdin` + `aladdin` CLI with aliases, site, measured public runs (§4.11). The rename to aloop shipped early in v0.11.0 | in progress: `bin/aladdin` + `/aladdin` with `aloop`/`agentic` aliases (test: `aladdin-cli.test.py`); natural-language auto-trigger on every host (`intent-trigger`, test: `intent-trigger.test.py`); README reordered product-first; site at `docs/index.html` (Pages switch is the owner's). evidence ledger `docs/evidence/README.md` + `run-summary` (test: `evidence.test.py`). `e2e-live.sh --host codex|opencode` runs the same loop on those hosts (`aloop install <host>` into the run repo, then `codex exec --json` / `opencode run --format json`; `--dry-run` prints the command; test: `e2e-live-hosts.test.py`). Open: the measured public runs themselves (this environment has no `codex`/`opencode` CLI: run `make e2e-live YES=1 HOST=codex` and `HOST=opencode` on a machine with both and add the rows; reason: a number we cannot measure is not published) Mac release run (2026-10-19) found two bugs Linux CI never sees, both fixed with tests: `stats sprint-close` counted 0 attempts when the project sat behind a symlink (macOS `/var` → `/private/var`; paths are now compared by realpath), and `make conformance` hung when another aloop checkout's `plugin/bin` was ahead on PATH (`ensure-tools --resolve` returned that checkout's shim; any aloop bin dir is now skipped). Next: a macOS CI job, so the next one is caught before a release (reason: both were found only by hand on the owner's Mac). |
| **M8 — Aladdin 1.0** | v1.0 | Session 10: `/aladdin` + `aladdin` CLI with aliases, site, measured public runs (§4.11). The rename to aloop shipped early in v0.11.0 | in progress: `bin/aladdin` + `/aladdin` with `aloop`/`agentic` aliases (test: `aladdin-cli.test.py`); natural-language auto-trigger on every host (`intent-trigger`, test: `intent-trigger.test.py`); README reordered product-first; site at `docs/index.html` (Pages switch is the owner's). evidence ledger `docs/evidence/README.md` + `run-summary` (test: `evidence.test.py`). `e2e-live.sh --host codex|opencode` runs the same loop on those hosts (`aloop install <host>` into the run repo, then `codex exec --json` / `opencode run --format json`; `--dry-run` prints the command; test: `e2e-live-hosts.test.py`). Open: the measured public runs themselves (this environment has no `codex`/`opencode` CLI: run `make e2e-live YES=1 HOST=codex` and `HOST=opencode` on a machine with both and add the rows; reason: a number we cannot measure is not published) Mac release run (2026-10-19) found two bugs Linux CI never sees, both fixed with tests: `stats sprint-close` counted 0 attempts when the project sat behind a symlink (macOS `/var` → `/private/var`; paths are now compared by realpath), and `make conformance` hung when another aloop checkout's `plugin/bin` was ahead on PATH (`ensure-tools --resolve` returned that checkout's shim; any aloop bin dir is now skipped). A `macos` CI job now runs the host tests and the conformance fixtures on macOS (reason: both were found only by hand on the owner's Mac). |

**Order rationale:** identity and conformance fixtures first, so every later change is
measured against today's behaviour; budgets and handoff next, because they shape every run;
Expand Down
2 changes: 1 addition & 1 deletion plugin/bin/gate-red-verify
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if [ "${GATE_RUN_TESTS:-auto}" != "0" ] && is_cargo_repo; then
if [ -n "$_missing" ]; then
_names="$(printf '`%s` ' $_missing)"; _shims=""
for _m in $_missing; do
case "$_m" in [A-Z]*) _shims="$_shims pub struct $_m; //" ;; *) _shims="$_shims pub fn $_m(…) -> … { todo!() } //" ;; esac
case "$_m" in [[:upper:]]*) _shims="$_shims pub struct $_m; //" ;; *) _shims="$_shims pub fn $_m(…) -> … { todo!() } //" ;; esac
done
fail "RED tests do NOT compile: they cannot find ${_names% }. RED's tests must compile and fail by assertion, so each missing item gets a shim in tests/common/mod.rs, marked // agentic:shim:${_shims%//} — and the test files call it through \`mod common;\` (common::$(printf '%s' "$_missing" | head -1)), not the crate; src/ is SCAFFOLD's and GREEN's."
fi
Expand Down
3 changes: 3 additions & 0 deletions plugin/bin/gate-supervisor-scope
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ lock_recent() {
[ -f "$lock" ] || return 1
local now m
now="$(date +%s 2>/dev/null)" || return 1
# A bad clock is a gate failure, not "lock is stale": bash 3.2 (macOS /bin/bash) does not
# abort on `$(( not-a-number ))` under set -u, so the arm below would quietly allow.
case "$now" in ''|*[!0-9]*) echo "$GATE_NAME: date +%s printed '$now'" >&2; exit 1 ;; esac
# GNU first: on Linux `stat -f` means "filesystem status" and prints a report instead of
# failing, which used to crash this arm (and a crashed hook does not block).
m="$(stat -c %Y "$lock" 2>/dev/null)" || m="$(stat -f %m "$lock" 2>/dev/null)" || return 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/conformance/claude-code.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def case(item, title, name, cwd, expect, must_say=None, extra=None, agent_type=N
blocks = [l for l in lines if l.startswith("BLOCK[")]
good = rc == expect and (must_say is None or any(must_say in l for l in (blocks if expect else lines)))
detail = blocks[0] if blocks else (lines[-1] if lines else "")
results.append((item, title, good, "exit %d (want %d) %s" % (rc, expect, detail[:140])))
results.append((item, title, good, "exit %d (want %d) %s" % (rc, expect, detail if not good else detail[:140])))


def commit(wt, msg):
Expand Down
8 changes: 6 additions & 2 deletions scripts/smoke/e2e-live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ if [ -n "$DRY" ]; then echo "cmd: ${CMD[*]}"; [ -n "$STDIN_PROMPT" ] && echo "pr
unset CLAUDE_CODE_SESSION_ID CLAUDE_CODE_REMOTE_SESSION_ID CLAUDE_CODE_REMOTE_SDK_URL \
CLAUDE_COWORK_MEMORY_PATH_OVERRIDE CLAUDE_MEMORY_STORES \
CLAUDE_CODE_MESSAGING_SOCKET CLAUDE_CODE_MESSAGING_TOKEN
# macOS has no GNU `timeout` (coreutils installs it as gtimeout); perl's alarm survives exec.
if command -v timeout >/dev/null; then TO=(timeout "$TIMEOUT")
elif command -v gtimeout >/dev/null; then TO=(gtimeout "$TIMEOUT")
else TO=(perl -e 'alarm shift; exec @ARGV or die "exec: $!\n"' "$TIMEOUT"); fi
start=$(date +%s)
if [ -n "$STDIN_PROMPT" ]; then
timeout "$TIMEOUT" "${CMD[@]}" <<<"$PROMPT" > "$T/out.jsonl" 2> "$T/err.log"
"${TO[@]}" "${CMD[@]}" <<<"$PROMPT" > "$T/out.jsonl" 2> "$T/err.log"
else
timeout "$TIMEOUT" "${CMD[@]}" > "$T/out.jsonl" 2> "$T/err.log" </dev/null
"${TO[@]}" "${CMD[@]}" > "$T/out.jsonl" 2> "$T/err.log" </dev/null
fi
rc=$?
secs=$(( $(date +%s) - start ))
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/budget-roles.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def call(agent, role, tokens, mode="post"):
copy = os.path.join(wt, ".aladdin", "task.env") # a fresh project: markers live in .aladdin/
assert os.path.isfile(copy) and "TASK_ID=S1-SR-W1" in open(copy).read(), copy
s = state("r2")
assert s["observe"] and s["task"] == "S1-SR-W1" and s["story_dir"] == story and s["worktree"] == wt, s
assert s["observe"] and s["task"] == "S1-SR-W1" and s["story_dir"] == story and os.path.realpath(s["worktree"]) == os.path.realpath(wt), s
ok("an observed role in a host worktree gets the contract copy (selfcheck finds its task); state names the task")

# 6) Claude Code prepends a session-context attachment line (renderedRole "user", no TASK_ID)
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/layout.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def ok(name):


def fresh():
t = tempfile.mkdtemp(prefix="agentic-layout-")
t = os.path.realpath(tempfile.mkdtemp(prefix="agentic-layout-")) # git reports /private/var on macOS
subprocess.run(["git", "init", "-q", "-b", "main"], cwd=t, check=True)
return t

Expand Down
Loading
0