Skip to main content

Trace practice and calibration

Preserve your prediction before opening the lab reference implementation.

  1. A unsubscribes B before B’s turn and registers C during publication. The mutation happens only once. Predict two publications. Calibration: A; then A,C. New registrations are outside the current token snapshot; live cancellation suppresses B.
  2. The same callback is registered twice. Remove one token and publish. Calibration: one invocation remains. Tokens identify subscriptions, not callback identities.
  3. A raises ValueError, B records the event. Calibration: B still runs, the returned error list contains A’s token and ValueError, and the next publication works. No rollback of A’s partial effects is implied.
  4. A attempts nested publication without catching RuntimeError. Calibration: the outer call records A’s RuntimeError and continues to B; the nested publication delivers nothing.
  5. Insert A then B, undo, try deleting outside the text, then redo. Calibration: invalid deletion changes nothing; redo restores AB. Repeat with empty insertion: it also preserves redo. Repeat with insertion C: text becomes AC and redo is gone.
  6. A closes the publisher; B is pending. Calibration: B is skipped, later publication rejects, and repeated close remains safe.
  7. Compare a direct function, a Strategy and a Command for a single pure calculation. Calibration: choose the function unless a specific variation/lifecycle/history requirement justifies more structure; class names alone do not supply guarantees.
  8. Draw both remote send/record crash windows. Calibration: send-before-record risks duplicates, record-before-send risks omission. Name the coordination or reconciliation needed before claiming safe retries.

For each failed prediction, state which contract sentence you missed and solve a changed trace. These guided answers do not replace the unseen transfer assessment.

Compare with the core package​

These calibrations apply to behavioral-contracts.zip. In core L02, task 1 instead delivers A,B on the first publication; in core L03, a valid no-op after undo drops redo. Keep both predictions and explain the named contracts. Core Subject has no close operation, so task 6 is an additional lifecycle obligation here.