noCV
PPOLICY-109 · Migrate and simplify

Pin a quote to one rule family during a revision switch

Practice briefStoryExpert

A local replay switches a partner from revision 2 to 3 while quotes are in progress. Resolving the calculator at request start and the explainer at response time can produce a mixed-revision quote even after family validation.

Focused work estimate
4h + prerequisites
Priority in the scenario
High
Engineering practice
Versioned configuration · Concurrency · Deterministic replay

Estimated field mix

  • Backend50%
  • System design30%
  • Quality engineering20%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Pattern topics

  • Abstract FactoryRefactor

    Make family resolution yield a stable snapshot so a revision switch cannot mix products created at different moments in the same operation.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional equipment-rental service supports direct customers and two reseller contracts. Pricing now lives in a long conditional with subclasses left over from a discontinued campaign. Build a local TypeScript quoting module and synthetic fixtures; no starter repository, real charges, tax advice, or payment connection is supplied. Amounts use integer cents and the exercise supports USD only.

Setup prerequisites

  • Pure functions
  • Object composition
  • Integer arithmetic

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Resolve and retain one immutable family snapshot for the complete quote operation.
  • Switches affect only newly started operations; stored quotes retain inputs, family revision, and sufficient breakdown for deterministic replay.
  • A malformed replacement family is rejected without displacing the last valid selection, and rollback selects a previous complete family.

Implementation constraints

  • Use an in-process deterministic scheduler for the exercise; a distributed configuration service is outside scope.

Verification to include

  • Pause a quote between calculation and explanation, switch revisions, and verify each concurrent quote is internally consistent.
  • Reject an incompatible family, perform a rollback, and replay an earlier quote against its pinned revision.

Deliverables

  • Atomic family selection, interleaving tests, and revision-switch runbook

Rollout and recovery

Exercise old/new/rollback sequences against synthetic requests; report differences by explicit revision without modifying prior quote records.

Value of the work

For the engineer: Practice choosing, testing, and removing object-design abstractions around versioned business rules and tenant isolation.

For the team: Review changes that let a team introduce a contract without silently changing existing quotes, together with the maintenance costs of the chosen design.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.