@junghanacs/entwurf 0.12.10 → 0.13.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.
Files changed (43) hide show
  1. package/AGENTS.md +2 -1
  2. package/BASELINE.md +45 -6
  3. package/CHANGELOG.md +16 -0
  4. package/CONTRIBUTING.md +4 -2
  5. package/DELIVERY.md +1 -1
  6. package/README.md +20 -5
  7. package/VERIFY.md +7 -4
  8. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/backend-adapter.js +148 -5
  9. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/config.js +16 -4
  10. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/models.js +66 -7
  11. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/overlay.js +190 -5
  12. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/tool-surface.js +12 -4
  13. package/package.json +4 -2
  14. package/pi/settings.reference.json +1 -1
  15. package/pi-extensions/acp-provider.ts +20 -10
  16. package/pi-extensions/lib/acp/augment.ts +60 -2
  17. package/pi-extensions/lib/acp/backend-adapter.ts +183 -8
  18. package/pi-extensions/lib/acp/backend.ts +5 -1
  19. package/pi-extensions/lib/acp/config.ts +19 -5
  20. package/pi-extensions/lib/acp/engraving.ts +3 -1
  21. package/pi-extensions/lib/acp/event-mapper.ts +10 -3
  22. package/pi-extensions/lib/acp/models.ts +69 -7
  23. package/pi-extensions/lib/acp/overlay.ts +234 -5
  24. package/pi-extensions/lib/acp/tool-surface.ts +12 -4
  25. package/run.sh +152 -21
  26. package/scripts/check-acp-cortex.ts +668 -0
  27. package/scripts/check-acp-provider-surface.ts +50 -6
  28. package/scripts/check-acp-session-reuse.ts +64 -1
  29. package/scripts/check-gate-qualification.ts +2 -0
  30. package/scripts/check-probe-cli-shim.ts +879 -0
  31. package/scripts/check-probe-ordering.ts +2450 -0
  32. package/scripts/check-shell-quote.ts +4 -4
  33. package/scripts/fixtures/probe-cli-shim +20 -0
  34. package/scripts/fixtures/probe-mcp-server.ts +168 -12
  35. package/scripts/lib/probe-acp-turn.ts +207 -0
  36. package/scripts/lib/probe-cli-shim.ts +464 -0
  37. package/scripts/lib/probe-cli-target.ts +165 -0
  38. package/scripts/lib/probe-event-log.ts +383 -0
  39. package/scripts/lib/probe-verdict.ts +1213 -0
  40. package/scripts/mutants/acp-cortex.json +196 -0
  41. package/scripts/mutants/probe-ordering.json +1032 -0
  42. package/scripts/smoke-acp-cortex-live.ts +392 -0
  43. package/scripts/smoke-acp-ordering-probe-live.ts +848 -0
