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.
--maxOutputBytes (default 16 MiB, at most 256 MiB) caps a module’s
output on every call the main thread carries, measured by its bytes
there: a client’s call, a job’s run, and a hop routed through the main
thread (its result and its input). Past it the call is refused with
OUTPUT_TOO_LARGE or INPUT_TOO_LARGE, naming the module and the
action. A module that returns more than 16 MiB stops working on upgrade:
raise the cap, or have it return a reference (a path in its data)
instead.--no-directPeerChannels
routes hops through the main thread) is capped the same way, on its input
(INPUT_TOO_LARGE) and its output (OUTPUT_TOO_LARGE), and both are
checked against the called module’s schemas by the main thread before
the handler runs and before the caller sees the result.tools/call, an HTTP
invoke-action, a job’s run, a hop routed through the main thread) has
its input and output validated in a validator worker, under a deadline.
The pool is sized by --validatorWorkers (2 to 4 by default), and each
validation has --validationTimeoutMs (1000 ms by default) from when it
is queued. Past the deadline the call is refused VALIDATION_TIMEOUT.VALIDATION_CALLER_THROTTLED on that module for a minute. A module whose
own outputs or compiles miss it 3 times in 5 minutes is quarantined
(VALIDATION_QUARANTINED) until you load it again.--validationCompileMs
(10000 ms by default). A plainly unsafe schema.json is refused (over
1 MB, a backtracking pattern, a $ref cycle, over 100,000 nodes with
its $refs expanded). Either refusal is MODULE_ASSEMBLY_FAIL, at stage
schemaCompile or schemaSafety. Load modules with heavy schemas in a
test run first.declarations.
Two things a 7.x module could carry are refused: a binary output field
(contentEncoding: base64 with a contentMediaType) that is not under
properties or an array’s items, and x-mcp-header anywhere in an
input schema. countinghouse-validate reports both before you upgrade.--moduleLoadTimeout (120 s by default,
every sandbox mode) ends a worker that hasn’t answered its load in time,
and the load fails MODULE_LOAD_TIMEOUT.require.resolve through the
sandbox’s hooks; multi-tenant hosting of third-party modules should run
24.15 or later, where Node’s own hook covers it. The floor rises to 24
when Node 22 reaches end of life, on 2027-04-30.--moduleDataPath. Every module now gets private data
directories there, in every mode. The default is
$HOME/.countinghouse/module_data; where $HOME is read-only (systemd
ProtectHome or ProtectSystem=strict, a read-only container root) set it
to a writable directory first, or modules fail to load with cannot create
the module data directory. Under systemd, add it to ReadWritePaths
(example).id before rotating any key. 8.0.0 gives
every user an opaque id, an HMAC of the auth entry’s id field, else of
its API key (authentication.md).
Per-user module data and repeatable job schedulers are scoped by it. An
entry without id keeps working, but rotating its key then changes its id
and orphans that data; add id first. The secret behind the ids is
written to <moduleDataPath>/.identity-secret on first start (or comes
from COUNTINGHOUSE_IDENTITY_SECRET, 64 hex characters): back it up with
the module data, since changing it changes every id. Start one server on
a new data directory first; two starting at once on an empty one would
each generate a secret. An unusable --moduleDataPath now refuses
startup with exit 2 (it used to fail each module load instead). Schedulers stored
under the pre-8.0 owner prefix are still found and removed by their owner./app. In worker mode startup exits
with status 2 if countinghouse’s own code is under /app, where modules
see their own files. Install it elsewhere (for example
/opt/countinghouse) or run with --no-workerThread. Modules and data
under /app are fine.MODULE_NAME_MISMATCH, in
every mode. Check registry entries, load_module calls and composite
runsModules bindings before upgrading. POST /load-module may leave
name out.runsModules names the module. A composing module’s identity is
bound by its module name (its package.json name, which the server loads
it under), no longer by a device’s friendlyName. Where the two differ
(the bundled echo-device-client-module, whose device is
echo-device-client), list the module name; one identity runs a module,
all its devices. Under --authProvider sqlite, bind with
countinghouse-auth-sqlite bind-module <apiKey> <moduleName>. Remove the
old friendlyName entries too (from runsModules, or with
unbind-module <friendlyName>): a stale entry still binds whatever module
is loaded under that name. A module left unbound is unloaded at startup
with MODULE_COMPOSITION_INVALID, and its tools are gone from
tools/list.--no-workerThread keeps single-thread
mode, which is now for debugging modules only and has no sandbox. In
worker mode the sandbox runs in audit by default, which changes some
module behaviour (next section); --moduleSandbox off turns its lockdown,
limits and logging off, but not the file broker.pnpm installs and --hardened. --hardened does not work with a pnpm
install of countinghouse until
nodejs/node#66812 is fixed:
Node’s permission model refuses the dependency links. Use npm, or run
without --hardened. pnpm installs work in worker mode without it. If paths
you configure for --hardened overlap by name (one extending another’s,
such as /srv/ch and /srv/ch_data), startup exits with status 2 and
names them; rename one.
127.0.0.1 unless --bindAddr is given (it used to
bind the first non-internal IPv4 address). Remote clients need, for
example, --bindAddr 0.0.0.0. --debug without --debugKey refuses to
start on any other address, a bare --debugKey with no value refuses to
start at all (exit 2), and JSON must be sent as application/json,
not text/plain (form bodies are not parsed at all).--allowedOrigins. CORS is off by default
(it allowed every origin), and every route refuses a request from a
browser origin not listed there. Clients outside a browser are unaffected.--maxRequestBody); they were 1 GB. A client that sends larger bodies
gets 413 until you raise the limit.BSON bodies are no longer taken. A request with
Content-Type: application/bson is answered 415
(REQUEST_UNSUPPORTED_MEDIA_TYPE) on every route, where
POST /devices/:deviceID/invoke-action used to decode it. Send JSON, with
binary data as base64. (MCP was always JSON only.) The
--maxBsonRequestBody option is gone with it: a start that still passes
it is not refused (the flag is ignored, and bounds nothing), so take it
out of your start command.
Jobs that run longer than an hour need --jobTimeout. A job that
sets no timeout of its own is now ended after --jobTimeout seconds
(default 3600; 0 for none), so a handler that never answers cannot
hold a job worker slot forever. It applies when a job runs, so jobs queued
before the upgrade and schedulers stored earlier are bounded too. A job’s
own opts.timeout still wins; either is capped at about 24 days
(setTimeout’s maximum).
add-job’s opts.timeout must be a whole number of milliseconds, at
least 1. A string ("5000"), a fraction, zero or a negative value used
to be coerced or to fail the run; it is now refused at once with
ADD_JOB_ERROR. A job stored earlier with such a value runs under
--jobTimeout, as if it had set none.
add-job with the same name creates a second,
owner-scoped scheduler rather than replacing the old one, so remove the
old one first (admin key, POST /devices/:id/remove-job
{name, isRepeat: true}). Schedulers now belong to the key that created
them; see Rotating a key.ctx.job is never null. Outside a task it is now
{id: null, progress(n), info(cb)}: progress(n), a number from 0 to 100,
is the call’s own progress, sent to an MCP client that asked for it
(_meta.progressToken) as notifications/progress with total: 100, at
most one every 250 ms, the latest value winning, none after the answer.
Only the outer call’s handler is heard: a composite’s parts’ reports are
dropped, and once the outer handler reports, its hops stop counting as
progress. info calls back with an error there. A module that asked
ctx.job == null to tell a call that is not a task must ask
ctx.job.id == null; a module that wrote ctx.job.id into its output
outside a task now gets null where it threw before. Inside a task
nothing changes.contentEncoding: "base64" is an assertion. A string whose
schema says contentEncoding: "base64" must now be canonical RFC 4648
base64 (the standard alphabet, padded, no whitespace, zero pad bits), in an
input and in an output, on every path. Before, it was an annotation that
asserted nothing, so a schema that used it loosely could have passed values
that are now refused (INPUT_DATA_VALIDATION_FAIL or
OUTPUT_DATA_VALIDATION_FAIL, naming the field). No bundled module used it.
Any other contentEncoding stays an annotation.OUTPUT_NOT_JSON. An output
holding a Buffer, a typed array or a DataView is refused in the module’s
worker (--workerThread, the default), naming the field: before, it was
mangled. Single-thread mode serializes no output, so there only a typed
field’s own check refuses one.
Return buf.toString('base64') in a field its output schema declares
{"type": "string", "contentEncoding": "base64", "contentMediaType": "<type>/<subtype>"}.
The check costs a clean output nothing. A bare ArrayBuffer is not caught
by it: under a typed field the validator refuses it, and under an untyped
one it is sent as {}, so don’t return one.api.json, schema.json and
handlers/<service>/<action>.js. A module with a main entry
(package.json "main", or an index.js) and no handlers/ directory is
refused before any of its code runs, with MODULE_LAYOUT_UNSUPPORTED: a
device.js exporting a handler map, or an index.js doing its own
discovery. Move each action into its own handler file (shared code into a
plain file the handlers require); for a 5.x module (a CHDevice with
setAction), npx countinghouse-migrate-module ./my-module does that. A
module that had several devices becomes several modules. With handlers/, a main entry is never
run.ctx.redis is per module (#164). Each key a module names
is stored under m:<module name, URI-encoded>:, the name the runtime loaded it under,
so modules no longer share keys: one module cannot read, overwrite or
delete another’s, nor the runtime’s own (jobinfo:*). A module reads and
writes its keys as it named them. Data a 7.x module wrote unprefixed is not
visible under its new namespace; there is no migration (no module authors
depend on it yet). multi and exec are gone from ctx.redis.DeviceError and CHError are gone. Neither the classes nor
the module-facing globals exist; a module that names them fails at call
time. Report a failure with your module’s own code:
return ctx.error('INPUT_REJECTED', 'text must be a string') (returning it
is the preferred form; throwing it or callback(err) give the same
answer), or throw a plain Error with a .code from a helper that has no
ctx. A module raises only its own codes, never the runtime’s (so
ARGUMENTS_INVALID in a handler becomes a code of your own, such as
INPUT_REJECTED). Before:
throw new DeviceError('ARGUMENTS_INVALID'); after:
return ctx.error('INPUT_REJECTED', 'text must be a string'). See
module-development.md.CHUtil.createSOAPClient. SOAP support and the soap
dependency are gone; a module that calls it fails at call time
(CHUtil.createSOAPClient is not a function). A module that needs SOAP
depends on a SOAP library of its own and declares its hosts under
countinghouse.permissions.net.countinghouse.remotes and call it with ctx.call('remote:<name>/<tool>');
the main thread holds the connection and the credential
(module-development.md;
what the operator allows is under What operators get).ctx.call,
ctx.serviceClient and device queries reach only the devices and actions
it declares in countinghouse.calls; anything else is
CTX_CALL_UNDECLARED.ctx.call serialises its
input once in your worker. A value that structured clone can’t carry, or
a SharedArrayBuffer, now fails the ctx.call there. A
SharedArrayBuffer used to be shared between two modules’ workers.ctx.usage() resolves with the current tools/call’s counts so
far ({calls, linesIn, bytesIn, tokensInEst, servers, sentence}). A
scenario can put its receipt sentence in its own summary. It’s null
outside a counted call, and never carries a key or a caller.receipt output field
(RECEIPT_RESERVED): the runtime adds its receipt to a scenario’s
result, and there the name is its own. Any other module’s receipt field
passes through untouched.rateLimit is no longer enforced. The CDIF-era
device fields rateLimit and price in api.json are retired: nothing
reads them. A spec that still carries one loads and validates, and
countinghouse-validate warns about it; bin/countinghouse-migrate-spec.js
removes both. Limit callers with --apiKeyRateLimit (per key) and
--globalRateLimit (all calls); jobs are bounded by the add-job limits on
repeat.every, repeat.limit and attempts.Under worker mode, in every --moduleSandbox mode unless noted:
audit and
enforce), since worker mode is the default: native addons,
child_process and the other blocked built-ins, process controls, and a
module whose dependencies resolve outside its own directory all work but
are logged under audit, and are refused under enforce. The list is in
the CHANGELOG’s “module sandbox, part 1” section and in
security-model.md./app:
__dirname, __filename, require.resolve, import.meta, stack traces,
process.cwd() (/app) and os.tmpdir() (/tmp). Code that builds
paths from __dirname keeps working; code that logs or compares host
paths sees /app/.... A CommonJS file that an ES module imports directly
still shows its host path in __filename and stack frames (a Node 24
limit)./data and /tmp are private. Each module writes under /data
(kept) and /tmp (its own, not the host’s, and emptied every time its
worker starts). Anything a module left in /tmp is gone after a restart./app are refused under enforce (EROFS), logged under
audit.enforce. Anything outside the
namespace is ENOENT unless the module declares it in
countinghouse.permissions.fs and your --modulePolicy approves it.
Under audit such access works and is logged, so run in audit first and
read the log./data and /tmp together: diskMb (default ceiling
1024) and diskEntries (default ceiling 100 000). Past it, writes are
ENOSPC under enforce; under audit crossings of 75 % and 100 % are
logged...
segment (../f answers EPERM). chmod drops setuid, setgid and sticky
bits. A cross-root rename answers EXDEV.audit and enforce). A
module’s process.env holds the names it declares in
countinghouse.permissions.env, with values from the policy or the
server’s environment; anything else, NODE_PATH included, is unset. For
example, a module that read an undeclared DYNAMIC_DEVICE_COUNT to decide
how many devices to expose falls back to its default.audit and enforce): over
256 MB of heap or external memory, or an event loop blocked for 10 s, ends
the worker; it restarts after 1 s, then 2 s, and is suspended on the 3rd
exit within 10 minutes. A module that sends the main thread more than
--moduleMessageRate messages a second (default 2000) gets
RATE_LIMITED.fs call is a hop to the main thread (see
measured cost). Descriptors from fs.open are numbers
from 0x10000000 up. fs.watch and friends are not available, and
neither is HTTP/2 respondWithFile (read the file with fs and stream
it)./data and /tmp: a worker’s
start walks them, about 70-145 µs per entry on the maintainer’s VM
(715 ms for 10 000 at dab69d0, 1.1-1.5 s at cd411ee on a slower disk;
so 7-15 s near the 100 000 default). The walk does not block the server.Module authors: Files and paths says how to write a module for this.
notifications/cancelled with the request’s id does,
naming a request of your own connection or session only. A cancelled call
writes no answer. A composite stops at its next hop, which is refused, and
a remote call made for it is aborted. Work already running finishes, its
result discarded, and is billed as before: the bill is what ran. A legacy
HTTP request’s disconnect changes nothing, and the call runs to its end.
A task-augmented call cancelled before its task’s id was sent has its job
removed if it hasn’t started (one already running runs to its end). This
is with --workerThread, the default: in single-thread mode a cancel only
suppresses the answer.structuredContent used to be {output: …}, one level above the
outputSchema it advertised, so clients that validate results (the
official MCP SDK client does) rejected every module tool. It is now the
output itself, and content[0].text is the same object serialized. Read
structuredContent, not structuredContent.output.contentEncoding: "base64" with an image/* or audio/*
contentMediaType is sent as an image or audio content block after the
text block, and structuredContent (and the text) hold a reference to it,
{mimeType, bytes, block}, as the tool’s outputSchema says. A client that
knows only protocol revision 2024-11-05, which has no audio content type,
may not render an audio block.text/plain) arrives as a resource block,
{uri, mimeType, blob}, whose uri (countinghouse://r/<id>) can be read
back; its reference in structuredContent carries the uri too. Before,
it stayed a base64 string there and in the outputSchema. Past
--inlineContentBytes (1 MiB of decoded bytes per result, in schema order)
a value is stored instead and sent as a resource_link with its name
(the field), mimeType and size; structuredContent holds
{mimeType, bytes, uri}. resources/read returns it to the caller who
made the call, in the same session, for --resourceRetention (24 h), as
text for valid UTF-8 text/*, else blob; anything else is “Resource
not found”. The server now declares resources: {}; resources/list is
always empty. A result whose stored values would pass a store limit is
refused RESULT_STORE_FULL, with nothing stored. A client on protocol
revision 2025-03-26 or 2024-11-05, which have no resource_link block,
may not show a link; it can still read the uri from the text block.
ctx.call and invoke-action are unchanged: their output keeps the base64
in place.tools/list advertises an output schema whatever its root type (an array,
a string, a number, null), and a modern result carries the output as
structuredContent, whatever its type; the text block is a string output
itself, else its JSON. A legacy request (initialize) is unchanged: only an
object schema is advertised, and other results are text only. A module’s
output may now be any JSON value its schema allows, null included; before,
anything but an object was refused OUTPUT_DATA_VALIDATION_FAIL.tools/call whose params._meta
carries a progressToken (a string of at most 256 characters, or a safe
integer) gets notifications/progress as its hops run: progress counts
the hops and remote calls billed so far, with no total and no message.
They come at most every 250 ms (240 at most per call), always before the
answer and never after. Over HTTP the POST’s response becomes an SSE stream
only when the first one is due and your Accept allows
text/event-stream; a call that answers first is plain JSON, as before. On
stdio they’re lines before the answer’s line; on the shared runtime,
frames on your own session. A runtime started with --no-workerThread
(single-thread mode) sends none: its hops carry no call tokens to count by.tools/list entries do not change._meta. An error result is isError: true with
the message as text and the code in _meta["countinghouse/code"], with no
structuredContent (clients validate it against the output schema even on
errors). Read the code there instead of structuredContent.code.countinghouse_call_tool no longer advertises an output schema: its
result is whatever the inner tool returns.countinghouse_check_balance returns {userName, balance}, not
{apiKey, balance}. userName is null when it would equal the key.tools/list has one more built-in for every key:
countinghouse_usage_report, a key’s own usage counts (an admin’s covers
every caller, by opaque id). A client that pins the tool list sees it.tools/list also has
countinghouse_settings when the runtime is given --settingsFile.
Pack changes are announced as notifications/message (level notice;
the server declares logging and answers logging/setLevel) and once
as a text block on the pack’s next result._meta['countinghouse/receipt'] holds the counts, and a second text block
holds its sentence (read 48,210 lines (3.1 MB) in 14 calls to github; …).
structuredContent is unchanged; a client that reads only
content[0].text is unaffected.INPUT_REJECTED where they answered ARGUMENTS_INVALID, and
INNER_CALL_FAILED where they answered DEVICE_ACTION_CALL_FAIL. A
composite that lets a callee module’s own error escape now answers with
the callee’s code; it was DEVICE_INVOKE_EXCEPTION. 23 catalogue codes
that nothing raised are gone (the CHANGELOG lists them).invoke-action are unchanged: they keep {output: …}.topic in an error body. It is {code, message, fault?}, with
kind and origin beside them. Match on code.application/json for JSON, and the browser
origin check are in Before you upgrade.--moduleRegistry. A start with no
--loadModule no longer reads the CDIF-era registry database
(lib/device-db, sqlite3) or loads modules from it: it loads nothing,
and serves the platform tools. Pass --moduleRegistry to keep the old
behaviour. Under --hardened, such a start no longer gets
--allow-addons either (reference).POST /reload-auth (admin key), and the authoring tool
countinghouse_reload_auth, re-read the auth configuration without a
restart. The file provider swaps a new file in only if it passes its
checks (otherwise AUTH_RELOAD_INVALID, and the configuration in use
stays); the answer never holds a key.--stdio, started by a desktop MCP client
through countinghouse-stdio (bin/countinghouse-stdio.js; not
bin/countinghouse, which pipes the log). The log goes to stderr and no
port is opened (reference).countinghouse.role in a module’s
package.json): --loadModule <scenario> also loads the parts its
countinghouse.calls names; a part it loads is not listed
(MODULE_NOT_LISTED from outside), and a scenario’s tools are listed
under their bare action names. A module with no role is listed as before
(module-authoring.md).tools/call on a listed module is counted at the
runtime’s boundary. --usageDir <dir> appends the records to daily JSON
Lines files (counts, tool and server names, the credential variable’s
name and the opaque caller id; never a credential value or content), and countinghouse-usage --usageDir <dir> prints the
report in your shell. The counts, the receipt and
countinghouse_usage_report work without --usageDir.
Under --store local the directory defaults to <storePath>/usage;
under --store redis it is explicit-only.--store local keeps metering, a
module’s ctx.redis data and jobs in files under --storePath and in
memory, for a client machine. Jobs and MCP tasks run in-process, are not
kept across restarts, and a finished one is readable for --jobResultTtl
seconds (default 3600). --meter keeps balances and limits. With
--stdio and neither --authConfigPath nor --authProvider, it is the
single-identity profile: one key made at start and written nowhere. --store redis stays the default
(reference).POST /uninstall-module {name, keepData} (admin key): removes a
module’s registry entry. Unless keepData is true, it deletes the
module’s data under --moduleDataPath and its ctx.redis keys (its
namespace, m: plus the URI-encoded module name plus :, so @acme/tool’s
keys are under m:%40acme%2Ftool:), so a later module of the same name inherits
neither; the answer gives keysDeleted. A purge that fails answers
MODULE_KEYS_NOT_PURGED. It never removes the module’s code. Unload the
module first (reference). A reload or an
upgrade keeps the keys.--settingsFile <path> (the user’s settings.json) lists the
built-in countinghouse_settings. An agent reads the settings and
tightens them within bounds, and never loosens a guarding one: that’s
SETTING_LOOSENS_A_GUARD, and the user loosens with the ch-local
command instead.--controlChannel ipc is the channel ch-local start uses while
the runtime serves. It works only in the single-identity profile, over
an IPC descriptor the spawning process holds, and is refused with
--hardened. It serves notice (a pack change to announce) and set
(a setting that applies now), and load, unload and reload of a
pack, named by its scenario’s package name. A reload drains, then
switches: calls already running finish on the old version, and new calls
to the pack wait until the new version is up. That wait is at most
--requestTimeout plus the new worker’s start, the cost of upgrading
without a restart.diskMb and diskEntries take the same
ceilings and per-module entries as the other limits.enforce, a module whose data holds a
symlink with an absolute target, or a hard link to a file that also has a
name outside its data, does not start until you remove it; the log names
the entries.enforce, modules cannot read auth.json, other modules’ code
and data, or anything else outside their namespace through fs or the
loader, by the routes the design knows of. Under audit you get a log of
what they would have been refused. The remaining gaps (network access
until parts 3 and 4, host processes racing the checks, module code
reaching countinghouse’s objects) are listed in
security-model.md.countinghouse.remotes and call it with ctx.call('remote:<name>/<tool>')
through the main thread, which holds the connection and the credential. A
credential is sent only where your --remoteCredentials <file> allows
that variable for the declared URL’s exact origin; a remote whose
credential is not allowed is not contacted. --remoteTimeout and
--remoteMaxBytes bound each call
(module-development.md,
security-model.md).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.
runsModules, by the
module’s package.json name, or sqlite’s bind-module), as
Before you upgrade says, and grant that identity
the targets.id to an auth entry before you rotate its key: without one,
the user’s id is derived from the key, so a new key is a new id, which
orphans the user’s per-user module data and schedulers.<moduleDataPath>/.identity-secret (0600), or given in
COUNTINGHOUSE_IDENTITY_SECRET. Back it up with the auth config: a new
secret changes every id.jobinfo:* lists
hold callers’ raw keys. In 8.0 a module’s ctx.redis can no longer reach
them, since every module’s keys live in its own namespace (m: plus the
URI-encoded module name), and new records name their owner by the caller id, but the old
lists stay until removed:
redis-cli -n 5 --scan --pattern 'jobinfo:*' | xargs -r redis-cli -n 5 del
(a job’s history then starts afresh).--moduleSandbox audit and off (the always-denied set aside), so keys
in such files are within its reach there: run enforce for tenants you do
not trust, and keep Redis behind a password or ACL
(security-model.md).From benchmarks/sandbox-part2.md, on the
maintainer’s VM; treat these as orders of magnitude and measure your own.
9246db1): about 30 ms with no broker (--no-workerThread),
1.2 s in worker mode under --moduleSandbox off, 1.9 s under enforce.
Brokered file I/O costs tens of times the direct path. Modules doing
occasional file I/O will not notice; modules doing thousands of small
synchronous operations per request will.POST /restart-module until a
small module answers again took a median of about 1.3 s at cd411ee
against about 4.2 s on 7.1.2, same module and machine, 2 CPUs. What part 2
adds to each start is the walk of /data and /tmp: about 0.7-1.5 s per
10 000 entries on the maintainer’s VM, depending on the disk.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.
respondWithFile is not available to modules.__filename and stack frames of a CommonJS file imported directly by
an ES module show its host path.--hardened does not support pnpm installs
(nodejs/node#66812).--hardened with an npm-hoisted install (countinghouse’s
dependencies beside it in node_modules) is refused before it relaunches:
Node 24.22’s permission model refuses grants whose names extend each
other’s there (ajv beside ajv-formats;
nodejs/node#66812), and
countinghouse names them and exits 2. This is a limitation of Node, not of
countinghouse: until Node fixes it, on Windows run --moduleSandbox enforce
without --hardened (enforce protects files on Windows without it;
--hardened is the opt-in extra layer), or from an install whose
dependencies are inside it.countinghouse.permissions.fs)
are not available yet; it gets its own /data and /tmp
(#204). Under
enforce a declared path is refused, as any path outside the namespace.