README documented commands the dispatcher no longer accepts: `seal-use tool
<toolName>` and `seal-use tools list` were both dropped in v0.10.39 while the
README kept telling readers to run them (verified: both answer "Unknown
command"). It also described `./enterprises` as loaded by default, which a test
explicitly asserts is *not*, claimed the HTTP adapter does not serve the
OpenAPI document it serves at `/openapi.json`, described `service start` as a
stdio wrapper rather than the HTTP adapter it runs, and said the MCP server
advertises exactly one tool when it advertises two (and none without
`SEAL_USE_MCP_ENABLED`).
Each claim was rewritten against the code. The `seal-use update` paragraph now
describes all three installation modes instead of only the source-checkout one.
To keep the docs from drifting again, the suite now scans README, AGENTS.md,
SECURITY.md, the skill references, and the `.agents/rules` for `seal-use <area>`
and fails if any area is not dispatchable — it flags `tool` and `tools` on the
pre-fix README, so the check is live rather than decorative.
The adapter's CORS allow-list offered `X-Seal-Home-Session` and openapi
declared it as a `localSession` security scheme required on every operation —
while no handler ever consulted the header and the scheme's own description
admitted it authenticates nothing. Generated clients would fabricate a token
for a check that does not exist, and a browser client sending it could fail a
preflight against a header the server no longer offers.
Remove the header from the allow-list (it now mirrors the two headers this
adapter actually reads), drop the scheme and its `security` requirement, and
state the trust model plainly in `info.description` where an API consumer sees
it. SECURITY.md keeps the authoritative wording and points at that paragraph
instead of at a scheme that no longer exists.
The local-adapter stance itself is untouched: no authentication is added, per
`.agents/rules/security-posture.md`.
The stdout contract was enforced by review alone, which is how `probe` shipped
prose on the machine channel: 161 output sites and no test ever asked which
stream they used. This test scans `src/` for `console.log` / `process.stdout.write`
calls and fails on any file outside the documented exceptions — `printer.ts`
(the machine-channel writer), the two document-dump commands (`doctor guide`,
`skill dump`), and the entry points that echo the captured result.
Asserted in both directions: a new writer fails, and an allow-listed file that
stops writing fails too, so the exception list cannot outlive its justification.
`runProbe` wrote its progress notes and three separate JSON blobs to stdout, so
every consumer parsing the output — `seal-use probe | jq`, the Agent Harness —
got prose interleaved with data. The command is also in the help registry, so
this was a documented command breaking its own contract.
The probe now returns one `ProbeResult` and the command prints it through
`printJson`; the `[probe] …` narration moves to stderr, which is the diagnostics
channel. The dev-script entry point keeps the same payload and its exit code.
Classified read-only too: `probe` reads tenant state and writes nothing, but
the allow-list had no entry, so the MCP read-only tool refused it. Its trailing
token is an enterprise selector rather than a verb, so the matcher accepts the
bare form and bare-plus-selector while still refusing a third token.
All 99 registry tools declare a zod schema, and not one of them was ever
parsed: `runToolResult` (every CLI command) and `executeSealTool`
(`POST /api/tool/:name` and every `/v1/*` route) handed `params` straight to the
handler. A missing required field reached the handler as `undefined` and died
as an opaque upstream error or a `Cannot read properties of undefined`, and an
out-of-range `limit` sailed through to the tenant.
Both paths now gate on `parseToolParams`, failing fast with the field path:
exit 13 on the CLI, HTTP 400 behind the adapter (structured exit codes map onto
statuses instead of collapsing every failure into 500). The HTTP tool endpoint
validates before `selectCorp`, which records usage stats to disk — a request
that can never succeed should cause no writes.
Two properties keep this a pure addition: the original params are returned
rather than zod's parsed output (handlers read undeclared keys — the configure
tool accepts `appKey` alongside `apiKey`, which the schema now says out loud),
and query strings are coerced to the declared type first, because `/v1/*`
passes `url.searchParams` where the schema wants `z.number()`.
Windows cannot rename-replace a running executable, so the win32 update path
renames the live image to `<binary>.old.<timestamp>` and never deleted it: one
full binary (tens of MB) leaked per update, forever. The same file cannot be
removed during the update that created it either — it is the executing image —
so the sweep runs at the start of every binary-mode invocation instead, which
includes the SWR background `update check --bg-save` that runs on its own.
Orphaned `.tmp-update-<ts>` staging dirs from an interrupted run are swept by
the same pass, gated on a one-hour mtime so a staging dir an update is actively
downloading into is never pulled out from under it.
The plugin's MCP surface (dist/mcp/server.js, ~9.8MB) was never turned on
(the enable_mcp default was false, README says most users do not need it) and
its only consumer was .zcode-plugin's .mcp.json. Meanwhile every source change
had to rebuild and re-commit a fresh 9.8MB minified version — 129 versions,
~556MB of blob history — for a tool nobody used.
What goes away:
- .mcp.json, dist/mcp/server.js, scripts/build-plugin.mjs, the `build:plugin`
script, and the CI "Build MCP Plugin & Verify" step (and its bundle gate).
- plugin.json drops `mcpServers` and the `enable_mcp` userConfig: the plugin
now ships skills only.
- bump-version and the PR template stop rebuilding/reminding about the bundle.
What stays:
- The local MCP: `seal-use mcp` runs the stdio server from source/the binary,
and `seal-use mcp-config` still prints the snippet for Cursor/Claude
Desktop/Codex. src/server.ts keeps its in-process tests (6/6) — only the
"boot the packaged bundle" test is dropped, since there is no artifact.
- The embedded skill images in the compiled binary: build:binary still runs
generate-embedded-skill, so `seal-use skill install` writes all 6 real PNGs
(verified: 22 files, valid PNG signatures).
Docs updated (README, AGENTS, issue-pr rule, PR template, SKILL.md) so no
reference to dist/mcp or build:plugin remains outside historical proposals
and CHANGELOG.
Both P0s from the September bug report were fixed but had no regression
test guarding them:
- replay --sn ignored the argument and replayed the newest record. The new
test feeds a two-record search and asserts the requested (older) record is
replayed — and that a missing SN fails with a lookup error rather than
falling back to the newest.
- regression demanded --webhook but honouring it did nothing. The new test
runs the live path with two target channels: without a selector it exits 13
with guidance, with --webhook the selector error disappears (mockApiFetch
learns to serve the approval-style channel catalog).
runner.ts statically imported all 28 command modules, so `seal-use version`
paid for exceljs, archiver and the embedded skill bundle on every run:
measured 175ms against a 7ms bare-bun baseline.
Dispatch branches now load their handler with await import() on demand, and
compareSemVer/isNewerVersion move to a tiny core/semver.ts so the version
path no longer drags in the 1200-line updater. selectCorp and
createSealClient follow the same pattern. Measured after: version 37-45ms,
help 40ms, corps list 40ms. The performance contract in cli-protocol.md is
updated from an aspirational <10ms to a measured <50ms with the numbers.
update.ts's service-restart finally block is also restructured: throwing from
finally swallowed the original update error, and the previous catch/branch hid
a restart failure behind a log line.
the dead `args` parameter of handleMcpCommand goes with its caller here, so
the signature change and the call site land together.
parseArgs decided a flag's kind from whatever token followed it, so
`corps list --all now` fed "now" into --all and crashed with Invalid boolean,
a bare `--limit` was silently dropped (full dataset pull), and `--limitt` was
silently ignored with exit 0.
Add BOOLEAN_FLAGS / VALUE_FLAGS / KNOWN_FLAGS registries derived from how the
code reads each flag (booleanOption vs stringOption/numberOption). Booleans
never consume the next token, value flags must receive one, unknown flags
fail with a did-you-mean suggestion, and the three dual-use flags (f, h,
version) keep the legacy heuristic. parser.test.ts — previously zero tests on
the entry point — locks all of it plus a help.ts cross-check.
deploy hosecloud status/list/get masked apiKey and apiSecret but printed
signKey in clear — yet signKey rides in the outbound callback URL as
config_id, so it behaves like a credential (redactSensitiveText already
carried it in its error-path pattern). Add it to redactIntegrationSecrets;
operators still get it from the stderr Next-action guidance when they need
it for `sync <signKey>`.
Also fixes a latent bug in redactSensitiveText: the JSON-field pattern used
$3 but only captured two groups, so redacted JSON came out malformed
(`"signKey":"<redacted>$3`). New redact.test.ts locks the query-string,
Bearer, JSON and field-list behaviour.
rules delete / documents delete / webhook delete all gate behind --yes, but
users delete, users reset-password and simulation clean reached the API with
no confirmation at all — a bare invocation deleted live data. Add the same
confirmationRequired gate (exit 10, no API call) the other destructive
commands use, and update the help registry plus the skill reference so the
usage lines show --yes.
loadCorpConfigs parsed every file with a bare Schema.parse, so one hand-
edited JSON aborted the whole directory: every corps/rules/webhook command
died with a raw parse error and no hint which file was at fault.
Each file now parses inside its own try/catch — bad files are skipped and
reported once per process on stderr with the offending path; the remaining
enterprises stay usable. loadGlobalConfig falls back to defaults (warning on
stderr) so config paths / corps list keep working for diagnosis. doctor gains
a config_parseability check that names unparseable files.
The classifier only matched English usage wording, so every Chinese-language
usage error, every enterprise-selection failure, and every Zod/SyntaxError
fell through to exit 1 ("upstream failure"), while environment safety guards
were reported as exit 2 or 1. Add two semantic codes:
- 13 (validationError): well-formed command, unusable value — missing --corp,
unparseable enterprise JSON, missing required parameter, ambiguous webhook
channel selection.
- 14 (safetyBlocked): the target environment forbids the action — replaying
into production, regression outside a test tenant.
classifyCliError now recognises Chinese usage wording, enterprise-selection
phrasing, local file problems, Zod issue lists (structural, not textual) and
SyntaxError; English Usage:/Unknown-command stays 2, domain failures and
quality gates stay 1. Docs (AGENTS, cli-protocol, skill cli.md) and the exit
code assertions follow.
Turn on noUnusedLocals/noUnusedParameters so the compiler keeps flagging
dead symbols, then clear the 737 findings it reports: unused imports across
src/, unused parameters, unreachable locals, and the copy-pasted 135-line
import prologues in the seal tool modules (each tool file now imports only
what it uses). Also applies the equivalent-safe lint rewrites (Array.from
instead of new Array(n).fill, non-null assertions in tests after toBeDefined,
simplified spreads, unused catch params) that oxlint will gate in a later
commit.
- Gate rules push behind --yes at CLI and domain layers (fail-closed on
dryRun=false without confirm)
- Raise webhook replay partial failure as CliError so exit 1 survives
cli.ts exitCode overwrite; route webhook stdout through printJson for
exit-12 protection and --output-file support
- Narrow MCP read-only allowlist: drop config mode/lint (write forms are
indistinguishable under token-prefix matching; config get covers reads)
- Extract redactSensitiveText to core, extend credential patterns, apply
to HTTP sendError/500 and domain error messages
- Pass release TAG_NAME via env instead of inline ${{ }} interpolation
to close script injection through crafted tag names
- Track .zcodeignore so enterprise credential exclusions travel with the
repo
- Add .agents/rules/security-posture.md documenting usability-first
accepted risks (loopback adapter auth, update verification, mutation
command gates, skill dump stdout); register skill dump as a documented
stdout Markdown exception in AGENTS.md and cli-protocol.md
- Rebuild dist/mcp/server.js
- Replace a real-looking signKey example with a placeholder in
hose-enterprise-deploy.md and rebuild embedded bundles so no
residual value ships in dist/mcp/server.js.
- Document exit codes 11 (auth missing/invalid) and 12 (output
protection) in AGENTS.md and .agents/rules/cli-protocol.md so
they match src/core/errors.ts and references/cli.md.
- Split the Webhook resource-pack workflow out of references/cli.md
into references/webhook-resource-pack.md (cli.md 50KB -> 39KB) and
add a routing row in SKILL.md; all 14 references stay covered.
* Fix enterprise fuzzy search and Seal auth link output
* Refine auth link output with aligned ordered fields and Beijing ISO expiry
* Docs: remove redundant delegation list note from hose-enterprise-auth.md
* Bundle: update dist/mcp/server.js after doc cleanup
* Refactor: eliminate delegation command in favor of auth link suite
* Refactor: standardize auth check command with hidden diagnostic aliases