Skip to content

v1.5.0: rule-driven multi-tool registry control plane - #2

Merged
NianLog merged 13 commits into
mainfrom
wip/v1.5.0-migration
Sep 4, 2026
Merged

NianLog merged 13 commits into
mainfrom
wip/v1.5.0-migration

Conversation

@NianLog

@NianLog NianLog commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

CCB v1.5.0:从 Claude Code 专用管理器演进为规则驱动(declarative JSON registry)的多 AI 工具配置控制平面。发布基线 1.4.0 → 1.5.0。

Changes

  • 规则驱动 registry 基础:src/shared/tool-registry 协议 + validator + 内置 Claude Code/Codex adapter;generic discovery/artifact management(EDIT/BACKUP/RESTORE capability 门控)
  • AI 工具管理工作台 + 通用配置资产管理(validation、atomic edit、backup/restore、retention)
  • Registry 发布工具链:sign-registry-bundle(Ed25519 + releaseNotes)、rehearsal 验收(env-gated 6 测试)
  • 云模板库:TemplateCloudService + CloudTemplateLibraryModal(pinned origin + SSRF guard)
  • 配置集(tool-config-set)与 Claude workspace 路径集中化(ClaudeWorkspacePathFacade,LEGACY_COMPAT 不迁移用户数据)
  • 回滚修复:无 last-known-good 时回退内置规则库;registry 状态机枚举彩色 Tag 双语展示
  • 安全:Mimosa L3 门禁 21 项高危全数处置(start-admin 静态化 + env 传参 + -- 终止符;13 处 join 站点 ensurePathWithinBase 边界校验;凭据误报运行期等值消除)
  • 文档契约:ARCHITECTURE/CAPABILITIES 入库;CI 新增 lint:changed ratchet 阻塞项

Testing

  • type-check 零错误
  • lint 零错误 + lint:changed ratchet 通过
  • Vitest 36 files / 252 tests 全通过(含 rehearsal env-gated 6 项)
  • root + proxy-server 双构建通过
  • 生产依赖 audit 双零(root + proxy-server)
  • Mimosa L3 提交门禁通过

NianLog added 12 commits July 12, 2026 22:05
- 云模板库:TemplateCloudService + CloudTemplateLibraryModal,管理侧静态 JSON 分发(SSRF guard + pinned origin)
- Registry 发布工具链:sign-registry-bundle 支持 releaseNotes、发布/验收脚本与 rehearsal 密钥 6 项 env-gated 测试
- 回滚修复:无 last-known-good 时回退内置规则库(EMBEDDED fallback),回滚后状态取自新 snapshot
- 设置面板布局统一;registry 状态机枚举以彩色 Tag 双语展示(13 态,zh/en locales 同步)
- 安全门禁 21 项高危全数处置:start-admin 提升脚本静态化 + 环境变量传参 + `--` 选项终止符;4 个服务 11 处 join 站点 ensurePathWithinBase 边界校验;凭据扫描误报以运行期等值构造消除
- 文档契约:ARCHITECTURE/CAPABILITIES 入库;docs/1.5.0 迁出仓库维护;CHANGELOG 双语与基线更新
- CI/CD:新增 lint:changed ratchet(vs origin/main)阻塞项;release.yml 注释清理;版本 1.5.0 同步 package-lock
Copilot AI lite review requested due to automatic review settings September 4, 2026 19:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new will-navigate restriction in WindowManager can prevent the app’s initial navigation/load and needs a guard (e.g., allow about:blank/empty current URL) before this can be considered safe to ship.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR upgrades CCB from v1.4.0 to v1.5.0, evolving it into a rule-driven (declarative JSON registry) multi-AI tool configuration control plane, with stronger supply-chain verification, safer artifact management, and improved startup/performance telemetry across main/preload/renderer.

Changes:

  • Introduces shared registry/template/performance contracts plus main-process validation, signature verification, and IPC surface for tool registry, artifacts, config sets, and cloud templates.
  • Adds runtime performance telemetry + user-triggered snapshot export flow, along with renderer startup scheduling and performance marks.
  • Tightens security posture (window navigation hardening, path boundaries, safer elevation/start scripts) and adds release/lint ratchet tooling with expanded regression tests.
