Skip to content

feat(consolidation): cache-segment planner; curator+toolset CLI; docs - #242

Merged
Patel230 merged 1 commit into
mainfrom
feat/cache-planner-consolidation
Aug 23, 2026
Merged

feat(consolidation): cache-segment planner; curator+toolset CLI; docs#242
Patel230 merged 1 commit into
mainfrom
feat/cache-planner-consolidation

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Completes the A (cache planning) and C (consolidation) items from the adoption queue.

Cache-segment planner — internal/engine/cache_planner.go

  • planCache segments the stable prefix (system prompt + tool catalog), emits one breakpoint per segment, and applies measured break-even economics (Anthropic 5m: write=1.25x, read=0.1x → caching pays off for reuse ≥ 2)
  • Returns a structured CachePlan (segments, breakpoints, write bytes, costs, saving) so hosts can log/observe decisions
  • Fixes an arithmetic bug vs the old gate's comment: read cost is 0.1x per reused turn
  • Empty tool catalogs no longer create a phantom "tools" segment from json.Marshal(nil)
  • cacheDecision now delegates to planCache at default reuse; existing behavior preserved

Consolidation CLI surfaces

  • hawk skills curator [status|run|pin|unpin|archive] — exposes the Hermes-style background skill curator as an explicit CLI (ForceReview bypasses the inactivity interval for on-demand runs)
  • hawk toolset [name] — lists or resolves named composable tool groups

Docs

  • New "Adopted Capabilities" README table mapping every env-gated feature/flag/command added across the adoption series

Testing

  • New planner tests (6): segments/breakpoints, disabled at reuse=1, non-anthropic off, below-min off, empty prefix, delegation
  • engine/cmd/skillcurator/toolset suites pass incl. updated golden help; golangci-lint 0 issues; gofmt clean

Completes the A (cache planning) and C (consolidation) items from the
cocoindex/hermes adoption queue.

Cache-segment planner (internal/engine/cache_planner.go):
- planCache segments the stable prefix (system prompt, tool catalog),
  emits one breakpoint per segment, and applies measured break-even
  economics (Anthropic 5m: write=1.25x, read=0.1x; caching pays off for
  reuse >= 2). Returns a structured CachePlan with costs and saving so
  hosts can log/observe the decision.
- Fixes an economics bug vs the old gate's arithmetic: read cost is
  0.1x per reused turn (the old comment conflated the discount with
  the cost). cacheDecision now delegates to planCache at default reuse;
  behavior is preserved for existing tests (non-anthropic off, small
  prefix off, large prefix on).
- Empty tool catalogs no longer create a phantom 'tools' segment from
  json.Marshal(nil).

Consolidation CLI surfaces:
- hawk skills curator [status|run|pin|unpin|archive]: exposes the Hermes-
  style background skill curator as an explicit CLI (ForceReview bypasses
  the inactivity interval for on-demand runs).
- hawk toolset [name]: lists or resolves named composable tool groups.

Docs:
- New 'Adopted Capabilities' README table mapping every env-gated
  feature/flag/command added across the adoption series so they are
  discoverable in one place.

Verification: new planner tests (6) green; engine/cmd/skillcurator/
toolset suites pass incl. updated golden help; golangci-lint 0 issues;
gofmt clean; go build ./... clean.
@Patel230
Patel230 merged commit 5dc3e29 into main Aug 23, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/cache-planner-consolidation branch August 23, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant