Skip to content

chore(ratchet): delete the interface-data-api guardrail ratchet - #85

Merged
Upd4ting merged 3 commits into
campaign/integrationfrom
chore/delete-ratchet
Nov 2, 2026
Merged

Upd4ting merged 3 commits into
campaign/integrationfrom
chore/delete-ratchet

Conversation

@Upd4ting

@Upd4ting Upd4ting commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Why

Antony's goal: every AntelopeJS guardrails.ratchet.json deleted through verified PRs on campaign/integration, with no fallback and no hidden assertion. interface-data-api had 3 rows left after #84 (W7) removed the 12 metadata.ts rows. None needs an AntelopeJS type change. This is the repo's last step: two rows take the ruled counted oxlint-disable-next-line (Antony's 2026-10-31 evening ruling), the third is refactored away, and ratchet:update deletes the file. Based on campaign/integration d20fad6.

What changed

Three commits.

  1. chore(ratchet): oxlint-disable-next-line lines, guardrails.suppressions.json raise, guardrails.ratchet.json deleted by pnpm run ratchet:update.
  2. build(sync): pnpm run sync drops the ratchet step from lefthook.yml, package.json and AGENTS.md.
  3. test(data-api): the verifier's fix round. readJson<T>(response) becomes readJson(schema, response) and returns schema.parse(JSON.parse(...)) (2026-11-02 ~08:20 ruling: a type argument on a client call is an unchecked claim). zod 4.5.4 is a devDependency (already in the lockfile). All 91 callers in 17 test files pass a schema; ListResponse<Row> and CreatedRow became listResponseSchema(row) and createdRowSchema in src/tests/internal/http.ts. validateObject and validateObjectList in src/tests/utils.ts take two type parameters (T for the parsed row, E for the expected one).

Two traps of the parse, handled:

  • Schemas are z.looseObject, so keys a schema does not name pass through and the to.equal(undefined) absence assertions still bite. Proof: with password made readable in access_control.test.ts, the suite goes from 192 passing to 190 passing and 2 failing (expected 'very-secure-qwerty123' to equal undefined); reverted.
  • Some old claims were false and the parse caught them. Product[] typed addedAt as a Date while the wire gives a string. ShelfListed.book claimed authorId, which the route does not return (the test lists the keys). A list row whose foreign reference is null came back with the key absent, not null (modifier_key.test.ts list), so its schema is nullish. The schemas state what the wire gives.

Rows

CI state (node 24.22.2, dist removed, GITHUB_BASE_REF=campaign/integration). With every ceiling at 0 on pack 0.2.17, pnpm run ratchet printed 3 rows. ratchet:update then printed Deleted guardrails.ratchet.json: no debt left. Rows before -> after: 3 -> 0.

Row Rule Tried Kept as
src/internal/field-types.ts:51 RowFields index signature anti-slop/no-unsafe-dictionary-type type RowFields = Record<string, unknown> (the rule reports it too); a table row holds relation instances and getter results, so no schema-derived value type exists disable
src/internal/deferred-joined-stream.ts:110 (stream as any)[name](...args) typescript/no-unsafe-return Reflect.get into an unknown local, isFunction guard, Reflect.apply, return unknown: the finding moves to no-reflect-get, no-reflect-apply and no-unknown-returns, so reverted. The existing SAFETY: stays disable
src/tests/internal/http.ts:41 readJson<T> typescript/no-unsafe-return schema parse, commit 3 refactored, no suppression

None is a W7 row and none needs a published-type change.

Suppression budget, approved for these two lines only: lint anti-slop/no-unsafe-dictionary-type 0 -> 1 (field-types.ts:51), typescript/no-unsafe-return 0 -> 1 (deferred-joined-stream.ts:110).

Proofs

Head dc81892.

  • CI=true GITHUB_BASE_REF=campaign/integration pnpm run checks, dist removed: Checks: 7 passed, 1 failed. The one failure is suppressions, only on the approved raise. Land with LAND_ADMIN=1 or land-raise.sh.
  • pnpm run test: 192 passing.
  • api-diff:

API: 1 packages, 26 entries unchanged against origin/campaign/integration (committed HEAD).
API: skipped test-helper entry ./dist/.d.ts in .; test helpers need a test runner and are outside both proof halves.
Runtime API: 1 packages, 23 entries unchanged against origin/campaign/integration (committed HEAD).
Runtime API: skipped test-helper entry ./dist/
.js in .; test helpers need a test runner and are outside both proof halves.
No behavioural probe ran.

Suppressions in authored code files (origin/campaign/integration and committed HEAD). A lint directive counts once per rule it names; * is a directive naming none.

Suppressions base HEAD
Lint suppressions, all rules 0 2
Lint suppressions, anti-slop/no-unsafe-dictionary-type 0 1
Lint suppressions, typescript/no-unsafe-return 0 1
@ts-expect-error 5 5
@ts-ignore 0 0
SAFETY: comments 4 4
Lint config rule-offs, all rules 0 0

Attention

  • The budget raise above is the only change to a ceiling. The source diff is test code plus two directive lines.

@Upd4ting
Upd4ting marked this pull request as ready for review November 2, 2026 13:14
@Upd4ting
Upd4ting merged commit 65afb35 into campaign/integration Nov 2, 2026
4 of 7 checks passed
@Upd4ting
Upd4ting deleted the chore/delete-ratchet branch November 2, 2026 13:14
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