@jjh32456/longlive 0.0.0-stage → 2.0.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/CHANGELOG.md +235 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +362 -0
- package/README.en.md +64 -0
- package/README.md +256 -2
- package/SPEC.md +211 -0
- package/build-info.json +1665 -0
- package/cordis.patch.yml +208 -0
- package/docs/A1-MIGRATION.md +75 -0
- package/docs/ANSWER-GUARD.md +92 -0
- package/docs/ARCHITECTURE.md +128 -0
- package/docs/AUTO-RECALL-WIRING.md +115 -0
- package/docs/AUTO-RECALL.md +237 -0
- package/docs/CONCEPTS.md +143 -0
- package/docs/CONFIG.md +839 -0
- package/docs/ERRORS.md +271 -0
- package/docs/FAQ.md +186 -0
- package/docs/FEATURES.md +579 -0
- package/docs/INDEX-FRESHNESS.md +21 -0
- package/docs/METRICS.md +244 -0
- package/docs/MIGRATION-1.6.0.md +220 -0
- package/docs/OPERATIONS.md +439 -0
- package/docs/PANEL-INTEGRATION.md +190 -0
- package/docs/PRIVACY.md +88 -0
- package/docs/QUICKSTART.md +155 -0
- package/docs/RAW-INDEX-POLICY.md +7 -0
- package/docs/README.en.md +48 -0
- package/docs/RESIDENT-WATCHER.md +90 -0
- package/docs/SESSION-WATCH.md +214 -0
- package/docs/TOOLS.md +184 -0
- package/docs/TROUBLESHOOTING.md +329 -0
- package/icon.svg +11 -0
- package/lib/client.js +436 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +163 -4
- package/runbook.md +343 -0
- package/scripts/archive-digest-build.mjs +668 -0
- package/scripts/auto-truncate-run.ps1 +752 -0
- package/scripts/backfill-auto-cards.mjs +98 -0
- package/scripts/edges-build.mjs +1003 -0
- package/scripts/index-maintain.mjs +39 -0
- package/scripts/index-reconcile.mjs +49 -0
- package/scripts/index-status.mjs +28 -0
- package/scripts/install-resident-watcher.ps1 +15 -0
- package/scripts/install-session-watch.ps1 +332 -0
- package/scripts/install-surgery-task.ps1 +174 -0
- package/scripts/lib/auto-truncate-run.ps1 +512 -0
- package/scripts/lib/session-watch-fixture.mjs +207 -0
- package/scripts/longlive-doctor.mjs +578 -0
- package/scripts/metrics-read.mjs +79 -0
- package/scripts/metrics-sample.mjs +215 -0
- package/scripts/migrate-180.mjs +163 -0
- package/scripts/migrate-200.mjs +8 -0
- package/scripts/migrate-a1-legacy.mjs +62 -0
- package/scripts/migrate-lifecycle.mjs +157 -0
- package/scripts/pack.mjs +392 -0
- package/scripts/recall-index-build.mjs +128 -0
- package/scripts/recall-links-build.mjs +420 -0
- package/scripts/rescore-cards.mjs +36 -0
- package/scripts/resident-watcher-status.ps1 +15 -0
- package/scripts/resident-watcher.ps1 +643 -0
- package/scripts/session-watch-drill.mjs +553 -0
- package/scripts/session-watch-status.ps1 +146 -0
- package/scripts/session-watch.mjs +1367 -0
- package/scripts/surgery-inspect.mjs +122 -0
- package/scripts/surgery-run.cmd +34 -0
- package/scripts/truncate-cli.mjs +279 -0
- package/scripts/unattended-surgery.ps1 +1019 -0
- package/scripts/uninstall-resident-watcher.ps1 +15 -0
- package/scripts/uninstall-session-watch.ps1 +192 -0
- package/scripts/verify-card-anchors.mjs +138 -0
- package/scripts/watch-loop.ps1 +916 -0
- package/src/actions/audit.js +125 -0
- package/src/actions/evidence.js +122 -0
- package/src/actions/fs.js +162 -0
- package/src/activity/index.js +873 -0
- package/src/activity/model.js +351 -0
- package/src/activity/store.js +786 -0
- package/src/activity/summary.js +180 -0
- package/src/activity/thinking.js +191 -0
- package/src/adapters/constants.js +11 -0
- package/src/adapters/engram/data/aliases.json +51 -0
- package/src/adapters/engram/data/policy.json +8 -0
- package/src/adapters/engram/data/routing-rules.json +546 -0
- package/src/adapters/engram/index.js +278 -0
- package/src/adapters/registry.js +315 -0
- package/src/answer/audit.js +238 -0
- package/src/answer/claim-guard.mjs +234 -0
- package/src/answer/evidence.js +30 -0
- package/src/answer/guard.js +1370 -0
- package/src/answer/index.js +1086 -0
- package/src/answer/query.js +111 -0
- package/src/answer/second-hop.mjs +101 -0
- package/src/auto-truncate-status.js +164 -0
- package/src/auto-truncate.js +1181 -0
- package/src/autoprocedure/candidate.js +342 -0
- package/src/autoprocedure/config.js +122 -0
- package/src/autoprocedure/evidence.js +345 -0
- package/src/autoprocedure/index.js +83 -0
- package/src/autoprocedure/ledger.js +329 -0
- package/src/autoprocedure/lint.js +232 -0
- package/src/autoprocedure/llm.js +409 -0
- package/src/autoprocedure/locks.js +102 -0
- package/src/autoprocedure/paths.js +39 -0
- package/src/autoprocedure/privacy.js +87 -0
- package/src/autoprocedure/rules.js +288 -0
- package/src/autoprocedure/runtime.js +718 -0
- package/src/autoprocedure/session-reader.js +328 -0
- package/src/backup.js +310 -0
- package/src/bus/bus.mjs +1446 -0
- package/src/codec.js +269 -0
- package/src/compaction/cut-engine.js +44 -0
- package/src/compaction/engine-core.js +1237 -0
- package/src/compaction/entry.js +228 -0
- package/src/compaction.js +230 -0
- package/src/conclusion.js +366 -0
- package/src/config.js +835 -0
- package/src/d6/runtime.js +517 -0
- package/src/d6/surface.js +181 -0
- package/src/deps.js +189 -0
- package/src/engine-status.js +141 -0
- package/src/features.js +1035 -0
- package/src/handoff/index.js +1077 -0
- package/src/handoff/model.js +1058 -0
- package/src/handoff/store.js +1233 -0
- package/src/heartbeat.js +385 -0
- package/src/home.js +16 -0
- package/src/host-version.js +280 -0
- package/src/hot-truncate-diag.js +98 -0
- package/src/identity/card-marker.js +281 -0
- package/src/identity/handover.js +845 -0
- package/src/identity/index.js +337 -0
- package/src/identity/inject-position.js +133 -0
- package/src/identity/writeback.js +344 -0
- package/src/identity.js +118 -0
- package/src/index.js +647 -0
- package/src/lifecycle/gap-clocks.js +364 -0
- package/src/lifecycle/index.js +269 -0
- package/src/lifecycle/proactive.js +1426 -0
- package/src/live-target.js +212 -0
- package/src/live.js +1603 -0
- package/src/log-rotation.js +153 -0
- package/src/memory/a1-migration.js +190 -0
- package/src/memory/activity-capture.js +229 -0
- package/src/memory/anchor-fallback.js +116 -0
- package/src/memory/anchors.js +194 -0
- package/src/memory/archive-cold-state.mjs +794 -0
- package/src/memory/archive-staging.mjs +305 -0
- package/src/memory/archive.mjs +415 -0
- package/src/memory/audit-records.js +222 -0
- package/src/memory/auto-cards.js +441 -0
- package/src/memory/capture-host.js +297 -0
- package/src/memory/capture.js +496 -0
- package/src/memory/card-anchors.js +203 -0
- package/src/memory/card-priority.js +110 -0
- package/src/memory/cards.js +425 -0
- package/src/memory/catchup.mjs +534 -0
- package/src/memory/conclusion-distill.js +381 -0
- package/src/memory/conclusion-drafts.js +243 -0
- package/src/memory/conflicts.js +1060 -0
- package/src/memory/consolidate.js +834 -0
- package/src/memory/decay.js +311 -0
- package/src/memory/distill.js +485 -0
- package/src/memory/event-index.js +1826 -0
- package/src/memory/evidence-chain.js +295 -0
- package/src/memory/evidence.js +213 -0
- package/src/memory/filter-runner.js +555 -0
- package/src/memory/filter.js +1035 -0
- package/src/memory/forget-v2.js +680 -0
- package/src/memory/forget.js +531 -0
- package/src/memory/frames-activation.js +249 -0
- package/src/memory/frontmatter.js +454 -0
- package/src/memory/fts-query.js +342 -0
- package/src/memory/governance.js +604 -0
- package/src/memory/index-freshness.js +234 -0
- package/src/memory/index.js +435 -0
- package/src/memory/l2-gate.js +169 -0
- package/src/memory/land.mjs +743 -0
- package/src/memory/lifecycle.js +235 -0
- package/src/memory/lock.js +121 -0
- package/src/memory/maintenance.js +1149 -0
- package/src/memory/manifest.js +245 -0
- package/src/memory/memory-health.mjs +607 -0
- package/src/memory/migrate-200.js +1681 -0
- package/src/memory/migrate-lifecycle.js +1808 -0
- package/src/memory/migrate.js +139 -0
- package/src/memory/paths.js +229 -0
- package/src/memory/procedure-candidate.mjs +377 -0
- package/src/memory/procedure.js +982 -0
- package/src/memory/prospective-memory.mjs +362 -0
- package/src/memory/provenance.js +119 -0
- package/src/memory/recall-feedback.mjs +406 -0
- package/src/memory/recall-v2.js +218 -0
- package/src/memory/recall.js +357 -0
- package/src/memory/reconcile.js +265 -0
- package/src/memory/records.js +433 -0
- package/src/memory/reinforce.js +281 -0
- package/src/memory/retention.js +162 -0
- package/src/memory/review.js +124 -0
- package/src/memory/state.js +279 -0
- package/src/memory/tiers.js +168 -0
- package/src/memory/topic-phrases.js +73 -0
- package/src/memory/trust.js +97 -0
- package/src/memory/turn-budget.mjs +290 -0
- package/src/memory/version-chain.js +264 -0
- package/src/memory/wake-bridge.mjs +2999 -0
- package/src/memory/wal.js +137 -0
- package/src/memory/working-frame.js +779 -0
- package/src/metrics/classify.mjs +191 -0
- package/src/metrics/estimate.mjs +108 -0
- package/src/metrics/index.mjs +204 -0
- package/src/metrics/measure.mjs +462 -0
- package/src/metrics/prestep-latency.mjs +307 -0
- package/src/metrics/store.mjs +264 -0
- package/src/original.js +294 -0
- package/src/policy/threshold-policy.js +224 -0
- package/src/policy-profile.js +463 -0
- package/src/recall/anaphora.mjs +87 -0
- package/src/recall/archive-config.mjs +130 -0
- package/src/recall/archive-fallback.mjs +390 -0
- package/src/recall/archive-search.mjs +428 -0
- package/src/recall/archive-state.mjs +588 -0
- package/src/recall/brain.mjs +501 -0
- package/src/recall/cards.mjs +202 -0
- package/src/recall/current-line.mjs +110 -0
- package/src/recall/edges.js +398 -0
- package/src/recall/embedding.mjs +698 -0
- package/src/recall/entities.mjs +112 -0
- package/src/recall/explain.mjs +443 -0
- package/src/recall/force-policy.mjs +138 -0
- package/src/recall/gate-log.mjs +280 -0
- package/src/recall/gate-metrics.mjs +191 -0
- package/src/recall/index.js +1337 -0
- package/src/recall/inject-order.mjs +279 -0
- package/src/recall/link-recall.mjs +183 -0
- package/src/recall/links.mjs +696 -0
- package/src/recall/privacy.mjs +208 -0
- package/src/recall/recall-core.mjs +810 -0
- package/src/recall/shared-visibility.js +302 -0
- package/src/recall/time-normalizer.mjs +196 -0
- package/src/recall/turn-budget-inject.mjs +154 -0
- package/src/retention/cold-gate.mjs +146 -0
- package/src/retention/config.js +163 -0
- package/src/retention/index.js +801 -0
- package/src/role/activation.js +191 -0
- package/src/role/attention.js +318 -0
- package/src/role/base.js +36 -0
- package/src/role/channels.js +423 -0
- package/src/role/index.js +425 -0
- package/src/role/interfaces.js +115 -0
- package/src/role/personality.js +370 -0
- package/src/role/readers.js +151 -0
- package/src/role/relationships.js +477 -0
- package/src/role/store.js +202 -0
- package/src/role/writeprotect.js +373 -0
- package/src/router/aliases.json +182 -0
- package/src/router/background/agent-runner.mjs +239 -0
- package/src/router/background/anchor.mjs +323 -0
- package/src/router/background/audit.mjs +337 -0
- package/src/router/background/budget-ledger.mjs +648 -0
- package/src/router/background/host-sim.mjs +451 -0
- package/src/router/background/index.mjs +81 -0
- package/src/router/background/memory.mjs +63 -0
- package/src/router/background/mock-llm.mjs +203 -0
- package/src/router/background/queue.mjs +224 -0
- package/src/router/background/retry.mjs +255 -0
- package/src/router/background/router.mjs +1459 -0
- package/src/router/background/stream.mjs +276 -0
- package/src/router/background/tool-policy.mjs +255 -0
- package/src/router/design-headings.json +221 -0
- package/src/router/face/config.mjs +155 -0
- package/src/router/face/context.mjs +284 -0
- package/src/router/face/face.mjs +466 -0
- package/src/router/face/identity.mjs +130 -0
- package/src/router/face/index.mjs +65 -0
- package/src/router/face/journal.mjs +119 -0
- package/src/router/face/llm.mjs +252 -0
- package/src/router/face/outbox.mjs +153 -0
- package/src/router/face/paths.mjs +54 -0
- package/src/router/judge.mjs +987 -0
- package/src/router/policies/generic.json +131 -0
- package/src/router/route.js +1766 -0
- package/src/router/router.mjs +535 -0
- package/src/router/routing-rules.json +816 -0
- package/src/router/run-sim.mjs +530 -0
- package/src/router/runtime.js +569 -0
- package/src/router/service/apply.mjs +1218 -0
- package/src/router/service/board.mjs +712 -0
- package/src/router/service/caller.mjs +131 -0
- package/src/router/service/config.mjs +361 -0
- package/src/router/service/context.mjs +314 -0
- package/src/router/service/hint.mjs +668 -0
- package/src/router/service/lease.mjs +494 -0
- package/src/router/service/live.mjs +251 -0
- package/src/router/service/lock.mjs +550 -0
- package/src/router/service/merge.mjs +255 -0
- package/src/router/service/model-resolve.mjs +350 -0
- package/src/router/service/paths.mjs +168 -0
- package/src/router/service/proposals.mjs +1461 -0
- package/src/router/service/queue.mjs +477 -0
- package/src/router/service/reconcile.mjs +271 -0
- package/src/router/service/service.mjs +2998 -0
- package/src/router/service/sources.mjs +352 -0
- package/src/router/service/status.mjs +520 -0
- package/src/router/service/store.mjs +476 -0
- package/src/router/service/ticklock.mjs +239 -0
- package/src/router/service/tokens.mjs +95 -0
- package/src/router/service/tools.mjs +248 -0
- package/src/router/service/wake.mjs +544 -0
- package/src/router/service/wal.mjs +685 -0
- package/src/router/shadow.mjs +821 -0
- package/src/surgery-recovery.js +1909 -0
- package/src/tool-output.js +485 -0
- package/src/tools.js +3262 -0
- package/src/truncate-visible.js +2416 -0
- package/src/truncate.js +999 -0
- package/src/ui/actions.js +1312 -0
- package/src/ui/flags.js +259 -0
- package/src/ui/panel-api.js +371 -0
- package/src/ui/panel-auth.js +251 -0
- package/src/ui/panel-integrity.js +243 -0
- package/src/ui/routes-readonly.js +759 -0
- package/src/ui/routes.js +284 -0
- package/src/util/append-store.js +368 -0
- package/src/util/local-day.js +30 -0
- package/src/util/redact.js +227 -0
- package/src/util/stale-locks.js +148 -0
- package/src/version.js +99 -0
- package/test/fixtures/pre-step-container.mjs +100 -0
- package/test/p1_probe.mjs +97 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
// src/role/writeprotect.js — 1.8.0 / v2.8.1 §16.8 A/E:宿主私有写保护 + HMAC 侧车 + 四元边界
|
|
2
|
+
//
|
|
3
|
+
// 设计(§16.8):
|
|
4
|
+
// A. `.longlive/role/**`、`.longlive/working/**` 等数据「模型与子脑不可写」:
|
|
5
|
+
// ① 宿主进程独占写(tmp + rename + fsync);② 每文件 HMAC 侧车
|
|
6
|
+
// `<file>.hmac` = HMAC-SHA256(auditKey, canonical bytes),读时校验,失败
|
|
7
|
+
// → `E_INTEGRITY_TAMPER` 且拒绝加载;③ 模型工具/子脑直写 → `E_WRITE_DENY`。
|
|
8
|
+
// E. 四元边界 sessionId/userId/projectId/readers[]:私密帧拒绝 `E_FRAME_PRIVATE`;
|
|
9
|
+
// role 文件带 subject/readers,跨用户读取被拒(宿主例外)。
|
|
10
|
+
//
|
|
11
|
+
// 密钥:宿主内存 auditKey 优先(与 panel-auth 同源);未注入时从
|
|
12
|
+
// `<memoryRoot>/.longlive/.hostkey` 取(首启生成,0600 权限,宿主私有目录约定)。
|
|
13
|
+
// 该 key 与内容分开存放且不在任何响应/日志里出现;残余风险见 docs/ROLE.md。
|
|
14
|
+
//
|
|
15
|
+
// 纯本地、失败静默:写路径抛结构化错误;读路径由调用方决定降级。
|
|
16
|
+
|
|
17
|
+
import crypto from 'node:crypto';
|
|
18
|
+
import fs from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
|
|
21
|
+
import { isInsideRoot, memoryError } from '../memory/paths.js';
|
|
22
|
+
import { RoleError, ROLE_CODES, iso } from './base.js';
|
|
23
|
+
|
|
24
|
+
export const WRITEPROTECT_SCHEMA = 'hostwrite/v1';
|
|
25
|
+
export const SIDECAR_SUFFIX = '.hmac';
|
|
26
|
+
export const HOST_KEY_FILE = '.hostkey';
|
|
27
|
+
/** Host-injected audit key wins over the persisted fallback key file. */
|
|
28
|
+
export const AUDIT_KEY_ENV = 'DSH_LONGLIVE_AUDIT_KEY';
|
|
29
|
+
export const WRITE_CODES = Object.freeze({
|
|
30
|
+
WRITE_DENY: 'E_WRITE_DENY',
|
|
31
|
+
NO_CAP: 'E_NO_CAP',
|
|
32
|
+
TAMPER: 'E_INTEGRITY_TAMPER',
|
|
33
|
+
SIDECAR: 'E_SIDECAR_INVALID',
|
|
34
|
+
FRAME_PRIVATE: 'E_FRAME_PRIVATE',
|
|
35
|
+
ACCESS_DENIED: 'E_ACCESS_DENIED',
|
|
36
|
+
SUBJECT: 'E_SUBJECT_INVALID',
|
|
37
|
+
});
|
|
38
|
+
export const ROLE_SUBJECT_FIELDS = Object.freeze(['sessionId', 'userId', 'projectId', 'readers']);
|
|
39
|
+
/** §16.8 A:模型/子脑永远不是 host writer。 */
|
|
40
|
+
export const HOST_ACTORS = Object.freeze(['host', 'panel']);
|
|
41
|
+
|
|
42
|
+
function writeError(code, message, status = 403, details = undefined) {
|
|
43
|
+
const error = new RoleError(code, message, details);
|
|
44
|
+
error.status = status;
|
|
45
|
+
return error;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Host-only actor gate: anything else is a model/subagent direct write. */
|
|
49
|
+
export function assertHostWrite(actorKind) {
|
|
50
|
+
const actor = String(actorKind ?? 'host');
|
|
51
|
+
if (!HOST_ACTORS.includes(actor)) {
|
|
52
|
+
throw writeError(WRITE_CODES.WRITE_DENY, `模型/子脑不可直写宿主私有数据(actor=${actor});请走宿主写路径。`);
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function hostKeyPath(memoryRoot) {
|
|
58
|
+
return path.join(path.resolve(String(memoryRoot ?? '')), '.longlive', HOST_KEY_FILE);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Read the persisted host key file, or null when absent. */
|
|
62
|
+
export function readHostKeyFile(memoryRoot) {
|
|
63
|
+
try {
|
|
64
|
+
const text = fs.readFileSync(hostKeyPath(memoryRoot), 'utf8').trim();
|
|
65
|
+
return text === '' ? null : text;
|
|
66
|
+
} catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Host-injected key from the environment (never written to disk by this module). */
|
|
72
|
+
export function readHostKeyEnv(env = process.env) {
|
|
73
|
+
const value = env?.[AUDIT_KEY_ENV];
|
|
74
|
+
return typeof value === 'string' && value.trim() !== '' ? value.trim() : null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Resolve a key for read verification without creating anything:
|
|
79
|
+
* host-injected env/auditKey first, then the persisted fallback file.
|
|
80
|
+
* Missing everything => null (callers fail closed).
|
|
81
|
+
*/
|
|
82
|
+
export function readHostKey(memoryRoot, { auditKey = null, env = process.env } = {}) {
|
|
83
|
+
const envKey = readHostKeyEnv(env);
|
|
84
|
+
if (envKey !== null) return envKey;
|
|
85
|
+
if (Buffer.isBuffer(auditKey) || typeof auditKey === 'string') {
|
|
86
|
+
const key = Buffer.isBuffer(auditKey) ? auditKey.toString('hex') : String(auditKey);
|
|
87
|
+
if (key.trim() !== '') return key.trim();
|
|
88
|
+
}
|
|
89
|
+
return readHostKeyFile(memoryRoot);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Keys a read path may verify against: host env key, injected auditKey, then
|
|
94
|
+
* the persisted fallback key file. Writers seal with the first available key.
|
|
95
|
+
*/
|
|
96
|
+
export function hostKeyCandidates(memoryRoot, { auditKey = null, env = process.env } = {}) {
|
|
97
|
+
const candidates = [];
|
|
98
|
+
const envKey = readHostKeyEnv(env);
|
|
99
|
+
if (envKey !== null) candidates.push(envKey);
|
|
100
|
+
if (Buffer.isBuffer(auditKey) || typeof auditKey === 'string') {
|
|
101
|
+
const key = Buffer.isBuffer(auditKey) ? auditKey.toString('hex') : String(auditKey);
|
|
102
|
+
if (key.trim() !== '' && !candidates.includes(key.trim())) candidates.push(key.trim());
|
|
103
|
+
}
|
|
104
|
+
const fileKey = readHostKeyFile(memoryRoot);
|
|
105
|
+
if (fileKey !== null && !candidates.includes(fileKey)) candidates.push(fileKey);
|
|
106
|
+
return candidates;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Resolve the host write key: env DSH_LONGLIVE_AUDIT_KEY > injected auditKey >
|
|
111
|
+
* persisted fallback `<memoryRoot>/.longlive/.hostkey` (created on first use).
|
|
112
|
+
*/
|
|
113
|
+
export function resolveHostKey(memoryRoot, { auditKey = null, env = process.env } = {}) {
|
|
114
|
+
const envKey = readHostKeyEnv(env);
|
|
115
|
+
if (envKey !== null) return envKey;
|
|
116
|
+
if (Buffer.isBuffer(auditKey) || typeof auditKey === 'string') {
|
|
117
|
+
const key = Buffer.isBuffer(auditKey) ? auditKey.toString('hex') : String(auditKey);
|
|
118
|
+
if (key.trim() !== '') return key;
|
|
119
|
+
}
|
|
120
|
+
const file = hostKeyPath(memoryRoot);
|
|
121
|
+
try {
|
|
122
|
+
const text = fs.readFileSync(file, 'utf8').trim();
|
|
123
|
+
if (text !== '') return text;
|
|
124
|
+
} catch {
|
|
125
|
+
/* create below */
|
|
126
|
+
}
|
|
127
|
+
const key = crypto.randomBytes(32).toString('hex');
|
|
128
|
+
const dir = path.dirname(file);
|
|
129
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
130
|
+
const tmp = `${file}.tmp-${process.pid}-${crypto.randomBytes(3).toString('hex')}`;
|
|
131
|
+
fs.writeFileSync(tmp, `${key}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
132
|
+
fs.renameSync(tmp, file);
|
|
133
|
+
try { fs.chmodSync(file, 0o600); } catch { /* windows best effort */ }
|
|
134
|
+
return key;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function hmacFor(key, text) {
|
|
138
|
+
return crypto.createHmac('sha256', key).update(String(text ?? ''), 'utf8').digest('hex');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function sidecarPath(file) {
|
|
142
|
+
return `${file}${SIDECAR_SUFFIX}`;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function writeAtomicRaw(file, text) {
|
|
146
|
+
const dir = path.dirname(file);
|
|
147
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
148
|
+
const tmp = path.join(dir, `.${path.basename(file)}.${process.pid}.${crypto.randomBytes(4).toString('hex')}.tmp`);
|
|
149
|
+
const fd = fs.openSync(tmp, 'w');
|
|
150
|
+
try {
|
|
151
|
+
fs.writeFileSync(fd, text, 'utf8');
|
|
152
|
+
fs.fsyncSync(fd);
|
|
153
|
+
} finally {
|
|
154
|
+
fs.closeSync(fd);
|
|
155
|
+
}
|
|
156
|
+
fs.renameSync(tmp, file);
|
|
157
|
+
const readBack = fs.readFileSync(file, 'utf8');
|
|
158
|
+
if (readBack !== text) throw writeError(WRITE_CODES.TAMPER, `写后读回不一致:${file}`, 500);
|
|
159
|
+
return { ok: true, bytes: Buffer.byteLength(text, 'utf8'), sha256: crypto.createHash('sha256').update(text).digest('hex') };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Host-only protected write: atomic file + HMAC sidecar over the exact bytes.
|
|
164
|
+
* Refuses model/subagent actors and paths outside the memory root.
|
|
165
|
+
*/
|
|
166
|
+
export function writeProtectedFile({ memoryRoot, file, text, auditKey = null, actorKind = 'host' }) {
|
|
167
|
+
assertHostWrite(actorKind);
|
|
168
|
+
const root = path.resolve(String(memoryRoot ?? ''));
|
|
169
|
+
if (!isInsideRoot(root, path.resolve(file))) {
|
|
170
|
+
throw memoryError(ROLE_CODES.PATH_OUTSIDE_ROOT, `写保护路径越界:${file}`);
|
|
171
|
+
}
|
|
172
|
+
const key = resolveHostKey(root, { auditKey });
|
|
173
|
+
const written = writeAtomicRaw(file, text);
|
|
174
|
+
const hmac = hmacFor(key, text);
|
|
175
|
+
writeAtomicRaw(sidecarPath(file), `${JSON.stringify({
|
|
176
|
+
schema: WRITEPROTECT_SCHEMA,
|
|
177
|
+
alg: 'HMAC-SHA256',
|
|
178
|
+
file: path.basename(file),
|
|
179
|
+
bytes: written.bytes,
|
|
180
|
+
sha256: written.sha256,
|
|
181
|
+
hmac,
|
|
182
|
+
sealedAt: iso(Date.now()),
|
|
183
|
+
}, null, 2)}\n`);
|
|
184
|
+
return { ok: true, file, bytes: written.bytes, sha256: written.sha256, hmac };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Host-only protected JSON write. */
|
|
188
|
+
export function writeProtectedJson({ memoryRoot, file, value, auditKey = null, actorKind = 'host' }) {
|
|
189
|
+
return writeProtectedFile({
|
|
190
|
+
memoryRoot,
|
|
191
|
+
file,
|
|
192
|
+
text: `${JSON.stringify(value, null, 2)}\n`,
|
|
193
|
+
auditKey,
|
|
194
|
+
actorKind,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Host-only protected JSONL append: append + re-seal the whole file sidecar. */
|
|
199
|
+
export function appendProtectedJsonl({ memoryRoot, file, row, auditKey = null, actorKind = 'host' }) {
|
|
200
|
+
assertHostWrite(actorKind);
|
|
201
|
+
const root = path.resolve(String(memoryRoot ?? ''));
|
|
202
|
+
if (!isInsideRoot(root, path.resolve(file))) {
|
|
203
|
+
throw memoryError(ROLE_CODES.PATH_OUTSIDE_ROOT, `写保护路径越界:${file}`);
|
|
204
|
+
}
|
|
205
|
+
const key = resolveHostKey(root, { auditKey });
|
|
206
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
207
|
+
const line = `${JSON.stringify(row)}\n`;
|
|
208
|
+
const fd = fs.openSync(file, 'a');
|
|
209
|
+
try {
|
|
210
|
+
fs.writeFileSync(fd, line, 'utf8');
|
|
211
|
+
try { fs.fsyncSync(fd); } catch { /* append fsync best effort */ }
|
|
212
|
+
} finally {
|
|
213
|
+
fs.closeSync(fd);
|
|
214
|
+
}
|
|
215
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
216
|
+
const hmac = hmacFor(key, text);
|
|
217
|
+
writeAtomicRaw(sidecarPath(file), `${JSON.stringify({
|
|
218
|
+
schema: WRITEPROTECT_SCHEMA,
|
|
219
|
+
alg: 'HMAC-SHA256',
|
|
220
|
+
file: path.basename(file),
|
|
221
|
+
bytes: Buffer.byteLength(text, 'utf8'),
|
|
222
|
+
hmac,
|
|
223
|
+
sealedAt: iso(Date.now()),
|
|
224
|
+
}, null, 2)}\n`);
|
|
225
|
+
return { ok: true, file, bytes: Buffer.byteLength(line, 'utf8'), hmac };
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Verify one file against its sidecar. Returns {ok, code, tampered}.
|
|
230
|
+
* Missing sidecar on a missing file = clean absence; missing sidecar on an
|
|
231
|
+
* existing file = `E_SIDECAR_INVALID` (unprotected content must not load).
|
|
232
|
+
*/
|
|
233
|
+
export function verifyProtectedFile({ memoryRoot, file, auditKey = null }) {
|
|
234
|
+
const root = path.resolve(String(memoryRoot ?? ''));
|
|
235
|
+
let text;
|
|
236
|
+
try {
|
|
237
|
+
text = fs.readFileSync(file, 'utf8');
|
|
238
|
+
} catch (error) {
|
|
239
|
+
if (error?.code === 'ENOENT') return { ok: true, absent: true, tampered: false };
|
|
240
|
+
return { ok: false, absent: false, tampered: true, code: WRITE_CODES.TAMPER, error: error?.code ?? 'EREAD' };
|
|
241
|
+
}
|
|
242
|
+
let sidecar;
|
|
243
|
+
try {
|
|
244
|
+
sidecar = JSON.parse(fs.readFileSync(sidecarPath(file), 'utf8'));
|
|
245
|
+
} catch {
|
|
246
|
+
return {
|
|
247
|
+
ok: false, absent: false, tampered: true, code: WRITE_CODES.SIDECAR,
|
|
248
|
+
message: `缺少/不可读 HMAC 侧车:${sidecarPath(file)}(拒绝加载未受保护的宿主私有内容)`,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
const candidates = hostKeyCandidates(root, { auditKey });
|
|
252
|
+
// 读路径不创建 key 文件:没有可用 key 时 fail-safe 按 tampered 处理。
|
|
253
|
+
const matched = typeof sidecar?.hmac === 'string'
|
|
254
|
+
&& candidates.some((key) => hmacFor(key, text) === sidecar.hmac);
|
|
255
|
+
if (!matched) {
|
|
256
|
+
return { ok: false, absent: false, tampered: true, code: WRITE_CODES.TAMPER, message: 'HMAC 校验失败(文件被篡改或侧车不匹配)' };
|
|
257
|
+
}
|
|
258
|
+
return { ok: true, absent: false, tampered: false, text, sha256: sidecar.sha256 ?? null };
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Read + verify protected JSON, parsing on success. */
|
|
262
|
+
export function readProtectedJsonValue({ memoryRoot, file, auditKey = null }) {
|
|
263
|
+
const verify = verifyProtectedFile({ memoryRoot, file, auditKey });
|
|
264
|
+
if (!verify.ok) return { ok: false, absent: verify.absent === true, code: verify.code, tampered: true, message: verify.message };
|
|
265
|
+
if (verify.absent) return { ok: true, absent: true, value: null };
|
|
266
|
+
try {
|
|
267
|
+
return { ok: true, absent: false, value: JSON.parse(verify.text) };
|
|
268
|
+
} catch {
|
|
269
|
+
return { ok: false, absent: false, code: WRITE_CODES.TAMPER, tampered: true, message: '受保护文件 JSON 解析失败' };
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Read + verify protected JSONL. */
|
|
274
|
+
export function readProtectedJsonl({ memoryRoot, file, auditKey = null, limit = 10_000 }) {
|
|
275
|
+
const verify = verifyProtectedFile({ memoryRoot, file, auditKey });
|
|
276
|
+
if (!verify.ok) return { ok: false, absent: verify.absent === true, code: verify.code, tampered: true, rows: [], bad: 0, message: verify.message };
|
|
277
|
+
if (verify.absent) return { ok: true, absent: true, rows: [], bad: 0, total: 0 };
|
|
278
|
+
const rows = [];
|
|
279
|
+
let bad = 0;
|
|
280
|
+
for (const line of verify.text.split(/\r?\n/)) {
|
|
281
|
+
if (line.trim() === '') continue;
|
|
282
|
+
try {
|
|
283
|
+
const parsed = JSON.parse(line);
|
|
284
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) rows.push(parsed);
|
|
285
|
+
else bad += 1;
|
|
286
|
+
} catch {
|
|
287
|
+
bad += 1;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return { ok: true, absent: false, rows: rows.slice(-limit), total: rows.length, bad };
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Serialize a value to the canonical text used by the sidecar. */
|
|
294
|
+
export function protectedJsonText(value) {
|
|
295
|
+
return `${JSON.stringify(value, null, 2)}\n`;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ------------------------------------------------------------------ 四元边界
|
|
299
|
+
//
|
|
300
|
+
// §16.8 E:sessionId/userId/projectId/readers[]。private 帧或 readers 不含调用者
|
|
301
|
+
// 时,跨用户读取被拒(host/panel 例外——它们持能力令牌)。
|
|
302
|
+
|
|
303
|
+
/** Normalize one subject (missing fields are null, readers is a string array). */
|
|
304
|
+
export function normalizeRoleSubject(raw = {}) {
|
|
305
|
+
const value = raw && typeof raw === 'object' ? raw : {};
|
|
306
|
+
const readers = Array.isArray(value.readers)
|
|
307
|
+
? [...new Set(value.readers.filter((item) => typeof item === 'string' && item.trim() !== '').map((item) => item.trim()))]
|
|
308
|
+
: [];
|
|
309
|
+
const field = (name) => (typeof value[name] === 'string' && value[name].trim() !== '' ? value[name].trim() : null);
|
|
310
|
+
const subject = {
|
|
311
|
+
sessionId: field('sessionId'),
|
|
312
|
+
userId: field('userId'),
|
|
313
|
+
projectId: field('projectId'),
|
|
314
|
+
readers,
|
|
315
|
+
};
|
|
316
|
+
if (value.private === true) subject.private = true;
|
|
317
|
+
return subject;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** True when the caller may read this subject's data. Host/panel always may. */
|
|
321
|
+
export function isSubjectReadable(subject, caller = {}) {
|
|
322
|
+
const actorKind = String(caller?.actorKind ?? 'host');
|
|
323
|
+
if (HOST_ACTORS.includes(actorKind)) return { ok: true, reason: 'host' };
|
|
324
|
+
const norm = normalizeRoleSubject(subject ?? {});
|
|
325
|
+
const userId = typeof caller?.userId === 'string' && caller.userId.trim() !== '' ? caller.userId.trim() : null;
|
|
326
|
+
if (norm.private === true && userId === null) return { ok: false, code: WRITE_CODES.FRAME_PRIVATE, reason: 'private' };
|
|
327
|
+
if (norm.readers.length > 0) {
|
|
328
|
+
if (userId !== null && norm.readers.includes(userId)) return { ok: true, reason: 'reader' };
|
|
329
|
+
return { ok: false, code: WRITE_CODES.ACCESS_DENIED, reason: 'readers' };
|
|
330
|
+
}
|
|
331
|
+
// No explicit reader list: the subject owner is the only non-host reader.
|
|
332
|
+
if (norm.userId !== null && userId !== norm.userId) {
|
|
333
|
+
return { ok: false, code: WRITE_CODES.ACCESS_DENIED, reason: 'owner-only' };
|
|
334
|
+
}
|
|
335
|
+
if (norm.userId !== null && userId === null) {
|
|
336
|
+
return { ok: false, code: WRITE_CODES.ACCESS_DENIED, reason: 'owner-only' };
|
|
337
|
+
}
|
|
338
|
+
return { ok: true, reason: 'open' };
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/** Throwing variant used by read paths that must fail closed. */
|
|
342
|
+
export function assertSubjectReadable(subject, caller = {}) {
|
|
343
|
+
const verdict = isSubjectReadable(subject, caller);
|
|
344
|
+
if (!verdict.ok) {
|
|
345
|
+
throw writeError(verdict.code, `跨用户读取被拒(${verdict.reason}):subject=${JSON.stringify(normalizeRoleSubject(subject ?? {}))}`, 403);
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/** Frame-specific: `private` frames without a matching reader → E_FRAME_PRIVATE. */
|
|
351
|
+
export function assertFrameReadable(frame, caller = {}) {
|
|
352
|
+
const subject = normalizeRoleSubject(frame?.subject ?? { sessionId: frame?.sessionId ?? null });
|
|
353
|
+
const verdict = isSubjectReadable(subject, caller);
|
|
354
|
+
if (!verdict.ok && (verdict.code === WRITE_CODES.FRAME_PRIVATE || subject.private === true)) {
|
|
355
|
+
throw writeError(WRITE_CODES.FRAME_PRIVATE, `私密帧拒绝读取(sessionId=${subject.sessionId ?? '?'},caller=${caller?.userId ?? '?'})`, 403);
|
|
356
|
+
}
|
|
357
|
+
if (!verdict.ok) {
|
|
358
|
+
throw writeError(WRITE_CODES.ACCESS_DENIED, `跨用户帧读取被拒(${verdict.reason})`, 403);
|
|
359
|
+
}
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** Fill the four-element subject for a frame/frame-like record (host write). */
|
|
364
|
+
export function attachFrameSubject(frame, { subject = {}, readers = [], userId = null, projectId = null } = {}) {
|
|
365
|
+
const merged = normalizeRoleSubject({
|
|
366
|
+
sessionId: subject.sessionId ?? frame?.sessionId ?? null,
|
|
367
|
+
userId: subject.userId ?? userId,
|
|
368
|
+
projectId: subject.projectId ?? projectId,
|
|
369
|
+
readers: Array.isArray(subject.readers) ? subject.readers : readers,
|
|
370
|
+
private: subject.private === true || frame?.private === true,
|
|
371
|
+
});
|
|
372
|
+
return { ...frame, subject: merged };
|
|
373
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"description": "动作名归一表:canonical 用设计文档的点号写法,legacy 是 0.8.0-rc.1 之前的旧名。judge 一律用 canonical 比对;输出同时保留 legacy 作为兼容别名,旧调用方不用改。",
|
|
4
|
+
"actions": [
|
|
5
|
+
{
|
|
6
|
+
"canonical": "acp_status",
|
|
7
|
+
"legacy": "acp_status",
|
|
8
|
+
"aliases": [
|
|
9
|
+
"acp_status",
|
|
10
|
+
"context.status",
|
|
11
|
+
"acp.status"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"canonical": "read",
|
|
16
|
+
"legacy": "read",
|
|
17
|
+
"aliases": [
|
|
18
|
+
"read",
|
|
19
|
+
"file.read"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"canonical": "grep",
|
|
24
|
+
"legacy": "grep",
|
|
25
|
+
"aliases": [
|
|
26
|
+
"grep",
|
|
27
|
+
"file.grep"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"canonical": "worker_spawn",
|
|
32
|
+
"legacy": "worker_spawn",
|
|
33
|
+
"aliases": [
|
|
34
|
+
"worker_spawn",
|
|
35
|
+
"worker.spawn",
|
|
36
|
+
"workflow"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"canonical": "worker_status",
|
|
41
|
+
"legacy": "worker_status",
|
|
42
|
+
"aliases": [
|
|
43
|
+
"worker_status",
|
|
44
|
+
"worker.status"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"canonical": "guard.refuse",
|
|
49
|
+
"legacy": "guard.refuse",
|
|
50
|
+
"aliases": [
|
|
51
|
+
"guard.refuse",
|
|
52
|
+
"refuse",
|
|
53
|
+
"guard_refuse"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"canonical": "guard.dryRun",
|
|
58
|
+
"legacy": "guard_dry_run",
|
|
59
|
+
"aliases": [
|
|
60
|
+
"guard.dryRun",
|
|
61
|
+
"guard_dry_run",
|
|
62
|
+
"dry_run",
|
|
63
|
+
"dry-run"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"canonical": "journal.append",
|
|
68
|
+
"legacy": "journal.append",
|
|
69
|
+
"aliases": [
|
|
70
|
+
"journal.append",
|
|
71
|
+
"journal_append"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"canonical": "procedures.draft",
|
|
76
|
+
"legacy": "procedures.draft",
|
|
77
|
+
"aliases": [
|
|
78
|
+
"procedures.draft",
|
|
79
|
+
"procedures_draft",
|
|
80
|
+
"memory_procedure"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"canonical": "topics.write",
|
|
85
|
+
"legacy": "topics.write",
|
|
86
|
+
"aliases": [
|
|
87
|
+
"topics.write",
|
|
88
|
+
"topics_write",
|
|
89
|
+
"topics.write_card"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"canonical": "taskboard.update",
|
|
94
|
+
"legacy": "taskboard.update",
|
|
95
|
+
"aliases": [
|
|
96
|
+
"taskboard.update",
|
|
97
|
+
"taskboard_update"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"canonical": "session.handover",
|
|
102
|
+
"legacy": "session_handover",
|
|
103
|
+
"aliases": [
|
|
104
|
+
"session_handover",
|
|
105
|
+
"session.handover",
|
|
106
|
+
"handover"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"canonical": "session.compact",
|
|
111
|
+
"legacy": "session_compact",
|
|
112
|
+
"aliases": [
|
|
113
|
+
"session_compact",
|
|
114
|
+
"session.compact",
|
|
115
|
+
"compress"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"canonical": "reply.only",
|
|
120
|
+
"legacy": "reply.only",
|
|
121
|
+
"aliases": [
|
|
122
|
+
"reply.only",
|
|
123
|
+
"reply_only",
|
|
124
|
+
"chat"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"canonical": "reply.no_write",
|
|
129
|
+
"legacy": "reply.no_write",
|
|
130
|
+
"aliases": [
|
|
131
|
+
"reply.no_write",
|
|
132
|
+
"reply_no_write",
|
|
133
|
+
"no_write"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"canonical": "reply.ask",
|
|
138
|
+
"legacy": "reply_ask",
|
|
139
|
+
"aliases": [
|
|
140
|
+
"reply.ask",
|
|
141
|
+
"reply_ask",
|
|
142
|
+
"ask_user"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"canonical": "memory.distillPropose",
|
|
147
|
+
"legacy": "memory_distill_propose",
|
|
148
|
+
"aliases": [
|
|
149
|
+
"memory.distillPropose",
|
|
150
|
+
"memory_distill_propose",
|
|
151
|
+
"propose_distill"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"canonical": "memory.delete",
|
|
156
|
+
"legacy": "memory_delete",
|
|
157
|
+
"aliases": [
|
|
158
|
+
"memory.delete",
|
|
159
|
+
"memory_delete",
|
|
160
|
+
"forget_memory"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"canonical": "identity.hold",
|
|
165
|
+
"legacy": "identity_hold",
|
|
166
|
+
"aliases": [
|
|
167
|
+
"identity.hold",
|
|
168
|
+
"identity_hold",
|
|
169
|
+
"identity_consent_hold"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"canonical": "memory.save_local",
|
|
174
|
+
"legacy": "memory_save_local",
|
|
175
|
+
"aliases": [
|
|
176
|
+
"memory.save_local",
|
|
177
|
+
"memory_save_local",
|
|
178
|
+
"save_local"
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|