Skip to content

Commit 9e21e91

Browse files
committed
docs(spec): a missing master row of a controlled_by_parent master is the master_chain leg, on the first hop or above it
The record_not_found bullet of ControlledByParentWriteUnresolvedReason said the legs judge a missing master row on the first hop and only above it is it the master_chain leg. The walk reads a controlled_by_parent master's row after the legs on every iteration, the first included, so an absent row there answers master_chain. The changeset names the sentence. Claude-Session: https://claude.ai/code/session_01KNKBCRDJCu5tGy3TEbvtrF Co-authored-by: Claude <noreply@anthropic.com>
1 parent 99f06a1 commit 9e21e91

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎.changeset/22497-master-chain-docblock.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
'@objectstack/plugin-sharing': patch
44
---
55

6-
docs: three contract docblocks now describe what the code decides. No type, schema or runtime change.
6+
docs: four contract docblocks now describe what the code decides. No type, schema or runtime change.
77

88
Clause-②: no
99

10-
- **`ControlledByParentWriteDenialLeg` (`@objectstack/spec`).** The `master_chain` leg has three resolution refusals: no relation to derive from, a row that is not present, and an empty master reference. Each names the master whose own master the walk could not derive. That master is the record's own master, when it is itself `controlled_by_parent`, or any master above it. The docblock said only a master above the record's own master. The next sentence now says "past the record itself" where it said "above the first hop", so the two agree.
10+
- **`ControlledByParentWriteDenialLeg` (`@objectstack/spec`).** The `master_chain` leg has three resolution refusals: no relation to derive from, a row that is not present, and an empty master reference. Each names the master whose own master the walk could not derive. That master is the record's own master, when it is itself `controlled_by_parent`, or any master above it. The docblock said only a master above the record's own master. The next sentence now says "past the record itself" where it said "above the first hop", so the two agree. The `record_not_found` bullet of `ControlledByParentWriteUnresolvedReason` had the same first-hop gap for a missing master row: it now says an absent row of a master that is itself `controlled_by_parent` is the `master_chain` leg, on the first hop or above it, and the legs judge a missing row only where the master governs its own rows.
1111
- **`ISharingService.canEdit` (`@objectstack/spec`) and `SharingService.canEdit` (`@objectstack/plugin-sharing`).** The caller lists no longer name the `sys_attachment` and `sys_comment` parent gates. Those gates read `checkEdit` and the master-detail write check. The `ISharingService.canEdit` sentence on how they reach the service now names `checkEdit`.
1212

1313
`ControlledByParentWriteDenialLeg`, `ControlledByParentWriteOutcome`, `canEdit` and `checkEdit` keep their declared shapes, and no verdict, outcome or refusal changes.

‎packages/spec/src/contracts/security-service.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,11 @@ export type ControlledByParentWriteDenialLeg =
340340
* defect (`422 INVALID_METADATA`).
341341
* - `record_not_found`: the record `(object, recordId)` does not exist
342342
* (`404 RECORD_NOT_FOUND`). This is the addressed record, not its master. A
343-
* missing master row is not one of these outcomes: on the first hop the legs
344-
* judge it as they judge any master row, and above the first hop it is the
345-
* `master_chain` leg.
343+
* missing master row is not one of these outcomes: where the master governs
344+
* its own rows the legs judge it as they judge any master row, and where it
345+
* is itself `controlled_by_parent` the walk reads that row to derive the next
346+
* master, so an absent row after the legs is the `master_chain` leg, on the
347+
* first hop or above it.
346348
* - `master_reference_missing`: the record's stored master reference is empty
347349
* (`422 MISSING_REQUIRED_FIELD`).
348350
*/

0 commit comments

Comments
 (0)