Skip to content

Commit a9a4ea4

Browse files
committed
docs(plugin-audit): re-anchor the dead tracker citations to the commits that decided them
Stage 9 of the domain:services dead-citation sweep (ruling C+D, form C). Every comment or docblock site under packages/plugins/plugin-audit/src that cited a tracker number answering 404 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. Comments only: each touched 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 d282087 commit a9a4ea4

16 files changed

Lines changed: 56 additions & 56 deletions

‎packages/plugins/plugin-audit/src/activity-type-vocabulary-enforcement.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* red THERE. Breaking a writer is red here and green there. Neither file alone
4141
* covers this object.
4242
*
43-
* ## 2026-08-24 — what the ruling on #11507 changed about this file
43+
* ## 2026-08-24 — what the open-vocabulary ruling (commit 88b9d749a) changed about this file
4444
*
4545
* Nothing about the measurements; everything about what they MEAN. #8203 wrote
4646
* §3 as "a defect, characterized", with the instruction to delete those cases
@@ -319,7 +319,7 @@ describe('[#8203/#11507] an author-contributed type is accepted — the open-voc
319319
* instruction is RETIRED, and deleting them now would delete the only
320320
* end-to-end measurement of a ruled contract.
321321
*
322-
* Maintainer ruling, 2026-08-24, #11507 (direction 4): `sys_activity.type` is
322+
* Maintainer ruling, 2026-08-24, commit 88b9d749a (direction 4): `sys_activity.type` is
323323
* an OPEN, author-extensible vocabulary. The declared options are the
324324
* platform's built-in set; ADR-0052 §5b.2 `activityMilestones[].type` stays a
325325
* sanctioned write path; an author-contributed value landing verbatim is what
@@ -329,7 +329,7 @@ describe('[#8203/#11507] an author-contributed type is accepted — the open-voc
329329
* So a red here no longer reads "the fix landed". It reads: something has
330330
* started REJECTING an author-contributed value — which is direction 3, a
331331
* shipped authoring surface turned into a rejection path. Do not adapt these
332-
* cases to it and do not weaken them; re-open #11507, because that is a
332+
* cases to it and do not weaken them; re-open the ruling (commit 88b9d749a), because that is a
333333
* maintainer call and not a test-fixing exercise.
334334
*
335335
* The mechanism is unchanged and still worth knowing: every field on this
@@ -362,7 +362,7 @@ describe('[#8203/#11507] an author-contributed type is accepted — the open-voc
362362
* in the spec, so any metadata author can name any string and it lands. This
363363
* is the authoring-time face of the open vocabulary, and the one an AI-written
364364
* metadata app meets first — which is exactly why the declaration now says so
365-
* in its own `description` (#11507), instead of showing that author a list
365+
* in its own `description` (commit 88b9d749a), instead of showing that author a list
366366
* that reads closed.
367367
*/
368368
it('a milestone declaring an undeclared type writes it — the authoring-surface hole', async () => {

‎packages/plugins/plugin-audit/src/audit-hook-object-scope.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
* gates bought a `driver.findOne` / matched-row read for a handler that was
1717
* going to return on its first line.
1818
*
19-
* ## Why an allow list could not fix it (#5928, PR #6575)
19+
* ## Why an allow list could not fix it (#5928, commit 69787f07b)
2020
*
2121
* `SKIP_OBJECTS` is a DENY list over an OPEN universe: `/meta` PUT registers new
2222
* objects into a running engine with no event a plugin could subscribe to, so a
2323
* registrant that enumerated the complement would freeze its list at boot and
2424
* silently stop auditing everything created afterwards — a compliance
25-
* regression, and a quiet one. The `excludeObjects` face #6575 added is the
25+
* regression, and a quiet one. The `excludeObjects` face commit 69787f07b added is the
2626
* expression this plugin was missing; `test 3` below is the pin that the deny
2727
* direction is preserved.
2828
*
@@ -462,7 +462,7 @@ describe('[#5860] the skip list is declared on the registration face', () => {
462462
// invariant, and it is what this now asserts. An object-SCOPED gate costs
463463
// the demand gate nothing beyond its own object — and on these two
464464
// objects nothing at all: `comment-access-hooks.ts` (#4630) and
465-
// service-storage's `attachment-access-hooks.ts` (#10091) already declare
465+
// service-storage's `attachment-access-hooks.ts` (commit da891e0ef) already declare
466466
// `beforeUpdate` scoped to `sys_comment` / `sys_attachment`, so
467467
// `hasHooksFor` is already true for both wherever the access kits install.
468468
const globalPreImage = registrations
@@ -524,7 +524,7 @@ describe('[#5860] the skip list is declared on the registration face', () => {
524524
expect(excluded).toContain('sys_comment');
525525
expect(excluded).toContain('sys_job_queue');
526526
expect(excluded).not.toContain('biz_task');
527-
// #6575 refuses both of these at registration; a spread of the real skip
527+
// Commit 69787f07b refuses both of these at registration; a spread of the real skip
528528
// list can never produce them, and this says so out loud.
529529
expect(excluded).not.toContain('*');
530530
expect(excluded.every((n) => typeof n === 'string' && n.trim().length > 0)).toBe(true);

‎packages/plugins/plugin-audit/src/audit-writers.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ describe('audit writers — a lost audit row is reported at error (#5226)', () =
12081208
* keep losing rows for hours to a second fault with one `error` line at the
12091209
* top of the log describing the first;
12101210
* 2. that one line named the telemetry-datasource remedy unconditionally. The
1211-
* cause measured on #14927 was `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` and
1211+
* cause commit ab489388b records was `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` and
12121212
* the text said "datasource" — the operator was sent to check something
12131213
* that was not broken.
12141214
*
@@ -1367,7 +1367,7 @@ describe('audit writers — reported once per CAUSE, not once per process (#1516
13671367
expect(forMissingTable).toMatch(/telemetry/);
13681368
expect(forMissingTable).toMatch(/OS_TELEMETRY_DB=0/);
13691369

1370-
// The measured #14927 misdirection: the cause was an organization refusal
1370+
// The misdirection commit ab489388b records: the cause was an organization refusal
13711371
// and the text said "datasource".
13721372
const refused = makeCauseEngine(() => ORG_REQUIRED());
13731373
await refused.fire('crm_lead', 'l-1');
@@ -1407,7 +1407,7 @@ describe('audit writers — reported once per CAUSE, not once per process (#1516
14071407
});
14081408

14091409
/**
1410-
* [#8707] Which organization an audit row is stamped with — the RECORD'S own,
1410+
* [commit 1408fe385] Which organization an audit row is stamped with — the RECORD'S own,
14111411
* honouring the maintainer's ruling on #8287.
14121412
*
14131413
* The precedence these cases pin is `recordOrgId ?? sess.organizationId`. Read the
@@ -1645,12 +1645,12 @@ describe('audit writers — the record\'s own organization stamps the row (#8707
16451645
expect(stampOf(created).audit?.organization_id).not.toBe('org-parent');
16461646
});
16471647

1648-
// ── the platform stamp column — `sys_api_key` (#8778, #19054) ──────────
1648+
// ── the platform stamp column — `sys_api_key` (commit 7901b2dd2, #19054) ──
16491649
//
16501650
// The former ⛔ KNOWN GAP case lived here: it pinned that
16511651
// `sys_api_key.active_organization_id` was UNREACHABLE and stamped the
16521652
// ACTOR's org, and was written to go red the day the divergence became
1653-
// expressible. That day is #8778 (maintainer-ruled option A); the cases
1653+
// expressible. That day came with commit 7901b2dd2 (maintainer-ruled option A); the cases
16541654
// below are its rewrite, expecting `org-key`. #19054 moved the divergence
16551655
// off the authorable `tenancy.organizationField` key and into
16561656
// `PLATFORM_STAMP_ORGANIZATION_COLUMNS`, keyed by object name — so these
@@ -1879,7 +1879,7 @@ describe('audit writers — the writer reads the session key the engine emits (#
18791879

18801880
// This case is GREEN before and after the #9516 fix on purpose: it pins
18811881
// that fixing WHICH KEY the fallback arm reads did not disturb the ORDER
1882-
// the #8707 ruling set (honouring the maintainer's ruling on #8287).
1882+
// commit 1408fe385 set (honouring the maintainer's ruling on #8287).
18831883
await fire('afterInsert', {
18841884
object: 'crm_lead',
18851885
input: { id: 'lead-1' },
@@ -1919,7 +1919,7 @@ describe('audit writers — the writer reads the session key the engine emits (#
19191919
// Lower stakes than the audit stamp — it feeds `resolveWriteLocale` and the
19201920
// emitted envelope's `organizationId` rather than a row behind an RLS wall —
19211921
// but the same removed key, dead the same way. Note the ORDER here is
1922-
// session-first and stays that way: #8707's ruling reasons about an AUDIT
1922+
// session-first and stays that way: commit 1408fe385 reasons about an AUDIT
19231923
// ROW read through the record's own tenant wall, which is not what a mention
19241924
// notification is. Only the key changes at this site.
19251925
const setupMentions = (schemas: Record<string, string[] | Record<string, any>> = SINGLE_TENANT) => {

‎packages/plugins/plugin-audit/src/audit-writers.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { SECRET_MASK, collectMaskedReadFields } from '@objectstack/objectql/core
2020
// picker, the search companion and the approval inbox the day an author sets
2121
// `nameField` — the same argument the SECRET_MASK import above makes.
2222
import { referenceTargetOf, resolveDisplayField } from '@objectstack/spec/data';
23-
// [#8707 / #10101] The platform-row organization resolver, imported rather
24-
// than owned. It started life in THIS file (#8707, honouring #8287's ruling)
23+
// [commit 1408fe385 / #10101] The platform-row organization resolver, imported rather
24+
// than owned. It started life in THIS file (commit 1408fe385, honouring #8287's ruling)
2525
// and was promoted to `@objectstack/metadata-core` by the maintainer ruling
2626
// recorded on cloud#1395: ONE shared resolver for all three platform-row
2727
// writers (audit, approvals, automation runs) — a per-writer copy of the
@@ -190,7 +190,7 @@ const SKIP_OBJECTS = new Set<string>([
190190
* #5038's bulk equivalents) had to answer "yes, a hook covers this object" for
191191
* every one of these tables and buy a row read for a handler that returns on
192192
* its first line. The knowledge existed; the contract had nowhere to put it
193-
* until #5928 / PR #6575 added `excludeObjects`.
193+
* until #5928 / commit 69787f07b added `excludeObjects`.
194194
*
195195
* Why the negative face and not `object: [...]` with the complement: the object
196196
* universe is OPEN. `/meta` PUT registers new objects into a running engine and
@@ -223,7 +223,7 @@ const NOISE_FIELDS = new Set<string>([
223223
]);
224224

225225
/**
226-
* [#8144 / #8707 / #10101] `createFieldPresenceProbe` and
226+
* [#8144 / commit 1408fe385 / #10101] `createFieldPresenceProbe` and
227227
* `resolveRecordOrganizationField` were defined HERE until #10101 promoted
228228
* them to `@objectstack/metadata-core` (the cloud#1395 ruling: one shared
229229
* platform-row organization resolver for audit, approvals and automation
@@ -786,7 +786,7 @@ function renderMilestoneSummary(
786786
* puts a CLOSED vocabulary there — SQLSTATE (`42P01`, `23505`), mysql2's
787787
* symbolic names (`ER_NO_SUCH_TABLE`), SQLite's `SQLITE_*` — and ADR-0112 does
788788
* the same for the engine's own refusals (`ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED`,
789-
* the cause measured on #14927). None of them varies per row.
789+
* the cause commit ab489388b records). None of them varies per row.
790790
*
791791
* So the key is bounded by two sets fixed at BOOT — the declared object
792792
* registry and the driver's code vocabulary — and by nothing that grows with
@@ -1030,7 +1030,7 @@ export function installAuditWriters(
10301030
return def;
10311031
};
10321032

1033-
// [#8707 / #10101] The object's own organization COLUMN and value, through
1033+
// [commit 1408fe385 / #10101] The object's own organization COLUMN and value, through
10341034
// the SHARED platform-row resolver (`@objectstack/metadata-core`) — one
10351035
// memoized instance per installation, the same instance shape the approval
10361036
// writer and the automation-run recorder hold. See
@@ -1347,7 +1347,7 @@ export function installAuditWriters(
13471347
// a strict sys_user lookup); the service principal lands on `actor`.
13481348
const actorLabel: string | null =
13491349
userId ?? (typeof sess.actor === 'string' && sess.actor.trim() ? sess.actor.trim() : null);
1350-
// [#8707, honouring #8287's ruling] The audited RECORD'S OWN organization
1350+
// [commit 1408fe385, honouring #8287's ruling] The audited RECORD'S OWN organization
13511351
// wins; the acting session's active organization is the fallback. ⛔ Do not
13521352
// flip this back to `sess.organizationId ?? recordOrgId`.
13531353
//
@@ -1399,7 +1399,7 @@ export function installAuditWriters(
13991399
// `readonly: true` (so `validateRecord` skips them) and this whole path is
14001400
// wrapped in swallow-and-report.
14011401
//
1402-
// It survived a careful review of exactly these lines because #8707
1402+
// It survived a careful review of exactly these lines because commit 1408fe385
14031403
// reordered the two arms without evaluating either one: reordering two
14041404
// expressions does not tell you whether they resolve. The pins in
14051405
// `audit-writers.test.ts` (#9516 block) are what check this comment against
@@ -1689,7 +1689,7 @@ export function installAuditWriters(
16891689
* the declaration whether or not a creation happened. On insert only, a
16901690
* caller barred from *creating* an attachment on a `files: false` object
16911691
* could *move* an existing one onto it. `attachment-access-hooks.ts`
1692-
* authorizes the re-point (#10091: the new `parent_object`/`parent_id`
1692+
* authorizes the re-point (commit da891e0ef: the new `parent_object`/`parent_id`
16931693
* must be editable) — access, again, not capability.
16941694
*/
16951695
const enforceFilesCapability = async (ctx: HookContext) => {

‎packages/plugins/plugin-audit/src/capability-gate-update-verb.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* *move* an existing one onto it, and a `sys_comment` could be re-threaded
1111
* into a feeds-disabled object's thread. The access kits authorize the
1212
* re-point (`comment-access-hooks.ts` since #4630,
13-
* `attachment-access-hooks.ts` since #10091) — those are ACCESS checks, and
13+
* `attachment-access-hooks.ts` since commit da891e0ef) — those are ACCESS checks, and
1414
* the capability half was never asked on the update verb.
1515
*
1616
* This file runs against a REAL `ObjectQL` (a stub driver underneath), not the

‎packages/plugins/plugin-audit/src/comment-access-hooks.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ describe('comment access — beforeDelete (author or parent editor)', () => {
261261
).rejects.toMatchObject({ code: 'RECORD_NOT_ACCESSIBLE' });
262262
});
263263

264-
// [#9798] The UNSCOPED multi-write block that used to sit here called the
264+
// [commit c7655d472] The UNSCOPED multi-write block that used to sit here called the
265265
// handlers DIRECTLY with a whole-operation context of this file's own
266266
// construction — a shape the engine's per-row dispatch (#5038/#5574) never
267267
// produced on either verb, so it stayed green for a behaviour the wired
@@ -401,8 +401,8 @@ describe('#7141 — caller envelope forwarded to the sharing gate', () => {
401401
await beforeDelete(envelopeWriteCtx('beforeDelete', { id: 'c1' }, { ...DELEGATED_ENVELOPE }));
402402

403403
const forwarded = canEdit.mock.calls[0]![2] as unknown as Record<string, unknown>;
404-
// Every principal field survives — the #6523 contract's unit is the envelope
405-
// and #6206 forbids rebuilding a subset of it.
404+
// Every principal field survives — the unit of commit aa4b90d9a's contract is the envelope
405+
// and the full-envelope ruling forbids rebuilding a subset of it.
406406
expect(forwarded).toEqual({
407407
userId: 'human_1',
408408
tenantId: 'org_1',
@@ -534,7 +534,7 @@ describe('#7141 — caller envelope forwarded to the sharing gate', () => {
534534
});
535535

536536
// ─────────────────────────────────────────────────────────────────────────
537-
// #4630's unscoped multi-write refusals through the WIRED engine (#9798)
537+
// #4630's unscoped multi-write refusals through the WIRED engine (commit c7655d472)
538538
//
539539
// A real `ObjectQL` + in-memory driver + this module's installer — the exact
540540
// path `ql.delete('sys_comment', …)` / `ql.update('sys_comment', …)` take in

‎packages/plugins/plugin-audit/src/comment-access-hooks.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* carrying NEITHER an id NOR a `where` is refused outright rather than
3333
* authorizing the whole table by resolving zero rows — on BOTH verbs that
3434
* refusal reaches this handler through the `dispatchUnscopedMultiWrite`
35-
* whole-operation dispatch both registrations declare (#9719/#9798 built
35+
* whole-operation dispatch both registrations declare (#9719/commit c7655d472 built
3636
* it for delete; #9974 ruled it onto update).
3737
* - {@link installCommentReadVisibility} — the read side: a
3838
* `find`/`findOne`/`count`/`aggregate` middleware that intersects the query
@@ -74,7 +74,7 @@ export interface CommentAccessEngine {
7474
options?: {
7575
object?: string;
7676
packageId?: string;
77-
/** [#9798, both verbs since #9974] Opt-in whole-operation `beforeUpdate` /
77+
/** [commit c7655d472, both verbs since #9974] Opt-in whole-operation `beforeUpdate` /
7878
* `beforeDelete` dispatch for an UNSCOPED predicate write
7979
* (`multi: true`, no `where`) — the engine declaration added by #9719.
8080
* Declared here because this file's registrations pass it; the mechanism,
@@ -219,7 +219,7 @@ function asIdList(id: unknown): Array<string | number> | null {
219219
* snapshot lacks `permissions`, which sharing bypasses need.
220220
*
221221
* [#7136] Typed as the full envelope, which is what `ISharingService` declares
222-
* for every parameter this value is handed to (#6523 / the #6206 ruling).
222+
* for every parameter this value is handed to (commit aa4b90d9a / the full-envelope ruling).
223223
*
224224
* [#7141] And FORWARDED as the full envelope, which is the other half of that
225225
* ruling: a caller "MUST NOT rebuild a subset of it". The five-field projection
@@ -369,7 +369,7 @@ export function installCommentAccessHooks(
369369
// authorize row-by-row, and "nothing to authorize" must never read as
370370
// "allowed" (the engine would hand an unscoped AST to deleteMany).
371371
//
372-
// [#9798/#9974] This branch is verb-neutral in what it says AND, since
372+
// [commit c7655d472/#9974] This branch is verb-neutral in what it says AND, since
373373
// #9974, in what reaches it. On BOTH verbs the only dispatch that can
374374
// deliver this shape is the `dispatchUnscopedMultiWrite` whole-operation
375375
// dispatch this module's two `before*` registrations declare (see below):
@@ -472,7 +472,7 @@ export function installCommentAccessHooks(
472472
}
473473
},
474474
// [#9974] `dispatchUnscopedMultiWrite` is what makes the #4630 unscoped
475-
// refusal in `resolveTargetRows` REACHABLE ON UPDATE — the half #9798 could
475+
// refusal in `resolveTargetRows` REACHABLE ON UPDATE — the half commit c7655d472 could
476476
// not land, ruled in on 2026-08-19. Without it the predicate path dispatches
477477
// per row with `input.id` bound (so the by-id branch shadows the shape
478478
// check) and a zero-match predicate dispatches nothing, leaving the declared
@@ -491,7 +491,7 @@ export function installCommentAccessHooks(
491491
if (!rows.length) return; // nothing matched — nothing to authorize
492492
await authorizeRows(ctx, rows, 'delete');
493493
},
494-
// [#9798] `dispatchUnscopedMultiWrite` is what makes the #4630 unscoped
494+
// [commit c7655d472] `dispatchUnscopedMultiWrite` is what makes the #4630 unscoped
495495
// refusal in `resolveTargetRows` REACHABLE through the wired engine: the
496496
// predicate path dispatches per row with `input.id` bound (so the by-id
497497
// branch shadows the check), and a zero-match predicate dispatches nothing

‎packages/plugins/plugin-audit/src/objects/sys-activity-type-open-vocabulary.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { ObjectSchema } from '@objectstack/spec/data';
55
import { SysActivity } from './index.js';
66

77
/**
8-
* #11507 — the declaration of `sys_activity.type` must say what the column
8+
* Commit 88b9d749a — the declaration of `sys_activity.type` must say what the column
99
* actually is: an OPEN, author-extensible vocabulary whose declared options are
1010
* the platform's BUILT-IN set.
1111
*
1212
* ## The ruling this file executes
1313
*
14-
* Maintainer, 2026-08-24, on #11507 (direction 4 of the four the card framed),
14+
* Maintainer, 2026-08-24, on the card behind commit 88b9d749a (direction 4 of the four it framed),
1515
* verbatim: 「四维分析一致的,接手你的建议。」 Recorded on the card as:
1616
*
1717
* > the column is an open, author-extensible vocabulary. […] make the
@@ -92,7 +92,7 @@ describe('[#11507] sys_activity.type is an OPEN vocabulary and the declaration s
9292
});
9393

9494
/**
95-
* The load-bearing assertion, and the deliverable of #11507. The three
95+
* The load-bearing assertion, and the deliverable of commit 88b9d749a. The three
9696
* markers are the three things an author must be able to learn FROM THE
9797
* DECLARATION ITSELF:
9898
* - the declared list is the BUILT-IN set (not the whole legal set);

0 commit comments

Comments
 (0)