Day 34 — Test inventory differences and refuse a recurrence pass without opportunity
Learning task. Reproduce all three retained fixtures and explain exactly which property each computes. In §7.5, observed task names − approved task names finds supplied unexpected keys; the request-union difference finds requests outside the supplied approved runs. Section 7.11 repeats these bounded comparisons with C7 labels. Neither program authenticates a baseline, detects an absent expected task through the reverse difference, or preserves every task/request association after flattening to request sets. Completeness, version, environment, interval and identifier semantics are inputs to review, not facts inferred by set arithmetic.
Worked transcripts. Section 7.5 prints unexpected tasks: ['sync-override'] and requests outside approved run: ['q-144']. Section 7.11 prints the same lists under C7 unexpected tasks: and C7 outside approved:. Remove batch-17 from the observed mapping in a separate run: these two forward differences still produce those same outputs. The missing approved task requires inspecting approved − observed; the original program does not print it. An absent row in a partial export would not prove the job vanished. Preserve the original fixture and label the mutation, rather than quietly treating modified input as a new CTN inventory.
Offline laboratory W7-RELATION — preserve the association and comparison direction. Python 3 standard library, in-memory mappings only; the train- identifiers are separate synthetic objects. The first observed map assigns the same request label to both the expected and extra task. Predict why a flat request union can miss an extra relation, then reproduce four lines:
approved7 = {"train-approved": {"train-r1"}}
observed7 = {"train-approved": {"train-r1"}, "train-extra": {"train-r1"}}
def pairs7(mapping):
return {(task, request) for task, requests in mapping.items() for request in requests}
print("W7 unexpected tasks:", sorted(set(observed7) - set(approved7)))
print("W7 global request delta:", sorted(set().union(*observed7.values()) - set().union(*approved7.values())))
print("W7 relation delta:", sorted(pairs7(observed7) - pairs7(approved7)))
missing7 = {"train-extra": {"train-r1"}}
print("W7 missing approved tasks:", sorted(set(approved7) - set(missing7)))
Exact transcript reproduced in publication validation:
W7 unexpected tasks: ['train-extra']
W7 global request delta: []
W7 relation delta: [('train-extra', 'train-r1')]
W7 missing approved tasks: ['train-approved']
The empty global delta is not approval of the extra task/request relation. The typed pair preserves an association lost by union. However, these strings do not establish real namespace authenticity, uniqueness, intent or a complete approved inventory. The final row detects a missing key in the supplied map, not the cause of its absence. Request source coverage before turning a discrepancy into a corrective action.
C7X recurrence gate. Run §7.14 unchanged. Its eight outputs distinguish a bounded scheduler check, missing preserved baseline, no approval, no execution receipt, unknown effect, no scheduled opportunity, recurrence and business regression. In particular, NO_TRIGGER_ELAPSED: NO_EXPECTED_TRIGGER_TESTED must refuse proof of nonrecurrence. A disabled status and no observed run cannot replace a known next trigger, source health and a legitimate integration control. BASE is only BOUNDED_SCHEDULER_CHECK_NOT_ERADICATION, even when all declared flags agree.
Adverse interpretation. Setting expected_fire=False and new_run=False must never yield a success claim. Separately, an observed new run is positive evidence requiring review even if no invocation was expected: C7X reports the first failing gate, not an exhaustive list of all inconsistent inputs. Do not use its early label to suppress a supplied recurrence event. The toy function assumes well-formed declared flags; it cannot verify a schedule, receipt, approver or log pipeline. C24 supplies no next-trigger result, so do not populate C7X's BASE from the case and call it tested eradication.
Practice and limit. Submit EX034 with the two original two-line transcripts, W7-RELATION's four lines and C7X's eight, plus source-coverage and scheduled-opportunity limitations. Compare the worked answer. All executed code here reads invented mappings/flags; it does not disable a real task or test a live recovery method.
Previous: Day 33 · Week 7 index · Course index · Next: Day 35.
Exercise for this lesson
EX034 — Manifest fixture. Objective: distinguish finite inventory differences from coverage and recurrence evidence. Inputs: §§7.5/7.11/C7X and Day 34 W7-RELATION. Reproduce all four transcripts (2, 2, 8 and 4 lines respectively); in a separate §7.11 mutation remove batch-17 and explain why its printed lists do not reveal the missing key. Give the reverse difference, the lost-association example and two independent source/actor limits. Demonstrate that no scheduled opportunity cannot pass C7X nonrecurrence and explain its first-failing-gate limitation. No fixture verdict is CTN-wide eradication. Rubric: 0 = invented case outcome, intent or recurrence pass without opportunity; 1 = exact original lists but incomplete adverse controls/limits; 2 = all transcripts and scoped direction, association, service and opportunity reasoning. Worked answer.