noCV
PPROVIDER-105 · Compose cross-cutting behavior

Record one bounded telemetry event around each provider attempt

Practice briefStoryIntermediate

Adapter A logs full payloads while B logs nothing on exceptions. The team cannot compare local attempt outcomes without exposing synthetic recipient and notice content in generic logs.

Focused work estimate
2h 30m + prerequisites
Priority in the scenario
Medium
Engineering practice
Instrumentation · Data minimization · Exception handling

Estimated field mix

  • Integrations40%
  • Site reliability30%
  • Privacy engineering30%

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

  • DecoratorApply

    Add consistent attempt instrumentation around interchangeable adapters without embedding logging behavior in each provider mapping.

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 maintenance scheduler sends appointment notices through two providers. Their request shapes, error codes, and acknowledgement semantics differ. Build two local scripted provider doubles and a TypeScript application module; use synthetic recipients, block external network access, and never send real notifications. No provider accounts, starter repository, or production delivery qualification is supplied.

Setup prerequisites

  • HTTP contracts
  • Asynchronous cancellation
  • Dependency injection

Preceding work

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

Acceptance criteria

  • Wrap provider attempts with a common duration and outcome recorder that emits exactly one completion event per attempt.
  • Limit event fields to operation identity, provider, outcome category, elapsed duration, and declared adapter version; omit recipient, body, and credentials.
  • A telemetry sink failure cannot change the provider result or mask an adapter exception.

Implementation constraints

  • Use a Decorator or explicit higher-order function; inject clock and event sink for deterministic tests, and avoid high-cardinality recipient labels.

Verification to include

  • Run accepted, rejected, thrown-error, and cancellation cases and assert one correctly categorized event each.
  • Make the sink throw and inspect all event payloads for synthetic secret and recipient markers.

Deliverables

  • Attempt telemetry wrapper and privacy/failure regression fixtures

Rollout and recovery

Enable the wrapper on local stubs first; disable the sink independently while preserving attempt behavior and correlation identities.

Value of the work

For the engineer: Practice placing provider boundaries, comparing wrappers and coordinators, and testing ordering, cancellation, and resource limits under controlled faults.

For the team: Review whether a provider change can be made without rewriting scheduling rules, leaking recipient data, or turning one provider failure into wider exhaustion.

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.