# Software verification plan example: atomic batch import

**Plan:** SVP-IMPORT-001 · **Revision:** 1 · **Prepared:** 2026-10-27  
**Status:** Teaching plan with recorded partial evidence; **acceptance: NOT CLAIMED**.

## 1. Identity and authority

Original Proof teaching example. Roles identify responsibility in a real project; no person is invented as an approver. The purpose is to inspect how a planned case can be missing from a passing test run.

## 2. Scope and baseline

Python functions with a local, fresh SQLite database per case. An accepted batch must persist its rows and completion checkpoint together. Invalid batches reject the whole batch. The example intentionally chooses this atomic behavior; it does not implement the existing website's separate resume-after-interruption illustration.

Executed environment: Python 3.12.14; SQLite 3.53.1. Plan SHA-256: `d6002573f16ecf4b6e71935bfdbed49d2f8e3ea3beec0b2d04a2d9b3329c56c0`. Each result report identifies its implementation, shared sources and actual execution time. Expected values were declared in `plan.json`, independently of observed importer outputs.

Assumptions:
- Each case starts with an empty database.
- A valid row has a nonempty string item_id and a signed 64-bit integer value; bool is not accepted as an integer.
- Completed-ID replay in this fixture means replay of the same payload.
- The concurrency and recovery requirements below remain planned obligations, not measured conclusions.

Not executed:
- Concurrent retries
- Process interruption or power loss
- Real service or network integration
- Different payload reused under a completed import ID
- Documentation review
- Operator recovery validation
- Proof CLI or Proof product execution

## 3. Applicable basis and risks

No external certification or contractual standard is claimed. The local requirements below are the acceptance basis for selected checks. A partial rejected batch could mislead the caller and corrupt later recovery; repeated completed IDs could duplicate data. The plan retains concurrency and recovery obligations even when this fixture cannot perform them.

| Requirement | Revision | Claim |
|---|---|---|
| IMP01 | 1 | A nonempty valid batch shall persist its rows and a completed-import checkpoint whose row_count equals the batch size. |
| IMP02 | 1 | Replaying a completed import ID with the same payload shall return the recorded completion count without additional rows or checkpoints. |
| IMP03 | 1 | If a row is malformed, the batch shall be rejected with an explicit row error and no rows or completion checkpoint from that batch shall remain persisted. |
| IMP04 | 1 | An empty batch shall be rejected explicitly without rows or a completed-import checkpoint. |
| IMP05 | 1 | Concurrent retries of one import shall not duplicate imported rows or completion checkpoints. The response contract for the competing attempts must be settled before the integration procedure is accepted. |
| IMP06 | 1 | Error and recovery documentation shall explain the malformed-row error, whole-batch rejection, correction/retry procedure and completed-ID replay limitation. |
| NEED01 | 1 | The intended operator shall be able to identify and correct the malformed row, retry the rejected import, and recognize successful completion without introducing duplicate data. |

## 4. Verification strategy

Use explicit response and persisted-state assertions, including a fresh connection after the operation. Start with the existing four-case suite, compare it with the plan, add the missing malformed-later-row case, then rerun the expanded suite after the transaction repair. Retain the failing observation as well as the repaired one. Concurrency requires integration work; documentation requires an actual review.

## 5. Verification register

### VP01 — IMP01

- Method / level: test / component / local SQLite.
- Owner: Developer.
- Required evidence: T01.
- Acceptance criterion: T01 returns completed with row_count 3; exactly the three specified rows and one completed checkpoint persist.
- Final recorded status: **passed**. Recorded: T01.
- Remaining work: No additional declared local case for this obligation; broader product acceptance remains separate.

### VP02 — IMP02

- Method / level: test / component / local SQLite.
- Owner: Developer.
- Required evidence: T02.
- Acceptance criterion: T02 returns completed then replayed with row_count 3; persisted rows and checkpoint are unchanged by replay.
- Final recorded status: **passed**. Recorded: T02.
- Remaining work: No additional declared local case for this obligation; broader product acceptance remains separate.

### VP03 — IMP03

- Method / level: test / component / local SQLite.
- Owner: Developer.
- Required evidence: T03, T05.
- Acceptance criterion: Both T03 and T05 return the specified INVALID_ROW error; after each rejected batch, persisted rows and checkpoints are empty.
- Final recorded status: **passed**. Recorded: T03, T05.
- Remaining work: No additional declared local case for this obligation; broader product acceptance remains separate.

### VP04 — IMP04

