beads/cmd/bd/protocol
Karel Bourgois b396366151
test(protocol): propagate TZ to the bd subprocess (#6097)
TestProtocol_FieldsRoundTrip fails on any machine whose TZ differs from its
system zone:

    roundtrip_test.go:99: field "due_at" = "2099-03-14T23:00:00Z", want prefix "2099-03-15"
    roundtrip_test.go💯 field "defer_until" = "2099-01-14T23:00:00Z", want prefix "2099-01-15"

workspace.env() builds a WHITELIST environment for the bd child (PATH, HOME,
GIT_CONFIG_NOSYSTEM, BEADS_TEST_MODE, BD_DISABLE_METRICS, optionally
BEADS_DOLT_PORT and TMPDIR). TZ is not on it, so the child inherits none and its
time.Local falls back to /etc/localtime, while the TEST process uses its own TZ.

The assertion computes its expectation from the PARENT's time.Local:

    dueLocal, _ := time.ParseInLocation("2006-01-02", "2099-03-15", time.Local)
    assertFieldPrefix(t, issue, "due_at", dueLocal.UTC().Format("2006-01-02"))

and compares it to a value the CHILD produced, so the two disagree whenever the
zones differ. Reproduced on macOS with a Europe/Paris system zone and TZ=UTC:
the parent expects 2099-03-15, the child stores local midnight in Paris and the
UTC form is 2099-03-14T23:00:00Z.

Not a product defect — date-only input parsed as local midnight and stored as
UTC is the documented behavior, and both processes implement it correctly. They
simply disagree about which zone is local. CI does not see it because its
runners have TZ unset AND a UTC system zone, so both sides agree by accident.

Fixed by propagating TZ into the child env, so the two share one notion of
local. Verified on a Europe/Paris system zone: the test fails on main under
TZ=UTC and passes with this change under TZ=UTC, TZ=Europe/Paris and
TZ=America/Los_Angeles (the west-of-UTC case the assertion's comment calls out).
2026-09-02 17:34:01 -07:00
..
testdata/corpus ci: add advisory cyclomatic complexity reporting (#6081) 2026-08-30 19:05:17 -07:00
assignee_test.go test(protocol): pin data-model + ready-front production-scar clauses (wy-nzybu) 2026-07-13 09:46:16 -07:00
blocked_status_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
blocked_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
blocking_semantics_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
canonicalize_test.go test(protocol): make corpus determinism pure (bd-qq1qn) (#5281) 2026-08-02 07:14:30 -07:00
CATALOG.md Merge remote-tracking branch 'upstream/main' into pr-4232-fix 2026-07-13 20:43:10 -07:00
child_id_test.go test(protocol): pin data-model + ready-front production-scar clauses (wy-nzybu) 2026-07-13 09:46:16 -07:00
children_test.go fix(cli): implement children pretty and defer reason 2026-06-13 21:22:38 -07:00
close_guard_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
comments_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
corpus.go fix(show): expose guarded-write revision in JSON (#5353) 2026-08-05 19:51:49 -07:00
corpus_test.go test(protocol): make corpus determinism pure (bd-qq1qn) (#5281) 2026-08-02 07:14:30 -07:00
defer_test.go fix(cli): implement children pretty and defer reason 2026-06-13 21:22:38 -07:00
dep_identity_test.go test(protocol): pin data-model + ready-front production-scar clauses (wy-nzybu) 2026-07-13 09:46:16 -07:00
errors_contract_test.go test(protocol): pin §E/§M/§V conformance clauses at the CLI level (wy-ge2h8) 2026-07-13 10:30:24 -07:00
exit_codes_init_test.go test(protocol): pin §E/§M/§V conformance clauses at the CLI level (wy-ge2h8) 2026-07-13 10:30:24 -07:00
exit_codes_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
helpers_test.go test(protocol): propagate TZ to the bd subprocess (#6097) 2026-09-02 17:34:01 -07:00
input_validation_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
interchange_test.go test(protocol): pin the §J interchange clauses; fix the bd import header gap (wy-ltox1) 2026-07-13 11:20:06 -07:00
json_contract_test.go fix(show): flag comment_count as omitted when comments are not streamed (#4865) 2026-07-25 16:16:41 -07:00
lease_claim_test.go test: fix red main — init-cancel E2E deadline + reclaim JSON assertion (#5039) 2026-07-25 10:10:18 -07:00
lifecycle_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
memory_contract_test.go test(protocol): pin §E/§M/§V conformance clauses at the CLI level (wy-ge2h8) 2026-07-13 10:30:24 -07:00
preservation_test.go test(protocol): realign show --json contract tests with count-only payload (wy-017ry) 2026-07-13 10:08:34 -07:00
ready_front_test.go test: make ready ordering setup deterministic (bd-y9cjq) (#5238) 2026-08-01 09:55:11 -07:00
roundtrip_test.go test(protocol): realign show --json contract tests with count-only payload (wy-017ry) 2026-07-13 10:08:34 -07:00
stale_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
status_validation_test.go feat(test): parallelize protocol tests for 3x speedup (bd-dgp) 2026-02-27 20:04:00 -08:00
versioning_contract_test.go test(protocol): pin §E/§M/§V conformance clauses at the CLI level (wy-ge2h8) 2026-07-13 10:30:24 -07:00
wp4_helpers_test.go test(protocol): pin §E/§M/§V conformance clauses at the CLI level (wy-ge2h8) 2026-07-13 10:30:24 -07:00