Skip to content

Commit 16bfff0

Browse files
d-csclaude
andcommitted
docs(mollifier): strip internal planning labels from comments
Remove plan-tracking shorthand (Q#, C#, F#, Phase N, _plans/) from trigger-layer mollifier comments and test names; reword to plain English. Comment/test-name only; no behaviour change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3429def commit 16bfff0

6 files changed

Lines changed: 26 additions & 30 deletions

File tree

apps/webapp/app/runEngine/concerns/idempotencyKeys.server.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class IdempotencyKeyConcern {
4646
private readonly traceEventConcern: TraceEventConcern
4747
) {}
4848

49-
// Q5 buffer-side dedup. Resolves an idempotency key against the
49+
// Buffer-side idempotency dedup. Resolves an idempotency key against the
5050
// mollifier buffer when PG missed. Returns a SyntheticRun cast to
5151
// TaskRun so the route handler (which only reads run.id / run.friendlyId)
5252
// can echo the buffered run's friendlyId as a cached hit. Returns null
@@ -114,7 +114,7 @@ export class IdempotencyKeyConcern {
114114
})
115115
: undefined;
116116

117-
// Buffer fallback per Q5 mollifier-idempotency design. PG missed —
117+
// Buffer fallback per the mollifier-idempotency design. PG missed —
118118
// the same key may belong to a buffered run that hasn't materialised
119119
// yet. Skipped when `resumeParentOnCompletion` is set: blocking a
120120
// parent on a buffered child via waitpoint requires a PG row that
@@ -222,9 +222,8 @@ export class IdempotencyKeyConcern {
222222
return { isCached: true, run: existingRun };
223223
}
224224

225-
// Pre-gate claim — closes the PG+buffer race during gate transition
226-
// (see _plans/2026-05-21-mollifier-idempotency-claim.md). All
227-
// same-key triggers serialise here before evaluateGate decides
225+
// Pre-gate claim — closes the PG+buffer race during gate transition.
226+
// All same-key triggers serialise here before evaluateGate decides
228227
// PG-pass-through vs mollify. Skipped for triggerAndWait
229228
// (resumeParentOnCompletion) — that path bypasses the gate via F4
230229
// and its existing PG-side dedup is sufficient.

