Repository navigation
worker: defrag drafts corrections for disputed claims - #90
Merged
Merged
Conversation
…ted claims before LIMIT
…-ghkdsb # Conflicts: # docs/features/hosted-worker.md # worker/src/mcp.ts # worker/src/memory.ts
…eedback as what accepts
…lines capped at 3
…, or often read and not confirmed lately
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.
The hourly defrag gains a rewrite step (
worker/src/rewrite.ts). For each disputed claim (a session's standingwrong), a Workers AI text model (@cf/meta/llama-3.3-70b-instruct-fp8-fast, overrideKYPP_REWRITE_MODEL) drafts a corrected lesson from the writable raters' notes, or answers NONE. The draft passes the S1 write gate and lands as an unstamped candidate under the same subject (agentkypp-defrag,metadata.rewrite_of), so only laterusedratings can accept it. The disputed claim is left as it was.Bounds: at most
REWRITE_BATCH(5) claims per pass; one attempt per newest standingwrong(metadata.rewrite_tried), including when the model fails;KYPP_REWRITE=offturns it off. Notes go only to the model, never to a reader, and the prompt marks them untrusted.Contracts touched:
defrag()takes an optional rewriter and returnsrewritten;store.toRewrite/ratingNotes/rewriteTried; uses the existingAIbinding.Verification:
npm run typecheck;npm test399/399; newtest/rewrite.test.ts(draft filed as candidate, one attempt per wrong and retry on a newer one, control-text draft refused, failing model, no rewriter, answer parsing);featuremap.py checkclean.Generated by Claude Code