Expand description
Conformance cases for ProcessStore backends (spec 3.2 §11, §13 Q8).
| Case | Contract |
|---|---|
put_get_round_trip | A row reads back exactly as put, every field and every Wake, ProcessKind and Suspension variant included; ids with :, / and non-ASCII characters survive |
put_replaces | A second put with the same pid replaces the row, and list finds it only under its new partition, queue and parent |
list_filters_and_orders | list applies partition, queue, parent and limit, orders by pid in byte order, and ignores states |
set_wake_and_queue | set_wake sets and clears the wake set, set_queue the queue, leaving every other field |
unknown_pid | get of an unknown pid is None; set_wake and set_queue fail with kernel.not_found and create no row; delete answers false |
delete | delete removes the row and its list entries and answers true, then false |
records_survive_a_restart | Rows read back through a new handle (durable backends only) |
concurrent_writers | Concurrent puts and updates from two handles over distinct pids lose no row, and concurrent updates of different fields of one row lose neither |
sustained_writes | A sustained stream of puts, updates and deletes from two handles, read concurrently, stays consistent and readable (SQLite’s write lock and WAL included) |
suspend_request_round_trips | set_suspend_requested sets and clears the flag leaving every other field, put writes it, list filters on it, and an unknown pid fails with kernel.not_found |
spend_sums_by_day_and_scope | spend sums add_spend over an inclusive day range per process or per partition; concurrent additions from two handles all count; deleting a process keeps its spend |
usage_sums_counters_by_day_and_scope | usage sums the cost, model calls, total tokens and every unit add_spend recorded, per process or per partition over an inclusive day range, through a second handle; concurrent additions all count; deleting a process keeps its usage |
Every case writes under fresh process ids in fresh partitions and deletes its rows at the end, so a harness may point every case at one shared database. Spend totals have no delete, so the spend case leaves its totals, under ids no other case uses.
Traits§
- Process
Store Harness - Opens a
ProcessStorebackend for the conformance suite.
Functions§
- concurrent_
writers - Sixteen writers over two handles put and update distinct pids at once and lose no row; two writers updating different fields of one row lose neither update.
- delete
deleteremoves the row and itslistentries and answerstrue, thenfalse; the pid can be put again.- list_
filters_ and_ orders listapplies partition, queue, parent and limit together, orders bypidin byte order (soB<Z<a<ä<日), and ignoresstates, which the process table applies after joining the run store.- put_
get_ round_ trip - A row reads back exactly as put: every field, every
Wake,ProcessKindandSuspensionvariant, named queues, unicode labels, and ids with:,/and non-ASCII characters. - put_
replaces - A second put with the same
pidreplaces the whole row;listthen finds it under its new partition, queue and parent only. - records_
survive_ a_ restart - Rows, with their updates, read back through a new handle as a restarted kernel opens one. Skipped for a backend that is not durable.
- set_
wake_ and_ queue set_wakesets and clears the wake set andset_queuesets the queue, each leaving every other field as it was;listfinds the row under its new queue.- spend_
sums_ by_ day_ and_ scope spendsums whatadd_spendrecorded over an inclusive range of UTC days, per process or per partition: additions to one day accumulate, ranges cross month and year boundaries and reach back to the first century, an empty or reversed range is 0, and a process charged in two partitions counts in each. Forty concurrent additions from two handles all count, and deleting a process’s row keeps its spend.- suspend_
request_ round_ trips set_suspend_requestedsets and clears the pending suspension request, leaving every other field;putwrites the flag and a second put replaces it;listfilters on it, alone and with the other fields;deletedrops a requested row from the filter; an unknownpidfails withkernel.not_foundand creates no row.- sustained_
writes - Four writers over two handles each run 150 rounds of put, set_wake and set_queue, and delete every third row, while two readers list and get without pause. No call fails, every read decodes to a state some write produced, and the final table holds exactly the rows not deleted, each with its last update.
- unknown_
pid - An unknown
pidreads asNone;set_wakeandset_queuefail withkernel.not_foundnaming it and create no row;deleteanswersfalse. - usage_
sums_ counters_ by_ day_ and_ scope usagesums whatadd_spendrecorded — cost, model calls, total tokens and each unit — over an inclusive range of UTC days, per process or per partition, read through a second handle: a delta with units and no cost counts, a unit no delta named stays absent, twenty concurrent additions from two handles all count, and deleting a process’s row keeps its usage.spendagrees with the costusagereports.