6214780244
Automatically-retrieved facts (balances, sessions, etc.) are now cached with
a time expiry so repeated checks don't re-invoke the underlying data store.
- check(): registered providers cache their normalized edges per
(relation, subject, object) with a TTL; a fresh entry is reused without
re-invoking the provider. Per-check factProviders are one-off observations
and stay cache-transparent (no read, no write).
- TTL resolution: DSL-declared 'BEHAVES { ttl <duration> }' on a fact >
setFactTTL(relation, ms) > policy.providerCacheTTL (default 30s; 0 disables).
- Grammar: facts may now declare a freshness window via
'fact balance(user, amount) BEHAVES { ttl 1h }' (previously BEHAVES only
accepted 'AS edge|transitive|hierarchical|symmetrical_graph'). The runtime
indexes it as the fact's ttlMs.
- registerFact/unregisterFact, graph mutations (add/update/remove node or
relation), and invalidateProviderCache(relation?) keep the cache consistent.
- Injectable clock (default wall clock) drives cache freshness, mirroring the
core's unpinned-clock contract.
Tests: DSLRuntimeCache (reuse within TTL, expiry re-invoke, per-check
override transparency, registerFact invalidation, mutation invalidation,
per-relation/all invalidation, policy default, DSL-declared 1h TTL).
34 lines
1.1 KiB
JSON
34 lines
1.1 KiB
JSON
{
|
|
"name": "@arbiter/evidence-dsl",
|
|
"version": "1.7.0",
|
|
"description": "Evidence DSL v2 compiler: translates the natural Evidence DSL (ADR-000) into @arbiter/core relation configurations.",
|
|
"license": "ISC",
|
|
"type": "module",
|
|
"main": "src/index.js",
|
|
"exports": {
|
|
".": "./src/index.js",
|
|
"./package.json": "./package.json",
|
|
"./DSLCompiler": "./src/DSLCompiler.js",
|
|
"./parser/DSLParser": "./src/parser/DSLParser.js",
|
|
"./parser/GeneratedParser": "./src/parser/GeneratedParser.js",
|
|
"./generator/RuleGenerator": "./src/generator/RuleGenerator.js",
|
|
"./validation/DSLValidation": "./src/validation/DSLValidation.js",
|
|
"./runtime/DSLRuntime": "./src/runtime/DSLRuntime.js",
|
|
"./interpreter/BuiltInFunctions": "./src/interpreter/BuiltInFunctions.js"
|
|
},
|
|
"files": [
|
|
"src/"
|
|
],
|
|
"scripts": {
|
|
"test": "node --test --test-force-exit \"tests/**/*.test.js\"",
|
|
"generate:parser": "node scripts/generate-parser.js"
|
|
},
|
|
"dependencies": {
|
|
"@arbiter/core": "^1.0.4"
|
|
},
|
|
"devDependencies": {
|
|
"@rigor/core": "^3.1.0",
|
|
"peggy": "^5.0.6"
|
|
}
|
|
}
|