7 Commits
Author SHA1 Message Date
gitea 957cb04324 feat: AI PRO 离线凭证激活与统一门禁
默认不激活 AI PRO,需服务方离线下发 Ed25519 签名凭证后在本地执行
hose-aipro login 激活。凭证只含 sub / exp / maxVersion 等业务字段,
校验完全在本地完成,不联网。

约束仅两条:
- 当前二进制版本不得高于 maxVersion(三段数字比较,忽略 -dev 后缀)
- 当前时间不得晚于 exp(绝对到期时间;不做时长上限、不做时钟防篡改)

实现要点:
- src/cli/aipro-license.ts 单文件承载验签、版本比较、0600 凭证落盘、
  门禁与 login;公钥内嵌源码,私钥由签发方离线保管、绝不进仓库
- src/aipro-cli.ts 分发层 12 行统一门禁;login 在门禁前分流且不进命令
  注册表。以后新增任何 AI PRO 命令只需照常注册,自动受门禁管辖,
  授权代码零侵入
- scripts/license/issue.ts 离线签发,私钥只读本地文件或环境变量,
  exp 想签多久签多久,脚本不施加任何天数限制
- 放行 status / help / version 等自省命令,其余业务命令未激活一律拦截
- 测试用进程内依赖注入临时密钥对,不引入环境变量后门
- skills/hose-aipro/SKILL.md 补充激活说明

校验:bun test 1094 pass / 0 fail,bun run check 通过;
端到端冒烟(未激活拦截 → 签发 → login → 版本超限拒绝)全通过。
2026-11-05 15:07:55 +08:00
gitea 362acfba58 feat(cli): 分离 hose-aipro 独立命令体系并升级至 v0.9.0
1. 架构对称性与声明式注册表抽取:
   - 新增 src/cli/aipro-registry.ts,声明式定义 AIPRO_COMMAND_REGISTRY 及其别名映射与 mutating 突变检查
   - 重构 src/aipro-cli.ts,移除过程式 switch-case 分发,改为查表式声明分发,与 hose-use 的 CLI_COMMAND_REGISTRY 保持 100% 对称
   - 在 src/cli/registry.ts 统一重导出 aipro-registry,巩固其作为顶层声明注册表的单一事实源地位
   - 增加 aipro-cli 测试用例,强制校验 COMMAND_METADATA["hose-aipro"] 与声明式注册表双向一致性

2. 双 Skill 独立打包与内嵌部署:
   - 注册两个独立技能:skills/hose-use 与 skills/hose-aipro,互相关联引用
   - src/packaging/embedded-skill.ts 增加双 Skill 编译期嵌入与 installSkillFiles 全量同步
   - hose-use / hose-aipro 下的 skill status/dump/install 完全对齐

3. 守护服务交叉治理:
   - src/cli/service.ts 支持 ServiceTargetName ("hose-use" | "hose-aipro"),默认端口 8888 与 8889
   - 支持 hose-use aipro <start|stop|...> 与 hose-aipro hose-use <start|stop|...> 双向服务纳管
   - 误触非本领域业务命令时提供友好互导拦截

4. 审批领域数据层防御加固:
   - 迁移 004:approval_runs 增加 short_id 唯一约束
   - 增加 allocateUniqueShortId 冲突重试,多步写操作纳入事务

5. 版本升级至 v0.9.0:
   - package.json、README.md、specs、.zcode-plugin 及两套 Skill 同步更新至 0.9.0
   - bump-version 脚本适配多 Skill 自动递增
2026-11-03 19:16:12 +08:00
gitea 95eb8ee676 chore(legacy): remove ekb-mcp migration layer, approval db compat shim, and stale daily notes
The ekb-mcp -> hose-use rename migration (LEGACY_* constants,
syncLegacyEnterprisesDir/syncLegacyGlobalConfig with 7-day grace
cleanup, dual-source enterprises resolution) has completed its job:
legacy data self-deleted on active machines years of grace ago.
Config resolution now returns the single primary
~/.config/hose-use source; startup no longer scans the legacy dir.

- core/config/loader.ts: drop legacy constants, sync functions, and
  LEGACY path from diagnostics candidates; loader.test.ts drops the
  three legacy-migration cases
- domains/approval/db.ts deleted: pure pass-through over core/db whose
  consumers (repository.ts) already call core/db directly; the four
  test files now import getDatabase/closeDatabase from core/db
- scripts/dev-hygiene.ts: drop the config.legacy finding and
  legacyConfig snapshot field
- docs/daily/* removed: Python-era (ekb-cli/ekb-mcp) notes describing
  commands and architecture that no longer exist (preserved in git
  history)

No behavior change on machines without legacy data: tsc clean,
313 tests pass (316 minus the 3 removed legacy cases).
2026-10-05 16:29:19 +08:00
gitea 2ed9bf0236 feat: make development builds visibly identifiable 2026-09-13 14:24:27 +08:00
gitea 3e072b490e feat: install development build globally 2026-09-11 17:35:29 +08:00
gitea 27660bed92 feat(approval): introduce configurable gateway policy script and enforce strict reject/approve guardrails 2026-09-07 14:03:22 +08:00
gitea ca00e9a2cc feat(aipro): implement bind, review, decide with gateway guardrail and <150 chars opinion validation 2026-09-06 23:54:36 +08:00