clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

main
atlas / docs / decisions / 0014-the-depcheck-pragma.md
0014-the-depcheck-pragma.md 2.1K rendered
1# 14. A boundary crossing is annotated in place, with a reason23- **Date:** 2026-08-024- **Status:** accepted5- **Where it is written down:** issue #5 §9, §10 decision 13;6 `tools/depcheck/report.go`78## Context910The project's architectural contracts are encoded as static analysis: the lane11import matrix, the stdlib-only rule for `format/`, hostenv purity, network12confinement, semconv discipline. Rules that cannot be escaped get weakened13instead — the rule is loosened until the one honest exception fits, and then it14no longer catches the dishonest ones. Rules that can be escaped silently are15worse.1617## Decision1819A boundary crossing that is genuinely correct is annotated **in place**:2021```go22resp, err := http.Get(u) //depcheck:allow netconfine the crawl politeness probe runs before the archive exists23```2425The pragma sits on the offending line or the line above it, names one rule (or26`all`), and **must carry a written reason**. A pragma naming an unknown rule,27or carrying no reason, is itself a finding — it would otherwise suppress28nothing while reading as though it did.2930It is the source-level twin of a waiver entry in the harness this repository31was judged by (`golden/waivers.json`, archived on `golden-reference`), and it32is read the same way: **as a cost**, visible where the crossing is rather than33in a config file nobody opens.3435## Consequences3637- Every rule keeps its strictness. The exception is local, named and explained,38 and it shows up in a diff of the file that takes it.39- The pragma checker runs inside each analyzer's pass, so a typo'd rule name is40 caught by the pass it was addressed to rather than by a separate lint.41- One pragma exists in the tree today —42 `internal/generate/compose/compose_test.go` suppressing `semconvlit`, because43 the point of that test case is a key the registry does not know and which by44 definition has no constant. A second one appearing is a thing to notice, not45 a thing to prevent.46- Grepping `//depcheck:allow` is the standing inventory of accepted crossings,47 the same way the harness printed its waiver file on every run as the48 standing inventory of accepted divergences.