Practice Solutions and Diagnostic Calibration
Preserve your attempt first. Equivalent correct implementations and design choices are accepted when they satisfy the stated contract. These are worked checks, not a claim of learner performance.
Diagnostic calibration
A fake callback can append its arguments to a list before returning a fixed value. Two calls can duplicate effects even when the final price matches. Assignment shares a list; shallow copying the outer dict still shares its child. After the second acquisition fails, the first acquired resource still needs its owner's cleanup. Final-value-only tests can miss duplicated calls, wrong order, leaked ownership and exception changes. Rejected operations should not destroy valid history when failure atomicity is the declared contract.
P01–P04
P01 calls button then scrollbar, exactly once each; both carry dark. Shape alone cannot establish a matching family. P02 rejects dark/light and preserves the call trace. P03 either callable dispatch or an object can enforce the same policy; compare concrete edit sites rather than class count. P04 the kit has no rollback protocol for product resources; use an explicit acquisition scope such as the existing extension's context-manager composition. Construction names do not supply ownership automatically.
P05–P08
P05 GET accepts only None; POST accepts all three given body values. This is the fixture's API choice. P06 the returned headers and caller dictionary must be different objects; each mutation leaves the other unchanged. P07 individual fields can be checked early; constraints involving multiple fields need a complete-state check before publication. A builder adds value only if its construction workflow or readability warrants it. P08 rejection must not mutate a previously returned value or expose a new invalid one.
P09–P12
P09 shallow copies retain the original shared child. A deep clone separates it from the source while preserving the two clone references to one cloned child. P10 editing cloned-left also changes cloned-right, but not the original list. P11 copied[0] is copied is true while copied is original is false; identity memoization preserves the cycle. P12 copying configuration while retaining a borrowed service may be correct; explicit ownership rules take precedence over a generic deep-copy habit. No copied socket is promised.
P13–P16
P13 total9, empty total0. P14 total10; a global visited set that discards the second occurrence changes the problem. P15 detect an identity already on the current recursion path and reject. Remove it on return so another independent path may reuse it. P16 unique inventory requires stable item identity and deduplication semantics; two occurrences of one item distinguish the contracts. An acyclic chain can still exceed a recursive implementation's depth limit.
P17–P20
P17 the observed effects are open/read/read/close; repeated close adds none. Close-before-read performs no acquisition and subsequent read fails. P18 failed factory acquisition leaves the proxy empty and retryable; failed read after acquisition still leaves an owned object to close. If close can fail, a new explicit retry/failure-state policy is needed. P19 lazy lifetime, result caching and added behavior have different contracts even if each wraps another object. Concurrent cache misses can duplicate underlying calls. P20 preserve the trace and compare alternatives using the named changed requirement; no universal preference for classes or functions earns credit.
Experiment and project calibration
E1 must preserve identity/mutation observations for all three methods. E2 counts actual changed sites for both dimensions of variation without extrapolating asymptotic laws. E3 distinguishes borrowed/owned and acquired/not-acquired states. A project passes design judgment only if the chosen abstraction serves a named change pressure, the tests inspect the risky claim, and a simpler alternative is considered. The core kit's pass does not replace the separate SC extension or independent explanation.