Skip to content

refactor(components): remove offloaders that delete by heuristic - #474

Open
OsherElhadad wants to merge 12 commits into
mainfrom
feat/remove-heuristic-deletion
Open

OsherElhadad wants to merge 12 commits into
mainfrom
feat/remove-heuristic-deletion

Conversation

@OsherElhadad

@OsherElhadad OsherElhadad commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Behavior change: needs a human yes. The owner said yes to this change on 2026-11-26.

  • Who it affects: any config that names a removed component, or an obsolete preset that used one. The obsolete presets are balanced, aggressive, coding, mcp, agent, general, codesmart and codesafe. The agentdiet preset is also affected.
  • Old behavior: these configs ran the removed components.
  • New behavior: the config loads. The proxy logs a warning and runs without the removed names. The agentdiet preset runs no components. The proxy does not stop.
  • How to keep the old behavior: pin an older release.
  • Not affected: the six current presets (off, conservative, medium, high, xhigh, ultrahigh) and house. None of them names a removed component.

Part of #471.

Summary

This PR removes 9 components that delete content by a heuristic. The heuristic is age, size, run order or a guess about the future. A component may now remove only content that is provably redundant, or content it parks behind an expand handle.

Removed: failed_run, collapse, mask, linecap, smartcrush, readlifecycle, coref, agentdiet, skeleton. The tree-sitter dependency goes with skeleton. internal/coref stays, because extract_llm_sweep passes its index to the model.

Kept: format, textclean, searchfold, toon, dedup, extract, cmdfilter, extract_llm, extract_llm_sweep, summarize, cache_aware_summarizer, cachesplit, cacheinject, toolschema, toolfilter.

The evidence is in the private research notes.

