Documentation menu
Documentation / Operations vertical / sc
Sc
npm install @wabbit/tome-scFirst install from our registry?
Get a registry token from your credentials page. You need a purchase that includes this package, or a Craft Library membership.
Add the registry and your token to the
.npmrcat the root of your project, with your token in place ofYOUR_TOKEN:@wabbit:registry=https://npm.wabbit.com/ //npm.wabbit.com/:_authToken=YOUR_TOKEN
Tome Star Citizen wrapper — fleet management, ship database, RSI integration, SC locations, gameplay activity taxonomy, operation/force templates, squadrons, task force coordination, and military rank presets over @wabbit/tome-org. Bundles the SC block pack, Signal editorial theme, and the COP military design-token theme.
Overview
The Star Citizen wrapper over Tome — the one package an SC org installs to make Tome Star-Citizen-appropriate.
What this is
Two deliverables in one package:
- The SC data layer — 12 collections extending
@wabbit/tome-org: fleet management (Ships, Fleet, FleetLogs, AssetAvailability, ResourceRequests), SC operations (Locations, GameplayActivities, OperationTemplates, ForceTemplates), and military coordination (Squadrons, TaskForces, TaskForceAssignments). Pluswith*extension functions that inject SC fields onto org's Member/Event/Membership/Rank collections, RSI hooks, and military rank presets. - The SC bundle — tome-sc hard-includes
@wabbit/tome-blocks-sc-pack(fleet/task-force/RSI display blocks),@wabbit/tome-blocks-signal-theme(30+ Signal editorial blocks), and@wabbit/tome-cop(the military/ops design-token theme) as realdependencies. Installing@wabbit/tome-scpulls the whole SC-appropriate platform in one shot. The underlying packages remain individually consumable — this is a wrapper, not a fusion (same precedent as the@wabbit/tome-blocksmeta-package).
Why hard dependencies when no code here imports them? Nothing in src/ imports any of the three packs; they are dependencies purely so that one install gives an SC org everything it needs, at versions released together. The trade-off is deliberate: a site that wants only the SC data layer still downloads the packs (they are inert until you register them), and package.json dependencies cannot be opted out of — the blocks flags below only record intent. If the download matters to you, install the packs you want directly and use this package's collections through createSCLayer.
createSCPlatform(config) is the one-call composition surface. createSCLayer(config) is the SC-collections-only convenience function for sites doing manual composition.
Peer dependencies
| Peer | Range | Required |
|---|---|---|
payload | >=3.67.0 | yes |
@payloadcms/richtext-lexical | >=3.67.0 | yes |
@wabbit/tome-core | >=1.17.0 <2.0.0 | yes |
@wabbit/tome-org | >=0.19.0 <1.0.0 | yes |
@wabbit/tome-lms | >=0.9.0 <1.0.0 | no (optional) — only for the certificationsSlug relationship on ForceTemplates; omit that option and the field is left out. No runtime import |
@wabbit/tome-workflow | >=0.1.0 <1.0.0 | no (optional) — import type only; see the registered-assets section |
The three bundled block packs (@wabbit/tome-blocks-sc-pack, @wabbit/tome-blocks-signal-theme, @wabbit/tome-cop) are real dependencies, not peers — see Bundled packs below for the opt-out.
Quickstart — createSCPlatform
// payload.config.ts
import { buildConfig } from 'payload'
import { createSCPlatform } from '@wabbit/tome-sc'
const sc = createSCPlatform({
organization: 'Example Org',
terminology: 'milsim', // preset: Wing/Unit/Group/Billet; or pass a full/partial OrgTerminology
mediaCollection: 'media',
blocks: { scPack: true, signalTheme: true }, // bundled packs — both default true, opt out per pack
rsi: { validateHandle: true, syncOrgAffiliation: true },
})
export default buildConfig({
collections: sc.collections, // org's 13 collections (extended) + tome-sc's 12 SC collections
})createSCPlatform composes, in order:
createOrgLayer— SC terminology preset (or your ownOrgTerminologyoverride) +orgSlugsoverrides.applyExtensions— wraps org's output by slug (the only supported seam): Members getwithRSIFields+ the opt-in RSI hooks (rsi.validateHandle/rsi.syncOrgAffiliation); Events getwithFleetFields; Memberships getwithSquadronMembershipthenwithSquadronMemberCountSync(see "Rank presets & the squadron memberCount fix" below); Ranks getwithSCRankPresets.createSCLayer— the 12 SC collections, withmemberSlug/eventSlug/teamsSlug/divisionsSlug/campaignSlugresolved from org's actual (possibly overridden) slugs — never a hardcoded'org-members'guess.registerScPermissions()(viacreateSCLayer, redundant-safe against the module-import self-registration).registerScGdpr()(viacreateSCLayer) — registers this package's GDPR redaction dispositions by default. PassregisterGdpr: falseif your site owns those dispositions itself.registerLayer('@wabbit/tome-sc', …)— the layer-registry entry (admin sidebar group'Organization'unless you passadminGroup).
Returns exactly { collections: CollectionConfig[] }. createSCLayer(config?) returns the 12 SC collections as a plain CollectionConfig[], and createOrgLayer (from @wabbit/tome-org) likewise returns an array, which is what applyExtensions takes below.
Advanced path — manual composition
What createSCPlatform does internally, spelled out, for sites that need to interleave other layers or override individual pieces:
import { createOrgLayer, ORG_DEFAULT_SLUGS } from '@wabbit/tome-org'
import {
createSCLayer,
applyExtensions,
withRSIFields,
withFleetFields,
withSquadronMembership,
withSquadronMemberCountSync,
withSCRankPresets,
} from '@wabbit/tome-sc'All of these resolve from the root barrel, but not from the same internal module: withRSIFields/withFleetFields/withSquadronMembership/withSCRankPresets are defined under src/extensions/ and re-exported via export { ... } from './extensions'. withSquadronMemberCountSync is different — it's defined in src/collections/military/squadrons.ts (the Squadron collection factory's own module) and reaches the root barrel through export * from './collections', not through @wabbit/tome-sc/extensions. The import path from @wabbit/tome-sc is identical either way; only the internal source module differs.
const orgCollections = createOrgLayer({
terminology: {
division: { singular: 'Wing', plural: 'Wings' },
team: { singular: 'Unit', plural: 'Units' },
squad: { singular: 'Group', plural: 'Groups' },
position: { singular: 'Billet', plural: 'Billets' },
organization: 'Example Org',
},
})
const extendedOrg = applyExtensions(orgCollections, {
[ORG_DEFAULT_SLUGS.members]: withRSIFields,
[ORG_DEFAULT_SLUGS.events]: withFleetFields,
[ORG_DEFAULT_SLUGS.memberships]: (c) => withSquadronMemberCountSync(withSquadronMembership(c)),
[ORG_DEFAULT_SLUGS.ranks]: withSCRankPresets,
})
const scCollections = createSCLayer({
memberSlug: ORG_DEFAULT_SLUGS.members, // 'org-members' — verified against packages/org/src/types.ts, not assumed
eventSlug: ORG_DEFAULT_SLUGS.events, // 'org-events'
mediaCollection: 'media',
})
export default buildConfig({
collections: [...extendedOrg, ...scCollections],
})Rank presets & the squadron memberCount fix — two documented call-order flips
Rank presets — collection-first, not config-first. Wrapping the INPUT config (createRankCollection(withSCRankPresets({ slug: 'ranks' }))) is a no-op: RankCollectionConfig has no category-options extension point (createRankCollection hardcodes its own generic options). The correct, as-shipped order wraps the factory's OUTPUT instead:
withSCRankPresets(createRankCollection({ slug: 'ranks' }))createSCPlatform already does this correctly via applyExtensions's [ORG_DEFAULT_SLUGS.ranks]: withSCRankPresets entry — this note is for anyone composing manually against a bare createRankCollection() call outside createOrgLayer.
Squadron memberCount — `withSquadronMemberCountSync` must wrap `withSquadronMembership`, not stand alone. withSquadronMembership alone only injects the squadron relationship field onto org's Membership collection — it wires no hooks. Without withSquadronMemberCountSync layered on top, every Squadron's memberCount field stays permanently 0 (the field exists, nothing ever updates it). Always compose them together:
withSquadronMemberCountSync(withSquadronMembership(membershipCollection))createSCPlatform does this automatically.
Co-installation note — @wabbit/tome-accounts
createAccountsLayer defaults memberSlug: 'members', while org (and therefore tome-sc) defaults 'org-members'. A site running org + accounts + sc must pass memberSlug: 'org-members' (or its site's own override) into createAccountsLayer() explicitly, or accounts' Membership relationships point at a nonexistent collection. tome-sc itself always takes this slug via config (see orgSlugs.members above) — this warning is about wiring a third layer alongside it correctly.
Bundled packs
Real dependencies (not peers) — installing @wabbit/tome-sc installs all three:
| Package | Role | Opt-out |
|---|---|---|
@wabbit/tome-blocks-sc-pack | 5 SC display blocks: fleet-summary, signal-hero-sc, task-force-roster, op-briefing-panel, rsi-handle-card. Self-contained data — zero dependency on this package's collections. | blocks: { scPack: false } |
@wabbit/tome-blocks-signal-theme | 23 offered Signal editorial blocks (33 total registered) — accordion, callout, data table, personnel/ship cards, threat panels, and more. Reclassified SC-tier under this umbrella; independently installable on any editorial site. | blocks: { signalTheme: false } |
@wabbit/tome-cop | Military/ops design-token theme — the SC default aesthetic. Imported by the starter template. | Not gated by createSCPlatform's blocks config — import (or skip) it directly in your theme setup. |
Block registration is a consumer-side wiring step, not a plugin side-effect
createSCPlatform's blocks config ({ scPack: true, signalTheme: true }, both default true) is data describing intent — it does not call any pack's register() function for you. It hands the flags back, defaults applied, as sc.blocks (type SCBlockPacks); the opt-outs only take effect if your registration code reads them, as below. Payload registers block DEFINITIONS via block lists on a blocks-type field; there is no plugin hook where createSCPlatform could silently mutate a shared registry without your knowledge. Wire the packs yourself, same as any @wabbit/tome-blocks-* consumer:
import { BlockRegistry, BundleRegistry } from '@wabbit/tome-blocks-core/registry'
import { register as registerScPack } from '@wabbit/tome-blocks-sc-pack'
import { register as registerSignalTheme } from '@wabbit/tome-blocks-signal-theme'
import { createSCPlatform } from '@wabbit/tome-sc'
const sc = createSCPlatform({ blocks: { signalTheme: false } })
const blockRegistry = new BlockRegistry()
const bundleRegistry = new BundleRegistry()
if (sc.blocks.scPack) registerScPack(blockRegistry, bundleRegistry)
if (sc.blocks.signalTheme) registerSignalTheme(blockRegistry, bundleRegistry)
// then reference blockRegistry.resolveAll() from whichever collection's
// `blocks`-type field should offer them (e.g. a Pages collection's `layout` field)RSI integration — hook-based, opt-in, no official API
Nothing calls any RSI-adjacent service unless a site explicitly enables it via SCIntegrationConfig.rsi. There is no official, stable RSI API. Every integration this package supports is one of:
- Handle validation — a plain existence check (HTTP 200) against RSI's own public citizen dossier page (
https://robertsspaceindustries.com/citizens/{handle}). This confirms the handle is registered, not that the caller owns it. - Ship catalog data — pulled from a third-party, RSI-unaffiliated community API (
star-citizen.wiki), because RSI itself has never published a ship-catalog API.
@wabbit/tome-sc/rsi exports RSIClient, a thin, resilient wrapper over both surfaces (never throws — network/parse failures degrade to a typed empty/false result). The subpath is where you import RSIClient and the adapter yourself; it is not a way to keep the RSI code out of your bundle. The root barrel's RSI hooks (validateRSIHandle, syncMemberOrg, createSyncShipDatabase) import RSIClient statically, and createSCPlatform imports those hooks, so the client module is always loaded. It makes no network call unless you enable rsi config. Every hook (validateRSIHandle, syncMemberOrg, createSyncShipDatabase) also accepts a custom function (validateHandle, syncFn) so a site can swap in its own implementation — or a future official RSI API — without touching call sites.
createSCPlatform's rsi.validateHandle and rsi.syncOrgAffiliation are wired onto the Members collection automatically. `rsi.syncShips` is accepted in `SCPlatformConfig` for parity with the rest of its config shape but is NOT auto-wired by `createSCPlatform` — a scheduled ship-sync is a Payload Endpoint + external cron trigger, not a CollectionConfig, so it doesn't fit this function's contracted { collections, blocks } return shape. Wire it yourself with createSyncShipsTask from @wabbit/tome-sc/tasks (snippet at the end of the next section).
RSIProfileAdapter — the ONE place RSI's markup regexes live
RSIClient.validateHandle is now backed internally by RSIProfileAdapter (@wabbit/tome-sc/rsi's createRSIProfileAdapter), the concrete ExternalProfileAdapter<RSIProfile> implementation for @wabbit/tome-core/verification's neutral verification/cache/reconcile machinery (resilient fetch with retry/backoff, an optional distributed rate limiter). Every RSI-specific regex — the citizen dossier's class="citizen-record" / class="entry bio" / org-affiliation markup — lives in src/rsi/adapter.ts and nowhere else in this package. Ported field-for-field from a production consumer's scrapeRsiDossier.ts / parseRsiHandle.ts, producing the same extracted values against the same fixture HTML.
import { createRSIProfileAdapter } from '@wabbit/tome-sc/rsi'
import { createDistributedRateLimiter, createInMemoryLimiterClient } from '@wabbit/tome-core/verification'
const adapter = createRSIProfileAdapter({
rateLimiter: createDistributedRateLimiter({
key: 'rsi-scrape',
ttlMs: 5_000,
pollMs: 250,
timeoutMs: 30_000,
client: createInMemoryLimiterClient(), // swap for a real Redis client in production
}),
})
const identifier = adapter.parseIdentifier('https://robertsspaceindustries.com/citizens/SomeHandle')
if (identifier) {
const result = await adapter.fetchProfile(identifier)
// result.status: 'success' | 'not_found' | 'hidden' | 'error'
}Deliberate divergences from that original scraper, all covered by tests in tests/rsi/rsiProfileAdapter.test.ts:
- Fail-CLOSED `exists()`/`checkExistence()`. The original
verifyRSIHandlereturnstrueon ANY thrown network error ("allow the application to proceed for manual review"). This adapter returnsfalse— a network failure is not evidence a handle exists.checkExistenceexposes the structuredreason('confirmed' | 'not_found' | 'http_error' | 'network_error' | 'rate_limited') behind the boolean, since theExternalProfileAdaptercontract'sexists()only has room forPromise<boolean>. - 404 is never retried and never mislabelled. The original scraper retries a stable 404 like any transient failure (wasting its whole retry budget) and then surfaces it as
"RSI website unreachable: HTTP 404: Not Found". This adapter'sfetchProfilemaps a 404 straight tostatus: 'not_found'on the first attempt. - No `E2E_TEST_` bypass. The original
verifyRSIHandlehas a hardcoded handle-prefix bypass reachable in production (not gated onNODE_ENVor a flag). That was a consumer-side test hook — it does not move upstream. InjectfetchImplfor tests instead. - `visibility` detection is new. The original has no automated hidden/redacted detection at all (it relies on a manual admin override field). This adapter detects a fully private profile structurally (total absence of citizen-record/enlistment/avatar markup on an HTTP 200) and a redacted org affiliation from RSI's literal
"REDACTED"org-name text. Both map tofetchProfile'sstatus: 'hidden'; the distinction lives onprofile.visibility('public' | 'hidden' | 'redacted').
RSIClient.validateHandle keeps its original {valid, orgTag?} return shape and pass/fail semantics, but now gets the adapter's retry + optional rate-limiting for free (previously a single unretried fetch), and widens accepted input to the same URL forms parseIdentifier accepts (previously bare handles only — a superset, not a narrowing).
import { createSyncShipsTask } from '@wabbit/tome-sc/tasks'
const { endpoint } = createSyncShipsTask({ shipsSlug: 'ships', schedule: '0 4 * * *' })
export default buildConfig({
collections: sc.collections,
endpoints: [endpoint], // CRON_SECRET-guarded — point your external scheduler (Vercel Cron, systemd timer, etc.) at it
})Access control — v1 posture (honest, not redesigned)
Default read: org members only. Every SC collection factory reads org members only by default, through orgMemberRead from @wabbit/tome-org (0.19+): staff, a holder of the org permissions the factory already gates writes on (MANAGE_STRUCTURE for squadrons, task forces, assignments and gameplay activities; the logistics keys for resource requests), and any account with a row in the member collection (memberSlug, default 'org-members') read every row; an anonymous visitor or a signed-in account with no member row reads nothing. Registered assets are versioned, so readVersions follows the same rule, and asset transfer requests' version history follows their scoped read. Before this the default was core's authenticated, which on a site with public sign-up let any account read crews, task forces and leadership-only vessels. Opt out per collection with access: { read: authenticated } (the registry factories take a full access object), or on the layer's per-collection access map; a consumer-supplied access wins exactly as before. A stricter membership test is access: { read: orgMemberRead({ memberSlug, isMember }) }.
tome-sc's access model is permission-key-only — there is no raw admin-role concept (checkScRole), matching org's own checkOrgRole convention. SC_PERMISSIONS mints three new permissions (MANAGE_FLEET, MANAGE_LOCATIONS, MANAGE_REGISTERED_ASSETS — the third added in 0.4.0 for the registered-assets sub-cluster) and consumes three of org's existing keys (MANAGE_STRUCTURE, MANAGE_LOGISTICS, MANAGE_TEMPLATES). Three deliberate v1 simplifications, carried over from the collection factories' own header comments rather than silently dropped:
- Fleet cluster collapses "admin"/"super-admin" onto `MANAGE_FLEET`.
SC_SUPER_PERMISSIONSships empty at v1 (noEDIT_FLEET/DELETE_FLEETsplit exists yet), so every Fleet/FleetLogs/Ships write gates on the singleMANAGE_FLEETkey regardless of how prose elsewhere distinguishes "admin" from "super-admin." Trigger to refine: whenSC_SUPER_PERMISSIONSgains a dedicated split. - Operations cluster drops a leadership-profile bypass some consumers implement. One production consumer's app-side data-access layer grants division/team LEADERS visibility into out-of-scope OperationTemplates/ForceTemplates even without a direct membership record. tome-sc has no DAL layer and no Position/billet leadership resolution of its own, so
OperationTemplateCollectionConfig/ForceTemplateCollectionConfig's visibilityWhereclause omits that bypass. Sites that need it supply their own site-level access override on top. - Military cluster allows member self-service on TaskForceAssignments. The assigned member can accept/decline/leave their own assignment record directly — this is a direct corollary of the "supports invitation workflow (pending → active/declined)" contract, not an added ABAC extension. Broader leadership-hierarchy checks (a
canManageTaskForceAssignment-style function) are not ported; access beyond self-service and the task force's coordinator/deputy isMANAGE_STRUCTURE-gated only.
No consumer's billet/unit/wing leadership-hierarchy ABAC model is ported anywhere in this package (squadrons, task forces, or templates) — every "admin" resolves to a permission-key check, and every consumer-specific leadership bypass is either dropped with a documented reason or left as an explicit extension point for a site's own access override.
registered-assets sub-cluster
The registered-assets sub-cluster ports a production consumer's commissioned-vessels feature (CommissionedShips / ShipAssignments / ShipTransferRequests) under a neutral name. It is NOT part of createSCLayer/createSCPlatform's fixed collection tuple — same posture shipsCollection/certificationsSlug have held for years — a consumer composes it explicitly:
import {
createRegisteredAssetCollection,
createAssetAssignmentCollection,
createAssetTransferRequestCollection,
registerRegisteredAssetsGdpr,
} from '@wabbit/tome-sc'
const registeredAssets = createRegisteredAssetCollection({
parentScopeSlug: 'units', // example: a Team-equivalent slug
ancestorScopeSlug: 'wings', // example: a Division-equivalent slug
linkedAssetSlug: 'fleet', // OPTIONAL — omit for no per-member-asset link
assignmentsSlug: 'asset-assignments', // wires the auto-close-on-terminal-status hook
})
const assetAssignments = createAssetAssignmentCollection({
assetSlug: registeredAssets.slug,
// participatesInPositionCascade defaults to false (Option C) — see the
// factory's header before ever setting this true.
})
const assetTransferRequests = createAssetTransferRequestCollection({
parentScopeSlug: 'units',
ancestorScopeSlug: 'wings',
resolveLeadership: async (req) => resolveMyOwnLeadershipProfile(req), // injectable
})
registerRegisteredAssetsGdpr() // registered-assets, asset-assignments, asset-transfer-requestsOption C (asset-assignments.officerPosition): a vessel officer billet's holder-of-record lives on the ASSIGNMENT, not on the referenced Position document's currentHolder — deliberately outside @wabbit/tome-org's org-wide 1-to-1 position cascade. participatesInPositionCascade defaults to false. Flipping it to true re-arms that cascade and introduces a real hazard: two independent writers (org's normal Position-assignment flow, and this collection's own sync hook) can now target the same Position's currentHolder with no cross-collection concurrency check — one write silently disappears with no error. See createOfficerPositionSyncHook's doc comment before enabling it.
`@wabbit/tome-workflow` relationship: packages/sc itself has no runtime dependency on @wabbit/tome-workflow — it's an OPTIONAL peer, referenced only via import type for assetTransferTopology's return shape (SingleApproverTopology). This is despite at least one production consumer's own cluster having a genuine runtime dependency on it: that consumer's transfer-request workflow declares the topology for real and its apply-hook runs the settle/unwind write through @wabbit/tome-workflow/server's executeClaimed. assetTransferTopology() returns the same shape as that consumer's own workflow topology; createTransferApplyHook reimplements the same settle/unwind pattern by hand rather than calling executeClaimed (a documented open follow-up, not an oversight — see the factory's header). A consumer without @wabbit/tome-workflow installed still gets a plain, structurally-typed config object back from assetTransferTopology(); installing the package only sharpens the type.
GDPR dispositions (registerRegisteredAssetsGdpr): registered-assets.createdBy → retain (organisational record); asset-assignments.member → hard-delete (a service record scoped to one member's tenure, unlike Fleet/TaskForceAssignments' retain-because-soft-anonymise posture elsewhere in this package); asset-transfer-requests → redact (the transfer record itself is a structural audit trail that survives; only rationale/decisionNotes/lastExecutionError are cleared). Each of the three is independently skippable ({ registeredAssets: false } etc.) for a consumer with its own redact-engine ownership over one of them.
Package structure
@wabbit/tome-sc/rsi (RSIClient, createRSIProfileAdapter) and @wabbit/tome-sc/tasks (createSyncShipsTask) are separate subpath exports — neither name is re-exported from the main barrel, mirroring how @wabbit/tome-core keeps its own scheduled-task exports (auth/jobs/*) off its main barrel. (The RSI client module is still loaded by the root barrel's hooks; see above.)
createSyncShipsTask(config?) returns { run, schedule, endpoint }. The endpoint (default path /jobs/sync-ships) answers 500 until the CRON_SECRET environment variable is set, and rejects any request that does not present it.
Also on the root barrel (not covered above): SC_DEFAULT_SLUGS; permission keys and helpers (SC_PERMISSIONS, SC_SUPER_PERMISSIONS, SC_CONSUMED_ORG_PERMISSIONS, registerScPermissions, buildScSuperPermissionMap, SC_OVERRIDABLE_PERMISSIONS, hasScPermission, hasAnyScPermission, hasScPermissionAsync); GDPR registration (registerScGdpr, unregisterScGdpr); reference data (SC_MANUFACTURERS, SC_RANK_CATEGORIES, createSCRankSeedData); mergeHooks; the terminology presets (SC_TERMINOLOGY_PRESETS, resolveScTerminology); every collection factory under src/collections; and every hook under src/hooks.
Server / client posture
No React components ship from this package. Everything is Payload config, hooks and server helpers; @wabbit/tome-sc/tasks builds a Payload Endpoint. Do not import any of it into a client bundle.
Testing
pnpm --filter @wabbit/tome-sc test runs the Vitest suite in tests/ (RSI adapter fixtures, the registered-assets cluster, GDPR registration, fleet helpers, layer version). The RSI tests inject fetchImpl, so they make no network calls.
What this package does not cover
Frontend components (ship cards, fleet dashboards, force-composition builder UI), a Discord bot bridge, a Spectrum integration, in-game economy tracking, and the Signal block definitions themselves (they live in @wabbit/tome-blocks-signal-theme) are all out of scope. A production consumer's own org-owned CommissionedShips/ShipAssignments/ShipTransferRequests cluster is now covered by the registered-assets sub-cluster above — TaskForces' optional shipsCollection config knob predates it and still points at the SC ship-class registry (ships), not registered-assets.
Exports
| Import path |
|---|
@wabbit/tome-sc |
@wabbit/tome-sc/rsi |
@wabbit/tome-sc/tasks |
Changelog
0.5.xMinor
BREAKING: Every SC collection now reads org members only by default (
orgMemberReadfrom@wabbit/tome-org); a signed-in account with no member row reads nothing.Before, ships, gameplay activities, locations, squadrons, task forces, task force assignments, asset availability, resource requests, registered assets and asset assignments read core's
authenticated: any signed-in account read every row. On a site with public sign-up that handed every crew roster, task force, availability schedule and leadership-only vessel to a stranger with an account.The new default answers true for staff, for a holder of the org permissions the factory already gates writes on (
MANAGE_STRUCTURE, the logistics keys), and for an account with a row in the member collection (memberSlug); false for everyone else. Registered assets are versioned, soreadVersionsnow follows the same rule, and asset transfer requests' version history follows their scoped read rule, instead of Payload's signed-in default.Migration: nothing to do on a site where every account has a member row. A site that relies on any-signed-in reads passes
access: { read: authenticated }on the factory (the registry factories take a fullaccessobject), or on the layer's per-collectionaccessmap; a consumer-suppliedaccesswins exactly as before.A site with a stricter notion of membership passes
access: { read: orgMemberRead({ memberSlug, isMember }) }. Requires@wabbit/tome-org0.19 or later, which exportsorgMemberRead.@wabbit/tome-cop@0.2.4
6 fixes (0.5.1 – 0.5.2)
- 0.5.2
Canceled statuses now accept both spellings.
This is the first of three steps toward American spelling in stored values, and nothing that gets written changes yet.
Training events, attendance, exam tickets, LMS orders, events, campaigns, CRM activities, resource requests, task forces and the event, status board and operation briefing blocks gain the American
canceled(CANCELEDon the status board) next to the existing value. Reads, queries, the closed-event lock, event board state and selection, the calendar export (STATUS:CANCELLEDis unchanged, it is the iCalendar literal), the status board badge, theme selectors fordata-event-statusand the erasure trail treat the two spellings as one meaning.The event list board labels gain a
canceledkey that is read before the oldcancelledkey. The old field is hidden, not removed, so stored text is kept on save.The admin shows both options, because Payload cannot hide one select option. The old one is labeled "Canceled (legacy spelling)".
Writers still store the old values.
- 0.5.2
Updated dependencies [49eb91d]
- @wabbit/tome-blocks-sc-pack@0.49.8
- @wabbit/tome-cop@0.2.5
- 0.5.1
Admin labels, field descriptions, demo content and messages now use American spellings.
- 0.5.1
Updated dependencies [dd19c82]
- 0.5.1
Updated dependencies [dd19c82]
- 0.5.1
Updated dependencies [deea397]
- @wabbit/tome-blocks-sc-pack@0.49.4
- @wabbit/tome-blocks-signal-theme@0.49.4
- @wabbit/tome-cop@0.2.5
0.4.xMinor
Add the
registered-assetssub-cluster (Wave 2R / 2R-I6):createRegisteredAssetCollection,createAssetAssignmentCollection,createAssetTransferRequestCollection, andregisterRegisteredAssetsGdpr, ported from the reference consumer'sCommissionedShips/ShipAssignments/ShipTransferRequestscluster under the neutral name adopted for this package (Wave 2 residue extraction plan §1c/§5a).NOT part of
createSCLayer/createSCPlatform's fixed collection tuple — same opt-in postureshipsCollection/certificationsSlugheld for years before this increment; a consumer composes the three factories explicitly.createRegisteredAssetCollection: every stored field name overridable viafieldNames(the reference consumer keepsshipClass/currentAsset/affiliatedUnit/affiliatedWing/bio— zero data migration);linkedAsset(reference consumer:currentAsset) emitted only whenlinkedAssetSlugis configured;canManagereplaces the reference consumer's documentedauthenticatedplaceholder, defaulting to the newMANAGE_REGISTERED_ASSETSpermission; absorbscreateParentScopeMirrorHook(reference consumer:mirrorAffiliatedWingFromUnit) andcreateAssignmentAutoCloseHook(reference consumer:autoCloseAssignmentsOnDecommission, terminal statuses configurable);statusOptionsdefaults toactive|decommissioned|retired— the reference consumer replaces wholesale with its three includinglost-in-action.createAssetAssignmentCollection: absorbscomputeActiveFlagverbatim. Models the reference consumer's Option C design decision (a ship officer billet's holder-of-record lives on the assignment, not on@wabbit/tome-org's PositioncurrentHolder) asparticipatesInPositionCascade(defaultfalse). Thetrueopt-in wirescreateOfficerPositionSyncHook, whose doc comment documents the concurrent-write hazard re-arming the cascade introduces — no cross-collection concurrency guard exists, so a raced write from org's own Position flow can silently disappear.createAssetTransferRequestCollection: generalizes the reference consumer'smaybeApplyTransferintocreateTransferApplyHook, hand-rolling the same settle-on-success/unwind-on-throw-with-error-field pattern the reference consumer's realtome-integrationbranch delegates to@wabbit/tome-workflow/server'sexecuteClaimed(Wave 4 I2) —lastExecutionErroritself already exists verbatim in that branch's schema, not new. The wing-scoped access matrix (decideReadTransferRequest/decideUpdateTransferRequest) isWhere-returning throughout (@wabbit/tome-core/access/scoped'sandWhere/orWhere) with an injectableresolveLeadershipseam, unaffected by the above —access.tsis byte-identical between the reference consumer's main branch andtome-integration. ExportsassetTransferTopology, structurally identical to the reference consumer's realshipTransferRequestsWorkflowTopology(ShipTransferRequests/workflow.ts,tome-integrationbranch) —{ kind: 'single', approverPoolResolver }, no escalation/recusal used there either.@wabbit/tome-workflowis added as an OPTIONAL peer, referenced only viaimport type:packages/scitself has no prior runtime relationship to it, even though the reference consumer's real cluster does — not everyregistered-assetsconsumer should be forced into that runtime dependency for one collection factory.MANAGE_REGISTERED_ASSETSadded toSC_PERMISSIONS.registerRegisteredAssetsGdpr/unregisterRegisteredAssetsGdpr(sibling toregisterScGdpr, matching@wabbit/tome-core/field-reports'sregisterFieldReportsGdprprecedent — not auto-wired):registered-assets.createdBy→ retain;asset-assignments.member→ hard-delete;asset-transfer-requests→ redact (row retained,rationale/decisionNotes/lastExecutionErrorcleared). Each collection's registration is independently skippable for a consumer with its own redact-engine ownership.
47 fixes (0.4.1 – 0.4.16)
- 0.4.16
README: subpath and file mentions are written package-qualified (for example
@wabbit/tome-x/render) or as code text, so crawlers no longer resolve them as site URLs. - 0.4.16
Updated dependencies [d51ad89]
- 0.4.16
Updated dependencies [d51ad89]
- 0.4.16
Updated dependencies [d51ad89]
- @wabbit/tome-blocks-sc-pack@0.43.2
- @wabbit/tome-blocks-signal-theme@0.43.2
- @wabbit/tome-cop@0.2.4
- 0.4.15
@wabbit/tome-blocks-sc-pack@0.37.1
- 0.4.15
@wabbit/tome-blocks-signal-theme@0.38.0
- 0.4.15
@wabbit/tome-cop@0.2.3
- 0.4.14
@wabbit/tome-blocks-sc-pack@0.28.5
- 0.4.14
@wabbit/tome-blocks-signal-theme@0.37.0
- 0.4.14
@wabbit/tome-cop@0.2.2
- 0.4.13
@wabbit/tome-blocks-sc-pack@0.28.5
- 0.4.13
@wabbit/tome-blocks-signal-theme@0.35.0
- 0.4.13
@wabbit/tome-cop@0.2.2
- 0.4.12
Updated dependencies [b8ccf85]
- @wabbit/tome-blocks-signal-theme@0.31.0
- @wabbit/tome-blocks-sc-pack@0.28.5
- @wabbit/tome-cop@0.2.2
- 0.4.11
Published packages now contain compiled JavaScript and type declarations under a one-line license banner, and no longer include source maps.
What you install: one compiled
.js(ESM) and.cjs(CommonJS) file per source module, its.d.ts/.d.ctsdeclarations, and the stylesheets, fonts and other assets a package already shipped. Every JavaScript module opens with a comment naming the package and its license:/*! @wabbit/<package> — © Wabbit, LLC. Wabbit Tome Commercial License (see LICENSE.md). Not for redistribution. */.The
.mapfiles and thesourceMappingURLcomments that pointed at them are gone, which roughly halves the size of each tarball.Debugging: the code is still unbundled and unminified, one readable file per module, so a stack trace points at real code with real names. Line numbers in a stack trace are one higher than before, because of the banner line.
A
'use client'directive stays the first statement of its module (the banner is a comment above it), so React Server Component boundaries are unchanged.No API change, no runtime behavior change, and nothing to do on upgrade.
In
@wabbit/tome-blocks-gallery, the source snapshotsextractGallerySourcewrites from an installed pack leave out the license banner line, so a component or config snapshot starts at the code and a paid block's preview shows its first 15 lines of real code. - 0.4.11
Updated dependencies [775f90a]
- @wabbit/tome-blocks-sc-pack@0.28.5
- @wabbit/tome-blocks-signal-theme@0.28.5
- @wabbit/tome-cop@0.2.2
- 0.4.10
Updated dependencies [d08fc38]
- 0.4.10
Updated dependencies [58655f4]
- @wabbit/tome-blocks-signal-theme@0.28.0
- @wabbit/tome-blocks-sc-pack@0.19.0
- 0.4.9
Updated dependencies [c14a133]
- @wabbit/tome-blocks-signal-theme@0.27.0
- @wabbit/tome-blocks-sc-pack@0.19.0
- @wabbit/tome-cop@0.2.1
- 0.4.8
@wabbit/tome-blocks-sc-pack@0.19.0
- 0.4.8
@wabbit/tome-blocks-signal-theme@0.26.0
- 0.4.8
@wabbit/tome-cop@0.2.1
- 0.4.7
Updated dependencies
- @wabbit/tome-blocks-signal-theme@0.23.0
- 0.4.6
Updated dependencies [d5d72e1]
- 0.4.6
Updated dependencies [9ac8d3d]
- @wabbit/tome-cop@0.2.0
- @wabbit/tome-blocks-signal-theme@0.20.0
- @wabbit/tome-blocks-sc-pack@0.19.0
- 0.4.5
Updated dependencies [f6cfffa]
- 0.4.5
Updated dependencies [89a8338]
- @wabbit/tome-blocks-sc-pack@0.19.0
- 0.4.4
createSCPlatformnow returns the resolvedblocksflags so bundled-pack opt-outs can take effect.createSCPlatformnow returns the resolvedblocksflags ({ scPack, signalTheme }, both defaulttrue) alongsidecollections, and exports theSCBlockPackstype. The flags were previously accepted and never read anywhere, so opting out of a bundled pack did nothing; readsc.blocksin your block-registration code to honor them.Additive —
sc.collectionsis unchanged. - 0.4.4
Task-force member counts are recalculated with
payload.count()instead of reading every active assignment.No API or behavior change.
Internal: collection slugs are typed through the shared
typedSlug()helper instead of inline casts. - 0.4.4
customer-facing wording: internal references removed from admin descriptions, error messages and block metadata.
- 0.4.4
Updated dependencies [89161af]
- 0.4.4
Updated dependencies [0aa80a3]
- @wabbit/tome-blocks-signal-theme@0.18.1
- @wabbit/tome-cop@0.1.9
- @wabbit/tome-blocks-sc-pack@0.18.0
- 0.4.3
Local relationship-id helpers are replaced by
@wabbit/tome-core/utilities/relationId.Each call site maps to the core reader with the same return shape (raw vs. stringified id,
nullvs.undefined, polymorphic), so behavior is unchanged. The@wabbit/tome-corepeer floor goes up to>=1.17.0because that is the first core version exportingrelationIdRaw,relationIdsandrelationIdsRaw. - 0.4.3
Updated dependencies [c3468b0]
- 0.4.3
Updated dependencies [c3468b0]
- @wabbit/tome-blocks-sc-pack@0.18.0
- @wabbit/tome-blocks-signal-theme@0.18.0
- @wabbit/tome-cop@0.1.8
- 0.4.2
Updated dependencies [404d325]
- @wabbit/tome-blocks-signal-theme@0.17.0
- @wabbit/tome-blocks-sc-pack@0.17.0
- @wabbit/tome-cop@0.1.8
- 0.4.1
Adopt
@wabbit/tome-core/fields/addressand@wabbit/tome-core/utilities/relationIdat the sites the audit counted (2026-09-01 sale-readiness audit §5.1, T3(g)).No stored field name, and no emitted field array, changes anywhere in this changeset — each adopter passes the vocabulary it already stores, and each ships a characterization test that was written from the pre-change source, run green against the untouched factory, and run green again after.
Address group — five sites, one implementation.
@wabbit/tome-crm—accountsandcontactseach carried a byte-identical seven-fieldaddressgroup. Both now spreadpostalAddressFields({ vocabulary: 'legacy-crm' })after their ownnameline (nameis the company/contact line, not a postal line).tests/address-characterisation.test.tspins both groups whole.@wabbit/tome-deals—billingAddressandshippingAddressinside the frozen Customer Snapshot were copies three and four. They now come from onebuildSnapshotAddressGrouphelper:name+companyprepended locally, the six postal lines from core, and the eight per-field labels plus the'US'country default passed through core'sfieldOverridesseam. The snapshot is a legal-offer record frozen after send, so a field-name change would orphan the address on every deal already sent;tests/address-characterisation.test.tspins both groups and the fact that they differ only in the group label and the recipient line's label.@wabbit/tome-fulfillment— the fifth copy, and the only one that validatedcountry. Its postal lines stay FLAT at collection top level (they are stored columns with PII rows and a GDPR registration behind them), now viapostalAddressFields({ vocabulary: 'postal', required: true, validateCountry: true }). The ISO-3166 validator and its uppercase-normalizing hook moved into core verbatim; because a moved function is a new object,tests/address-characterisation.test.tspins the whole top-level field ORDER plus the validator's and hook's BEHAVIOR (acceptsUS, rejectsusa, rewrites' us 'to'US'), not their identity.
`relationId` — the four-return-types problem.
@wabbit/tome-lms— twelve modules undersrc/server(academy,catalog,certificates,course,dashboard,enrollment,grades,leaderboard,learnerShell,notes,profile,reviews) carried a byte-identicalstring | nullcopy. They importrelationIdfrom core now. One behavioral difference, strictly an improvement: on a malformed populated doc ({ id: null },{ id: {} }) the old copy returned the STRING'null'/'[object Object]'as an id; core returnsnull.tests/relation-id-adoption.test.tspins the adoption itself, because adoption is the thing that decays — the July 2026 audit's finding, repeated verbatim in September, was "extraction keeps happening, adoption does not."
Not migrated, deliberately:
src/guards,src/utilities/{grading,prerequisites,progress}.ts,src/hooks/**,src/server/mutations/helpers.tsandsrc/server/awardGate.tsreturnstring | numberorundefined. Migrating those is a semantic change, not an import change, and belongs in a pass that owns their call sites.The new test names them as out of scope so the next reader does not have to re-derive why.
@wabbit/tome-sc— the registry sub-cluster's copy is gone;collections/registry/shared.tsre-exports core'srelationId, keepingextractIdas a local alias (the module is private to that sub-cluster). This one WIDENS: the sc copy returnedstring | number, so a populated doc's numeric id came through unstringified. It is now stringified, which makes===between two resolved ids agree — the behavior every call site in the cluster already assumed. Ids handed back topayload.find/updateare unaffected, since Payload accepts either form in awhereclause. sc's 179 tests stay green.@wabbit/tome-crm— the inline ternary inintegration/deals.ts(typeof oppRaw === 'object' ? oppRaw.id : oppRaw) was the fifth shape and had the same numeric-id asymmetry; it is onerelationId(deal.opportunity)call now.
`fetchMemberId` ×4 — one implementation (sc).
asset-availability,fleet-logsandfleeteach carried a verbatim copy of the auth-user → Member-row lookup, andresource-requestscarried its projecting twin. All four now import fromsrc/access/fetchMemberId.ts, which documents why each query knob is load-bearing:overrideAccess: true(the member collection's own read access may itself depend on membership, so without the bypass this is a circular check that denies the owner their own row),depth: 0,pagination: false.The id is returned in its STORED type here rather than through
relationId— this is an identity read fed straight back into awhereclause, not a relationship read.tests/fleet-shared-helpers.test.tspins the adoption, the three knobs, and the null-for-anonymous contract. - 0.4.1
Import
mergeHooks,fieldShapeand the select-option override contract from@wabbit/tome-coreinstead of keeping local copies (2026-09-01 sale-readiness audit §5.1, T3(a)).No API change: every symbol these packages exported before is still exported, now re-exported from core, and every factory produces byte-identical output.
Deleted, with every call site repointed:
org/src/hooks/mergeHooks.ts,lms/src/collections/shared/mergeHooks.ts,sc/src/extensions/mergeHooks.ts→@wabbit/tome-core/hooks/mergeHooks. Core has exported this since July; sc's copy still carried a header claiming "Neither @wabbit/tome-core nor @wabbit/tome-org exports this."lms/src/server/jobs/paginate.ts,crowdfund/src/server/jobs/paginate.ts,workflow/src/server/paginate.ts→@wabbit/tome-core/jobs.org/src/fieldShape.ts+org/src/insertFieldsAfter.ts,lms/src/collections/shared/fieldShape.ts→@wabbit/tome-core/fields/fieldShape. Org'sresolveFieldDescription/FieldDescriptionOverridewere NOT part of the duplicated set and stay in the package, moved toorg/src/fieldDescriptions.ts.org/src/optionOverrides.ts,lms/src/collections/shared/optionOverrides.ts→@wabbit/tome-core/fields/selectOptions;sc/src/collections/registry/shared.tsnow re-exports it (itsextractIdis a separate audit item and is untouched).
Peer floor raised to `@wabbit/tome-core` `>=1.14.0 <2.0.0` in all five packages, because each now imports a subpath or a named export that first exists in that core minor:
./fields/fieldShapeand./fields/selectOptionsare new subpaths, andfindPaged/chunk/readPositiveNumberare new named exports on the pre-existing./jobs. Crowdfund's floor moves from>=1.7.0even though./jobsitself shipped in 1.7.0 — the subpath resolving is not the same thing as the export existing, which is the sharper version of the lesson its own 0.1.1 CHANGELOG records (ERR_PACKAGE_PATH_NOT_EXPORTED).Org moves from
>=1.2.0, lms from>=1.0.0, sc from>=1.11.0, workflow from>=1.7.0.Header comments that pointed at the deleted files, or asserted core did not export these, were corrected rather than left dangling.
- 0.4.1
One
LayerFactoryConfigevery layer factory's config extends, and one factory verb.Fourteen layer packages end in the same one call a consumer writes into
payload.config.ts, and no two agreed on whatconfigmay contain: full seam vocabulary in three (org, lms, ledger), partial in six, NONE in six (2026-09-01 sale-readiness audit §5.3). A site that learnedadminGroupfrom org andhooksfrom sc discovered, package by package, that six factories accept neither — not because the seam had been rejected, but because nothing said it existed.New in core (a NEW exports-map subpath, hence the minor):
@wabbit/tome-core/utilities/layerFactoryConfigexports theLayerFactoryConfiginterface —adminGroup,access(per-collection override map),hooks(appended viamergeHooks, never replacing),extraFields,fieldOverrides,omitFields,fieldOrder,slugs— andapplyLayerFactoryConfig(collections, config), which honors the whole vocabulary in one call and one fixed order (adminGroup → access → hooks → field shape, the last delegated tofields/fieldShape'sapplyFieldShapeso the order cannot drift between layers). Pure: new array, new objects, identity return on an empty config.It is a separate subpath from
./utilities/layerRegistrydeliberately — that module is in core'ssideEffectsarray, and a pure type/vocabulary module should not drag a declared side-effecting module into every factory's type graph.The slug convention is documented rather than forced, because both live shapes are right for what they do: a typed
slugs?: Partial<XSlugs>map for the slugs a layer OWNS (org, sc, accounts — the typed key set makes a typo a compile error, and a homomorphic mapped type satisfies the base'sRecord<string, string | undefined>), and named<name>Slug?: stringscalars for relationship targets in OTHER layers (memberSlug,mediaSlug,eventSlug,rolesSlug) — those are pointers out of a layer, not entries in its key set.*Every `createLayer
config now extends it.** Twelve extendLayerFactoryConfigdirectly and APPLY it throughapplyLayerFactoryConfig(accounts, catalog, crm, crowdfund, deals, fulfillment, lms, marketing, org, sc) or through a targeted application (chrome). Additive in every case: for the six that accepted none of the seams (deals, economy, gamification, marketing, plus forms/intake, see below), the fields are new; for the rest,adminGroup` and friends keep their existing meaning and the applier is a no-op when they are omitted.Two packages accept the vocabulary but do NOT yet apply it, and say so in their type's JSDoc in the required form ("accepted, not yet applied — trigger: …"). economy and gamification both declare
@wabbit/tome-coreas an OPTIONAL peer and hold zero runtime imports of it — gamification reachesregisterLayerthrough a lazyrequire()in a try/catch for exactly this reason.applyLayerFactoryConfigis a runtime VALUE, so importing it at module scope would convert an optional peer into a required one and break every site that installs those packages without core; copying the applier locally is barred byassert:no-forked-primitives. The trigger is stated: the day core becomes a required peer, delete the note and add one line.Both take the type via
import type, which is erased at runtime.Two packages drop seams EXPLICITLY rather than accept-and-ignore. chrome extends
Omit<LayerFactoryConfig, 'access' | 'hooks' | 'extraFields' | 'fieldOverrides' | 'omitFields' | 'fieldOrder' | 'slugs'>because it returns Payload GLOBALS, not collections — those seven are keyed by collection slug and typed againstCollectionConfig, and chrome's slugs already have direct per-surface knobs (header.slug,footer.slug) a parallel map could contradict.The one seam it keeps,
adminGroup, IS applied: globals carryadmin.groupexactly as collections do. rpg extendsOmit<LayerFactoryConfig, 'access'>becauseCharacterSheetsConfigis a single collection's config that doubles as the layer factory's config, and its ownaccessalready means "this collection's access object" — one level shallower than the base's slug-keyed map.Two meanings under one name is the confusion this interface exists to end.
Factory-verb convergence. Three verbs were live.
createWorkflowLayer(config?)is new in@wabbit/tome-workflow(a new export — hence the minor) and returns a spreadable, deliberately EMPTYCollectionConfig[]: this layer is an engine, not a collection set, so the empty array is the honest answer and lets...createWorkflowLayer()compose exactly like every sibling.Its
WorkflowLayerConfigomits every seam for the same reason, and exists as the stable place a real option will land.createGamificationLayerandcreateRpgLayerare pure aliases ofregisterGamificationLayer/registerRpgLayer.initWorkflow,registerGamificationLayerandregisterRpgLayerare all@deprecatedwith sunset at each package's next major; none is removed.Forcing function:
scripts/assert-layer-factory-contract.mjs+pnpm assert:layer-factory-contract, wired intoplatform-discipline.ymlafterassert:layer-version(source reading only, pre-build). Every exportedcreate*Layermust take a config parameter whose type resolves toLayerFactoryConfig— throughextends, an intersection, or an explicitOmit<…>— with verb aliases followed to theirregister*/init*target.Before this change it reported 12 violations and 0 conforming; it now reports 15 conforming, 0 violations. Deliberately NOT checked: whether a factory actually applies what it accepts, because a machine cannot tell a documented deferral from an accident, and a gate that forced silent application would be worse than one that forces a stated deferral.
docs/guides/create-a-new-layer-package.mdgains a "The factory contract" section stating the rule and the three permitted responses.Three factories are ALLOWLISTED with a reason each:
createAiLayerreturns credential wiring and owns no collections, so every seam is meaningless to it;createFormsLayerandcreateIntakeLayerare owned by the forms+intake access wave running in parallel, whose changes rewrite the same files.Peer floors: accounts, catalog, chrome, crm, deals, economy, fulfillment, gamification, marketing and rpg raise
@wabbit/tome-coreto>=1.14.0 <2.0.0. The new subpaths do not exist below that, and a too-low floor is howERR_PACKAGE_PATH_NOT_EXPORTEDreached crowdfund's consumers once already.These are marked
patchbecause the config widening is purely additive; the raised required-peer floor is the reason a release manager may prefer to cut them as minors instead. - 0.4.1
Manifest metadata:
homepage,bugs,engines.All 46 publishable manifests were missing the three fields a consumer sees before any code (2026-09-01 sale-readiness audit §6). Metadata only — no source, no build, no runtime change.
homepagedeep-links to that package README on GitHub (.../tree/main/packages/<dir>#readme). Without it a registry page links to the monorepo root and the reader has to guess which of 46 folders they want.bugs.urlpoints at the repo issue tracker, so a paying customer has a place to report a defect that is not email.engines.nodeis>=22, matching the rootenginesand.nvmrcset the same day. This is a real floor, not decoration: CI on Node 20 could not expand the glob the block packs use fornode --test, and a package installed on Node 20 fails at a runtime the installer cannot connect back to the version.
The forcing function ships with the change:
scripts/assert-manifest-metadata.mjs(rootpnpm assert:manifest-metadata, wired intoplatform-discipline.ymlbesideassert:license-metadata) fails when any publishable manifest lacksdescription,repository.directorymatching its own folder,homepage,bugs,engines.nodeequal to the repo floor,license,filesorsideEffects. It reported 138 violations before this change and 0 after. - 0.4.1
Collapse the audited serial-await fan-outs in Payload hooks, jobs and access checks.
No behavior changes — every try/catch, failure reporter and
overrideAccessjustification is preserved; only the number of round-trips changes.`find({ limit: 0 })` → `payload.count()` —
limit: 0setspagination: falsein the Mongo adapter, so the query loads every matching row into memory to produce one number.@wabbit/tome-orgdocuments this as a production incident inhooks/attendance-count-sync.ts:6-11and had reintroduced it incollections/recruiting/JoinRequest.ts's one-pending-request guard;@wabbit/tome-sc's squadron member recount had the same shape.Independent lookups → `Promise.all` / `Promise.allSettled` — org's
createGiverWindowAccess(a per-request access check that took two serial round-trips),EventAttendance's display-name composer andAwardPresentation's, sc's RSI profile+org page fetches (the hot path for handle validation, against a third-party host), squadron recalcs, and accounts' three offboarding teardown callbacks.allSettledwherever a branch had its own fallback, so a failed member lookup still cannot stop the event title from resolving. sc's RSI adapter keeps its 404 short-circuit exactly, and ledger's per-leg balance guard decides in leg order so the thrownNegativeBalanceErrorstill names the same wallet the serial version did.Independent per-row writes → `batchWrite` (
@wabbit/tome-core/utilities/batch) — org's notification open/resolve fan-outs, the division/team cleanup and sunset cascades (up to 1,000 rows each), the event cascade-delete, the non-atomicmemberCountfallback; lms's certification-expiry sweep (now paced inWRITE_CHUNKchunks like its sibling reconciler) and the course-delete enrollment drop; workflow's deadline sweep; crowdfund's tier-claim reconcile.Same `data` for every row → one bulk `payload.update({ where, data })` — sc's asset-assignment auto-close and the transfer-request GDPR redaction, matching
sc/src/gdpr.ts'smakeNullRefHandler. The auto-close also drops a latent correctness hazard: its page cursor advanced while its own writes removed rows from the filter it was paging over, so a page boundary could skip assignments.Two collection-level fixes. sc's Fleet had two field-level
beforeChangehooks each issuing afindByIDfor the SAME ship on every write; they are now one collection-level hook that reads the ship once and sets bothchassisNameandname. lms'scheckCertificationExpiryre-derivedrecountHoldersonce per expired award with no cache; it now recounts once per affected certification, after the sweep — which is also more correct, since only the final count was ever right.@wabbit/tome-crowdfund'ssettleCampaignpledge loop is untouched and now carries an expliciteslint-disableplus the reason: it captures money one pledge at a time against amaxCapturesPerRunbudget that only bounds anything if the iterations are serialized.@wabbit/tome-org,@wabbit/tome-lms,@wabbit/tome-workflowand@wabbit/tome-crowdfundraise their@wabbit/tome-corepeer floor to>=1.14.0, the release that adds./utilities/batch. org and lms were also understating their floor before this change — both already imported@wabbit/tome-core/jobs, added in core 1.7.0, while declaring>=1.2.0/>=1.0.0. - 0.4.1
README peer tables, and the gate that now requires them.
Sixteen packages declared
peerDependenciesand documented them nowhere a reader could scan — in prose inside an install paragraph, in a transposed "compatibility matrix" with the peers as columns, or not at all. Docs only; no source, no manifest, no runtime change (the one manifest change in this PR, admin'ssonnerpeer, has its own changeset).Each of the sixteen gains a
## Peer dependenciessection generated from its ownpackage.json—| Peer | Range | Required |, one row per peer, the range verbatim,no (optional)read frompeerDependenciesMeta, plus one sentence on what is a realdependencyrather than a peer and why the optional ones are optional. The worst omissions this surfaced:@wabbit/tome-coredocumented 2 of its 13 peers and left out bothnextand@payloadcms/richtext-lexical, which are required;@wabbit/tome-adminlisted 5 of 20;@wabbit/tome-readoutand@wabbit/tome-sclisted none.Eight block packs carried a hand-typed compatibility table that had drifted a full React major — still
>=18after the peer floor moved to>=19.0.0— and none of the eight listedreact-domat all. Those tables are retired in favor of the generated one, with a line saying what they used to claim so the next reader does not reinstate them.The forcing function ships with the fix:
scripts/assert-readme-contract.mjsnow FAILS a package that declares peers without a peer table (a markdown table whose header row names a Peer and a Range column — the existingOptional?andNotesthird columns still pass, so the thirty already-conforming READMEs were not touched). It is deliberately shape-only, not row-level: asserting that each row agrees with the manifest is the Tier 2 generation work.Verified non-vacuous by breaking one table's header and watching the gate fail, then restoring it.
CONTRIBUTING.md's assert-script list — which said "five" while sixteen existed — and the three guides that describe this gate were corrected in the same pass. - 0.4.1
createSCLayernow registers@wabbit/tome-scwith the platform layer registry.Through 0.4.0 tome-sc exported a full layer factory — twelve collections, a permission namespace, GDPR registration — and never called
registerLayer.hasLayer('@wabbit/tome-sc')was therefore permanentlyfalsefor every consumer, and any cross-layer feature gate keyed on SC's presence could never fire.Nothing surfaced it, because a missing registration is indistinguishable from a layer that is genuinely not installed.
The registration follows the sibling pattern exactly: a static import of
@wabbit/tome-core/utilities/layerRegistry(core is a required peer here, and the registry isglobalThis-backed, so a static import shares one store across ESM/CJS/bundler/Payload-CLI contexts — never a lazyrequire()), wrapped intry/catchto swallow only the duplicate-registration throw under HMR or acreateSCLayercall followed bycreateSCPlatform.The manifest is real, not a stub:
versionreads the newSC_LAYER_VERSIONleaf const,collectionsis the twelve resolved slugs, and theadminNaventry usesconfig.adminGroup ?? 'Organization'— the same label the twelve collection factories resolve — underdomain: 'people'atorder: 10. Both halves matter: the sidebar resolver pairs manifest entries to collections by that group string, and its "first manifest wins for a given group label" rule means SC's domain must agree with org's registration for the same label, or the rendered domain would depend on config-build order.Additive: a consumer that never read the registry is unaffected; one that did now sees SC where it previously saw nothing.
- 0.4.1
Updated dependencies [b01ca1f]
- 0.4.1
Updated dependencies [0836ef5]
- 0.4.1
Updated dependencies [73081e6]
- 0.4.1
Updated dependencies [73081e6]
- @wabbit/tome-blocks-sc-pack@0.16.0
- @wabbit/tome-blocks-signal-theme@0.16.0
- @wabbit/tome-cop@0.1.8
0.3.xMinor
Add
RSIProfileAdapter(createRSIProfileAdapter,@wabbit/tome-sc/rsi) — the concreteExternalProfileAdapter<RSIProfile>implementation for@wabbit/tome-core/verification's neutral verification/cache/reconcile primitives (Wave 2R I2).This is now the ONE place RSI's markup regexes live, ported field-for-field from the reference consumer's
scrapeRsiDossier.ts/parseRsiHandle.tsand characterized against the same fixture HTML (Wave 2R I0).RSIClient.validateHandleis rewired to use the adapter internally (same{valid, orgTag?}return shape) so it now benefits from retry/backoff and an optional distributed rate limiter — previously a single unretried fetch. Deliberate divergences from the reference consumer, all test-covered:exists()/checkExistence()fail CLOSED on a network error (the reference consumer fails open); a 404 resolves tostatus: 'not_found'on the first attempt with no wasted retries (the reference consumer retries a stable 404 like a transient failure and then mislabels it); noE2E_TEST_production bypass moved upstream; new structuralvisibilitydetection ('public' | 'hidden' | 'redacted') that the reference consumer's scraper never had.Bumps this package's
@wabbit/tome-corepeer floor to>=1.11.0 <2.0.0(the./verificationsubpath this adapter is built on).@wabbit/tome-cop@0.1.7
1 fix (0.3.1)
- 0.3.1
Fix a module cycle in
@wabbit/tome-sc/rsibetweenclient.tsandadapter.ts(Wave 2R / I2.1 hotfix).adapter.tsimportedADAPTER_VERSIONfromclient.tsto build its top-levelDEFAULT_USER_AGENT, whileclient.tsimportsadapter.tsforcreateRSIProfileAdapter— a live cycle, not just a type-only one, so it broke depending on which side of the cycle a consumer's module graph reached first: entering viaclient.js/index.js(as Payload'sgenerate:typesdoes when it resolvesRSIClient) hitadapter.js's top-levelADAPTER_VERSIONread beforeclient.jshad reached its own assignment, throwingReferenceError: Cannot access 'ADAPTER_VERSION' before initialization.ADAPTER_VERSIONnow lives in a new dependency-freesrc/rsi/version.ts; bothadapter.tsandclient.tsimport it from there instead of from each other, eliminating the cycle.client.tsstill re-exportsADAPTER_VERSIONfor backward compatibility — no import site needs to change.Adds
tests/rsi/rsiModuleLoadability.test.ts, a regression guard that spawns a freshnodeprocess against every built file indist/rsi/*(both the ESM and CJS twin) plus every./rsi*entry in the package'sexportsmap, and asserts a clean load — closing the gap that let this ship:scripts/assert-node-loadable.mjsonly walks exports-map targets (neveradapter.jsdirectly, since there's no standalone subpath for it) and itsclassify()treats a thrownReferenceErroras a SKIP ("runtime side effect"), not a FAIL, so it stayed green through this defect on both counts.
0.2.xMinor
Wave 2 absorb — prepares the layer for its first consumer.
Each item restores an upstream production-tested behavior this layer had diverged from.
- Consumer hooks seam.
SCLayerConfiggainshooks?:, merged viamergeHooks(append, never replace) across all twelve collection factories. The layer is right to omit cache revalidation, media reference tracking and audit-log writes — a platform layer must not know a consumer's infrastructure — but it previously offered nowhere to put them back, so the failure mode was silent omission. Untracked media is not merely degraded: it stays eligible for a ghost-pointer sweep while still in use. - `squadrons.leader` is no longer `required`. Offboarding a leader with no assistant to promote clears the field; a required constraint makes that write fail validation and blocks member retirement outright. Applies to any consumer with an offboarding path — a vacant leader is a valid state.
- `operation-templates.forceTemplate` added. Present upstream, absent here, so adoption would have dropped the relationship and orphaned existing rows. Slug-configurable.
- `resource-requests` access restored to
MANAGE_LOGISTICS | MANAGE_ECONOMY | CREATE_EVENTS. The prior single-permission check silently revoked access from every economy and events officer, whose roles carry the other two. - Break-glass integrity bypass, opt-in via core's
registerSuperRoles. Off by default, so a site declaring no super-roles keeps the stricter behavior. Note a consumer cannot supply this throughconfig.hooks—mergeHooksappends, so the layer's hook runs and throws first; the seam is additive-only and cannot suppress layer behavior.
Adds the package's first vitest config and test suite.
Requires `@wabbit/tome-core` >= 1.7.0 for
isSuperRoleUser; the peer range is bumped accordingly.- Consumer hooks seam.
@wabbit/tome-cop@0.1.7
5 fixes (0.2.1 – 0.2.4)
- 0.2.4
Registers this package's member-referencing collections with core's GDPR export/delete pipelines from inside the package (Wave 5 / W5-I3), mirroring
@wabbit/tome-fulfillment'sregisterFulfillmentGdpr.New
registerScGdpr(options?)/unregisterScGdpr(options?)in./gdpr.ts, re-exported from the package barrel;createSCLayer(and thereforecreateSCPlatform) callsregisterScGdprautomatically unlessconfig.registerGdpr: false.Ten collections register, all
post-identity(none hold subject handle text). Fleet/AssetAvailability/TaskForceAssignments (personal asset ownership) default toretain— this package's real consumer soft-anonymises the Member document on erasure rather than deleting it, so these FKs stay valid and resolve to "Former Member" with nothing to clear;retainis the correct disposition for that consumer, not a fallback.A
personalAssetMode: 'null-ref'opt-in is available for a consumer that instead hard-deletes Members: it clears the owner field viapayload.update(Local API,overrideAccess: true, full validation and hooks run) rather than any database-adapter bypass. Because those three fields arerequired: trueby default, choosing'null-ref'also requiresmemberFieldRequired: false(new option onSCLayerConfig/SCPlatformConfig, forwarded to the three factories AND toregisterScGdprfrom the same config so the two can't drift) —registerScGdprthrows loudly at registration time if'null-ref'is requested while the fields are still required, rather than registering a mode that would fail validation on every row.FleetLogs registers
retain(immutable service-history log). Squadrons/TaskForces/ResourceRequests/Locations/OperationTemplates/ForceTemplates registerretaintoo — none of these six is named in the Wave 5 compliance plan's disposition table; registered under the plan's own stated fallback rule rather than left unregistered, flagged ingdpr.ts's header for a follow-up ratification pass.Bumps the
@wabbit/tome-corepeer/dev floor to>=1.8.0for themode/phase/onNullRefregistry contract this depends on.- @wabbit/tome-cop@0.1.7
- 0.2.3
Two upstream corrections surfaced by the first consumer's line-read cutover audits.
`membershipsSlug` added to `SCLayerConfig`. The Squadron factory hardcoded its
membershipsjoin target to org's'org-memberships'— the only cross-layer slug in the package without a config knob — forcing the first consumer to patch the emitted field post-hoc. A join pointing at an unregistered collection does not error; it renders empty.Resource-requests control flow corrected to match upstream. The 2026-08-15 restoration had the permission keys right and the ordering wrong: logistics authority was granted before the id/status guards (officers could edit
fulfilled/cancelledrequests and perform id-less bulk ops) anddeletegained a logistics branch upstream never shipped. Corrected: update = super-role → require id → blockfulfilled/cancelled→ requester-own → logistics-triple; delete = super-role → require id → block fulfilled → requester-own only.The integrity hook also gains upstream's priority-400 (logistics-exempt) — the field-access-only approach silently stripped the change with a 200, breaking consumers that key error handling off the thrown message. Five new tests pin the ordering.
- 0.2.2
distis now loadable by raw Node. tsup builds withbundle: false, so it emitted relative specifiers exactly as the TypeScript source wrote them — extensionless (from "./hierarchy",require("./hierarchy")).Bundlers and tsx resolve those; raw Node does not. ESM raised
ERR_MODULE_NOT_FOUND, and CJS was worse:require("./x")resolved to the ESM.jstwin (.cjsis not in Node's CJS extension search list), and Node 22+require(esm)then died on _that_ file's own extensionless import.Any consumer outside a bundler — the payload CLI under plain node,
generate:types, ops scripts, codegen tools — hit this on every subpath that had relative imports; single-file subpaths loaded fine, which is why it went unnoticed. A post-build step (scripts/fix-dist-extensions.mjs --strict) now appends explicit extensions (.js//index.js,.cjs//index.cjs) and fails the build on any specifier it cannot resolve rather than guessing.No source changes, and bundler consumers are unaffected — extensioned relative specifiers are universally resolvable.
- @wabbit/tome-cop@0.1.7
- 0.2.1
Import
authenticated/anyonefrom the@wabbit/tome-core/auth/guardsleaf instead of the/authbarrel.The barrel statically re-exports
createBetterAuth, which drags@delmaredigital/payload-better-authinto the module graph — so any consumer loading this package outside a bundler (payload CLI under tsx:generate:types, seeds, migrations) crashed with ERR_MODULE_NOT_FOUND unless it installed an auth stack it may deliberately not use. Leaf-import discipline is what this platform's own consumer docs mandate; the layers now follow it themselves.No behavioral change — same functions, same leaf they always resolved to.
- 0.2.1
Retire the local
authorizedCronRequestcopy in favor of@wabbit/tome-core/jobs.The copy's own comment explained the duplication — the function "is not exported from
@wabbit/tome-core's public surface" — which stopped being true in core 1.7.0. This was the last of three copies; the two in core were retired alongside the export.All three shared a timing leak: an early
authHeader.length !== expected.lengthreturn, which is precisely the flawutilities/timingSafeEqualwas promoted into core to eliminate. The shared implementation hashes both inputs to a fixed-length digest before comparing, so no length branch remains to short-circuit on and a wrong-length header costs the same work as a right-length one.It also rejects a blank secret outright, so a misconfigured
CRON_SECRETcannot authorize a blank header.Behavior is otherwise unchanged: same 500 on unconfigured secret, same 401 on a bad or missing header.
0.1.xMinor
Initial release — the Star Citizen wrapper over Tome.
SC data layer — 12 collections extending
@wabbit/tome-org: fleet management (createShipCollection,createFleetCollection,createFleetLogCollection,createAssetAvailabilityCollection,createResourceRequestCollection), SC operations (createLocationCollection,createGameplayActivityCollection,createOperationTemplateCollection,createForceTemplateCollection), and military coordination (createSquadronCollection,createTaskForceCollection,createTaskForceAssignmentCollection). Post-hoc extension functions (withRSIFields,withFleetFields,withSquadronMembership,withSquadronMemberCountSync,withSCRankPresets) wrap org's Member/Event/Membership/Rank collections without modifying@wabbit/tome-orgitself.Hook-based, opt-in RSI integration (
validateRSIHandle,syncMemberOrg,createSyncShipDatabase, the tree-shakeable./rsiRSIClient, and./tasks'createSyncShipsTask) — nothing calls any RSI-adjacent service unless a site enables it, and there is no official RSI API (handle checks scrape RSI's own public citizen page; ship data comes from a third-party community API).SC bundle —
createSCPlatform(config)composes org (SC terminology preset + rank presets) + the extensions above + the 12 SC collections + permission registration into one call, and bundles@wabbit/tome-blocks-sc-pack,@wabbit/tome-blocks-signal-theme, and@wabbit/tome-copas real dependencies.createSCLayer(config)is the SC-collections-only convenience function for manual composition.Mints two new platform permissions (
MANAGE_FLEET,MANAGE_LOCATIONS); consumes three of org's existing keys (MANAGE_STRUCTURE,MANAGE_LOGISTICS,MANAGE_TEMPLATES). See the package README for the full quickstart, advanced manual-composition path, thetome-accountsco-installation warning, and the documented v1 access-control posture.
18 fixes (0.1.1 – 0.1.8)
- 0.1.8
Updated dependencies [510036f]
- @wabbit/tome-blocks-sc-pack@0.15.0
- @wabbit/tome-blocks-signal-theme@0.15.0
- 0.1.7
@wabbit/tome-blocks-sc-pack@0.14.0
- 0.1.7
@wabbit/tome-blocks-signal-theme@0.14.0
- 0.1.7
@wabbit/tome-cop@0.1.5
- 0.1.6
@wabbit/tome-blocks-sc-pack@0.13.0
- 0.1.6
@wabbit/tome-blocks-signal-theme@0.13.0
- 0.1.5
@wabbit/tome-blocks-signal-theme@0.12.1
- 0.1.5
@wabbit/tome-cop@0.1.5
- 0.1.4
@wabbit/tome-blocks-sc-pack@0.11.2
- 0.1.4
@wabbit/tome-blocks-signal-theme@0.11.2
- 0.1.3
vitest runexited 1 with "No test files found" in these two packages — neither has any test files yet.Added
--passWithNoTeststo thetestscript so CI doesn't fail on an empty suite. Script-only change; no runtime behavior changed.Both packages still need real test coverage added (tracked separately, not fixed here).
- 0.1.3
Every package now declares an explicit
sideEffectsfield (38 added; motion/engine/forms already correct).Registration-bearing modules (render files'
registerRenderer,blocks/*/index.tsdefineBlockself-registration, widgetregister.tsfiles, productHooks, permission self-registrations, print templates, chrome built-in variants) are listed so bundlers can tree-shake everything else WITHOUT dropping import-time registrations — previously the field was unset, which blocked cross-module tree-shaking through the barrels entirely. Never blanketfalseon a package with registration or CSS. - 0.1.3
Updated dependencies [6bc419c]
- 0.1.3
Updated dependencies [36e537a]
- 0.1.3
Updated dependencies [5f78397]
- @wabbit/tome-blocks-sc-pack@0.11.0
- @wabbit/tome-blocks-signal-theme@0.11.0
- @wabbit/tome-cop@0.1.5
- 0.1.2
Core runtime-floor sweep: each package's
@wabbit/tome-corepeer floor now matches the newest core runtime export it actually imports, instead of the platform-wide>=1.0.0baseline from the original peer-range sweep.The stale floors let npm silently install a package next to a core version missing a module it runtime-imports, producing a hard
next buildfailure at import time (reproduced 2026-07-11: tome-starter locked core 1.0.12 + admin 0.6.3 —isAdminNavDomaindoes not exist in core 1.0.x, whereregistry/adminNavwas type-only).@wabbit/tome-admin→>=1.3.0 <2.0.0—nav/manifestResolverruntime-importsisAdminNavDomainfromregistry/adminNav, first shipped as a runtime export in core 1.3.0 (Sidebar v2 Wave 0, d8ff1b2).@wabbit/tome-deals→>=1.1.0 <2.0.0— runtime-importsauth/repScoping(buildRepWhereClauseet al.) andutilities/normalize(normalizeEmail), both introduced in core 1.1.0 (consolidation pass, a9801fe).@wabbit/tome-accounts→>=1.2.0 <2.0.0— runtime-importsauth/permissions(roleSatisfiesPermission, permission registration), introduced in core 1.2.0 (platform permission engine, 9238072).@wabbit/tome-org→>=1.2.0 <2.0.0— runtime-importsauth/permissions(checkPermissionHierarchicalet al.).@wabbit/tome-sc→>=1.2.0 <2.0.0— runtime-importsauth/permissionsacross access helpers and military collections.
Same defect class as the
tome-crmfloor raise to>=1.1.0(b027075);tome-crmis already correct and unchanged here.- @wabbit/tome-cop@0.1.4
- 0.1.1
Updated dependencies [ec4b7bc]
- 0.1.1
Updated dependencies [cd59894]
- @wabbit/tome-cop@0.1.4
- @wabbit/tome-blocks-signal-theme@0.10.2
- @wabbit/tome-blocks-sc-pack@0.10.2