Skip to content

test(tmproto): pin unknown-type and unknown-method wantErr substrings#204

Draft
bokelley wants to merge 1 commit into
mainfrom
claude/issue-200-tighten-robustness-wanterr
Draft

test(tmproto): pin unknown-type and unknown-method wantErr substrings#204
bokelley wants to merge 1 commit into
mainfrom
claude/issue-200-tighten-robustness-wanterr

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #200.

Tightens two overly-broad wantErr substrings in tmproto/robustness_test.go that were too generic to catch wrong-error regressions:

  • TestArtifactRef_Validate "unknown type": "type""not a known ArtifactRefType"
  • TestAssetAccess_Validate "unknown method": "method""not a known AssetAccessMethod"

The old substrings matched any error containing the field-name prefix (artifact_ref.type, asset_access.method), so a regression that returned a different error class (e.g., "required" instead of "not a known …") would still pass. The new substrings pin the exact discriminating phrases already emitted by validate_ladder.go, making wrong-error regressions visible while keeping the no-caller-bytes invariant intact (wantNot guards are unchanged). No production code touched.

What tested

  • go build ./... — clean
  • go vet ./tmproto/... — clean
  • go test ./tmproto/... ok 0.035s — all 195 tests pass including the two tightened cases
  • go test ./... ok — full root-module suite passes

Pre-PR review

  • code-reviewer: approved — new wantErr substrings confirmed as verbatim substrings of production errors; wantNot guards preserved; no production code changed; no blockers
  • ad-tech-protocol-expert: approved — pins closed-enum rejection class correctly per TMP sanitization policy; no blockers

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or request a new first draft PR: comment /triage execute
    on the source issue only when no triage-managed PR is already
    open. Triage does not update existing PRs.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01MjgZzyRVRrXju1ozznUSLT


Generated by Claude Code

Tighten two overly-broad wantErr assertions in robustness_test.go:
- ArtifactRef "unknown type": "type" → "not a known ArtifactRefType"
- AssetAccess "unknown method": "method" → "not a known AssetAccessMethod"

The old substrings matched any error containing the field name prefix,
making wrong-error regressions invisible. The new substrings pin the
exact discriminating phrases already emitted by validate_ladder.go,
so a regression to a different error class still fails while preserving
the no-caller-bytes invariant (wantNot guards unchanged).

Closes #200.

https://claude.ai/code/session_01MjgZzyRVRrXju1ozznUSLT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten TMP sanitization regression assertions

2 participants