Skip to content

Commit 0e6905d

Browse files
LeadGoEngineerPaperclip-Paperclip
andcommitted
chore(compat): cite CONTRACT §7 Hermeticity in code and README
§7 Hermeticity landed in commit 47e6d64 (PR #9), so the three call sites that described the property as a "harness invariant the contract does not promise today" are now stale — the property IS a contract promise, and these bundles pin down what §7 promises. Updates: - compat/dates/dates.go: helpIsHermetic and flagValidationIsHermetic godocs swap "harness invariant" framing for "Pins down the … path of CONTRACT §7 Hermeticity on every PR" (section reference by name; no fabricated quoted text per the standing rule). - compat/formats/formats.go: flagValidationIsHermetic same. - compat/README.md: the two subtest tables flip the Contract column from "harness invariant" → "§7" for the three hermetic rows so citation-verifier CI (QUA-20, when it lands) recognizes them as contract-anchored. Net: -19 lines of bridging prose, +10 lines of canonical refs. Follow-up to QUA-22; the §7 section itself is already on main. Co-Authored-By: Paperclip <[email protected]>
1 parent 47e6d64 commit 0e6905d

3 files changed

Lines changed: 13 additions & 22 deletions

File tree

compat/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ The exporter does not need a separate `go.mod` for compat tests — the standard
8686
|---|---|---|
8787
| `HelpDocumentsDateFlags` | §3 | `--help` mentions `--since` and `--until` and exits 0. |
8888
| `InvalidSinceValueFails` | §3, §4 | `--since obviously-not-a-date` exits non-zero, writes to stderr, leaves stdout empty. |
89-
| `HelpIsHermetic` | harness invariant | `--help` succeeds with all HTTP proxies pointed at an unreachable address. |
90-
| `FlagValidationIsHermetic` | harness invariant | A parse failure also produces no successful outbound request. |
89+
| `HelpIsHermetic` | §7 | `--help` succeeds with all HTTP proxies pointed at an unreachable address. |
90+
| `FlagValidationIsHermetic` | §7 | A parse failure also produces no successful outbound request. |
9191

9292
When `compat.Runner.Subcommands` is set, every row above runs once per declared subcommand under `subcommand=NAME/...`.
9393

@@ -97,7 +97,7 @@ When `compat.Runner.Subcommands` is set, every row above runs once per declared
9797
|---|---|---|
9898
| `HelpDocumentsFormatFlag` | §4 | `--help` mentions `--format` and exits 0. |
9999
| `UnknownFormatFails` | §4 | `--format obviously-not-a-format` exits non-zero, writes to stderr, leaves stdout empty. |
100-
| `FlagValidationIsHermetic` | harness invariant | The unknown-format parse failure makes no successful outbound request. |
100+
| `FlagValidationIsHermetic` | §7 | The unknown-format parse failure makes no successful outbound request. |
101101
| `JSONIsArray` | §4 | `--format json` exits 0 and emits stdout that unmarshals as `[]any`. |
102102
| `CSVHasHeader` | §4 | `--format csv` exits 0 and emits at least one non-empty line on stdout (the header row, present even on an empty result). |
103103
| `DefaultIsMarkdown` | §4 | No `--format` flag produces byte-identical stdout to `--format markdown`. |

compat/dates/dates.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,9 @@ func invalidSinceValueFails(t *testing.T, r compat.Runner) {
161161
// unreachable address. If the CLI tries to hit the network at all, it
162162
// will fail or hang — the latter is caught by the Runner timeout.
163163
//
164-
// This is a harness invariant, not a property the contract promises
165-
// today. A `--help` that dialed out would still satisfy §3 surface
166-
// checks but would be unusable for LLM-agent introspection (an agent
167-
// must be able to ask "what does this CLI do" without a token or
168-
// network). Codifying hermeticity as its own CONTRACT.md section is
169-
// tracked separately; in the meantime the framework defends the
170-
// property here so an exporter cannot regress it silently.
164+
// Pins down the `--help` path of CONTRACT §7 Hermeticity on every PR.
165+
// §7 is load-bearing for LLM-agent introspection: an agent must be able
166+
// to ask "what does this CLI do" without a token or working network.
171167
func helpIsHermetic(t *testing.T, r compat.Runner) {
172168
t.Helper()
173169
res := r.WithEnv(noNetworkEnv()...).MustRun(t, "--help")
@@ -176,10 +172,11 @@ func helpIsHermetic(t *testing.T, r compat.Runner) {
176172
}
177173
}
178174

179-
// flagValidationIsHermetic is the parse-failure half of the same
180-
// harness invariant documented on helpIsHermetic above: a CLI that
181-
// dialed out before rejecting an invalid flag would have already
182-
// leaked a network call by the time it exits non-zero.
175+
// flagValidationIsHermetic is the date-parse-failure half of CONTRACT
176+
// §7 Hermeticity, paired with helpIsHermetic above: a CLI that dialed
177+
// out before rejecting an invalid flag would have already leaked a
178+
// network call by the time it exits non-zero. Pins down the
179+
// date-parse-failure path of §7 on every PR.
183180
func flagValidationIsHermetic(t *testing.T, r compat.Runner) {
184181
t.Helper()
185182
args := []string{"--since", "obviously-not-a-date", "--until", "obviously-not-a-date"}

compat/formats/formats.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,8 @@ func unknownFormatFails(t *testing.T, r compat.Runner) {
154154
// failure does not dial out. Mirrors the dates bundle's parse-failure
155155
// hermetic test, but exercises the `--format` parse path explicitly
156156
// in case the CLI looks up format codecs differently than date
157-
// values.
158-
//
159-
// This is the same harness invariant the dates bundle defends — a
160-
// flag-validation failure must not have already opened a connection
161-
// by the time it exits non-zero. It is not a contractual claim
162-
// (CONTRACT.md does not define a hermeticity section today);
163-
// codifying that is tracked separately. Until then, the framework
164-
// enforces it here so an exporter cannot regress it silently.
157+
// values. Pins down the `--format` parse-failure path of CONTRACT §7
158+
// Hermeticity on every PR.
165159
func flagValidationIsHermetic(t *testing.T, r compat.Runner) {
166160
t.Helper()
167161
res, err := r.WithEnv(noNetworkEnv()...).Run(context.Background(), "--format", unknownFormatValue)

0 commit comments

Comments
 (0)