@twinsearth/agent-universe 2.6.2 → 2.6.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/README.md CHANGED
@@ -273,7 +273,7 @@ npm config set @twinsearth:registry https://npm.pkg.github.com
273
273
  npm install @twinsearth/agent-universe
274
274
  ```
275
275
 
276
- 已发布版本:1.0.0 / 2.0.0 / 2.2.0 / 2.3.0 / 2.3.1 / 2.3.4 / 2.3.5 / 2.3.6 / 2.4.0 ~ 2.6.2,详见 [Releases](https://github.com/TwinsEarth/agent-universe/releases)。
276
+ 已发布版本:1.0.0 / 2.0.0 / 2.2.0 / 2.3.0 / 2.3.1 / 2.3.4 / 2.3.5 / 2.3.6 / 2.4.0 ~ 2.6.4,详见 [Releases](https://github.com/TwinsEarth/agent-universe/releases)。
277
277
 
278
278
  ## 版本谱系
279
279
 
@@ -313,6 +313,8 @@ npm install @twinsearth/agent-universe
313
313
  | v2.6.0 | **State Machine** | **状态机恢复边(no_quorum→open、rework→running,消除 NoQuorum 吸收态)+ 证据分级作为结算强制闸门(is_trustworthy 此前零调用点)+ policy=None 提交即验收** |
314
314
  | v2.6.1 | **Ledger Persistence** | **账本落盘 + 重启从只追加流水重放恢复(ledger_entries,根治只写不读/重启丢账)+ MCP 单一来源参数校验(缺必填/类型错误返回 -32602,杜绝静默降级)** |
315
315
  | v2.6.2 | **Version Source** | **VERSION 唯一来源 + check-version 全仓一致性断言(CI 强制,漂移即红)+ 合约重写可部署(Hardhat 18 逐缺陷测试)+ 真实 Reed-Solomon 纠删码 + 网络替身 InMemory* 诚实化** |
316
+ | v2.6.3 | **Settlement Closeout** | **重复注册拒绝 + 投标报价与预算强校验(0/负/超预算/已关闭拒绝)+ Rejected / DuplicateWork 终局可达(返工重提相同结果自动拒绝,付0、退预算、罚没10%质押)** |
317
+ | v2.6.4 | **Consensus Hardening** | **BFT checked 算术(溢出安全)+ 规范签名 Result 化/递归剥离 signature + JS 码点序跨语言键序 + PROTOCOL_VERSION 契约 + 弱公钥拒绝 + Clock 端口(消除 1970 panic)** |
316
318
 
317
319
  详见 [RELEASES.md](RELEASES.md) 和 [releases/](releases/) 目录。
318
320
 
package/js/index.js CHANGED
@@ -9,7 +9,7 @@ const { AgentMarket, Bid, Reputation, MIN_STAKE } = require('./lib/market');
9
9
  const { McpHttpClient, McpError, MCP_PROTOCOL_VERSION } = require('./lib/mcp');
10
10
  const aca = require('./lib/aca');
11
11
 
12
- const version = '2.6.2';
12
+ const version = '2.6.4';
13
13
 
14
14
  /**
15
15
  * AgentUniverse 门面:聚合身份、网络、市场能力
package/js/lib/aca.js CHANGED
@@ -33,7 +33,19 @@ function stableStringify(value) {
33
33
  if (Array.isArray(value)) {
34
34
  return '[' + value.map(stableStringify).join(',') + ']';
35
35
  }
36
- const keys = Object.keys(value).sort();
36
+ // v2.6.4(GAP §4.4):按 Unicode 码点序排序,而非 JS 默认的 UTF-16 码元序。
37
+ // 否则含 astral(补充平面,如 emoji)键名时,JS 与 Rust BTreeMap 的键序分歧,
38
+ // 三端 canonical 载荷不再逐字节一致。
39
+ const keys = Object.keys(value).sort((a, b) => {
40
+ const ca = [...a];
41
+ const cb = [...b];
42
+ const n = Math.min(ca.length, cb.length);
43
+ for (let i = 0; i < n; i++) {
44
+ const diff = ca[i].codePointAt(0) - cb[i].codePointAt(0);
45
+ if (diff !== 0) return diff;
46
+ }
47
+ return ca.length - cb.length;
48
+ });
37
49
  return (
38
50
  '{' +
39
51
  keys
@@ -129,7 +141,7 @@ function buildManifest(identity, name, capabilities, opts = {}) {
129
141
  const manifest = {
130
142
  did: identity.did,
131
143
  name,
132
- version: opts.version || '2.6.2',
144
+ version: opts.version || '2.6.4',
133
145
  capabilities: [...capabilities],
134
146
  endpoints: opts.endpoints || [],
135
147
  hardware: {
package/js/lib/mcp.js CHANGED
@@ -60,7 +60,7 @@ class McpHttpClient {
60
60
  method: 'initialize',
61
61
  params: {
62
62
  protocolVersion: MCP_PROTOCOL_VERSION,
63
- clientInfo: { name: 'agent-universe-js', version: '2.6.2' },
63
+ clientInfo: { name: 'agent-universe-js', version: '2.6.4' },
64
64
  capabilities: {},
65
65
  },
66
66
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@twinsearth/agent-universe",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@twinsearth/agent-universe",
9
- "version": "2.6.2",
9
+ "version": "2.6.4",
10
10
  "license": "MIT",
11
11
  "engines": {
12
12
  "node": ">=18"
package/js/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/agent-universe",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "Agent Universe - 群众化的 AGI 路线,去中心化的智能体共享 & 开源网络。使命:让科技造福全人类!",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/js/test/test.js CHANGED
@@ -43,8 +43,8 @@ function test(name, fn) {
43
43
  console.log('Agent Universe JS SDK 测试\n');
44
44
 
45
45
  // 1. 版本号
46
- test('版本号为 2.6.2', () => {
47
- assert.strictEqual(version, '2.6.2');
46
+ test('版本号为 2.6.4', () => {
47
+ assert.strictEqual(version, '2.6.4');
48
48
  });
49
49
 
50
50
  // 2. 密钥对 + DID + 签名验证
@@ -417,6 +417,19 @@ test('v2.6.0 policy=None 提交即验收并豁免证据', () => {
417
417
  assert.strictEqual(r.paid, 40);
418
418
  });
419
419
 
420
+ // 16. v2.6.4 canonical 键序按 Unicode 码点序(GAP §4.4)
421
+ test('v2.6.4 canonical 键序按码点序,BMP私用区与astral分歧被修复', () => {
422
+ const { stableStringify } = require('../lib/aca');
423
+ const bmp = ''; // U+E000,码点 0xE000
424
+ const astral = '😀'; // U+1F600,码点 0x1F600
425
+ // 码点序:0xE000 < 0x1F600 → bmp 在前。
426
+ // JS 默认 UTF-16 码元序:astral 高半 0xD83D < bmp 0xE000 → 会给出相反顺序。
427
+ const s1 = stableStringify({ [astral]: 1, [bmp]: 2 });
428
+ const s2 = stableStringify({ [bmp]: 2, [astral]: 1 });
429
+ assert.strictEqual(s1, s2, '不同插入顺序应产出同一紧凑 JSON');
430
+ assert.strictEqual(s1, '{"":2,"😀":1}', '键序必须是码点序(bmp 在前)');
431
+ });
432
+
420
433
  console.log(`\n${passed} 项测试通过`);
421
434
  if (process.exitCode === 1) {
422
435
  console.error('存在失败测试');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/agent-universe",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "Agent Universe - 群众化的 AGI 路线,去中心化的智能体共享 & 开源网络。使命:让科技造福全人类!",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",