Skip to content

ci: restore the gitignored migration fixtures and fix the config cache leaking across homes - #48

Merged
enowdev merged 1 commit into
mainfrom
fix/go-ci-fixtures
Nov 5, 2026
Merged

enowdev merged 1 commit into
mainfrom
fix/go-ci-fixtures

Conversation

@enowdev

@enowdev enowdev commented Nov 5, 2026

Copy link
Copy Markdown
Owner

go test ./... fails on every checkout of main, and only on CI. Two independent causes, both fixed here; no test is skipped, weakened or deleted.

1. The migration fixtures were never committed

.gitignore had an unanchored AGENTS.md line under "local agent/editor tooling". Unanchored, it also matched the fake homes of other agents under internal/migrate/testdata — nanobot, OpenClaw, OpenHuman and ZeroClaw all keep their own AGENTS.md, and OpenHuman's memory/memory.db fell under *.db.

Evidence:

$ git check-ignore -v internal/migrate/testdata/nanobot/home/.nanobot/workspace/AGENTS.md
.gitignore:35:AGENTS.md	internal/migrate/testdata/nanobot/home/.nanobot/workspace/AGENTS.md
$ git ls-tree -r --name-only 288416f | grep -E 'testdata/.*(AGENTS|CLAUDE\.local)\.md$'
(no output — never tracked in any commit; no dangling blob in the object store either)

So the files existed only on the machine that wrote the goldens, and TestNanobotPlanGolden, TestNanobotConflicts, TestNanoclawDetect, TestNanoclawPlanV2, TestOpenClawPlan, TestOpenhumanDetect, TestOpenhumanPlan, TestZeroclawDetect and TestZeroclawPlan failed everywhere else.

The fix anchors the rule to /AGENTS.md (repo root only) and un-ignores the fixture .db, then commits the fixtures themselves.

About the golden updates

Four goldens change, and every changed line is a fingerprint of the restored fixture bytes:

golden changed line
nanobot/plan.golden agents_md sha=
openclaw_plan.txt agents_md sha=, role:work prompt_sha=
openhuman/plan.golden agents_md sha=
zeroclaw/plan_v3.golden agents_md sha=, role:coder prompt_sha=

The original bytes are not recoverable — they were never in git history and no dangling blob holds them, so the fixtures are reconstructed. What is recoverable is exact: each golden records the trimmed byte length of the text it rendered (113 / 42 (x2) / 80 chars) and the NanoClaw memory entry's own text, so the reconstructions hit those lengths to the byte. Only ContentHash output moved; every status, reason, count, order and summary line in those goldens is byte-identical, and the OpenHuman memory.db warning and both role items are preserved (the first attempt at -update silently dropped them, which is how this was caught). Run with -update twice and the diff is empty.

2. config.Load() served a config from the wrong home

The cache ignored which home it came from, so tests that set ANTARES_HOME per test got the previous test's config:

$ go test ./cmd/antares -run 'TestDaemonStateRoundTripAndStaleCleanup|TestDevicePairCLI'
--- FAIL: TestDevicePairCLI
    device_test.go:44: url without a daemon should come from config: "http://127.0.0.1:1"

TestDevicePairCLI sets ANTARES_PORT=18999, but Load() returned the config cached for the previous test's home, whose config.yaml pins port 1. Run alone, it passes. This is a real bug beyond tests: anything that changes ANTARES_HOME/ANTARES_CONFIG in-process got another directory's settings. The cache now records the home and config path it was loaded from and only serves itself while both still match.

Verification

  • go vet ./... clean, go test ./... green (previously 10 failures)
  • git status --ignored under testdata is empty — nothing else is silently missing
  • Fixture lengths verified against every golden's documented · N chars

CI on this PR is the real check: the smoke job has been skipped on main for weeks because it needs go and web, so it runs again here.

…e leaking across homes

`go test ./...` failed on every checkout of main, and only on CI, because of
two independent bugs.

1. The migration fixtures were never committed. `.gitignore` had an
   unanchored `AGENTS.md` rule under "local agent/editor tooling", which
   also matched the fake agent homes under `internal/migrate/testdata`
   (nanobot, openclaw, openhuman, zeroclaw, nanoclaw all ship their own
   AGENTS.md, and OpenHuman's memory.db fell under `*.db`). The files
   existed only on the machine that wrote the goldens, so every golden
   test that rendered them failed everywhere else. Anchoring the rule to
   `/AGENTS.md` and un-ignoring the fixture `.db` restores them, and this
   commit adds the fixture files themselves.

   Fixture contents were rewritten to the byte lengths the committed
   goldens record (113/42/42/80 chars, and the two role prompts), so the
   only golden lines that move are the `sha=`/`prompt_sha=` fingerprints
   those bytes feed. No assertion, expectation or status changed: every
   item is still ready/conflict exactly as before.

2. `config.Load()` served its cached config without checking which home it
   came from. Tests that set ANTARES_HOME per test got the previous test's
   config, so `TestDevicePairCLI` read the port from
   `TestDaemonStateRoundTripAndStaleCleanup`'s config.yaml (1 instead of
   18999) and failed depending on test order. The cache now records the
   home and config path it was loaded from and only serves itself while
   both still match. This is a real bug outside tests too: anything that
   changes ANTARES_HOME or ANTARES_PROFILE in-process got stale settings.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@enowdev
enowdev merged commit 91d0048 into main Nov 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant