feat(facts): optional --text on update + facts confirm#11
Merged
Conversation
CLI `facts update` no longer forces --text. When --text is omitted it reuses the existing fetchText path (the same one the MCP surface uses): the current fact text is fetched and echoed back so only the provided fields change. This lets `bee facts update <id> --confirmed true` flip the confirmed flag without a manual get-then-update dance and without risking a text rewrite. Add `bee facts confirm <id>` as sugar for the common confirm-and-preserve-text case. It is CLI-only: bee_update_fact already lets MCP callers set confirmed without supplying text, so a separate MCP tool would churn the tool snapshot for no new capability. Update USAGE, the top-of-file divergence comment, tests, and the README facts section to match.
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.
What
facts updateno longer requires--text. When omitted, the CLI reuses the existingfetchTextpath (already used by the MCP surface): it GETs the fact, reuses the stored text, and PUTs only the fields you passed. Sobee facts update <id> --confirmed truenow works on its own — no get-then-update dance, no risk of overwriting the fact text.bee facts confirm <id>— sugar that setsconfirmed=truewhile preserving the existing text.Why
Confirming a fact previously meant fetching it, then re-sending its text alongside
--confirmed true, purely to satisfy a--textrequirement the underlying API and MCP surface never imposed. That was an extra round-trip and risked silently rewriting the text.Notes
facts confirmis CLI-only by design:bee_update_factalready supports settingconfirmedwithouttext, so no new MCP tool (and no tool-snapshot churn) is warranted.--textsupplied still takes the no-fetch path.factssection are updated to match.Tests
Added/updated coverage for:
update --confirmedwith no--text(fetches & preserves text), and the newconfirmsubcommand including its id-validation errors.bun run typecheck,bun run build, andbun testall pass locally (302 tests, 0 fail).