Skip to content

feat(kb): kb_edit patches big pages; a HOLD ends the task's /goal (v0.495.0) - #962

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/kb-patch
Dec 1, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/kb-patch

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

From a field report: an agent couldn't add two changelog lines to a ~149k-char KB page, and a task's /goal kept re-prompting the agent after the task was put on HOLD.

KB

  • New kb_edit: anchored edits (each oldString must occur exactly once) and/or append, optionally at the end of an underHeading section. Optional baseRev turns a stale read into a conflict.
  • kb_write: accepts file (a .md/.txt in the agent's own folder, no dot-folders, ≤2 MB). Refuses a rewrite that deletes >40% of an existing page of ≥2k chars unless confirmRewrite is set, and says that args aren't shell-expanded when the body looks like $(cat …). Strips kb_read header lines pasted onto the top of a body.
  • kb_read: heading / offset+limit / outline. An unranged read of a page over 60k chars returns the outline plus the first 150 lines. Header lines now sit above a ──── fence.
  • Audited: kb.write.refused, kb.write.conflict; kb.written now records mode and file.

/goal vs HOLD

  • The converging task prompt (which is part of the /goal condition) now says a blocked/held/cancelled task ends the goal.
  • maybeHoldDelegate types /goal clear into the live session when a task with criteria is parked, whoever parked it (the agent itself included). Audited session.goal.cleared.

Tests: scripts/kb-edit-test.cjs (50 assertions, including the incident end to end over the MCP process). Full test:governance passes: 153/153.

🤖 Generated with Claude Code

….495.0)

kb_write replaced a whole page and took inline text only, so adding two
changelog lines to a ~149k-char page meant retyping it — which produced
placeholder / literal $(cat …) bodies and pasted-back kb_read headers
saved over the page, until a human edited it by hand.

- kb_edit: anchored edits + append (optionally under a heading), baseRev conflict
- kb_write: `file` source (agent folder only), shrink brake (>40% needs
  confirmRewrite), strips kb_read headers pasted onto a body
- kb_read: heading / offset+limit / outline; big pages return an outline
- /goal: a blocked/held/cancelled task ends the goal (prompt clause) and
  parking it types `/goal clear` into the live session

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit f1fffdb into main Dec 1, 2026
1 check passed
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