Skip to content

Pin what a non-object tags value from untyped code does - #43

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/non-object-tags
Nov 14, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/non-object-tags

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle, with one matching README sentence. No behavior changed.

  • A characterization test is added: report() given a tags value that is not an object (null, 42, "loose", true, as untyped code may pass) sends the event with only { version } and writes nothing to debug. That branch of withVersion() (tags && typeof tags === "object") had no test. The new test sits next to the existing one for a non-object options.
  • The README's tag-cleaning paragraph under "Options and limits" now says what happens in that case.

No tracking issue: the gap was found during triage.

Triage notes

Cross-client parity

No behavior that another client could observe was changed, so trace-client-python and trace-client-java need nothing.

CHANGELOG

No entry was added. No behavior changed and nothing a consumer would re-vendor for was touched: the diff is one test and one README sentence describing existing behavior.

Test plan

  • CI test job (npm ci, npm run typecheck, npm test on Node 22) is green on the PR head, and its test count is one higher than on main.
  • Local run: UNVERIFIED. Node is not installed in the dispatch environment, so CI is the gate.

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

report() ignores a tags value that is not an object (null, a string, a
number, a boolean) and sends the event with only the client's own tags,
logging nothing. No test covered that branch of withVersion, and the README
said nothing about it. No behavior changed.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 43551164740):

  • Scope: PASS. Two files: one test in tests/trace-client.test.ts and one README sentence describing the branch that test pins. No unrelated churn.
  • Tests-new: PASS (not applicable). No public member was added.
  • Tests-fix: not applicable. No production code changed (git diff origin/main -- trace-client.ts is empty), so there is no fix to revert.
  • Sibling structure: PASS. The test is in the TraceClient block next to the options counterpart ("sends the event when untyped code passes null or a non-object as options"), with the same shape, assertions and debug log check.
  • Sibling renames: not applicable.
  • Docs: PASS. The README tag-cleaning paragraph now covers the non-object case. The TSDoc for ReportOptions.tags stays typed as Record<string, string>, the same as how the options case is left undocumented in the TSDoc.
  • Issue resolution: not applicable. No Closes.
  • CI: PASS. The test job is green on the head. # tests 83, # pass 83, # fail 0, against 82 on main run 43358567110. The new test ran as ok 29.
  • Zero-dependency: PASS. No imports were added.
  • Edge gate intact: PASS. tsconfig.json is untouched, and typecheck is green.
  • Never-throws / no console / export surface / version agreement: PASS. trace-client.ts is unchanged.
  • Changelog: PASS. No user-visible change was made to trace-client.ts, so no entry is needed.
  • Cross-client parity noted: PASS. The PR body says no counterpart change is needed.

Observations (judgment, not blocking):

  • README.md:248: "only the client's own tags" covers version plus install when an ID is configured. The test exercises only the no-ID case, so the install half of that sentence is backed by the separate withInstall tests rather than this one.
  • tests/trace-client.test.ts:569: an array passed as tags is an object and goes through the normal path, so ["a"] would send {"0":"a", ...}. That case was deliberately left uncharacterized so that arguably odd behavior is not pinned. The README wording ("not an object at all") stays accurate for it.

Local anchor: UNVERIFIED. Node is absent from the dispatch environment, so CI on the exact head SHA is the gate.

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


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson

Copy link
Copy Markdown
Member Author

Correction to the self-review above: the first observation's README citation should read README.md:157, not README.md:248. The finding itself is unchanged.

Docs check (Phase 7) passed. The changed files (README.md, tests/trace-client.test.ts) match nothing on the do-not-auto-merge list, so the PR is being squash-merged.

This 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 40abcd4 into main Nov 14, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feat/non-object-tags branch November 14, 2026 03:22
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