@autodevjapan/godd-mcp-alpha 2.14.1 → 2.15.1

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.
@@ -0,0 +1,112 @@
1
+ # Adapter contracts
2
+
3
+ For adapter implementers only. These subpaths expose **no** production processing route — they validate and forward an envelope, nothing more.
4
+
5
+ This file ships inside the npm tarball, so after `npm install` you can read it at
6
+ `node_modules/@autodevjapan/godd-mcp-alpha/docs/adapter-contracts.md`.
7
+
8
+ Everything user-facing (tool list, CLI reference, troubleshooting) lives on the
9
+ [documentation site](https://www.getgodd.dev/en/docs).
10
+
11
+ ---
12
+
13
+ ## Media interval adapter contract
14
+
15
+ ```ts
16
+ import {
17
+ forwardMediaIntervalTransformation,
18
+ loadMediaIntervalCalibrationSnapshot,
19
+ validateMediaIntervalAdapterContract,
20
+ } from "@autodevjapan/godd-mcp-alpha/media-interval-adapter-contract";
21
+
22
+ const contract = validateMediaIntervalAdapterContract(adapterPayload);
23
+ const transformation = forwardMediaIntervalTransformation(contract);
24
+ const calibration = loadMediaIntervalCalibrationSnapshot();
25
+ if (calibration.status === "INCONCLUSIVE") {
26
+ throw new Error("Media interval calibration could not be verified");
27
+ }
28
+ ```
29
+
30
+ ### English
31
+
32
+ Node validates and forwards the envelope only. Interval arithmetic, canonical union coverage, coverage decisions, and source-buffer application remain Rust-owned and must not be duplicated in the adapter payload. An unsupported schema, unknown nested field, insufficient sample count, invalid metadata, or digest mismatch returns `INCONCLUSIVE` with no numeric fallback — stop instead of inventing a default tolerance.
33
+
34
+ ### 日本語
35
+
36
+ Node は envelope の検証と転送のみを行います。区間算術、canonical union coverage、coverage判定、source bufferへの適用はRustだけが所有し、アダプター payload 側で再実装してはいけません。未対応スキーマ・未知のネストフィールド・サンプル数不足・不正なメタデータ・digest 不一致は `INCONCLUSIVE` を返し、数値のフォールバックは行いません。既定の許容値を捏造せず、処理を停止してください。
37
+
38
+ ### Русский
39
+
40
+ Node только проверяет и передаёт envelope. Расчёт интервалов, canonical union coverage, решение по coverage и применение к source buffer остаются исключительно в Rust и не должны дублироваться в payload адаптера. Неподдерживаемая схема, неизвестное вложенное поле, недостаточное число выборок, некорректные метаданные или несовпадение digest возвращают `INCONCLUSIVE` без числового запасного значения — остановитесь, а не придумывайте допуск по умолчанию.
41
+
42
+ ---
43
+
44
+ ## Audio length adapter contract
45
+
46
+ ```ts
47
+ import { validateAudioLengthAdapterContract } from "@autodevjapan/godd-mcp-alpha/audio-length-adapter-contract";
48
+
49
+ const contract = validateAudioLengthAdapterContract(adapterPayload);
50
+ // contract.length_arithmetic_owner === "rust"
51
+ ```
52
+
53
+ `validateAudioLengthAdapterContract` accepts one object with exactly these five
54
+ keys and nothing else: `schema_version` (must be `1`),
55
+ `length_arithmetic_owner` (must be `"rust"`), `waveform_input`, `mel_input`,
56
+ and `audio_output`. Any extra or missing key throws.
57
+
58
+ | Envelope | Required keys | Fixed values |
59
+ |---|---|---|
60
+ | `waveform_input` | `kind`, `shape`, `channel_sample_lengths`, `dtype` | `kind: "waveform"`, `dtype: "f32"`, `shape` = 2 positive safe integers |
61
+ | `mel_input` | `kind`, `shape`, `layout`, `dtype` | `kind: "mel"`, `dtype: "f32"`, `layout` ∈ {`"BinsFirst"`, `"FramesFirst"`}, `shape` = 3 positive safe integers |
62
+ | `audio_output` | `kind`, `container`, `encoding`, `sample_rate`, `channels`, `samples_per_channel` | `kind: "audio"`, `container: "wav"`, `encoding: "pcm_s16le"`, the three numbers positive safe integers |
63
+
64
+ Two rules are the point of the contract:
65
+
66
+ - **Length arithmetic stays in Rust.** The keys `padding_samples`,
67
+ `processing_samples`, `expected_feature_frames`, and `trimmed_samples` are
68
+ rejected anywhere in the three envelopes. If your adapter has computed them,
69
+ it has already duplicated the owning implementation — send the shapes, not
70
+ the results.
71
+ - **`channel_sample_lengths` must be internally consistent.** It must have
72
+ exactly `shape[0]` entries and every entry must equal `shape[1]`. A ragged
73
+ waveform is rejected rather than truncated to the shortest channel.
74
+
75
+ ## Compile cache adapter contract
76
+
77
+ ```ts
78
+ import {
79
+ policyForCompileCacheReceipt,
80
+ projectCompileCacheRegisterRequest,
81
+ validateCompileCacheReceipt,
82
+ } from "@autodevjapan/godd-mcp-alpha/compile-cache-adapter-contract";
83
+
84
+ const request = projectCompileCacheRegisterRequest(projectInput);
85
+ const receipt = validateCompileCacheReceipt(rawReceipt);
86
+ const { action, disposition } = policyForCompileCacheReceipt(rawReceipt);
87
+ ```
88
+
89
+ This subpath carries **no source body**. `canonical_source`, `source`,
90
+ `source_body`, `source_text`, `compiled_javascript`, `compiled_module`,
91
+ `host_path`, and `deck_title` are structurally impossible on the boundary
92
+ types — the guarantee is a compile-time assertion, so a change that reintroduces
93
+ one of them fails `pnpm typecheck` rather than leaking at runtime. Pass the
94
+ canonical source to `projectCompileCacheRegisterRequest`, which hashes it into
95
+ `canonical_source_digest` and returns a request that no longer contains it.
96
+
97
+ Every receipt maps to exactly one caller action via
98
+ `COMPILE_CACHE_OUTCOME_POLICY`. Do not branch on the outcome string yourself —
99
+ read `action` and `disposition`:
100
+
101
+ | Disposition | Outcomes | What the caller does |
102
+ |---|---|---|
103
+ | `CONTINUE` | `CACHE_HIT`, `CACHE_MISS_COMPILED`, `SINGLE_FLIGHT_JOINED`, `TOO_LARGE_FOR_CACHE`, `BUDGET_EVICTED_LRU`, `SUPERSEDED_BY_NEW_SOURCE`, `DECK_TOMBSTONED`, `STALE_GENERATION_REJECTED`, `PREVIEW_LEASE_EXPIRED`, `AGE_EXPIRED`, `IDLE_EXPIRED`, `RESERVATION_EXPIRED`, `COMPILE_FAILED_ROLLED_BACK` | proceeds — the cache simply did not help |
104
+ | `RETRY` | `BUDGET_UNRECLAIMABLE` | retries **at most once** (`max_retries: 1`), then `REJECT` |
105
+ | `REJECT` | `BUDGET_OVERFLOW`, `RECONCILE_CLOCK_REGRESSION` | stops; these mean arithmetic overflow or a clock that went backwards |
106
+
107
+ Reconciliation ownership is fixed, not negotiated:
108
+ `COMPILE_CACHE_RECONCILE_OWNER` declares `nextjs-server` as the owner, a
109
+ `monotonic-milliseconds` clock, and a timer-and-after-lifecycle-event trigger.
110
+ `deriveCompileCacheReconcilePolicy({ age_ms, idle_ms, reservation_ttl_ms })`
111
+ returns that owner plus `interval_ms` = the minimum of the three budgets, so the
112
+ sweep can never run less often than the shortest deadline it must enforce.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "releaseTag": "godd-native-v0.2.25",
4
- "expectedVersion": "godd-native 0.2.25",
5
- "sourceCommit": "0e3d92fadc039b73404ee62d1e151699d95a6273",
3
+ "releaseTag": "godd-native-v0.2.27",
4
+ "expectedVersion": "godd-native 0.2.27",
5
+ "sourceCommit": "313e1c76395d0fcbdd071c695f1d405aa71d67c3",
6
6
  "capabilities": [
7
7
  "cobol-evidence",
8
8
  "codec-capability",
@@ -13,7 +13,7 @@
13
13
  "plan-audit",
14
14
  "research"
15
15
  ],
16
- "baselineBytes": 36857772,
16
+ "baselineBytes": 36863916,
17
17
  "maximumAssetBytes": 50000000,
18
18
  "maximumTarballBytes": 25000000,
19
19
  "maximumUnpackedBytes": 55000000,
@@ -21,22 +21,22 @@
21
21
  "darwin-x64": {
22
22
  "artifact": "godd-native-x86_64-apple-darwin",
23
23
  "bytes": 8704856,
24
- "sha256": "387b1eeceff77b77712db3528ba451aee1db1145f6ad7d41c636bec14585c2b3"
24
+ "sha256": "450bfd9030682b2755d17e45efa2f2a6808a990cf246036cb9a9e703383eb4c7"
25
25
  },
26
26
  "darwin-arm64": {
27
27
  "artifact": "godd-native-aarch64-apple-darwin",
28
28
  "bytes": 7905536,
29
- "sha256": "b38d1c6037ca5ae209c6532b8f7c489d5bd51987c0935ac0fd0e1d2feec71d20"
29
+ "sha256": "43bacbb81e170e3a821a8aadb7aba33cea0b7871f5a3232bb7e598f347f90c80"
30
30
  },
31
31
  "linux-x64": {
32
32
  "artifact": "godd-native-x86_64-unknown-linux-musl",
33
33
  "bytes": 9651280,
34
- "sha256": "2e215e4bd78d0cf5d54fb235f59711467b3896acfde776277ab23cda41e4523c"
34
+ "sha256": "6a2f7c8a7b3cace0b3b41f7f73f5bbae05fd42e9d52a5bcd19f338d7302022df"
35
35
  },
36
36
  "win32-x64": {
37
37
  "artifact": "godd-native-x86_64-pc-windows-msvc.exe",
38
- "bytes": 10595840,
39
- "sha256": "d265c18a2c627bdf88bed1480c070ffb4c286030e979a82c5884cc76b6d32a91"
38
+ "bytes": 10601984,
39
+ "sha256": "5b945c654547e8652ed42e410f9be8ba54e20c0d078838fa3342fdfd1918697a"
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.14.1",
3
+ "version": "2.15.1",
4
4
  "type": "module",
5
5
  "description": "Governed AI development workflows that turn natural-language intent into specifications, tested code, reviews, documentation, and shippable pull requests.",
6
6
  "license": "UNLICENSED",
@@ -18,6 +18,11 @@
18
18
  "require": "./dist/media-interval-adapter-contract.cjs",
19
19
  "default": "./dist/media-interval-adapter-contract.cjs"
20
20
  },
21
+ "./compile-cache-adapter-contract": {
22
+ "types": "./dist/compile-cache-adapter-contract.d.ts",
23
+ "require": "./dist/compile-cache-adapter-contract.cjs",
24
+ "default": "./dist/compile-cache-adapter-contract.cjs"
25
+ },
21
26
  "./*": "./*"
22
27
  },
