<a id="week-07-day-04"></a>

#### 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:

~~~python
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:

~~~text
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](#exercise-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](#answer-ex034). 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-07-day-03) · [Week 7 index](#week-07-index) · [Course index](../SUBJECTS.md) · [Next: Day 35](#week-07-day-05).

### Exercise for this lesson

<a id="exercise-ex034"></a>
**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](#answer-ex034).

## Worked answers

<a id="answer-ex034"></a>
**EX034 — Model fixture output.** The supplied code prints exactly:

```text
unexpected tasks: ['sync-override']
requests outside approved run: ['q-144']
```

This compares the two provided sets only. It cannot prove the job inventory includes every runner, or that a person intentionally installed the unexpected task. If a source record were missing, a set difference could mislead; retain source provenance and the approved inventory's version alongside the output.

**Additional professional worked reasoning:** The original code identifies sync-override and q-144 only in its two supplied inventories. Preserve both inputs, their versions, acquisition limits and request-ID namespace verification. C7X's NO_TRIGGER_ELAPSED illustrates why zero later runs cannot prove a disabled job remains suppressed without a scheduled opportunity. Neither a set difference nor a short quiet log identifies a human.

**Week 7 Day 34 — worked comparison and recurrence controls.** Section 7.5 prints unexpected tasks ['sync-override'] and requests outside approved run ['q-144']; §7.11 prints the same lists under its C7 labels. Removing observed batch-17 in a separately labeled run leaves both printed lists unchanged; the reverse approved-minus-observed key comparison yields ['batch-17']. It cannot explain whether the source was incomplete. W7-RELATION's four lines show train-extra unexpected, an empty global request delta, the extra ('train-extra', 'train-r1') relation and missing train-approved. Association and direction are distinct from request-value membership. C7X's eight row results are BOUNDED_SCHEDULER_CHECK_NOT_ERADICATION, HOLD_BASELINE_UNVERIFIED, PROPOSED_NOT_APPROVED, APPROVED_NOT_EXECUTED, EFFECT_NOT_VERIFIED, NO_EXPECTED_TRIGGER_TESTED, TASK_STILL_EXECUTING and BUSINESS_REGRESSION. In particular expected_fire=False with no new run cannot pass; the classifier's first failing gate is not an exhaustive finding list, so any supplied positive new run must still be investigated. No flag authenticates a schedule or receipt, and no set difference identifies intent, all runners or a human.
