Assessment Solutions and Scoring
Each answer states the minimum reasoning expected at level 2. Level 3 adds a defended changed case and alternative. Different designs can pass; contradictions with the stated contract cannot.
A01
Reject bool despite Python int subclassing. One policy call is required; log the saved result instead of invoking again. A callable dependency can isolate one provider for tests; a class needs additional ownership/lifecycle benefits. Render failure skips persist and still runs guaranteed cleanup. Reject answers based solely on number of implementations.
A02
First snapshot contains A,B, so A then B run; the nested attempt raises before delivery and is collected if it escapes A. Second snapshot contains A,C. If A attempts nesting again, a second reported error is expected. Each B registration has its own token; disposing one handle repeatedly cannot remove the other. Require membership, error and identity reasoning.
A03
ab -> xb -> ab -> ab -> xb. Invalid edit neither creates an undo entry nor destroys redo. Text-only restore can leave cursor out of bounds or at the wrong visible position. Full credit requires identifying restoration observations and aliasing, not simply saying use deepcopy.
A04
Mark-before risks recording done without sending after a crash. Mark-after risks duplicate send after success with lost acknowledgement. An effect-specific idempotency/reconciliation protocol is needed. Accepted-fact replay applies known state changes without live sends; commands may fail or produce different outcomes on replay. The kit offers no durable/crash/concurrency guarantee.
A05
Multiple extensions are valid if every new state/event pair is specified, guards are explicit, rejected operations leave state unchanged, and a witness reaches/leaves the new state. Preserve public error/status observations or classify changes intentionally. State classes may delegate transition selection to a context; they need not know every successor.
A06
Construction: no fetch. First next fetches 0 then 1 and returns 7. Second returns 8 with no fetch. Third fetches 2 and returns 9. A resource-owning fetch requires explicit lifetime and error/early-stop cleanup; tuple pages in the kit have no close operation. Require a close trace or context-manager design rather than relying on eventual GC.
A07
L06 first allow stops before quota; that is wrong for an all-mandatory-checks policy. In that policy authentication success continues and quota failure terminates. Specify the final allow only after all required checks. Under L06 empty/all-pass denies and exceptions propagate without later calls. Test order and calls skipped, not only the final value.
A08
Neg changes the element interface and every exhaustive visitor; Count adds one visitor implementing existing methods. accept selects the node-specific method, and the visitor supplies the operation. Parse/AST validation still checks syntax; false short-circuits missing-name lookup, true forces it and fails. A different static unknown-name policy must be labeled as changed semantics.
A09
One workflow coordinator normalizes method, computes derived requirements/submit state, then renders without creating user-change feedback. Bind async responses to owner/generation and dispose subscriptions. Observer communicates changes; Mediator owns interaction policy. Accept an equivalent pure function design and require the eight-case table from P19.
A10
Under project policy state remains published and the accepted record stays present; report notification failure separately. Do not retry approval or resend on replay. Use a matrix/version-list oracle separate from implementation, generated short histories and a failure injection. Name excluded concurrency/durability claims. Recheck a weak gate plus one other on unseen cases after 7–14 days.
Additional retry and runtime scope
For A04, also distinguish concurrent retries, reuse of an identity with a conflicting payload, and deduplication retention. A stable key requires an effect-specific coordination contract. The runtime key separately grades BD1–BD6 with live cancellation and no-op preservation; do not apply those answers to core A02/A03 without stating a changed contract.