Clauses
19
Current Pass
1
Stale
0
Blocked
0
Unverified
18
Open Decisions
0

Abstract base: Batch, revision draft-1

BATCH-001

Unverified

`BatchProcessor` must return `InvalidInput` if the entire input is invalid.

Invalid later item
Input
`[(4, 2), (1001, 1)]`
Expected
`InvalidInput`, zero `apply` calls
Excess length
Input
101 copies of `(1, 1)`
Expected
`InvalidInput`, zero `apply` calls
Wrong field type
Input
`[{numerator: true, denominator: 1}]`
Expected
`InvalidInput`, zero `apply` calls
Wrong shape
Input
Missing input, a scalar, a missing field, or an extra field
Expected
`InvalidInput`, zero `apply` calls for each case

BATCH-002

Unverified

`BatchProcessor` must not call `apply` when the entire input is invalid.

Invalid later item
Input
`[(4, 2), (1001, 1)]`
Expected
`InvalidInput`, zero `apply` calls
Excess length
Input
101 copies of `(1, 1)`
Expected
`InvalidInput`, zero `apply` calls
Wrong field type
Input
`[{numerator: true, denominator: 1}]`
Expected
`InvalidInput`, zero `apply` calls
Wrong shape
Input
Missing input, a scalar, a missing field, or an extra field
Expected
`InvalidInput`, zero `apply` calls for each case

BATCH-003

Unverified

For valid input, `BatchProcessor` must call `apply` exactly once per item, in ascending list-index order.

Positive fraction
Input
`[(7, 2)]`
Expected
`Completed([Ok(3)])`
Duplicate pairs
Input
`[(4, 2), (4, 2)]`
Expected
`Completed([Ok(2), Ok(2)])`, two `apply` calls
Maximum length
Input
100 copies of `(1, 1)`
Expected
`Completed` with 100 `Ok(1)` results

BATCH-004

Unverified

`BatchProcessor` must complete each `apply` call before starting the next call.

Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`

BATCH-005

Unverified

`BatchProcessor` must append each `apply` result to `results` in the same order as the input items.

Positive fraction
Input
`[(7, 2)]`
Expected
`Completed([Ok(3)])`
Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`
Duplicate pairs
Input
`[(4, 2), (4, 2)]`
Expected
`Completed([Ok(2), Ok(2)])`, two `apply` calls
Maximum length
Input
100 copies of `(1, 1)`
Expected
`Completed` with 100 `Ok(1)` results

BATCH-006

Current Pass

`BatchProcessor` must continue with the next item after an `Error` result.

Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`
Evidence · Continue after error · Current Pass

File batch-binding.json
Run run

Receipt SHA-256
1cee544103b8fd5f0a450918a3309e84335910a39dca71659f171d4a28d9bafe

Gate · Continue after error · Current Pass

File acceptance.json
Run run

Manifest SHA-256
1b15fdedf904cd71ace9acaebc5f76cceebfd7baa25e9c80ae25f6530b2a1a9f

Receipt SHA-256
1cee544103b8fd5f0a450918a3309e84335910a39dca71659f171d4a28d9bafe

BATCH-007

Unverified

After processing every item, `BatchProcessor` must return `Completed(results)`.

Positive fraction
Input
`[(7, 2)]`
Expected
`Completed([Ok(3)])`
Negative numerator
Input
`[(-7, 2)]`
Expected
`Completed([Ok(-3)])`
Negative denominator
Input
`[(7, -2)]`
Expected
`Completed([Ok(-3)])`
Both negative
Input
`[(-7, -2)]`
Expected
`Completed([Ok(3)])`
Zero numerator
Input
`[(0, -2)]`
Expected
`Completed([Ok(0)])`
Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`
Duplicate pairs
Input
`[(4, 2), (4, 2)]`
Expected
`Completed([Ok(2), Ok(2)])`, two `apply` calls
Lower bound
Input
`[(-1000, 1)]`
Expected
`Completed([Ok(-1000)])`
Upper bound
Input
`[(1000, 1)]`
Expected
`Completed([Ok(1000)])`
Maximum length
Input
100 copies of `(1, 1)`
Expected
`Completed` with 100 `Ok(1)` results

BATCH-008

Unverified

For empty input, `BatchProcessor` must return `Completed([])` without calling `apply`.

Empty
Input
`[]`
Expected
`Completed([])`, zero `apply` calls

BATCH-009

Unverified

`BatchProcessor` must not change the input or produce external effects.

BATCH-010

Unverified

For valid input, `BatchProcessor` must initialize `results` to `[]` before processing any item.

Positive fraction
Input
`[(7, 2)]`
Expected
`Completed([Ok(3)])`
Duplicate pairs
Input
`[(4, 2), (4, 2)]`
Expected
`Completed([Ok(2), Ok(2)])`, two `apply` calls
Maximum length
Input
100 copies of `(1, 1)`
Expected
`Completed` with 100 `Ok(1)` results

BATCH-011

Unverified

`BatchProcessor` must terminate each `apply` call for every valid pair.

BATCH-012

Unverified

`BatchProcessor` must return exactly one declared result from each `apply` call.

BATCH-013

Unverified

The extension author must replace behavior only within `apply`.

BATCH-014

Unverified

The extension author must define `apply` for every valid pair.

Concrete extension: Divide, revision draft-1

DIV-001

Unverified

If the denominator is zero, `BatchProcessor` must return `Error(ZeroDivisor)` from `apply`.

Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`

DIV-002

Unverified

Otherwise, if the numerator and denominator have opposite signs, `BatchProcessor` must return `Ok(-magnitude)` from `apply`.

Negative numerator
Input
`[(-7, 2)]`
Expected
`Completed([Ok(-3)])`
Negative denominator
Input
`[(7, -2)]`
Expected
`Completed([Ok(-3)])`
Lower bound
Input
`[(-1000, 1)]`
Expected
`Completed([Ok(-1000)])`

DIV-003

Unverified

Otherwise, `BatchProcessor` must return `Ok(magnitude)` from `apply`.

Positive fraction
Input
`[(7, 2)]`
Expected
`Completed([Ok(3)])`
Both negative
Input
`[(-7, -2)]`
Expected
`Completed([Ok(3)])`
Zero numerator
Input
`[(0, -2)]`
Expected
`Completed([Ok(0)])`
Continue after error
Input
`[(1, 0), (9, 2)]`
Expected
`Completed([Error(ZeroDivisor), Ok(4)])`
Duplicate pairs
Input
`[(4, 2), (4, 2)]`
Expected
`Completed([Ok(2), Ok(2)])`, two `apply` calls
Upper bound
Input
`[(1000, 1)]`
Expected
`Completed([Ok(1000)])`
Maximum length
Input
100 copies of `(1, 1)`
Expected
`Completed` with 100 `Ok(1)` results

DIV-004

Unverified

`BatchProcessor` must not evaluate `magnitude` when the denominator is zero.

DIV-005

Unverified

`BatchProcessor` must evaluate @DIV-001 through @DIV-003 in order and execute exactly one branch.