mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-02 13:09:39 +08:00
* fix(desktop): keep cached Library sessions from mkdir empty custom roots Re-resolve the live binding on each request so a missing custom root stays unavailable instead of recreating an empty library. Same-disk restore continues through existing open/status; a rebuilt path remains binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not mint unavailable Library identity from default root Unavailable cached custom sessions are not required to keep the live identity. Restore still uses the original disk object; a replaced directory stays binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): add owner-scoped Library staging adapter Host H1 is a thin LibraryVault adapter for plugin upload staging. It keeps owner×ghost isolation, hard quota, tombstones, and ACK-gated release without a second media library, new UI, or TCC path. Quota counts durable, orphan blobs, closed tmp, and in-memory uploads without overlap. abort of a commitPending blob is STREAM_INVALID so the landed original stays reserved until ACK. disposeAll/bind/unbind/relocate/delete drain in-flight release behind relocating. First-minted staging roots also fsync parent directory entries; Windows still reports fsynced:false. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): recover staging commit from retained manifest and intent Same-instance retry after a durable manifest write plus failed journal fsync no longer dies on ifNotExists ALREADY_EXISTS. Matching identity is adopted; conflicting identity is rejected without overwrite. New originals write intent.json before blob rename. A new Store recovers only from that trusted identity after hash/bytes checks, then installs manifest+dirsync. Incomplete or conflicting intent fails closed and keeps the source. Historical orphans without intent stay billed in isolation and are not TTL-deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): fail closed when a custom Library parent vanishes A stale custom resolveLibraryRoot could still reach vault.open, which recursively created the missing user parent and reported ready empty. Custom open now refuses to recreate a vanished parent (disk-missing); default first-time create still mkdir. keep files remain in the renamed directory and are not treated as deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): reject replaced custom parents and revoke extraDir on drift Stale resolve plus a same-path new inode is binding-moved at the mkdir boundary. disk-missing after a granted extraDir actually revokes the slot. Auto-open failures latch drift so status-only restore works. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not recursive-mkdir custom Library parent after inspect Custom skeleton mkdir is non-recursive so a vanished user parent cannot be rebuilt as an empty library. Default roots still create recursively. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): bind custom Library mkdir to held parent identity After the last successful inspect, hold the parent directory and compare path identity after mkdir(root). A same-path new inode fails closed as binding-moved; an empty root created on the replacement is rolled back and keep files stay parked. Node has no mkdirat; this is not atomic. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): create custom Library trees via held parent fd Darwin mkdirat/openat (SYS_mkdirat=475) and Linux /proc/self/fd keep ghostId/meta on the granted parent object. Missing helper fail-closed before mutation; no path mkdir fallback. Windows custom init unsupported. Default roots still mkdir recursively. Keep files stay parked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): skip custom first-open path usage persist and sweep After the held parent fd is closed, custom open does not write, rename, or unlink under this.root. Sweep unlink and persistUsage are skipped; read-only usage scan remains. Default roots unchanged. Later library writes still persist. Isolated D: no replacement usage.json. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): existing custom open, session teardown, usage ledger Open an already-initialized custom library from the held parent fd without mkdir. Missing structure on platforms without create stays fail-closed. Teardown only the captured session. Reuse a valid usage ledger; scan only when it is missing or corrupt. Custom tmp is not path-unlinked. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): Windows existing custom open via FILE_OPEN ReadFile Existing libraries open from the inherited parent handle with NtCreateFile FILE_OPEN+ReadFile. FileIndex 0 and missing helpers fail closed. Create stays unsupported on Windows. Linux may unlink only uuid.tmp/.stream staging leftovers via /proc/self/fd. No path mkdir fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): parse existing-open helper JSON as complete values Pretty-printed and compact meta/usage payloads both parse. Malformed JSON or failed field checks stay CORRUPT. Do not split on the first newline of the helper stdout. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): do not delete custom Library uuid tmp/stream on open Age and an empty streams map cannot prove a fsynced .tmp/.stream is garbage after a crash before rename. Open no longer unlinks them. P2_tmp stays unresolved. Unknown names are kept. Signed-off-by: PraiseZhu <zhuzan@xd.com> * feat(desktop): Windows custom Library first-create via NtCreateFile Create dirs with FILE_OPEN_IF and meta.json with FILE_CREATE from the inherited parent handle. No path mkdir, no rollback rmdir, no new native dependency. Existing FILE_OPEN stays read-only. Missing helper still fails closed before mutation. Signed-off-by: PraiseZhu <zhuzan@xd.com> * test(maker-core): time durable Subagent system-deny waitFor Record list/resolver/control monotonic marks and dump them on waitFor failure so Linux CI can discriminate missed 500ms poll vs unpublished system-deny. Keep the original assertion and timeout. Mac is syntax sanity only. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): distinguish Windows meta exists from reparse collision FILE_CREATE collision is exists only after FILE_OPEN of a regular file. Reparse and unknown collisions fail closed. CreateRelative always releases handles it still owns, including the catch path. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): sweep idle staging uploads and count concurrent disk reserve Idle incomplete uploads now yield BUSY/QUOTA slots after timeout. Concurrent begin reservations are checked against reserveBytes. Durables and commitPending originals are never TTL-deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): count idle tmp residue and unwritten disk reserve Refresh closed tmp bytes after idle abort before quota admission. Disk reserve subtracts only unwritten stream remainder; commitPending does not double-count landed blobs. Durables stay off TTL. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): recover staging durables across owner generation Restart resets app-session generation so live ownerScopeKey (local🆔2 vs local🆔0) no longer matches the on-disk manifest. Treat generation as a process lease, not durable owner identity. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): fail closed on custom ghost loss and staging.release races Greptile P1: vanished custom ghost dirs must not rebuild an empty library on a live vault; staging.release re-hashes the unique original and blocks concurrent library mutates until the staging original is gone. P2: disposeAll now invalidates staging stores, uploads, and vaults. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): persist custom libraryReady so vanished ghost dirs stay fail-closed Binding records first-create vs already-built trees without bumping generation. Restart after `<parent>/<ghostId>` disappears now returns disk-missing instead of initializing an empty replacement library. Signed-off-by: PraiseZhu <zhuzan@xd.com> * fix(desktop): serialize Library mutates with staging.release Greptile P1 r4058467558 needs a real per-ghost mutex, not only a second hash. Mutating Library ops and staging.release now share one chain so hash-then-delete cannot overlap write/delete/rename. Relocating releases still fail closed without taking the lock. Signed-off-by: PraiseZhu <zhuzan@xd.com> --------- Signed-off-by: PraiseZhu <zhuzan@xd.com>
Docs 规范索引
本索引用于发现 docs/ 下仍保留的产品规则、设计规则、开发规则、运维与合规文档。
状态含义:authoritative = 权威、对治理模块有约束力;参考 = 设计 / 记录 / spike,非约束、仅供背景参考(不区分是否完成,要看正文)。
| 文档 | 类型 | 状态 | 治理/相关代码 | owner |
|---|---|---|---|---|
| README.md | 索引 | — | docs/ 文档目录 |
— |
| product-rules/README.md | 产品规则索引 | authoritative | Cindy 产品行为、体验与边界 | — |
| core-product-principles.md | 产品原则 | authoritative | Cindy Core、Agent、Skill、插件与多端产品边界 | — |
| design-rules/README.md | 设计规则索引 | authoritative | Cindy UI 视觉、交互与内容设计 | — |
| design-rules/DESIGN.md | 设计规范 | authoritative | Desktop 与 Mobile 的视觉语言、Token、组件和交互约定 | — |
| dev-rules/README.md | 开发规则索引 | authoritative | Cindy 客户端工程规则 | — |
| environment-setup.md | 开发环境 | authoritative | 公共依赖、submodule 与首次安装 | — |
| model-catalog-maintenance.md | 模型配置与下发入口 | authoritative | 架构、配置层级、修改位置、代码导航与发布验收 | — |
| model-metadata-precedence.md | 模型资料合同 | authoritative | 继承、用户覆盖、多账号与成员语义 | — |
| local-model-selection.md | 本地模型规则 | authoritative | 包装、硬件、候选和推荐 | — |
| model-registry-v4-media.md | 媒体模型合同 | authoritative | 全类型资料与发布兼容条件 | — |
| model-catalog-runtime.md | 模型运行细则 | authoritative | 窗口、压缩、原生缓存与显示 | — |
| model-catalog.md | 模型配置示例 | 参考 | 可校验的最小配置和维护场景 | — |
| model-catalog-history.md | 模型历史记录 | 参考 | 旧型号取舍与迁移记录,不代表当前发布状态 | — |
| desktop-development.md | Desktop 开发规则 | authoritative | Desktop 启动、重启与验证 | — |
| electron-security-and-process-boundaries.md | Electron 安全规则 | authoritative | Renderer、preload、BrowserWindow、WebView、IPC、CSP 与进程边界 | — |
| credentials-and-local-storage.md | 本地数据安全规则 | authoritative | 凭证、用户持久数据、临时文件与测试目录 | — |
| media-storage-and-protocols.md | 媒体存储规则 | authoritative | Desktop 媒体入库、协议、引用与回收 | — |
| database-and-migrations.md | 数据库规则 | authoritative | Desktop SQLite schema、migration、companion 与运行期访问 | — |
| mobile-development.md | Mobile 开发规则 | authoritative | Mobile 模拟器、验证与专项入口 | — |
| orca-team-architecture.md | 契约/规范 | authoritative | apps/desktop 的 maker-ipc/orca* 服务 + mcp-integrations codex MCP、packages/lizi-mcps 的 orca、packages/orca-workflow、packages/maker-core 的 codex MCP context |
— |
| maker-core-and-agent-behavior.md | maker-core 规则 | authoritative | packages/maker-core 的 Agent 编排、prompt 组装、translator、model 映射、缓存率/性能/准确性指标与 system prompt 门禁 |
— |
| plugin-security-and-authoring.md | 插件安全规则 | authoritative | 插件(.cindy)运行时沙箱、直接能力声明、网络/凭证/资源交接、存量插件向下兼容与无感升级、作者契约与编写手册同步 |
— |
| cindy-updater.md | 更新器规则 | authoritative | 客户端自动更新链路(cindy-updater + Electron 更新服务)的 owner 确认门禁 |
— |
| engineering-conventions.md | 通用工程规范 | authoritative | Desktop 日志、IPC 错误协议、main 侧测试、跨平台双端兼容与 UI 文案 i18n | — |
| log-upload-and-redaction.md | 日志上报规则 | authoritative | 客户端日志采集/脱敏/上报:记录边界不变量、来源白名单方向、标记代次与原子清除、区域绑定与崩溃时序 | — |
| protocol-compatibility.md | 跨端协议规则 | authoritative | 两仓本地协议包、device-link relay 层与 wire protocol 兼容 | — |
| architecture-invariants.md | 架构不变量 | authoritative | package 解耦、main 静态依赖、主界面布局树(layoutTree/LayoutStore/panel registry) |
— |
| configuration-and-overrides.md | 配置契约 | authoritative | 配置可见性分层、默认值+override 分离、迁移与恢复默认语义 | — |
| remote-and-mobile-adaptation.md | 远程/手机版门禁 | authoritative | SSH 远程工作区、device-link allowlist、apps/mobile 入口与功能类 PR 三选一门禁 |
— |
| development-workflow.md | 开发工作流 | authoritative | worktree dogfooding 契约、提 PR/直推 main 门禁、Review P0/P1/P2 口径 | — |
| plugin-setup-runtime.md | 技术设计 | 参考 | ghost_list / ghost_info / ghost_call 插件配置前置检查、Ask-shell Setup 卡片、配置变更回调与原调用恢复 |
— |
| remote-plugin-oauth.md | 客户端契约 | 参考 | 远程设备插件 OAuth 事务、Desktop 回调桥、任务授权指引及兼容边界 | — |
| desktop-login-hosted-callback.md | 跨仓契约 | 参考 | Desktop 系统浏览器登录的托管回调链路:auth-server 路由契约、结果页模板交付、灰度开关与回滚 | — |
| auth-realm-routing.md | 跨仓契约 | 参考 | 组织 SSO 双区域发现、会话区域持久化与 token 消费端点路由 | — |
| client-log-upload-requirements.md | 需求文档 | 参考 | Desktop 客户端日志上报(手动 + 崩溃自动)的目标、数据边界、同意闸与可靠性要求 | — |
| client-log-upload-implementation-plan.md | 实现方案 | 参考 | 上述需求的落地方案:模块布局、四层收窄管道、定位读取与锚点裁剪、标记代次、分期 | — |
| legal/README.md | 法律/合规索引 | authoritative | 法律合规资料归档边界与固定路径例外 | — |
| legal/notices/README.md | 第三方许可/SBOM | generated | pnpm licenses:generate、Desktop/Mobile 随包声明 |
— |