23
28
  "bin": {
@@ -34,6 +39,8 @@
34
39
  "dist/audio-length-adapter-contract.d.ts",
35
40
  "dist/media-interval-adapter-contract.cjs",
36
41
  "dist/media-interval-adapter-contract.d.ts",
42
+ "dist/compile-cache-adapter-contract.cjs",
43
+ "dist/compile-cache-adapter-contract.d.ts",
37
44
  "scripts/postinstall.js",
38
45
  "scripts/atomic-binary-install.js",
39
46
  "scripts/postinstall-godd-native.js",
@@ -41,6 +48,7 @@
41
48
  "scripts/godd-tk-assets.js",
42
49
  "scripts/postinstall-godd-tk.js",
43
50
  "scripts/write-sha256.js",
51
+ "docs/adapter-contracts.md",
44
52
  "README.md"
45
53
  ],
46
54
  "engines": {
@@ -58,14 +66,15 @@
58
66
  "godd"
59
67
  ],
60
68
  "scripts": {
61
- "build": "pnpm generate:native-catalog && node esbuild.config.js && tsc --ignoreConfig src/audio-length-adapter-contract.ts src/media-interval-adapter-contract.ts --declaration --emitDeclarationOnly --declarationMap false --outDir dist --module ES2022 --target ES2022 --moduleResolution bundler --resolveJsonModule --types node --skipLibCheck",
62
- "build:release": "pnpm generate:native-catalog && GODD_BUILD_MODE=release node esbuild.config.js && tsc --ignoreConfig src/audio-length-adapter-contract.ts src/media-interval-adapter-contract.ts --declaration --emitDeclarationOnly --declarationMap false --outDir dist --module ES2022 --target ES2022 --moduleResolution bundler --resolveJsonModule --types node --skipLibCheck",
69
+ "build": "pnpm generate:native-catalog && node esbuild.config.js && tsc --ignoreConfig src/audio-length-adapter-contract.ts src/media-interval-adapter-contract.ts src/compile-cache-adapter-contract.ts --declaration --emitDeclarationOnly --declarationMap false --outDir dist --module ES2022 --target ES2022 --moduleResolution bundler --resolveJsonModule --types node --skipLibCheck",
70
+ "build:release": "pnpm generate:native-catalog && GODD_BUILD_MODE=release node esbuild.config.js && tsc --ignoreConfig src/audio-length-adapter-contract.ts src/media-interval-adapter-contract.ts src/compile-cache-adapter-contract.ts --declaration --emitDeclarationOnly --declarationMap false --outDir dist --module ES2022 --target ES2022 --moduleResolution bundler --resolveJsonModule --types node --skipLibCheck",
63
71
  "generate:native-catalog": "tsx scripts/generate-native-catalog.ts",
64
72
  "catalog:generate": "tsx scripts/generate-command-catalog.ts",
65
73
  "catalog:check": "tsx scripts/generate-command-catalog.ts --check",
66
74
  "catalog:check:full": "tsx scripts/generate-command-catalog.ts --check --require-site",
67
75
  "typecheck": "tsc --noEmit",
68
76
  "test": "vitest run",
77
+ "test:docs-contract": "node scripts/docs-contract-tests.mjs",
69
78
  "test:realtime-parity": "node scripts/realtime-admission-parity.mjs",
70
79
  "quality-gate:realtime-docker": "docker buildx build --load --no-cache-filter gate --file docker/realtime-admission-parity.Dockerfile --tag godd-realtime-admission-gate:local ..",
71
80
  "test:watch": "vitest",
@@ -84,7 +93,7 @@
84
93
  "esbuild": "0.28.1",
85
94
  "tsx": "4.23.1",
86
95
  "typescript": "7.0.2",
87
- "vite": "8.1.5",
96
+ "vite": "8.2.0",
88
97
  "vitest": "4.1.10"
89
98
  },
