harden: malformed-input hardening, non-panicking encoders, unit coverage - #436
harden: malformed-input hardening, non-panicking encoders, unit coverage#436MattJackson wants to merge 1 commit into
Conversation
…erage across codec/tokens/config
|
Thanks for lifting the One half of the invariant is still missing on this branch: let n = Numeric::new_with_scale(-1, 38);
assert_eq!(n.precision(), 39); // passes today; the only valid answer is 38
The complete invariant, as far as I can tell: with no integral digits, I am carrying exactly that change as a focused patch on top of the 0.12.3 sources: victorchutw@65c1a32 — the constructor bound, the precision correction, unit tests (construction, precision, length buckets, encode/decode round trips, TYPE_INFO bytes, scale-39 rejection), and live |
* Pin Tiberius to a fork carrying the decimal(38,38) Numeric fix tiberius 0.12.3 from crates.io asserts `scale < 38` in `Numeric::new_with_scale` and describes a fraction-only scale-38 value as the invalid `numeric(39,38)`, so a valid `decimal(38,38)` declaration (ADR-0044, mapped verbatim by ADR-0062) could never reach SQL Server. Upstream main still carries the assertion and the open hardening PR tiberius-rs/tiberius#436 fixes only the assertion. Activate ADR-0069's fork rung: pin the maintainer-controlled fork victorchutw/tiberius by full commit SHA 65c1a32f (upstream "Bump v0.12.3" plus one Numeric patch that accepts scale <= 38 and computes the precision of a value without integral digits as max(scale, 1)). The lock records the same revision and nothing else moves. Add a direct offline smoke test of the pinned revision, record the activation, verification posture, upstream trace, and crates.io exit in ADR-0069, and note in ADR-0062 that decimal(38,38) is not a third representability sliver. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Tighten the dependency smoke test and ADR wording after review Name the smoke test without the glossary-avoided "numeric", prove scale-39 rejection with should_panic(expected) like the rest of the repo, keep one determinism assertion, trim the Cargo.toml comment to the sibling style, and make ADR-0069 name the fork's test-module edits and the branch/revision relationship precisely. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Narrate ADR-0069's crates.io source historically The opening paragraph described the crates.io source and caret requirement in the present tense, contradicting the fork pin now in Cargo.toml. State both as the original decision, point at the fork activation that replaced only the source, and note that the lockfile discipline carries over. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: 朱余晟 <victorchu@gamasys.com.tw> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
Superseded by #443. Re-opened as a native GitHub stacked PR (stack #445) per @aqrln's request in #440 — the fork origin of these PRs made a native stack impossible (GitHub can't add fork-head PRs to a stack), so the branches now live in |
Robustness hardening and broad unit-test coverage across the codec/token layer.
Squashed into a single commit (all the submitter's own work — no external authorship to preserve here).
Supersedes: none.
Sequential series — merge after #432–#435. Based on
main; diff reduces to its own delta as the earlier PRs land.Reviewer note: rebase-merge or merge-commit, not squash (keeps the series consistent).