seal-use users activate <userId> shipped in v0.4.0 as scaffolding for
the automated delegation flow but never made it onto the documented
surface, while sealUserActivate stayed reachable through the MCP write
gateway — an undocumented, ungated mutation. Adopt it:
- Document in the help registry (users area).
- Require --yes like its siblings delete/reset-password (CLI layer
only; the MCP capability call path is unchanged).
- Wire the --dry-run preview already supported by the capability.
- Cover the gate and the preview in users.test.ts and
dry-run-gates.test.ts.
Close the AGENTS.md "Safety Guardrail & Mutation Preview" coverage gap:
every remote-mutating command now supports --dry-run returning
structured JSON with preview: true, without executing the mutation.
- Domain capabilities gain an optional dryRun param and preview
handlers: sealUserCreate/ResetPassword/Delete/Activate/DelegationCreate,
sealDelegationRevoke, sealApprovalRuleCreate/Update/Delete/
VersionPublish, sealSimulationBatchClean, sealInsightRecordAnalyze.
Previews reuse the shared mutationPreview() diff shape; reads (GET)
are allowed to build the before/after, writes never fire.
- CLI wiring: users create/delegation/reset-password/delete, rules
create/update/delete/publish, simulation delete, analytics analyze,
auth link revoke pass dryRun; dry-run bypasses the --yes gate
(webhook delete pattern); corps mark previews the local config tag
change without writing it.
- Shared dryRunOption() helper in parser.ts; help registry documents
--dry-run on all covered commands; cli-protocol.md §3 example list
updated; cli.md and embedded skill regenerated.
- New src/cli/commands/dry-run-gates.test.ts pins the contract:
preview JSON on stdout, zero mutating requests (GET-only where reads
are needed), config untouched for local previews.
Local user-config writes (corps switch/rename, config mode/test-dir/
lint) stay outside this contract: they are reversible local edits with
no upstream effect.
Unify the visible command surface on one canonical spelling per
semantic concept while keeping every legacy spelling working as a
silent parser/dispatcher alias (per .agents/rules/cli-protocol.md §6):
- Fix silent-ignore accept-set gaps: webhook resource-pack export now
reads --out/--output-file and --downloads/--download; approval-runs
and webhook read canonical --start-date/--end-date; webhook secret
reveal accepts --reveal/-r alongside legacy --show-secret.
- Add kebab-case parser registrations for camel-only flags (human-result,
manual-approval-status, include-bridge, rule-version, document-limit,
context-lines, source-document-sn/-id, simulation-batch-id) and read
them in rules/documents search, context, approval-runs list/summary/
bridge/export.
- Retire verbs on the visible surface only: webhook create (add),
simulation delete (clean), preference thinking-depth policies delete
(remove); dispatch keeps both. Runtime nextAction suggestions and
doctor knowledge switch to canonical spellings.
- Add src/cli/naming-charter.test.ts: help surface must be lowercase
kebab-case and free of retired tokens; canonical/legacy spellings
must both parse; P0 accept-sets pinned.
- Document the charter in .agents/rules/cli-protocol.md §7; sync
AGENTS.md, README, and skills/references docs; regenerate cli.md and
embedded skill artifacts.
The shared tokenizer accepts `ms` for the simulation windows, and without a
per-caller unit set that grammar leaked into --expire: `--expire 500ms` was
a usage error before the parsers were unified and became silently rounded to
a 1h / 1s link after.
tokenizeDuration now takes an allowed-unit set; the expire flags pass
EXPIRE_UNITS (d/h/m/s) while parseDurationMs keeps the full set. Adds a
regression test asserting sub-second input stays exit 2 on both flags.
Two findings from reviewing the outbound-push extraction:
The verify poll compared `record.sourceDocumentSN === sn` with `sn` optional,
so a caller that only knows the flowId compared against `undefined` and
matched any record lacking an SN — reporting an unrelated run as the one this
push created, with its id and taskMode in the response. Guard the needle:
an absent SN matches nothing. This class did not exist on the deploy path
before (it compared against flowId only), so it was introduced by the merge.
The replay help text also never listed --sign-key even though the channel
resolves the target integration through it, and selectHoseIntegration now
errors on an ambiguous list with "请通过 --sign-key 指定" — pointing at a
flag the user could not discover from `help approval-runs`.
Adds direct tests for replay-safety.ts (the exit-14 wording, the next action,
and that --force is the only override), which previously had none.
The two --expire flags each carried a byte-identical copy of the same regex
and unit-conversion switch, and a third parser (parseDurationMs) lived in
capabilities/helpers.ts with yet another regex. Because the copies were
independent, --expire 300 could be read differently on each path without
anyone noticing.
core/duration.ts now owns the grammar (tokenizeDuration) and the unitless
heuristic (expireSeconds: a bare number <= 168 reads as hours, larger as
seconds). Each flag keeps only what genuinely differs: Seal delegation links
floor to whole hours and cap at 168h, Hose links round to seconds, simulation
windows are milliseconds and fall back instead of failing the batch.
Adds a cross-flag regression test asserting both --expire parsers read the
same literal the same way.
The deploy capability and the cross-tenant replay each carried their own
copy of the same outbound pipeline: integration selection, the assisted-only
gate, payload/URL construction, and push-then-verify. A change to the wire
contract could drift into one path and not the other.
Move the shared parts into domains/seal/outbound-push.ts and return the raw
CloseAPI messageLog query to the hose domain (domains/hose/close/outbound.ts),
leaving only the replay-specific log matching on the seal side. The
production-target guard is now one implementation (replay-safety.ts) shared
by the corp-pair resolver and the channel validator; both call sites are
kept deliberately as defense in depth.
Behavior note: replay used to silently pick the first integration when the
target had several and no --sign-key was given. It now errors and lists the
available signKeys, matching what deploy already did — pushing a message to
the wrong outbound channel should not depend on array order.