Skip to content

Pin that a clear on never undoes another switch's opt-out - #47

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/pin-no-switch-back-on
Nov 20, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/pin-no-switch-back-on

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Stage B (unit-test expansion) cycle for the environment opt-outs. One test is added to the environment opt-outs block. It pins the promise in the README ("nothing in this client ever turns a switch back on") and in the TraceClient doc comment ("nothing in this client turns a switch back on").
  • No existing test covered it. TRACE_USAGE_REPORTING set to a clear "on" (on, true, yes, 1, any case) alongside DO_NOT_TRACK=1 was never exercised. Neither was enabled: true (or a string "on") alongside an environment opt-out: the precedence test only uses enabled: false.
  • The new test asserts the current behavior: environmentOptsOut returns true, disabledReason is "environment", enabled is false, and the server receives nothing.

A Stage A documentation sweep was run first. README, TSDoc, CHANGELOG, package.json, tsconfig.json and ci.yml were checked against trace-client.ts, and no drift was found. The [Unreleased] CHANGELOG heading for 0.5.0 was left alone, because cutting the release is the owner's call.

Test plan

  • CI test job green on the head SHA (npm run typecheck, npm test), with pass count equal to test count (91 expected)
  • Local anchor UNVERIFIED: Node is not available in this checkout, so CI on the head SHA is the gate.

Triage notes

No tracking issue: the gap was found during triage.

Cross-client and changelog

  • No cross-client-visible behavior changed: this PR adds a test only. Whether trace-client-python and trace-client-java pin the same promise could not be checked from this run.
  • No CHANGELOG.md entry, since nothing user-visible changed.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

The README and the TraceClient doc comment promise that nothing in the
client turns a switch back on. No test covered it: TRACE_USAGE_REPORTING=on
alongside DO_NOT_TRACK=1, and enabled: true alongside an environment
opt-out, were never exercised. Test only; no behavior changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (head f09f603, CI run 44694829386):

  • Scope: PASS. Only tests/trace-client.test.ts is modified (+20 lines, one new it in environment opt-outs). No production, config or doc file is touched.
  • Tests-new: PASS (not applicable). No new public member. The new test exercises TraceClient.environmentOptsOut, the constructor's opt-out precedence, enabled and disabledReason.
  • Tests-fix: not applicable. Characterization only; no production code changed, so there is no fix to revert.
  • Sibling structure: PASS. Same shape as the neighbouring fails closed: … tests: per-value assertion messages, env option rather than process.env, await sleep(100) then capture.requests checked empty.
  • Sibling renames: not applicable. Nothing was renamed.
  • Docs: PASS. The test pins existing README ("nothing in this client ever turns a switch back on") and TSDoc (trace-client.ts:141) text; no doc changes needed. A Stage A sweep found no drift elsewhere.
  • Issue resolution: not applicable. No Closes; the gap was found during triage.
  • CI: PASS. test job green; log shows # tests 91, # pass 91, # fail 0, # cancelled 0, and ok 9 - never lets a clear on turn another switch's opt-out back on.
  • Zero-dependency: PASS. No import added; trace-client.ts unchanged.
  • Edge gate intact: PASS. tsconfig.json unchanged; npm run typecheck green in CI.
  • Never-throws / No console / Export surface / Version agreement: PASS. trace-client.ts is untouched, so none of these can have moved.
  • Changelog: PASS. No user-visible change, so no entry is needed.
  • Cross-client parity noted: PASS. The PR body states that no cross-client-visible behavior changed.

Judgment call flagged: tests/trace-client.test.ts:1449 uses await sleep(100) before asserting nothing arrived, as the sibling tests do. Every client here is disabled, so report() resolves without any request and the wait only guards against a regression that starts sending. It cannot flake toward a false failure.

Local anchor UNVERIFIED (no Node in this checkout); CI on the head SHA was the gate. Do-not-auto-merge list: no match (test file only).

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 07f6660 into main Nov 20, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feat/pin-no-switch-back-on branch November 20, 2026 07:26
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