Skip to content

Commit 41fa73d

Browse files
committed
test(plugin-security): drop the phantom compile-time pin its tsconfig cannot evaluate
`pnpm check:type-check-coverage` caught it in this PR's own diff: plugin-security's tsconfig excludes `**/*.test.ts` (the package carries a TEST_DEBT ledger entry), so a `@ts-expect-error` in that file evaluates NEVER — a pin that reads like proof and holds nothing (AGENTS.md → "Build & Test"). The runtime half stays: a `{ info }` sink is shown hearing NOTHING — not the failure, not the count, not the reassuring "reconciled" line. The compile-time half lives in plugin-email's `outbox-sweep.test.ts`, whose package does compile its tests (observed red as `error TS2578: Unused '@ts-expect-error' directive` when the contract is reverted), and the type contract of both sinks is held by `pnpm check:optional-error-sink`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
1 parent 8371237 commit 41fa73d

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

‎packages/plugins/plugin-security/src/permission-set-projection.test.ts‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,16 +1132,21 @@ describe('reconcilePermissionSetProjection', () => {
11321132
expect(out.backfillFailed).toBe(1);
11331133
expect(heard).toEqual([]); // neither the failure, nor the count, nor the "reconciled" line
11341134

1135-
// THE CONTRACT. Without that cast the same sink no longer compiles: `warn`
1136-
// is non-optional on `ProjectionLogger` (#9754). Restore `warn?` in
1137-
// permission-set-projection.ts and this directive turns into an "Unused
1138-
// '@ts-expect-error' directive" error — which is how this assertion proves
1139-
// it is live rather than decorative.
1140-
await reconcilePermissionSetProjection(protocol, {
1141-
ql,
1142-
// @ts-expect-error — #9754: a ProjectionLogger MUST declare a `warn` channel
1143-
logger: { info: (m: string) => heard.push(m) },
1144-
});
1135+
// THE CONTRACT is what removes that cast's subject: `warn` is non-optional
1136+
// on `ProjectionLogger` (#9754), so no TS caller can build the sink above
1137+
// without saying `as unknown as` out loud.
1138+
//
1139+
// ⚠️ Deliberately NOT pinned here with `@ts-expect-error`. This package's
1140+
// tsconfig excludes `**/*.test.ts` (it carries a TEST_DEBT ledger entry in
1141+
// scripts/check-type-check-coverage.mjs), so no tsc program compiles this
1142+
// file and the directive would evaluate NEVER — a phantom check that reads
1143+
// like proof, which is the failure AGENTS.md → "Build & Test" names and
1144+
// `pnpm check:type-check-coverage` refuses. The compile-time half of this
1145+
// contract is pinned in plugin-email's `outbox-sweep.test.ts`, whose
1146+
// package DOES compile its tests (observed: reverting `warn` there turns
1147+
// that directive into `error TS2578: Unused '@ts-expect-error' directive`),
1148+
// and the type half of BOTH sinks is held by
1149+
// `pnpm check:optional-error-sink`.
11451150
});
11461151

11471152
it('heals a record that drifted from an EXISTING metadata definition (metadata wins)', async () => {

0 commit comments

Comments
 (0)