From 7e8b9e6220f990fd8019e07b54fb5f38d34b1e65 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Mon, 12 Oct 2026 16:19:26 +0800 Subject: [PATCH] Update docs and skills for new directory layout --- SECURITY.md | 4 ++-- scripts/generate-linter-plaintext.mjs | 2 +- skills/seal-use/SKILL.md | 2 +- skills/seal-use/references/cli.md | 4 ++-- skills/seal-use/references/rule-lint.md | 6 +++--- src/core/stats/usage-tracker.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index e146a9e..a82a358 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,10 +17,10 @@ initial response within a few business days — this is a small project, not a s | Path | Contents | Mode | | --- | --- | --- | -| `~/.config/seal-use/seal_tokens.json` | Session tokens and derived keys | `0600` | +| `~/.config/seal-use/tokens.json` | Session tokens and derived keys | `0600` | | `~/.config/seal-use/enterprises/*.json` | Per-enterprise Hose app key/password or Seal bearer token | `0600` | | `enterprises/*.json` (working tree) | Same, for enterprises added from a checkout | `0600` | -| `~/.config/seal-use/usage.json` | Per-enterprise command counts | `0600` | +| `~/.cache/seal-use/usage.json` | Per-enterprise command counts | `0600` | The tool writes these `0600`; a config placed by hand can keep the `0o644` default, so `seal-use doctor` reports any credential file whose mode is wider than `0600`. Real enterprise diff --git a/scripts/generate-linter-plaintext.mjs b/scripts/generate-linter-plaintext.mjs index 96ad32b..3b67a29 100644 --- a/scripts/generate-linter-plaintext.mjs +++ b/scripts/generate-linter-plaintext.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env bun // 生成 src/domains/seal/linter/plaintext.generated.ts: // 把 manifest 中 plaintext: true 的官方校验器源码嵌入为字符串, -// 供 syncOfficialLinters 写入 ~/.config/seal-use/linters/official/。 +// 供 syncOfficialLinters 写入 ~/.cache/seal-use/linters/official/。 // 修改 checkers/ 下任一源码后运行 `bun run generate:linter-plaintext` 刷新。 import { readFileSync, writeFileSync } from "node:fs"; import { join } from "node:path"; diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index b7376b0..263c1bf 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -157,7 +157,7 @@ seal-use report review set --month --sn --verdict --corp ``` -- **存储**:`~/.config/seal-use/reviews/-.jsonl`,追加式一行一条,可直接手改/`tail`;同 SN 改判以后写为准。 +- **存储**:`~/.config/seal-use/state/reviews/-.jsonl`,追加式一行一条,可直接手改/`tail`;同 SN 改判以后写为准。 - **语义**:`ai_correct`=AI 对人工错,`human_correct`=人工对 AI 错,`both_correct`=双方都对,`both_wrong`=双方都错,`undecided`=已看暂无法判。 - **自动接入**:`report monthly` 载入该租户该月裁决,SN 匹配上真实审批块后,人工准确率 = 判为"人工对"数 / 已裁决总数;`notes.humanAccuracyAvailable` 标记是否可得,`reviewedCount`/`divergedCount` 说明覆盖度。无裁决则保持 ⚠️ 数据说明,不编造。 - `review set` 是本地写(非只读),`review list` 是只读;两者都进 help 注册表与读写白名单。 diff --git a/skills/seal-use/references/cli.md b/skills/seal-use/references/cli.md index 9b637d5..d1b0586 100644 --- a/skills/seal-use/references/cli.md +++ b/skills/seal-use/references/cli.md @@ -265,7 +265,7 @@ Test Enterprise Binding, Staging Synchronization & Automated Regression Testing: - In the **Production Enterprise**: Rules remain strictly in **draft state** without publishing any live version. - In the **Test Enterprise**: Style preferences (`decisionPreferences`, `thinkingDepthPreference`) are updated to match production, test draft rules are cleared and populated with production draft rules, recoded, and immediately **published as a new official version** in the test tenant (`--version-name `). - **Semantic Version Naming**: Defaults to `Sync from [Prod v · #]` tracking production baseline version and test draft iteration without redundant date strings. - - **Rule Mapping & Local Snapshot**: Returns `versionMapping` and `ruleMapping` in CLI stdout and saves persistent snapshot to `~/.config/seal-use/mappings/-v.json` and `-latest.json`. + - **Rule Mapping & Local Snapshot**: Returns `versionMapping` and `ruleMapping` in CLI stdout and saves persistent snapshot to `~/.config/seal-use/state/mappings/-v.json` and `-latest.json`. - `--dry-run` previews the full preference diff, version mapping plan, and rule sync plan without sending mutations. Execution requires `--yes`. - **Approval Run Replay to Test Enterprise (`corps replay-test`)**: - Automatically identifies the bound test enterprise for `` (or current corp). @@ -299,7 +299,7 @@ Approval rule maintenance: - `seal-use rules version [--corp ]` - `seal-use rules diff [--code ] [--include-unchanged] [--full] [--corp ]` (returns structured changes plus a Git-style `unifiedDiff`; oversized output is truncated only when it exceeds the safety limit) - `seal-use rules lint [--file ] [--linter ] [--version ] [--code ] [--min-score ] [--level all|error|warning] [--summary] [--corp ]` -- `seal-use rules linters [--corp ]` (lists official and custom linters with directory specs: `~/.config/seal-use/linters` and `official/`) +- `seal-use rules linters [--corp ]` (lists official and custom linters with directory specs: custom in `~/.config/seal-use/linters` and official in `~/.cache/seal-use/linters/official`) - `seal-use rules pull [--version ] [--out ] [--corp ]` - `seal-use rules push [--file ] [--publish] [--version-name ] [--dry-run|--yes] [--corp ]` incrementally applies the local file: matched IDs are updated, missing local IDs are created, and remote IDs absent from the file are deleted. It does not clear/recreate the whole draft or recode it. Run `--dry-run` first; a local file exported with `rules pull` is preferred. - `seal-use rules clear [--dry-run|--yes] [--corp ]` diff --git a/skills/seal-use/references/rule-lint.md b/skills/seal-use/references/rule-lint.md index 782a111..cadf08d 100644 --- a/skills/seal-use/references/rule-lint.md +++ b/skills/seal-use/references/rule-lint.md @@ -58,8 +58,8 @@ seal-use config lint disable | 层 | 位置 | 说明 | | :--- | :--- | :--- | | 内置引擎 | 编译进二进制 | 永远可用,`builtin` 即此层 | -| 官方明文版 | `~/.config/seal-use/linters/official/` | `syncOfficialLinters` 自动同步,改动会被覆盖;agent 可直接阅读源码理解校验逻辑 | -| 用户自定义 | `~/.config/seal-use/linters/.ts`(全局唯一位置) | 私有脚本,跨项目共用;不再从项目 cwd 读取 | +| 官方明文版 | `~/.cache/seal-use/linters/official/` | `syncOfficialLinters` 自动同步,改动会被覆盖;agent 可直接阅读源码理解校验逻辑 | +| 用户自定义 | `~/.config/seal-use/linters/.ts`(全局唯一位置) | 私有脚本,跨项目共用;保留在 ~/.config 防止随缓存清理误删 | 哪些官方校验器明文下发由 `src/domains/seal/linter/manifest.ts` 的 `plaintext` 标记决定:`true` 的条目源码会被写入 `official/`(源码嵌入物 `plaintext.generated.ts` 由 `bun run generate:linter-plaintext` 从 `linter/checkers/` 生成,改动校验器后必须重跑并提交,CI 的 `verify:linter-plaintext` 会拦截漂移);`false` 的条目只以进程内函数存在、不下发明文。 @@ -103,7 +103,7 @@ seal-use rules lint --linter hlab --file ./rules.local.json ## Custom TS Linters (Plugin-as-Code) -Place custom TypeScript linter functions in `~/.config/seal-use/linters/.ts` or `./linters/.ts`: +Place custom TypeScript linter functions in `~/.config/seal-use/linters/.ts`: ```typescript // ~/.config/seal-use/linters/finance-strict.ts diff --git a/src/core/stats/usage-tracker.ts b/src/core/stats/usage-tracker.ts index c904b0b..b9aa2cf 100644 --- a/src/core/stats/usage-tracker.ts +++ b/src/core/stats/usage-tracker.ts @@ -67,7 +67,7 @@ function saveUsageStatsAtomic(stats: CorpUsageStats, targetPath: string = resolv } const tempPath = `${targetPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2, 8)}.tmp`; try { - // 0o600 like `sealTokens.json`: usage rows name the enterprises this machine has been + // 0o600 like `tokens.json`: usage rows name the enterprises this machine has been // operating, so keep them owner-only instead of inheriting the 0o644 default. writeFileSync(tempPath, JSON.stringify(stats, null, 2), { encoding: "utf-8", mode: 0o600 }); renameSync(tempPath, targetPath);