Skip to content

Pin non-string opt-out values and the 255-character install ID - #40

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/untested-input-boundaries
Nov 11, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/untested-input-boundaries

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle: two branches of the client that no test exercised are now pinned to their current behavior. No production code is changed.

  • environmentOptsOut with non-string values. An environment from untyped code may carry 1, true, null, an array, or an object whose toString() gives "off". matches() accepts only strings, so none of these opt out, and the program's own setting stays in charge (disabledReason is null). This matches the documented rule that only the listed string values opt out.
  • installIdFromFile at the 255-character limit. The existing test covers a 256-character line being rejected. The new test checks that a line of exactly 255 characters, padded with spaces, is returned trimmed and that the file is not rewritten.

A third candidate, report() with a non-string name, turned out to be covered already by logs nothing for a report that was never going to be sent, so it was dropped.

Test plan

  • CI test job green on the PR head (npm ci, npm run typecheck, npm test), with the executed-test count two higher than on main
  • Local anchor: UNVERIFIED. In this environment node is absent and npm resolves to a Windows install, so CI on the head SHA is the gate.

Not picked this cycle

Cross-client parity and changelog

  • No cross-client-visible behavior changed. trace-client-python and trace-client-java need no matching change.
  • CHANGELOG.md: no entry. The change is test-only, with nothing user-visible.

No tracking issue: these gaps were found during triage.

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

An opt-out variable that is not a string (a number, boolean, array or
object from untyped code) opts nothing out and leaves the program's own
setting in charge. An install-ID line of exactly 255 characters is read
as the ID and the file is left as it is.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (head of feat/untested-input-boundaries):

  • Scope: PASS. git diff --stat origin/main touches only tests/trace-client.test.ts, and both additions are tests for the gaps named in the PR body.
  • Tests-new: PASS (not applicable). No new public member was added.
  • Tests-fix: not applicable. This is a characterization-only cycle with no production change.
  • Sibling structure: PASS. Each test sits in its matching describe block (environment opt-outs, installation ID) and follows that block's style: an env option, the dir temp directory, and every enabled client close()d.
  • Sibling renames: not applicable. Nothing was renamed.
  • Docs: PASS. The new tests assert what the TSDoc already says: only the listed string values opt out, and an ID is at most 255 characters. No doc changes were needed.
  • Issue resolution: not applicable. There are no Closes. The PR body records why An application name a header cannot carry drops every report #36 and A malformed enabled option fails open: only the literal false opts out #37 were skipped.
  • CI: PASS. Run 42953472879 shows # tests 80, # pass 80, # fail 0, # cancelled 0. main ran 78, and both new subtests appear as ok.
  • Zero-dependency / Edge gate / export surface / no console / never-throws: PASS. trace-client.ts, tsconfig.json and package.json are untouched, and no new imports were added to the tests.
  • Version agreement / Changelog: PASS. There is no version change, and a test-only change is not user-visible.
  • Cross-client parity noted: PASS. The PR body states that no cross-client-visible behavior changed.

Judgment note: tests/trace-client.test.ts (the non-string opt-out test) pins the fail-open direction for a malformed environment value. This matches the documented rule that only the listed strings opt out, but it is the same question #37 raises about enabled. If the owner decides #37 toward fail-closed and wants the environment variables to follow, this test is the one to update.

Local anchor UNVERIFIED (no node in the dispatch environment). CI on the exact head SHA is the gate.

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

drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit abd88d7 into main Nov 11, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feat/untested-input-boundaries branch November 11, 2026 03:33
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