- Method / level: test / component / local SQLite.
- Owner: Developer.
- Required evidence: T04.
- Acceptance criterion: T04 returns EMPTY_BATCH and leaves persisted rows and checkpoints empty.
- Final recorded status: **passed**. Recorded: T04.
- Remaining work: No additional declared local case for this obligation; broader product acceptance remains separate.

### VP05 — IMP05

- Method / level: test / integration / concurrent retries.
- Owner: Integration owner (not assigned in this teaching run).
- Required evidence: INT-CONCURRENT-01.
- Acceptance criterion: Run the agreed simultaneous-retry procedure against the target service; observe one row set and one checkpoint, and compare both responses with the approved concurrency contract.
- Final recorded status: **not_run**. Missing: INT-CONCURRENT-01.
- Remaining work: Not run. Requires a real integration environment and an agreed competing-response contract.

### VP06 — IMP06

- Method / level: review / documentation / recovery procedure.
- Owner: Documentation reviewer (no review performed).
- Required evidence: REVIEW-RECOVERY-01.
- Acceptance criterion: Review the actual error and recovery instructions against IMP06; record reviewer, reviewed revision, findings and their disposition.
- Final recorded status: **not_performed**. Missing: REVIEW-RECOVERY-01.
- Remaining work: Not performed. No documentation review or approval is claimed.

## 6. Validation activities

**VAL01 / NEED01 — not performed.** Observe a representative operator use the recovery instructions to diagnose the malformed row, correct it, retry the rejected import and recognize the resulting three rows and completion; record usability problems and the acceptance decision. Owner role: Product acceptance owner (no validation performed). Required evidence: VALIDATE-RECOVERY-01. No user study, operator exercise or acceptance was simulated.

## 7. Environment and resources

Python's standard library and SQLite; no account, external service or third-party package required. Each case creates a temporary on-disk database and reads persisted state through a new connection. This does not reproduce a deployed service, concurrent process, power failure or production operating conditions.

## 8. Roles and independence

Developer for VP01–VP04; integration owner for VP05; documentation reviewer for VP06; product acceptance owner for VAL01. The integration owner has not been assigned in this teaching run. No independent assurance arrangement or approval is claimed.

## 9. Schedule and gates

| Stage | Entry | Exit observation |
|---|---|---|
| Baseline | Plan and buggy code present | Four recorded cases; compare against all six obligations |
| Add missing case | VP03's missing T05 identified | Record the failed persisted-state assertion |
| Repair | Failure understood; transactional implementation available | Rerun all five selected cases; retain remaining obligations |
| Product completion | Real integration environment, response contract and reviewers available | Pending: VP05, VP06, VAL01 and authorized acceptance |

## 10. Execution, anomalies and results

Run from `import-example/`:

```sh
python reproduce.py
python validate_fixture.py
```

The reproducer succeeds when it records the expected three scenarios consistently. The intentionally failing case runner and all three incomplete-plan checks return nonzero; their exit codes are retained in `reports/provenance.json`. A successful reproducer command is not a completed verification plan.

| Stage | Cases passed | Verification obligations supported | VP03 | Plan ready |
|---|---|---|---|---|
| legacy | 4/4 | 3/6 | partial | No |
| expanded-buggy | 4/5 | 3/6 | failed | No |
| fixed | 5/5 | 4/6 | passed | No |

The buggy T05 run returns INVALID_ROW for row2 but leaves row-a=11 persisted without a completion checkpoint. The repaired T05 run returns the same error with no rows or checkpoint persisted. The repair wraps row inserts and completion in one transaction.

## 11. Evidence and traceability

`plan.json` links requirement IDs to obligations and required evidence IDs. Each `*.results.json` retains inputs, expected and observed values, runtime, source/plan hashes and case outcomes. Each `*.plan-status.json` derives the obligation statuses. `reports/provenance.json` records subprocess commands, exit codes and artifact hashes. The checker also challenges false pass labels, duplicate/missing evidence and stale inputs; see its separate validation report.

Hashes identify file content; they do not authenticate an approver. The manifest checker checks declared obligations and consistency. It does not establish complete requirements or production suitability.

## 12. Changes, reruns and acceptance

Requirement, source, environment and procedure changes trigger an impact assessment. This small checker uses exact hashes; a real project may need a governed evidence-reuse decision. Required open work: concurrent retries (VP05), documentation review (VP06), operator recovery validation (VAL01). No exception or release approval has been recorded. The final disposition is **incomplete against the declared plan**.

## References

- Main guide: https://reqproof.com/topics/software-verification-plan
- Python SQLite context-manager documentation: https://docs.python.org/3/library/sqlite3.html#how-to-use-the-connection-context-manager
- Recorded sources and commands: `import-example/README.md`, `schema.md` and `reports/`.
