evolcore 0.0.41-test.0 → 0.0.41-test.2
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 +62 -0
- package/dist/agents/baseagent-availability.js +1 -1
- package/dist/agents/baseagent.js +88 -49
- package/dist/agents/claude-runner.js +177 -92
- package/dist/agents/codex-runner.js +146 -71
- package/dist/agents/ecagent-runner.js +1 -1
- package/dist/agents/gemini-runner.js +1 -1
- package/dist/aun/aid/agentmd.js +98 -11
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/aid/control-aid.js +26 -2
- package/dist/aun/aid/identity.js +91 -0
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/aid/managed-operation.js +1 -1
- package/dist/aun/aid/ownership-operation.js +23 -22
- package/dist/aun/group/fs-download.js +39 -0
- package/dist/aun/group/identity.js +36 -21
- package/dist/aun/group/operations.js +5 -0
- package/dist/aun/menu/client.js +27 -0
- package/dist/aun/msg/managed-operation.js +68 -7
- package/dist/aun/msg/p2p.js +8 -8
- package/dist/aun/service-proxy.js +53 -12
- package/dist/channels/aun.js +633 -32
- package/dist/channels/daemon.js +15 -1
- package/dist/cli/agent-command.js +5 -2
- package/dist/cli/agent-create.js +991 -233
- package/dist/cli/agent.js +49 -10
- package/dist/cli/aid-bind-command.js +48 -19
- package/dist/cli/aun-commands.js +48 -36
- package/dist/cli/daemon-commands.js +679 -697
- package/dist/cli/fs-command.js +64 -2
- package/dist/cli/index.js +72 -5
- package/dist/cli/init-channel.js +1 -1
- package/dist/cli/init.js +75 -1
- package/dist/cli/managed-command-guard.js +17 -1
- package/dist/cli/model.js +40 -40
- package/dist/cli/provider-command.js +57 -0
- package/dist/cli/proxy-command.js +92 -0
- package/dist/cli/restart-monitor.js +4 -2
- package/dist/cli/role.js +85 -0
- package/dist/cli/stats.js +10 -3
- package/dist/cli/task-context.js +19 -0
- package/dist/config/access-policy.js +7 -2
- package/dist/config/boot-log.js +39 -1
- package/dist/config/config-field-policy.js +17 -39
- package/dist/config/config-manager.js +183 -44
- package/dist/config/config-operation-service.js +5 -19
- package/dist/config/contact-book-store.js +47 -21
- package/dist/config/contact-book.js +18 -12
- package/dist/config/contact-operation-service.js +3 -4
- package/dist/config/contact-request-service.js +11 -0
- package/dist/config/daemon-services.js +11 -0
- package/dist/config/gateway-config.js +88 -594
- package/dist/config/owner-config.js +2 -2
- package/dist/config/peer-role-resolver.js +15 -12
- package/dist/config/provider-ipc-service.js +132 -0
- package/dist/config/provider-menu-request.js +58 -0
- package/dist/config/providers-config.js +12 -7
- package/dist/config/providers-import.js +3 -21
- package/dist/config/providers-management.js +78 -5
- package/dist/config/resolved-config-op.js +11 -1
- package/dist/config/role-command-service.js +166 -0
- package/dist/config/role-request-service.js +193 -0
- package/dist/config/schema-migration.js +1000 -25
- package/dist/config-store.js +89 -4
- package/dist/contracts/ecweb-instance.js +41 -0
- package/dist/contracts/ecweb-service-protocol.js +4 -1
- package/dist/core/agent-application-service.js +60 -11
- package/dist/core/agent-create-status.js +203 -0
- package/dist/core/agent-creation-claim.js +177 -0
- package/dist/core/agent-ipc-registration.js +39 -18
- package/dist/core/agent-runtime.js +194 -24
- package/dist/core/auth/agent-delegation.js +6 -3
- package/dist/core/auth/auth-gateway.js +67 -2
- package/dist/core/auth/authorization-audit.js +58 -11
- package/dist/core/auth/delegation-authorization.js +5 -2
- package/dist/core/auth/operation-authorizer.js +43 -6
- package/dist/core/auth/operation-catalog.js +45 -7
- package/dist/core/channel-loader.js +2 -0
- package/dist/core/command/agent-control.js +260 -21
- package/dist/core/command/agent-storage-menu.js +5 -3
- package/dist/core/command/cli-intent-parser.js +8 -3
- package/dist/core/command/command-handler.js +112 -154
- package/dist/core/command/connect-menu.js +11 -3
- package/dist/core/command/data-root-resolver.js +5 -4
- package/dist/core/command/memory-slash.js +16 -8
- package/dist/core/command/menu-catalog.js +10 -6
- package/dist/core/command/menu-handler.js +106 -73
- package/dist/core/command/menu-protocol.js +15 -1
- package/dist/core/command/provider-menu.js +46 -0
- package/dist/core/command/role-menu.js +147 -30
- package/dist/core/command/slash-handler.js +125 -255
- package/dist/core/daemon-control.js +26 -27
- package/dist/core/event-catalog.js +10 -0
- package/dist/core/evolagent-registry.js +7 -5
- package/dist/core/evolagent.js +10 -8
- package/dist/core/file-integrity/store.js +11 -0
- package/dist/core/handoff/ipc-registration.js +3 -0
- package/dist/core/inference/text-inference.js +31 -40
- package/dist/core/initialization/service.js +491 -0
- package/dist/core/ipc-registration.js +40 -24
- package/dist/core/memory/consolidation-context.js +51 -5
- package/dist/core/memory/consolidation-ops-records.js +96 -1
- package/dist/core/memory/consolidation-trigger.js +208 -191
- package/dist/core/memory/consolidation.js +333 -35
- package/dist/core/memory/index-manager.js +27 -5
- package/dist/core/memory/memory-admin.js +45 -5
- package/dist/core/memory/memory-writer.js +163 -18
- package/dist/core/memory/relation-idle-monitor.js +119 -58
- package/dist/core/memory/relation-sweep.js +55 -45
- package/dist/core/message/aun-ipc-sender.js +81 -69
- package/dist/core/message/im-renderer.js +25 -4
- package/dist/core/message/message-admission.js +89 -4
- package/dist/core/message/message-bridge.js +66 -21
- package/dist/core/message/response-engine.js +108 -35
- package/dist/core/model/catalog-service.js +5 -3
- package/dist/core/model/config-scope.js +29 -71
- package/dist/core/model/field-scope.js +1 -1
- package/dist/core/model/model-catalog.js +30 -41
- package/dist/core/model/model-diagnostics.js +4 -3
- package/dist/core/model/model-fallback.js +10 -7
- package/dist/core/model/model-permission.js +3 -2
- package/dist/core/ownership/owner-resolver.js +772 -158
- package/dist/core/permission/approval-gateway.js +103 -403
- package/dist/core/permission/ec-command-parser.js +62 -6
- package/dist/core/permission/index.js +1 -0
- package/dist/core/permission/permission-result.js +78 -0
- package/dist/core/permission/sandbox-runtime.js +18 -1
- package/dist/core/permission/tool-policy.js +21 -46
- package/dist/core/relation/peer-identity.js +64 -1
- package/dist/core/role/runtime-policy.js +72 -13
- package/dist/core/session/session-capsule.js +1 -1
- package/dist/core/session/session-idle-monitor.js +1 -1
- package/dist/core/session/session-manager.js +20 -0
- package/dist/core/session/session-renew.js +3 -3
- package/dist/core/skill/index-generator.js +15 -5
- package/dist/core/system-session/memory.js +43 -8
- package/dist/core/thread/thread-service.js +19 -6
- package/dist/directory/owner-directory-admission.js +95 -0
- package/dist/directory/owner-directory-authorization.js +309 -0
- package/dist/directory/owner-directory-cache.js +635 -0
- package/dist/eck/kit-renderer.js +2 -2
- package/dist/ecweb/basic-settings-service.js +33 -40
- package/dist/ecweb/init-menu.js +32 -0
- package/dist/ecweb/message-context-service.js +110 -0
- package/dist/index.js +93 -19
- package/dist/ipc.js +247 -29
- package/dist/paths.js +7 -0
- package/dist/proxy/command.js +122 -0
- package/dist/proxy/ipc-service.js +68 -0
- package/dist/proxy/manager.js +484 -0
- package/dist/proxy/service-supervisor.js +603 -0
- package/dist/response-system/engines/v1/proactive-flow.js +16 -6
- package/dist/trigger/authorization.js +27 -17
- package/dist/trigger/feedback.js +2 -3
- package/dist/trigger/ipc-service.js +105 -78
- package/dist/trigger/local-files.js +2 -1
- package/dist/trigger/manager.js +5 -3
- package/dist/trigger/scheduler.js +88 -6
- package/dist/utils/atomic-write.js +28 -0
- package/dist/utils/cross-platform.js +14 -0
- package/dist/utils/ecweb-supervisor.js +258 -83
- package/dist/utils/error-utils.js +26 -2
- package/dist/utils/logger.js +92 -6
- package/dist/utils/package-version-info.js +4 -2
- package/dist/utils/welcome.js +1 -1
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/aun/SDK.md +4 -1
- package/kits/docs/channels/aun.md +9 -0
- package/kits/docs/evolcore/INDEX.md +1 -0
- package/kits/docs/evolcore/agent.md +8 -1
- package/kits/docs/evolcore/aid.md +67 -17
- package/kits/docs/evolcore/config.md +28 -7
- package/kits/docs/evolcore/contact.md +3 -0
- package/kits/docs/evolcore/fs.md +11 -0
- package/kits/docs/evolcore/group.md +1 -1
- package/kits/docs/evolcore/memory-architecture.md +2 -2
- package/kits/docs/evolcore/memory-consolidation.md +32 -8
- package/kits/docs/evolcore/memory.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +4 -0
- package/kits/docs/evolcore/model.md +23 -20
- package/kits/docs/evolcore/msg.md +4 -7
- package/kits/docs/evolcore/provider.md +50 -0
- package/kits/docs/identity/AID_PROFILE_SPEC.md +52 -17
- package/kits/migrations/migrate-contact-book-v2.mjs +30 -11
- package/kits/rules/01-overview.md +3 -0
- package/kits/rules/04-relation.md +1 -1
- package/kits/schemas/_meta.json +37 -4
- package/kits/schemas/agent-config.schema.13.json +8 -3
- package/kits/schemas/agent-config.schema.16.json +891 -0
- package/kits/schemas/daemon.schema.9.json +366 -0
- package/kits/schemas/defaults.schema.5.json +406 -127
- package/kits/schemas/relation-config.schema.11.json +277 -0
- package/kits/schemas/role-config.schema.1.json +7 -7
- package/kits/skills/.switches.json +4 -0
- package/kits/skills/ec-agent-create/SKILL.md +3 -0
- package/kits/skills/ec-identity/SKILL.md +2 -2
- package/kits/skills/ec-service-proxy/SKILL.md +118 -0
- package/kits/skills/ec-skill/scripts/skill.mjs +6 -0
- package/kits/skills/personal-assistant/SKILL.md +176 -0
- package/kits/skills/personal-assistant/references/01-workspace-spec.md +333 -0
- package/kits/skills/personal-assistant/references/02-bootstrap.md +205 -0
- package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +177 -0
- package/kits/skills/personal-assistant/references/04-frontend-contract.md +439 -0
- package/kits/skills/personal-assistant/references/05-directory-reference.md +292 -0
- package/kits/skills/personal-assistant/references/06-render-config.md +350 -0
- package/kits/skills/personal-assistant/schema/workspace.schema.json +85 -0
- package/kits/skills/personal-assistant/schema/workspace.v1.json +66 -0
- package/kits/skills/personal-assistant/scripts/archive.mjs +154 -0
- package/kits/skills/personal-assistant/scripts/check.mjs +114 -0
- package/kits/skills/personal-assistant/scripts/index-rebuild.mjs +252 -0
- package/kits/skills/personal-assistant/scripts/ingest.mjs +344 -0
- package/kits/skills/personal-assistant/scripts/init.mjs +270 -0
- package/kits/skills/personal-assistant/scripts/lib/apply.mjs +92 -0
- package/kits/skills/personal-assistant/scripts/lib/schema.mjs +96 -0
- package/kits/skills/personal-assistant/scripts/lib/time.mjs +28 -0
- package/kits/skills/personal-assistant/scripts/migrate.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/search.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/verify.mjs +196 -0
- package/kits/skills/personal-assistant/templates/INDEX.md.tpl +24 -0
- package/kits/skills/personal-assistant/templates/README.md.tpl +108 -0
- package/kits/skills/personal-assistant/triggers/ingest-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/memory-consolidate.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-weekly.json +23 -0
- package/kits/skills/thread-ops/SKILL.md +5 -0
- package/kits/templates/memory-consolidation/forget.md +19 -6
- package/kits/templates/memory-consolidation/notes.md +1 -1
- package/kits/templates/memory-consolidation/profile.md +2 -2
- package/kits/templates/memory-consolidation/promote.md +20 -3
- package/kits/templates/roles/member.json +8 -1
- package/kits/templates/system-fragments/baseagent.md +2 -2
- package/kits/templates/system-fragments/memory.md +4 -4
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +7 -3
- package/dist/core/message/create-status.js +0 -96
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* verify.mjs —— 完整性校验
|
|
4
|
+
*
|
|
5
|
+
* 用法:
|
|
6
|
+
* node "<技能目录>/scripts/verify.mjs" --workspace "<路径>" [--frontmatter] [--json]
|
|
7
|
+
*
|
|
8
|
+
* 做三件事:
|
|
9
|
+
* 1. 结构校验:比对 schema,报告 MISSING / EXTRA / DRIFT
|
|
10
|
+
* 2. 清单校验:读 capture/_manifest/*.json,逐项核对 size 与 sha256
|
|
11
|
+
* 3. 格式校验(--frontmatter):检查 md 是否带齐必需字段
|
|
12
|
+
*
|
|
13
|
+
* 只读,不改任何文件。
|
|
14
|
+
* 退出码:0 全部通过 / 10 有警告 / 20 有错误 / 30 前置条件不满足
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
17
|
+
import { join, resolve } from 'node:path';
|
|
18
|
+
import { createHash } from 'node:crypto';
|
|
19
|
+
import { loadSchema, latestVersion, readWorkspaceVersion, readCapabilities, diff } from './lib/schema.mjs';
|
|
20
|
+
|
|
21
|
+
function parseArgs(argv) {
|
|
22
|
+
const out = { json: false, frontmatter: false };
|
|
23
|
+
for (let i = 2; i < argv.length; i++) {
|
|
24
|
+
const a = argv[i];
|
|
25
|
+
if (a === '--workspace' || a === '-w') out.workspace = argv[++i];
|
|
26
|
+
else if (a === '--frontmatter') out.frontmatter = true;
|
|
27
|
+
else if (a === '--json') out.json = true;
|
|
28
|
+
else if (a === '--help' || a === '-h') out.help = true;
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const args = parseArgs(process.argv);
|
|
34
|
+
if (args.help || !args.workspace) {
|
|
35
|
+
console.log(`用法:node verify.mjs --workspace <路径> [--frontmatter] [--json]
|
|
36
|
+
|
|
37
|
+
只读校验:结构 + 落地清单 + frontmatter 完整性。`);
|
|
38
|
+
process.exit(args.help ? 0 : 30);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const workspace = resolve(args.workspace);
|
|
42
|
+
if (!existsSync(workspace)) {
|
|
43
|
+
console.error(`❌ 工作区不存在:${workspace}`);
|
|
44
|
+
process.exit(30);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const errors = [];
|
|
48
|
+
const warnings = [];
|
|
49
|
+
const notes = [];
|
|
50
|
+
|
|
51
|
+
// ── 1. 结构 ─────────────────────────────────────────────────────
|
|
52
|
+
const current = readWorkspaceVersion(workspace);
|
|
53
|
+
const target = latestVersion();
|
|
54
|
+
const schema = loadSchema(current || target);
|
|
55
|
+
const capabilities = readCapabilities(workspace);
|
|
56
|
+
const d = diff(workspace, schema, { capabilities });
|
|
57
|
+
|
|
58
|
+
if (current < target) errors.push(`结构版本落后:v${current || '未初始化'} → v${target},需运行 migrate`);
|
|
59
|
+
if (d.missing.length) errors.push(`缺少 ${d.missing.length} 项(运行 migrate 可补建)`);
|
|
60
|
+
if (d.extra.length) warnings.push(`有 ${d.extra.length} 项不在 schema 定义内(不会自动处理):${d.extra.map(e => e.path).join('、')}`);
|
|
61
|
+
|
|
62
|
+
// ── 2. 清单 ─────────────────────────────────────────────────────
|
|
63
|
+
const manifestDir = join(workspace, 'capture', '_manifest');
|
|
64
|
+
let manifestCount = 0;
|
|
65
|
+
let checkedObjects = 0;
|
|
66
|
+
let manifestBroken = 0;
|
|
67
|
+
|
|
68
|
+
function sha256(file) {
|
|
69
|
+
const h = createHash('sha256');
|
|
70
|
+
h.update(readFileSync(file));
|
|
71
|
+
return h.digest('hex');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (existsSync(manifestDir)) {
|
|
75
|
+
for (const f of readdirSync(manifestDir).filter(n => n.endsWith('.json'))) {
|
|
76
|
+
manifestCount++;
|
|
77
|
+
let m;
|
|
78
|
+
try {
|
|
79
|
+
m = JSON.parse(readFileSync(join(manifestDir, f), 'utf8'));
|
|
80
|
+
} catch (e) {
|
|
81
|
+
errors.push(`${f}:无法解析(${e.message})`);
|
|
82
|
+
manifestBroken++;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
// 清单结构:sources[].items[](ingest 写入);兼容旧式顶层 objects[]
|
|
86
|
+
const objs = Array.isArray(m.objects)
|
|
87
|
+
? m.objects
|
|
88
|
+
: (Array.isArray(m.sources)
|
|
89
|
+
? m.sources.flatMap(s => Array.isArray(s.items) ? s.items : [])
|
|
90
|
+
: []);
|
|
91
|
+
for (const o of objs) {
|
|
92
|
+
checkedObjects++;
|
|
93
|
+
const abs = join(workspace, o.path || '');
|
|
94
|
+
if (!o.path || !existsSync(abs)) {
|
|
95
|
+
errors.push(`${f}:清单里的文件不存在 → ${o.path || '(空路径)'}`);
|
|
96
|
+
manifestBroken++;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const st = statSync(abs);
|
|
100
|
+
if (typeof o.size === 'number' && st.size !== o.size) {
|
|
101
|
+
errors.push(`${f}:大小不符 ${o.path}(清单 ${o.size} / 实际 ${st.size})`);
|
|
102
|
+
manifestBroken++;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (o.sha256) {
|
|
106
|
+
const actual = sha256(abs);
|
|
107
|
+
if (actual !== o.sha256) {
|
|
108
|
+
errors.push(`${f}:摘要不符 ${o.path}`);
|
|
109
|
+
manifestBroken++;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!manifestCount) notes.push('还没有任何落地清单(ingest 尚未运行)');
|
|
117
|
+
|
|
118
|
+
// ── 3. frontmatter ──────────────────────────────────────────────
|
|
119
|
+
let fmChecked = 0;
|
|
120
|
+
const fmBad = [];
|
|
121
|
+
if (args.frontmatter) {
|
|
122
|
+
const required = schema.frontmatter_required || [];
|
|
123
|
+
const walk = (dir, out = []) => {
|
|
124
|
+
if (!existsSync(dir)) return out;
|
|
125
|
+
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
126
|
+
if (e.name.startsWith('_')) continue;
|
|
127
|
+
const abs = join(dir, e.name);
|
|
128
|
+
if (e.isDirectory()) walk(abs, out);
|
|
129
|
+
else if (e.name.endsWith('.md')) out.push(abs);
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
};
|
|
133
|
+
for (const root of ['capture', 'output']) {
|
|
134
|
+
for (const file of walk(join(workspace, root))) {
|
|
135
|
+
fmChecked++;
|
|
136
|
+
let text = '';
|
|
137
|
+
try { text = readFileSync(file, 'utf8'); } catch { continue; }
|
|
138
|
+
if (!text.startsWith('---')) { fmBad.push({ path: file, missing: required }); continue; }
|
|
139
|
+
const end = text.indexOf('\n---', 3);
|
|
140
|
+
const block = end > 0 ? text.slice(3, end) : '';
|
|
141
|
+
const missing = required.filter(k => !new RegExp(`^${k}:`, 'm').test(block));
|
|
142
|
+
if (missing.length) fmBad.push({ path: file, missing });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (fmBad.length) warnings.push(`${fmBad.length} 个文件 frontmatter 不完整`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ── 汇总 ────────────────────────────────────────────────────────
|
|
149
|
+
const exitCode = errors.length ? 20 : (warnings.length ? 10 : 0);
|
|
150
|
+
const rel = p => p.replace(workspace, '').replace(/^[\\/]/, '');
|
|
151
|
+
|
|
152
|
+
if (args.json) {
|
|
153
|
+
console.log(JSON.stringify({
|
|
154
|
+
ok: exitCode === 0,
|
|
155
|
+
workspace,
|
|
156
|
+
structure: { version: current, target, missing: d.missing.length, extra: d.extra.length },
|
|
157
|
+
manifest: { files: manifestCount, objects: checkedObjects, broken: manifestBroken },
|
|
158
|
+
frontmatter: args.frontmatter ? { checked: fmChecked, bad: fmBad.length } : null,
|
|
159
|
+
errors, warnings, notes,
|
|
160
|
+
}, null, 2));
|
|
161
|
+
process.exit(exitCode);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
console.log(`工作区:${workspace}`);
|
|
165
|
+
console.log(`结构:v${current || '未初始化'} / 目标 v${target}`);
|
|
166
|
+
console.log(`清单:${manifestCount} 份,核对 ${checkedObjects} 个对象${manifestBroken ? `,${manifestBroken} 个异常` : ''}`);
|
|
167
|
+
if (args.frontmatter) console.log(`frontmatter:检查 ${fmChecked} 个文件,${fmBad.length} 个不完整`);
|
|
168
|
+
console.log('');
|
|
169
|
+
|
|
170
|
+
if (notes.length) {
|
|
171
|
+
for (const n of notes) console.log(`ℹ️ ${n}`);
|
|
172
|
+
if (notes.length) console.log('');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (warnings.length) {
|
|
176
|
+
console.log('⚠️ 警告:');
|
|
177
|
+
for (const w of warnings) console.log(` · ${w}`);
|
|
178
|
+
console.log('');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (errors.length) {
|
|
182
|
+
console.log('❌ 错误:');
|
|
183
|
+
for (const e of errors.slice(0, 20)) console.log(` · ${e}`);
|
|
184
|
+
if (errors.length > 20) console.log(` …… 还有 ${errors.length - 20} 条`);
|
|
185
|
+
console.log('');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (args.frontmatter && fmBad.length) {
|
|
189
|
+
console.log('缺少字段的文件:');
|
|
190
|
+
for (const b of fmBad.slice(0, 10)) console.log(` · ${rel(b.path)} 缺:${b.missing.join(', ')}`);
|
|
191
|
+
if (fmBad.length > 10) console.log(` …… 还有 ${fmBad.length - 10} 个`);
|
|
192
|
+
console.log('');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
console.log(exitCode === 0 ? '✅ 校验通过' : (exitCode === 10 ? '⚠️ 通过,但有警告' : '❌ 校验未通过'));
|
|
196
|
+
process.exit(exitCode);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# {{workspace_name}} · 总索引
|
|
2
|
+
|
|
3
|
+
> 本文件由 `scripts/index-rebuild.mjs` 从各文件的 frontmatter 自动生成。
|
|
4
|
+
> **不要手工编辑**——下次重建会被覆盖。要加记录,去 `capture/` 或 `output/` 里写文件。
|
|
5
|
+
|
|
6
|
+
- 工作区:`{{workspace_name}}`
|
|
7
|
+
- 结构版本:v{{workspace_version}}
|
|
8
|
+
- 更新时间:{{generated_at}}
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 条目(最新在上)
|
|
13
|
+
|
|
14
|
+
| 日期 | 类型 | 标题 | 标签 | 来源 | 文件 |
|
|
15
|
+
|------|------|------|------|------|------|
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 归档
|
|
20
|
+
|
|
21
|
+
最近三个月之前的条目已移入 `.assistant/index/archive/`,按月份分片。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
*由 `personal-assistant` 技能生成*
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# {{workspace_name}}
|
|
2
|
+
|
|
3
|
+
这是**{{owner_name}}**的个人助理工作区,创建于 {{created_at}}。
|
|
4
|
+
|
|
5
|
+
里面的每一份东西都是纯文本,用任何编辑器、任何搜索工具都能打开。**不依赖任何软件的内部格式。**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 这里有什么
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
{{workspace_name}}/
|
|
13
|
+
├── README.md ← 你正在看的
|
|
14
|
+
├── INDEX.md 全部记录的入口
|
|
15
|
+
├── capture/ 原料:外部给的、系统采集的,只增不改
|
|
16
|
+
├── output/ 产出:我提炼的、生成的报告与长期沉淀
|
|
17
|
+
└── .assistant/ 运行时状态,删了能重建
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### capture/ —— 原料
|
|
21
|
+
|
|
22
|
+
| 目录 | 装什么 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `conversation/` | 对话正文(md 给人看,jsonl 给机器读) |
|
|
25
|
+
| `notes/` | 口述的想法、随笔 |
|
|
26
|
+
| `links/` | 转发的链接与文章(都带摘要) |
|
|
27
|
+
| `files/` | 收到的文件原件 |
|
|
28
|
+
| `scene/` | 看现场:照片引用 + 位置 + 描述 |
|
|
29
|
+
| `listening/` | 非会议的持续聆听 |
|
|
30
|
+
| `meeting/` | 会议原料:转写、参与人 |
|
|
31
|
+
| `track/` | 行为轨迹:位置、应用使用、设备、通讯 |
|
|
32
|
+
| `_manifest/` | 落地清单,证明"没丢" |
|
|
33
|
+
| `_inbox/` | 拿不准放哪的先丢这,48 小时内归位 |
|
|
34
|
+
| `_archive/` | 三个月前的冷数据 |
|
|
35
|
+
|
|
36
|
+
### output/ —— 产出
|
|
37
|
+
|
|
38
|
+
| 目录 | 装什么 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `reports/` | 日 / 周 / 月 / 季 / 年报 |
|
|
41
|
+
| `meetings/` | 会议总结 |
|
|
42
|
+
| `tasks/` | 任务清单:唯一事实源 |
|
|
43
|
+
| `knowledge/` | **长期沉淀,永不归档**:记忆、画像、主题 |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 三条规矩
|
|
48
|
+
|
|
49
|
+
**1. 原料只增不改。** 写错了就再写一条,旧的不动。这样任何时候都能回看"当时是怎么想的"。
|
|
50
|
+
|
|
51
|
+
**2. 结论必须能追溯。** 每份产物、每条记忆都带 `source:`,指向支撑它的原料。没有来源的结论不写。
|
|
52
|
+
|
|
53
|
+
**3. 记忆不遗忘。** 改主意不改老条目,而是写新条目、把老的标 `superseded`。旧版本永久保留。
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 每条记录的格式
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
---
|
|
61
|
+
id: 2026-10-27-1200-标题
|
|
62
|
+
date: 2026-10-27T12:00:00+08:00
|
|
63
|
+
type: note # note | link | scene | meeting | listening | report | task | profile | memory | topic
|
|
64
|
+
tags: [标签]
|
|
65
|
+
source: 自己 # 或来源人、设备、capture/ 下的路径
|
|
66
|
+
---
|
|
67
|
+
正文
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 找东西
|
|
73
|
+
|
|
74
|
+
1. **先翻 `INDEX.md`** —— 最近三个月的全部记录
|
|
75
|
+
2. **按元数据筛** —— 按日期、类型、标签、来源
|
|
76
|
+
3. **全文搜索** —— 直接 grep,兜底
|
|
77
|
+
|
|
78
|
+
索引是脚本生成的,随时能重建,不用担心它过期。
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 维护
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# 体检(只读):看结构对不对
|
|
86
|
+
node "<技能目录>/scripts/check.mjs" --workspace "<本目录>"
|
|
87
|
+
|
|
88
|
+
# 修正:把结构升到当前版本(幂等、只做加法、不删数据)
|
|
89
|
+
node "<技能目录>/scripts/migrate.mjs" --workspace "<本目录>"
|
|
90
|
+
|
|
91
|
+
# 重建索引
|
|
92
|
+
node "<技能目录>/scripts/index-rebuild.mjs" --workspace "<本目录>"
|
|
93
|
+
|
|
94
|
+
# 冷热归档
|
|
95
|
+
node "<技能目录>/scripts/archive.mjs" --workspace "<本目录>" --dry-run
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 我不做什么
|
|
101
|
+
|
|
102
|
+
- 不建数据库、不做向量检索。文本 + 目录 + grep 够了。
|
|
103
|
+
- 不存录音和原图本体,只存引用。
|
|
104
|
+
- 不替代运行时的上下文记忆——那套为对话服务,这套为长久保管服务。
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
*本工作区由 `personal-assistant` 技能创建,结构版本 v{{workspace_version}}。*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema_version": 3.1,
|
|
3
|
+
"id": "pa-ingest-daily",
|
|
4
|
+
"agentAid": "{{agent_aid}}",
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"name": "pa-ingest-daily",
|
|
7
|
+
"description": "每日落地:把当天对话与投喂内容写进 capture/。",
|
|
8
|
+
"source": { "type": "cron", "expression": "50 23 * * *", "timezone": "Asia/Shanghai" },
|
|
9
|
+
"execution": {
|
|
10
|
+
"type": "trigger_session",
|
|
11
|
+
"prompt": "加载 personal-assistant 技能,执行「每日落地」:运行 node \"<技能目录>/scripts/ingest.mjs\" --workspace \"{{workspace}}\" --date today。若落地正常且无需报告,只输出 [[NOOP]];如发现缺失或失败,用一句话说明缺什么。",
|
|
12
|
+
"thread": "per_run",
|
|
13
|
+
"permissionMode": "bypass",
|
|
14
|
+
"onError": "fail",
|
|
15
|
+
"noopSentinel": "[[NOOP]]"
|
|
16
|
+
},
|
|
17
|
+
"feedback": { "strategy": "silent" },
|
|
18
|
+
"reliability": {
|
|
19
|
+
"concurrency": "forbid",
|
|
20
|
+
"missedPolicy": "run_once",
|
|
21
|
+
"retry": { "maxAttempts": 1, "backoffMs": 30000 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema_version": 3.1,
|
|
3
|
+
"id": "pa-memory-consolidate",
|
|
4
|
+
"agentAid": "{{agent_aid}}",
|
|
5
|
+
"enabled": false,
|
|
6
|
+
"name": "pa-memory-consolidate",
|
|
7
|
+
"description": "每日整理记忆:把当天的对话与事件提炼成 knowledge/memory 条目。",
|
|
8
|
+
"source": { "type": "cron", "expression": "0 2 * * *", "timezone": "Asia/Shanghai" },
|
|
9
|
+
"execution": {
|
|
10
|
+
"type": "trigger_session",
|
|
11
|
+
"prompt": "加载 personal-assistant 技能,整理昨天的记忆:读 \"{{workspace}}/capture/conversation/\" 与 \"{{workspace}}/capture/notes/\" 昨天的内容,按 SKILL.md 的记忆规则提炼成 \"{{workspace}}/output/knowledge/memory/\" 下的条目(facts / entities / episodes / rules 四类),每条带 source 指回原料。改主意的不删旧条目,写新条目并把旧的标 status: superseded。完成后运行 index-rebuild,只回一句话。",
|
|
12
|
+
"thread": "per_run",
|
|
13
|
+
"permissionMode": "bypass",
|
|
14
|
+
"onError": "fail",
|
|
15
|
+
"noopSentinel": "[[NOOP]]"
|
|
16
|
+
},
|
|
17
|
+
"feedback": { "strategy": "silent" },
|
|
18
|
+
"reliability": {
|
|
19
|
+
"concurrency": "forbid",
|
|
20
|
+
"missedPolicy": "run_once",
|
|
21
|
+
"retry": { "maxAttempts": 1, "backoffMs": 30000 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema_version": 3.1,
|
|
3
|
+
"id": "pa-report-daily",
|
|
4
|
+
"agentAid": "{{agent_aid}}",
|
|
5
|
+
"enabled": false,
|
|
6
|
+
"name": "pa-report-daily",
|
|
7
|
+
"description": "生成当天日报,写入 output/reports/daily/。",
|
|
8
|
+
"source": { "type": "cron", "expression": "30 22 * * *", "timezone": "Asia/Shanghai" },
|
|
9
|
+
"execution": {
|
|
10
|
+
"type": "trigger_session",
|
|
11
|
+
"prompt": "加载 personal-assistant 技能,按 SKILL.md 第六节生成今天的日报:读 \"{{workspace}}/capture\" 下今天的原料,写进 \"{{workspace}}/output/reports/daily/<今天>.md\",每条结论都要带 source 指向原料路径。写完后运行 node \"<技能目录>/scripts/index-rebuild.mjs\" --workspace \"{{workspace}}\"。完成后只回一句话:日报已生成,或说明失败原因。",
|
|
12
|
+
"thread": "per_run",
|
|
13
|
+
"permissionMode": "bypass",
|
|
14
|
+
"onError": "fail",
|
|
15
|
+
"noopSentinel": "[[NOOP]]"
|
|
16
|
+
},
|
|
17
|
+
"feedback": { "strategy": "silent" },
|
|
18
|
+
"reliability": {
|
|
19
|
+
"concurrency": "forbid",
|
|
20
|
+
"missedPolicy": "run_once",
|
|
21
|
+
"retry": { "maxAttempts": 1, "backoffMs": 30000 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema_version": 3.1,
|
|
3
|
+
"id": "pa-report-weekly",
|
|
4
|
+
"agentAid": "{{agent_aid}}",
|
|
5
|
+
"enabled": false,
|
|
6
|
+
"name": "pa-report-weekly",
|
|
7
|
+
"description": "周日晚生成周报。",
|
|
8
|
+
"source": { "type": "cron", "expression": "0 21 * * 0", "timezone": "Asia/Shanghai" },
|
|
9
|
+
"execution": {
|
|
10
|
+
"type": "trigger_session",
|
|
11
|
+
"prompt": "加载 personal-assistant 技能,生成本周周报:汇总 \"{{workspace}}/output/reports/daily/\" 本周的日报与 \"{{workspace}}/output/tasks/\" 的任务状态,写进 \"{{workspace}}/output/reports/weekly/<年>-W<周>.md\"。写进展、卡点、下周重点三类,不要流水账。完成后运行 index-rebuild,并只回一句话。",
|
|
12
|
+
"thread": "per_run",
|
|
13
|
+
"permissionMode": "bypass",
|
|
14
|
+
"onError": "fail",
|
|
15
|
+
"noopSentinel": "[[NOOP]]"
|
|
16
|
+
},
|
|
17
|
+
"feedback": { "strategy": "silent" },
|
|
18
|
+
"reliability": {
|
|
19
|
+
"concurrency": "forbid",
|
|
20
|
+
"missedPolicy": "run_once",
|
|
21
|
+
"retry": { "maxAttempts": 1, "backoffMs": 30000 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -96,6 +96,11 @@ ec thread history <来源peer>/<来源threadId> --after <发送于的时间戳>
|
|
|
96
96
|
2. 对端已给最终答案?→ **删除复查 + 回来源话题汇报**。
|
|
97
97
|
3. 对端还在处理?→ 调整周期,或什么都不做。
|
|
98
98
|
|
|
99
|
+
**复查职责**:你仍是发出委托的本端 Agent。先确认当前话题是否收到对端的业务回复;
|
|
100
|
+
上下文不足时读取当前话题历史。信封中的“原消息”是已发给对端的背景,不是本轮待执行任务,
|
|
101
|
+
不要代替对端在本机查找源码或执行原委托。尚无业务回复时只输出 `[[NOOP]]`,不要重复发送原问题。
|
|
102
|
+
无人值守复查不发起阻塞式用户问题;需要人工补充信息时,向来源话题说明缺口并结束本轮。
|
|
103
|
+
|
|
99
104
|
```bash
|
|
100
105
|
ec trigger delete <trig_id> # 完成:删除,不留残留
|
|
101
106
|
ec trigger update <trig_id> --every 30m # 放宽
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
### ① 还成立 → 续期
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
ec memory update <路径> --touch
|
|
35
|
+
ec memory update <路径> --touch --reason '<为什么它还成立>'
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
`--touch` 只刷新时间戳(文件的 mtime 与 frontmatter 的 `updatedAt`),不改内容。
|
|
39
39
|
|
|
40
40
|
**续期的含义是「我又看了一遍,还有效」**,不是「它变了」。
|
|
41
41
|
|
|
42
|
-
续期后 **`forgetAfterDays` 天内不会再被挑出来审查**(配置默认 30
|
|
42
|
+
续期后 **`forgetAfterDays` 天内不会再被挑出来审查**(配置默认 3 天,可配 1-7 天;带 `long-term` 标签的记忆固定 30 天审查一次,不受此值影响)。
|
|
43
43
|
|
|
44
44
|
**注意区分两件事:**
|
|
45
45
|
|
|
@@ -53,9 +53,11 @@ ec memory update <路径> --touch
|
|
|
53
53
|
### ② 不成立了 → 归档
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
ec memory archive <路径>
|
|
56
|
+
ec memory archive <路径> --reason '<为什么它不成立了>'
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
一次只归档一条:给多个路径会被拒绝。
|
|
60
|
+
|
|
59
61
|
归档后这条记忆**从索引里消失、召回时看不到**,文件移入 `archive/` 保留可追溯(人工可回捞)。
|
|
60
62
|
|
|
61
63
|
### ③ 几条合起来值得留一条 → 合并
|
|
@@ -66,10 +68,11 @@ ec memory archive <路径>
|
|
|
66
68
|
ec memory create --scope <本次会话的 scope> --slug <slug> --desc '一句话描述' \
|
|
67
69
|
--tags <...> [--keywords <...>] \
|
|
68
70
|
--replaces '<旧文件1>,<旧文件2>,...' \
|
|
69
|
-
|
|
71
|
+
--reason '<为什么这几条合成一条>' \
|
|
72
|
+
'<合并后的完整内容>'
|
|
70
73
|
```
|
|
71
74
|
|
|
72
|
-
`--replaces`
|
|
75
|
+
`--replaces` 列出的旧文件会被一并归档,索引里只留合并后的那一条。`--reason` 记到每一条旧文件名下;几条旧文件的理由各不相同,说明它们不该合并——真过时的先单独 `archive`,剩下的再合并。
|
|
73
76
|
|
|
74
77
|
三个典型场景:
|
|
75
78
|
|
|
@@ -79,9 +82,19 @@ ec memory create --scope <本次会话的 scope> --slug <slug> --desc '一句话
|
|
|
79
82
|
| 内容过时了大方向还成立(比如项目换工具了) | `create --replaces` 产出更新版 |
|
|
80
83
|
| 两条矛盾,其中一条已被后来的事实推翻 | 留下正确的那条:`--touch` 续期;错的归档 |
|
|
81
84
|
|
|
85
|
+
## 每条记忆都要写理由
|
|
86
|
+
|
|
87
|
+
三种产出的命令都**必须带 `--reason`**,说明**这一条记忆**为什么续期 / 归档 / 合并。
|
|
88
|
+
程序把它连同时间、动作记进该记忆所在层的 `archive/FORGET-LOG.md`,一条记忆一行。
|
|
89
|
+
|
|
90
|
+
- 针对这一条写,不写本次整理的总结(总结写进反馈文件)。
|
|
91
|
+
- 一句话,不超过 80 字;不写或超长会被拒绝,按提示改了重试。
|
|
92
|
+
- 写判断依据,不复述记忆内容:「项目已从 webpack 换成 vite,命令失效」,不写「这条过时了」。
|
|
93
|
+
- 理由里不要出现单引号。
|
|
94
|
+
|
|
82
95
|
## 判断标准
|
|
83
96
|
|
|
84
|
-
审查周期由 `memory.forgetAfterDays` 决定(默认 30
|
|
97
|
+
审查周期由 `memory.forgetAfterDays` 决定(默认 3 天,可配 1-7 天),配置改了下次检查就按新阈值筛候选。带 `long-term` 标签的记忆不看这个值,固定每 30 天才交给模型审一次;中间的轮次程序只推后它的 mtime,不进候选清单。
|
|
85
98
|
|
|
86
99
|
**「这条现在还成立吗?」**
|
|
87
100
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
| 来源 | 位置 | 说明 |
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| note | 上下文文件里的 `pendingDir` 对应 `processing/` 目录 | 主会话在对话中随手记下的原料:可能重复、可能矛盾、可能有错 |
|
|
14
|
-
| 会话历史 | 上下文文件里的 `threads/` 快照目录 | 上下文文件列出了「话题快照文件」时可用,**应当读取**(`manual` / `compress` / `session-new` 以及多数 `relation-idle
|
|
14
|
+
| 会话历史 | 上下文文件里的 `threads/` 快照目录 | 上下文文件列出了「话题快照文件」时可用,**应当读取**(`manual` / `compress` / `session-new` 以及多数 `relation-idle`);没列出时(没有入站记录的关系,如只被群链按发言人写入过的关系)只能凭 note 本身判断 |
|
|
15
15
|
| 已有记忆 | 目标作用域的 `MEMORY.md` 索引 | 查重 |
|
|
16
16
|
|
|
17
17
|
## 产出
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
## 产出
|
|
21
21
|
|
|
22
|
-
一条带 `profile` 标签的 **relation 级**记忆,且**一个关系只能有一条**。
|
|
22
|
+
一条带 `profile` 标签的 **relation 级**记忆,且**一个关系只能有一条**。slug 固定为 `profile`,只能写本次会话所属关系,不带 `--peer`;其他写法会被拒。
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
ec memory create --scope relation --slug profile \
|
|
@@ -29,7 +29,7 @@ ec memory create --scope relation --slug profile \
|
|
|
29
29
|
"(画像正文)"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
**必须用 `--replaces` 指定上一版画像**,否则会被拒(一个关系只能有一条 `profile`
|
|
32
|
+
**必须用 `--replaces` 指定上一版画像**,否则会被拒(一个关系只能有一条 `profile` 记忆)。被覆盖的上一版自动留一份在 `archive/consolidated/profile.md`,每次重建覆盖那一份——只保留上一版,不累积历史。
|
|
33
33
|
|
|
34
34
|
**首次生成**:目标文件不存在,`--replaces` 可以不传。
|
|
35
35
|
|
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
## 输入
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
上下文文件里列出的候选:带 `to-promote` 标签的记忆,可能有两层来源(清单里已分组)。**候选只给路径 + 描述**,先只读描述判断;某条描述太简、拿不准的,再读那一条正文。
|
|
12
12
|
|
|
13
13
|
| 来源 | 位置 | 说明 |
|
|
14
14
|
|---|---|---|
|
|
15
|
-
|
|
|
15
|
+
| 关系层候选 | 清单里路径形如 `<peerKey>/consolidated/…` | 本关系 consolidated/ 里带 `to-promote` 的条目 |
|
|
16
|
+
| agent 层候选 | 清单里路径形如 `agent/consolidated/…` | agent 自己的 personal/memory 里带 `to-promote` 的条目,来自 generalize 产出时的标记 |
|
|
17
|
+
|
|
18
|
+
两层都评,判断标准一样。agent 层候选如果确实是 owner 定的规矩,同样提升到 owner 级,提升后按「两边都留一份」那节处理——源文件归档。
|
|
16
19
|
| 对话历史 | 上下文文件里列出的 `threads/` 快照文件(若有) | 上次本模式整理以来的增量对话,辅助判断 owner 的明确要求是否在对话里体现;无增量时为空,可忽略 |
|
|
17
20
|
|
|
18
21
|
## 产出
|
|
@@ -35,7 +38,21 @@
|
|
|
35
38
|
- 只针对某一个 agent 或某一个项目的一次性要求。
|
|
36
39
|
- owner 随口提到的个人偏好,没有「对所有 agent 有效」的意思。
|
|
37
40
|
|
|
38
|
-
**评估后认为不该提升的,用 `update` 把 `to-promote` 标签去掉。**
|
|
41
|
+
**评估后认为不该提升的,用 `update` 把 `to-promote` 标签去掉。** 否则该关系下次整理还会扫到它,反复评估同一条。
|
|
42
|
+
|
|
43
|
+
候选在**关系层**,本模式的写作用域是 owner 层,所以路径必须带关系前缀——**就是候选清单里列出的那个路径,原样抄**,不要自己改成 `consolidated/<文件名>`:不带前缀会解析成 owner 层的同名文件,标签留在关系层没被摘掉,这一轮等于白跑。
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 关系层候选
|
|
47
|
+
ec memory update '<peerKey>/consolidated/20261002-xxx.md' --tags '<去掉 to-promote 后的标签>' \
|
|
48
|
+
--reason '评估后认为只是针对该对端的要求,不构成 owner 级规矩'
|
|
49
|
+
|
|
50
|
+
# agent 层候选
|
|
51
|
+
ec memory update 'agent/consolidated/20261002-xxx.md' --tags '<去掉 to-promote 后的标签>' \
|
|
52
|
+
--reason '评估后认为只是这个 agent 的做法,不构成 owner 级规矩'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
改完用 `Grep` 在候选清单给出的目录里确认 `to-promote` 已经不在。
|
|
39
56
|
|
|
40
57
|
## 权限校验
|
|
41
58
|
|
|
@@ -41,7 +41,14 @@
|
|
|
41
41
|
"config.get": { "allow": true, "scopes": ["relation"], "constraints": { "currentRelationOnly": true, "targetCurrentAgentOnly": true, "configFieldPolicy": "behavior-read" } },
|
|
42
42
|
"config.set": { "allow": true, "scopes": ["relation"], "constraints": { "currentRelationOnly": true, "targetCurrentAgentOnly": true, "configFieldPolicy": "role-overridable-write" } },
|
|
43
43
|
"config.unset": { "allow": true, "scopes": ["relation"], "constraints": { "currentRelationOnly": true, "targetCurrentAgentOnly": true, "configFieldPolicy": "role-overridable-write" } },
|
|
44
|
-
"model
|
|
44
|
+
"model.list": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
45
|
+
"model.current": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
46
|
+
"model.info": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
47
|
+
"model.effort.current": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
48
|
+
"model.use": { "allow": false },
|
|
49
|
+
"model.effort": { "allow": false },
|
|
50
|
+
"model.reset": { "allow": false },
|
|
51
|
+
"model.check": { "allow": false },
|
|
45
52
|
"permission.current": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
46
53
|
"permission.answer": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
47
54
|
"chatmode.current": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[baseagent]
|
|
2
2
|
baseAgentName: {{baseAgentName}} # 底层推理引擎(claude / codex / gemini / ecagent;ecagent 为 EvolCore 内置基座,非 Claude Code)
|
|
3
3
|
{{?effectiveModel}}
|
|
4
|
-
effectiveModel: {{effectiveModel}} #
|
|
4
|
+
effectiveModel: {{effectiveModel}} # 当前实际生效的模型(Agent 级配置经角色约束;模型只在 Agent 级配置)
|
|
5
5
|
{{/}}
|
|
6
6
|
{{?baseAgentModel}}
|
|
7
|
-
baseAgentModel: {{baseAgentModel}} # base agent
|
|
7
|
+
baseAgentModel: {{baseAgentModel}} # base agent 引擎实例持有的模型(参考值;实际调用以 effectiveModel 为准)
|
|
8
8
|
{{/}}
|
|
9
9
|
{{?modelFallbackActive}}
|
|
10
10
|
modelFallbackActive: true # evolcore 配置的模型不可用,当前正在使用降级模型 {{modelFallbackModel}}
|
|
@@ -47,9 +47,9 @@ slug 撞名改用 `update`。完整用法见 `$KITS_DOCS/evolcore/memory.md`。
|
|
|
47
47
|
ec memory create --scope <relation|agent|owner> --slug <slug> --desc '一句话描述' \
|
|
48
48
|
[--peer <peerKey>] --tags '<tag1>,<tag2>' [--keywords '<kw1>,<kw2>'] [--replaces '<路径1>,<路径2>'] \
|
|
49
49
|
[--reason '为什么'] [--generalized-from '<路径>'] [--promoted-from '<路径>'] '<正文>'
|
|
50
|
-
ec memory update <路径> --tags '<tag1>,<tag2>'
|
|
51
|
-
ec memory update <路径> --touch
|
|
52
|
-
ec memory archive <路径...>
|
|
50
|
+
ec memory update <路径> --tags '<tag1>,<tag2>' [--reason '为什么'] # 整体替换标签,不是追加;改不了正文
|
|
51
|
+
ec memory update <路径> --touch [--reason '为什么'] # 只刷新时间戳(遗忘续期)
|
|
52
|
+
ec memory archive <路径...> [--reason '为什么'] # 下线记忆,移入 archive/
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
泛化 / 提升专用:`--generalized-from <路径>`(scope=agent)、`--promoted-from <路径>`(scope=owner)记录来源,供 `ec memory demote` 回退。值为相对 `agents/<selfAid>/` 的路径。
|
|
@@ -69,7 +69,7 @@ ec memory archive <路径...> # 下线记忆,移入 archi
|
|
|
69
69
|
| --tags | 必填,取值见 $KITS_DOCS/evolcore/memory-tags.md |
|
|
70
70
|
| --keywords | 可选,串起相关记忆的内容关键词 |
|
|
71
71
|
| --replaces | 可选,要替换的旧文件,自动归档。合并、纠正、升格作用域都走它,是唯一的防重复手段 |
|
|
72
|
-
| --reason |
|
|
72
|
+
| --reason | 一句话说明为什么做这个操作,进 ops.jsonl 的操作流水,不写进记忆正文。forget 模式必填且不超过 80 字,针对这一条记忆写,另记入该记忆所在层的 `archive/FORGET-LOG.md`;其他模式可选但应当写 |
|
|
73
73
|
| --generalized-from | 仅 scope=agent:泛化来源,相对 `agents/<selfAid>/` 的路径,供 demote 回退 |
|
|
74
74
|
| --promoted-from | 仅 scope=owner:提升来源,相对 `agents/<selfAid>/` 的路径,供 demote 回退 |
|
|
75
75
|
|
|
@@ -6,7 +6,7 @@ PACKAGE_ROOT: {{PACKAGE_ROOT}} # evolcore 安装目录(kits/rules/docs)
|
|
|
6
6
|
evolcoreMode: dev # evolcore 以源码仓库运行,$PACKAGE_ROOT/src 下的代码可直接查看和修改
|
|
7
7
|
{{/}}
|
|
8
8
|
{{?evolcoreMode=install}}
|
|
9
|
-
evolcoreMode: install # evolcore 为全局安装包,$PACKAGE_ROOT 下代码可查看但不应直接修改;发现 bug
|
|
9
|
+
evolcoreMode: install # evolcore 为全局安装包,$PACKAGE_ROOT 下代码可查看但不应直接修改;发现 bug 时可在本地生成 markdown 报告,只有用户明确要求时才外发
|
|
10
10
|
{{/}}
|
|
11
11
|
{{?venueUid}}
|
|
12
12
|
venueUid: {{venueUid}}
|