Replies: 4 comments 4 replies
|
Happy to implement, have done partly for the push and pull docs anyways as reading docs was wasting tokens, would be great for maintainers to review proposal if any suggestions let me know and can implement as discussed. |
|
Hi @msammu07 This is a fantastic proposal! To be honest, I've noticed this pain point before but hadn't come up with a clean solution yet. Your Git-like push/pull approach is a great way to solve it. Please feel free to start working on it and open PRs. I'd really appreciate your contribution! Ah, just FYI: I recently enhanced the real-time doc editing feature to sync changes live across clients (showing user cursors like Google Docs/Notion for both docs and task descriptions). It shouldn't conflict directly with the push/pull feature, but it's something worth keeping an eye on during implementation. |
|
Would the proposed feed track changes to the caller's visible set, including permission loss without a document edit? A content-only cursor wouldn't tell a managed mirror to remove that cached document. In our Sinaps Studio work at SinapsData, RAG access is checked when tools execute; an offline mirror needs a separate retention contract. A permission-only change followed by pull would clarify that contract, including the limit that removing the managed file cannot revoke copies an agent already made. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
I run several coding agents (Claude Code, Codex and others, often several sessions at once) against one self-hosted Paca. Paca is the shared record for tasks, and I wanted it to be the shared store for plans and specs as well. In practice, Paca Docs is expensive for agents to work with, because every doc operation goes through the whole document:
read_docreturns the full document every time. An agent that needs one section of a long plan, or wants to check one line, pulls the whole thing into its context. Agents that work on local files usegrep/rgand partial reads instead, and can search code and plans in one command. Paca Docs offers no equivalent.search_docsreturns one short excerpt per document, with no line numbers, no surrounding lines and no regex. It matches only within a single BlockNote text run, so a phrase that crosses a formatting change (foo **bar**) is not found. On the server it runsjsonb_path_querywithILIKEover every document's content, with no index behind it.write_docneeds the full content. Changing one checkbox means reading the whole doc and writing it all back, and the agent spends the whole document in output tokens on every write. Each write also goes Markdown → BlockNote, and each read goes BlockNote → Markdown. Both conversions lose some formatting, so content nobody edited can drift with every rewrite.Plans/2026-11-08 my-planis resolved one segment at a time: one HTTP call per folder, then the fetch. Deeper folders mean more sequential calls.A concrete example from my setup: one 19.5 KB implementation plan (about 5k tokens). Pushing it with
write_doccosts about 5k output tokens per push. Checking that one line landed meant reading the whole document back.What I do today
I moved plans and specs back into each repo, so agents can grep and edit them as files. Paca keeps a copy for humans and for agents that don't have the repo. A small client-side script pushes a repo file to Paca. It hashes the file, skips the push when nothing changed, sends the content without the model re-typing it, and queues the push when Paca is offline. Pushing that same plan now takes about 2 s and no model tokens. A matching
pullthat keeps a read-only local Markdown copy for agents to grep is the obvious next step.These scripts work around the API, though. Built into Paca, the same ideas would be faster, safer when several agents work at once, and available to every user.
Proposed capability
1. Content check: hash plus conditional requests
content_hashper document, computed on write.GETreturns it as anETag.If-None-Matchreturns304 Not Modified, so an agent can check for changes without downloading the doc.PATCHacceptsIf-Matchand returns412when the doc changed since the caller read it. That replaces silent last-write-wins between agents.updated_atdoes not change. Agents that re-push routinely then don't pollute history or look like real edits.2. Pull: an incremental change feed and an export
GET /projects/:id/docs/changes?since=<cursor>returns, for each doc changed since the cursor: id, folder path, title,updated_at,content_hash, and tombstones for deleted or moved docs. The current list endpoint can't show deletions, so a client copy can't notice them without re-listing everything.pullcan keep a read-only local Markdown copy that agents grep and read partially, refreshed with one cheap call per session. Permissions still apply, because the copy holds only what the caller's key may read.3. Push: upsert by path, with where the copy came from
PUT /projects/:id/docs/by-path), so the client doesn't walk the folders first.sourcemetadata on a doc (repository, file path, commit). Paca would then know a doc is a managed copy without relying on a convention in the text.Also worth considering
outline(headings with line numbers),sectionand line-range reads, agrep_docsthat returns every match with line numbers and context, and anedit_docthat replaces one exact string and rewrites only the blocks that changed. Unchanged blocks would keep their stored JSON, which stops the conversion drift.GET /projects/:id/docs/by-path?path=….Acceptance examples
pull. One request comes back saying nothing changed, and no doc content is transferred.pullupdates, moves and removes the local file.If-Match. The second gets412instead of overwriting the first.updated_atunchanged.Would the maintainers be open to this direction? I'm happy to split it into separate issues (content check, change feed, upsert by path, MCP partial reads) and help with the implementation.
All reactions