Context
PackStore, fetchPacks and resolvePack existed, but nothing handed a service its deployment’s verified packs as
one injectable dependency, so identity, billing and notifications each wired the store, the hashes and the keys.
Decision
- A port.
ResolvedPackSource(keymarket_packs.ResolvedPackSource) givespacks(), the deployment’s verified pack versions, andvalueFor(market, key, options), the value in force on a day (today, UTC, by default) under the tenant’s pins, statuses and sections. A driver suppliespacks()only;valueForis the port’s, so every driver answers alike. - Drivers.
store(default) fetches the hashes inMarketPacksConfig.packHashesfromPackStoreand verifies them againstMarketPacksConfig.trustedKeysonce per process; a failed load is retried on the next call.memoryserves packs handed to it. The OS loader (STA-763) is a further driver or a host@Replaces. - Binding.
MarketPacksModule(the./nodeentry) exports the port; gen binds the driver from configsource(STACKRA_MARKET_PACKS_SOURCE). Which packs a deployment trusts is deploy-time configuration, never per tenant.
Consequences
@stackra/market-packsdepends on@stackra/configand@stackra/validationat runtime (the lockfile gains those links).- New pack versions reach a running service with a new deployment config.
Enforcement
packages/foundation/market-packs/src/core/ports/__tests__/resolved-pack-source.port.test.ts,
packages/foundation/market-packs/src/core/drivers/__tests__/store-resolved-pack-source.driver.test.ts,
packages/foundation/market-packs/src/node/__tests__/market-packs.module.test.ts.
Supersedes and sources
Supersedes: none. Sources: OSservices/identity/SPEC.md G1, services/billing/SPEC.md,
services/notifications/SPEC.md gap 6; STA-831.