@autodevjapan/godd-mcp-alpha 2.9.1 → 2.9.3

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "releaseTag": "godd-native-v0.2.9",
4
- "expectedVersion": "godd-native 0.2.9",
5
- "sourceCommit": "8c49470b1b225b0f9b9e92ee64eef59676ae67b4",
3
+ "releaseTag": "godd-native-v0.2.10",
4
+ "expectedVersion": "godd-native 0.2.10",
5
+ "sourceCommit": "2910ea70cf3432a0ed80263dd74fcd13386f92c2",
6
6
  "capabilities": [
7
7
  "cobol-evidence",
8
8
  "codec-capability",
@@ -13,30 +13,30 @@
13
13
  "plan-audit",
14
14
  "research"
15
15
  ],
16
- "baselineBytes": 49710920,
16
+ "baselineBytes": 32513684,
17
17
  "maximumAssetBytes": 50000000,
18
18
  "maximumTarballBytes": 25000000,
19
19
  "maximumUnpackedBytes": 55000000,
20
20
  "targets": {
21
21
  "darwin-x64": {
22
22
  "artifact": "godd-native-x86_64-apple-darwin",
23
- "bytes": 12574932,
24
- "sha256": "43ec2d150df2936eeed70577634604c83a5f91032fbbf41d4409924da5eb5b3c"
23
+ "bytes": 7674896,
24
+ "sha256": "0fd114374d43c712bcb67162d18baf5f0ac20b8800c9e10353c7425ffd8d5d42"
25
25
  },
26
26
  "darwin-arm64": {
27
27
  "artifact": "godd-native-aarch64-apple-darwin",
28
- "bytes": 12171232,
29
- "sha256": "560a5f14f5778dd5524831e3ea6713c18caf69a3f337cd93fea373653e2c3e4c"
28
+ "bytes": 7012016,
29
+ "sha256": "8aacfe997c596e748870a564bc48b293564725cddeebbe9609528e3fe5c4e757"
30
30
  },
31
31
  "linux-x64": {
32
32
  "artifact": "godd-native-x86_64-unknown-linux-musl",
33
- "bytes": 14250896,
34
- "sha256": "09963a4f44a85602ed9f2b594e27dcbf3b436a7d51e0165ae28d418b6d55555b"
33
+ "bytes": 8565456,
34
+ "sha256": "9944a786643f1053483bcb18a4b1c79f6f05de01c61895460e9be592b29ee1d9"
35
35
  },
36
36
  "win32-x64": {
37
37
  "artifact": "godd-native-x86_64-pc-windows-msvc.exe",
38
- "bytes": 10713600,
39
- "sha256": "ab6308b7b54feb4b7c4ef5e073064abfd484cb4375641ec070ea5c011502864a"
38
+ "bytes": 9261056,
39
+ "sha256": "8acb6f141ca282c3198e6470679baf87778ec28922592884e3fe2398cfee1d83"
40
40
  }
41
41
  }
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autodevjapan/godd-mcp-alpha",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
4
4
  "type": "module",
5
5
  "description": "Senior-engineering workflows for AI coding clients — plan, build, test, review, and ship with one command",
6
6
  "license": "UNLICENSED",
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
@@ -166,6 +166,68 @@ export const EXPECTED_NATIVE_ASSET_FILES = Object.freeze(
166
166
  ]),
167
167
  );
168
168
 
169
+ // --- Native asset budget headroom (#1432) ---------------------------------
170
+ // `validateNativeManifest` は `maximumAssetBytes < baselineBytes` を throw する。
171
+ // つまり上限へ到達した瞬間に manifest の読み込み自体が失敗し publish 経路が止まる
172
+ // (fail-closed だが、#1424 のようにクロスビルド済み release を作った後にしか
173
+ // 気づけない)。到達前に検知するため、警告用の閾値と ratchet 上限を定義する。
174
+ export const NATIVE_ASSET_HEADROOM_WARNING_BYTES = 2_000_000;
175
+
176
+ // `godd-native-v0.2.10` で観測した baseline(残 headroom 17,486,316 bytes)。
177
+ // これを超える増加は「サイズ削減」か「上限の再設計」の判断を必ず挟ませるため、
178
+ // 単調増加を止める ratchet として固定する(緩めるときは spec の根拠更新とセット)。
179
+ // native release ごとに新しい `baselineBytes` まで引き下げること(spec の
180
+ // 「native release 後のチェックリスト」参照)。据え置くと ratchet が機能しなくなる。
181
+ export const NATIVE_ASSET_BASELINE_CEILING_BYTES = 32_513_684;
182
+
183
+ /**
184
+ * exact 8 files の合計 bytes と `maximumAssetBytes` の余裕を判定する。
185
+ * `ok` / `warning` / `exhausted` の 3 段で返し、呼び出し側が警告表示に使う。
186
+ */
187
+ export function describeNativeAssetHeadroom(
188
+ totalBytes = NATIVE_ASSET_BASELINE_BYTES,
189
+ maximumBytes = MAX_NATIVE_ASSET_BYTES,
190
+ warningBytes = NATIVE_ASSET_HEADROOM_WARNING_BYTES,
191
+ ) {
192
+ requirePositiveInteger(totalBytes, "totalBytes");
193
+ requirePositiveInteger(maximumBytes, "maximumBytes");
194
+ requirePositiveInteger(warningBytes, "warningBytes");
195
+ const headroomBytes = maximumBytes - totalBytes;
196
+ const level =
197
+ headroomBytes <= 0
198
+ ? "exhausted"
199
+ : headroomBytes < warningBytes
200
+ ? "warning"
201
+ : "ok";
202
+ return Object.freeze({
203
+ totalBytes,
204
+ maximumBytes,
205
+ warningBytes,
206
+ headroomBytes,
207
+ level,
208
+ });
209
+ }
210
+
211
+ /**
212
+ * ビルド直後の release artifact directory から exact 8 files の合計 bytes を測る。
213
+ * manifest 更新前の artifact を対象にするため digest 照合は行わない
214
+ * (digest 照合は `verifyBundledNativeAssets` の責務)。
215
+ */
216
+ export function measureNativeAssetBytes(directory) {
217
+ if (!existsSync(directory)) {
218
+ throw new Error(`Native asset directory is missing: ${directory}`);
219
+ }
220
+ let totalBytes = 0;
221
+ for (const file of EXPECTED_NATIVE_ASSET_FILES) {
222
+ const path = join(directory, file);
223
+ if (!existsSync(path)) {
224
+ throw new Error(`Native asset is missing: ${file}`);
225
+ }
226
+ totalBytes += statSync(path).size;
227
+ }
228
+ return totalBytes;
229
+ }
230
+
169
231
  export function checksumFile(path) {
170
232
  return createHash("sha256").update(readFileSync(path)).digest("hex");
171
233
  }