Skip to content

Make DialCacheConfig modes discriminated and explicit #19

Description

@lan17

Priority

P2 — Medium — important hardening or API work after the safety foundations.

Problem

Contradictory or ignored constructor states are type-valid: Redis accepts both client and createClient; custom or disabled metrics can be combined with Prometheus prefix/registry options that are ignored; and constructing DialCache implicitly registers Prometheus collectors unless metrics: false is supplied.

Evidence:

Open decisions

Confirm the metrics default and whether supplying both Redis client modes has any intended meaning.

Acceptance criteria

  • Model Redis as exactly one of caller-supplied client or lazy factory.
  • Model metrics as one of disabled, custom adapter, or Prometheus configuration.
  • Reject ambiguous states in TypeScript and at runtime for plain JavaScript.
  • Add positive and negative declaration tests to the packed-consumer suite.
  • Document global registry side effects and the chosen default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions