test(e2e): run harness under SPAXEL_MIGRATION_WINDOW_HOURS=0 (bf-qzrmq)

Isolate the window-independence harness change in TestHarness.Start: set
SPAXEL_MIGRATION_WINDOW_HOURS=0 (the strict window, not the open 24h
default) so the e2e no-reject path actually proves token-based admission
regardless of the migration window, instead of silently passing on the
implicit/explicit 24h crutch. A comment documents the bf-4mle6 / bf-qzrmq
policy and why spaxel-sim nodes connect on real HMAC tokens rather than
the window.

This is the commit-hygiene half of bf-qzrmq: it stages ONLY the env-var +
comment (concern A). The unrelated IO-6 hard-gate test code
(TestIO6HardGate_WalkerProducesTrackedBlob, CaptureIO6Diagnostics,
GetNodeRecords, GetStatus, io6RunMaxima + the "strings" import — concern B,
belonging to bf-4q5w) is deliberately left uncommitted in the working tree.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-07-07 12:24:57 -04:00
parent 9c38cbb9ef
commit 250056cb56

View file

@ -82,6 +82,23 @@ func (h *TestHarness) Start(ctx context.Context) error {
"SPAXEL_DATA_DIR="+tmpDir,
"SPAXEL_LOG_LEVEL=info",
"TZ=UTC",
// Window-independent auth policy (bf-4mle6 / bf-qzrmq): run the harness
// under the STRICT window (SPAXEL_MIGRATION_WINDOW_HOURS=0) — NOT the open
// 24h default — so the no-reject e2e path actually PROVES token-based
// admission regardless of window, instead of silently passing on the
// implicit/explicit 24h crutch.
//
// This works because spaxel-sim (child bf-ekr9c) defaults to --provision:
// resolveTokens() mints a REAL per-node HMAC-SHA256(installSecret, mac)
// token from the mothership /api/provision endpoint and presents it as the
// X-Spaxel-Token header on each node's WS dial. The ingestion server
// (bf-1o7qi) bridges that header into hello.Token, and the always-wired
// validator (main.go SetTokenValidator) accepts a valid token REGARDLESS of
// the migration window — server.go only falls through to the window branch
// for an empty/invalid token, and =0 leaves the deadline zero (past), so a
// tokenless node WOULD be rejected. The sim nodes therefore connect purely
// on the strength of their real tokens, not the window.
"SPAXEL_MIGRATION_WINDOW_HOURS=0",
)
h.MothershipCmd.Stdout = io.Discard
h.stderrBuf = &bytes.Buffer{}