Skip to content

Commit 0ecceee

Browse files
authored
Merge pull request #391 from ranxianglei/2026-09-11_release-v1.17.1
release: v1.17.1 — transform perf (13.6s→1.2ms) + config/CI fixes
2 parents 220bd86 + fa37d04 commit 0ecceee

7 files changed

Lines changed: 86 additions & 115 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ SCHEMA_NOTES.md
4848
repomix-output.xml
4949
results.txt
5050
symbols.txt
51+
52+
# Local scratch (agent temp files) — never commit
53+
tmp/

‎CHANGELOG.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
### v1.17.1 — transform no longer scales with compression history (13.6 s → 1.2 ms) + config/CI fixes
4+
5+
Three fixes bundled — headliner is #385, which removes the long-session slowdown reported in #384:
6+
7+
**1. Transform cost bounded to visible context + active blocks** (#385, fixes #384):
8+
Per-transform work scaled with the **total compression history** instead of the visible context. Candidate planning at 1,000 messages measured **13.6 s** on master; now **~1.2 ms** (acceptance target ≤20 ms met with ~17× headroom; same-harness before/after, `scripts/bench-candidate-planning.ts`).
9+
- **RC1** `resolveBoundaryIds()` rebuilt the global boundary lookup per candidate draft → request-scoped `SearchContext.boundaryLookup` memo, built once per compress call.
10+
- **RC1b** `resolveSelection()` ran the real Anthropic BPE tokenizer per message (~27 ms/KB) → new `estimateAllMessageTokensFast()` (chars/4, the existing estimation convention); exact BPE kept where correctness requires it.
11+
- **RC2** T1 nudge analysis (context composition / protected refs / compressible ranges) ran every transform even when no nudge could fire → gated on `nudgeAllowed || emergencyOverride || tierTriggerPossible`, all consumers null-guarded.
12+
- **RC3** `syncCompressionBlocks()` replayed ALL blocks (active + inactive) and `hideConsumedCompressCalls()` rebuilt immutable consumed-call indexes every transform → transient `structureVersion` bumped at the three block-mutation sites; sync skips full replay when unchanged; hide-consumed caches its derived index by version.
13+
- **RC4** fire-and-forget state saves raced (stale-overwrite possible) → ordered, coalescing per-session save queue (snapshot at enqueue, `setImmediate` drain, batch writes latest snapshot only, FIFO, failure isolation).
14+
- Persisted-state format **unchanged** — all new fields are transient; candidate executor validation, Bug 39 protection semantics, decompression, fork recovery untouched. +20 tests (sync equivalence, cache invalidation, memoization, save coalescing, §5.7 multi-turn growth-cycle).
15+
16+
**2. `qualityGate.algorithms` false "Unknown keys" warning** (#389, fixes #329): per-algorithm params (`qualityGate.algorithms.rouge-recall-v1.*`) are a legal dynamic-key map but the key-allowlist recursed into it — every startup warned on a valid config. Added to the recursion skip list (same convention as `compress.providers` / `messageFilters.filters`). Note: real param names for `rouge-recall-v1` are `layer1MinChars`, `layer1MinRetentionPct`, `layer2MaxRougeF1`, `layer2MaxTop20Recall` — unknown inner keys are silently ignored, so check your params actually take effect.
17+
18+
**3. Fork PR builds green again** (#390, fixes #366): `build-artifact` ran `npm publish` on every PR, but fork PRs can't access `NPM_TOKEN` → ENEEDAUTH killed the whole job. The publish step is now gated to same-repo heads; fork PRs still build, pack, and upload the artifact, and the install comment no longer advertises the npm tag or a base-repo ref that doesn't exist for forks. CI-only — no runtime code.
19+
20+
Files: `lib/compress/search.ts`, `lib/messages/sync.ts`, `lib/messages/utils.ts`, `lib/token-utils.ts`, `lib/state/persistence.ts`, `lib/state/types.ts`, `lib/config-validation.ts`, `scripts/bench-candidate-planning.ts` (new), `.github/workflows/pr-artifact.yml`. Full suite 1209/1209 on the release branch; typecheck + build clean.
21+
22+
**Install**: `opencode plugin opencode-acp@latest --global`
23+
324
### v1.17.0 — context-limit safety net + budget guard: no more silent 400 death loops
425

526
Six fixes bundled, two of them new protection subsystems for sessions whose context window was unknown or exceeded:

‎CHANGELOG.zh-CN.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# 更新日志
22

3+
### v1.17.1 — transform 开销不再随压缩历史增长(13.6 s → 1.2 ms)+ 配置/CI 修复
4+
5+
捆绑三项修复 —— 主打 #385,消除 #384 报告的长会话卡顿:
6+
7+
**1. transform 成本收敛到可见上下文 + 活跃块**(#385,修复 #384):
8+
每次 transform 的工作量随**总压缩历史**而非可见上下文增长。候选规划在 1000 条消息下实测 **13.6 s**,修复后 **~1.2 ms**(验收目标 ≤20 ms,余量 ~17×;同基准前后对比,`scripts/bench-candidate-planning.ts`)。
9+
- **RC1** `resolveBoundaryIds()` 每个候选草稿都重建全局边界索引 → 请求级 `SearchContext.boundaryLookup` 记忆化,每次 compress 调用只建一次。
10+
- **RC1b** `resolveSelection()` 每条消息跑真实 Anthropic BPE 分词器(实测 ~27 ms/KB)→ 新 `estimateAllMessageTokensFast()`(字符/4,既有估算惯例);对正确性有要求的位置保留精确 BPE。
11+
- **RC2** T1 nudge 分析(上下文构成 / 保护引用 / 可压缩范围)在无 nudge 可触发时也每次全量计算 → 改为 `nudgeAllowed || emergencyOverride || tierTriggerPossible` 时才计算,所有消费方空值守卫。
12+
- **RC3** `syncCompressionBlocks()` 每次重放全部块(含失活),`hideConsumedCompressCalls()` 每次重建不变索引 → 瞬态 `structureVersion` 在三处块变更点递增;结构未变时 sync 跳过全量重放;hide-consumed 按版本缓存派生索引。
13+
- **RC4** 发后即忘的状态保存可能竞态(旧快照覆盖新)→ 有序合并的每会话保存队列(入队时快照、`setImmediate` 排空、批内只写最新、FIFO、失败隔离)。
14+
- 持久化格式**不变** —— 新字段全部瞬态;候选执行校验、Bug 39 保护语义、decompression、fork 恢复未动。新增 20 个测试(sync 等价性、缓存失效、记忆化、保存合并、§5.7 多轮增长周期)。
15+
16+
**2. `qualityGate.algorithms` 误报 "Unknown keys"**(#389,修复 #329):按算法名配置参数(`qualityGate.algorithms.rouge-recall-v1.*`)是合法的动态键映射,但键白名单递归进了它 —— 每次启动都对合法配置告警。已加入递归跳过列表(与 `compress.providers` / `messageFilters.filters` 同惯例)。注意:`rouge-recall-v1` 的真实参数名是 `layer1MinChars`、`layer1MinRetentionPct`、`layer2MaxRougeF1`、`layer2MaxTop20Recall` —— 未知内层键会被静默忽略,请检查参数是否真正生效。
17+
18+
**3. fork PR 构建恢复绿色**(#390,修复 #366):`build-artifact` 对每个 PR 都跑 `npm publish`,但 fork PR 拿不到 `NPM_TOKEN` → ENEEDAUTH 干掉整个任务。发布步骤现在仅限同仓库头分支;fork PR 仍会构建、打包、上传构件,安装指引评论也不再对 fork 宣传不存在的 npm 标签和主仓库引用。仅 CI 改动,无运行时代码。
19+
20+
文件:`lib/compress/search.ts`、`lib/messages/sync.ts`、`lib/messages/utils.ts`、`lib/token-utils.ts`、`lib/state/persistence.ts`、`lib/state/types.ts`、`lib/config-validation.ts`、`scripts/bench-candidate-planning.ts`(新增)、`.github/workflows/pr-artifact.yml`。发布分支全量 1209/1209;typecheck + build 干净。
21+
322
### v1.17.0 — 上下文窗口安全网 + 预算守卫:终结静默 400 死循环
423

524
捆绑六项修复,其中两项是针对“窗口未知/超出窗口”会话的新保护子系统:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# REQ — Release v1.17.1
2+
3+
## Goal
4+
5+
Ship the three PRs merged to master on 2026-09-11 as v1.17.1 (patch: fixes + perf only, no new API/config/persistence surface).
6+
7+
## Bundled PRs
8+
9+
| PR | Fixes | Summary |
10+
|---|---|---|
11+
| #385 | #384 | perf: transform work bounded to visible context + active blocks (candidate planning 13.6 s → ~1.2 ms @ 1000 msgs). RC1 request-scoped boundary lookup, RC1b fast token estimate, RC2 gated T1 nudge analysis, RC3 structureVersion incremental sync, RC4 ordered coalescing save queue. Dual-agent reviewed (APPROVE-WITH-NITS, nits addressed). Persisted-state format unchanged. |
12+
| #389 | #329 | fix: `qualityGate.algorithms` added to dynamic-key recursion skip-list — no more false "Unknown keys" warning on valid per-algorithm params. Dual-agent reviewed (both APPROVE, mutation-verified tests). |
13+
| #390 | #366 | fix(ci): fork PRs skip `npm publish` (ENEEDAUTH), keep artifact + upload; comment step `continue-on-error`, fork-aware install repo. Review findings F1–F3 fixed pre-merge. CI-only. |
14+
15+
## Version decision
16+
17+
v1.17.1 — all changes are fixes/perf; no config keys, API, or persistence-format changes (RC3/RC4 fields are transient).
18+
19+
## Acceptance
20+
21+
- [x] package.json → 1.17.1
22+
- [x] CHANGELOG.md + CHANGELOG.zh-CN.md `### v1.17.1` entries
23+
- [ ] check-pr.sh + typecheck + full suite + build on release branch
24+
- [ ] PR created; CI green
25+
- [ ] Human merges → release.yml auto-tags v1.17.1 → npm latest
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# WORKLOG — Release v1.17.1
2+
3+
1. Verified master since v1.17.0: #389 → #390 → #385 (perf) all merged 2026-09-11.
4+
2. Audited #385 (bot-authored): benchmark evidence, dual-agent review noted in PR body, persisted-state compatibility claimed; full suite re-run below confirms.
5+
3. Branched `2026-09-11_release-v1.17.1` from github/master (220bd86).
6+
4. package.json 1.17.0 → 1.17.1.
7+
5. Changelog entries (EN + zh): #385 headline with RC1–RC4 detail, #389 with real rouge-recall-v1 param names, #390 CI-only note.
8+
6. Verification results:
9+
- check-pr.sh: all checks passed
10+
- typecheck: 0 errors
11+
- tests: 1229/1229 pass
12+
- build: OK
13+
7. Commit, push, PR #___ (human merges).
14+
15+
## Hotfix (user-caught): tmp/ leaked into release commit
16+
17+
`git add -A` picked up untracked debug notes `tmp/c348.fixed` / `tmp/c348.raw` (#348 investigation). Branch rewritten before merge: soft-reset to github/master, recommitted clean. Also: `tmp/` added to .gitignore (root cause — no ignore rule existed), `tmp/nested-fork-probe.mts` untracked (earlier master leak via bot's #350 commit), local copies preserved in `~/tmp/`.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "opencode-acp",
4-
"version": "1.17.0",
4+
"version": "1.17.1",
55
"type": "module",
66
"description": "Active Context Pruning — model-driven context management for OpenCode (hardened fork of DCP with 35 bug fixes)",
77
"main": "./dist/index.js",

‎tmp/nested-fork-probe.mts‎

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)