chore: use placeholder identifiers in fixtures and docs - #110
Merged
Conversation
Fixtures carried identifiers copied from a live tenant, and a few doc and comment lines quoted counts from one. Placeholders are better on their own terms: stable, self-describing, and impossible to go stale. A copied identifier addresses nothing a reader owns, and a copied count is out of date the moment it is written. Documentation should state what the API does. Where a measurement backs a claim, the claim belongs in the docs and the measurement in working notes, so the wording here now says what happens rather than where it was seen. TestNoLabTenantDataInRepo keeps all three properties: placeholder ids in literals, no tenant-specific hostname, and no doc line pinned to a particular tenant. It matches identifiers only inside string literals, since a bare 27-character token is a Go identifier rather than data, and allows two documented product constants. Verified the guard fails on each pattern it covers and passes on a clean tree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
setOwnersSuccessFmt's comment carried a tenant measurement ("[] on all 46
apps measured, 45 of which did have owners"). State the behavior instead.
The changelog entry claimed placeholders and note-kept measurements
"throughout"; README, cmd/agents.md and earlier changelog entries still
carry tenant figures, so scope the claim to what the guard enforces.
Rewrap a line the same entry left at 120 columns.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Match an id as a token anywhere inside a quoted or backticked span, not only when the quotes hug it: the normal fixture shape (an id inside a request path) slipped through. - Scan what git tracks instead of walking and skipping .claude/ and dev/, which each track a published file. 218 files scanned before, 220 after. - Reference login.C1iClientID rather than re-typing the literal, so rotating the product's own client id cannot fail the guard. Also fail when the scan covers no files at all -- an empty pass reads as coverage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The quoted-span restriction covered exactly one id-shaped token in the tree (an allowlisted constant) while missing a bare id in a Go comment, in an unquoted YAML value, in prose, in a table cell and in a URL. Scanning the body catches all five and removes the backtick-parity edge with it. TestAPIEmpty200BodySucceeds is 27 characters and satisfies the character mix, and this repo backticks test names in docs, so Go test names are excluded by prefix. Also drops a branch the tokenizer made unreachable, and a hostname alternative the bare-word one already covered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The comment still prescribed the quoted-span scan the previous commit removed, which would have led the next reader to restore it. leet-c1 is exempt: the handle is in every commit's author metadata, so rejecting it in file text buys nothing, and the old message told the reader to use a hostname. Go requires only a non-lowercase character after Test, and Benchmark, Example and Fuzz names sit in the same length range. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The handle appears in zero scanned files, so the exemption guarded a hypothetical while making the match context-free: leet-c1.conductor.one would have passed. If a tracked file ever needs the handle, the guard fires and that is the moment to decide. The clearer failure message stays — the old one told the reader to swap in a hostname for something that was not one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The allowlisted object id is high-entropy by shape and trips generic-api-key. It is a platform id compiled into the API, not a credential, so it gets a fingerprint with a reason like the search key above it. CLAUDE.md's pre-push list named every other gate CI runs but not gitleaks, which is why a locally green branch failed CI. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixtures and command documentation now use placeholder identifiers, and a test
keeps them that way. Placeholders are stable and self-describing; a copied
identifier addresses nothing the reader owns.
TestFixturesAndDocsUsePlaceholdersscans every tracked.go/.md/.yaml/.jsonfile (220 today) and rejects object-id-shaped tokens, tenant hostnames,and prose naming the tenant an observation came from. It enumerates via
git ls-filesrather than walking, so tracked files under.claude/anddev/are covered too, and it fails rather than skipping if the scan comes back empty.
Names of Go test functions are excluded by prefix:
TestAPIEmpty200BodySucceedsis 27 characters and satisfies the character mix, and this repo backticks test
names in docs.
Help text states what the API does; the supporting measurements live in working
notes rather than inline.
Verification
(id in a string literal, bare id in a comment, unquoted value, prose, table
cell, URL, tenant hostname, tenant phrase) and to pass on placeholders.
go build,go vet,go test ./... -count=1,golangci-lint,gosec,govulncheck,go mod tidyall clean.removed; the id substitutions change input and expectation together.
🤖 Generated with Claude Code