dsh-memu-memory 1.4.2 → 1.4.4
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/AGENTS.md +108 -110
- package/CHANGELOG.md +173 -868
- package/LICENSE +21 -21
- package/README.md +368 -374
- package/README.zh.md +354 -360
- package/assets/icon.svg +7 -7
- package/cordis.patch.yml +8 -8
- package/docs/active-memory-ab.md +279 -385
- package/docs/binding-lifecycle.md +99 -99
- package/docs/client-conventions.md +75 -75
- package/docs/contributing.md +217 -217
- package/docs/emotion-model-spec.md +247 -281
- package/docs/env-and-commands.md +149 -152
- package/docs/host-adaptation.md +339 -360
- package/docs/host-api.md +131 -137
- package/docs/host-versions.md +117 -120
- package/docs/mcp-porting.md +146 -146
- package/docs/memory-semantics.md +271 -259
- package/docs/pending-work.md +44 -51
- package/docs/troubleshooting.md +909 -854
- package/lib/active-memory.js +160 -165
- package/lib/activity-log.js +207 -207
- package/lib/auto-link/apply.js +248 -249
- package/lib/auto-link/candidates.js +163 -163
- package/lib/auto-link/decide.js +300 -300
- package/lib/auto-link/normalize.js +99 -99
- package/lib/auto-link/policy.js +42 -42
- package/lib/auto-link/suppression.js +101 -101
- package/lib/auto-link/terminology.js +311 -311
- package/lib/backup.js +1254 -1254
- package/lib/binding-diagnostics.js +634 -634
- package/lib/budget.js +118 -118
- package/lib/client.js +9820 -9751
- package/lib/commitment.js +178 -138
- package/lib/consolidation-ledger.js +434 -438
- package/lib/consolidation-receipt.js +386 -387
- package/lib/consolidation-snapshot.js +420 -405
- package/lib/consolidation-worker.js +240 -241
- package/lib/context.js +33 -33
- package/lib/curator-evidence.js +131 -131
- package/lib/curator-policy.js +198 -202
- package/lib/curator.js +1813 -1811
- package/lib/cycle.js +524 -513
- package/lib/diagnostics.js +524 -524
- package/lib/embedding-catalog.js +1051 -1055
- package/lib/embedding-download.js +637 -607
- package/lib/embedding-runtime.js +946 -946
- package/lib/engine.js +1103 -1103
- package/lib/entity-repair.js +285 -285
- package/lib/environment-check.js +394 -394
- package/lib/fork-model.js +312 -312
- package/lib/freshness.js +128 -121
- package/lib/global-graph.js +389 -389
- package/lib/graph.js +1193 -1193
- package/lib/host-surface.js +30 -30
- package/lib/inbound.js +284 -281
- package/lib/index.js +506 -511
- package/lib/inject.js +2639 -2619
- package/lib/lexicon-scope.js +143 -143
- package/lib/lexicon.js +1183 -1192
- package/lib/lifecycle-audit.js +37 -0
- package/lib/local-embedding-entry.js +145 -145
- package/lib/local-embedding-manager.js +306 -306
- package/lib/local-embedding-protocol.js +210 -210
- package/lib/local-embedding-worker.js +682 -682
- package/lib/local-vector-service.js +506 -453
- package/lib/maintenance-ledger.js +138 -0
- package/lib/maintenance-review.js +103 -0
- package/lib/maintenance-runner.js +267 -0
- package/lib/managed-runtime.js +118 -118
- package/lib/media.js +607 -513
- package/lib/memory.js +5035 -4941
- package/lib/memu-config.js +213 -213
- package/lib/memu.js +565 -565
- package/lib/migrate.js +200 -200
- package/lib/mood.js +300 -300
- package/lib/paths.js +453 -457
- package/lib/port-surface.js +82 -82
- package/lib/preset-mount.js +85 -0
- package/lib/preset-scope.js +126 -126
- package/lib/private-links.js +567 -567
- package/lib/private.js +2198 -2209
- package/lib/prompts/global-curator.md +135 -135
- package/lib/prompts/image-caption.md +1 -1
- package/lib/prompts/private-consolidation.coding.md +39 -39
- package/lib/prompts/private-consolidation.md +32 -32
- package/lib/prompts/private-consolidation.mixed.md +37 -37
- package/lib/prompts/private-consolidation.rp.md +47 -47
- package/lib/prompts/private-policy.coding.md +35 -35
- package/lib/prompts/private-policy.md +36 -36
- package/lib/prompts/private-policy.mixed.md +29 -29
- package/lib/prompts/private-policy.rp.md +43 -43
- package/lib/prompts/system-guide.coding.md +20 -20
- package/lib/prompts/system-guide.md +25 -25
- package/lib/prompts/system-guide.mixed.md +22 -22
- package/lib/prompts/system-guide.rp.md +23 -23
- package/lib/prompts.js +331 -331
- package/lib/recall-cache.js +212 -212
- package/lib/remote-summary.js +123 -123
- package/lib/rpc.js +2531 -2532
- package/lib/salient-wake.js +438 -438
- package/lib/snippet.js +125 -125
- package/lib/state.js +1948 -1928
- package/lib/stats.js +236 -236
- package/lib/temporal.js +345 -348
- package/lib/text-retrieval.js +992 -1001
- package/lib/text-similarity.js +305 -305
- package/lib/tokenizer-v2.js +271 -271
- package/lib/tools.js +1098 -1091
- package/lib/turn-log.js +545 -545
- package/lib/vector-migration.js +928 -930
- package/lib/vector-profile.js +1353 -1359
- package/lib/visibility.js +59 -59
- package/lib/webui/graph-LICENSE.txt +1 -1
- package/lib/webui/graph-view.bundle.js +2 -2
- package/lib/webui/graph-view.js +1171 -1175
- package/lib/webui/mark.svg +7 -7
- package/lib/webui/standalone.css +1178 -1178
- package/lib/webui/standalone.js +238 -238
- package/lib/webui.js +136 -136
- package/lib/worker-pool.js +1020 -979
- package/package.json +153 -153
- package/requirements.lock +34 -34
- package/scripts/acceptance-local.mjs +946 -946
- package/scripts/active-memory-ab-live.mjs +653 -655
- package/scripts/active-memory-ab.mjs +1302 -1302
- package/scripts/audit-memory-lifecycle.mjs +55 -0
- package/scripts/bench-recall.mjs +142 -142
- package/scripts/build-graph.mjs +44 -45
- package/scripts/chain-matrix.mjs +541 -541
- package/scripts/check-all.mjs +68 -74
- package/scripts/check-doc-drift.mjs +547 -547
- package/scripts/check-graph-browser.mjs +261 -261
- package/scripts/check-i18n.mjs +81 -83
- package/scripts/check-idle-compositing.mjs +61 -61
- package/scripts/check-seed-compat.mjs +115 -118
- package/scripts/check-text-format.mjs +55 -0
- package/scripts/curator-pair-calibrate.mjs +259 -259
- package/scripts/diagnose-bindings.mjs +176 -176
- package/scripts/drive-session.mjs +863 -864
- package/scripts/engine-smoke.mjs +69 -69
- package/scripts/entity-dedupe.mjs +110 -110
- package/scripts/lexicon-calibrate.mjs +230 -230
- package/scripts/lexicon-dedupe.mjs +318 -318
- package/scripts/local-runtime-install.mjs +142 -142
- package/scripts/local-runtime-verify.mjs +56 -56
- package/scripts/local-vector-verify.mjs +93 -93
- package/scripts/make-readme-shots.mjs +59 -59
- package/scripts/migrate-visibility.mjs +94 -94
- package/scripts/mock-llm.mjs +938 -903
- package/scripts/preview.mjs +58 -58
- package/scripts/prune-sessions.mjs +31 -34
- package/scripts/prune-turnlogs.mjs +29 -30
- package/scripts/prune-vectors.mjs +24 -24
- package/scripts/rebuild-auto-links.mjs +252 -252
- package/scripts/recall-bench.mjs +820 -820
- package/scripts/repetition-ab-scenarios.mjs +93 -93
- package/scripts/repetition-detector-snapshot.mjs +314 -314
- package/scripts/repetition-eval-live.mjs +360 -360
- package/scripts/repetition-eval.mjs +702 -702
- package/scripts/replay.mjs +705 -575
- package/scripts/setup.mjs +46 -46
- package/scripts/simulate-injection.mjs +299 -301
- package/tests/absorb-review.test.mjs +354 -354
- package/tests/activation.test.mjs +89 -89
- package/tests/active-memory-ab.test.mjs +745 -745
- package/tests/active-memory.test.mjs +129 -129
- package/tests/activity-log.test.mjs +126 -126
- package/tests/activity-wiring.test.mjs +155 -155
- package/tests/appendix-b.test.mjs +217 -217
- package/tests/appendix-b2.test.mjs +166 -166
- package/tests/audit-batch3.test.mjs +247 -247
- package/tests/audit-regression.test.mjs +275 -275
- package/tests/audit-safety.test.mjs +227 -227
- package/tests/auto-link-candidates.test.mjs +245 -245
- package/tests/auto-link-decide.test.mjs +512 -512
- package/tests/auto-link-migration.test.mjs +133 -133
- package/tests/backend-compensation.test.mjs +272 -272
- package/tests/backup.test.mjs +793 -793
- package/tests/binding-diagnostics.test.mjs +720 -720
- package/tests/browser.test.mjs +476 -476
- package/tests/client-export.test.mjs +521 -521
- package/tests/client-render.test.mjs +2008 -1728
- package/tests/coalesce.test.mjs +113 -113
- package/tests/commitment.test.mjs +243 -144
- package/tests/config.test.mjs +159 -159
- package/tests/consolidation-credential.test.mjs +330 -330
- package/tests/consolidation-feed.test.mjs +122 -122
- package/tests/consolidation-fork.test.mjs +1587 -1539
- package/tests/consolidation-ledger.test.mjs +389 -389
- package/tests/consolidation-snapshot.test.mjs +567 -505
- package/tests/consolidation-value.test.mjs +89 -89
- package/tests/context-scope.test.mjs +40 -40
- package/tests/cross-library-recall.test.mjs +269 -269
- package/tests/cue.test.mjs +58 -58
- package/tests/curator-absorb.test.mjs +444 -444
- package/tests/curator-calibrate.test.mjs +173 -173
- package/tests/curator-clusters.test.mjs +306 -306
- package/tests/curator-commit.test.mjs +325 -325
- package/tests/curator-contract.test.mjs +191 -191
- package/tests/curator-evidence.test.mjs +102 -102
- package/tests/curator-link.test.mjs +317 -317
- package/tests/curator-pairing.test.mjs +339 -339
- package/tests/curator-probe.test.mjs +490 -490
- package/tests/curator-review-mode.test.mjs +315 -315
- package/tests/curator.test.mjs +152 -152
- package/tests/cycle.test.mjs +567 -568
- package/tests/diagnostics.test.mjs +278 -278
- package/tests/disclosure.test.mjs +249 -249
- package/tests/doc-drift.test.mjs +342 -342
- package/tests/drive-session.test.mjs +152 -152
- package/tests/dynamic-rrf.test.mjs +182 -182
- package/tests/dynamic-threshold.test.mjs +52 -52
- package/tests/embedding-catalog.test.mjs +374 -374
- package/tests/embedding-download.test.mjs +529 -486
- package/tests/embedding-runtime.test.mjs +449 -449
- package/tests/emotion-chain.test.mjs +84 -84
- package/tests/emotion-contract.test.mjs +445 -445
- package/tests/engine.test.mjs +108 -108
- package/tests/entity-merge.test.mjs +278 -278
- package/tests/environment-check.test.mjs +187 -187
- package/tests/fact-version.test.mjs +146 -146
- package/tests/fixtures/active-memory-ab/README.md +56 -56
- package/tests/fixtures/active-memory-ab/cases/01-clean-dense-turn.json +351 -351
- package/tests/fixtures/active-memory-ab/cases/02-clean-thin-turn.json +122 -122
- package/tests/fixtures/active-memory-ab/cases/03-clean-starved-small.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/04-clean-large-thin.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/05-clean-half-step.json +166 -166
- package/tests/fixtures/active-memory-ab/cases/06-clean-duplicate-reread.json +197 -197
- package/tests/fixtures/active-memory-ab/cases/07-clean-recent-recall.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/08-global-relevant.json +111 -111
- package/tests/fixtures/active-memory-ab/cases/09-global-irrelevant-conflict.json +158 -158
- package/tests/fixtures/active-memory-ab/cases/10-no-human-turn.json +97 -97
- package/tests/fixtures/active-memory-ab/cases/11-clean-scale-100.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/12-clean-scale-1000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/13-clean-scale-5000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/14-clean-scale-20000.json +137 -137
- package/tests/fixtures/active-memory-ab/lead-ai-reviewed-reference.json +191 -191
- package/tests/fixtures/active-memory-ab/manifest.json +199 -199
- package/tests/fixtures/curator-pairs/labeled.v1.jsonl +90 -90
- package/tests/fixtures/lexicon-stub-hooks.mjs +15 -15
- package/tests/fixtures/lexicon-stub.mjs +284 -284
- package/tests/fixtures/mock-llm/reply.txt +1 -1
- package/tests/fixtures/recall-bench/01-paraphrase.json +183 -183
- package/tests/fixtures/recall-bench/02-exact.json +152 -152
- package/tests/fixtures/recall-bench/03-negation.json +172 -172
- package/tests/fixtures/recall-bench/04-no-answer.json +161 -161
- package/tests/fixtures/recall-bench/05-conflict.json +193 -193
- package/tests/fixtures/recall-bench/06-boundary.json +272 -272
- package/tests/fixtures/recall-bench/07-secret.json +190 -190
- package/tests/fixtures/recall-bench/08-coding.json +163 -163
- package/tests/fixtures/recall-bench-gold-candidates/01-paraphrase.json +193 -193
- package/tests/fixtures/recall-bench-gold-candidates/02-exact.json +197 -197
- package/tests/fixtures/recall-bench-gold-candidates/03-negation.json +244 -244
- package/tests/fixtures/recall-bench-gold-candidates/04-no-answer.json +189 -189
- package/tests/fixtures/recall-bench-gold-candidates/05-conflict.json +245 -245
- package/tests/fixtures/recall-bench-gold-candidates/06-boundary.json +279 -279
- package/tests/fixtures/recall-bench-gold-candidates/07-secret.json +224 -224
- package/tests/fixtures/recall-bench-gold-candidates/08-coding.json +218 -218
- package/tests/fixtures/repetition-eval/01-zh-rp.json +92 -92
- package/tests/fixtures/repetition-eval/02-en.json +96 -96
- package/tests/fixtures/repetition-eval/03-code.json +90 -90
- package/tests/fixtures/repetition-eval/04-names.json +115 -115
- package/tests/fixtures/repetition-eval/05-user-quote.json +95 -95
- package/tests/fixtures/repetition-eval/06-agreement.json +85 -85
- package/tests/fixtures/tokenizer-cases.mjs +27 -27
- package/tests/fork-model.test.mjs +345 -345
- package/tests/freshness.test.mjs +140 -140
- package/tests/global-graph.test.mjs +106 -106
- package/tests/global-lifecycle.test.mjs +149 -149
- package/tests/graph-cascade.test.mjs +363 -363
- package/tests/graph-view.test.mjs +414 -414
- package/tests/graph.test.mjs +371 -371
- package/tests/help-page.test.mjs +416 -416
- package/tests/hook-order.test.mjs +72 -72
- package/tests/humanlike.test.mjs +232 -232
- package/tests/hybrid-recall.test.mjs +610 -610
- package/tests/inbound.test.mjs +441 -441
- package/tests/inject-conflict.test.mjs +173 -173
- package/tests/inject-guide.test.mjs +513 -513
- package/tests/inject.test.mjs +384 -384
- package/tests/injection-budget-settings.test.mjs +35 -35
- package/tests/injection-budget.test.mjs +165 -165
- package/tests/injection-chain.test.mjs +442 -442
- package/tests/injection-intent-budget.test.mjs +92 -92
- package/tests/injection-rollback.test.mjs +428 -428
- package/tests/issue2-chain.test.mjs +169 -169
- package/tests/lexical-bm25.test.mjs +171 -171
- package/tests/lexicon-calibrate.test.mjs +48 -48
- package/tests/lexicon-dedupe.test.mjs +171 -171
- package/tests/lexicon-frequency.test.mjs +195 -195
- package/tests/lexicon-inject.test.mjs +459 -459
- package/tests/lexicon-perf.test.mjs +464 -464
- package/tests/lexicon-scope.test.mjs +256 -256
- package/tests/lexicon-ui.test.mjs +667 -667
- package/tests/lexicon.test.mjs +922 -922
- package/tests/lifecycle-audit.test.mjs +56 -0
- package/tests/loader-register.mjs +3 -3
- package/tests/loader.mjs +17 -17
- package/tests/local-embedding-entry.test.mjs +95 -95
- package/tests/local-embedding-env.test.mjs +51 -51
- package/tests/local-embedding-manager.test.mjs +494 -494
- package/tests/local-embedding-protocol.test.mjs +121 -121
- package/tests/local-embedding-worker.test.mjs +440 -440
- package/tests/local-vector-service.test.mjs +41 -0
- package/tests/maintenance-status.test.mjs +77 -0
- package/tests/maintenance.test.mjs +438 -0
- package/tests/managed-memory.test.mjs +1234 -1234
- package/tests/managed-runtime.test.mjs +72 -72
- package/tests/media-injection.test.mjs +225 -0
- package/tests/media.test.mjs +135 -135
- package/tests/memory-chain.test.mjs +169 -169
- package/tests/memory-fields.test.mjs +134 -134
- package/tests/memu-resident-route.test.mjs +130 -130
- package/tests/memu-resident.test.mjs +33 -33
- package/tests/migration-payload.test.mjs +40 -42
- package/tests/mock-llm.test.mjs +263 -225
- package/tests/mood.test.mjs +109 -109
- package/tests/multiprocess.test.mjs +29 -29
- package/tests/negation-polarity.test.mjs +135 -135
- package/tests/new-session-gate.test.mjs +617 -617
- package/tests/open-loop-date.test.mjs +416 -416
- package/tests/ops-hardening.test.mjs +209 -209
- package/tests/package-shipping.test.mjs +88 -88
- package/tests/pending-injection.test.mjs +107 -107
- package/tests/port-surface.test.mjs +138 -138
- package/tests/preset-mount.test.mjs +132 -0
- package/tests/preset-scope.test.mjs +212 -212
- package/tests/private-links.test.mjs +493 -493
- package/tests/prompt-semantics.test.mjs +51 -51
- package/tests/prompts.test.mjs +315 -315
- package/tests/query-decompose.test.mjs +62 -62
- package/tests/react-snapshot.test.mjs +24 -24
- package/tests/recall-bench.test.mjs +317 -317
- package/tests/recall-cache.test.mjs +292 -292
- package/tests/recall-corpus-eligibility.test.mjs +51 -51
- package/tests/recall-dedup.test.mjs +446 -446
- package/tests/recall-intent.test.mjs +172 -172
- package/tests/regression-sweep.test.mjs +311 -311
- package/tests/reminder-fairness.test.mjs +55 -0
- package/tests/remote.test.mjs +140 -140
- package/tests/rename.test.mjs +30 -30
- package/tests/repetition-detector-snapshot.test.mjs +231 -231
- package/tests/repetition-eval-live.test.mjs +177 -177
- package/tests/repetition-eval.test.mjs +373 -373
- package/tests/salience-domain.test.mjs +173 -173
- package/tests/salient-date.test.mjs +142 -142
- package/tests/salient-wake.test.mjs +389 -389
- package/tests/settings-beat.test.mjs +222 -222
- package/tests/settings-coverage.test.mjs +97 -97
- package/tests/settings-plumbing.test.mjs +79 -79
- package/tests/short-term.test.mjs +182 -166
- package/tests/sidebar-beat.test.mjs +213 -213
- package/tests/sidebar-refresh.test.mjs +123 -123
- package/tests/sidebar.test.mjs +102 -74
- package/tests/simulate-injection.test.mjs +76 -76
- package/tests/slot-similarity.test.mjs +153 -153
- package/tests/snippet.test.mjs +79 -79
- package/tests/source-kind.test.mjs +52 -52
- package/tests/speaker-provenance.test.mjs +120 -120
- package/tests/stale-maintenance.test.mjs +206 -131
- package/tests/state-gc.test.mjs +34 -34
- package/tests/state.test.mjs +155 -155
- package/tests/stats.test.mjs +112 -112
- package/tests/storage.test.mjs +125 -125
- package/tests/stubs/child-process-spy.mjs +14 -14
- package/tests/stubs/dsh-llm-pi-ai.js +13 -13
- package/tests/stubs/dsh-llm.js +5 -5
- package/tests/stubs/dsh-schedule.js +140 -140
- package/tests/stubs/dsh-session-query.js +26 -26
- package/tests/stubs/dsh-session.js +7 -7
- package/tests/stubs/dsh-tools.js +101 -101
- package/tests/temporal-repair.test.mjs +78 -0
- package/tests/temporal.test.mjs +124 -124
- package/tests/text-format.test.mjs +24 -0
- package/tests/tokenizer-v2.test.mjs +142 -142
- package/tests/tool-schema.test.mjs +126 -126
- package/tests/tools.test.mjs +810 -810
- package/tests/turn-log.test.mjs +487 -487
- package/tests/ui-defaults.test.mjs +57 -57
- package/tests/update-fields.test.mjs +138 -138
- package/tests/vector-gc.test.mjs +37 -37
- package/tests/vector-migration.test.mjs +810 -810
- package/tests/vector-profile.test.mjs +449 -449
- package/tests/visibility-migration.test.mjs +152 -152
- package/tests/webui-auth.test.mjs +963 -963
- package/tests/webui.test.mjs +421 -421
- package/tests/windows-env.test.mjs +89 -89
- package/tests/worker-lifecycle.test.mjs +1522 -1429
|
@@ -1,281 +1,247 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
| lib/
|
|
33
|
-
| lib/
|
|
34
|
-
| lib/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
fade
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
3
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
| 心疼 | sorrow 0.80 / joy 0.20 | -0.2 |
|
|
249
|
-
| 不甘 | anger 0.60 / sorrow 0.40 | +0.4 |
|
|
250
|
-
|
|
251
|
-
验收样例必须把期望写成可计算范围:分别统计主导轴准确率、null precision/recall、arousal 误差和 dominance 误差;复合情绪允许 top-2 轴集合匹配并记录容差。
|
|
252
|
-
|
|
253
|
-
## 附录 B:实施前检查清单
|
|
254
|
-
|
|
255
|
-
- [ ] 实现并测试 normalizeEmotion、derivedValence、overlap 和门控真值表。
|
|
256
|
-
- [ ] 决定 P0 是否启用 feature flag;不要同时声称改 mood.js 且零召回变化。
|
|
257
|
-
- [ ] 明确 remember/update 的 omitted/null/zero 语义。
|
|
258
|
-
- [ ] 统一远程字段名和 visibility 枚举。
|
|
259
|
-
- [ ] 为旧 index、旧 binding、后台 fork 增加兼容测试。
|
|
260
|
-
- [ ] 以 npm test 退出码作为门禁,不引用过时的 878/取消测试数字。
|
|
261
|
-
- [x] 实现完成后再更新本文状态、版本和变更日志。
|
|
262
|
-
|
|
263
|
-
## 10. 实施结果(2026-10-30)
|
|
264
|
-
|
|
265
|
-
| 阶段 | 落地位置 | 结果 |
|
|
266
|
-
|---|---|---|
|
|
267
|
-
| P0 | `lib/mood.js` 重写:四轴词表、`normalizeEmotion`、`derivedValence`(统一 0.8 系数)、`maxShare`、`overlap`、`dominanceBias`、`emotionActive`、分句读取、`moodDecay` 的 0.35 边界 | 完成 |
|
|
268
|
-
| P1 | `lib/memory.js` 召回:overlap 路径 + 旧 valence 回落、dominance 乘数、三腿门控、`arousalBias` 的强度代理纳入 `maxShare` | 完成;`moodBias` 实测边界 0.7 / 1.3 |
|
|
269
|
-
| P2 | `state.js` / `tools.js` / `prompts.js` / `remote-summary.js` / `rpc.js` / `client.js` | 完成;remember → list → update → recall 往返通过 |
|
|
270
|
-
| P3 | `private.js` fork 显式 `mood: null`;四份整理提示词按回合还原情绪 | 完成 |
|
|
271
|
-
| P4 | 文档与只读展示 | 完成;卡片/抽屉显示 arousal、dominance、emotionSource,编辑控件按 §1.2 不做 |
|
|
272
|
-
|
|
273
|
-
实现期间发现并修正的三处偏差,记在这里避免重犯:
|
|
274
|
-
|
|
275
|
-
1. **`derivedValence` 早期草稿把 anger 记成正贡献**,与"四个纯负轴都为负"冲突。统一为 `0.8 * (joy - anger - sorrow - fear)`。
|
|
276
|
-
2. **`emotion: null` 曾在工具层被 `?? null` 与"省略"合并**,导致"明确中性"被会话心情覆盖。现在三态分开:`undefined` = 继承,`null` = 明确中性,全零对象 = 规范化为 null。
|
|
277
|
-
3. **`dominanceBias(null, x)` 曾因 `Number(null) === 0` 返回 1.05**。现在缺失或非法一律返回 1。
|
|
278
|
-
|
|
279
|
-
验收:`tests/emotion-contract.test.mjs`(17 条,由独立验收者按 §8 编写,不迁就实现)+ 展示侧 `tests/client-render.test.mjs`(卡片/抽屉的 arousal/dominance/emotionSource 行);全量门禁的实测数字只看 `AGENTS.md` §3 的带日期快照,本文件不复制份数(复制的那份一定会在下个版本过时)。
|
|
280
|
-
|
|
281
|
-
端到端链路验证覆盖 8 条:读取、写入四态来源、持久化、更新三态、召回、旧条目降级、展示与协议、远程清洗;36 项断言全通过。
|
|
1
|
+
# 情绪模型规范:四项构成与双辅助轴
|
|
2
|
+
|
|
3
|
+
适用范围:私有记忆的本地情绪读取、记忆写入与召回排序;不扩展全局记忆。
|
|
4
|
+
|
|
5
|
+
本文定义当前数据契约、来源规则与兼容边界。修改实现时,应同时核对本地读取、写入、远程解析、后台整理和展示。
|
|
6
|
+
|
|
7
|
+
## 1. 目标与边界
|
|
8
|
+
|
|
9
|
+
### 1.1 目标
|
|
10
|
+
|
|
11
|
+
1. 在不调用模型的前提下,读取四项情绪构成、arousal 和 dominance。
|
|
12
|
+
2. 保留现有 valence 读写兼容性,并为旧条目提供确定的降级路径。
|
|
13
|
+
3. 让情绪对召回的影响有界、可关闭、可回归测试。
|
|
14
|
+
4. 让后台整理、远程整理和前台写入明确区分情绪来源。
|
|
15
|
+
|
|
16
|
+
### 1.2 非目标
|
|
17
|
+
|
|
18
|
+
- 不给全局记忆增加情绪字段。
|
|
19
|
+
- 不把情绪写入注入文本或记忆正文。
|
|
20
|
+
- 不改变 peak、confidence、accuracyOf、negativityBias 的既有语义。
|
|
21
|
+
- 不引入模型调用或真实模型标注作为运行时依赖。
|
|
22
|
+
- WebUI 提供只读展示,不提供情绪编辑控件。
|
|
23
|
+
|
|
24
|
+
## 2. 实现边界
|
|
25
|
+
|
|
26
|
+
| 位置 | 职责 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `lib/mood.js` | 四轴读取、归一化、派生 valence、门控与衰减 |
|
|
29
|
+
| `lib/state.js` | 保存会话 mood 的兼容字段与四轴数据 |
|
|
30
|
+
| `lib/memory.js` | 解析写入来源、保存条目情绪并计算召回偏置 |
|
|
31
|
+
| `lib/tools.js` | 暴露工具可表达的参数,区分省略与显式中性 |
|
|
32
|
+
| `lib/prompts.js`、`lib/remote-summary.js` | 远程协议与解析校验 |
|
|
33
|
+
| `lib/private.js` | 后台整理绑定不继承即时 mood |
|
|
34
|
+
| `lib/rpc.js`、`lib/client.js` | 投影字段与只读展示 |
|
|
35
|
+
|
|
36
|
+
定位实现时按符号搜索,不依赖固定行号。
|
|
37
|
+
|
|
38
|
+
## 3. 规范化数据契约
|
|
39
|
+
|
|
40
|
+
### 3.1 情绪构成
|
|
41
|
+
|
|
42
|
+
使用四个固定轴:joy、anger、sorrow、fear。
|
|
43
|
+
|
|
44
|
+
有效的非空 emotion 满足:
|
|
45
|
+
- 四个键都存在;值必须是有限数。
|
|
46
|
+
- 每个值必须大于等于 0。
|
|
47
|
+
- 四项之和必须大于 0;写入前归一化到和为 1。
|
|
48
|
+
- 归一化误差要求 abs(sum - 1) < 1e-9。
|
|
49
|
+
|
|
50
|
+
emotion: null 是规范的中性表示。为了兼容工具调用,显式全零对象也接受,但在校验后规范化为 null;它不能被当作四轴全都有少量情绪。
|
|
51
|
+
|
|
52
|
+
非法输入必须拒绝并在错误中包含 emotion:缺键、非有限数、负数、数组、字符串以及除显式全零外的非正和都不能静默修复。实现可对极小浮点误差使用固定容差,但不得把负数 clamp 成合法值。
|
|
53
|
+
|
|
54
|
+
### 3.2 强度与掌控感
|
|
55
|
+
|
|
56
|
+
| 字段 | 范围 | 缺失默认 | 说明 |
|
|
57
|
+
|---|---:|---:|---|
|
|
58
|
+
| arousal | 0..1 | 0.35 | 情绪激活程度;显式 0 保留为 0 |
|
|
59
|
+
| dominance | -1..1 | 0 | 主动/失控程度;显式 0 保留为 0 |
|
|
60
|
+
|
|
61
|
+
缺失和显式值必须区分:缺失使用默认值,显式 arousal: 0 或 dominance: 0 不得被 || 覆盖。
|
|
62
|
+
|
|
63
|
+
内部存储、工具和远程协议统一使用字段 dominance,不再引入 mood_dominance。若未来必须兼容该别名,只能在输入边界映射一次,内部和输出只保留 dominance。
|
|
64
|
+
|
|
65
|
+
### 3.3 记忆条目字段
|
|
66
|
+
|
|
67
|
+
| 字段 | 类型/范围 | 说明 |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| emotion | 四轴对象或 null | 事件的情绪构成 |
|
|
70
|
+
| arousal | 0..1 | 事件激活程度 |
|
|
71
|
+
| dominance | -1..1 | 事件中的主动/失控程度 |
|
|
72
|
+
| emotionSource | model/session/content/unknown | 系统审计字段 |
|
|
73
|
+
| moodValence | -1..1 | 派生的旧路径兼容投影 |
|
|
74
|
+
| peak | boolean | 保持现有语义 |
|
|
75
|
+
|
|
76
|
+
emotionSource 不属于普通用户可编辑字段:model 表示工具参数显式提供;session 表示允许继承当前会话 mood;content 表示从记忆正文读取;unknown 表示没有足够证据。
|
|
77
|
+
|
|
78
|
+
旧条目没有 emotion 时保持原样,不从旧 valence 反推四轴。
|
|
79
|
+
|
|
80
|
+
## 4. 本地读取算法
|
|
81
|
+
|
|
82
|
+
### 4.1 readMood 返回值
|
|
83
|
+
|
|
84
|
+
返回值保留 valence,并包含四轴与辅助字段:
|
|
85
|
+
|
|
86
|
+
{ valence, emotion, arousal, dominance }
|
|
87
|
+
|
|
88
|
+
现有否定预处理必须保留。读取按句切分,在每句内取各轴的最大命中权重,再按规则合并;不得继续使用会把多个命中平均到接近中性的旧算法。
|
|
89
|
+
|
|
90
|
+
- 缓和词按所在分句生效:有点、稍微、一点点、a bit、somewhat。
|
|
91
|
+
- 一点都、一点也不、一点也没不属于缓和词。
|
|
92
|
+
- 强度词和重复标点可以提高 arousal,但必须有明确上限。
|
|
93
|
+
- 未命中可靠情绪词时返回 emotion: null,而不是强行生成均匀分布。
|
|
94
|
+
|
|
95
|
+
### 4.2 dominance
|
|
96
|
+
|
|
97
|
+
使用可解释的词表加构成先验:
|
|
98
|
+
|
|
99
|
+
dominance = clamp(lexicalDominance + 0.4 * (anger - fear), -1, 1)
|
|
100
|
+
|
|
101
|
+
词表中存在歧义词时,不能把结果宣称为事实;dominance 只作为有界排序辅助。词表测试必须覆盖高控制、低控制、怒和惧的相反方向。
|
|
102
|
+
|
|
103
|
+
### 4.3 派生 valence
|
|
104
|
+
|
|
105
|
+
派生 valence 使用以下固定系数:
|
|
106
|
+
|
|
107
|
+
raw = 0.8 * joy - 0.8 * anger - 0.8 * sorrow - 0.8 * fear
|
|
108
|
+
moodValence = clamp(raw, -1, 1)
|
|
109
|
+
|
|
110
|
+
这保证纯怒、纯哀和纯惧为负,纯喜为正;emotion 的构成仍由四轴本身表达,valence 只是旧路径的兼容投影。所有纯轴和代表性复合轴都必须有单元测试,不能同时保留与该结论冲突的经验公式。
|
|
111
|
+
|
|
112
|
+
### 4.4 衰减
|
|
113
|
+
|
|
114
|
+
情绪构成不按比例衰减;强度和掌控感衰减回基线:
|
|
115
|
+
|
|
116
|
+
fade = 0.5 ** (minutes / 90)
|
|
117
|
+
arousal = 0.35 + (arousal - 0.35) * fade
|
|
118
|
+
dominance = dominance * fade
|
|
119
|
+
|
|
120
|
+
当 fade < 0.35 时,emotion 变为 null。边界是严格小于;fade === 0.35 仍保留构成。即使 emotion 变为 null,arousal 和 dominance 仍返回并继续衰减。
|
|
121
|
+
|
|
122
|
+
## 5. 召回语义与兼容降级
|
|
123
|
+
|
|
124
|
+
### 5.1 新路径
|
|
125
|
+
|
|
126
|
+
双方都有合法 emotion 时:
|
|
127
|
+
|
|
128
|
+
overlap(p, q) = sum(min(p[i], q[i]))
|
|
129
|
+
moodBias = 1 + 0.3 * fab * (2 * overlap - 1)
|
|
130
|
+
|
|
131
|
+
moodBias 必须限制在 [0.7, 1.3]。dominance 双方都有有限值时:
|
|
132
|
+
|
|
133
|
+
domBias = 1 + 0.2 * (0.5 - abs(entry.dominance - context.dominance) / 2)
|
|
134
|
+
|
|
135
|
+
domBias 必须限制在 [0.9, 1.1]。任一 dominance 缺失或非法时,domBias 必须为 1,而不是传播 NaN。
|
|
136
|
+
|
|
137
|
+
### 5.2 旧路径
|
|
138
|
+
|
|
139
|
+
读路径必须使用唯一分流:
|
|
140
|
+
1. 双方都有合法 emotion:使用 overlap;
|
|
141
|
+
2. 否则双方都有可用 legacy valence:使用既有 moodCongruence/fadedValence;
|
|
142
|
+
3. 否则:情绪乘数为 1。
|
|
143
|
+
|
|
144
|
+
旧条目不反推 emotion。新字段接入召回后,必须验证旧条目、旧会话 mood 和缺失字段不会产生 NaN。
|
|
145
|
+
|
|
146
|
+
### 5.3 门控
|
|
147
|
+
|
|
148
|
+
门控是三条独立条件的 OR:
|
|
149
|
+
|
|
150
|
+
emotionActive = (emotion !== null && maxShare(emotion) >= 0.35) || abs(arousal - 0.35) >= 0.1 || abs(dominance) >= 0.25
|
|
151
|
+
|
|
152
|
+
emotion === null 只会关闭第一条,不会关闭 arousal 或 dominance 两条。必须测试 null+高 arousal 开启、null+高 dominance 开启、全基线关闭,以及非空低 share。
|
|
153
|
+
|
|
154
|
+
arousal intensity 代理应使用 max(arousal, maxShare(emotion), legacyValenceProxy, peak ? 1 : 0);没有 emotion 时只使用旧字段和 arousal。
|
|
155
|
+
|
|
156
|
+
## 6. 写入、远程和 fork 语义
|
|
157
|
+
|
|
158
|
+
### 6.1 工具参数
|
|
159
|
+
|
|
160
|
+
核心写入接口支持 `emotion: object|null`、`arousal: number` 与 `dominance: number`。宿主工具 schema 中 emotion 为对象;需要明确中性时使用全零对象,由核心规范化为 null,不要求工具 schema 接受 null。
|
|
161
|
+
|
|
162
|
+
remember 省略 emotion 时按 §6.3 的来源优先级解析;显式 null 或全零对象表示中性。emotion 描述记忆所述事件,而非整理时的心情,工程事实(`owner=about_project`)保持中性。
|
|
163
|
+
|
|
164
|
+
update 省略字段时保留原值;核心接口显式 null 清除 emotion 并将来源设为 unknown,显式对象使用相同校验与归一化。
|
|
165
|
+
|
|
166
|
+
### 6.2 远程 JSON
|
|
167
|
+
|
|
168
|
+
远程协议只输出一个 JSON 对象,字段使用统一名称:
|
|
169
|
+
|
|
170
|
+
{ memories: [{ title, content, emotion: null, arousal: 0.35, dominance: 0, mood_valence: 0, source: inferred, visibility: shared }] }
|
|
171
|
+
|
|
172
|
+
visibility 只允许当前代码支持的 shared 或 secret;不得再使用已废弃的 session。远程缺字段时回落到兼容默认;字段存在但非法时应记录可诊断错误并拒绝该条,不静默改成合法情绪。
|
|
173
|
+
|
|
174
|
+
### 6.3 后台整理 fork
|
|
175
|
+
|
|
176
|
+
后台 fork 不继承父会话的即时 mood。创建子 binding 时显式使用 mood: null,避免把整理时的心情误写成事件情绪。
|
|
177
|
+
|
|
178
|
+
写入来源优先级:模型显式 emotion -> model;允许继承且存在 session mood -> session;从该条 content 读取出可靠情绪 -> content;否则 emotion=null、dominance=0、arousal=0.35、source=unknown。工程事实固定使用中性。
|
|
179
|
+
|
|
180
|
+
## 7. 集成约束
|
|
181
|
+
|
|
182
|
+
- 本地读取保留 valence 返回值,新增字段不得破坏旧会话 mood 的读取。
|
|
183
|
+
- 召回使用 §5 的唯一分流和有界乘数;修改读取结果可能改变排序,需要对应回归用例。
|
|
184
|
+
- 写入、远程协议、RPC 与只读展示使用相同字段名和归一化规则。
|
|
185
|
+
- 后台 fork 的 mood 来源与父会话隔离,emotionSource 由系统解析而非普通更新参数指定。
|
|
186
|
+
|
|
187
|
+
## 8. 验收标准
|
|
188
|
+
|
|
189
|
+
- 有效 emotion 归一后和为 1,所有分量非负。
|
|
190
|
+
- 缺键、负数、非有限数、数组和非法 dominance 被拒绝。
|
|
191
|
+
- 全零输入规范化为 null;null 不生成均匀分布。
|
|
192
|
+
- 四个纯轴的 derived valence 方向正确;复合轴结果可复算。
|
|
193
|
+
- overlap 自反、对称且在 [0,1];bias 范围始终满足上界。
|
|
194
|
+
- 门控测试覆盖 null、高 arousal、高 dominance 和低 share。
|
|
195
|
+
- decay 在 0.35 两侧有明确、稳定结果。
|
|
196
|
+
- readMood(...).valence 继续存在;旧 setSessionMood({ valence, arousal }) 继续可读。
|
|
197
|
+
- 旧条目无 emotion 时不反推四轴。
|
|
198
|
+
- 远程缺字段可解析,非法字段可诊断拒绝。
|
|
199
|
+
- fork 不继承父即时 mood;工程事实保持中性。
|
|
200
|
+
- remember -> list -> update -> recall 往返保留字段和来源。
|
|
201
|
+
|
|
202
|
+
项目门禁:node --check changed JS files;npm test 必须 exit 0(允许明确列出的 skipped);node scripts/acceptance-local.mjs;npm run check;git diff --check。文档中的测试数字不是永久常量,报告必须记录本次实际结果,不得以 fail 0 替代成功退出。
|
|
203
|
+
|
|
204
|
+
## 9. 风险与默认决策
|
|
205
|
+
|
|
206
|
+
- 词典推断不是事实识别;dominance 只能作为低权重排序信号。
|
|
207
|
+
- 四轴归一化会丢失强弱,强弱由 arousal 承载。
|
|
208
|
+
- fade < 0.35 有离散边界;实现不得私自改变契约。
|
|
209
|
+
- 远程模型可能输出不符合协议的 JSON;严格校验优先于尽量解析。
|
|
210
|
+
|
|
211
|
+
默认决策:四轴为 joy/anger/sorrow/fear;保留 valence;dominance 作为有界召回辅助轴;门控阈值 0.35;保留旧条目的兼容读取路径;WebUI 只读;远程和工具统一使用 dominance。
|
|
212
|
+
|
|
213
|
+
## 附录 A:初始词表与测试样例
|
|
214
|
+
|
|
215
|
+
初始词表至少覆盖:
|
|
216
|
+
- joy:开心、高兴、太好了、喜欢、爱、满意、惊喜、谢谢、期待;
|
|
217
|
+
- anger:气、烦、讨厌、气死、烦死、离谱、凭什么、受不了、恨;
|
|
218
|
+
- sorrow:难过、失望、崩溃、委屈、心疼、累、困、没意思;
|
|
219
|
+
- fear:害怕、恐慌、焦虑、担心、紧张、慌、吓死、不敢、万一;
|
|
220
|
+
- compounds:尴尬、嫉妒等必须有明确词条或明确组合规则,不能只出现在测试期望中。
|
|
221
|
+
|
|
222
|
+
复合预设是可解释的初始建议,不是硬编码事实:
|
|
223
|
+
|
|
224
|
+
| 表达 | 建议构成 | 建议 dominance |
|
|
225
|
+
|---|---|---:|
|
|
226
|
+
| 委屈 | sorrow 0.70 / anger 0.30 | -0.4 |
|
|
227
|
+
| 尴尬 | sorrow 0.50 / fear 0.50 | -0.5 |
|
|
228
|
+
| 嫉妒 | anger 0.50 / sorrow 0.30 / fear 0.20 | -0.1 |
|
|
229
|
+
| 心疼 | sorrow 0.80 / joy 0.20 | -0.2 |
|
|
230
|
+
| 不甘 | anger 0.60 / sorrow 0.40 | +0.4 |
|
|
231
|
+
|
|
232
|
+
验收样例必须把期望写成可计算范围:分别统计主导轴准确率、null precision/recall、arousal 误差和 dominance 误差;复合情绪允许 top-2 轴集合匹配并记录容差。
|
|
233
|
+
|
|
234
|
+
## 附录 B:维护检查清单
|
|
235
|
+
|
|
236
|
+
- normalizeEmotion、derivedValence、overlap 与门控真值表符合本文。
|
|
237
|
+
- remember 与 update 的省略、null、全零对象语义分别校验。
|
|
238
|
+
- 远程字段名与 visibility 枚举一致。
|
|
239
|
+
- 旧 index、旧 binding 与后台 fork 具备兼容用例。
|
|
240
|
+
- 以测试进程退出码和当次报告判断结果,不复制历史通过数量。
|
|
241
|
+
|
|
242
|
+
## 10. 兼容不变量
|
|
243
|
+
|
|
244
|
+
- derivedValence 使用 `0.8 * (joy - anger - sorrow - fear)`。
|
|
245
|
+
- 明确中性不能被省略语义或会话情绪覆盖。
|
|
246
|
+
- dominance 缺失或非法时,dominanceBias 返回 1。
|
|
247
|
+
- 卡片与抽屉只读展示 arousal、dominance、emotionSource。
|