lingshu-skill 5.70.0 → 5.71.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 +45 -0
- package/SKILL-lite.md +1 -1
- package/SKILL-tiny.md +1 -1
- package/SKILL.md +1 -1
- package/cordis-plugin/lingshu-cron/plugin.js +36 -14
- package/cordis-plugin/lingshu-im/plugin.js +67 -15
- package/manifest.json +35 -35
- package/package.json +1 -1
- package/scripts/assembler.py +8 -2
- package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +88 -16
- package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +45 -0
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/assembler.py +8 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/checkpoint.py +13 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/dream.py +45 -0
- package/scripts/astrbot_plugin_lingshu/engine/scripts/emotion.py +13 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/growth_parts.py +5 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/memory.py +62 -6
- package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_cloud.py +47 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_server.py +12 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/persona.py +10 -4
- package/scripts/astrbot_plugin_lingshu/engine/scripts/safety.py +6 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/session_import.py +6 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/session_rag.py +68 -21
- package/scripts/astrbot_plugin_lingshu/make_checksums.py +8 -4
- package/scripts/checkpoint.py +13 -2
- package/scripts/dream.py +45 -0
- package/scripts/emotion.py +13 -2
- package/scripts/growth_parts.py +5 -1
- package/scripts/memory.py +62 -6
- package/scripts/panel_cloud.py +47 -1
- package/scripts/panel_server.py +12 -2
- package/scripts/persona.py +10 -4
- package/scripts/safety.py +6 -1
- package/scripts/session_import.py +6 -2
- package/scripts/session_rag.py +68 -21
|
@@ -1,20 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PATCH_NOTES.md": "9296e524f743f358fd11115598398a754cfd69534526dde9c8ad85f14a418f89",
|
|
3
3
|
"README.md": "3d634d743b085eebd2cbb5dd3a00edfa728ed23947e20cc29e7c3b29087ec043",
|
|
4
|
-
"
|
|
4
|
+
"_conf_schema.json": "51a484cfa04a686bc923e960f5937e19eb52bb329a937050c268ad1cc5c12170",
|
|
5
|
+
"engine/CHANGELOG.md": "ded9e237679c18e7f27677695653af9c7ae77a8432f5daa6732c851c8650b047",
|
|
5
6
|
"engine/README.md": "5ab87b76dc757e6edd6ef1d760e9a979e55df48b2b8c2b76552747fabb7b1026",
|
|
6
|
-
"engine/SKILL-lite.md": "
|
|
7
|
-
"engine/SKILL-tiny.md": "
|
|
8
|
-
"engine/SKILL.md": "
|
|
7
|
+
"engine/SKILL-lite.md": "210f7cc4ff48196c8280a2a6d6c3f87549beced1984cbea9f404ed2d960cb339",
|
|
8
|
+
"engine/SKILL-tiny.md": "dc2db6c193e93d57d0dd64098089d61217d25b2ae070627eb9088b8bfde88a3d",
|
|
9
|
+
"engine/SKILL.md": "52bee9e349c1298d19a0b0c91dfb6bb8c36425fd4dbc27e5f08c61c66e0f034f",
|
|
9
10
|
"engine/assets/panel.html": "7b8f3c1d595e14a06e266ea89c90620f3ce2223c2af2a089e407df734df28e17",
|
|
10
11
|
"engine/docs/commands.md": "0ce8c88e5d2d04a8055b45c060ebd53b50c52b79b650312e2ee440845804ca4b",
|
|
11
12
|
"engine/docs/mechanics.md": "aa9683c827ed3419106e84d847ab16dc310c27fc62f588184192aaa1617523cc",
|
|
12
13
|
"engine/docs/models.md": "596bc1a3414f2de5569dcb41a0c494acae7daa534efd5a91dbcc3c4cb308d695",
|
|
13
14
|
"engine/docs/panel-api.md": "d57f793c7504c50272a16d99f7d6bcd3fd6a246bad8f049199920ff0f0f00f00",
|
|
14
15
|
"engine/docs/recovery.md": "2e9443d8416048c72ebe5cbec03a437fb833e41f4cd6cc4b3c8ee14ea73a0e8e",
|
|
16
|
+
"engine/scripts/_ci_env_probe.py": "2e98d3333348b639db6e4f851bbfc1c5a2c068245cc73c5d094e625cbfb23fa8",
|
|
17
|
+
"engine/scripts/_panel_smoke_v299.py": "f3076d0c434cb9d42d2bd54bf02fad3715b64aee0570deec0fe9198315c5ab8c",
|
|
18
|
+
"engine/scripts/_smoke_v299.py": "0fb9781809d89b5e529f31e6089997fec715ca99c92c13f26f669d6a3f6290bd",
|
|
19
|
+
"engine/scripts/_sync_trae_cn.py": "dfa1110843cf4e74add507e7326a0d03515c26f8c59119e59b319873c70cbc80",
|
|
20
|
+
"engine/scripts/_tmp_add_s10.py": "821e0bc8513288a2b5c4f855ce55bab1a3e1fa180a536ceba9bda58f9a889369",
|
|
21
|
+
"engine/scripts/_tmp_add_s11.py": "ab8ca0bd8e0f5af3d1030350f76956a1d537ed4fb9e9fac813e7f9cd3f053012",
|
|
22
|
+
"engine/scripts/_tmp_add_s12.py": "e732b6c5f76ba8f4170d7aaacc8fa19738cd382fdb353cc0fb607af9dcd9b33c",
|
|
23
|
+
"engine/scripts/_tmp_add_s13.py": "76be3366b74335a14b63d784b4855e425677592bdb1fe27f673dacf98b6b5a2b",
|
|
24
|
+
"engine/scripts/_tmp_add_s14.py": "d0c5d65bb808235273cd422fb666ca3cad51cf00ca393d275e1610f8e4dd3475",
|
|
25
|
+
"engine/scripts/_tmp_add_s9.py": "b8d454d884ab969777214e233aa21a4ca2c89cd4ac9fb4dc2e3307ff80ba42dd",
|
|
26
|
+
"engine/scripts/_tmp_cache_load.py": "e9c7083349bdf9b347270864f2b6efea5312bbb8deee872c38a8e61177f5e193",
|
|
27
|
+
"engine/scripts/_tmp_clean_market.py": "819350c93eddb19abf96ba87f678696626bf9da21d54d23946643d9c04739621",
|
|
28
|
+
"engine/scripts/_tmp_clean_pruned.py": "e28765f3fe480a98f3c0c43d6401c797573f552fb50d08d7b04561d22e6ff4f2",
|
|
29
|
+
"engine/scripts/_tmp_cleanup_docs.py": "c5362fe8e035793be93a7b91f6450abcb0e685de59a525f8c55fa054228c94e2",
|
|
30
|
+
"engine/scripts/_tmp_cmp_ranker.py": "43d799682f2f99bd6d6ce19fcbcee63ef121843ecc5d6438a9af57df48d8b453",
|
|
31
|
+
"engine/scripts/_tmp_dolater_note.py": "2c9792b1a13b67696ec4dd94397e7a7a24d319f6446e493e33a822a40a3265db",
|
|
32
|
+
"engine/scripts/_tmp_dust_why.py": "a35c5224a6d4b348137d1ebce1cbeadb1469bbf9206c6cc44f9e8e95a104d3c7",
|
|
33
|
+
"engine/scripts/_tmp_explicit_import.py": "98a8857af111bba4f59667b510601e244010e249bf4c492e60cf015702981fca",
|
|
34
|
+
"engine/scripts/_tmp_extract_compaction.py": "76ef81308937ae252735a96370327d1a06b32aeb3a47b75b33a87fbdcec7c641",
|
|
35
|
+
"engine/scripts/_tmp_extract_compaction2.py": "65a35e76e9d52fec93b21cdc77674c3c163215a2a085f5fac2baa5f98f27e8c3",
|
|
36
|
+
"engine/scripts/_tmp_extract_compaction3.py": "9b9af7199dbe3b63fa006f4f99115c770da74471066064369b51bc19ce8bb1e1",
|
|
37
|
+
"engine/scripts/_tmp_extract_compaction4.py": "8598b1e272617dfea453d0c5b26314d66ed828e9a90d0ffcc8b2860277fe794f",
|
|
38
|
+
"engine/scripts/_tmp_finalize_s14.py": "7516e38403e55647731e675dca57ab432d2e7fe7088470225bec67ca33611742",
|
|
39
|
+
"engine/scripts/_tmp_find_compaction.py": "f7d47198f2a763f41e3c2f662e55c5c71afe2a97fe0e243fbdc93a5533c67ba9",
|
|
40
|
+
"engine/scripts/_tmp_fix_b4.py": "e6266a7eba63a6c14e776110673f9a87d39ff8d9603892ad7cf9587e216de862",
|
|
41
|
+
"engine/scripts/_tmp_fix_cli76.py": "bb75d216091fc0c8c7d9200b067f270c7a37b81c4e4f5888cd54300e5ddcb465",
|
|
42
|
+
"engine/scripts/_tmp_fix_docs.py": "566677f5422c2774d55e5ca287d1a0d54d8f37ac0faebb6b9cae241bafc3561f",
|
|
43
|
+
"engine/scripts/_tmp_fix_docs_b.py": "6707aba7d372a6aa24087408317987ca09aefb9f4cdd00dc84acc6504d29bcd9",
|
|
44
|
+
"engine/scripts/_tmp_fix_docs_b2.py": "71ad0b492afedbfd42ef9d272b408b91574a1d876fb8736bf947866c354825a5",
|
|
45
|
+
"engine/scripts/_tmp_fix_i3.py": "8d6d7584ae3171154509e5b88c276269fc583360bca69d2837eea91f4a85a911",
|
|
46
|
+
"engine/scripts/_tmp_fix_s10.py": "147cd15867943fc2c406a6ff192e5b832141297e9fa37da9c788e9e05f6cfaee",
|
|
47
|
+
"engine/scripts/_tmp_fix_s11.py": "d0983dd11c3f74f3174fcd4300cf43a4e699105307328411628aed120ffe439b",
|
|
48
|
+
"engine/scripts/_tmp_fix_s9_status.py": "bb615ceb25845ed25437a478e9f191cf02790072dbaa3e71f6fa8f8b50923600",
|
|
49
|
+
"engine/scripts/_tmp_fix_shadow_sim.py": "c5c60f2f117d0bd2337b50a58c85a53a5691a8166585cf3bce9bbee4f2e74a30",
|
|
50
|
+
"engine/scripts/_tmp_fix_traits_value.py": "b352af37ff0eaecfd5eb53b2f5625979ea176df3098a771f680b230bd018b9ad",
|
|
51
|
+
"engine/scripts/_tmp_import_idem.py": "397446dec408d2611d1001c7898f67dc4b214fd24fa7c9b443030de701648f39",
|
|
52
|
+
"engine/scripts/_tmp_log_ack.py": "0fa11002110e666357323e9c1f53dc1e32e1b7d92c9219371467e44224008142",
|
|
53
|
+
"engine/scripts/_tmp_mark_batch.py": "900b25d5e6fc7f889aa1a7f5e424a6abe4458fd4ad82d8a077e37d0b1dc3e1c1",
|
|
54
|
+
"engine/scripts/_tmp_mark_batch2.py": "8c49a609f1bbd90ed476012a5d41114f72a4df5adc029bdf627e7e11d3d025a7",
|
|
55
|
+
"engine/scripts/_tmp_mark_dolater.py": "eb44f191be6c59f704913cbf4991fa22f820d0dae5ac51330b3410168a293b7d",
|
|
56
|
+
"engine/scripts/_tmp_mark_dolater2.py": "c3ce317304adee688380ec9bf743c61ec15e7da7bc8ff2702f0495c73f70861b",
|
|
57
|
+
"engine/scripts/_tmp_move_self.py": "f7b41aa5e730a61b10ef942226d7b88483a2422b37fee5f0acb8f505ec413115",
|
|
58
|
+
"engine/scripts/_tmp_occ_cli.py": "4573823fab994b89dfa5af502989279609c336edbf734166d69fa0aa098a4cde",
|
|
59
|
+
"engine/scripts/_tmp_occ_link.py": "7023c4c7a24cdec5db114364e5fccbb7173d2cd12bbb05ff88e6dda247937436",
|
|
60
|
+
"engine/scripts/_tmp_optimize_recall.py": "cbefe2f9b6107526c70bb23c8f1a318d1ca828420009bf63154a5c2fd20edbe8",
|
|
61
|
+
"engine/scripts/_tmp_panel_audit.py": "41a5446595352d1a74d17fb78114b24eb9cf73618b1fd03ce8b58229f9c0b7c1",
|
|
62
|
+
"engine/scripts/_tmp_patch_batch3.py": "b8b3936ec2786da862afb7c35ec23ebdeaf79aed45d677cca6174a9c25f96d5d",
|
|
63
|
+
"engine/scripts/_tmp_patch_rrf.py": "dc738ee16dc97eb120044a883c6dc3cead07cbff0dfa9dc508d7bb622395e310",
|
|
64
|
+
"engine/scripts/_tmp_patch_s2s3.py": "9acbd369fb21899d0102754540482069c89feefd87e885512a47bb1861ad3f7e",
|
|
65
|
+
"engine/scripts/_tmp_patch_s4.py": "e2925f735c6bb836ab08130e688eb37fbb67257f9b7089ace4f2d446b6890374",
|
|
66
|
+
"engine/scripts/_tmp_patch_s7.py": "786a593793fd1bf7a8af793bfebbdd91f97275d4c3bcf8d36716b2f9b2d53b45",
|
|
67
|
+
"engine/scripts/_tmp_patch_s8.py": "ea9b09dc30de218e424eb1bb0a7405ef31cca84d21298c0af0a060a4975e3842",
|
|
68
|
+
"engine/scripts/_tmp_patch_skill.py": "f072858b539564f6579474c9054e687b907667d05448ab6d360d64c244915f25",
|
|
69
|
+
"engine/scripts/_tmp_release_guard.py": "cd063f714e6528f4061962a72fa53c66ec780ee75f663047b82ae54eca2ff2f7",
|
|
70
|
+
"engine/scripts/_tmp_rerank_breaker.py": "61b20d4b843293879989c55edf667c98ab42007cdb80ae6987a85cb54796594a",
|
|
71
|
+
"engine/scripts/_tmp_s16.py": "e6902f5e89df8dc47dadc0f82426177ebef23ee795453e0e85ab0de316f6d1f0",
|
|
72
|
+
"engine/scripts/_tmp_scan_asar.py": "b30bab4786a39242e620a0c7f7c508f35ae6bc41a1f3de01ecef3e4be8f09c18",
|
|
73
|
+
"engine/scripts/_tmp_scan_asar2.py": "2591b66a7d43ffb230ed90403c8946f3d5341c8362ee66088c5d3731dca0b935",
|
|
74
|
+
"engine/scripts/_tmp_speed_survey.py": "c9d765f074b37bdc757e7c26c9aa9d03c8fc57dc7673e7df391111003cd0be7c",
|
|
75
|
+
"engine/scripts/_tmp_struct_docs.py": "3a363fa3e75cae0cea88e22dde612629aa3d7b5162e221ffa047565087ea44e9",
|
|
76
|
+
"engine/scripts/_tmp_sum_fallback.py": "d7163708ca2005267ba86f259a1097b4566844ce6771af265506a188c9c044e5",
|
|
77
|
+
"engine/scripts/_tmp_sweep.py": "ed22f543c0b3f956d77396c3d401707434397b384dde011c871178d55b6754e8",
|
|
78
|
+
"engine/scripts/_tmp_sync_check.py": "c6ddf8486a9d6f26ea6ad5f7f79b0bac13de5e1d4e2d6e948d8c0d55d29f7b03",
|
|
79
|
+
"engine/scripts/_tmp_sync_tail.py": "3d2316e28d6b2f99666140d85c995d1115485e3b977c2a0e5b6b09012808411e",
|
|
80
|
+
"engine/scripts/_tmp_todo_clean.py": "150123220ca1da99bc5f9bfa8fefb8e46b13f810275bb8754b5267b4781d53c4",
|
|
81
|
+
"engine/scripts/_tmp_verify_copy.py": "8dc91571de6a1f52e69ffaef831eee7ff90a50eaec0a786882893361d98b4717",
|
|
82
|
+
"engine/scripts/_tmp_wire_extras.py": "636a7c9d66a1cb02391fa15bf59221e3a9a692aa34d002e86e0e5a87d73b7454",
|
|
83
|
+
"engine/scripts/_tmp_wire_hsum.py": "e74bddc3967607b28e0dc00110bfa80c473b9cf1f622d0110b094a0569d22a0d",
|
|
84
|
+
"engine/scripts/_tmp_wire_occ_b5.py": "9de9d1dce7c89c7268d82675a7eb9719ea5caa9a7ff0ef5c8e4b91c07a90c5ef",
|
|
85
|
+
"engine/scripts/_tmp_wire_ranker.py": "92b406c3c247305f4002099089dc24f941d62c59565865f836acc25665df3752",
|
|
86
|
+
"engine/scripts/_tmp_wire_shadow_timeline.py": "db191a755daea2885452d94a152cc6cb74f111f99f9d0944881c3af3b1fa448c",
|
|
15
87
|
"engine/scripts/anchor_retention.py": "327862125cbe9b1c5aaaf14f0b9334031f0906c5c10b15367af53bfe3f905d16",
|
|
16
88
|
"engine/scripts/app_context.py": "1541a133d5381e21b30f5e856869c6a170add9e20f8792cf049f2acca6da86c6",
|
|
17
|
-
"engine/scripts/assembler.py": "
|
|
89
|
+
"engine/scripts/assembler.py": "60bbb5ebe238d54f9f4bdecbbf0e24cfa9793102b6f1f734e796560786482205",
|
|
18
90
|
"engine/scripts/behavior_baseline.py": "7f488663082f301426c98f291a31860dd159a6097eba6ff225e4912f1b222272",
|
|
19
91
|
"engine/scripts/bench.py": "7e410bb94a93c8e0b4fd8187ede7a3f7f6cf171e43a2884a836b6734e23e9dc0",
|
|
20
92
|
"engine/scripts/bigfive.py": "d998558c73584ebdd0b2535e687b4f8af25437bdadec229f7d0bad090ed482bb",
|
|
@@ -22,20 +94,20 @@
|
|
|
22
94
|
"engine/scripts/check_docs.py": "27dcc2a55c500db334ba04e475f6a3fb326a45bea31ff394817ea3a50864400b",
|
|
23
95
|
"engine/scripts/check_pressure_sync.py": "d7ea8acfa8a2d07baca12c9a6664c76a259766d6e1cecf06963ed30241f9bb8b",
|
|
24
96
|
"engine/scripts/check_tag.py": "fd333d0983ff075ea7340532dfeed62ab05ab521d169b44ff8a928d418c7dd22",
|
|
25
|
-
"engine/scripts/checkpoint.py": "
|
|
97
|
+
"engine/scripts/checkpoint.py": "9963cac0dffbb5fbaedbde9db40323abd19fc8c53250955f3b9119371144b31a",
|
|
26
98
|
"engine/scripts/cli.py": "e68709f183eae3cb407732f52df91fd65d22f4327b101a8bbc26df93c2a7b69f",
|
|
27
99
|
"engine/scripts/context_ab.py": "3d383f1fc16d328612825bbf731866fa427da0746490d027a0ddb719d210f1cb",
|
|
28
100
|
"engine/scripts/core.py": "5e369e0f9185f88f096fe21967a226013b1fc8d70653268b6ee1a0d2a4c9da79",
|
|
29
101
|
"engine/scripts/coverage_report.py": "53e1c731f4182fac68190d68d23459bcd8059c0b39ebc5a4ba0e56a0d562ad01",
|
|
30
102
|
"engine/scripts/delivery.py": "6a4bf2caac9dca41b43c06d31f7cfc328bae19d3fb618da26b35f1a214071a11",
|
|
31
103
|
"engine/scripts/desktop_shortcut.py": "975b76d49c9d6b3220f7d45327e801a5d8c74aff39eae2e3fbdf86b38c7994cc",
|
|
32
|
-
"engine/scripts/dream.py": "
|
|
33
|
-
"engine/scripts/emotion.py": "
|
|
104
|
+
"engine/scripts/dream.py": "0d3f2fe45890b401b1dc541bf42e34aeb3153f12471ffa0a8b94b1681759002a",
|
|
105
|
+
"engine/scripts/emotion.py": "e0b4451e05e99dd651c79b9d927191d963824012e7b03aba933d92e111368965",
|
|
34
106
|
"engine/scripts/failures.py": "3a16234a1871f62e3ba7b7b743110b4044fb7b715b4d0e924b8ebf1cf0be50d0",
|
|
35
107
|
"engine/scripts/fallback_embed.py": "11339a9f5040aea8952fdd45f4183cdfb0f00266ff61e200f3b4e8a62778f6e0",
|
|
36
108
|
"engine/scripts/gap_memory.py": "cb4b46479cf77b706205bf2e2e2c806d6b1952a7924ee9517425e026f53df577",
|
|
37
109
|
"engine/scripts/growth.py": "e6324cdbda4d4f459b1bf367d52a91b772f1a72cc46cb17a83993e1630fb91a3",
|
|
38
|
-
"engine/scripts/growth_parts.py": "
|
|
110
|
+
"engine/scripts/growth_parts.py": "84321f429394aaf1295e445e46ef2f09ab6881e66c47d16cb789eff86279b572",
|
|
39
111
|
"engine/scripts/hsum.py": "d14ad5cd24714cd7974d2db7846e1f941115faa817c92914ae6e1a71b1423608",
|
|
40
112
|
"engine/scripts/insights.py": "3ed8d8aedb79b7c578985285e5838cc93a58163383ac83caf0e45eb343e9c27e",
|
|
41
113
|
"engine/scripts/make_dsh_tgz.py": "f65a87b8a4a4cee5b589adb4b2d75797b10fb4c9392ecc196b698efa78d509ed",
|
|
@@ -46,30 +118,30 @@
|
|
|
46
118
|
"engine/scripts/mem_lesson.py": "e1520786315f3e41c829909c739e5af3eee89397da7db5026d106710b2b3c118",
|
|
47
119
|
"engine/scripts/mem_score.py": "91148eb50058c47a6094a6cd5e0eb9c3e3331cb0dc0ecb05a82d00905d2e9d90",
|
|
48
120
|
"engine/scripts/mem_topic.py": "c22f75c128cdd3b26ff845f1a71608401bc0dc8955f9f0e1988d7f0cd663d0d5",
|
|
49
|
-
"engine/scripts/memory.py": "
|
|
121
|
+
"engine/scripts/memory.py": "eae2e89140b8543fd5c53c3b4504961a0b9769ff779091148d7c3b2df795267e",
|
|
50
122
|
"engine/scripts/memory_extras.py": "4adb61400c5224c90aa54f059267f795c6348a251d93cd173d79fff157d57d90",
|
|
51
123
|
"engine/scripts/npm_prepack.py": "d62c491a6f9edfcab2dd465a995e72df879a61b4da26ae0fe76121c8adc77e02",
|
|
52
124
|
"engine/scripts/occ.py": "4caac0d72ce071ea224ce2dc7d346effdbff8a516e3e7b54118a3be3ed274256",
|
|
53
125
|
"engine/scripts/panel_build.py": "5dfc687631c9818370d8392aca1443ce605f2e8994c2277019f0742e42008567",
|
|
54
|
-
"engine/scripts/panel_cloud.py": "
|
|
126
|
+
"engine/scripts/panel_cloud.py": "bb0762f93efd0cdbb0db7f4541935a39c77579f6c1c7c974afa5094c8f0399f6",
|
|
55
127
|
"engine/scripts/panel_data.py": "189eadcba9139fc934fc22fcd62911828b28fe3a4a189c8c0598043d227ea37b",
|
|
56
128
|
"engine/scripts/panel_icon.py": "8b766740c547087c4d40ab7031a8b6845f3e0bdd3893079d2da22bb9c9694a9f",
|
|
57
129
|
"engine/scripts/panel_launcher.py": "c27c195acc126dace8b99f66906bbdb64ef4dcb4a66513907ebd4df159b97af1",
|
|
58
|
-
"engine/scripts/panel_server.py": "
|
|
130
|
+
"engine/scripts/panel_server.py": "3e34c3461994f57d61d0bdcd6d81a575e03d18591f618f8d2e445a2618465ba3",
|
|
59
131
|
"engine/scripts/panel_settings.py": "1d33fc5bf46ee64e3d1b052ecfa1b998a5da55a58e55807182a7214f8594b15b",
|
|
60
132
|
"engine/scripts/panel_shortcut.py": "956374abe9d1e2b63618223e861f696070b6c0368a757f5a630f441c854ea1ea",
|
|
61
133
|
"engine/scripts/panel_splash.py": "36cd59e593ce52557a180a8767bfa9cd9c803f0cccaa141e7da8babd5a35e925",
|
|
62
134
|
"engine/scripts/panel_update.py": "b6256af938fec44e7e0c0073d7ed3f2b50487f6d52cea5772fe175d222b09f0d",
|
|
63
135
|
"engine/scripts/panels.py": "3000f170d42c0e200dd82ed12e8da8b4c62e0e3e1e47f232f3272a798078f59d",
|
|
64
|
-
"engine/scripts/persona.py": "
|
|
136
|
+
"engine/scripts/persona.py": "bc09d5bf148590e370a38fb78aaef84b6521818b536728efb3123a716f0b3916",
|
|
65
137
|
"engine/scripts/prepublish_tests.py": "8d116de1edd3ab57584a6a2749598cf127e918383da67e50118601e5a3970c2a",
|
|
66
138
|
"engine/scripts/release.py": "36491d76fdd76693c164e441f70ac063a4c4b10c2e36eed06d705f57f55895b6",
|
|
67
139
|
"engine/scripts/retriever.py": "208b58f4df062bca859eef607e258cc4233791552454fdd3a02051a18f7e0786",
|
|
68
140
|
"engine/scripts/rss_ingest.py": "21532e5798081872f46638a9b57ea5ebaefea90dff20ebabc05dfd727b30f220",
|
|
69
|
-
"engine/scripts/safety.py": "
|
|
141
|
+
"engine/scripts/safety.py": "1ae280f1f03feecf8b735b6305b136b5809d138c168e22e1d9fa5495b77fb145",
|
|
70
142
|
"engine/scripts/safety_net.py": "678d9286c83530e5196f4e46ef195d7e4686fe7f9bcbff0af57ff1b97827376e",
|
|
71
|
-
"engine/scripts/session_import.py": "
|
|
72
|
-
"engine/scripts/session_rag.py": "
|
|
143
|
+
"engine/scripts/session_import.py": "61ddf40707e0b11d9c958040f2024d1fc7c4dc45eb798ed0a4befcce38713bbe",
|
|
144
|
+
"engine/scripts/session_rag.py": "60fe617e3ca9863d9f77957421ce81de91a533452618d3dbb84a81cf1826df5e",
|
|
73
145
|
"engine/scripts/session_summary.py": "290d6cff75c68461f03bcad8d691793fb9c79612d4c44b3da22679fab021a149",
|
|
74
146
|
"engine/scripts/shadow_memory.py": "3543198649a9b8b70cdcaa591f71eeb48da1eb47440b988cfbe31f2c63a3715a",
|
|
75
147
|
"engine/scripts/shape_audit.py": "3c361b8138d95c1e11476092e4d4da2eba71d9ed5300857bb3ce9113a8bf3be7",
|
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v5.71(2026-12-05)
|
|
4
|
+
|
|
5
|
+
### 🎉 150 项审计最终批:全量缺口大收官!
|
|
6
|
+
|
|
7
|
+
本批一次性闭环最后 29 项待办,150 项审计**全部完成**:
|
|
8
|
+
|
|
9
|
+
**记忆与人格(高危)**:
|
|
10
|
+
1. **LS-001**:`safety.py` 修复 POSIX 危险路径子目录绕过——系统目录前缀分隔符跟随平台(`/` vs `\`)。
|
|
11
|
+
2. **LS-019**:`memory.py` 归档召回保留缺少 id 的旧记录,按内容哈希合成稳定 id。
|
|
12
|
+
3. **LS-020**:`memory.py` purge 冷静期检查 fail-closed——时间戳缺失/无效拒绝物理删除。
|
|
13
|
+
4. **LS-021**:`memory.py` trash_restore 按 deleted_at 选取最新版本台账记录。
|
|
14
|
+
5. **LS-023**:`memory.py` 批量 discard/delete 遵守置顶保护,跳过并回报。
|
|
15
|
+
6. **LS-026**:`persona.py` 人格自愈回滚在只读模式不写盘。
|
|
16
|
+
7. **LS-027**:`persona.py` 写 lastgood 前执行完整结构校验。
|
|
17
|
+
8. **LS-028**:`emotion.py` 补齐独立导入依赖(mind_state/default_onboarding)。
|
|
18
|
+
9. **LS-030**:`dream.py` 旧 pending 存在时合并新簇,避免新簇永久丢失。
|
|
19
|
+
10. **LS-032**:`dream.py` 禁止 aggregate 标志绕过审核——正文必须等于源原文拼接。
|
|
20
|
+
|
|
21
|
+
**会话与摄取**:
|
|
22
|
+
11. **LS-046**:`session_rag.py` 脏时间戳单条隔离,不再回滚整批。
|
|
23
|
+
12. **LS-047**:`session_rag.py` search/stats 只读连接,不自动建库建表。
|
|
24
|
+
13. **LS-054**:`checkpoint.py` 同一脏工作区不重复 remember。
|
|
25
|
+
14. **LS-055**:`growth_parts.py` frontmatter 开界独立成行判断。
|
|
26
|
+
15. **LS-056**:`assembler.py` 钳制输出预留在 [0, budget]。
|
|
27
|
+
16. **LS-057**:`session_import.py` 先设置 sys.path 再 import brain。
|
|
28
|
+
|
|
29
|
+
**面板与云端**:
|
|
30
|
+
17. **LS-062**:`panel_cloud.py` cloud_shot 兼容完整文件名与扩展名两种传法。
|
|
31
|
+
18. **LS-067**:`panel_cloud.py` 发布读-改-写共享索引加互斥锁。
|
|
32
|
+
19. **LS-068**:`panel_cloud.py` 拒绝空扩展 ZIP 安装。
|
|
33
|
+
20. **LS-085**:`panel_server.py` 技能操作协议对齐(check/show/delete/root_rm 别名)。
|
|
34
|
+
21. **LS-122**:`make_checksums.py` 显式发布清单优先于下划线启发式,`_conf_schema.json` 纳入校验。
|
|
35
|
+
|
|
36
|
+
**Cordis 插件**:
|
|
37
|
+
22. **LS-097**:cron extract 成功只清理已提交前缀,保留运行期间新增文本。
|
|
38
|
+
23. **LS-098**:cron 高水位自救每档位只执行一次(先检查消费状态再跑)。
|
|
39
|
+
24. **LS-105**:IM 后续工具步骤保留召回块,不提前删除。
|
|
40
|
+
25. **LS-106**:IM 会话重绑定后按身份指纹替换旧提示。
|
|
41
|
+
26. **LS-107**:IM capture 节流先原子占用再写回,防并发绕过间隔。
|
|
42
|
+
27. **LS-108**:IM `where.exe` 探测 PATH 真实 python.exe,修复 .cmd 启动。
|
|
43
|
+
28. **LS-110**:cron 水位动作 busy 时不消费档位,下轮可重试。
|
|
44
|
+
29. **LS-115**:`test_app_context.py` __main__ 移到末尾,plan_turns 测试可执行。
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
3
48
|
## v5.70(2026-12-05)
|
|
4
49
|
|
|
5
50
|
### 🏗️ 150 项审计第十四批:发布流水线与测试门禁组大收官
|
|
@@ -61,10 +61,16 @@ def plan(parts: dict, budget: int = 40000, *, ratios: dict | None = None,
|
|
|
61
61
|
budget = max(1, int(budget))
|
|
62
62
|
ratios = {**DEFAULT_RATIOS, **(ratios or {})}
|
|
63
63
|
# 输出预留:min(max_tokens, 25% 窗口),与附录 C 的 outputHeadroomMaxPct 一致
|
|
64
|
+
# LS-056(v5.71):钳制输出预留和可用上下文范围!
|
|
65
|
+
# 旧写法不设防——output_reserve 传负数时 reserve<0 → usable > 总预算;
|
|
66
|
+
# 传 >1 时 reserve 吃掉全部窗口。现在 reserve 强制钳在 [0, budget]。
|
|
67
|
+
_or = float(output_reserve) if output_reserve is not None else 0.25
|
|
68
|
+
_or = max(0.0, min(1.0, _or))
|
|
64
69
|
if max_output_tokens:
|
|
65
|
-
reserve = min(int(max_output_tokens), int(budget *
|
|
70
|
+
reserve = min(int(max_output_tokens), int(budget * _or))
|
|
66
71
|
else:
|
|
67
|
-
reserve = int(budget *
|
|
72
|
+
reserve = int(budget * _or)
|
|
73
|
+
reserve = max(0, min(budget, reserve))
|
|
68
74
|
usable = max(1, budget - reserve)
|
|
69
75
|
|
|
70
76
|
texts = {name: str(parts.get(name) or "") for name in SECTIONS}
|
|
@@ -143,7 +143,13 @@ def collect(repo: str | None = None) -> dict | None:
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
def decide(ev: dict, state: dict, force: bool = False) -> dict:
|
|
146
|
-
"""是否需要写:HEAD 变了 /
|
|
146
|
+
"""是否需要写:HEAD 变了 / 工作区有**新**改动 / 强制。
|
|
147
|
+
|
|
148
|
+
LS-054(v5.71):避免同一脏工作区重复 checkpoint!
|
|
149
|
+
旧实现只看 `ev["changed"] > 0`——HEAD 没动、脏文件也没增减时(cron 每轮
|
|
150
|
+
收尾都会触发),同一份脏工作区会被反复 remember 成重复记忆。
|
|
151
|
+
现在同时比较上次记录的 changed 数:HEAD 与改动数均未变化 → 不重复记。
|
|
152
|
+
"""
|
|
147
153
|
prev = state.get(ev["repo"]) or {}
|
|
148
154
|
if force:
|
|
149
155
|
return {"write": True, "reason": "force"}
|
|
@@ -151,8 +157,13 @@ def decide(ev: dict, state: dict, force: bool = False) -> dict:
|
|
|
151
157
|
return {"write": True, "reason": "首次收尾"}
|
|
152
158
|
if prev.get("head") != ev["head"]:
|
|
153
159
|
return {"write": True, "reason": f"HEAD {prev.get('head', '?')} → {ev['head']}"}
|
|
160
|
+
_prev_changed = prev.get("changed")
|
|
154
161
|
if ev["changed"] > 0:
|
|
155
|
-
|
|
162
|
+
if _prev_changed == ev["changed"]:
|
|
163
|
+
return {"write": False,
|
|
164
|
+
"reason": f"HEAD 与改动数均未变化({ev['changed']} 处),不重复记"}
|
|
165
|
+
return {"write": True,
|
|
166
|
+
"reason": f"工作区改动 {_prev_changed} → {ev['changed']} 处"}
|
|
156
167
|
return {"write": False, "reason": "与上次收尾一致,不重复记"}
|
|
157
168
|
|
|
158
169
|
|
|
@@ -787,6 +787,30 @@ def dream(trigger: str = "manual", dry_run: bool = False) -> dict:
|
|
|
787
787
|
keep_old = True
|
|
788
788
|
log_event("dream", f"已有未整理的梦(task_id={old['task_id']},"
|
|
789
789
|
f"{age / 3600:.1f}h 前触发),本次不重复生成新任务", level="warn")
|
|
790
|
+
# LS-030(v5.71):避免旧 pending 导致新簇永久丢失!
|
|
791
|
+
# 沿用旧任务时 new_pending 不写盘——本次新提取的簇原本会静默消失。
|
|
792
|
+
# 现在把新簇**合并进旧 pending 的 clusters**:task_id 保持不变
|
|
793
|
+
# (AI 拿到的 apply_schema 不失效),新碎片纳入同一场整理。
|
|
794
|
+
if clusters:
|
|
795
|
+
try:
|
|
796
|
+
_old_clusters = old.get("clusters") or []
|
|
797
|
+
_merged = _old_clusters + list(clusters)
|
|
798
|
+
old["clusters"] = _merged
|
|
799
|
+
# report 里的簇计数只属于本场,供日志观察合并规模
|
|
800
|
+
old.setdefault("report", {})
|
|
801
|
+
atomic_json(HOME / "dreams" / "pending.json", old)
|
|
802
|
+
log_event("dream",
|
|
803
|
+
f"新簇已并入未整理任务(+{len(clusters)} 组,"
|
|
804
|
+
f"合并后 {len(_merged)} 组)", level="info")
|
|
805
|
+
except Exception as _mg:
|
|
806
|
+
log_event("dream", f"新簇并入 pending 失败(新簇暂存 orphaned):{_mg}",
|
|
807
|
+
level="warn")
|
|
808
|
+
try:
|
|
809
|
+
atomic_json(HOME / "dreams" / f"orphaned_{task_id}_newclusters.json",
|
|
810
|
+
{"task_id": task_id, "clusters": clusters,
|
|
811
|
+
"created": now})
|
|
812
|
+
except Exception:
|
|
813
|
+
pass
|
|
790
814
|
else:
|
|
791
815
|
orphan_path = HOME / "dreams" / f"orphaned_{old['task_id']}.json"
|
|
792
816
|
atomic_json(orphan_path, old)
|
|
@@ -1037,9 +1061,30 @@ def apply_dream(result: dict) -> dict:
|
|
|
1037
1061
|
# AI 整理出来的记忆先标"待审核":防止做梦合并/编造的内容直接当事实沉淀。
|
|
1038
1062
|
# 例外:机械聚合摘要(aggregate=True)只是把 N 条原文用「;」连起来的派生视图,
|
|
1039
1063
|
# 没有可审的"新事实",进待审只会每天占住"待审核1条"(P9 #64)。
|
|
1064
|
+
# LS-032(v5.71):禁止 aggregate 标志绕过审核!
|
|
1065
|
+
# AI 结果里 aggregate 可以被任意伪造(想跳审核就标 true)。
|
|
1066
|
+
# 现在必须验证正文确实是源原文的「;」机械拼接才放行——内容与
|
|
1067
|
+
# source_ids 指向的原文完全一致才算机械视图��否则一律进待审。
|
|
1068
|
+
_is_mechanical = False
|
|
1040
1069
|
if item.get("aggregate"):
|
|
1070
|
+
_src_ids = [x for x in (item.get("source_ids") or []) if isinstance(x, str)]
|
|
1071
|
+
if _src_ids:
|
|
1072
|
+
_src_texts = []
|
|
1073
|
+
_by_id = {m.get("id"): m for m in records if isinstance(m, dict)}
|
|
1074
|
+
for _sid in _src_ids:
|
|
1075
|
+
_sm = _by_id.get(_sid)
|
|
1076
|
+
if _sm is not None and str(_sm.get("text") or "").strip():
|
|
1077
|
+
_src_texts.append(str(_sm.get("text")).strip())
|
|
1078
|
+
if _src_texts:
|
|
1079
|
+
_joined = ";".join(_src_texts)
|
|
1080
|
+
# 正文与机械拼接一致(允许首尾空白差异)才算真聚合
|
|
1081
|
+
_is_mechanical = text.strip() == _joined.strip()
|
|
1082
|
+
if _is_mechanical:
|
|
1041
1083
|
rec["aggregate"] = True
|
|
1042
1084
|
else:
|
|
1085
|
+
if item.get("aggregate"):
|
|
1086
|
+
applied["rejected"].append(
|
|
1087
|
+
"aggregate 标志未通过机械聚合校验(正文≠源原文拼接),已改入待审")
|
|
1043
1088
|
rec["review"] = "pending"
|
|
1044
1089
|
rec["review_source"] = "dream"
|
|
1045
1090
|
# #46 Memex 索引解引用:合并/蒸馏产物带 evidence_ids 指针(指向原始证据记忆),
|
|
@@ -1090,13 +1090,24 @@ def emotion_arc(days: int = 7) -> dict:
|
|
|
1090
1090
|
# 原依赖 brain.py 的星号合并命名空间——单独 import emotion 就 NameError
|
|
1091
1091
|
# (实测:persona.daily_drift 调 _emo.feel 时崩 "load_persona is not defined")。
|
|
1092
1092
|
# 这里补一个安全的本地绑定:优先用已有合并名,缺失则直接取 persona 模块的实现。
|
|
1093
|
+
# LS-028(v5.71):补齐 emotion.py 独立导入依赖——mind_state / default_onboarding
|
|
1094
|
+
# 同样定义在 persona.py(rational() 等运行路径会用到),一并纳入回退绑定。
|
|
1093
1095
|
try:
|
|
1094
|
-
load_persona # noqa: B018 已由 brain 合并命名空间提供
|
|
1096
|
+
load_persona, mind_state # noqa: B018 已由 brain 合并命名空间提供
|
|
1095
1097
|
except NameError: # pragma: no cover - 仅在单独 import 时触发
|
|
1096
1098
|
try:
|
|
1097
|
-
from persona import load_persona, save_persona
|
|
1099
|
+
from persona import (load_persona, save_persona, mind_state,
|
|
1100
|
+
default_onboarding) # type: ignore
|
|
1098
1101
|
except Exception:
|
|
1099
1102
|
pass
|
|
1103
|
+
else:
|
|
1104
|
+
try:
|
|
1105
|
+
mind_state # noqa: B018
|
|
1106
|
+
except NameError:
|
|
1107
|
+
try:
|
|
1108
|
+
from persona import mind_state # type: ignore
|
|
1109
|
+
except Exception:
|
|
1110
|
+
pass
|
|
1100
1111
|
|
|
1101
1112
|
|
|
1102
1113
|
def emotion_cfg() -> dict:
|
|
@@ -95,7 +95,11 @@ def parse_frontmatter(text: str) -> tuple:
|
|
|
95
95
|
以及常见简写(值里含冒号、以 # 开头)。够读 DSH / Claude / Trae 各家的 SKILL.md。
|
|
96
96
|
"""
|
|
97
97
|
text = text.lstrip("\ufeff")
|
|
98
|
-
|
|
98
|
+
# LS-055(v5.71):开界与闭界采用一致的整行判断!
|
|
99
|
+
# 旧写法 startswith("---") 会把 "---not-a-delimiter" 这种**整行**误当开界,
|
|
100
|
+
# 吞掉后面的正文。开界必须也是独立成行的 "---"(行尾只允许空白)。
|
|
101
|
+
_first_line = text.split("\n", 1)[0].rstrip()
|
|
102
|
+
if _first_line != "---":
|
|
99
103
|
return {}, text
|
|
100
104
|
# 闭界必须是整行 "---"(行尾可带空白):裸 find("\n---") 会把正文里
|
|
101
105
|
# "---xxx" 这类行误当边界,导致 head 被提前截断
|
|
@@ -460,11 +460,19 @@ def bulk_memory_action(ids: list, action: str, value=None) -> dict:
|
|
|
460
460
|
raise ValueError("没有可用的标签")
|
|
461
461
|
want = set(ids)
|
|
462
462
|
updated = 0
|
|
463
|
+
skipped_pinned: list = []
|
|
463
464
|
with _locked(HOME / "hippocampus.jsonl"):
|
|
464
465
|
records = load_all()
|
|
465
466
|
for m in records:
|
|
466
467
|
if m.get("id") not in want:
|
|
467
468
|
continue
|
|
469
|
+
# LS-023(v5.71):批量操作遵守置顶保护!
|
|
470
|
+
# 单条 forget / set_memory_review(discard) / apply_dream(forget) 都
|
|
471
|
+
# 硬拒置顶记忆,但批量 discard/delete 原来不看 pinned——面板一次
|
|
472
|
+
# 全选就能把置顶记忆扫进淡忘区。现在口径统一:置顶记忆跳过并如实回报。
|
|
473
|
+
if action in ("discard", "delete") and m.get("pinned") and m.get("layer") != "dust":
|
|
474
|
+
skipped_pinned.append(m["id"])
|
|
475
|
+
continue
|
|
468
476
|
if action == "confirm":
|
|
469
477
|
m["review"] = "confirmed"
|
|
470
478
|
m["review_at"] = now_ts()
|
|
@@ -507,6 +515,7 @@ def bulk_memory_action(ids: list, action: str, value=None) -> dict:
|
|
|
507
515
|
# v4 #32:批量操作审计(含批量 delete/importance 等)
|
|
508
516
|
audit_log("panel", f"bulk_{action}", f"{len(ids)}条", f"成功 {updated} 条")
|
|
509
517
|
return {"updated": updated, "requested": len(ids), "action": action,
|
|
518
|
+
"skipped_pinned": skipped_pinned,
|
|
510
519
|
"review_counts": review_counts()}
|
|
511
520
|
|
|
512
521
|
|
|
@@ -2465,9 +2474,29 @@ def recall(query: str, k: int = 8, layers: tuple = ("cortex", "hippo"),
|
|
|
2465
2474
|
if not str(m.get("agent_id") or "").strip()
|
|
2466
2475
|
or str(m.get("agent_id")).strip() == aid]
|
|
2467
2476
|
if include_archive:
|
|
2477
|
+
# LS-019(v5.71):保留缺少 ID 的旧归档记录!
|
|
2478
|
+
# 旧实现 `if m.get("id")` 把无 id 的老归档记录整条丢弃——这些是
|
|
2479
|
+
# 早期版本写入的历史,静默丢失。现在按 load_all 同款做法合成稳定
|
|
2480
|
+
# 内容哈希 id(仅内存内生效,不写回 archive.jsonl)。
|
|
2481
|
+
import hashlib as _hashlib
|
|
2482
|
+
_raw_archive = load_archive()
|
|
2483
|
+
archive = []
|
|
2484
|
+
for m in _raw_archive:
|
|
2485
|
+
if not isinstance(m, dict):
|
|
2486
|
+
continue
|
|
2487
|
+
if not m.get("id"):
|
|
2488
|
+
_m = dict(m)
|
|
2489
|
+
try:
|
|
2490
|
+
_seed = json.dumps({k: _m.get(k) for k in
|
|
2491
|
+
("text", "kind", "created", "layer", "gist")},
|
|
2492
|
+
ensure_ascii=False, sort_keys=True, default=str)
|
|
2493
|
+
_m["id"] = "m_" + _hashlib.sha1(_seed.encode("utf-8")).hexdigest()[:12]
|
|
2494
|
+
except Exception:
|
|
2495
|
+
_m["id"] = "m_archive_noid"
|
|
2496
|
+
m = _m
|
|
2497
|
+
if _channel_visible(m, channel, group_id, user):
|
|
2498
|
+
archive.append(m)
|
|
2468
2499
|
# LS-004(v5.58):归档召回同样必须执行 agent_id 隔离。
|
|
2469
|
-
archive = [m for m in load_archive() if m.get("id")
|
|
2470
|
-
and _channel_visible(m, channel, group_id, user)]
|
|
2471
2500
|
if agent_id:
|
|
2472
2501
|
aid = str(agent_id).strip()
|
|
2473
2502
|
archive = [m for m in archive
|
|
@@ -3173,8 +3202,19 @@ def trash_restore(memory_id: str) -> dict:
|
|
|
3173
3202
|
except Exception:
|
|
3174
3203
|
keep.append(line)
|
|
3175
3204
|
continue
|
|
3176
|
-
if row.get("id") == memory_id
|
|
3177
|
-
|
|
3205
|
+
if row.get("id") == memory_id:
|
|
3206
|
+
# LS-021(v5.71):台账恢复应选取最新版本!
|
|
3207
|
+
# 同一记忆可能被删除多次(删→复存→再删),台账里有多条同 id 记录。
|
|
3208
|
+
# 旧实现取文件里的第一条(可能是最旧版本),恢复回的是过期内容。
|
|
3209
|
+
# 现在按 deleted_at 比较,始终保留时间戳最新的那条。
|
|
3210
|
+
if (target is None
|
|
3211
|
+
or _num(row.get("deleted_at"), 0) > _num(target.get("deleted_at"), 0)):
|
|
3212
|
+
# 之前选中的旧版本行要留在台账里(其他 restore 仍可能需要)
|
|
3213
|
+
if target is not None:
|
|
3214
|
+
keep.append(json.dumps(target, ensure_ascii=False))
|
|
3215
|
+
target = row
|
|
3216
|
+
else:
|
|
3217
|
+
keep.append(line)
|
|
3178
3218
|
else:
|
|
3179
3219
|
keep.append(line)
|
|
3180
3220
|
if target is None:
|
|
@@ -3246,7 +3286,13 @@ def purge(memory_id: str, confirm_token: str) -> dict:
|
|
|
3246
3286
|
target = next((m for m in archive if m.get("id") == memory_id), None)
|
|
3247
3287
|
if not target:
|
|
3248
3288
|
raise ValueError(f"没有这条记忆:{memory_id}")
|
|
3249
|
-
|
|
3289
|
+
# LS-020(v5.71):归档分支同样禁止异常时间戳绕过冷静期
|
|
3290
|
+
_raw_aa = target.get("archived_at") or target.get("forgotten_at")
|
|
3291
|
+
archived_at = _num(_raw_aa, -1)
|
|
3292
|
+
if archived_at <= 0:
|
|
3293
|
+
raise ValueError(
|
|
3294
|
+
f"这条归档记忆的时间戳缺失或无效(archived_at={_raw_aa!r}),"
|
|
3295
|
+
f"无法确认已过 {_PURGE_COOLDOWN_DAYS} 天冷静期,拒绝物理删除。")
|
|
3250
3296
|
if archived_at > cutoff:
|
|
3251
3297
|
raise ValueError(
|
|
3252
3298
|
f"归档记忆需冷静满 {_PURGE_COOLDOWN_DAYS} 天后才能物理删除"
|
|
@@ -3267,7 +3313,17 @@ def purge(memory_id: str, confirm_token: str) -> dict:
|
|
|
3267
3313
|
raise ValueError(
|
|
3268
3314
|
f"只有淡忘区(dust)的记忆才能物理删除,当前层:{target.get('layer')}。"
|
|
3269
3315
|
f"先 `memory forget {memory_id}` 转 dust,满 {_PURGE_COOLDOWN_DAYS} 天后再 purge。")
|
|
3270
|
-
|
|
3316
|
+
# LS-020(v5.71):禁止异常删除时间戳绕过冷静期!
|
|
3317
|
+
# 旧实现 _num(forgotten_at, 0) 把缺失/坏值当 0 —— 0 恒小于 cutoff,
|
|
3318
|
+
# 冷静期检查形同虚设,脏数据记忆可直接物理删除。现在 fail-closed:
|
|
3319
|
+
# 时间戳缺失或无法解析时拒绝 purge,要求先修正记录。
|
|
3320
|
+
_raw_fa = target.get("forgotten_at")
|
|
3321
|
+
forgotten_at = _num(_raw_fa, -1)
|
|
3322
|
+
if forgotten_at <= 0:
|
|
3323
|
+
raise ValueError(
|
|
3324
|
+
f"这条记忆的淡忘时间戳缺失或无效(forgotten_at={_raw_fa!r}),"
|
|
3325
|
+
f"无法确认已过 {_PURGE_COOLDOWN_DAYS} 天冷静期,拒绝物理删除。"
|
|
3326
|
+
"请先修复该记录的时间戳或用 forget 重新淡忘。")
|
|
3271
3327
|
if forgotten_at > cutoff:
|
|
3272
3328
|
raise ValueError(
|
|
3273
3329
|
f"淡忘记忆需冷静满 {_PURGE_COOLDOWN_DAYS} 天后才能物理删除"
|
|
@@ -25,6 +25,7 @@ import base64
|
|
|
25
25
|
import hashlib
|
|
26
26
|
import json
|
|
27
27
|
import os
|
|
28
|
+
import threading
|
|
28
29
|
import time
|
|
29
30
|
import urllib.error
|
|
30
31
|
import urllib.request
|
|
@@ -413,6 +414,11 @@ def cloud_extension_download(ext_id: str) -> dict:
|
|
|
413
414
|
raise FileExistsError("该拓展已安装,请先删除 extensions/installed 下同名目录")
|
|
414
415
|
with zipfile.ZipFile(io.BytesIO(raw)) as z:
|
|
415
416
|
names = z.namelist()
|
|
417
|
+
# LS-068(v5.71):拒绝空扩展 ZIP 安装成功!
|
|
418
|
+
# 旧实现只查文件数上限——空包(0 个文件)也能"安装成功",装出一个
|
|
419
|
+
# 空目录还显示"已安装"。现在要求至少一个有效文件。
|
|
420
|
+
if not names or all(n.endswith("/") for n in names):
|
|
421
|
+
raise ValueError("拓展包是空的(没有任何文件),拒绝安装")
|
|
416
422
|
if len(names) > panels.ZIP_MAX_FILES:
|
|
417
423
|
raise ValueError("拓展包文件数超限")
|
|
418
424
|
total = sum(i.file_size for i in z.infolist())
|
|
@@ -464,7 +470,25 @@ def _safe_name(name: str) -> bool:
|
|
|
464
470
|
|
|
465
471
|
|
|
466
472
|
def cloud_shot(name: str, ext: str) -> bytes:
|
|
467
|
-
"""取云端截图字节(前端 <img> 直连本机代理端点,避免跨域/混合内容问题)。
|
|
473
|
+
"""取云端截图字节(前端 <img> 直连本机代理端点,避免跨域/混合内容问题)。
|
|
474
|
+
|
|
475
|
+
LS-062(v5.71):统一截图清单字段与读取参数!
|
|
476
|
+
清单里 `screenshot` 存的是**完整文件名**(如 "demo.png"),而旧实现要求
|
|
477
|
+
调用方把 ext 拆成 ".png" 单独传——前端直接把清单字段塞进 ext 参数时,
|
|
478
|
+
拼出 "shots/demo{demo.png}" 这种不存在的路径。现在兼容两种传法:
|
|
479
|
+
ext 以 "." 开头按扩展名处理;否则视为完整文件名(忽略多余的 name 前缀)。
|
|
480
|
+
"""
|
|
481
|
+
ext = str(ext or "").strip()
|
|
482
|
+
if not ext.startswith("."):
|
|
483
|
+
# 传入的是完整文件名(清单 screenshot 字段):剥掉 name 前缀留扩展名
|
|
484
|
+
_fname = ext.lower()
|
|
485
|
+
if _fname == str(name).strip().lower():
|
|
486
|
+
ext = ".png" # 只给了面板名(老清单只有名字):用默认 png
|
|
487
|
+
elif _fname.startswith(str(name).strip().lower()):
|
|
488
|
+
ext = _fname[len(str(name).strip()):]
|
|
489
|
+
if not ext.startswith("."):
|
|
490
|
+
ext = Path(ext).suffix or ".png"
|
|
491
|
+
ext = ext.lower()
|
|
468
492
|
if ext not in SHOT_WHITELIST:
|
|
469
493
|
raise ValueError("截图扩展名不支持")
|
|
470
494
|
c = _cfg()
|
|
@@ -615,12 +639,34 @@ def _push_one(kind: str, repo: str, token: str, branch: str, name: str,
|
|
|
615
639
|
|
|
616
640
|
kind_key 决定子目录与清单键:panels → panels/xxx.zip + index.json.panels,
|
|
617
641
|
extensions → extensions/xxx.zip + index.json.extensions(同一份 index.json)。
|
|
642
|
+
|
|
643
|
+
LS-067(v5.71):防止云发布并发覆盖共享 index!
|
|
644
|
+
旧实现的"读旧清单→合并→回写"在两个发布同时跑时会互相覆盖:
|
|
645
|
+
A 读到旧清单、B 读到旧清单、A 写回(带 A 条目)、B 写回(**丢掉 A 条目**)。
|
|
646
|
+
现在用进程级互斥锁串行化"读-改-写"窗口;锁只保护本机并发,
|
|
647
|
+
跨机器场景靠回写前二次读取对比 updated 做最后防线。
|
|
618
648
|
"""
|
|
649
|
+
global _PUBLISH_LOCK
|
|
619
650
|
put = _gitee_put if kind == "gitee" else _github_put
|
|
620
651
|
get = _gitee_get if kind == "gitee" else _github_get
|
|
621
652
|
put(repo, f"{kind_key}/{name}.zip", token, branch, zbytes, msg, author)
|
|
622
653
|
if shot is not None:
|
|
623
654
|
put(repo, f"shots/{name}{shot_ext}", token, branch, shot, msg, author)
|
|
655
|
+
with _PUBLISH_LOCK:
|
|
656
|
+
_push_index_entry(kind, repo, token, branch, name, entry, msg,
|
|
657
|
+
kind_key=kind_key, author=author)
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
# LS-067: 云发布共享 index 的读-改-写互斥锁(进程级;个人市场单机足够)
|
|
661
|
+
_PUBLISH_LOCK = threading.Lock()
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
def _push_index_entry(kind: str, repo: str, token: str, branch: str, name: str,
|
|
665
|
+
entry: dict, msg: str, kind_key: str = "panels",
|
|
666
|
+
author: dict | None = None) -> None:
|
|
667
|
+
"""index.json 合并回写(必须在 _PUBLISH_LOCK 内调用)。"""
|
|
668
|
+
put = _gitee_put if kind == "gitee" else _github_put
|
|
669
|
+
get = _gitee_get if kind == "gitee" else _github_get
|
|
624
670
|
# index.json 合并回写:读旧清单 → 覆盖同名条目 → 写回(并发竞争可接受,个人市场)
|
|
625
671
|
#
|
|
626
672
|
# ⚠ fail-closed:**只有"清单确实不存在"才可以新建空清单**。
|