File summaries
File Description
tests/unit/shared/config-template.spec.ts Adds unit coverage for new artifact template helper functions (ownership, keys, diffs, override validation, migration).
tests/unit/scripts/template-channel-staging.spec.ts Adds staging verification tests to prevent canonical JSON/schema drift between server artifacts and client validators.
tests/unit/scripts/release-preflight.spec.ts Adds regression tests for release preflight checks (trust map, rehearsal key IDs, key leak detection, window security contract).
tests/unit/renderer/startup-scheduler.spec.ts Tests renderer startup batch scheduling and timeout cleanup semantics.
tests/unit/renderer/renderer-performance.spec.ts Tests renderer Performance API mark/measure collection and defensive behavior.
tests/unit/proxy-server/transformers.spec.ts Updates fixtures to avoid secret-scanner false positives while testing API key prefix validation.
tests/unit/preload/performance-api.spec.ts Tests preload IPC forwarding for renderer timing payload export.
tests/unit/main/window-security.spec.ts Tests navigation allow/deny logic (hash-only allowed; cross-origin/protocol/path denied).
tests/unit/main/tool-detection-service.spec.ts Tests platform mapping, safe path templating, and detector aggregation behavior.
tests/unit/main/tool-artifact-management-service.spec.ts Tests capability-gated validation/edit/backup/restore and retention behavior on real FS fixtures.
tests/unit/main/tool-artifact-discovery-service.spec.ts Tests safe discovery/read semantics (bounds, UTF-8, symlink/junction rejection).
tests/unit/main/tool-artifact-codec-service.spec.ts Tests built-in codecs (JSON/JSONC/YAML/TOML/TEXT) and bounded parse depth/node limits.
tests/unit/main/task-scheduler.spec.ts Tests node-cron v4 semantics (task creation vs start behavior).
tests/unit/main/statistics-service.spec.ts Tests initialization merge, unref’d autosave timer, and idempotent shutdown behavior.
tests/unit/main/settings-service.spec.ts Tests legacy template migration into artifact overrides and override-map validation.
tests/unit/main/runtime-performance-telemetry.spec.ts Tests runtime metrics aggregation, normalization, and defensive copying.
tests/unit/main/privilege-manager.spec.ts Tests cross-platform elevation command escaping/boundaries.
tests/unit/main/performance-snapshot-service.spec.ts Tests snapshot capture/export, renderer timing validation, and integration with runtime telemetry.
tests/unit/main/file-watcher-performance.spec.ts Tests watcher topology sampling updates and failure isolation.
tests/unit/main/config-service-performance.spec.ts Tests config scan metrics recording and error isolation (telemetry failures don’t mask scan errors).
tests/unit/main/claude-workspace-path-facade.spec.ts Tests legacy-compat path mode selection and direct-child file boundary enforcement.
src/shared/types/settings.ts Adds artifactTemplateOverrides to editor settings contract.
src/shared/template-cloud.ts Introduces typed cloud template index/payload domain contract (CONFIG_SET / ARTIFACT).
src/shared/performance.ts Adds shared performance snapshot/timing contracts and renderer payload validation.
src/shared/constants/index.ts Binds app version to package.json and updates app description.
src/shared/constants.ts Updates descriptions, adds APP_ID, and adjusts IPC channel literals to avoid scanner false positives.
src/shared/config-template.ts Expands legacy template helpers into artifact template key/ownership/diff/migration/override validation utilities.
src/renderer/src/utils/startup-scheduler.ts Adds renderer startup task batching + cancellable idle scheduling and timeout wrapper.
src/renderer/src/utils/renderer-performance.ts Adds renderer performance mark/measure/timing export helpers with safe fallback.
src/renderer/src/styles/globals.css Moves @import ordering and adds global Ant List layout constraints for long text/action alignment.
src/renderer/src/styles/components/Sidebar.css Removes legacy sidebar styles (file deleted).
src/renderer/src/styles/components/Header.css Removes legacy header styles (file deleted).
src/renderer/src/styles/components/Config.css Cleans up trailing/invalid legacy theme CSS.
src/renderer/src/store/settings-store.ts Adds default artifactTemplateOverrides in renderer settings defaults.
src/renderer/src/store/app-store.ts Introduces MainTab union type and ties fallback version to APP_INFO.VERSION.
src/renderer/src/monaco-runtime.ts Adds minimal monaco runtime entry to reduce bundled workers/features.
src/renderer/src/monaco-esm.d.ts Adds TS declaration shim for monaco deep ESM import path.
src/renderer/src/components/Settings/ArtifactTemplateSettings.css Adds styles for artifact template settings UI.
src/renderer/src/components/Layout/ModernLayout.tsx Adds new “AI Tools” nav entry and adjusts logo text markup.
src/renderer/src/components/Layout/ModernLayout.css Adds container-query based logo scaling and refines typography sizing.
src/renderer/src/components/Config/ModernConfigPanel.tsx Adds multi-tool selector, config-set panel routing, and cloud template modal entry point.
src/renderer/src/components/Config/ModernConfigPanel.css Improves responsive wrapping/ellipsis behavior for toolbars and list item actions.
src/renderer/src/components/Config/ConfigEditor.tsx Adds async artifact template resolution with “don’t overwrite user draft” safeguard.
src/renderer/src/components/Config/CloudTemplateLibraryModal.tsx Adds tool-filtered cloud template library modal and import flow via main-verified IPC.
src/renderer/src/components/Common/PrivilegeWarningModal.tsx Applies multiline list layout class for global list styling rules.
src/renderer/src/components/Common/Logo.tsx Minor formatting-only adjustment (export line).
src/renderer/src/components/Common/CodeEditor.tsx Switches to minimal monaco runtime and removes TS worker wiring.
src/renderer/src/components/AIToolManagement/AIToolManagementPanel.css Adds layout/status styling for AI tool management panel.
src/renderer/src/App.tsx Adds startup batching, renderer performance marks, and new “AI Tools” main tab panel routing.
src/proxy-server/src/transformers/openrouter.ts Adjusts error-mapping key construction to avoid scanner false positives.
src/proxy-server/src/transformers/deepseek.ts Adjusts error-mapping key construction to avoid scanner false positives.
src/proxy-server/src/server.ts Removes cors middleware from proxy server.
src/proxy-server/package.json Removes cors dependencies in proxy-server package.
src/proxy-server/package-lock.json Removes cors-related packages and updates transitive resolution (e.g., qs).
src/main/window-manager.ts Enables sandbox, blocks window.open, and adds navigation restrictions via isAllowedRendererNavigation.
src/main/utils/window-security.ts Adds fail-closed navigation policy helper (hash-only navigation allowed).
src/main/utils/upstream-http-client.ts Adds native Node HTTP(S) upstream client with timeout/proxy support and bounded body reads.
src/main/utils/path-manager.ts Centralizes Claude workspace path selection via ClaudeWorkspacePathFacade and adds registry/backup paths.
src/main/utils/command-executor.ts Adds security suppression comment tied to bounded parsing + shell:false spawning.
src/main/utils/claude-workspace-path-facade.ts Adds centralized legacy/workspace path selection and direct-child file boundary enforcement.
src/main/task-scheduler.ts Migrates scheduling to node-cron v4 createTask semantics (explicit start).
src/main/services/update-service.ts Migrates update checks to Electron net.fetch and adds parallel registry update check logging.
src/main/services/tool-artifact-codec-service.ts Adds built-in format validators/codecs with JSONC support and bounded parse structure checks.
src/main/services/terminal-management-service.ts Adds security suppression comment for intentional shell usage in controlled MCP init.
src/main/services/statistics-service.ts Adds init gating, safe merge of historical + in-flight events, serialized autosave queue, and idempotent shutdown.
src/main/services/settings-service.ts Adds artifact template override validation + legacy migration behavior during load/merge.
src/main/services/runtime-performance-telemetry.ts Adds passive runtime telemetry aggregation for watchers + config scans.
src/main/services/rule-engine.service.ts Replaces uuid dependency with crypto.randomUUID for rule IDs.
src/main/services/registry-signature-verifier.ts Adds Ed25519 public key parsing and detached signature verification for registry bundles.
src/main/services/project-management-service.ts Adds security suppression comment for spawn usage with controlled args.
src/main/services/performance-snapshot-service.ts Adds on-demand snapshot capture/export with strict renderer timing validation.
src/main/services/managed-mode-log-rotation.service.ts Adds stronger filename filtering + ensurePathWithinBase enforcement for log rotation/listing.
src/main/services/config-service.ts Adds scan performance metrics recording and replaces uuid with crypto.randomUUID in several paths.
src/main/services/claude-code-version-service.ts Migrates npm registry calls from axios to net.fetch with proper headers and timeout.
src/main/services/agents-management-service.ts Hardens agent filename/path construction using safe filename + ensurePathWithinBase.
src/main/ipc-handlers.ts Adds tool registry/template cloud/artifact/config set/performance IPC handler surface.
src/main/index.ts Adds single-instance lock, early Windows AUMID assignment, and safe before-quit cleanup sequencing.
src/main/file-watcher.ts Adds watcher topology sampling into runtime telemetry and improves lifecycle safety around async close.
scripts/start-admin.js Hardens privilege elevation scripts by removing argv passthrough and validating target path characters.
scripts/sign-registry-bundle.cjs Adds offline Ed25519 bundle signing helper producing manifest integrity fields.
scripts/release-preflight.cjs Adds release preflight static checks (versioning, docs, trust map, key leak detection, security tokens).
scripts/lint-changed.cjs Adds incremental lint ratchet gate against base branch (no new ESLint errors in touched files).
requirements-security.txt Pins semgrep CLI for reproducible local security audits.
package.json Bumps to 1.5.0, adds release/lint scripts, updates deps (node-cron v4, smol-toml, https-proxy-agent), and build settings.
.gitignore Adds ignores for local security tooling, keys, coverage, and audit artifacts while keeping key docs tracked.
.github/workflows/release.yml Pins GitHub Actions SHAs, enforces blocking lint + lint:changed, adds npm audit gate, and makes releases draft by default.
Review details

Files not reviewed (1)

  • src/proxy-server/package-lock.json: Generated file
  • Files reviewed: 118/123 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +222 to +228
this.mainWindow.webContents.on('will-navigate', (event, targetUrl) => {
const currentUrl = this.mainWindow?.webContents.getURL() ?? ''
if (!isAllowedRendererNavigation(currentUrl, targetUrl)) {
event.preventDefault()
logger.warn(`阻止 renderer 页面导航: ${targetUrl}`)
}
})
Comment thread scripts/start-admin.js
return process.platform;
}
/** 可执行文件路径白名单:字母数字与路径常规字符(不含引号/$/;等解释器元字符) */
const EXECUTABLE_PATH_PATTERN = /^[\w@+=:,./ \\-]+$/;
@NianLog
NianLog merged commit 6fdb6b1 into main Sep 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants