Skip to content

refactor(result): read _extra through IsPlainObject instead of a cast - #92

Merged
Upd4ting merged 1 commit into
mainfrom
refactor/burn-down-suppressions
Nov 13, 2026
Merged

Upd4ting merged 1 commit into
mainfrom
refactor/burn-down-suppressions

Conversation

@Upd4ting

Copy link
Copy Markdown
Member

Why

Antony wants every suppression guardrails.suppressions.json allows in this repo brought to zero by fixing the code it hides, so the lint holds without escape hatches (ANT-1090). This PR removes the one SAFETY: comment and its cast. The budget file drops safety from 1 to 0.

What

DecodeRow spread the _extra cell through overflow as RowObject | null. It now reads it through IsPlainObject(overflow) ? { ...overflow } : {}. IsPlainObject is the existing guard in member.ts, which narrows RowValue to a record without an assertion.

Every state a row reaches decodes the same:

  • _extra is a jsonb object, which pg parses to a plain object, so it spreads as before.
  • _extra is null or the select list leaves it out, so both versions give {}.

Only a non-object _extra would decode differently, and the jsonb NOT NULL DEFAULT '{}' column, which the adapter writes only as an object, never holds one.

flowchart LR
  row[pg row] --> cell["_extra cell (RowValue)"]
  cell -->|IsPlainObject| spread["{ ...overflow }"]
  cell -->|null, undefined| empty["{}"]
  spread --> strip["drop _id, _instance"]
  empty --> strip
  strip --> doc["{ ...document, ...extra }"]
Loading

SAFETY comments added

None. This PR removes one and adds none.

Proof

pnpm run checks: Checks: 11 passed, 0 failed.

The behavioural probe calls the built DecodeRow on both roots. It covers an object _extra (with shadowing _id and _instance keys), an empty one, null, an absent one, a named instance, and an _extra key that overrides a field. Both roots return the same JSON.

API: 1 packages, 1 entries unchanged against origin/main (committed HEAD).
API: skipped .agents/skills/verify-module, private.
Runtime API: 1 packages, 1 entries unchanged against origin/main (committed HEAD).
Behavioural probe supplied.

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

Suppressions base HEAD
Lint suppressions, all rules 1 1
Lint suppressions, anti-slop/no-unknown-parameters 1 1
@ts-expect-error 56 56
@ts-ignore 0 0
SAFETY: comments 1 0
Lint config rule-offs, all rules 0 0

@Upd4ting
Upd4ting merged commit 8955077 into main Nov 13, 2026
10 checks passed
@Upd4ting
Upd4ting deleted the refactor/burn-down-suppressions branch November 13, 2026 09:28
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