test(core): Kani for Direction::of and part_weight

Both were exceptions for lacking all three backing kinds; neither is a
wrapper or an enum map. `Direction::of` is the sign classification the
party direction law is stated over (law 23), and `part_weight` is the
weight the proration charges are computed from (laws 26-28).

- `direction_of_is_the_sign` explores any `i64` and covers paid,
  received and neither (`kani::cover!`).
- `part_weight_is_days_of_the_month` explores `days` and `month_days`
  up to 40 and covers a partial month, a whole month and an invalid
  part.
- each spec block now carries its `SOURCE:` line, so the gate's
  right-law check applies to them.
- `docs/proofs/entries.md` records each harness's law in the
  machine-readable table; the exception list drops from 16 to 14
  (`Direction::key` and `MonthPart::is_valid` stay, with their reasons).

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-08 21:54:10 -07:00
1 parent 6f2e2cf1eb
commit 080a3ffbf5
4 files changed
+94 -15

No files matched your search

+3 -2
View File
@@ -1150,7 +1150,7 @@ impl Direction {
}
/// The direction of a signed amount: paid above zero, received below,
/// neither at zero.
/// neither at zero. SOURCE: BS-partner-3 (the party direction law).
pub fn of<T: Amount>(amount: T) -> Self {
if amount > T::ZERO {
Direction::Paid
@@ -1461,7 +1461,8 @@ impl MonthPart {
}
/// A part's weight in `MONTH_L`ths of a month: `days × (MONTH_L /
/// month_days)`, exactly. `None` for a part no month has.
/// month_days)`, exactly. `None` for a part no month has. SOURCE:
/// BS-asset-1, BS-prepaid-1 (proration by days; laws 26-28).
pub fn part_weight<T: Units>(p: MonthPart) -> Option<T> {
if !p.is_valid() {
return None;