Skip to content

Edit application knowledge

The shared knowledge base describes your application at a selected revision, separate from executable flows. In knowledge-base mode, edit shared knowledge directly through pinned revisions and private temporary files rather than maintaining a second local corpus. (Git test storage also works without a second corpus; see Where tests are saved.)

Action reference (manage_knowledge_uploads)

Section titled “Action reference (manage_knowledge_uploads)”

All temporary-edit and upload actions run on the local MCP server (there is no reflow knowledge CLI command). Load knowledge-corpus for the authoring and review contract.

ActionPurpose
root / revisionsRead the current published root and newest revision window (default 50, max 100 entries; next_offset: null marks the end of the window, not the end of all history).
revisionRead the complete document inventory for a pinned revision_id.
prepare_editDownload verified bytes to a private 0600 temp file (path or batch paths, 1–25); omit revision_id for new empty files.
uploadUpload edited bytes (content, file_path, or batch file_paths); returns upload_id and operation_id.
verify / deleteVerify already-transferred bytes (incomplete means resume upload first) or abandon an unused remote reservation.
publishPublish a format-1 delta manifest against base_revision_id (plus optional remove_paths), or a full manifest without a base.
operationReconcile a publication receipt (publication_id + exact manifest_hash) and reclaim published temp files.

Edit a page without copying its body through the model

Section titled “Edit a page without copying its body through the model”

Inspect manage_knowledge_uploads with action: "root" and app, then read action: "revision" for the selected revision_id and pin that revision while editing:

{
"action": "prepare_edit",
"app": "my-app",
"path": "local-development.md",
"revision_id": "<selected-published-revision-id>"
}

Reflow downloads and verifies the exact original and returns an absolute file_path, initial content_hash, and byte count—keeping the full page out of the tool response. Edit the temporary file with your agent’s file tools, then upload it:

{
"action": "upload",
"app": "my-app",
"file_path": "<absolute-file_path-returned-by-prepare_edit>"
}

file_path can also import an existing file read-only from the checkout selected at MCP startup (REFLOW_LOCAL_REPO or the detected checkout); do not create repository files solely to import them in knowledge-base mode. An upload accepts exactly one of content or file_path.

For multiple pages, pass paths: ["a.md", "b.md"] to prepare_edit and file_paths: ["<returned-a>", "<returned-b>"] to upload (do not mix batch and single-file fields). Batch calls are non-atomic—inspect each entry in results, retain accepted IDs, reconcile uncertain items via single-file actions with their same IDs, and submit not_started entries separately rather than replaying the whole batch.

Preparing or uploading a file never publishes knowledge or changes the application root. Publish from the pinned base with base_revision_id: include only changed or new paths in the format-1 manifest and their verified uploads. Unchanged pages carry forward from the immutable base automatically. Use remove_paths to omit named base pages from the new candidate (never deleting retained history; a path cannot be both removed and changed).

{
"action": "publish",
"app": "my-app",
"base_revision_id": "<pinned-base-revision-id>",
"manifest": {
"format": 1,
"documents": [
{"path": "billing.md", "content_hash": "<edited-sha256>", "bytes": 1234},
{"path": "local-development.md", "content_hash": "<edited-sha256>", "bytes": 2345}
]
},
"uploads": [
{"contentHash": "<billing-edited-sha256>", "uploadId": "<verified-upload-id>"},
{"contentHash": "<development-edited-sha256>", "uploadId": "<verified-upload-id>"}
]
}

Compute content_hash and bytes from the edited file (or use the verified upload’s metadata)—the initial prepare_edit hash/size no longer apply after editing. Submit uploads at most two at a time and wait for verification. The returned manifestHash commits the complete resulting revision. Without base_revision_id, manifest must list every page with verified uploads for every distinct hash; pre-manifest revisions require one full publication before acting as a format-1 base.

Base validation failures return a rejection code without forwarding a mutation—inspect the pinned revision rather than auto-switching bases. Retain upload_id and operation_id on any unconfirmed transfer and reconcile with the exact same IDs and bytes.

Reconcile operation with app, publication_id, and the exact returned manifest_hash. A matching receipt verifies the complete manifest and cleans up temporary files whose current bytes match a published hash (up to 128 draft directories per pass; repeated reconciliations in the same MCP session continue through remaining drafts).

  • Inspect temporary_edits: if absent, verification or cleanup was unavailable (the publication itself remains accepted). Preserve any paths in temporary_edits.recovered_file_paths (edits changed during cleanup) or temporary_edits.retained_file_paths (interrupted copies—inspect permissions or links before touching them).
  • Call prepare_edit again after publication before starting another edit. To abandon an unpublished local edit, confirm it is no longer needed and remove that file with your file tools (this does not delete remote reservations or published revisions).
  • If operation immediately reports unconfirmed with reason: "receipt_not_observed" and retry_after_ms: 2000, wait and poll the same publication_id and manifest_hash instead of republishing. reason: "lookup_unavailable" indicates a connection error, not rejection.
  • Once confirmed, select the root explicitly using the observed root’s revision and change token; never auto-rebase an uncertain root change.
ConstraintRule
Scope & permissionsTemporary files are bound to the connected team, deployment, and app; keep regular files owner-only (0600—run chmod 600 <file_path> if an editor widens mode). Symlinks, hardlinks, arbitrary profile/home paths, and concurrent mid-read edits are refused.
Format & sizeExact UTF-8 up to 256 KiB; BOM and CRLF bytes are preserved.
Batch calls1–25 distinct paths, max concurrency 2, single 30s budget covering discovery and per-file work.
Cleanup & retentionBest-effort cleanup on reconciled operation (128 draft dirs/pass); unpublished edits are never auto-expired.
Role boundariesknowledge-maintainer can prepare_edit, upload, and publish candidates; delete on unused reservations and root selection require the full author profile. Published references cannot be deleted.