Skip to content

chore: use placeholder identifiers in fixtures and docs - #110

Merged
leet-c1 merged 7 commits into
mainfrom
chore/placeholder-identifiers
Sep 1, 2026
Merged

chore: use placeholder identifiers in fixtures and docs#110
leet-c1 merged 7 commits into
mainfrom
chore/placeholder-identifiers

Conversation

@leet-c1

@leet-c1 leet-c1 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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.

TestFixturesAndDocsUsePlaceholders scans every tracked .go/.md/.yaml/
.json file (220 today) and rejects object-id-shaped tokens, tenant hostnames,
and prose naming the tenant an observation came from. It enumerates via
git ls-files rather than walking, so tracked files under .claude/ and dev/
are covered too, and it fails rather than skipping if the scan comes back empty.

Names of Go test functions are excluded by prefix: TestAPIEmpty200BodySucceeds
is 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

  • Guard proven to fail on a planted violation of each shape it claims to catch
    (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.
  • The two allowlisted identifiers are product constants, not tenant data.
  • go build, go vet, go test ./... -count=1, golangci-lint, gosec,
    govulncheck, go mod tidy all clean.
  • No test weakened: +420/-9 across test files, no assertion or test function
    removed; the id substitutions change input and expectation together.

🤖 Generated with Claude Code

leet-c1 and others added 7 commits September 1, 2026 04:44
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>
@leet-c1
leet-c1 merged commit 089baf7 into main Sep 1, 2026
2 checks passed
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