@@ -0,0 +1,196 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "lane": "acp-cortex",
4
+ "mutants": [
5
+ {
6
+ "claim": "CORTEX-CURATED-FOUR-ROWS",
7
+ "title": "dropping a curated row silently shrinks the GLG-decided 4-row cortex surface",
8
+ "subject": "pi-extensions/lib/acp/models.ts",
9
+ "find": [
10
+ "export const SUPPORTED_CORTEX_MODEL_IDS = [",
11
+ "\t\"cortex-auto\",",
12
+ "\t\"cortex-claude-opus-5\",",
13
+ "\t\"cortex-claude-sonnet-5\",",
14
+ "\t\"cortex-openai-gpt-5.4\",",
15
+ "] as const;"
16
+ ],
17
+ "replace": [
18
+ "export const SUPPORTED_CORTEX_MODEL_IDS = [",
19
+ "\t\"cortex-auto\",",
20
+ "\t\"cortex-claude-sonnet-5\",",
21
+ "\t\"cortex-openai-gpt-5.4\",",
22
+ "] as const;"
23
+ ],
24
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
25
+ "timeoutSeconds": 300,
26
+ "signature": "[QK:CORTEX-CURATED-FOUR-ROWS]",
27
+ "signatureSource": "scripts/check-acp-cortex.ts"
28
+ },
29
+ {
30
+ "claim": "CORTEX-AUTH-NARROW-CREDENTIAL-CACHE",
31
+ "title": "widening the auth passthrough to the whole cortex/cache leaks operator tool_outputs/tip_history into the child",
32
+ "subject": "pi-extensions/lib/acp/overlay.ts",
33
+ "find": [
34
+ "\tcortexLinkIfExists(",
35
+ "\t\tjoin(realSnowflake, \"cortex\", \"cache\", \"credential_cache\"),",
36
+ "\t\tjoin(cortexDir, \"cache\", \"credential_cache\"),",
37
+ "\t);"
38
+ ],
39
+ "replace": [
40
+ "\trmSync(join(cortexDir, \"cache\"), { recursive: true, force: true });",
41
+ "\tcortexLinkIfExists(join(realSnowflake, \"cortex\", \"cache\"), join(cortexDir, \"cache\"));"
42
+ ],
43
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
44
+ "timeoutSeconds": 300,
45
+ "signature": "[QK:CORTEX-AUTH-NARROW-CREDENTIAL-CACHE]",
46
+ "signatureSource": "scripts/check-acp-cortex.ts"
47
+ },
48
+ {
49
+ "claim": "CORTEX-AUTOUPDATE-OFF",
50
+ "title": "flipping autoUpdate back on lets the cortex runtime replace itself on launch mid-rail (D4)",
51
+ "subject": "pi-extensions/lib/acp/overlay.ts",
52
+ "find": ["\treturn `${JSON.stringify({ autoUpdate: false }, null, \"\\t\")}\\n`;"],
53
+ "replace": ["\treturn `${JSON.stringify({ autoUpdate: true }, null, \"\\t\")}\\n`;"],
54
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
55
+ "timeoutSeconds": 300,
56
+ "signature": "[QK:CORTEX-AUTOUPDATE-OFF]",
57
+ "signatureSource": "scripts/check-acp-cortex.ts"
58
+ },
59
+ {
60
+ "claim": "CORTEX-BRIDGE-DUAL-HOME",
61
+ "title": "dropping the bridge-only real-HOME restore leaves the garden store cut off — tools reach the model but see an empty garden (D10)",
62
+ "subject": "pi-extensions/lib/acp/overlay.ts",
63
+ "find": ["\t\tif (stdio.name === CORTEX_DUAL_HOME_BRIDGE_SERVER) env.HOME = realHome;"],
64
+ "replace": ["\t\tvoid realHome;"],
65
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
66
+ "timeoutSeconds": 300,
67
+ "signature": "[QK:CORTEX-BRIDGE-DUAL-HOME]",
68
+ "signatureSource": "scripts/check-acp-cortex.ts"
69
+ },
70
+ {
71
+ "claim": "CORTEX-MCP-NON-STDIO-FAILLOUD",
72
+ "title": "silently dropping a non-stdio server advertises a config the session does not have (D9 fail-loud)",
73
+ "subject": "pi-extensions/lib/acp/overlay.ts",
74
+ "find": [
75
+ "\t\tif (\"type\" in server && (server.type === \"http\" || server.type === \"sse\")) {",
76
+ "\t\t\tthrow new Error(",
77
+ "\t\t\t\t`entwurf: cortex mcp.json projection cannot represent ${server.type} server ` +",
78
+ "\t\t\t\t\t`${JSON.stringify(server.name)} — only stdio entries are measured through ` +",
79
+ "\t\t\t\t\t`$SNOWFLAKE_HOME/cortex/mcp.json (CP0 D9). Remove it from entwurfProvider.mcpServers ` +",
80
+ "\t\t\t\t\t`for cortex models or front it with a stdio bridge.`,",
81
+ "\t\t\t);",
82
+ "\t\t}"
83
+ ],
84
+ "replace": [
85
+ "\t\tif (\"type\" in server && (server.type === \"http\" || server.type === \"sse\")) {",
86
+ "\t\t\tcontinue;",
87
+ "\t\t}"
88
+ ],
89
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
90
+ "timeoutSeconds": 300,
91
+ "signature": "[QK:CORTEX-MCP-NON-STDIO-FAILLOUD]",
92
+ "signatureSource": "scripts/check-acp-cortex.ts"
93
+ },
94
+ {
95
+ "claim": "CORTEX-OVERLAY-SESSION-SCOPED",
96
+ "title": "a static shared overlay dir lets two residents overwrite one mcp.json/envelope",
97
+ "subject": "pi-extensions/lib/acp/overlay.ts",
98
+ "find": ["\tconst scopeDir = join(overlaysRoot, cortexOverlayScopeId(params.scopeKey));"],
99
+ "replace": ["\tconst scopeDir = join(overlaysRoot, \"shared\");"],
100
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
101
+ "timeoutSeconds": 300,
102
+ "signature": "[QK:CORTEX-OVERLAY-SESSION-SCOPED]",
103
+ "signatureSource": "scripts/check-acp-cortex.ts"
104
+ },
105
+ {
106
+ "claim": "CORTEX-HOME-PRESENCE-REFUSED",
107
+ "title": "a truthy check instead of presence lets an empty-string CORTEX_HOME slip past the refusal (D3 E2b nuance)",
108
+ "subject": "pi-extensions/lib/acp/backend-adapter.ts",
109
+ "find": ["\t\tif (\"CORTEX_HOME\" in process.env) {"],
110
+ "replace": ["\t\tif (process.env.CORTEX_HOME) {"],
111
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
112
+ "timeoutSeconds": 300,
113
+ "signature": "[QK:CORTEX-HOME-PRESENCE-REFUSED]",
114
+ "signatureSource": "scripts/check-acp-cortex.ts"
115
+ },
116
+ {
117
+ "claim": "CORTEX-LAUNCH-NO-MODEL-PIN",
118
+ "title": "re-introducing the launch -m pin creates a second model authority that drifts from per-turn set-model",
119
+ "subject": "pi-extensions/lib/acp/backend-adapter.ts",
120
+ "find": [
121
+ "\tresolveLaunch({ config }) {",
122
+ "\t\tconst settings = config.adapterSettings as CortexAdapterSettings | undefined;",
123
+ "\t\tconst connection = settings?.cortexConnection?.trim() || undefined;",
124
+ "\t\tconst selectionArgs: string[] = [];"
125
+ ],
126
+ "replace": [
127
+ "\tresolveLaunch({ config, nativeModelId }) {",
128
+ "\t\tconst settings = config.adapterSettings as CortexAdapterSettings | undefined;",
129
+ "\t\tconst connection = settings?.cortexConnection?.trim() || undefined;",
130
+ "\t\tconst selectionArgs: string[] = [\"-m\", nativeModelId];"
131
+ ],
132
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
133
+ "timeoutSeconds": 300,
134
+ "signature": "[QK:CORTEX-LAUNCH-NO-MODEL-PIN]",
135
+ "signatureSource": "scripts/check-acp-cortex.ts"
136
+ },
137
+ {
138
+ "claim": "CORTEX-ENFORCE-SET-MODEL",
139
+ "title": "enforcing a constant instead of the native id silently answers with the wrong model (CP0-M)",
140
+ "subject": "pi-extensions/lib/acp/backend-adapter.ts",
141
+ "find": [
142
+ "\t\tawait setConfig.call(connection, { sessionId: acpSessionId, configId: \"model\", value: nativeModelId });",
143
+ "\t},",
144
+ "",
145
+ "\t// A connection change must invalidate a reused session (§4/§7). Flat,"
146
+ ],
147
+ "replace": [
148
+ "\t\tawait setConfig.call(connection, { sessionId: acpSessionId, configId: \"model\", value: \"auto\" });",
149
+ "\t},",
150
+ "",
151
+ "\t// A connection change must invalidate a reused session (§4/§7). Flat,"
152
+ ],
153
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
154
+ "timeoutSeconds": 300,
155
+ "signature": "[QK:CORTEX-ENFORCE-SET-MODEL]",
156
+ "signatureSource": "scripts/check-acp-cortex.ts"
157
+ },
158
+ {
159
+ "claim": "CORTEX-OVERLAY-KEY-IS-SESSION-KEY",
160
+ "title": "re-deriving the overlay scope from ambient env drops opts.sessionId — two same-process/cwd sessions alias one overlay/mcp.json",
161
+ "subject": "pi-extensions/lib/acp/backend-adapter.ts",
162
+ "find": ["\t\tconst overlay = ensureCortexDualHomeOverlay({", "\t\t\tscopeKey: sessionKey,"],
163
+ "replace": ["\t\tconst overlay = ensureCortexDualHomeOverlay({", "\t\t\tscopeKey: piSessionId ?? \"static\","],
164
+ "gate": ["bash", "run.sh", "check-acp-cortex"],
165
+ "timeoutSeconds": 300,
166
+ "signature": "[QK:CORTEX-OVERLAY-KEY-IS-SESSION-KEY]",
167
+ "signatureSource": "scripts/check-acp-cortex.ts"
168
+ },
169
+ {
170
+ "claim": "ACP-OVERLAY-SESSIONKEY-WIRED",
171
+ "title": "passing a cwd-derived key instead of resolveSessionKey's value silently merges distinct sessions' overlay scopes at the production call site",
172
+ "subject": "pi-extensions/lib/acp/backend.ts",
173
+ "find": [
174
+ "\t\t\tconst overlay = adapter.ensureOverlay({ cwd, modelId: model.id, nativeModelId, config, sessionKey });"
175
+ ],
176
+ "replace": [
177
+ "\t\t\tconst overlay = adapter.ensureOverlay({ cwd, modelId: model.id, nativeModelId, config, sessionKey: `cwd:${cwd}` });"
178
+ ],
179
+ "gate": ["bash", "run.sh", "check-acp-session-reuse"],
180
+ "timeoutSeconds": 300,
181
+ "signature": "[QK:ACP-OVERLAY-SESSIONKEY-WIRED]",
182
+ "signatureSource": "scripts/check-acp-session-reuse.ts"
183
+ },
184
+ {
185
+ "claim": "CORTEX-PROVIDER-SIX-ROW-SURFACE",
186
+ "title": "filtering the cortex rows out of the REAL provider entry drops the whole backend from the operator's model list while models.ts and check-acp-cortex stay green",
187
+ "subject": "pi-extensions/acp-provider.ts",
188
+ "find": ["\t\tmodels: allCuratedModels(),"],
189
+ "replace": ["\t\tmodels: allCuratedModels().filter((m) => !m.id.startsWith(\"cortex-\")),"],
190
+ "gate": ["bash", "run.sh", "check-acp-provider-surface"],
191
+ "timeoutSeconds": 300,
192
+ "signature": "[QK:CORTEX-PROVIDER-SIX-ROW-SURFACE]",
193
+ "signatureSource": "scripts/check-acp-provider-surface.ts"
194
+ }
195
+ ]
196
+ }