Repository navigation
[PR] (ai: anthropic/claude-opus-4-6) Settings panel pack editor: guided form (per-field descriptions + base template loading) | (ai: anthropic/claude-opus-4-6) 设置面板 pack 编辑器:引导式表单(逐字段说明+底本载入)+ AI 辅助提示词生成,原始 JSON 降为高级页签 - #5345
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7542-pr.5345.362f4e6This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5345.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 open/closed issue 与近期 PR 全量检索(关键词 pack editor / templates / philosophy / howToCompress / 设置面板)无同题项。本 PR 与 pack 家族在途/已合并工作相邻但各自独立闭环:#5340(CLI 标签:pr, scope/ui, p3(设置面板 UX 引导式表单,功能增强非缺陷;无特定宿主车道) 开始按 PR Review 规范审:原 issue 方向 → 回归清单 → 代码 → 测试有效性 → diff 整洁度。分支 |
…of rebuilding it Review fix for #5345 (#5344): the guided-form save path built a fresh {description?, promptSections:{philosophy?,howToCompress?}} object, so any pack carrying fields beyond those two — toolPrompts (the lean one-liner tool descriptions), nudgeSections, prompts, adapters, version, or the other six promptSections keys — was silently dropped on the first form-tab save. The shipped chat pack itself carries adapters.pi.promptSections, so the PR's own 'load chat as base then tweak' workflow hit this immediately. Form values now merge onto the raw JSON the dialog already carries (edit-load / AI-apply / manual JSON-tab edits): tri-state per covered key (empty = delete), everything else round-trips untouched. An unparseable raw box now refuses the form save with the same bad-JSON error as the JSON tab instead of clobbering it.
Review fix for #5345 (#5344): PackTemplate declared an optional description and the form tab's base-load reads it, but the endpoint never populated it, so 'load base text' left the description field blank for chat/lean. SurfaceResolution now carries the pack-declared description (additive field, identity default pack has none) and the template includes it; test pins chat = shipped text verbatim and default absent.
(ai: vllm-qwen/qwen3.8-27b) PR #5345 独立审核结论:方向正确、实现质量达标;审核发现 2 处缺陷 + 1 条门禁命中,已直接在分支修掉并推送(新 head 审核中做了什么(全部是 PR 分支上的增量 commit,未替换原作者贡献):
结构化八问:
测试有效性: CI 状态:旧 head 两条静态门红均为继承性失败(分账见上第 4 条与 #4599);新 head 判定:可合——待新 head CI 全绿后由 owner 合并。 |
(ai: vllm-qwen/qwen3.8-27b) CI 状态更新(紧接上一条审核结论):新 head 结论不变:审核完成、2 处缺陷 + 1 条门禁命中已在分支修复并钉测试,新 head CI 全绿后即可合并。若 test 矩阵出现红,签名属 #4599 在档继承家族则再 merge 一次 ci-fixes 即可(已在 #4599 留痕)。 |
…cfc2ada) The #5345 review fix (form save merges onto the carried raw JSON instead of rebuilding) shipped no test - the logic sat inline in a DOM click handler, unreachable from node tests. Extract it as pure exported helper mergePackFormIntoRaw (same single-implementation pattern as the #3572 JSONC helpers: TS module + toString() inline into the browser IIFE) and pin: round-trip of uncovered fields, tri-state empty=delete, promptSections creation / malformed-shape replacement, bad-json and non-object refusal. Handler behavior unchanged (same i18n keys, same 2-space PUT body).
(ai: vllm-qwen/qwen3.8-27b) Verification pass for this PR (working #5349) — end-to-end checks plus three fixes landed on the branch: Verified working (live smoke, isolated env, real server on port 0)
Latent defects found during verification — hidden because ci.yml fail-fast tiering skips the test layer while a static gate is red:
Reconciliation notes (concurrent commits on this branch): my initial PackTemplate de-export duplicated 8d4c046 → dropped mine. My initial Local state: targeted suites 21/21 (web-i18n, web-user-packs, web-pack-picker, chat-pack), unused-exports gate clean, docs-sync zero drift (ci-fixes merged), typecheck clean. Awaiting CI on c640c01. |
…, AI-assist prompt, raw JSON kept as Advanced tab Closes #5344 The pack Edit dialog was a bare JSON textarea with no field docs and no samples. Replace the default view with three tabs: 1. Guided form: philosophy + howToCompress fields with plain-language help; one-click base text loaded from the resolvable default/chat/lean packs (new read-only GET /__bili/packs/templates, tri-state-resolved like buildCompressSystemPrompt); empty fields are omitted so runtime falls back to system defaults. 2. AI assist: describe the scenario in one sentence -> generates a ready-to-copy prompt for any LLM constrained to bili-pack.json shape -> paste the returned JSON back -> parsed into the form (extra top-level keys are kept in the JSON tab and saved with the pack). 3. Advanced (JSON): the previous raw-text editing, unchanged. Docs: CONFIGURATION.md / CONFIGURATION.zh-CN.md updated (paired).
c640c01 to
b844b75
Compare
Internal-only type in src/web/api.ts; drop the leading export so the unused-exports CI gate stops flagging PR #5345.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.965-master.79fe3b8 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…18n dead-key gate two live call shapes Both are master-red required-check failures introduced by the guided pack editor (b844b75, ranxianglei#5345); neither is this lane's regression. Reproduced on a pristine upstream/master worktree before touching anything: node --import ./tests/preload-test-env.mjs --import tsx --test tests/web-i18n.test.ts not ok 1 - ranxianglei#1024: catalog parity — every placeholder mismatch for "cfg.q_pack_ai_p1" not ok 4 - ranxianglei#1024: every referenced key exists in both locales and no catalog key is dead catalog key never referenced anywhere: cfg.q_pack_base_blank # pass 8 / # fail 2 1. src/web/i18n.ts: the en value of `cfg.q_pack_ai_p1` lost the `{need}` placeholder that the zh-CN value still has. The test asserts placeholder parity between locales, and client.ts:4273 interpolates it via `t("cfg.q_pack_ai_p1", { need })` — so the English AI-assist prompt was silently rendering with the user's requirement text dropped. 2. tests/web-i18n.test.ts: `collectRefs()` only knew `t("literal")`, `data-i18n="literal"`, `zh("literal")` and `tr(x, "literal")`. The pack editor uses two more forms, and both read as "never referenced": - a `[value, key]` pair table: `[["", "cfg.q_pack_base_blank"], ["default", "cfg.q_pack_base_default"], …].forEach(p => t(p[1]))` in client.ts:4129; - a key passed as an ARGUMENT: `packSectionField("cfg.q_pack_phil", "cfg.q_pack_phil_help", 5)` in client.ts:4168. Rather than enumerate yet more call shapes (which is how this gate fell behind), collect every `cfg.*` literal in the three web sources: `cfg.` is this catalog's namespace, so such a string is always a reference. Verified the gate still fires on both directions: - added `"cfg.zz_dead_probe"` to BOTH catalogs, kept no consumer -> `catalog never referenced anywhere: cfg.zz_dead_probe`, pass 9 / fail 1 - dropped `{need}` from the en value -> `placeholder mismatch for "cfg.q_pack_ai_p1"`, pass 9 / fail 1 - restored both -> pass 10 / fail 0 `npx tsc --noEmit` clean; `gen-config-docs generate` is a fixed point (0 artifact diffs); `check-test-import-graph` exit 0.
…refs (#5345 fallout) Master has been red since #5345 (guided pack editor): every PR's test shards fail both #1024 catalog checks. (a) en cfg.q_pack_ai_p1 lost its {need} placeholder vs zh — restored, text aligned. (b) the base-selector option labels are referenced through a pair array (t(pair[1])), which the literal t("key") scanner cannot see, so all four cfg.q_pack_base_* keys report as dead. collectRefs now also accepts dot-qualified identifiers quoted verbatim in page/client/report sources (catalog keys are namespaced; plain quoted words like "billion-context" lack a dot and are unaffected). tests/web-i18n.test.ts 10/10 locally; unblocks #5196's matrix.
…ption keys visible to the ranxianglei#1024 dead-key guard The guided pack editor (ranxianglei#5345) broke the i18n parity tests on master push CI: 1) en cfg.q_pack_ai_p1 was missing the {need} placeholder its zh twin has (client.ts interpolates t("cfg.q_pack_ai_p1", { need })). 2) Four catalog keys were passed as bare strings through helper parameters (option array / packSectionField), which the ranxianglei#1024 reference scanner (literal t(\"key\") only) cannot see — flagged as dead keys. Labels are now translated at the call sites so every key has a scannable literal reference. Verified locally at origin/master (44fcbe4): tests/web-i18n.test.ts + web-user-packs.test.ts 11/11 (was 9/11); all web/pack/i18n suites 257/257; tsc --noEmit clean.
tests/web-i18n.test.ts (ranxianglei#1024 'every referenced key exists in both locales') scans src/notices.ts for quoted dot-qualified identifiers and treats each as a catalog-key reference (the ranxianglei#5345 verbatim-acceptance design). The new iot-incompat notice probe carried the path literals "package.json" and "config.json" inside that scanned file, so the gate failed deterministically on every platform/shard ('referenced key missing from zh catalog: package.json'; 'config.json' was next in line). Relocated probeDshIotThinking + dshIotThinkingActive to src/dsh-channel.ts, next to the dshProfileDirs/resolveDshHome helpers they exclusively use; behavior is byte-identical, zero logic change. The iot-incompat test now imports them from their new home. Verified locally: web-i18n + iot-incompat-notice + notice-registry suites 21/21 pass; unused-export gate clean; tsc --noEmit clean.
… as catalog keys PR ranxianglei#6015 red CI (shards ubuntu/24/3, ubuntu/22/3, windows/22/4, all the same subtest): ranxianglei#1024 'every referenced key exists in both locales' failed with 'referenced key missing from zh catalog: package.json'. collectRefs()'s lenient bare-string rule (ranxianglei#5345) accepts any dot-quoted token as a live i18n reference; the new notices.ts probe writes the literals "package.json" / "config.json", which the rule misreads as keys. Drop tokens whose final segment is a file extension from that rule only — explicit t()/tr()/data-i18n references stay authoritative, and the two segments already proven to be key suffixes (summary.key, det.log) are kept out of the exclusion.
(ai: anthropic/claude-opus-4-6)
What & Why
#5344:pack 编辑原来是一个裸 JSON textarea——没有字段说明、没有样例,普通用户不知道该填什么。本 PR 把编辑对话框改成三个页签:
philosophy/howToCompress两个字段各带大白话说明与示例;「起稿底本」下拉可一键载入 系统默认 / chat / lean 的现行文案再改;留空字段不写入包文件,运行时自动沿用系统默认。服务端仅新增一个只读端点
GET /__bili/packs/templates(返回 default/chat/lean 三个可解析包的 philosophy/howToCompress 原文;用户/项目覆盖优先,与运行时同一解析链)。创建/读取/删除走既有__bili/packs/user/*端点不变。客户端零依赖(原生 DOM),中英文 i18n 全部补齐,CONFIGURATION.md 与 zh-CN 成对更新。Kernel Boundary (in-repo acp-kernel, #2092)
未触碰 kernel/**:模板文本经 acp-kernel 已导出的
defaultPrompts+resolveCompressSurfaceDetailed(host 侧现有解析链)组装,只读使用。Config surface
无新增配置字段;新增 1 个只读管理端点(沿用 __bili/* 既有 loopback/origin 门控)。
Compression modes reasoning
Proxy 模式与 plugin 模式都不受影响:本 PR 只改设置面板 UI 与一个只读端点,不改任何 wire 注入、prompt 装配或压缩执行路径(templates 端点的 tri-state 解析刻意复刻 buildCompressSystemPrompt 的回落语义,仅为展示底本)。
Tests