TenantAtlas/apps/platform/.pnpm-store/v10/files/c7/060d7d3ee0605280ac0999760be27b5e3661cfe19bd6aae877699a3b824c35a02c474e5d2f7d5e9677ede4bee996a8f5f50e18ae4827b91e6c213af339c783
ahmido 1fec9c6f9d
Some checks failed
Main Confidence / confidence (push) Failing after 45s
feat: compress governance operator outcomes (#253)
## Summary
- introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries
- apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces
- expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests

## Validation
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
- focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions)
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions)

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #253
2026-04-19 12:30:36 +00:00

60 lines
2.4 KiB
Plaintext

import { Redis } from '@upstash/redis';
import type { MutationOption } from "../core/index.cjs";
import { Cache } from "../core/index.cjs";
import { entityKind } from "../../entity.cjs";
import type { CacheConfig } from "../core/types.cjs";
export declare class UpstashCache extends Cache {
redis: Redis;
protected useGlobally?: boolean | undefined;
static readonly [entityKind]: string;
/**
* Prefix for sets which denote the composite table names for each unique table
*
* Example: In the composite table set of "table1", you may find
* `${compositeTablePrefix}table1,table2` and `${compositeTablePrefix}table1,table3`
*/
private static compositeTableSetPrefix;
/**
* Prefix for hashes which map hash or tags to cache values
*/
private static compositeTablePrefix;
/**
* Key which holds the mapping of tags to composite table names
*
* Using this tagsMapKey, you can find the composite table name for a given tag
* and get the cache value for that tag:
*
* ```ts
* const compositeTable = redis.hget(tagsMapKey, 'tag1')
* console.log(compositeTable) // `${compositeTablePrefix}table1,table2`
*
* const cachevalue = redis.hget(compositeTable, 'tag1')
*/
private static tagsMapKey;
/**
* Queries whose auto invalidation is false aren't stored in their respective
* composite table hashes because those hashes are deleted when a mutation
* occurs on related tables.
*
* Instead, they are stored in a separate hash with the prefix
* `__nonAutoInvalidate__` to prevent them from being deleted when a mutation
*/
private static nonAutoInvalidateTablePrefix;
private luaScripts;
private internalConfig;
constructor(redis: Redis, config?: CacheConfig, useGlobally?: boolean | undefined);
strategy(): "all" | "explicit";
private toInternalConfig;
get(key: string, tables: string[], isTag?: boolean, isAutoInvalidate?: boolean): Promise<any[] | undefined>;
put(key: string, response: any, tables: string[], isTag?: boolean, config?: CacheConfig): Promise<void>;
onMutate(params: MutationOption): Promise<void>;
private addTablePrefix;
private getCompositeKey;
}
export declare function upstashCache({ url, token, config, global }: {
url: string;
token: string;
config?: CacheConfig;
global?: boolean;
}): UpstashCache;