apps/webapp/app/runEngine/services/triggerTask.server.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ export class RunEngineTriggerTaskService {
269269
// resolve it — publish on success so waiters see our runId,
270270
// release on error so the next claimant can retry. Stored in an
271271
// outer scope so the try/catch at the bottom of `callV2` can act
272-
// on whichever return path or throw the pipeline takes. Plan doc:
273-
// _plans/2026-05-21-mollifier-idempotency-claim.md
272+
// on whichever return path or throw the pipeline takes.
274273
idempotencyClaim = claimResult;
275274

276275
if (idempotencyKey) {
@@ -471,7 +470,7 @@ export class RunEngineTriggerTaskService {
471470
decision: mollifierOutcome.decision,
472471
buffer: mollifierBuffer,
473472
// Idempotency-key triple wires the buffer's SETNX into
474-
// the trigger-time dedup symmetric with PG (Q5).
473+
// the trigger-time dedup symmetric with PG.
475474
idempotencyKey,
476475
taskIdentifier: taskId,
477476
});
@@ -539,8 +538,8 @@ export class RunEngineTriggerTaskService {
539538
// onDebounced is a closure over webapp state (triggerRequest +
540539
// traceEventConcern) and can't be serialised into the mollifier
541540
// snapshot. The pass-through path attaches it here; the drainer
542-
// path replays without it. C1/F4 gate bypasses ensure debounce
543-
// and triggerAndWait never reach the mollify branch.
541+
// path replays without it. The debounce and triggerAndWait gate
542+
// bypasses ensure neither reaches the mollify branch.
544543
onDebounced:
545544
body.options?.debounce && body.options?.resumeParentOnCompletion
546545
? async ({ existingRun, waitpoint, debounceKey }) => {
@@ -643,7 +642,7 @@ export class RunEngineTriggerTaskService {
643642
}
644643

645644
// Build the engine.trigger() input object from the values gathered during
646-
// this.call(). Extracted so the mollify path (Phase 2) can construct the
645+
// this.call(). Extracted so the mollify path can construct the
647646
// same input shape without re-entering the trace-run span. The pass-through
648647
// path spreads this result and attaches `onDebounced` inline; the mollify
649648
// path serialises it into the buffer for drainer replay.

apps/webapp/app/v3/mollifier/mollifierGate.server.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export type GateInputs = {
4646
// the pattern used by `canAccessAi`, `canAccessPrivateConnections`, and the
4747
// compute-template beta gate.
4848
orgFeatureFlags: Record<string, unknown> | null;
49-
// Trigger options that drive C1/C3/F4 bypasses. The mollify path can't
49+
// Trigger options that drive the debounce / OTU / triggerAndWait
50+
// bypasses. The mollify path can't
5051
// serialise stateful callbacks (debounce), can't safely break OTU's
5152
// synchronous-rejection contract, and shouldn't intercept single
5253
// triggerAndWait (batchTriggerAndWait still funnels through per item).
@@ -151,25 +152,23 @@ export async function evaluateGate(
151152
): Promise<GateOutcome> {
152153
const d = { ...defaultGateDependencies, ...deps };
153154

154-
// C1 — debounce bypass. onDebounced is a closure over webapp state and
155+
// Debounce bypass. onDebounced is a closure over webapp state and
155156
// can't be snapshotted into the buffer for drainer replay. Skip before the
156157
// trip evaluator so debounce traffic is never counted against the rate.
157158
if (inputs.options?.debounce) {
158159
d.recordDecision("pass_through");
159160
return { action: "pass_through" };
160161
}
161-
// C3 — OneTimeUseToken bypass. OTU is a security feature on the PUBLIC_JWT
162+
// OneTimeUseToken bypass. OTU is a security feature on the PUBLIC_JWT
162163
// auth path; its synchronous-rejection contract is materially worse to
163-
// break than the idempotency-key contract. Sibling brief:
164-
// `_plans/2026-05-13-mollifier-otu-protection.md`.
164+
// break than the idempotency-key contract.
165165
if (inputs.options?.oneTimeUseToken) {
166166
d.recordDecision("pass_through");
167167
return { action: "pass_through" };
168168
}
169-
// F4 — single triggerAndWait bypass. batchTriggerAndWait still funnels
169+
// Single triggerAndWait bypass. batchTriggerAndWait still funnels
170170
// through TriggerTaskService.call per item so the dominant burst pattern
171-
// remains covered. Sibling brief:
172-
// `_plans/2026-05-13-mollifier-trigger-and-wait-protection.md`.
171+
// remains covered.
173172
if (inputs.options?.parentTaskRunId && inputs.options?.resumeParentOnCompletion) {
174173
d.recordDecision("pass_through");
175174
return { action: "pass_through" };

apps/webapp/app/v3/mollifier/mollifierMollify.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type MollifyNotice = {
1212
export type MollifySyntheticResult = {
1313
// `id` is the canonical TaskRun primary key derived from `friendlyId`
1414
// via `RunId.fromFriendlyId`. Downstream consumers in the trigger
15-
// route — notably `saveRequestIdempotency` (Q3) — index the request-
15+
// route — notably `saveRequestIdempotency` — index the request-
1616
// idempotency cache by this id; without it the cache stores
1717
// `undefined` and Prisma's `findFirst({ where: { id: undefined } })`
1818
// on retry strips the predicate and returns an arbitrary TaskRun
@@ -25,7 +25,7 @@ export type MollifySyntheticResult = {
2525
// run-detail page with no span selected (parity gap with PG runs).
2626
run: { id: string; friendlyId: string; spanId: string };
2727
error: undefined;
28-
// The race-loser path (Q5): if accept's SETNX hit an existing
28+
// The race-loser path: if accept's SETNX hit an existing
2929
// buffered run with the same (env, task, idempotencyKey), the
3030
// response echoes the winner's runId with isCached=true. The
3131
// mollifier-queued notice is only attached for the happy accept.
@@ -49,7 +49,7 @@ export async function mollifyTrigger(args: {
4949
buffer: MollifierBuffer;
5050
// Optional idempotency context. When both are passed, accept SETNXes
5151
// the lookup so the buffered window participates in trigger-time
52-
// dedup symmetrically with PG (Q5).
52+
// dedup symmetrically with PG.
5353
idempotencyKey?: string;
5454
taskIdentifier?: string;
5555
}): Promise<MollifySyntheticResult> {

apps/webapp/test/engine/triggerTask.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ describe("RunEngineTriggerTaskService", () => {
12851285
containerTest(
12861286
"mollifier · mollify action writes to buffer and returns synthetic result (no Postgres row)",
12871287
async ({ prisma, redisOptions }) => {
1288-
// Phase 3 semantics: when the gate decides mollify, the call site
1288+
// When the gate decides mollify, the call site
12891289
// invokes `mollifyTrigger` which writes the engine.trigger snapshot
12901290
// to the buffer and returns a synthesised `MollifySyntheticResult`
12911291
// (run.friendlyId + notice + isCached:false). `engine.trigger` is

apps/webapp/test/mollifierGate.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,10 @@ describe("evaluateGate — per-org isolation via Organization.featureFlags", ()
433433
});
434434
});
435435

436-
// C1/C3/F4 bypasses: the three categories of trigger that the mollifier never
436+
// Bypasses: the three categories of trigger that the mollifier never
437437
// intercepts, regardless of the per-org flag or the trip-evaluator decision.
438-
// Documented in `_plans/2026-05-13-mollifier-{debounce,otu,trigger-and-wait}-protection.md`.
439-
describe("evaluateGate — C1/C3/F4 bypasses", () => {
440-
it("C1: debounce triggers pass through without invoking the evaluator", async () => {
438+
describe("evaluateGate — debounce / OTU / triggerAndWait bypasses", () => {
439+
it("debounce triggers pass through without invoking the evaluator", async () => {
441440
const { deps, spies } = makeDeps({
442441
enabled: true,
443442
shadow: false,
@@ -452,7 +451,7 @@ describe("evaluateGate — C1/C3/F4 bypasses", () => {
452451
expect(spies.evaluatorCalls).toBe(0);
453452
});
454453

455-
it("C3: oneTimeUseToken triggers pass through without invoking the evaluator", async () => {
454+
it("oneTimeUseToken triggers pass through without invoking the evaluator", async () => {
456455
const { deps, spies } = makeDeps({
457456
enabled: true,
458457
shadow: false,
@@ -467,7 +466,7 @@ describe("evaluateGate — C1/C3/F4 bypasses", () => {
467466
expect(spies.evaluatorCalls).toBe(0);
468467
});
469468

470-
it("F4: single triggerAndWait (parentTaskRunId + resumeParentOnCompletion) passes through", async () => {
469+
it("single triggerAndWait (parentTaskRunId + resumeParentOnCompletion) passes through", async () => {
471470
const { deps, spies } = makeDeps({
472471
enabled: true,
473472
shadow: false,
@@ -485,7 +484,7 @@ describe("evaluateGate — C1/C3/F4 bypasses", () => {
485484
expect(spies.evaluatorCalls).toBe(0);
486485
});
487486

488-
it("parentTaskRunId alone (no resumeParentOnCompletion) does NOT bypass — must be both for F4", async () => {
487+
it("parentTaskRunId alone (no resumeParentOnCompletion) does NOT bypass — must be both", async () => {
489488
const { deps, spies } = makeDeps({
490489
enabled: true,
491490
shadow: false,

0 commit comments

Comments
 (0)