Skip to content
pi-c Artifact [4d4e12d3d1]
Login

Artifact [4d4e12d3d1]

Artifact 4d4e12d3d14294d1568b938d77dc6b43d32e42aa20fd04feea236dbe0dfeaf94:


Core acceptance catalog

Status: proposed executable scenarios; none implemented or passed yet. Reference contracts are in durability, harness, provider, and context. Stage ownership and qualification policy are in implementation-plan.md.

Scenario record and oracle

Every executable case records: case ID; linked contract IDs; initial persistent state; admitted input; seeded schedule; injected fault point; expected recovered state; permitted external effects; expected observer/submitter outcome; release-build variant; and evidence path.

The oracle is a small independent transition model plus an external-effect ledger. It must not call the implementation's recovery/eligibility functions to decide expected results. The fake provider supplies recorded chunks and fixed outcomes; it does not call an LLM. Stable operation/task/entry IDs, not text search, drive assertions.

Outcomes distinguish stored, refused, and unknown. A client error is not proof of rollback. An external effect may remain unknown after interruption; that is valid only where explicitly represented and never silently repeated.

Storage, admission, and observation

Case Setup/input and fault Persistent-state oracle External-effects / observer oracle Contracts
A01 Submit a keyed input; kill immediately before admission commit. Reopen contains either the complete admitted transition or none, determined by actual commit. No execution before admission; no durable acknowledgement without a receipt. D01,D03,D04
A02 Commit admission, drop the acknowledgement, resend the same request key after reopen. One submission identity and one admitted input; original settlement is reacquired. No second execution caused by retrying admission. D02
A03 Reuse a request key with another submission type or changed content. Type mismatch rejects; current Pi dedup does not compare complete payload equality. Record the chosen C payload-conflict policy before implementation. No second admission; divergence must be explicit. D02
A04 Append entry, change document, and advance task together; inject failure between writes and at COMMIT. All-or-none for that batch; failed acknowledgement can be unknown, resolved by reopen/IDs. No successful acknowledgement of partial state. D03,D04,C03
A05 Submit several batches; deterministically refuse the middle one. Earlier batches stored; refused and later batches absent. Only receipted prefix is eligible for publication; correct caller outcomes. D04
A06 Storage records a receipt and then reports failure; separately fail the Session before later publication. Stored data survives reopen even if caller rejects; later durable-but-unpublished state is recovered. Receipted state publishes according to Session failure boundary; never invent rollback from rejection. D03,D04
A07 Observe partial progress; crash before deferred persistence, then at its deadline/end-of-turn commit. Only eligible latest/initial-fork document changes can be lost within the declared window; authoritative entries and task transitions cannot defer. Distinguish transient progress from durable acknowledgement; test chosen strict/deferred policy explicitly. D19,D21
A08 Rebuild context indexes and update redaction while a conversation has sleeping/unfinished tasks. Runtime IDs, messages, checkpoints, and ownership survive; derived IDs may change. Search/archive changes cannot execute or cancel tasks. C05,C07,D07
A09 Open a second writer, a read-only viewer, and a writer after a forced crash. Writer ownership excludes competitors; viewer does not migrate/recover/mutate; crashed owner's lock is recoverable. At most one executor; SQLite locking alone is not the oracle for ownership. D16,D18,C02
A10 Migrate an old database/task/document; open unknown-newer and malformed versions; interrupt migration. Supported migration is atomic; unsupported data is refused or blocked without reinterpretation/destruction. No effects from blocked tasks; clear diagnostics and preserved original data. D17

Scheduler and external effects

