Truthound · All articles · 21/24
Evidence-led Truthound Core guidance on data contracts, check inputs and operational limits.
480 articles
Checking that Pipeline.fit_predict delivers X_val in the same preprocessing space
A validation value can remain in its original units while training data is standardized, without an exception. Inspect the final estimator boundary.
FeatureAgglomeration inverse transforms need both container and feature-width contracts
A correctly shaped value can still arrive in a container the inverse transform rejects. Separate execution success from output-column validation.
Routing Bagging X_val with the same feature selection as each sub-estimator
Selecting training columns while forwarding validation metadata unchanged gives the two inputs different feature spaces.
RandomProjection n_components=auto: verify resolved dimensions and output names together
auto describes the request; fitting resolves the actual dimension. Feature names and output containers must use that resolved value.
scikit-learn auc with decreasing uint8 coordinates: use a triangle to check direction
Changing the numeric representation of the same curve should preserve its area.
Adjusted balanced accuracy on a single-class fold: keep undefined states separate from scores
Replacing an undefined adjusted score with an arbitrary finite value changes both metric meaning and the population being evaluated.
Shopify metafield filters: preserving errors instead of turning them into empty results
A failed filter differs from an actual absence of matches. Test response state alongside the returned dataset.
Shopify legalEntityId: testing cross-shop consolidation without merging unknown entities
Distinguish shop-scoped IDs from organization-level legal-entity IDs, and do not merge nulls into a single company.
Shopify local-currency gift cards: testing issuance settings against redemption strategy
Before comparing amounts in a multi-currency experiment, verify the issuance-currency and redemption-policy combination fixed at creation.
Shopify marketing engagements: testing cumulative-to-delta migration without double counting
Changing a mode flag can turn a cumulative total into a new increment. Connect the last approved total with the first emitted delta at the transition.
Shopify DraftOrderLineItem weight: carrying the unit through the grams migration
A field-name migration is also a unit-contract migration. Normalize the new value and unit together before comparing the business weight.
Shopify canceled receiving: reconciling the meaning of totalReceivedQuantity
When testing the new receiving state, separate status totals so received is not mistaken for the quantity that physically arrived.
Pydantic validate_call: making dropped TypedDict options visible to operators
Share the requested and accepted option sets, not just their values, so a dropped setting is not mistaken for a normal execution.
Pydantic TypeAdapter unions: checking the selected response branch before serialization
A type declaration alone does not prove that field projection occurred. Verify the selected branch and the paths actually emitted.
Pydantic exclude_none: teaching the difference between required keys and nullable values
Required describes key presence; nullable describes permitted values. The team's acceptance checklist must separate them.
Pydantic MISSING unions: checking that a parent response does not disclose child fields
Validate the public field set independently of the runtime object's available information. That keeps the agreed disclosure boundary visible.
Pydantic strict Literal: preserving the original JSON numeric kind
If a protocol distinguishes original numeric kinds, a normalized value alone cannot prove that the received representation met the contract.
Pydantic Enum dictionary keys: agreeing on the JSON wire mapping
In-memory key types differ from JSON object keys. Share an explicit mapping in both directions.
Pydantic Decimal JSON Schema: aligning scientific notation with the consumer contract
Separate numeric-accuracy requirements from permitted string notation. Consumers then get a compatibility choice instead of an unnecessary change to the value.
Pydantic Decimal multiple_of: sharing exact counterexamples beyond the precision boundary
Teach and verify exact divisibility through independent arithmetic on the original decimal representation, rather than a rounded quotient.