90
99
  "pnpm": {
@@ -94,9 +103,9 @@
94
103
  "overrides": {
95
104
  "esbuild": "0.28.1",
96
105
  "rollup": ">=4.59.0",
97
- "hono": ">=4.12.32",
106
+ "hono": ">=4.12.34",
98
107
  "@hono/node-server": ">=2.0.5",
99
- "fast-uri": ">=3.1.4",
108
+ "fast-uri": ">=4.1.2",
100
109
  "express-rate-limit": ">=8.6.0",
101
110
  "ip-address": ">=10.1.1",
102
111
  "qs": ">=6.15.3",
@@ -173,9 +173,12 @@ export const EXPECTED_NATIVE_ASSET_FILES = Object.freeze(
173
173
  // 気づけない)。到達前に検知するため、警告用の閾値と ratchet 上限を定義する。
174
174
  export const NATIVE_ASSET_HEADROOM_WARNING_BYTES = 2_000_000;
175
175
 
176
- // `godd-native-v0.2.25` の exact baseline を、意味のある追加増加を止める
176
+ // `godd-native-v0.2.27` の exact baseline を、意味のある追加増加を止める
177
177
  // non-cumulative ratchet として固定する。absolute ceiling は別途50MBで維持する。
178
- export const NATIVE_ASSET_BASELINE_CEILING_BYTES = 36_857_772;
178
+ // v0.2.25 (36,857,772) からの +18,432 bytes は registry anchor (#1493) と
179
+ // compile cache (#1463) の実装分。昇格ごとに実測値へ再固定するため、
180
+ // 小さな増加が誰にも気づかれずに累積することはない。
181
+ export const NATIVE_ASSET_BASELINE_CEILING_BYTES = 36_863_916;
179
182
 
180
183
  /**
181
184
  * 現在の昇格済みreleaseを上限とし、1 byteでも追加増加すれば拒否するratchet。