Skip to content

refs: an ADR id and a symbol of a missing package are references too - #43

Merged
aledbf merged 1 commit into
mainfrom
refs-one-gate
Oct 17, 2026
Merged

aledbf merged 1 commit into
mainfrom
refs-one-gate

Conversation

@aledbf

@aledbf aledbf commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

spin checked its storage prose with a second gate, written in shell (hack/storage-refs.sh), and that gate existed only for two rules. Both rules now live in internal/refs, so spin can drop the shell gate and use one task refs:

  • An ADR-NNNN has to resolve to a file under Options.Decisions. This is the new -decisions flag, and it defaults to docs/decisions.
  • A pkg.Symbol is a finding when the path of its internal/<pkg> was reported missing somewhere in the files read. The check is limited to those packages so that it does not flag every json.Unmarshal.

The README and the cmd doc are updated.

Verification

  • TestADecisionAndASymbolOfAMissingPackage is a table test with 8 cases. Three planted bugs each turned it red: the ADR check inverted, the wrong key in the missing-package set, and the one-segment check removed.
  • nice -n 19 task mutate BASE=origin/main: 14 refused, 0 survived. The first run had one survivor: if the symbol pattern got an empty alternative, .Unmarshal would be reported next to a missing package. A new case now covers that.
  • task lint and task test pass. Coverage is 83.5%, floor 60%.

Followup

  • spin needs to bump go-tools to this commit once it is merged. spin's half (one refs gate, the shell gate deleted) is on spin's branch and does not depend on this bump to pass.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

spin held its storage prose with a second gate in shell for these two
rules alone. An ADR-NNNN resolves to a file under -decisions
(docs/decisions by default); a Symbol of internal/<pkg> is a finding
when that package's own path was found missing, anywhere in the files
read - every x.Y would report json.Unmarshal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 59b671e into main Oct 17, 2026
1 check passed
@aledbf
aledbf deleted the refs-one-gate branch October 17, 2026 14:32
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