<a id="ch-07"></a>

## Chapter 7 — The patient-letters row is the April export

<!-- open-cyber-academy:lesson-figures:start ch-07 -->
### Lesson map

Lesson 07. Map, example, EX053.

```mermaid
flowchart TD
  E["April sharing export"] --> L["Tuple still says anyone-with-link"]
  A["Afternoon staff-only change"] --> D["Decision log"]
  L --> Q{"Does the log edit the tuple?"}
  D --> Q
  Q -->|No| K["The filter still prints the row"]
```

The export and the afternoon are different records.

### Logical drawing

```text
tuple:     patient-letters/ , anyone-with-link , True
log prose: staff-only , April afternoon , Leila
filter:    the tuple remains a failure line
```
<!-- open-cyber-academy:lesson-figures:end ch-07 -->

### Learning outcomes

After this chapter, you should be able to:

1. Say why `patient-letters/` remains on the failure list.
2. Keep the decision log outside the script.
3. Refuse a cleaned print that drops the row.

### 7.1 The afternoon does not rewrite the triple.

Chapter 1 records an afternoon change: the patient-letters folder became staff-only, with a log line that names the date, the exposure, and Leila. That line lives in the one-page log. The sharing script never reads the log.

The triple still holds `anyone-with-link` and `True`. The comprehension therefore still emits the first failure line. Removing it would change both the printed names and the count `shared too widely 3`. No such removal is in the file. The row is the evidence copy of the export, taken before further setting changes.

`invoices/` and `old-backup.zip` are the other two failure lines. They were not the folder a patient described. Their presence is why the filter was run on every top-level name rather than on the reported folder alone. Those two names also stay, for the same reason: the export was not edited after the invoices were later restricted or after the zip was later removed.

A reader who pastes only the afternoon state over the first triple is reporting a setting this program did not load.

### 7.2 Worked example

| Sentence | Record it belongs to | Decision |
|---|---|---|
| The first failure line is `patient-letters/: anyone-with-link` | The eight triples | Keep |
| The folder was set staff-only that afternoon | The decision log | Keep as prose |
| "The lab was rerun and the row disappeared." | No second list | Refuse |
| "Invoices were never in the export." | They are the second failure line | Refuse |

> **Synthetic case.** The log does not feed `lab_sharing.py`.

### Errors and limits

Later restrictions on invoices stay prose as well. The export's three lines stay together.

### Apply

- **EX053 — Which record.** Someone rewrites the first triple as staff-only and says the script now reports two items shared too widely. What still prints, and where does the afternoon change live? *Rubric:* 3 = the triple stays `anyone-with-link`; the filter still prints three names; the afternoon change stays in the log; do not edit the script;; 2 = the three lines stay and the log stays separate;; 1 = one line;; 0 = none.

<!-- open-cyber-academy:chapter-navigation:start ch-07 -->
### Continue studying — lesson 07 (chapter 07 of 20)

[← Chapter 06](#ch-06) · [Course chapter index](../SUBJECTS.md) · [Chapter 08 →](#ch-08)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex053"></a>
**EX053.** The first triple stays `anyone-with-link`. The filter still prints three names. The afternoon staff-only change stays in the decision log. The script is not edited.
