easy-cheese-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/easy-cheese-setup

/easy-cheese-setup

Register the durable
cheese-durable
hallouminate corpus (so every project's XDG specs/research are semantically searchable across sessions) and, when asked, register the current repo as a hallouminate tenant. Idempotent and non-destructive: it detects, reports with evidence, asks before mutating, then fixes.
The engine ships as a self-contained bundle at
scripts/easy-cheese-setup.pyz
, with three
--apply
-gated subcommands (default is dry-run / report-only):
python3 <skill>/scripts/easy-cheese-setup.pyz global [--apply]   # durable-corpus registration/repair
python3 <skill>/scripts/easy-cheese-setup.pyz local  [--apply]   # per-repo tenant registration
python3 <skill>/scripts/easy-cheese-setup.pyz doctor [--apply]   # both legs
install.sh
calls
global --apply
once at install time (guarded on hallouminate ∈
--mcp
). This skill drives the interactive path.
注册持久化的
cheese-durable
hallouminate语料库(让每个项目的XDG规格/研究可跨会话进行语义搜索),并在用户要求时将当前仓库注册为hallouminate租户。本工具具有幂等性且无破坏性:它会先检测,附带证据生成报告,在修改前征得用户同意,然后进行修复。
该引擎以独立包形式发布在
scripts/easy-cheese-setup.pyz
,包含三个受
--apply
参数控制的子命令(默认是试运行/仅报告模式):
python3 <skill>/scripts/easy-cheese-setup.pyz global [--apply]   # durable-corpus注册/修复
python3 <skill>/scripts/easy-cheese-setup.pyz local  [--apply]   # 每个仓库租户注册
python3 <skill>/scripts/easy-cheese-setup.pyz doctor [--apply]   # 同时执行两个环节
install.sh
会在安装时调用一次
global --apply
(仅当hallouminate包含在
--mcp
参数中时执行)。本技能负责交互式操作流程。

Flow

流程

Run
doctor
(no
--apply
) first — it reports both legs' intended actions without touching anything. Show the report as evidence, confirm with the user, then apply the legs they approve.
先运行
doctor
(不带
--apply
参数)——它会报告两个环节的预期操作,不会修改任何内容。将报告作为证据展示给用户,获得用户确认后,再执行用户批准的环节。

Global leg — durable corpus

全局环节——持久化语料库

  • Ensures
    paths.corpus_home()
    exists on disk (guards hallouminate's abort-on-missing-path, hallouminate#101), then insert-or-replaces the marked
    # >>> easy-cheese:cheese-durable … # <<<
    [[corpus]]
    block in
    ~/.config/hallouminate/config.toml
    , pointing at
    corpus_home()
    . Replace-in-place keeps it idempotent — a second
    global --apply
    leaves the file byte-identical.
  • Repoints on drift: if the marked block points anywhere other than
    corpus_home()
    ,
    --apply
    corrects it.
  • Legacy migration (interactive only). A pre-existing unmarked
    cheese-global → ~/.cheese
    block is the stale state this work fixes.
    migrate_legacy
    removes it so the durable corpus collapses onto the marked
    cheese-durable
    block. It is deliberately NOT a CLI subcommand and NOT part of
    install.sh
    's path — so the installer can never delete a user's config non-interactively. Invoke it here only after the user confirms the reported legacy block:
    bash
    python3 -c "import sys; sys.path.insert(0, '<skill>/scripts/easy-cheese-setup.pyz'); \
      import hallouminate_setup as h; print(h.migrate_legacy(apply=True))"
    A
    cheese-global
    block pointing anywhere other than
    ~/.cheese
    is left untouched.
  • 确保
    paths.corpus_home()
    对应的路径在磁盘上存在(解决hallouminate中路径缺失时终止运行的问题,hallouminate#101),然后在
    ~/.config/hallouminate/config.toml
    中插入或替换标记为
    # >>> easy-cheese:cheese-durable … # <<<
    [[corpus]]
    块,指向
    corpus_home()
    。原地替换保证了幂等性——再次执行
    global --apply
    不会改变文件内容。
  • 修正偏移问题:如果标记块指向的路径不是
    corpus_home()
    --apply
    参数会将其修正。
  • 旧版迁移(仅交互式操作)。预先存在的未标记
    cheese-global → ~/.cheese
    块是本工具要修复的过时状态。
    migrate_legacy
    会移除该块,使持久化语料库合并到标记的
    cheese-durable
    块中。它特意没有做成CLI子命令,也不属于
    install.sh
    的流程——这样安装程序就不会在非交互式情况下删除用户的配置。仅当用户确认报告中的旧版块后,才在此处调用它:
    bash
    python3 -c "import sys; sys.path.insert(0, '<skill>/scripts/easy-cheese-setup.pyz'); \
      import hallouminate_setup as h; print(h.migrate_legacy(apply=True))"
    如果
    cheese-global
    块指向的路径不是
    ~/.cheese
    ,则不会对其进行修改。

Local leg — repo tenant

本地环节——仓库租户

  • Iff the repo has
    .cheese/
    artifacts and is not already a hallouminate tenant, runs
    hallouminate init-repo <name> --path <main-root>
    .
  • Registers the main repo root, never a worktree — in a Conductor/worktree checkout this avoids stomping the tenant identity onto a throwaway worktree path.
  • 仅当仓库存在
    .cheese/
    artifacts且尚未成为hallouminate租户时,才运行
    hallouminate init-repo <name> --path <main-root>
  • 注册主仓库根目录,而非工作树——在Conductor/工作树检出环境中,这可以避免将租户身份覆盖到临时工作树路径上。

Rules

规则

  • Detect and report before mutating; every mutating leg is
    --apply
    -gated and confirmed.
  • One source of truth for the durable root: the engine imports
    paths.corpus_home()
    — never hardcode
    ~/.cheese
    or an XDG path.
  • Non-destructive by default:
    install.sh
    touches only the marked block; legacy-block removal is interactive-only.
  • 修改前先检测并报告;所有修改环节都受
    --apply
    参数控制,且需获得用户确认。
  • 持久化根目录的唯一数据源:引擎导入
    paths.corpus_home()
    ——绝不硬编码
    ~/.cheese
    或XDG路径。
  • 默认无破坏性:
    install.sh
    仅修改标记块;旧版块的移除仅在交互式操作中进行。