countinghouse

Upgrading to 8.0.0

One page for operators deciding on the upgrade from 7.x. 8.0.0 runs modules in worker threads by default, inside the module sandbox (parts 1 and 2), with every file access a module makes going through the main thread. The CHANGELOG has the full list; this page groups it by what you have to do. What the sandbox does and does not protect is in security-model.md.

Before you upgrade

What modules will notice

Under worker mode, in every --moduleSandbox mode unless noted:

Module authors: Files and paths says how to write a module for this.

What MCP clients will notice

What HTTP API clients will notice

What operators get

Modules no longer receive API keys (R2-1)

The runtime no longer hands a module an API key or a user name. Before and after:

A module reads 7.x 8.0
ctx.caller {apiKey, userName, isAdmin} {id, isAdmin}: id is u_ and 22 characters, the same for a user everywhere on this server
ctx.recordUsage(...)’s answer {apiKey, tool, cost, ts} {id, tool, cost, ts}
ctx.httpHeaders every request header minus X-CH-Key, X-App-Key and Authorization
ctx.serviceClient({..., as}) authorizes as as as is refused (“identities come from the operator’s runsModules binding; remove as”); it authorizes as the module’s binding, like ctx.call
CHUtil.createServiceClient({appKey}) in a worker authorizes as appKey refused; use ctx.serviceClient
CHUtil.dm, CHUtil.ci reachable gone from the global CHUtil (undocumented; breaking for any use)
a hop callee’s ctx.caller the hop identity’s key the hop identity’s {id, isAdmin}

For module authors. Replace ctx.caller.apiKey and .userName with ctx.caller.id (a bill or a per-user record keys on it), drop as from ctx.serviceClient, and declare every call in countinghouse.calls: in 8.0 a third-party module’s undeclared inner calls are refused (CTX_CALL_UNDECLARED), whatever API it uses. The bundled demos and examples show the shape.

For operators.

Measured cost

From benchmarks/sandbox-part2.md, on the maintainer’s VM; treat these as orders of magnitude and measure your own.

Going back to 7.x

7.x does not know about --moduleDataPath: modules that wrote under /data in 8.0.0 will not find that data after a downgrade. Copy what you need out of <moduleDataPath>/<name>/data first.

Known issues