What changed

  • Code: the 9 components, their tests, their stats fields and their config forms are gone.
  • Presets: the 8 obsolete presets lose the removed names. The agentdiet preset is removed.
  • Old configs: config.LoadBytes and Config.Build drop a removed name and log a warning. PresetPipeline("agentdiet") returns an empty pipeline. Test: TestRemovedComponentsAreIgnoredNotFatal. TestEveryPresetBuilds fails if a preset names a removed or unregistered component.
  • Data dependence: 9 rows are deleted under docs/data-dependence/components/. The counts in page.md.tmpl change from 24 to 15 components. The page is regenerated with go run ./cmd/gen-datadep. No kept component changes its data dependence.
  • Docs and plugin: docs, nav, the plugin component list and the benchmark sweep arms no longer name the removed components. The text says 14 obsolete presets, not 15.
  • go.mod: only go-tree-sitter, go-sitter-forest/* and go-pointer are removed. No pin is added.
  • Merge with main (this update): 24 conflicts.
    • Main's newer code is kept where it does not use a removed component (proxy.go, tenant.go, go.mod, the sweep and commit-gate tests).
    • The sweep and commit-gate tests that PR refactor(components): remove offloaders that delete by heuristic #474 had changed are taken from main. Main rewrote the sweep (sweep v3). Only the agentdiet and mask tests are removed from them.
    • The cg-transcript-replay tests and the marker-cap tests now use extract. The cache-break test uses a small test-only component.

How it was tested

Run on macOS, Go 1.27.4, with GOFLAGS=-p=2. No -race on proxy or dash.

  • go build ./... and go vet ./... pass.
  • go test passes for ./config, ./components/..., ./proxy/..., ./dash/..., ./tenant/..., ./apply/..., ./proxyapp/... and ./cmd/....
  • The plugin tests that cover insights.py and the docs pass (-run 'Insight|Preset|Component|Docs').
  • Two tests fail the same way on unchanged origin/main:
    • TestCGScriptsAreVendoredIntoCodex: cg.py differs between the two plugin folders on main.
    • TestBobReleasePythonSuite runs past the 9-minute limit. The Bob suite is on hold.
  • mkdocs build was not run: mkdocs is not installed on this machine.

Local tests: waived (owner rule)

Open questions

Osher-Elhadad added 2 commits October 12, 2026 00:20
A component may now remove only content that is provably redundant
(duplicates, superseded copies, formatting, boilerplate) or that it parks
behind an expand handle chosen from the content itself. The following
deleted by age, size, run order or prediction and are removed:
failed_run, collapse, mask, linecap, smartcrush, readlifecycle, coref,
agentdiet and skeleton (with the tree-sitter dependency).

Presets, docs, the plugin component list, stats fields and benchmark
arms no longer name them. A stored config that still does loads, logs a
warning and runs without the component (the agentdiet preset likewise),
so an old document cannot stop the proxy at boot.

Refs #471

Signed-off-by: Osher-Elhadad <[email protected]>
@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

CI is green. Task-success check: the default house pipeline is byte-identical before and after this change (replay of 2,123 requests), so the existing real-agent SWE-bench results for house apply unchanged. A paired run of the cleaned general preset against the same task list is queued with the benchmark owner and will be reported on #471.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Review of 20057e6 + c6b6242. Verified in a fresh worktree: go build, go vet clean; go test ./... passes except dash (SQLITE_BUSY, load-dependent) and one proxy test (database is locked); both fail the same way on origin/main under the current host load (load avg ~40), neither touches code this PR changes. TestRemovedComponentsAreIgnoredNotFatal and TestEveryPresetBuilds pass.

Blocking

  1. The PR description publishes per-component experiment results (retained-% table with unit counts, per-preset token-share changes, "pre-declared bound", replay sizes). This repo is public and the mission rule is that method and measured numbers about features go to the private research repo. Replace the Evidence section with a one-line pointer ("evidence is in the private research notes") and keep only the compatibility and test statements. The commit messages are fine.

Non-blocking
2. Stale references to removed components remain in non-test code comments: components/offload/common.go:45,56,219 (collapse.max_tokens, mask, smartcrush), components/dsl/dsl.go:286 (linecap), components/offload/cmdfilter_agentcmd.go:40 (skeleton.go), components/offload/extract_llm.go:942 ("unlike mask/failed_run"), components/component.go:39 ("code skeleton"). Reword or drop in this PR since it is the cleanup PR.
3. The /compact override path (cmd/context-guru-proxy/main.go:598) now answers ?preset=agentdiet with "unknown preset" (error) while a stored config with preset: agentdiet loads. Acceptable, but say so in the PR text, or have PresetPipeline return an empty pipeline for it.
4. Pipeline-name handling is correct on every path I traced (LoadBytes, Build for struct callers, Validate which goes through LoadBytes, applyPreset). Note Validate therefore accepts a removed name silently at settings-save time; the warning only shows in the log. Fine for compatibility; consider rejecting it for new saves later.

Safety: house pipeline unchanged; no defaults changed; go.mod drops the tree-sitter deps only. Privacy: nothing found in the diff. Attribution: no AI/Co-Authored-By lines in the two commits. Not labelled ready-to-merge until item 1 is fixed.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Re-review of 03b92fe: blocker 1 is resolved (the PR body carries no measurements). Item 3 is fixed and covered by TestRemovedPresetResolvesToEmptyPipeline. Build and vet are clean; config, cmd and components tests pass. The one failure, TestExtractLLMDoesNotBookASingleFlightFollowersSaving, is a flake that fails the same way on origin/main (29 of 40 runs on main, 31 of 40 here) and is unrelated.

Remaining nit, not blocking: comments in components/offload/state.go (lines 59, 258, 287, 378, 429) and config/form.go (65, 509) still name mask, failed_run and linecap. Historical wording, fine to leave or tidy later.

Approving; labelled ready-to-merge.

Osher-Elhadad added 2 commits October 14, 2026 06:48
Signed-off-by: Osher-Elhadad <[email protected]>

# Conflicts:
#	context-guru-plugin/skills/insights-components/SKILL.md

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: APPROVE at f0a0237. (Posted as a comment: GitHub does not let the author account approve.)

  • Merge 83be4b8. Its only conflict was context-guru-plugin/skills/insights-components/SKILL.md, and it was resolved to main's version: the file has no diff against main and names none of the removed components.
  • Removed components. failed_run, collapse, mask, linecap, smartcrush, readlifecycle, coref, agentdiet and skeleton are no longer referenced by any preset, shipped config, plugin script or doc except in historical notes. A stored config that still names one keeps loading: dropRemoved drops it with a warning, and preset: agentdiet warns and runs the pipeline as written.
  • Fixtures. f0a0237 drives the thread-cache fixtures with extract, and the test still fails if extract acts on nothing ("the comparison proves little"), so the fixtures still test something.
  • Checks. gofmt and go vet ./... are clean. go test passes for ./config, ./components/..., ./apply, ./context-guru-plugin, ./proxy and ./dash. CI is green. All new commits, including the merge, are signed off with no AI attribution. It merges cleanly with #475 and #500.

Non-blocking:

  • The removed TestKeptVerbatimNotRecompacted was the only end-to-end pipeline test of the kept-verbatim guarantee, and it drove mask. The shared skipReduce path still enforces it, but porting the test to extract would keep it pinned.
  • Some deploy/harbor/cfg-iter02*.yaml experiment configs still list collapse and coref. They load with a warning; delete or annotate them as historical.

Signed-off-by: Osher-Elhadad <[email protected]>

# Conflicts:
#	components/offload/skeleton_measure_test.go
#	components/offload/testdata/read_lifecycle.json
#	docs/components/offload-reducers.md
#	docs/components/skeleton.md

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review: APPROVE at 4e22725 (main merged; last approved f0a0237).

  • Conflicts. git show --remerge-diff 4e22725c shows four, all on files this PR deletes:
    • skeleton_measure_test.go, testdata/read_lifecycle.json and docs/components/skeleton.md were modify/delete conflicts. Main's only edits to them were path placeholders from #529, so dropping those edits is correct.
    • In docs/components/offload-reducers.md, the resolution keeps the intro and the dedup/extract sections. It removes only the blocks for removed components: failed_run, linecap, smartcrush, mask, collapse and read_lifecycle.
    • Nothing else from main is lost.
  • Leftovers. No build-time or config reference to the removed components remains. What does remain is historical comments, a CI comment about the old preset breakage, internal/coref (still used by extract_llm_sweep), and test stubs that use the names only as strings. mkdocs build --strict passes.
  • Tests. On a local merge with today's main, gofmt and go vet ./... are clean. ./config, ./components/..., ./apply, ./context-guru-plugin, ./proxy and ./dash all pass. CI is green, and the merge commit is signed off.

The earlier non-blocking note (port the end-to-end "kept verbatim" test to extract) still stands. This approval covers 4e22725.

Resolve the conflicts with main and bring the PR up to date.

- Take main's code where it does not depend on a removed component
  (proxy.go, tenant.go, go.mod, the sweep and commit-gate tests).
- Keep the removal of failed_run, collapse, mask, linecap, smartcrush,
  readlifecycle, coref, agentdiet and skeleton, and of their tests.
- Move the cg-transcript-replay tests and the marker-cap tests off the
  removed components.
- Drop the removed components' data-dependence rows. Fix the counts in
  the page template and regenerate the page.
- Say 14 obsolete presets (agentdiet is gone), and keep obsolete presets
  loading without the removed components.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 7dfca4131039 blocking

Verdict: blocking

Findings

  1. deploy/harbor/replay2.py:31 — the sweep still runs arms for removed components.

    • What fails: a replay2.py run writes pipeline: [failed_run] (and mask, collapse, smartcrush, skeleton) per arm (replay2.py:92). After this PR, dropRemoved drops the name and the proxy runs an empty pipeline. The arm is labeled failed_run but measures off. The benchmark numbers are silently wrong.
    • Proof: replay2.py:31-32 lists the five removed names in DET_CONFIGS; config/config.go:506 (dropRemoved) removes them with only a log warning. The PR edited the sibling deploy/harbor/replay.py the same way but missed this file. The PR body claims "the benchmark sweep arms no longer name the removed components".
    • Fix: remove failed_run, mask, collapse, smartcrush and skeleton from DET_CONFIGS in replay2.py, as done in replay.py.
  2. docs/data-dependence/page.md.tmpl:36 — a lost newline merges two bullets in the Terms section.

    • What fails: the Metadata bullet now renders inside the Content bullet: output are content too.- **Metadata**: values that do not let you read the content back.... The Terms section loses the Metadata definition as its own bullet.
    • Proof: page.md.tmpl:36 and the generated docs/data-dependence.md:36 both carry content too.- **Metadata**:. The base (7a02270f) had a newline between content too. and - **Metadata**:. The PR's edit of the template removed it, and the generated page carries it too.
    • Fix: restore the newline in page.md.tmpl and run go run ./cmd/gen-datadep again.
  3. examples/llm-d-service/build.sh:5 — the example still requires a C toolchain for the removed skeleton component.

    • What fails: build.sh sets CGO_ENABLED=1 and its comment says the skeleton component links tree-sitter via cgo. README.md:75 tells the user a C toolchain is required. Both claims are false after this PR. A user installs a C toolchain for no reason.
    • Proof: examples/llm-d-service/build.sh:4-13, examples/llm-d-service/README.md:75. The PR fixed the same claim in docs/setup.md, .goreleaser.yaml, Makefile and both workflows, but missed this example.
    • Fix: drop CGO_ENABLED=1 from build.sh (or keep it with the race-test reason) and fix the README line.
  4. docs/results/REPRODUCE.md:60 — the reproduce guide still builds with -tags cg_skeleton.

    • What fails: the guide tells a user to run CGO_ENABLED=1 go build -tags cg_skeleton ... and go test -tags cg_skeleton ./..., and says the tag needs cgo/tree-sitter. The tag and the component no longer exist. The prerequisite list (REPRODUCE.md:15) demands CGO_ENABLED=1 for the same wrong reason.
    • Proof: docs/results/REPRODUCE.md:15,58-61. No file in the tree carries the cg_skeleton build constraint after this PR (internal/treesitter and components/offload/skeleton.go are deleted).
    • Fix: update the build commands and the prerequisite line to the plain build.
  5. components/offload/payload_rederive_test.go (deleted) — the end-to-end proof for the short stash horizon is gone, and a kept test still cites it.

    • What fails: TestAReclaimedPayloadIsReDerivedBeforeItsMarkerGoesUpstream was the only test that drove the #190 property end to end: a reclaimed stash payload is re-derived before its marker goes upstream. That property is what makes store.DefaultStashTTL (a fifth of ttl_seconds) safe. It still applies to the kept components dedup and extract — the rewritten comment in store/store.go:519-528 names exactly these two and their exposure. The PR re-drove other mask tests with extract, but deleted this one. store/payload_ttl_test.go:16-17 still says the test exists "in components/offload, which drives the re-derivation end to end" — a pointer to a deleted file.
    • Proof: the file is deleted in the diff; grep for the test name over the tree returns nothing; store/payload_ttl_test.go:16 cites it. No remaining test sets StashTTLSeconds below TTLSeconds to drive the re-derivation path.
    • Fix: re-drive the test with extract or dedup, as the PR did for the marker-mode and replay tests. If that is not possible, fix the pointer in payload_ttl_test.go and say the property is untested.

Non-blocking

  • Dead code left behind in components/offload/common.go: hasError (:223), headPeek (:64) and resolveBudget (:48) have no non-test callers now. components.Ctx.TailOnlyCold (components/component.go:853) has no callers at all. Consider removing them in a follow-up.
  • Stale comment pointers to removed code: extract_llm.go:126, summarize.go:111 and cache_aware_summarizer.go:120 say "see AgentDiet.modelClient"; modelcfg.go:36 lists agentdiet as a model component; dedup.go:107 cites "the rule coref.go"; state.go:288 says "mask and failed_run build prefix + headPeek(...)"; stashreserve_test.go:15 says "linecap will certainly rewrite".
  • docs/components.md:29 still lists agentdiet among the presets that "run little or none" of the lossless trio, and docs/reference/reference.md:160 says cost_source: host_total "also carries summarize and agentdiet". Both are stale.
  • PresetPipeline's doc comment still says "a plain map lookup"; the function now special-cases agentdiet and logs.
  • proxy/proxy.go:1163, proxy/tenancy.go:635 and proxy/security_test.go:305 still name tree-sitter as an example of slow pipeline work.
  • deploy/harbor/dump_unique.py:18 maps marker text of removed components to categories. This is correct for old dump files, so no change is needed.

What I checked

  • The full diff 7a02270f..HEAD (129 files) and the code around each change.
  • The behavior-change rule: the change is named at the top of the PR, with the owner's yes recorded (2026-11-26). The six current presets and house name no removed component.
  • Old-config handling: dropRemoved in LoadBytes and Build, the agentdiet early return in applyPreset, and PresetPipeline("agentdiet") returning an empty pipeline. All three /compact and dash call sites (proxyapp/main_run.go:824, dash/adaptcompaction.go:101,342) handle the empty result without error. TestRemovedComponentsAreIgnoredNotFatal and TestRemovedPresetResolvesToEmptyPipeline cover the new behavior.
  • Preset arithmetic: 14 obsolete presets, 15 kept components, presetConfigs entries carry no removed name, TestEveryPresetBuilds now fails on a removed or unregistered name.
  • Data dependence: 9 row files deleted, 15 remain, the template's counts (5+2+1+3 = 11 of 15; 3 cannot work without content; 1 special case) match the row files' kinds. The generated page carries the template, including the defect in finding 2.
  • Deleted tests vs kept behavior: gate labels, kept-verbatim, stash-reserve refusal, commit-gate and sweep tests were re-driven with extract, cmdfilter or dedup and still cover the kept components. The one gap is finding 5.
  • flattenForCoref moved from coref.go to extract_sweep.go byte-identical; internal/coref stays and has three live callers.
  • go.mod: only removals (go-tree-sitter, go-sitter-forest/*, go-pointer); no new pin, so the tag rule holds.
  • Host boundary and client rules: no new logic in a host package, no client-specific rule added. The late_rewrite test component lives in a cmd test only.
  • Docs sweep for stale names: docs/setup.md, presets.md, components.md, mkdocs nav and the plugin's insights.py are consistent; the leftovers are findings 3, 4 and the non-blocking notes.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 7dfca4131039 blocking

Verdict: blocking

Findings

  1. deploy/harbor/replay2.py:31 — the replay harness still offers arms named after removed components, and each arm now silently measures the baseline.
    • What fails: replay2.py --configs mask (or failed_run, collapse, smartcrush, skeleton) writes pipeline: [mask] to the config file (replay2.py:85, spec = PIPE.get(config, ("pipe", config)), and replay2.py:92, cfg.write_text(f"pipeline: [{config}]\n")). config.LoadBytes now drops the name with a log warning only (config/config.go:496-521). The arm runs an empty pipeline and reports its numbers under the removed component's name. A reader cannot tell the arm from a real result.
    • Proof: DET_CONFIGS at deploy/harbor/replay2.py:31-32 still lists failed_run, mask, collapse, smartcrush, skeleton. The PR cleaned the sibling scripts (deploy/harbor/replay.py, sweep.py, swebench.py, terminalbench.py, deploy/eval-containers/sweep.py) and the PR body says "the benchmark sweep arms no longer name the removed components". These two tools were missed. docs/results/component-gating.md:10 still tells a reader to reproduce with replay2.py <capture> --configs ....
    • Fix: remove the removed names from DET_CONFIGS in replay2.py and from FREE and VARIANTS in scripts/analysis/cc_replay_sweep.py (see finding 1b). Update the two docs that point at them.

1b. scripts/analysis/cc_replay_sweep.py:15 — the transcript sweep still runs and searches over removed components.

  • What fails: FREE (lines 15-16) still lists failed_run, linecap, smartcrush, collapse, mask, coref, readlifecycle. VARIANTS (lines 19-24) still builds pipeline: [readlifecycle], [mask] and [collapse] docs. Each single-component run now measures an empty pipeline. Worse, the greedy search (lines 110-134) draws its pool from FREE, so it pays for a run per removed name and can print a "best custom pipeline" that contains a name which saves nothing.
  • Proof: res["single"][c] = run(args, "single-" + c, "-pipeline", c) at line 111 drives the shipped binary with each name; dropRemoved in LoadBytes turns each into a no-op with a warning in the log only. scripts/analysis/README.md:693-715 documents this tool as the way to see "what would each component have saved".
  • Fix: drop the removed names from FREE and delete the removed VARIANTS entries. Say so in the README section.
  1. docs/data-dependence/page.md.tmpl:36 — the Metadata term lost its line break and is glued onto the Content bullet.
    • What fails: the line now reads output are content too.- **Metadata**: values that do not let you read the content back.... In rendered markdown the Metadata definition is no longer its own list item. It appears as literal text inside the Content bullet, so the Terms section loses one of its two definitions.
    • Proof: grep -n "content too.- \*\*Metadata" docs/data-dependence/page.md.tmpl docs/data-dependence.md hits line 36 in both files. The generated page carries the same defect, so the page and the template agree — the defect is in the template edit itself, not the regeneration.
    • Fix: restore the newline before - **Metadata** in page.md.tmpl, then regenerate docs/data-dependence.md with go run ./cmd/gen-datadep.

Non-blocking

  • Dead code in components/offload/common.go. resolveBudget (line 48) and hasError/errWords (lines 218-228) have no callers left anywhere, and headPeek (line 64) is used only by common_test.go. The comments there already say "a removed component" used them. Delete them, or move headPeek into the test file.
  • The fixed-restore table lost its reapplyFrozen row. components/offload/expand_restore_test.go:21-24 still says the table covers "one offloader per route into it", but the rows left are extract (skipReduce) and extract_llm (its own check). cmdfilter still routes through reapplyFrozen, and that route into isKeptVerbatim/Ctx.Restored now has no row. Consider a cmdfilter row.
  • Config.Build is now a mutating method. dropRemoved (config/config.go:496) writes c.Pipeline and deletes from the shared c.Components map on every Build. Every current path pre-cleans through LoadBytes, so I found no live race. But a caller that builds a shallow copy sharing the Components map (the shape proxyapp/main_run.go:819 uses for PipelineFor) would race on delete if the config still named a removed component. A comment, or a read-only pass in Build, would remove the hazard.
  • Stale comments still name removed components, after commit b43170c claimed to drop them: components/offload/state.go:60 and :288, schema/validate.go:76, config/form.go:65 and :535, proxy/control.go:1300, proxy/agentcompaction_test.go:466 ("linecap does not act on these short bodies" — the pipeline is now extract), docs/components.md:29 (agentdiet "run little or none of it" — it now runs nothing), docs/reference/reference.md:160 (the cost_source text still counts agentdiet inside host_total).
  • proxyapp/main_run.go:106 still lists agentdiet among the obsolete presets that "still load". It does load, as an empty pipeline. Wording only.

What I checked

  • Read the full diff 7a02270f..HEAD (7 commits, 129 files, +517/-12038) and the code around each change.
  • Config resolution. dropRemoved in LoadBytes and Build; the agentdiet special case in applyPreset and PresetPipeline; the /compact path through proxyapp.PipelineFor (proxyapp/main_run.go:818-834) and proxy.go:854-866; the dash callers of PresetPipeline (dash/adaptcompaction.go:101, 342). The fail-open rule holds: a stored config that names a removed component loads, warns, and runs without it. TestRemovedComponentsAreIgnoredNotFatal and TestEveryPresetBuilds cover both entry points.
  • Presets. Compared every edited preset list in config.go against docs/reference/presets.md (lines 68-81) and context-guru-plugin/scripts/insights.py. They agree. The obsolete count is 14, as the text says. The six current presets and house name no removed component, so the default behavior does not change.
  • Registrations. The 15 remaining registered components match the 15 remaining row files under docs/data-dependence/components/. No code still registers a removed component. No cg_skeleton reference remains in Go, the Makefile, CI or goreleaser.
  • Moved code. flattenForCoref moved from the deleted coref.go into extract_sweep.go; internal/coref stays and extract_sweep*.go still calls it. The new test helpers callMsgs/asstMsg (components/offload/helpers_test.go) are used by dedup_test.go and summarize_keepfirst_test.go.
  • Data dependence. The generated page and the template agree (the generator output matches the row files; only the glued bullet, finding 2, is wrong). The counts in the page check out: 15 components, 11 without stored content, 3 model-written, 1 special case. The PR names the data-dependence change and no kept component changed its row.
  • Behavior change. Named at the top of the PR with the owner's yes on 2026-11-26, per the repo rule.
  • Host boundary and client rules. No business logic was added to a host package: proxy.go and metrics.go only lose the agentdiet counters; dash/schema.go changes a comment. No client rule was added or moved; docs/client-coverage.md needs no change.
  • go.mod. Only go-tree-sitter, go-sitter-forest/* and go-pointer (indirect) are removed. No pin is added, so the tag-only rule holds.
  • Docs. Checked the mkdocs nav against the deleted pages, and grepped the docs for links to skeleton.md, coref.md and removed anchors. None remain.
  • Test swaps. The collapse/mask/linecap fixtures replaced with extract keep each test's premise (a tool output above the floor, noise extract removes). TestRewriteOfSentMessageIsABreak now brings its own test-only component, which is the right fix now that no shipped component rewrites a sent message on purpose.
  • I did not run builds or tests (live tests not approved).

…oval

- Remove the removed component names from replay2.py and cc_replay_sweep.py, and note it in the docs.
- Restore the newline before the Metadata term in the data-dependence template.
- Drop the C toolchain and cg_skeleton text from the llm-d example and REPRODUCE.md.
- Drive the reclaimed-payload re-derivation tests with extract again.
- Add a cmdfilter row to the fixed-restore table.
- Delete dead code in components/offload/common.go.
- Make Config.Build read-only.
- Fix stale comments and docs that name removed components or tree-sitter.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator

Round 1 replies. All the findings are fixed in the commits up to cb5c0adb. First, the branch merged the latest origin/main, with no conflicts.

Both reviewers

  1. replay2.py and cc_replay_sweep.py still run arms for removed components: fixed.
    • DET_CONFIGS in replay2.py no longer lists the removed names.
    • In cc_replay_sweep.py, FREE now holds only live components. VARIANTS is deleted, with its loop.
    • scripts/analysis/README.md is updated, and docs/results/component-gating.md has a note on the removed components.
  2. page.md.tmpl:36, the lost newline: fixed. The newline is back, and the page is regenerated.

Reviewer 2
3. examples/llm-d-service, the C toolchain: fixed. build.sh uses CGO_ENABLED=0, and the README says that the build is pure Go.
4. REPRODUCE.md, -tags cg_skeleton: fixed. It now uses the plain build and go test ./..., and the prerequisite line is corrected.
5. The test of re-deriving a reclaimed payload is deleted: fixed. payload_rederive_test.go is back, and extract drives it now.

  • The first test passes as before.
  • The second test cannot keep its old meaning. extract has no frozen replay, so with a full reserve it declines and sends the message verbatim. The test is now TestAReclaimedPayloadThatCannotBeReStashedIsDeclinedNotDangling. It asserts that stash_refused moves, that stash_missing does not, and that no marker goes upstream. This matches the comment in store/store.go.
  • The pointer in store/payload_ttl_test.go points to a test that exists again.

Non-blocking (both reviewers): all fixed

  • Dead code: resolveBudget, hasError and errWords are deleted, and headPeek is moved into common_test.go. Ctx.TailOnlyCold stays, because apply/apply.go:2023 calls it.
  • Restore table: the expand_restore_test table has a cmdfilter row for reapplyFrozen.
  • Config.Build: it is now read-only. The new withoutRemoved() returns the filtered names, and only LoadBytes writes to the Config. A test checks that the caller's Config does not change.
  • Stale comments and docs: every place that the two reviews list is fixed. A proxy test fixture that still used linecap now uses [dedup].

Tests (macOS, Go 1.27.4, no -race on proxy or dash)

  • Build and go vet pass.
  • These packages pass: config, components, schema, store, tenant, apply, proxyapp, cmd, proxy and dash.
  • The plugin suite ran in 3 groups, 512 tests in all. All of them pass except TestCGScriptsAreVendoredIntoCodex, which also fails on an unchanged origin/main.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 cb5c0adbb5eb approve

Verdict: approve

Round-1 findings

All five of my round-1 findings are fixed. I verified each fix in the diff, not only in the author's reply.

  1. replay2.py arms for removed components — fixed. DET_CONFIGS (deploy/harbor/replay2.py:31) now lists only live names. scripts/analysis/cc_replay_sweep.py (reviewer 1's finding 1b, which I checked myself) is cleaned too: FREE holds only live components and VARIANTS is deleted with its loop. scripts/analysis/README.md and docs/results/component-gating.md carry the matching notes.
  2. Lost newline in the Terms section — fixed. page.md.tmpl:36 and the regenerated docs/data-dependence.md:36 both have the Metadata bullet on its own line again. The page and the template agree.
  3. llm-d example C toolchain — fixed. build.sh uses CGO_ENABLED=0 and the README says the build is pure Go.
  4. REPRODUCE.md cg_skeleton build — fixed. The prerequisite line and both build commands use the plain build and go test ./....
  5. Deleted re-derivation test — fixed. payload_rederive_test.go is back, driven by extract:
    • TestAReclaimedPayloadIsReDerivedBeforeItsMarkerGoesUpstream keeps the original shape: promise on turn 1, reclaim past stash_ttl_seconds, re-derive and re-stash on turn 2, with the Expired/Revived pair asserted.
    • The second test is correctly re-scoped: extract has no frozen replay, so a full reserve makes it decline, and the test now asserts stash_refused moves, stash_missing does not, and no marker goes upstream. This matches the rewritten comment in store/store.go:519-528.
    • The pointer in store/payload_ttl_test.go:16 names a test that exists again.
    • All helpers the tests use exist: newExtract, userMsg, tool, StashStats, PutStash, StashRefusals, StashMissing.

Reviewer 1's findings 1, 1b and 2 are the same defects as my 1 and 2, plus cc_replay_sweep.py. I checked them myself and they are fixed. Their non-blocking items are all fixed as well: the dead code in common.go is deleted (headPeek moved into common_test.go as the clipRunes fixture), the fixed-restore table has a cmdfilter reapplyFrozen row (helpers newFilterComp and cmdToolMsg exist), Config.Build is read-only, and the stale comments are reworded.

Findings

None.

Non-blocking

  • scripts/cc-demo.sh:3 still suggests building with CGO_ENABLED=1, and scripts/cc-demo.sh:19 describes the agent preset as "mask/dedup/failed_run/extract". The preset now runs the cleaned pipeline, so the comment names three removed components. The demo itself works (--preset agent loads). Comment-level only.

What I checked

  • Last review: round 1, 7dfca41310391a4f18404bc4f3a40d72f47e2059, 2026-11-26T18:34:40Z.
  • New commits read: 2 — 8ac1d67e (merge origin/main) and cb5c0adb (fix(components): address round 1 review of the heuristic-deletion removal).
  • Read in full: 4 reviews, 7 comments, 0 inline comments (from the three files; the inline file is empty).
  • New items since my last review: the author's round-1 reply (comment, 2026-11-26T18:57:54Z). I checked every claim in it against the diff; each held. The two earlier OsherElhadad reviews and comments predate my round 1 and name no new request.
  • The fix commit cb5c0adb in full: config (Build read-only via withoutRemoved(), dropRemoved now only in LoadBytes, with a test asserting the caller's Config is unchanged), the restored payload_rederive_test.go, the cmdfilter row in expand_restore_test.go, the dead-code deletion in common.go, and every doc and comment fix.
  • The merge 8ac1d67e: git show --remerge-diff is empty, so no conflict resolution dropped anything from main. The main side it brings in is #1445 (tool deferral accounting), already reviewed as its own PR.
  • Ctx.TailOnlyCold stays, correctly: apply/apply.go:2023 calls it. My round-1 note that it had no callers was wrong — I had grepped only components/.
  • Final sweep for removed names in scripts, deploy and examples: only historical results pages, dump_unique.py (correct for old dumps) and the cc-demo.sh comment above remain.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 cb5c0adbb5eb approve

Verdict: approve

Findings

None. Both round-1 findings are fixed, and I found no defect in the new commits.

Round-1 findings, re-checked

Mine:

  1. replay2.py arms for removed components — fixed. DET_CONFIGS (deploy/harbor/replay2.py:31) now holds only live names and presets. docs/results/component-gating.md carries a note that says the figures below are history and a current build cannot reproduce them.
    1b. cc_replay_sweep.py — fixed. FREE (scripts/analysis/cc_replay_sweep.py:15) now lists 7 live components. VARIANTS, its run loop and its print are deleted; grep finds no leftover use, so no NameError path remains. scripts/analysis/README.md drops "a few non-default settings".
  2. Glued Metadata bullet — fixed. The newline is back in docs/data-dependence/page.md.tmpl:36-37 and in the generated docs/data-dependence.md:36-37. Template and page agree.

Non-blocking, mine: all fixed. resolveBudget, hasError and errWords are deleted from common.go; headPeek moved into common_test.go as the fixture for clipRunes. The fixed-restore table gained a cmdfilter row for reapplyFrozen (expand_restore_test.go:50-60), and its head comment now names all three routes. Config.Build is read-only: withoutRemoved() filters into a fresh slice, dropRemoved is called only from LoadBytes (config/config.go:468), and TestRemovedComponentsAreIgnoredNotFatal now asserts the caller's Config is unchanged. Every stale comment and doc line both reviews listed is fixed; I checked each one at its new line.

Reviewer 2's:

  1. llm-d example C toolchain — fixed. build.sh sets CGO_ENABLED=0 and the README says the build is pure Go.
  2. REPRODUCE.md -tags cg_skeleton — fixed. The prerequisite line and both build commands use the plain build.
  3. Deleted re-derivation test — fixed. payload_rederive_test.go is back, driven by extract. store/payload_ttl_test.go:17 points at a test that exists again. The author's reason for reworking the second test is right: extract has no frozen replay, so with a full reserve it declines and sends the message verbatim. TestAReclaimedPayloadThatCannotBeReStashedIsDeclinedNotDangling asserts exactly that — verbatim output, no marker upstream, stash_refused moves, stash_missing does not — which matches the comment in store/store.go:519-528.

Reviewer 2's non-blocking claim that Ctx.TailOnlyCold has no callers is wrong: apply/apply.go:2023 calls it. The author's reply says so and the code confirms it. Keeping the method is right.

Non-blocking

  • deploy/harbor/cfg-iter02*.yaml (11 files) still name collapse and coref in their pipelines. They load with a warning. This is OsherElhadad's note from 2026-10-15, still open. Historical experiment configs; delete or annotate them in a follow-up.

What I checked

  • Last review: round 1, 7dfca41, 2026-11-26T18:35:02Z.
  • New commits read: 2 — 8ac1d67e (merge origin/main 17e5633, no conflicts) and cb5c0adb (fix(components): address round 1 review).
  • Read in full: 4 reviews, 4 comments, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt).
  • New items since my last review: the author's reply comment (2026-11-26T18:57:54Z), which claims every finding fixed — I verified each claim in the diff; the merge commit; the fix commit.
  • The fix commit, in full. Read every hunk of cb5c0adb (32 files): the config read-only rework, the dead-code removal, the moved headPeek, the new cmdfilter restore row, the restored payload_rederive_test.go (both tests, line by line), the harness cleanups and the comment fixes. The new test's helpers (newFilterComp, cmdToolMsg, StashStats, PutStash) all exist, so the file compiles against the tree as I read it.
  • The merge. git diff 17e5633c..HEAD touches no accrec/, tooldefer/, dash/ or accountant file, so the branch does not revert any of main's #1445/#1465/#1504 work; the tooldefer changes I read in the range diff arrived from main through the merge, not from this branch. The PR's removals are all still present at HEAD.
  • The new payload tests' premise. extract re-derives its cut from the re-sent original each turn, and the re-stash goes through the refusable commitMark. The decline-when-refused behavior the second test asserts is the one store/store.go documents for the no-replay family. I could not run the tests (live tests not approved); the author reports both pass.
  • Leftover names. Grepped the tree for the removed names: replay2.py, cc_replay_sweep.py, the llm-d example and REPRODUCE.md build commands are clean. What remains is history text in results docs (REPRODUCE.md:96, :337 describe past runs) and the cfg-iter02*.yaml note above.

The comments named CGO_ENABLED=1 and removed components. No code changes.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator

The approvals at cb5c0adb still count. The new commit b1545772 changes only 2 # comment lines in scripts/cc-demo.sh. Output of scripts/release/approval-still-valid.sh 474 cb5c0adb:

approved: cb5c0adbb5eb (base 17e5633ca760) patch-id fda1e9baaa33
head:     b1545772e1f2 (base 17e5633ca760) patch-id cbb0d7b93193
--- git range-diff
1:  20057e64 = 1:  20057e64 refactor(components): remove offloaders that delete by heuristic
2:  c6b62422 = 2:  c6b62422 docs: drop links to removed component pages
3:  b43170cd = 3:  b43170cd docs: drop stale comments naming removed components
4:  03b92feb = 4:  03b92feb fix(config): resolve the removed agentdiet preset to an empty pipeline on /compact too
5:  f0a02375 = 5:  f0a02375 test(apply): drive the thread-cache fixtures with extract now that mask is removed
6:  7dfca413 = 6:  7dfca413 docs: fix a sentence in CLAUDE.md after the cg_skeleton text left
7:  cb5c0adb = 7:  cb5c0adb fix(components): address round 1 review of the heuristic-deletion removal
-:  -------- > 8:  b1545772 docs(scripts): update two comments in cc-demo.sh
COMMENTS ONLY: cb5c0adbb5eb..b1545772e1f2 changes only comment lines in .go and .sh files. The approval of cb5c0adbb5eb still counts. Say so on the PR.

@amiddavid

Copy link
Copy Markdown
Collaborator

@OsherElhadad, the owner decided on part of this PR. The rest is for you to decide.

Decided (owner, 2026-11-27):

  • A new PR deletes the obsolete presets that use these components: balanced, aggressive, coding, mcp, agent, general, agentdiet, codesmart and codesafe. A config that names one loads with a warning.
  • The same PR removes the coref component. internal/coref stays, because extract_llm_sweep uses it.

For you to decide: the other 8 components stay in the code for now: failed_run, collapse, mask, linecap, smartcrush, readlifecycle, agentdiet and skeleton. With the presets gone, only a hand-written pipeline: can reach them.

  • Do you still want to delete all 8, as this PR does? Or do you want to keep some of them?
  • Is any part worth keeping, or rebuilding with a cut chosen by content? Candidates are the stale-read rule of readlifecycle, and the savings of mask and collapse (the largest measured).

This PR stays on hold until you answer. It merged main at b1545772 and was approved there. After the new PR lands, it will need another merge of main.

amiddavid added a commit that referenced this pull request Nov 27, 2026
…oaders, and retire coref (#1538)

refactor(config): delete the obsolete presets that use heuristic offloaders, and retire coref

Delete the 9 presets that name a component that deletes by a heuristic:
balanced, aggressive, coding, mcp, agent, general, agentdiet, codesmart
and codesafe. A config that names one loads, logs a warning and runs no
preset components. An explicit pipeline in the same document still runs.

Remove the coref component. A config that names it loads and drops the
name with a warning. internal/coref and every use of it by the sweep stay.

The other 8 components stay as they are: failed_run, collapse, mask,
linecap, smartcrush, readlifecycle, agentdiet and skeleton. A hand-written
pipeline reaches them. Their docs say so.

Move the tests that used a retired preset to a current one. Remove the
retired presets from the benchmark scripts, the plugin and the docs. Update
the data-dependence page counts.

Refs #1412, #471, #474

fix(config): address round 1 review of the preset retirement

- Split the --preset help into obsolete presets (run as before) and retired presets (load, warn, run nothing).
- Remove coref from the data-dependence feature row for billed-token records, and rebuild the page.
- Remove coref from the cc_replay_sweep arm list and skeleton from the replay arm lists. Extend the drift test to scan those lists.
- Say that nine offloaders (searchcap included) are in no preset, without a shared history claim.
- Fix stale comments that name coref or the retired presets as current.

fix(config): address round 2 review of the preset retirement

- Name the real reader of the per-thread billed record: the warm gate of extract_llm_sweep.
- Say in prefix_econ.go that no component rewrites the cached prefix now. The gate and the horizon stay only as the reference for the guard tests.
- Remove phi_evict and skeleton from the replay and sweep arm lists. The drift test now scans sweep.py CONFIGS too, and only `off` is exempt.
- Say which case is which: an unregistered name fails Build, a removed name runs an empty pipeline.

Behavior change (9 obsolete presets retired: a config naming one loads with a warning and runs no preset components; the coref component removed) approved by the owner in the integrator session: "1538 yes". Built, vetted and tested on the current main before the merge; the data-dependence page needed no change.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Program PR approved by the reviewer, CI green; needs maintainer approval

Projects

Status: New/ToDo

Development

Successfully merging this pull request may close these issues.

2 participants