feat(curate): wire chi:"curate" end to end - #54
Open
adiled wants to merge 1 commit into
Open
Conversation
`chi:"curate"` has been in the registry since the protocol was written — "manual compaction request" — but humd dropped it in the thrum.recv.todo arm, no worker handled it, and `graft::prune_jsonl` sat implemented and tested with no production caller. Three pieces of the same feature, none of them joined. This joins them. humd — forward Curate to registered workers, same shape as the Cancel and Cleanup arms directly above it. Workers no-op on an unknown sid, so spraying is safe until sid→worker routing exists. nest — `WorkerBee::curate(sid, cwd) -> CurateReport`, defaulting to a no-op so hives with nothing to trim are unaffected. It takes a cwd rather than a live Cell deliberately: `claude -p` exits after every turn, so a curate almost always arrives with no cell running, and the transcript on disk is the state worth trimming. nest-common — handle "curate" in the worker loop and advertise it in the hello's chis. Adds a small sid→cwd LRU populated from prompts, since a curate names a sid but no cwd and the transcript lives under one. claude-cli — implement curate via the existing prune_jsonl: strip thinking blocks, clip oversized tool results, protect the most recent turns. Two tests cover the new path: curate reaching the right transcript and honouring the protection window, and curate on a sid this bee never raised a cell for, which is routine given humd sprays to every worker. cargo check --workspace clean; claude-cli and nest suites pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chi:"curate"has been in the registry since the protocol was written — "manual compaction request" — but nothing behind it was connected:thrum.recv.todoarm (humd/src/lib.rs:1622), alongsideReleasePermit,PetalCell,Drone…nest-common's loop knowsprompt,cancel,tool-result,breath/echograft::prune_jsonlwas implemented and covered by tests, with no production caller anywhere in the treeThree pieces of one feature, none of them joined. This joins them. A bee can send
chi:"curate"and a transcript actually gets trimmed.What changed
humd — forward
Curateto registered workers, the same twelve-line shape as theCancelandCleanuparms directly above it. Workers no-op on an unknown sid, so spraying stays safe until sid→worker routing exists.nest —
WorkerBee::curate(sid, cwd) -> CurateReport, defaulting to a no-op so hives with nothing to trim are unaffected.It takes a
cwdrather than a liveCelldeliberately.claude -pexits after every turn, so a curate almost always arrives with no cell running — the transcript on disk is the state worth trimming, and it outlives the process that wrote it.nest-common — handle
"curate"in the worker loop and advertise it in the hello'schis. Adds a smallsid → cwdLRU populated from prompts, because a curate names a sid but no cwd, and the transcript lives under one.claude-cli — implement
curatethrough the existingprune_jsonl: strip thinking blocks, clip oversized tool results, protect the most recent turns.Tests
hives/claude-cli/tests/curate.rs:Both hold the same
HOMEguardgraft_integration.rsuses;HOMEis process-global and cargo threads these.cargo check --workspaceclean.claude-cliandnestsuites pass.Notes
ReleasePermitstays in the TODO arm. It resolves apermission-ask, and no bundled hive emits one yet — that's a feature rather than a gap-fill, and it doesn't belong here.bytes_before/bytes_afterof the re-serialized entries, so they track the transcript's size without matching the raw file byte-for-byte.