Skip to content

docs: record the repo gotchas a fresh session keeps rediscovering - #56

Merged
tas50 merged 1 commit into
mainfrom
docs/claude-md-repo-gotchas
Sep 8, 2026
Merged

docs: record the repo gotchas a fresh session keeps rediscovering#56
tas50 merged 1 commit into
mainfrom
docs/claude-md-repo-gotchas

Conversation

@tas50

@tas50 tas50 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Adds the context a full defect audit of this package turned out to need, and that nothing in the code or git history conveys.

The main addition: where the test doubles lie

A new "What the test doubles do not cover" section. Both suites go green on wire shapes a real Chef Server would reject or shape differently, and every gap listed there actually concealed a bug found in this audit:

Plus the throwaway-probe technique that pinned these down, since "write a zz_probe_test.go, log what the client sends vs. what the server receives, delete it" is not obvious from the repo.

The rest

Section Added
Adding a new service esc() every caller-supplied identifier; a create returns (*Response, error) when the server answers with {"uri":…}
Auth and transport the signed path must equal r.URL.EscapedPath(), not r.URL.Path (which is decoded and hides a mismatch), and verifySignature exists to check it; only transportErr-marked failures retry
Encoding edge cases the nil-slice rule extends past groups to run_list and normal.tags; a Go type assertion matches the dynamic type exactly, so a bare map[string]any assertion misses Attributes
Linting (new) the golangci-lint invocation that gives signal here, why gosec is mostly noise, and that a bare staticcheck binary fails on a Go-version mismatch

Dependency on the sibling PRs

Some lines describe code that lands with #44 (esc), #45 (asAttributeMap), #50 (MarshalJSON), #51 (Create signature) and #52 (transportErr). Merge this last, and if any of those is dropped, drop its line here — I've kept each to a single bullet so that's a one-line edit.

Test plan

  • Documentation only — no code, no test changes
  • Reviewed against the existing structure; additions slot into the sections that already exist rather than duplicating them
  • Every claim was observed in this session, not inferred

Adds the context that a full defect audit of this package turned out to
need, and that nothing in the code or git history conveys.

The main one is a section on where the two test doubles diverge from a real
Chef Server. Both suites go green on wire shapes that a real server would
reject or shape differently, and each listed gap concealed a real bug:
cinc-zero returning only all_files, accepting a null run_list, and
populating a group's courtesy "name" field.

Also records the invariants that are easy to break silently - the signed
path must equal r.URL.EscapedPath(), identifiers are esc()'d, only wire
failures are retriable, the exact-dynamic-type rule that makes a bare
map[string]any assertion miss an Attributes value - and the golangci-lint
invocation that produces signal on this package.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50
tas50 merged commit 9044384 into main Sep 8, 2026
@tas50
tas50 deleted the docs/claude-md-repo-gotchas branch September 8, 2026 15:08
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