Skip to content

cli: serve-defaults.test.ts still pins the always-on slate as a literal slice(0, 6), under the same "the list may grow beyond them" instruction #11046 retires #11415

Description

@os-steve

Found while implementing #11046 (which replaced the packages/spec literal pin with the derived rule). Filed unassigned and ungradeddomain:* and type are triage's to mint. Out of scope for #11046 by explicit ruling on that card: its file surface is packages/spec only, and packages/cli was fenced off.

What is there

packages/cli/test/serve-defaults.test.ts:4-14:

describe('serve: ALWAYS_ON_CAPABILITIES default slate',()=>{// ALWAYS_ON_CAPABILITIES is the fail-closed allowlist of platform services// that are injected into every app's `requires` at runtime. The six// foundational capabilities must always lead the slate in this precedence// order; the list may grow beyond them (e.g. `sharing`) without churning// this assertion, so we pin the prefix rather than the whole array.it('leads with the six foundational capabilities in stable order',()=>{expect(Serve.ALWAYS_ON_CAPABILITIES.slice(0,6)).toEqual(['queue','job','cache','settings','email','storage',]);});

Serve.ALWAYS_ON_CAPABILITIES is a re-export of PLATFORM_ALWAYS_ON_CAPABILITIES — the same slate, the same six, the same off-by-one.

Why it is the same defect, not a copy of a fixed one

This is a third home of the literal pin, and its comment states the retired instruction more explicitly than either of the two #11046 addressed: "the list may grow beyond them ... without churning this assertion, so we pin the prefix rather than the whole array." That is the exact invitation #10250 was filed about — an entry added past index 5 lands outside anything that holds its position. sms at index 6 is the entry that already did it.

Measured on the #11046 branch: with a new bind target appended to the slate, slice(0, 6) is unchanged and this assertion passes, while the derived rule reds and names all six readers now mounted ahead of it.

Scope note — this is NOT the @objectstack/cli derived pin

packages/cli/src/commands/serve-settings-ordering.pin.test.ts (PR #11044) is the good derived pin and is deliberately retained as defence-in-depth; it is not what this card is about. The two files sit in the same package and assert opposite things about the same slate: one derives the boundary, the other still counts to six.

Also stale, same family

packages/services/service-sms/src/sms-plugin.ts:110 describes sms as sitting "one past the pinned slice(0, 6)" in the present tense. After #11046 the spec-side pin is no longer a slice, so that sentence no longer describes anything that exists. Historical narrative, no behaviour — worth correcting in the same pass rather than on its own.

Suggested work

Replace the literal assertion with the derived rule (or delete it as subsumed by serve-settings-ordering.pin.test.ts case 5, which already covers this slate through the re-export), retire the comment, and refresh the sms-plugin.ts sentence.

Refs

#11046 (the spec-side repair; this was found from it) · #10250 (the defect and the ruling) · PR #11044 (the derived pin that stays)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions