The report previously could not compute human accuracy because upstream only
says whether AI and human agree, never who was right. This adds an append-only
local store so a reviewer judges each (typically diverged) document across
weekly passes, and report monthly folds those judgments back in.
- review-store.ts: JSONL per tenant+month (~/.config/seal-use/reviews/
<corpId>-<YYYY-MM>.jsonl), append-only (weekly passes never rewrite), one
record per SN; last write wins on re-adjudication. Verdicts: ai_correct,
human_correct, both_correct, both_wrong, undecided. Env-overridable root
(SEAL_USE_REVIEWS_DIR) for tests; corrupt lines skipped.
- collect.ts: load the store, join verdicts onto fetched blocks, compute
humanAccuracy = (human_right / reviewed) * 100 over adjudicated samples,
expose reviewedCount/divergedCount, and flip humanAccuracyAvailable. No
reviews -> honest gap (still unavailable), never fabricated.
- render.ts: when available, fill the §1.2 human row with real accuracy and
replace the gap warning with a coverage note; when not, keep the warning.
- CLI: `report review set/list --month ... [--sn --verdict --note
--reviewed-by]` (set writes local store, list reads it). Help registers
both as separate commands; read-only list vs mutating set classified
accordingly. Prefix help (`report review --help`) now lists subcommands
instead of erroring.
- parser: register --template/--report-id/--max-runs/--verdict/--reviewed-by
(the first three were previously rejected as unknown, breaking report
monthly's own flags); reviewed-by moves to VALUE_FLAGS so it consumes its
argument.
- SKILL.md: document the adjudication workflow and storage semantics.
Verified: 639 tests (6 new review tests incl. tenant/month isolation, corrupt
line skip, join + accuracy math, honest no-review gap, render coverage note),
tsc clean, oxlint 0 warnings.
Eats in the ai-audit-report-template as a module. The template is the mutable
skin: describeTemplate() infers per-section data demands from ##/### headings
(keyword rules), so editing/renaming/reordering sections does not require
touching collect or render code.
- src/domains/seal/reports/: describe (heading to demand), collect (performance/
risk blocks/template groups, fetched only for declared demands), render (fills
tables by section+column signature, rewrites narrative by structure not line
number), monthly (orchestrator returning content + per-section completeness +
notes).
- report-templates/: the template body, assets, example, and downstream
validate.py/render.py (not bundled; next.validate/render in the result point
at them).
- Capability sealReportMonthlyGet (read-only, allow-listed) + CLI
"seal-use report monthly --month <YYYY-MM>" + help + KNOWN_FLAGS month +
read-only report:monthly.
- SKILL.md: routing row + a section stating the two hard rules: the template is
swappable, and metrics with no upstream source keep template sample values
with a warning note instead of fabricated numbers.
Template-path resolution branches on isCompiledBinary() (dev: module-relative to
repo root; compiled: cwd), matching how rules lint --file resolves paths, since
templates are not embedded.
Verified: bun test 633 pass (6 new reports tests), tsc clean, oxlint 0 warnings.
Live smoke: 2026-08 report for a real corp fills real accuracy/counts/distribution
and marks human-accuracy + mismatch-classification + section-6 sample rows with
gap notes.
`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.
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.
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.
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
* 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
Sync ~/.gemini/config/skills.json to include the user's absolute
global agents skills directory (~/.agents/skills) upon global skill
install, and expose Antigravity status in skill status.
- Prepend the absolute path to entries if not already present
- Migrate legacy tilde path to absolute path to ensure discovery
- Avoid modifying config if target path is already registered
- Provide unit tests covering creation, deduplication, and prepend
- Decouple getHoseProvisionalAuthLink from internal closeapi session cache to prevent silent truncation and cache pollution (#137)
- Add --force, --refresh, -f options and positive integer validation to auth hose-link
- Clarify distinction between Hose web assistance links and Seal delegation tokens across CLI help, SKILL.md, and docs
- Add modular issue resolution and PR workflow rule under .agents/rules/