Case Setup/input and fault Persistent-state oracle External-effects / observer oracle Contracts
A11 Crash before and after each checkpoint in a two-phase task. Resume from persisted phase/checkpoint, not a saved stack or inferred transcript. Phase-local repeated work is permitted only under declared effect rules. D07
A12 Crash during a model request, repeatedly during its recovery, and after a clean close. Durable attempt/backoff state, bounded crash loop, correct distinction between interrupted request and clean close. No tight retry loop; fake provider attempt ledger matches policy. D05,D20,P14
A13 Poll a deferred provider result; crash before/after recording its handle or poll result. Existing handle is reused when durable; expiry and unavailable continuation have explicit outcomes. Poll is not mistaken for creation; no blind recreation. D05,P09
A14 Interrupt a replay-unsafe tool after intent and before result persistence. Terminal interrupted/unknown outcome with committed partial output, not fabricated success. No automatic re-execution of the uncertain effect. D06,D22
A15 Interrupt a replay-safe tool after remote success but before local result commit. Persistent idempotency reference reused on recovery. Fake remote ledger counts one logical effect despite multiple attempts; unsafe services require reconciliation. D06,D22
A16 Parent makes keyed nested calls; crash while first finishes and second runs. Reuse completed result; recover second under its own replay policy; never recreate child identities. Caller order/key changes are rejected or diagnosed under the declared contract. D10
A17 Abort races with effect start, park, child creation, and result commit. Durable abort mark controls eligibility; ordinary owned work drains before owner terminal state. Post-mark run commits rejected; repeated abort/cancel is idempotent; completed external effects are not claimed undone. D08,D09,D13
A18 Finish a parent while children run, fail a child, and interrupt its cleanup. Parent stays completing until ordinary owned work settles; background ownership boundary preserved. No unowned process leak or false settled event. D08,D10
A19 Deliver a signal before sleep, twice, after deadline, after abort, and with invalid data. Correct delivered/duplicate/invalid/closed/not_found states; one consumed key per wait. Authenticated host boundary; expired/duplicate callbacks do not revive closed work. D11,D12
A20 Sleep/park across restart with an advanced controlled clock; restart an evictable host before it arms wakeup. No held invocation; correct checkpoint and earliest wake; host arming protocol cannot strand runnable work. At most policy-permitted deliveries; no busy polling or infinite wake loop. D12,D13
A21 Exhaust crash limit; remove/reinstall or upgrade a task definition during recovery. Bounded restart counter, explicit blocked reasons, version-safe resumption. Finite failure is observable; reinstall does not bypass abort or replay policy. D17,D20

Provider, tool, and client boundaries

Case Setup/input and fault Persistent-state oracle External-effects / observer oracle Contracts
A22 Feed every split of a short SSE/JSON fixture, randomized splits of long fixtures, malformed UTF-8, truncated arguments, and setup errors. Preserve canonical structured blocks and incomplete status; reject invalid calls before execution. Valid start/delta/end/error sequence; no use-after-free when listeners retain permitted data. P01–P08
A23 Retry 429/5xx/network failures with retry hints; abort during backoff; exhaust both HTTP and runtime budgets. Explicit runtime retry deadline; no accidental multiplication of retry budgets. Measurable bounded attempts; nonretryable failures do not retry. P14,D05
A24 Switch provider/model with signatures, images, changing tools, and unanswered calls in history. Canonical originals preserved; adapter projection follows pinned capability rules. No foreign signature leakage or claims that synthetic tool errors prove execution outcomes. P02,P10–P13,P16,P17
A25 Run two parallel tools with reversed finish order, invalid args, a blocked call, and mixed terminate flags. Outcomes correlate to original calls; append result messages in source order. Completion events may be completion-ordered; termination only under the batch rule. H02,H03,P07
A26 Stream large process output; timeout/abort parent; interrupt file edit/write at declared boundaries. Stored intent/outcome agrees with reconciliation policy; spilled output is owned and retention is explicit. Child process group ends within bound or is reported unresolved; no automatic assumption that filesystem state rolled back. H04,H05,H07,D06,D22
A27 Steer and follow up while preparing/executing tools, retrying, and compacting. Independent queues, durable admission, no lost/duplicate delivery across restart. Correct drain boundaries; settled only when automatic work is exhausted. H01,H06,H08,D01
A28 Fork/clone/tree switch and compact with pending calls; lose compaction result; rebuild context. Branch immutability, document copy policy, no copied live tasks, preserved raw history/context manifest. Conversation fork is not workspace rollback; stale compaction cannot replace a newer boundary. H10–H15,D14,D15,C07
A29 Disconnect/reconnect observers or RPC while responses stream; send LF/CRLF JSONL with Unicode separators; EOF and repeated shutdown. Reacquire submission and authoritative entries; bounded window/gap behavior matches declared protocol. Prompt admission is not completion; no duplicate terminal events; malformed framing is rejected safely. H08,H09,H26,D19,P05
A30 Discover rules/skills/config before and after trust; load hostile archived instructions; deliver unauthenticated approvals. Selected resource versions and authorization principal are explicit; archive is data, not approval authority. No unapproved resource execution; secrets absent from searchable export/logs; documented trust changes are intentional. H15–H21,H24,H30,C05,C06,C09

Extension and release scenarios to expand in their owning stages

The 30 scenarios are a core starting suite, not complete coverage of all 79 mapped IDs. Each owning stage must expand its remaining IDs into executable cases or an explicitly reviewed deviation before claiming parity.

Crash and power-loss distinction

Real process-kill tests validate application recovery and SQLite process-crash behavior. They do not prove power-loss survival. Stable-storage qualification needs an appropriate SQLite VFS/fault-storage model or controlled VM/device reset test with an independently durable acknowledgement ledger. Pin that harness and state its limitations. Never simulate acknowledged fsync data disappearing and label it a valid FULL-policy failure, or retain unsynced data in the simulator and claim to have tested power loss.