Commit Graph
332 Commits
Author SHA1 Message Date
gitea d25c09c3be feat(simulation): 支持单租户未发布草稿快照、已发布版本回溯与每刻报销接入
- 模拟测试原生支持 ruleSource:默认保持以线上生效规则运行(无破坏性变更);显式传递 --draft 对未发布草稿拍摄不可变快照;传递 --rule-version <versionId> 回溯指定历史发布版本。
- 单租户原地即可闭环草稿模拟验证与多版本对比,彻底解耦对双企业组(corps sync-test 强制预发版)的硬依赖。
- 新增每刻报销(maycur / maycur-standard)来源系统支持,引入 --form-codes 单号批量测试并自动解析租户 signKey。
- 完善 simulation create 参数解析器、Zod 类型定义、Help 文档与 Skill 决策工作流规约。
2026-11-17 11:14:15 +08:00
gitea b980c60c3a Improve CLI ergonomics for Langfuse search and approval run diagnosis 2026-11-13 12:35:59 +08:00
yunyingk 67cd168ed4 Merge pull request #283 from yunyingk/mac15/fix-flow-error-attribution
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Canceled after 0s
fix(approval-runs): 不再把传输层失败当成业务结论
2026-11-10 19:49:37 +08:00
yunyingk c572cba842 fix(approval-runs): 传输层失败不再被误判为业务结论
`sealApprovalRunFlowGet` 用两次"请求被拒"充当路由信号:记录查询被拒,就
认为入参是单号;运行记录列表被拒,就认为该单据没有 AI 记录。两处都写成
裸 `catch {}`,于是所有失败都被吸收进这两个业务结论。

后果不是偶尔不准,而是以十足的语气给出错误答案:token 过期、连接重置、
网关 5xx 会被渲染成「单据已删除」或「AI 从未审核」,用户没有任何线索去
怀疑刚才那次请求其实失败了;退出码同时失去语义,本该由 classifyCliError
产出 11(认证/上游失败),实际退化成一次"成功的查询"。

现在只有标识符形态的拒绝才计为未命中:HTTP 400/404/422,或响应体确实
到达但不是一条审批记录。认证失败、5xx、限流、以及根本没有响应的传输
错误一律原样上抛。

- errors:导出既有的 `responseStatus` 结构读取器,让调用方能区分"没有
  响应"与"收到了 400/404 响应"。
- approval-runs:新增 `isUpstreamLookupMiss`,替换两处裸 catch。
- test:新增四个回归用例(401/403/503/连接失败),断言原始错误对象抵达
  调用方;另加一条非合思租户的守卫用例。
2026-11-10 19:47:48 +08:00
yunyingk 71845c35e7 fix(cli): 不再在帮助与文档中暴露已退役的 --flow 拼写
`approval-runs get --flow` 至今仍是 `approval-runs hose-flow` 的静默遗留
别名:解析器的布尔标志白名单里还留着它,命令实现里也仍在转发。但 CLI
协议第 6 节要求兼容拼写只能停留在实现层,不得出现在 help、Skill、
references、README 或正常运行时提示中。

问题在于这条规矩被自己的文档破了:`get --help` 中 `--raw-json` 的描述写着
"incompatible with --summary, --fields and --flow",references 里同一句话也
照抄了一遍。用户只要撞上一次参数冲突,就会被 CLI 主动教一遍退役拼写。

- help:`--raw-json` 描述去掉 `--flow`,改为指向规范命令
  `approval-runs hose-flow <recordId|SN>`。
- approval-run-lightweight.md:同步修正,并补上原生合思流程时间线的入口。
- 运行时:冲突报错改为只列调用方实际传入的标志,不再主动广播退役拼写。
- naming-charter:新增裸 `--flow` 的边界守卫。原有
  LEGACY_SURFACE_TOKENS 是子串匹配,无法表达这个概念(`--flow-id`、
  `--flow-ids`、`--flow-concurrency` 都是规范参数),这正是该泄漏存活
  八个版本的根因。
