Commit Graph
51 Commits
Author SHA1 Message Date
gitea 6b4f0f26e6 Release v0.10.26: updater installs the skill from the new binary, archive-first downloads 2026-09-15 23:43:14 +08:00
gitea 5b05c2695a Fix stale skill install and prefer the release archive 2026-09-15 23:39:06 +08:00
gitea a707eff850 Release v0.10.25: MCP boot fix, read-only/write tool split, contract and release gates 2026-09-15 23:07:13 +08:00
gitea c3ec09d0a0 Tighten credential modes, pid identity and repo hygiene 2026-09-15 17:40:52 +08:00
gitea 1a80a0fb4c Fix refusals of read-only approval-runs verbs and keep the lists in sync
The read-only MCP tool refused three verbs that only query:
approval-runs search, pick and bridge. #117's changelog claimed pick had
'moved into read-only', which was true of the tool registry but not of the CLI
allow-list — the two are hand-maintained in different files and had drifted.

Adds the missing entries, and a test that derives the pairing mechanically:
every 'action === "x"' in src/cli/commands/* that dispatches to a
runTool("seal_...") must be read-only when the tool it reaches is read-only.
It asserts a minimum number of pairs so a change in dispatch shape cannot make
it silently vacuous, and names its exceptions explicitly — the deploy
<action> short forms (rejected at runtime, so unreachable) and
approval-runs search (an accepted alias of list with no registry row).

Half of these were found by that check rather than by reading the code.
2026-09-15 16:26:17 +08:00
gitea d0acb02e4b Pin bun-version and gate dist/mcp/server.js freshness
The committed MCP bundle is the only thing that ships, but nothing checked
that it matched src/. The gate could not be added while CI ran
'bun-version: latest': that resolved to 1.4.2, and the minifier allocates
identifiers differently across Bun releases, so the runner rebuilt the
macOS/1.3.14-built bundle into different bytes — identical code, renamed
variables (N/S, A/I, q/p). Measured on #116.

Pin bun-version to 1.3.14 in both workflows, matching the local toolchain and
the @types/bun/bun-types already declared in package.json, then add the diff
gate alongside the existing boot check.

The boot check stays: a bundle that cannot start is invisible to a byte diff
when it is in sync with its broken source, which is exactly how #114 shipped.
2026-09-15 16:21:01 +08:00
gitea 11b8cfce39 Classify the tool registry so read-only MCP can reach read-only tools
The read-only MCP tool refused the whole `seal-use tool <name>` area, because
the 98-entry internal tool registry had no read/write classification. Now it
does: SEAL_READ_ONLY_TOOLS (66) and SEAL_MUTATING_TOOLS (32), exported from
src/domains/seal/tools.ts, with the policy delegating `tool` to them.

The two sets are exhaustive by construction — a test asserts they partition
sealTools exactly — so a newly added tool fails the suite until it is
classified, rather than silently defaulting into one bucket.

Classifying by inspection was not enough. Cross-checking mechanically (every
exported function in src/domains/seal that performs a mutating HTTP call,
mapped to the tools that invoke it) caught a real mistake shipped in #115:
`analytics analyze` was allow-listed as read-only, but it calls
seal_insight_record_analyze, which issues a POST and starts an analysis
server-side. Removed from the CLI allow-list; a comment records why it is
absent, since the name reads like a query.

`approval-runs pick` went the other way into read-only: it dispatches to
seal_approval_run_pick, which is a query over approval runs rather than a
local-state mutation.

Read-only means: reads tenant state, or writes only a local file. Anything
that creates, updates, deletes, publishes, pushes, replays, uploads, activates
or mints a credential counts as mutating. `seal_webhook_material_pack` is
mutating because push mode sends the pack even though preview mode does not;
`seal_approval_runs_export` and `seal_insight_export` are read-only because
they only write a local workbook.
2026-09-15 16:18:44 +08:00
gitea 8a032f02d1 Drop the byte-diff gate; keep booting the freshly built bundle
CI disproved the freshness gate on the first run: an ubuntu rebuild of the
macOS-built committed dist/mcp/server.js differs, and the diff is entirely
minified identifier renaming (N->S, A->I, q->p) with identical code. The
minifier does not allocate names reproducibly across platforms and Bun
versions, so a byte-for-byte gate cannot work here without pinning the
toolchain and matching runners.

Keep the check that does hold: boot the freshly built bundle and complete an
MCP handshake. Booting is what #114 actually needed — the byte diff would not
have caught that bug either, since the broken bundle was in sync with its
broken source.
2026-09-15 16:07:41 +08:00
gitea b0bad7e33d Add CI gate for dist/mcp/server.js freshness
The committed bundle is the only thing that ships, but CI only checked that
it compiled — never that it matched src/, and never that it could start.

- Fail when a fresh build differs from the committed dist/mcp/server.js,
  mirroring the existing dist/openapi.json gate, with the same actionable
  error. This is viable now: the bundle is byte-reproducible with the current
  toolchain (a rebuild of the committed file is byte-identical). Before the
  #114 rebuild it was not, which is why this was previously left out.
- Keep booting the freshly built bundle through a handshake, since a bundle
  that cannot start is invisible to source-level tests.
2026-09-15 16:04:56 +08:00
gitea 758c26354a Split the MCP passthrough into read-only and write tools
seal_cli could reach every CLI command, so its tool annotations had to be
all-or-nothing: destructiveHint true on a tool that mostly reads, which meant
clients could not auto-approve anything, and there was no way to gate the
mutating minority. Split it in two:

- seal_cli      read-only, readOnlyHint true / destructiveHint false.
- seal_cli_write mutations, publishing, credential minting, self-update and
                server commands; destructiveHint true.

The boundary is enforced rather than advertised. seal_cli runs only commands
on an explicit allow-list (84 entries, src/cli/read-only.ts) and fails closed
on anything unclassified, including commands added to the CLI later. Matching
reuses the CLI's own parseArgs and compares whole tokens, so a read prefix
cannot smuggle a mutation (corps listing is refused) and a bare allow-listed
command does not cover its subcommands. Refusals name seal_cli_write.

Deliberately excluded from the read-only set even though they look harmless:
anything writing local config (corps switch, config test-dir), minting or
printing credentials (auth keys, corps extract-keys), self-updating (update),
or standing up a long-running server (http, mcp, service run). seal-use
tool <name> is excluded too, since the 98-entry internal tool registry is not
itself classified.

A test asserts every allow-listed command still exists in the help registry,
so the list cannot silently rot.

Also, per the note that MCP is an optional, default-off path, the skill now
says so explicitly: the CLI is primary, a missing seal_cli* tool is the normal
default rather than a fault, and enabling it is the user's choice in the plugin
settings. Corrected skill docs that presented internal tool-registry names
(seal_webhook_get, seal_webhook_update, ...) as if they were MCP tools; the MCP
server exposes only the two seal_cli* tools.

CI: the MCP build step now boots the freshly built bundle and completes a
handshake, instead of only checking that it compiles. A bundle that cannot
start is invisible to source-level tests, which is how the previous unbootable
entry point shipped. No byte-for-byte dist diff gate here: the committed
bundle is not byte-reproducible with the current toolchain (~186 lines of drift
rebuilding the unmodified release commit), and such a gate would not have
caught that bug anyway, since the broken bundle was in sync with its source.
2026-09-15 16:02:03 +08:00
gitea 524259c67c Migrate MCP server to SDK v2 and fix the bundle that never booted
The plugin ships dist/mcp/server.js as its MCP entry point, and that bundle
could not start at all: it threw "TypeError: ... is not a constructor" while
loading and never answered a request. MCP defaults to off, so enabling it
produced no seal_cli tool and no visible error.

Root cause: src/server.ts is circularly entangled with the CLI command graph
(server -> cli/runner -> cli/commands/mcp -> server, and
server -> cli/runner -> cli/commands/http -> http/routes -> server). When
bun build --target=node flattened that cycle together with zod's own
core <-> classic cycle, zod's class initialisers landed after the top-level
z.lazy() call the SDK makes at import time, leaving ZodLazy undefined.

Not fixable by changing targets: --target=bun, --compile, and dropping
--minify all fail the same way. Only removing the cycles fixes it.

- Moved tokenizeCommand / normalizeCliArgs to a leaf module (src/cli/tokenize.ts)
  and made the mcp command import the server lazily, removing both cycles.
- Added a test that boots the packaged bundle over stdio and completes a
  handshake; the existing tests exercise source, not the shipped artifact,
  which is why this went unnoticed. Verified it fails on the old bundle.
- Committed the rebuilt dist/mcp/server.js, since the previously committed
  artifact is the broken one.

Also migrated the monolithic @modelcontextprotocol/sdk v1 to the v2 split
packages (@modelcontextprotocol/server for the server,
@modelcontextprotocol/client for tests):

- Low-level Server + setRequestHandler -> high-level McpServer + registerTool;
  hand-written JSON Schema -> z.strictObject (still emits
  additionalProperties: false).
- Added the title and annotations clients could not previously see:
  readOnlyHint false, destructiveHint true, idempotentHint false,
  openWorldHint true. seal_cli is a passthrough that can reach mutating verbs,
  so it must not be advertised as safe to auto-run or safe to retry; the
  description now names the command families needing user confirmation.
- startServer uses serveStdio, which owns protocol-era negotiation
  (2025-era clients keep working) and teardown.
- .mcp.json uses the ZCode-native ${ZCODE_PLUGIN_ROOT}; verified in ZCode's
  resolver that CLAUDE_PLUGIN_ROOT and ZCODE_PLUGIN_ROOT are the same alias.

Dropping the v1 SDK removes express, hono, cors and ajv from the dependency
graph (bun.lock -149 lines).
2026-09-15 15:32:39 +08:00
gitea 82d0d97efb Remove untraceable driftCount from approval-runs export (#112)
`approval-runs export` returned a bare audit-drift counter with no way to
trace it back to a document: no sourceDocumentSN, no recordId, no reason.
Interpreting it required a separate per-document `approval-runs flow`
query, and the word "drift" alone suggested the tool or the approval flow
was broken rather than a snapshot/lifecycle difference.

The drift itself is already visible in the workbook row: AI 决策「通过」
next to 人工审核「已取消」 and E人工行为「已撤回」, with the retraction
recorded in the standard formatted E人工意见 column. The aggregate carried
no information those columns do not.

`seal_approval_runs_export` never enabled flow alignment, so for MCP
consumers the field was a constant 0.

Rather than enriching the field, remove it. Per-run auditDrift and
auditDriftReason in `approval-runs flow` are unchanged.
2026-09-15 15:00:00 +08:00
gitea d83f3f74e5 Add equal credential scope principle for Hose admin cURL privilege elevation 2026-09-15 11:23:27 +08:00
gitea c50ea3edad Release v0.10.24: Hose assist link OpenAPI key extraction and privilege elevation 2026-09-15 11:17:03 +08:00
gitea 564566032d Release v0.10.23: Hose flow alignment, targeted SN export, and minute timestamp suffix 2026-09-15 10:40:55 +08:00
gitea 3082919d76 Release v0.10.22: Webhook resource pack export and HLab rule linter 2026-09-14 11:47:10 +08:00
gitea db79d5bc6a Release v0.10.21: Standardized export date range, 180-day safety limit, and count time filters 2026-09-14 10:17:09 +08:00
gitea d7aaf15c12 Release v0.10.20: Tenant doctor, rule regression matrix, and usage ranking 2026-09-13 23:38:35 +08:00
gitea 41cc1ba8c5 Release v0.10.19: Smart insights suite & Excel export, official rule linter isolation, and unified Seal HTTP client 2026-09-13 13:43:18 +08:00
gitea f4929abb0c Release v0.10.18: System diagnostic doctor and intelligent fuzzy search 2026-09-11 18:12:36 +08:00
gitea c6224407be Release v0.10.17: Automatic hosecloud integration sync, staging simulation guide, and CLI help completion 2026-09-11 15:08:44 +08:00
gitea 50131d1f4c Release v0.10.16: Full knowledge sync, semantic versioning and local dev override 2026-09-11 12:24:13 +08:00
gitea 8fa0016d89 Release v0.10.15: Contextual help, test enterprise pairing & sync, and directory normalization 2026-09-11 11:06:16 +08:00
gitea 0e1f744c53 Release v0.10.14: unify staging capability coverage 2026-09-11 09:44:38 +08:00
gitea 79c9420e4e Add material pack attachment file policy 2026-09-08 14:54:51 +08:00
gitea 80e0dea178 Release v0.10.13: Enforce material-pack scope isolation and strict path uniqueness 2026-09-08 10:00:10 +08:00
gitea 06561bc893 Release v0.10.11: Standard approval runs Excel export command and tool 2026-09-07 16:33:12 +08:00
gitea b5cc7c874e Release v0.10.10: Remove default cwd enterprises loading and add global test-dir config 2026-09-07 15:26:21 +08:00
gitea edafe033dc Release v0.10.9: Purge legacy MCP code, decouple CLI commands, and clean unused exports 2026-09-04 19:08:16 +08:00
gitea c5381e2c66 Release v0.10.8: Approval run attachments extraction and download command 2026-09-04 18:48:40 +08:00
gitea cba3098654 docs: document global stop command and shutdown route in changelog 2026-09-04 18:08:13 +08:00
gitea 37580dac44 Release v0.10.7: Local rules workspace and daemon HTTP server 2026-09-04 17:54:47 +08:00
gitea 64819d86cb Release v0.10.6: Webhook material pack import 2026-09-03 15:30:43 +08:00
gitea 0a3c984018 Release v0.10.5: Intelligent HoseCloud sync discovery, actionable guidance, and --auto support (Fixes #26) 2026-09-03 11:41:56 +08:00
gitea 1cf35dfd78 Release v0.10.4: Built-in rule linter, dynamic TS plugin loader with fault-tolerant fallback, and default-disabled global config 2026-09-03 11:30:52 +08:00
gitea 3e06c0f266 Release v0.10.3: Auto platform probing for Hose deployment, alias support, multi-target routing, and stderr next-step guidance 2026-09-02 18:18:54 +08:00
gitea afa039142f Release v0.10.2: add agent self-bootstrap guide to SKILL.md and CI mirror isolation 2026-09-02 16:36:17 +08:00
gitea 8e9141953d Release v0.10.1: standardize main branch, rename repo to seal-use, and optimize release pipeline 2026-09-02 16:18:54 +08:00
gitea 068637c667 feat: rebrand seal-home to seal-use with self-healing upgrade and backward compatibility (v0.10.0) (#15) 2026-09-02 15:42:25 +08:00
gitea ade7156c01 Release v0.9.8: Add assistance link onboarding (#13) 2026-09-02 14:55:08 +08:00
gitea e1f7c76d19 Release v0.9.7: Improve agent onboarding
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
2026-09-01 14:46:18 +08:00
yunyingk 6a4f49b766 Release v0.9.6: Add dynamic transfer speed and stall detection (#8)
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
* Release v0.9.6: Add dynamic transfer speed and stall detection to update downloader

* refactor(update): enforce 6s 300KB initial warmup gate and 10s stall resilience
2026-08-27 16:23:33 +08:00
gitea 7bc98389eb Release v0.9.5: Optimize CI/CD pipelines, enable parallel builds, and add SHA-256 checksums
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
2026-08-27 16:10:50 +08:00
gitea 2c1de28a16 Release v0.9.4: Optimize update fail-safe fallback routing and enforce global skill sync
🧪 CI / 🧪 Test & Type-Check (push) Has been cancelled
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
2026-08-26 16:31:00 +08:00
gitea 7572e56018 Release v0.9.3: Add automated Hose enterprise initialization and multi-domain probing
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-26 16:05:10 +08:00
gitea 6a17cd081b Release v0.9.2: Real-time streaming download progress and live mirror feedback during self-update
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-25 19:10:30 +08:00
gitea 3c085456b0 Release v0.9.1: Add native HTTP REST API server, interactive /docs, and CLI endpoints
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-25 19:03:23 +08:00
gitea 7441e0a9a8 Release v0.9.0: Add multi-platform simulation, deploy hosecloud, and preference management
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-25 18:04:53 +08:00
gitea af5344bd66 Release v0.8.1: Automated Gitea release dual-publishing and installer visual progress feedback
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-25 16:24:43 +08:00
gitea 539941bba5 Release v0.8.0: Multi-Source High-Speed Downloads, Gitea Acceleration & Strict Anti-Rollback
Binaries / Build & Release Binaries (push) Has been cancelled
2026-08-25 16:05:06 +08:00