mesh-knowledge: the bus test passes on any day (issue 540) #235

Merged
mesh-admin merged 1 commits from fix/540-knowledge-test-clock into main 2026-10-12 10:31:19 +00:00
Contributor

What. The bundle that TestTheKnowledgeBaseOverTheBus starts (built in the test's own TestMain) now gets a fixed clock, bundleDay = 2026-10-11 09:00 UTC, the day the fixture's proposal (valid) is dated. Test code only; no production change.

Why. The bundle ran on the real clock, so it dated the reservation of ADR 0300 from today, while the proposal kept the fixture's 2026-10-11. From 2026-10-12 on, the date rule (a new record is dated from the day its number was reserved) refused it, and the test failed on main. The in-process tests already inject the same clock through newWorld; the bus test's subprocess did not.

How it was tested.

  • On main today (2026-10-12): go test -run TestTheKnowledgeBaseOverTheBus fails with date: a new record is dated from the day its number was reserved, 2026-10-12, not 2026-10-11.
  • On this branch: it passes; go vet and go test ./... of modules/mesh-knowledge pass.
  • MESH_CHECK_MODULES=mesh-knowledge sh merge-check.sh passes locally (words, agent-home, paths, module tests; the manifest read was NOT CHECKED locally, no controller built beside it).

Fixes issue 540.

**What.** The bundle that `TestTheKnowledgeBaseOverTheBus` starts (built in the test's own `TestMain`) now gets a fixed clock, `bundleDay` = 2026-10-11 09:00 UTC, the day the fixture's proposal (`valid`) is dated. Test code only; no production change. **Why.** The bundle ran on the real clock, so it dated the reservation of ADR 0300 from today, while the proposal kept the fixture's 2026-10-11. From 2026-10-12 on, the date rule (a new record is dated from the day its number was reserved) refused it, and the test failed on main. The in-process tests already inject the same clock through `newWorld`; the bus test's subprocess did not. **How it was tested.** - On main today (2026-10-12): `go test -run TestTheKnowledgeBaseOverTheBus` fails with `date: a new record is dated from the day its number was reserved, 2026-10-12, not 2026-10-11`. - On this branch: it passes; `go vet` and `go test ./...` of modules/mesh-knowledge pass. - `MESH_CHECK_MODULES=mesh-knowledge sh merge-check.sh` passes locally (words, agent-home, paths, module tests; the manifest read was NOT CHECKED locally, no controller built beside it). Fixes issue 540.
mesh-admin added 1 commit 2026-10-12 10:23:46 +00:00
mesh-knowledge: give the bus test's bundle a fixed clock, so it passes on any day (issue 540)
mesh/delivery delivered
mesh/merge-gate pass: the change touches no module of the mesh's graph
mesh/repo-check pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
7628b0e5b9
The bundle dated a reservation from the real day while the proposal kept the
fixture's 2026-10-11, so the date rule refused it on every later day.
Author
Contributor

Delivery novox/mesh-catalog@7628b0e5b9f8 — delivered since 2026-10-12T10:31:22Z

Delivery plan — builds nothing: the change touches no module of the mesh's graph

Transitions

  • 2026-10-12 10:23 (new) → proposed (announced): novox/mesh-catalog#235's head announced
  • 2026-10-12 10:27 proposed → checked (checked): the verdict names this commit
  • 2026-10-12 10:27 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-12 10:31 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-12 10:31 published → delivered (done): nothing for a walk to move

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@7628b0e5b9f8` — **delivered** since 2026-10-12T10:31:22Z **Delivery plan** — builds nothing: the change touches no module of the mesh's graph **Transitions** - 2026-10-12 10:23 (new) → proposed (announced): novox/mesh-catalog#235's head announced - 2026-10-12 10:27 proposed → checked (checked): the verdict names this commit - 2026-10-12 10:27 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-12 10:31 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-12 10:31 published → delivered (done): nothing for a walk to move The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
Author
Contributor

Verdict: approve at 7628b0e

Checked independently in a fresh clone (mesh-catalog-235-review):

  • The diff touches only modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go, adding bundleDay and setting k.Now on the bundle TestMain starts for the bus test's subprocess. No production file changes.
  • Production still uses the real clock: main() builds the KB with newKB(st) (main.go), which does not set Now, so (*KB).now() (kb.go:103-108) falls through to time.Now().UTC(). Only the test's own bundle process gets the fixed Now, matching how newWorld already fixes the clock for the in-process tests.
  • Reproduced the failure on main at today's date (2026-10-12): TestTheKnowledgeBaseOverTheBus fails with date: a new record is dated from the day its number was reserved, 2026-10-12, not 2026-10-11 — exactly the error the PR body describes. Checking out the head commit's kit_test.go makes it pass.
  • grep -rn "time.Now()" **/*_test.go in the module finds only the poll-deadline in bus_test.go (time.Now().Add(5*time.Second) / time.Now().Before(deadline)), which is a timeout guard, not date-dependent assertion logic. No other test depends on the real date.
  • go vet ./... is clean; go test ./... passes (16s) in modules/mesh-knowledge at the head commit.
  • mesh/merge-gate and mesh/repo-check are both green on 7628b0e (merge-gate: "the change touches no module of the mesh's graph"; repo-check: "its merge-check.sh passed").

Test-only change, cause and fix both confirmed, no sign of a hidden production date bug.

Verdict: approve at 7628b0e Checked independently in a fresh clone (`mesh-catalog-235-review`): - The diff touches only `modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go`, adding `bundleDay` and setting `k.Now` on the bundle `TestMain` starts for the bus test's subprocess. No production file changes. - Production still uses the real clock: `main()` builds the KB with `newKB(st)` (`main.go`), which does not set `Now`, so `(*KB).now()` (`kb.go:103-108`) falls through to `time.Now().UTC()`. Only the test's own bundle process gets the fixed `Now`, matching how `newWorld` already fixes the clock for the in-process tests. - Reproduced the failure on main at today's date (2026-10-12): `TestTheKnowledgeBaseOverTheBus` fails with `date: a new record is dated from the day its number was reserved, 2026-10-12, not 2026-10-11` — exactly the error the PR body describes. Checking out the head commit's `kit_test.go` makes it pass. - `grep -rn "time.Now()" **/*_test.go` in the module finds only the poll-deadline in `bus_test.go` (`time.Now().Add(5*time.Second)` / `time.Now().Before(deadline)`), which is a timeout guard, not date-dependent assertion logic. No other test depends on the real date. - `go vet ./...` is clean; `go test ./...` passes (16s) in `modules/mesh-knowledge` at the head commit. - `mesh/merge-gate` and `mesh/repo-check` are both green on 7628b0e (merge-gate: "the change touches no module of the mesh's graph"; repo-check: "its merge-check.sh passed"). Test-only change, cause and fix both confirmed, no sign of a hidden production date bug.
mesh-admin merged commit d06733c490 into main 2026-10-12 10:31:19 +00:00
mesh-admin deleted branch fix/540-knowledge-test-clock 2026-10-12 10:31:19 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#235