Skip to content

Overlay runtime cache configuration on documented defaults #23

Closed

Description

@lan17

Priority

P1 — High — completed.

Resolution

Completed by #68 (71f26a278cf390d864da15ae017ab41e3afba5c2) and released in https://github.com/lan17/DialCache/releases/tag/v0.7.0.

Shipped contract

  • defaultConfig is the baseline; a non-null runtime provider result overlays it field by field.
  • Provider null, defensive undefined, or an empty config applies no overrides.
  • Missing runtime leaves inherit; explicit requestLocal: false and per-layer ramp: 0 disable inherited policy.
  • An omitted baseline remains fully disabled; a configured TTL with omitted ramp defaults to 100%.
  • Provider exceptions and malformed dynamic policy fail open uncached rather than silently re-enabling defaults.
  • Static/default policy is validated and snapshotted when cached() registers a definition or getOrLoad() starts its invocation.
  • DialCacheKeyConfig.disabled() is the explicit all-layer kill switch.
  • missing_config was replaced by the bounded policy_disabled reason.
  • The unused deprecated MissingKeyConfigError export was removed before release.

Compatibility delivered

  • Partial runtime configs now inherit unspecified defaults instead of disabling them.
  • Runtime kill switches must be explicit.
  • Dashboards migrated from reason="missing_config" to reason="policy_disabled".
  • Cache keys, Redis frames/Lua, invalidation identity, serializers, and client ownership were unchanged.

The current implementation and documentation are in main@84341f221da625af0df147e54c0eff7b1d8bb3eb / dialcache@0.10.0.

Activity

  1. changed the title [-]Simplify per-layer policy declaration and validate static policy early[/-] [+]Overlay runtime cache configuration on documented defaults[/+] on Jul 18, 2026
  2. lan17 commented on Jul 19, 2026

    @lan17
    OwnerAuthor

    Draft implementation is open at #68. It implements the confirmed sparse-overlay/default precedence, explicit disable semantics, registration-time static validation and immutable baseline snapshot, and the missing_config to policy_disabled metric migration. Local validation passed 215 unit tests, 46 Redis/Valkey integration tests, typecheck, build, packed ESM/CommonJS runtime and declaration checks, and Node 20 package compatibility. Two fresh review passes returned no findings. The issue remains open pending merge.

  3. added a commit that references this issue on Jul 22, 2026
    71f26a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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