@ultimat3/cache 31.32.0 → 31.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/graph.ts +6 -5
- package/src/invalidate.ts +7 -5
- package/src/partial-log.ts +7 -5
- package/src/semantic.ts +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/cache",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.34.0",
|
|
4
4
|
"description": "Tagged caching: request memo, LRU, Redis, CDN — one invalidation graph",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"test": "bun test"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ultimat3/core": "31.
|
|
46
|
+
"@ultimat3/core": "31.34.0"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/graph.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// ONE invalidation graph, not three. Memoized values, LRU keys, Redis keys, ISR routes and
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// second
|
|
5
|
-
//
|
|
1
|
+
// ONE invalidation graph, not three. Memoized values, LRU keys, Redis keys, ISR routes and CDN
|
|
2
|
+
// paths all register their tag dependencies here — so `invalidates: [tag.post]` reaches every one
|
|
3
|
+
// of them in a single hop. There is deliberately no exported constructor: a second graph would be a
|
|
4
|
+
// second source of truth, which is how "the page is still stale" bugs are born.
|
|
5
|
+
//
|
|
6
|
+
// Register into this one or you are not in the framework.
|
|
6
7
|
|
|
7
8
|
import type { CacheTag } from './tags';
|
|
8
9
|
import { parseTag, serializeTag, serializeTags } from './tags';
|
package/src/invalidate.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// THE single invalidation entry point. `action.cache.invalidates`, `x cache bust`, the MCP
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// THE single invalidation entry point. `action.cache.invalidates`, `x cache bust`, the MCP tool and
|
|
2
|
+
// the admin panel all call this one function — nothing else may talk to a tier's `invalidateTags`
|
|
3
|
+
// directly.
|
|
4
|
+
//
|
|
5
|
+
// One hop reaches memo, LRU, Redis, ISR routes and the CDN; the returned report answers the caller,
|
|
6
|
+
// and one `cache.invalidate` event answers every subscriber (the `/_x` cache panel keeps its own
|
|
7
|
+
// buffer), so "did it actually clear?" needs no log dive.
|
|
6
8
|
|
|
7
9
|
import {
|
|
8
10
|
CACHE_TIERS,
|
package/src/partial-log.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Single responsibility: how often `cache.invalidate.partial` is said. A tier that keeps refusing
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Single responsibility: how often `cache.invalidate.partial` is said. A tier that keeps refusing —
|
|
2
|
+
// the broadcast, while the bus is away — is ONE condition on a process that is still serving: a
|
|
3
|
+
// warning on its 1st, 2nd, 4th, 8th, … refusal and one line when it clears again, never one line
|
|
4
|
+
// per bust per publisher for as long as an outage lasts.
|
|
5
|
+
//
|
|
6
|
+
// The report itself is unchanged: every caller still gets every error, and the `/_x` panel still
|
|
7
|
+
// records every bust.
|
|
6
8
|
|
|
7
9
|
import { isOutageMilestone, logger } from '@ultimat3/core';
|
|
8
10
|
|
package/src/semantic.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// The semantic cache for LLM calls: a near-duplicate prompt should not pay for a second
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The semantic cache for LLM calls: a near-duplicate prompt should not pay for a second completion.
|
|
2
|
+
// Keyed by embedding, matched by cosine similarity above a threshold — exact string keys miss on
|
|
3
|
+
// "list my orders" vs "show me my orders", which is most of the traffic.
|
|
4
|
+
//
|
|
5
|
+
// The in-memory default is correct but O(n); pgvector is the production backing (an ivfflat index
|
|
6
|
+
// over `x_semantic_cache.embedding`), which is why the interface is a driver.
|
|
6
7
|
|
|
7
8
|
import type { Clock } from '@ultimat3/core';
|
|
8
9
|
import { systemClock } from '@ultimat3/core';
|