2026-11-10 19:47:43 +08:00
gitea 0ff3d9a313 feat: 新增租户 active 状态与统一禁用闸门 2026-11-08 12:52:05 +08:00
gitea f454d62be1 feat: 增加 SealAI 官方规则 CSV 导出 2026-11-06 15:00:05 +08:00
gitea 8c9f102931 feat: 原生 Seal 授权续期自愈与本地 SQLite 分歧待办闭环
- 授权自愈: 引入长效会话 Cookie 备份池,支持 Seal 原生协助授权到期与 401 报错时平滑自动换发与静默续期;
- 存储升级: 审核报告人工裁决底座迁移至 SQLite (~/.config/seal-use/state/reviews.sqlite),支持历史 JSONL 自动平滑导入与向后兼容双写;
- 分歧待办: 新增 report review unreviewed 与 dismiss 命令,收集人机不一致单据并在日常企业命令完成后于 stderr 注入 Agent 动作指引;
- 精密频控: 实现 30 天单据时效窗口过滤(陈年单据自动归档)、动态 5 小时滑动窗口频控与 24 小时人工拒审静音抑制协议;
- 透明认知: 全面补充 Skill 路由与帮助手册,消除黑盒,透传数据边界与安全红线。
2026-11-02 15:22:47 +08:00
gitea a885d1478e test(update): 为 cleanStaleBinaries 增加临时目录沙箱隔离
在 `src/cli/commands/update.ts` 中为 `cleanStaleBinaries` 增加可选的 `candidateOverrides` 参数,允许在单元测试中注入沙箱路径。
在 `src/cli/commands/update.test.ts` 中重构单测,使用 `mkdtempSync` 创建临时隔离文件测试活跃路径保留与废弃文件清理逻辑,杜绝在宿主机测试期间误伤或删除真实全局二进制。
2026-10-29 15:48:34 +08:00
gitea 3540c634a0 test: 为全局技能版本检查增加测试环境隔离与环境变量覆盖
在 `src/core/skill-version.ts` 中引入 `SEAL_USE_GLOBAL_SKILL_DIR` 环境变量,支持自定义覆盖全局 Skill 路径。
在 `src/cli/runner.test.ts` 中通过隔离的临时目录运行 CLI runner 测试,避免开发者本地环境或发版预检期间 `~/.agents/skills/seal-use` 版本漂移导致 `runner.test.ts` 误报。
同时增加专门的单测验证 Skill 新于 CLI 时 stderr 告警与引导输出。
2026-10-29 15:25:23 +08:00
yunyingk a40bcd1967 Merge pull request #271 from yunyingk/mac15/improve-export-tasks
fix: 统一审核记录导出的后台等待与实时进度
2026-10-29 15:15:03 +08:00
gitea 87bb10f527 feat(install): 支持 --system 与 --user 模式切换并自动清理残留二进制
- 在 scripts/install.sh 中默认安装至用户目录 ~/.local/bin,并自动清理历史遗留的 /opt/homebrew/bin/seal-use
- 在 scripts/dev-override.ts 中优先命中 ~/.local/bin/seal-use,忽略 Homebrew 路径并自动清理残留
- 在 seal-use update 中支持 --system(提权迁移至 /usr/local/bin)与 --user(降权回归至 ~/.local/bin)选项,添加 seal-use migrate 别名
- 迁移与更新时自动清理另一端的非活动实体二进制(恪守 Single Binary Invariant)
- 自更新权限预检:当目标位于系统目录且缺少写权限时,友好提示 sudo seal-use update 而非底层报错
- 在 seal-use doctor 中增加执行模式识别与多份二进制(PATH 阴影)检测告警
2026-10-29 15:10:40 +08:00
gitea db5a3f7139 fix: 修复审核记录导出进度与后台等待机制
为审核记录导出增加可复用的本地后台任务及 status/wait/list,等待超时或观察进程退出后任务继续执行。
统一实时脱敏诊断输出,保留 stdout 单一 JSON;补齐高级参数、预览和筛选配置摘要。
默认保留合思未找到单据,分别统计单据与审核记录,并显式报告部分补取失败。
补充 CLI/Skill 版本诊断、技能路由及回归测试,修复企业列表加载开销和源码更新测试隔离。
2026-10-27 15:59:04 +08:00
gitea d5725e12d1 Adopt users activate with --yes gate and --dry-run preview
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.
2026-10-25 00:56:23 +08:00
gitea ffb9820822 Add --dry-run mutation previews across remaining mutating commands
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.
2026-10-24 22:08:37 +08:00
gitea 245ec33d1a Enforce cross-domain naming charter with silent legacy aliases
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.
2026-10-24 21:56:59 +08:00
gitea d77c0505d8 Refine simulation batch timestamps and update source messaging 2026-10-23 17:01:21 +08:00
gitea ed57c0cd42 Add local search for simulation batches 2026-10-23 16:42:20 +08:00
gitea 3ae39bcc08 Add native JSON fallback for approval record details 2026-10-22 16:19:52 +08:00
gitea 41e0bfba71 Report verified personnel names for assistance links 2026-10-22 12:35:28 +08:00
gitea b5dd3560b6 Add approval record extra risk filtering 2026-10-22 12:34:54 +08:00
gitea a2963c736c Preserve auth exit codes when document readback fails 2026-10-20 17:40:06 +08:00
gitea b017e1fc48 Add safe knowledge document file editing 2026-10-20 17:30:38 +08:00
gitea 10852eb198 Fix platform-dependent config selection test 2026-10-20 10:23:36 +08:00
gitea b21d92efae Add expense store lookup by document number 2026-10-20 10:15:08 +08:00
yunyingk 4b3a899e5a Merge pull request #242 from yunyingk/mac15/clean-report-templates-and-assets
Clean report templates, drop legacy charts, and refine guidelines
2026-10-18 22:54:55 +08:00
gitea 05dfd0f5bb Clean report templates, drop legacy charts, and refine guidelines 2026-10-18 22:53:25 +08:00
gitea d40ab9648d Add normalized invoice fields, first-class invoices CLI, and CLI-attributed conflict diagnosis 2026-10-18 22:52:36 +08:00
gitea 9e7275f09b Add protocol test closures for secure writes, aliases, help and cli docs 2026-10-18 11:16:07 +08:00
gitea 50e4e492b4 Fix architecture review findings and align CLI metadata 2026-10-17 20:17:06 +08:00
gitea 818f33a8e1 Refine report glossary to plain business language and improve math layout 2026-10-16 18:27:18 +08:00
gitea 69d5b4f130 Add trailing terms definition appendix to report renderers 2026-10-16 18:06:02 +08:00
gitea 91feec7b0b Refine risk intercept fallback calculation and sync ledger documentation 2026-10-16 17:44:58 +08:00
gitea 04915c6ad6 Refine report data collection to support unlimited runs without 500 cap 2026-10-16 17:36:36 +08:00
gitea c6bd113fff Add report ledger workflow, refine terminology and codify skill discipline 2026-10-16 15:35:25 +08:00
gitea 077ecb050c Refine report pipeline to support date ranges and recordId reviews 2026-10-16 14:56:11 +08:00
gitea d127e80c1b Release v0.11.9: Automated release bump 2026-10-16 11:42:28 +08:00
gitea bbff9338a0 Add hose-ebot command for Hose outbound discovery and approval callback 2026-10-16 11:19:50 +08:00
yunyingk 2749d765b3 Merge pull request #238 from yunyingk/mac15/auth-hose-openapi-token
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
Add auth hose-openapi-token command for Hose enterprises
2026-10-15 17:07:52 +08:00
gitea 6e4a8cb088 Add auth hose-openapi-token command for Hose enterprises 2026-10-15 17:05:55 +08:00
gitea f6fe0de286 Add pkg/report standalone external validation suite and example report 2026-10-15 16:47:26 +08:00
gitea f9f72fa918 Decouple chapter numbers from validation and pipeline rendering to allow arbitrary chapter order 2026-10-15 16:39:33 +08:00
gitea a52b6ac117 Standardize report tables on clean 2-column format with clickable SN 2026-10-15 16:29:28 +08:00
gitea 7df5feb7b7 Add automated audit link column and reconcile divergence metrics 2026-10-15 16:06:29 +08:00
gitea 16f3f252c0 Align Hose document URL with backlogDetail hash routing 2026-10-15 15:36:26 +08:00
gitea 25d1036eed Refine approval run URL resolution with Hose fallback and SSO 2026-10-15 15:27:14 +08:00
gitea 0210051ab7 Implement pre-flight adjudication gate and companion ledger cross-validation 2026-10-15 15:17:44 +08:00
gitea 1fb61f794e Fix report sample count and decision distribution for scoped runs 2026-10-15 14:53:25 +08:00
gitea aad591569a Streamline monthly report template and enhance validator 2026-10-15 14:30:59 +08:00
gitea 2177a06f39 Add lightweight report data capability and authoring reference 2026-10-13 17:22:02 +08:00