Skip to content

Pin the telltale wire contract (consumer side) - #66

Merged
adbarc92 merged 1 commit into
mainfrom
test/telltale-wire-contract
Sep 5, 2026
Merged

Pin the telltale wire contract (consumer side)#66
adbarc92 merged 1 commit into
mainfrom
test/telltale-wire-contract

Conversation

@adbarc92

@adbarc92 adbarc92 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

telltale declares this payload in src/read.ts (TelltaleIssueDTO / IssuesResponse); this repo declares it again in feedback.ts (TelltaleIssue / FeedbackIssuesResponse). They agree today, field for field — and nothing made them keep agreeing. Either side could add, rename or drop a field with both suites green and the wire broken. That is finding 2 of the 2026-08-31 integration audit, and the gap SYSTEM-TEST-PLAN.md records as "no contract test between any two stages."

Mechanism

The contract JSON is vendored byte-for-byte from NEXUS docs/contracts/, where it is documented. telltale vendors the same file and pins the same hash. Moving the contract for one side leaves the other side's constant stale and red — that duplication is the mechanism, not redundancy. A shared package would give the same guarantee only if both sides upgraded, and nothing forces an upgrade.

Two independent checks, deliberately not one:

Layer Catches
runtime (vitest) contract's canonical SHA-256 moved; TelltaleIssue's key set ≠ contract's, exactly — an added field fails as loudly as a removed one
compile time (npm run check) Record<keyof TelltaleIssue, true> makes tsc fail if the interface gains or loses a field, before the suite even runs

Hashing is over the canonical JSON, not raw bytes — a byte hash would fail spuriously the first time someone checks the file out with CRLF.

Proved to fail before being kept

A verification that cannot fail is not verification, so both halves were driven red on purpose:

contract gains a `severity` field        →  2 of 5 red (hash freeze + key set)
test declares a field the interface lacks →  tsc: 1 ERROR, 'severity' does not exist
                                             in type 'Record<keyof TelltaleIssue, true>'
reverted                                  →  22 files / 159 tests green
                                             check: 357 files, 0 errors

Suite went 154 → 159. No existing test changed.

Scope

Consumer side only. The producer-side twin in telltale is written but not yet opened — that repo had an active working session in it at the time.

🤖 Generated with Claude Code

telltale declares this payload in src/read.ts as TelltaleIssueDTO /
IssuesResponse; this repo declares it again in feedback.ts as TelltaleIssue /
FeedbackIssuesResponse. They agree today, field for field. Nothing made them
keep agreeing - either side could add, rename or drop a field with both suites
green and the wire broken. That is finding 2 of the 2026-08-31 integration
audit.

The contract JSON is vendored byte-for-byte from NEXUS docs/contracts/, where
the mechanism is documented; telltale vendors the same file and pins the same
hash. Moving the contract for one side leaves the OTHER side's constant stale
and red, which is what forces a wire change to be read by both.

Two independent checks, deliberately not one:

- runtime: the contract's canonical SHA-256 still matches, and TelltaleIssue's
  key set equals the contract's exactly - an added field fails as loudly as a
  removed one.
- compile time: Record<keyof TelltaleIssue, true> makes tsc fail if the
  interface gains or loses a field, so `npm run check` catches drift even
  before the suite runs.

Hashing is over the canonical JSON, not raw bytes, so a CRLF checkout does not
produce a spurious failure.

Both halves were proved to fail before being kept, per the rule that a
verification which cannot fail is not verification:

  contract gains a `severity` field -> 2 of 5 tests red (hash + key set)
  test declares a field the interface lacks -> tsc 1 ERROR
  reverted -> 22 files / 159 tests green, check 357 files 0 errors

Suite went 154 -> 159. No existing test changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adbarc92
adbarc92 merged commit cb0d213 into main Sep 5, 2026
16 checks passed
@adbarc92
adbarc92 deleted the test/telltale-wire-contract branch September 5, 2026 00:04
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