DATA AGENT · ROW VALIDATION

Data agent: expose a malformed row before aggregation

Parse an editable CSV before aggregating it and compare strict validation with lenient coercion that turns 14.3k into 14.

Computed drill · sixty inspection seconds

Event trace

    Computed data

    Final metrics

    JavaScript parsing semantics: parseInt reads the longest leading integer and stops, Number() parses the whole string and turns an empty cell into 0. The intended values for the example tables are the fixture author's, revealed for comparison; an edited table has no ground truth, so any coerced value counts as unverified. No real database or language model is used.

    A suffix that parseInt swallows

    The opening table, 14.3k written with a suffix, has four regions. Number parser is Numeric prefix, like parseInt, which reads the longest leading integer and stops: east becomes 14. Aggregate is Sum. No row is flagged, so the agent reports a sum of 30314 against the intended 44600: SILENTLY WRONG. Choose Mean under Aggregate and the report is 7578.5 against 11150. Nothing in the answer hints that a row was coerced; only the trace and the Parsed rows table mark east as coerced.

    Validate before you aggregate

    Choose Strict integer. Now 14.3k fails validation and Invalid rows decides what happens. Quarantine and disclose reports 30300 over 3 of 4 rows and names east: PARTIAL, DISCLOSED. Reject the whole batch reports nothing and gives the reason: REJECTED WITH REASON. Drop silently also reports 30300 but says nothing: SILENTLY INCOMPLETE. Whole string, like Number() also rejects 14.3k and quarantines it. The parser decides whether a bad cell is caught; the policy decides whether the user learns about it.

    Other ways a number lies

    Use Load an example table. Quoted 14,300 with a comma parses as one cell, but parseInt stops at the comma and returns 14: 30314 again, while Number() rejects it. Unquoted 9,500 splits into two columns: with Reject rows whose column count differs from the header on, south is quarantined and the sum is 35100; switch it off and south parses as 9, giving 35109, SILENTLY WRONG. Empty cell under Number() becomes 0. The sum, 35800, matches only by luck, so the verdict is COERCED, RIGHT BY LUCK, and Mean gives 8950 instead of 11933.3. parseInt rejects the empty cell, and quarantine gives the true mean of the three values. Clean integers sums to 44600 under every parser and policy.

    Edit the table

    Table (CSV with header region,revenue_usd) is live; the selector only loads examples. Replace 8800 with 1e3: parseInt gives 1 and a sum of 35801, Number() gives 1000 and 36800, and strict validation quarantines the row. An edited table has no intended values, so any coerced cell gives UNVERIFIED COERCION, a failure: nobody can confirm the figure.

    Replay and limits

    Changing any input recomputes and rewinds. Play and Pause run the inspection, Next event moves one row, Restart rewinds, Speed runs from 0.25x to 2x and Inspection time seeks from 0 to 60 seconds. The verdict and metrics appear at 60 seconds; the Complete-run preview shows them at once. Parsing follows JavaScript semantics, and the intended values are the fixture author's. Real pipelines add schemas, units, locales and a quarantine table that someone must review.

    Views are my own and do not represent any employer, past or present.

    Search