Skip to content

Commit 6c9291d

Browse files
docs: explain upward propagation with part_integrity="cascade"
Describe how cascade propagates restrictions upward from part to master, then back downstream to all sibling parts, deleting the entire compositional unit. Updated in both diagram.md and master-part.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56ecea4 commit 6c9291d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/reference/specs/diagram.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ Prepare a cascading delete. Starting from a restricted table expression, propaga
151151
|-------|----------|
152152
| `"enforce"` | Error if parts would be deleted before masters |
153153
| `"ignore"` | Allow deleting parts without masters |
154-
| `"cascade"` | Also delete masters when parts are deleted |
154+
| `"cascade"` | Propagate restriction upward from part to master, then re-propagate downstream to all sibling parts |
155+
156+
With `"cascade"`, the restriction flows **upward** from a part table to its master: the restricted part rows identify which master rows are affected, those masters receive a restriction, and that restriction propagates back downstream through the normal cascade — deleting the entire compositional unit (master + all parts), not just the originally matched part rows.
155157

156158
```python
157159
# Build a cascade from a restricted table

src/reference/specs/master-part.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,9 @@ Session.Trial.delete()
216216
(Session.Trial & condition).delete(part_integrity="cascade")
217217
```
218218

219-
**Behavior:**
220-
- Identifies affected masters
221-
- Deletes masters (which cascades to ALL their parts)
222-
- Maintains compositional integrity
219+
**Behavior:** The restriction propagates **upward** from the part to its master. Specifically, the restricted part rows identify which master rows are affected, and those masters receive a restriction. The master restriction then propagates back **downstream** through the normal cascade, reaching all sibling parts. The result is that the entire compositional unit — master plus all its parts — is deleted, not just the originally restricted part rows.
220+
221+
This upward propagation may trigger further rounds: if the master itself is a part of a higher-level master, the restriction continues upward. The cascade engine iterates until no new restrictions are produced.
223222

224223
### 4.6 Behavior Matrix
225224

0 commit comments

Comments
 (0)