Skip to content

chore: credstore dependency surface + cli-common self-conformance (standards-review level 2) #55

Description

@rianjs

Context

Level 2 of the standards review audited the shared code against the docs it implements (credstore vs working-with-secrets.md; statedir/statedirtest/cache vs working-with-state.md). Zero contract violations — the Linux fail-closed classification, SetBundle snapshot/rollback, redaction suite, resolver no-create split, 8-var hermetic helper, and tier-1 cache surface are all implemented and tested as specified. The remaining work is one substantive dependency finding plus this repo's own conformance, with downstream consumer impacts mapped below. Depends on #54 for the doc-side changes (library profile, divergence rewording).

Current consumer pins (all affected by anything tagged here): google-readonly, newrelic-cli, slack-chat-api, atlassian-cli (shared + cfl + jtk) @ v0.2.2; codereview-cli @ v0.3.0.

1. credstore dependency surface (substantive)

byteness/keyring's root package imports its 1Password openers unconditionally, so the chain

credstore → byteness/keyring → onepassword-sdk-go (pre-1.0) → extism/go-sdk → wazero

is in the package import graph, not just the module graph. Measured on this repo: go list -deps ./credstore includes 63 packages from these trees — tetratelabs/wazero (34 packages — a full WASM runtime), uber/jaeger-client-go (19 — archived upstream), OTel protos, dylibso/observe-sdk, both 1Password SDKs — compiled into a credential library and therefore into every consumer binary.

working-with-secrets.md §1.10 already (correctly) refuses to expose the op backends precisely because the SDK is pre-1.0 — but the dependency still rides along: binary size, vuln/audit surface, and dependabot noise in every consumer's go.sum.

Work:

  • Quantify: binary-size delta for a consumer binary with/without the trees; govulncheck against a consumer binary; check whether the linker actually dead-code-eliminates wazero/jaeger (init-heavy packages often survive DCE).
  • Fix path, in preference order: (a) change byteness/keyring (we control the fork) to gate the op/op-connect/op-desktop openers behind build tags or split them into a submodule, so importers that never request those backends don't compile them; (b) if (a) is impractical, accept and document the trade-off in working-with-secrets.md §1.10.
  • If (a): repin byteness/keyring in cli-common, then tag and ride the consumer repin train (item 4).

2. cli-common mechanical conformance (blocked on #54 item 5 — the library profile)

  • .github/workflows/ci.yml: replace both hardcoded go-version: '1.26' with go-version-file: go.mod (ci.md §3 — this repo currently exhibits the exact drift the rule bans).
  • Makefile: check: tidy lint test build (today check omits build while CI builds, so a green local check does not predict a green CI run — violates repo-layout.md §4's own contract).
  • Add AGENTS.md + CLAUDE.md as thin peer indexes per agent-implementation.md §2 (each points to docs/development.md and docs/README.md; they MUST NOT point at each other; since this repo is the standards home, the source-of-truth links are local).
  • Add docs/development.md: package map (credstore / statedir / statedirtest / cache with the doc sections each implements), make check, hermetic-test rules (in-memory backend, statedirtest.Hermetic, not t.Parallel-safe), and the manual-tag / release-train policy.
  • Decide: keep the monolithic build-test CI job (remains a catalogued ci.md §8 divergence) or split build/test jobs while in there.

3. Color verification pass (downstream of #54 item 3)

  • Verify each CLI (jtk, cfl, gro, nrq, slck, sfdc) does not force color onto non-TTY output. fatih/color and lipgloss auto-disable by default, so this should be a no-op confirmation unless a CLI sets color.NoColor = false or equivalent. Record the result in output-and-rendering.md §10. (gro's missing root --no-color flag is already a catalogued §10 divergence — out of scope here.)

4. Tag + repin train

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions