Skip to content

Commit 5db5155

Browse files
committed
docs(service-storage): re-anchor the dead tracker citations to the commits that decided them
42 comment and docblock sites under packages/services/service-storage/src cited tracker numbers that answer 404. Each now cites the commit in this repository's history that decided what the line describes, and says in its own words what that commit decided: the sys_attachment beforeUpdate gate (da891e0), the full-envelope ruling on the sharing contract (aa4b90d), batched held-file hydration (c3c72a4), the stamp-only organizationField scope pin (7901b2d), the source-hashes provenance companion (09b4f4e), the update/delete doors scoped to the acting organization (f087c37) and the loud permission-store outage (6a180e4). Comments only: every file keeps its line count and no code token moves. Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H Co-authored-by: Claude <noreply@anthropic.com>
1 parent 31ed067 commit 5db5155

15 files changed

Lines changed: 43 additions & 43 deletions

‎packages/services/service-storage/src/attachment-access-hooks.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe('attachment access — beforeDelete (uploader or parent editor)', () =>
222222
});
223223

224224
// ─────────────────────────────────────────────────────────────────────────
225-
// #10091 — beforeUpdate: uploader or parent editor, + the attach rule on a
225+
// [commit da891e0ef] beforeUpdate: uploader or parent editor, + the attach rule on a
226226
// re-point. The delete gate's rule applied to the verb that could otherwise
227227
// rewrite it away (the comment kit — derived from this one — has gated
228228
// update since #4630; the source kit was missing the limb its derivative
@@ -618,7 +618,7 @@ describe('unscoped multi-delete (no id, no where) — #4757 through the wired en
618618
});
619619

620620
// ─────────────────────────────────────────────────────────────────────────
621-
// #10091 through the WIRED engine — the update verb.
621+
// Commit da891e0ef's gate through the WIRED engine — the update verb.
622622
//
623623
// Same rig as the #4757 block above, driving `ql.update('sys_attachment', …)`
624624
// end to end: the unscoped refusal reaches the handler through the
@@ -763,7 +763,7 @@ describe('unscoped multi-update (no id, no where) — #10091 through the wired e
763763
// rebuilt a five-field projection of the caller's execution envelope before
764764
// handing it to `ISharingService.canEdit`, whose contract declares the FULL
765765
// envelope and whose doc block tells callers they "MUST NOT rebuild a subset
766-
// of it" (#6523 / the #6206 ruling).
766+
// of it" (commit aa4b90d9a, the full-envelope ruling).
767767
// ─────────────────────────────────────────────────────────────────────────
768768

769769
/**
@@ -911,9 +911,9 @@ describe('#7145 — caller envelope forwarded to the sharing gate', () => {
911911
);
912912

913913
const forwarded = canEdit.mock.calls[0]![2] as unknown as Record<string, unknown>;
914-
// Every principal field survives — the #6523 contract's unit is the
915-
// envelope, and #6206 forbids rebuilding a subset of it. `uploaded_by`
916-
// stamping does not touch the context.
914+
// Every principal field survives — the contract's unit is the envelope
915+
// (commit aa4b90d9a), and the full-envelope ruling forbids rebuilding a
916+
// subset of it. `uploaded_by` stamping does not touch the context.
917917
expect(forwarded).toEqual(DELEGATED_PRINCIPAL_FIELDS);
918918
// …and every middleware-private key resolved for `sys_attachment` is gone.
919919
for (const key of OPERATION_PRIVATE_KEYS) expect(forwarded).not.toHaveProperty(key);

‎packages/services/service-storage/src/attachment-access-hooks.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type {
2525
* on the parent; v1 enforces read visibility — strictly better than
2626
* nothing, edit-parity is a tracked follow-up.) `uploaded_by` is
2727
* server-stamped from the session — a client-supplied value never wins.
28-
* - beforeUpdate (#10091): the caller must be the uploader OR hold edit on
28+
* - beforeUpdate (commit da891e0ef): the caller must be the uploader OR hold edit on
2929
* the parent record — the delete rule, applied to the verb that could
3030
* otherwise rewrite the other two gates away: an ungated update let any
3131
* member re-point `parent_id` at a record they cannot see, or rewrite
@@ -124,9 +124,9 @@ function asIdList(id: unknown): Array<string | number> | null {
124124
* session snapshot lacks `permissions`, which sharing bypasses need.
125125
*
126126
* [#7145] Forwarded as the full envelope, which is what `ISharingService`
127-
* declares for every parameter this value is handed to and what the #6206
127+
* declares for every parameter this value is handed to and what the full-envelope
128128
* ruling requires of every caller: they "MUST NOT rebuild a subset of it"
129-
* (#6523). The five-field projection this replaced (`userId` / `tenantId` /
129+
* (commit aa4b90d9a). The five-field projection this replaced (`userId` / `tenantId` /
130130
* `positions` / `permissions` / `isSystem`) was doing two jobs at once, and
131131
* only one of them was correct — same defect, same kit, one package over from
132132
* `comment-access-hooks.ts` (#7141 / PR #7143), which this mirrors:
@@ -467,7 +467,7 @@ export function installAttachmentAccessHooks(
467467
// the mechanism was ruled onto `beforeUpdate` as well; the refusal stays
468468
// PER REGISTRATION. This one carries #4757's delete refusal under its
469469
// grandfathered `ATTACHMENT_DELETE_DENIED` envelope; the `beforeUpdate`
470-
// registration above declares the update-verb refusal (#10091) under the
470+
// registration above declares the update-verb refusal (commit da891e0ef) under the
471471
// standard catalog code — the same both-verbs pairing the derived
472472
// comment kit ships.
473473
{ object: 'sys_attachment', packageId: PACKAGE_ID, dispatchUnscopedMultiWrite: true },

‎packages/services/service-storage/src/attachment-lifecycle.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export async function findFileHolder(
367367

368368
/**
369369
* The BATCHED form of {@link findFileHolder} — "which of these files is still
370-
* held?" — for callers holding many rows at once (#11427).
370+
* held?" — for callers holding many rows at once (commit c3c72a4bc).
371371
*
372372
* Record file-field hydration is such a caller: it must reach the same verdict
373373
* the download path reaches (#10246) or one `sys_file` row gets two answers,

‎packages/services/service-storage/src/backfill-sys-file-organizations.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
* `createRecordOrganizationResolver`, and the divergence from the precedent is
8484
* the point of this paragraph. That resolver's limb 0 reads
8585
* `tenancy.organizationField`, a STAMP-ONLY key whose consumers are scope-pinned
86-
* by the #8778 ruling (widened by name on cloud#1395) to exactly three
86+
* by its ruling (commit 7901b2dd2; widened by name on cloud#1395) to exactly three
8787
* platform-row writers; a fourth needs its own maintainer ruling. It would also
8888
* be the WRONG question here. That key answers "which column says who this row
8989
* is ABOUT"; this sweep needs "which column is this subject WALLED by", because

‎packages/services/service-storage/src/file-read-tenancy-posture-admission.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,10 @@ describe('[#15352] §5b — a `tenancy` service that was REGISTERED and FAILED i
576576
* the digits are now asserted, and they are the declared ones.
577577
*
578578
* What happened: the authorizer always re-raised the brand
579-
* (`isAuthzStoreUnavailableError(err) ⇒ throw`, #13279), and
579+
* (`isAuthzStoreUnavailableError(err) ⇒ throw`, commit 6a180e42d), and
580580
* `registerStorageRoutes`' `authorizeDownload` absorbed that re-raise one
581581
* frame up in `catch { verdict = 'deny' }`, rendering an outage as the gate's
582-
* own capability refusal — the confusion #13279 exists to prevent. That
582+
* own capability refusal — the confusion commit 6a180e42d was made to prevent. That
583583
* `catch` now RELAYS the declared envelope instead (⛔ not a bare re-raise:
584584
* the route's outer `catch` would answer `500 INTERNAL`, and the shared
585585
* render for an escaped envelope is #16545 and has not landed).

‎packages/services/service-storage/src/file-reference-lifecycle.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const SYSTEM_CTX = { isSystem: true, [RAW_FILE_VALUES_CONTEXT_KEY]: true } as co
108108
*
109109
* This mirrors `StorageMetadataStore`'s `StorageWriteContext` threading
110110
* (`createFile` #12745, `createSession` #12928, the update/delete halves
111-
* #13178) rather than inventing a second convention: the caller hands the
111+
* in commit f087c376f) rather than inventing a second convention: the caller hands the
112112
* engine the organization it is acting in as an execution context, and the
113113
* platform's existing insert-side chokepoint decides the rest. ⛔ The
114114
* organization is NOT written onto the payload here — whether this object has

‎packages/services/service-storage/src/metadata-store.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface FileRecord {
7777
* every walled deployment — a warning naming exactly this defect ("writes will
7878
* not be tenant-isolated").
7979
*
80-
* ## What the SAME context does on update / delete (#13178)
80+
* ## What the SAME context does on update / delete (commit f087c376f)
8181
*
8282
* ⚠️ Not the same thing, and the difference is the whole reason the
8383
* `update`/`delete` doors are not a copy-paste of the insert ones. Write-side
@@ -350,7 +350,7 @@ export class StorageMetadataStore {
350350
/**
351351
* Update one `sys_file` row.
352352
*
353-
* `context` carries the acting organization (#13178). It is the SAME channel
353+
* `context` carries the acting organization (commit f087c376f). It is the SAME channel
354354
* {@link createFile} opened in #12745 — `{ context: { tenantId } }` on the
355355
* engine options bag — and this door is the `update` half of that insert
356356
* that #12745 did not repair. What the value MEANS differs by verb, and
@@ -381,7 +381,7 @@ export class StorageMetadataStore {
381381
// stand up a second isolation mechanism outside the driver that owns
382382
// the one real one. A no-engine deployment has no wall to be on the
383383
// wrong side of (the same sentence `createFile`'s stand-in already
384-
// makes), so this branch is unchanged by #13178.
384+
// makes), so this branch is unchanged by commit f087c376f.
385385
this.files.set(id, merged);
386386
return merged;
387387
}
@@ -395,7 +395,7 @@ export class StorageMetadataStore {
395395
/**
396396
* Delete one `sys_file` row.
397397
*
398-
* `context` carries the acting organization (#13178) — the `delete` half of
398+
* `context` carries the acting organization (commit f087c376f) — the `delete` half of
399399
* #12745's insert, repaired for the same reason and through the same
400400
* channel as {@link updateFile}. See {@link StorageWriteContext} for what
401401
* the value does on this verb (it scopes the statement; it stamps nothing).
@@ -480,7 +480,7 @@ export class StorageMetadataStore {
480480
/**
481481
* Update one `sys_upload_session` row.
482482
*
483-
* `context` carries the acting organization (#13178) — the `update` half of
483+
* `context` carries the acting organization (commit f087c376f) — the `update` half of
484484
* the insert #12928 repaired, the `sys_upload_session` sibling of
485485
* {@link updateFile}. Same channel, same chokepoint, and the same split
486486
* between stamping and scoping that {@link StorageWriteContext} records.
@@ -522,7 +522,7 @@ export class StorageMetadataStore {
522522
/**
523523
* Delete one `sys_upload_session` row.
524524
*
525-
* `context` carries the acting organization (#13178) — the `delete` half of
525+
* `context` carries the acting organization (commit f087c376f) — the `delete` half of
526526
* #12928's insert. See {@link StorageWriteContext} for what the value does
527527
* on this verb.
528528
*/

‎packages/services/service-storage/src/storage-routes.authz-outage-relay.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* ## What was measured, and why this row came first
99
*
1010
* `buildFileReadAuthorizer` re-raises `AuthzStoreUnavailableError` rather than
11-
* returning `'deny'` (#13279). `registerStorageRoutes`' `authorizeDownload`
11+
* returning `'deny'` (commit 6a180e42d). `registerStorageRoutes`' `authorizeDownload`
1212
* then wrapped the whole authorizer call in `catch { verdict = 'deny' }` one
1313
* frame up, so the re-raise was absorbed and the outage rendered as
1414
* `403 FILE_DOWNLOAD_DENIED` / `403 ATTACHMENT_DOWNLOAD_DENIED`. Fail-CLOSED,
1515
* never an admission — but indistinguishable on the wire from a genuine
16-
* refusal, which is the exact confusion #13279 exists to prevent, and the worst
16+
* refusal, which is the exact confusion commit 6a180e42d was made to prevent, and the worst
1717
* shape in this card's six-site census (the datasource and settings families
1818
* lost the envelope into a 500; this one lost it into a *verdict*).
1919
*

‎packages/services/service-storage/src/storage-routes.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type FileReadVerdict = 'allow' | 'deny' | 'unauthenticated';
3939
* session with no active organization resolves to `undefined` rather than to a
4040
* guess.
4141
*
42-
* ⚠️ Since #13178 the same value also travels on this door's `updateFile` /
42+
* ⚠️ Since commit f087c376f the same value also travels on this door's `updateFile` /
4343
* `updateSession` calls, where it does something DIFFERENT — it scopes the
4444
* statement instead of stamping a column, so a row belonging to another
4545
* organization is no longer reachable (see `StorageWriteContext`). Two
@@ -196,9 +196,9 @@ export function registerStorageRoutes(
196196
} catch (err) {
197197
// [#15999, ruling item 3] An UNREADABLE authorization store is an outage,
198198
// not a verdict. `buildFileReadAuthorizer` already re-raises the brand
199-
// rather than returning `'deny'` (#13279) — and until now this `catch`
199+
// rather than returning `'deny'` (commit 6a180e42d) — and until now this `catch`
200200
// absorbed that re-raise one frame up and rendered it as this gate's own
201-
// `403`, which is precisely the confusion #13279 exists to prevent: an
201+
// `403`, which is precisely the confusion commit 6a180e42d was made to prevent: an
202202
// outage answered as a capability denial, indistinguishable on the wire
203203
// from a genuine refusal.
204204
//
@@ -452,7 +452,7 @@ export function registerStorageRoutes(
452452
// ---------------------------------------------------------------------------
453453
httpServer.post(`${basePath}/upload/complete`, async (req: IHttpRequest, res: IHttpResponse) => {
454454
try {
455-
// [#13178] Bound, not discarded: this handler already resolved the
455+
// [commit f087c376f] Bound, not discarded: this handler already resolved the
456456
// session and threw the value away, which is what left the commit
457457
// statement unscoped and raising `[tenant-audit]`.
458458
const session = await requireUploadSession(req, res);
@@ -592,7 +592,7 @@ export function registerStorageRoutes(
592592
// ---------------------------------------------------------------------------
593593
httpServer.put(`${basePath}/upload/chunked/:uploadId/chunk/:chunkIndex`, async (req: IHttpRequest, res: IHttpResponse) => {
594594
try {
595-
// [#13178] Bound rather than discarded — see the commit door above.
595+
// [commit f087c376f] Bound rather than discarded — see the commit door above.
596596
// Named `authSession` because `session` below is the sys_upload_session
597597
// ROW; these are two different things and the handler needs both.
598598
const authSession = await requireUploadSession(req, res);
@@ -680,7 +680,7 @@ export function registerStorageRoutes(
680680
// ---------------------------------------------------------------------------
681681
httpServer.post(`${basePath}/upload/chunked/:uploadId/complete`, async (req: IHttpRequest, res: IHttpResponse) => {
682682
try {
683-
// [#13178] Bound rather than discarded — see the commit door above.
683+
// [commit f087c376f] Bound rather than discarded — see the commit door above.
684684
const authSession = await requireUploadSession(req, res);
685685
if (authSession === false) return;
686686
const writeContext: StorageWriteContext = { organizationId: authSession?.organizationId };
@@ -750,7 +750,7 @@ export function registerStorageRoutes(
750750
// ---------------------------------------------------------------------------
751751
httpServer.get(`${basePath}/upload/chunked/:uploadId/progress`, async (req: IHttpRequest, res: IHttpResponse) => {
752752
try {
753-
// [#13178] Bound rather than discarded — the progress door can WRITE
753+
// [commit f087c376f] Bound rather than discarded — the progress door can WRITE
754754
// (`expireIfPastDeadline` statuses the row `expired`), so it owes the
755755
// same context the other two write doors do.
756756
const authSession = await requireUploadSession(req, res);

‎packages/services/service-storage/src/storage-service-plugin.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ describe('StorageServicePlugin: sys_file orphan lifecycle wiring (#2755)', () =>
464464

465465
// Lifecycle hooks (afterDelete/afterInsert, plus afterUpdate since #10171
466466
// gave the update verb its detach leg) + access hooks
467-
// (beforeInsert/beforeUpdate/beforeDelete, #10091 added the update verb)
467+
// (beforeInsert/beforeUpdate/beforeDelete; commit da891e0ef added the update verb)
468468
// — see attachment-lifecycle.ts and attachment-access-hooks.ts.
469469
//
470470
// [#10240] There is exactly ONE `beforeDelete` here, and it is the access

0 commit comments

Comments
 (0)