Files and versions
How workspace files, working copies, source versions, publication and file operations relate.
When you edit a workspace file, check which copy you are changing and which copy your running analysis uses. Querio has shared canonical files, separate working copies and immutable snapshots. Publishing changes shared files; opening a pull request does not.
File targets and execution
| Target | Where it is used |
|---|---|
| Canonical files | The shared workspace directory. CLI files commands use it. Context uses it in canonical mode. |
| Working copy, also called a changeset | A separate editable directory with a base version. Context selects one in changeset mode. |
| Environment files | The directory chosen when an execution environment is created: canonical files or one working copy. |
In Settings > Git, File mode is labeled Shared files (canonical) or Branches (changeset). The API keeps those technical values. The workspace's fileMode determines environment selection. In canonical mode, the environment uses shared files; this is the default when no mode is configured, and supplying a changeset is rejected. In changeset mode, the environment uses a specified working copy or creates one from the default source. The environment keeps that binding and cannot switch to another copy.
A session runs against its environment's selected directory. Closing the environment releases its attachment but leaves the working copy in place. You cannot discard a copy while it is attached. See Environments, sessions and runs for the runtime lifecycle.
File paths start at the workspace root, not automatically at [context].root. If root = "querio/", for example, memory's workspace-relative path is querio/memory/MEMORY.md. See Context files for the current tree and loading rules.
Context reload versus source changes
/reload reads context and skills again from the directory already selected by that session. It does not switch working copies, import or publish a version, reconcile a base, or rerun notebook cells. If an edit is missing from a conversation, check that session's file target first. Publishing to canonical files does not refresh an existing working copy. Saved and live analysis state are described in Explores and conversations.
Versions and working copies
| Term | Meaning |
|---|---|
| Source snapshot | Immutable imported file bytes. Importing creates a version without publishing or starting execution. |
| Base version | The immutable state a working copy started from, used to compare its edits. |
| Checkpoint | An immutable capture of a working copy's files and supported file kinds. Later edits cannot change it. |
| Canonical version | A snapshot of shared canonical files. Refreshing after direct edits can create a newer version. |
| Promoted Git source | The imported Git snapshot used for new default working copies in a Git-managed workspace. It can differ from the canonical snapshot, which may include unrelated outputs. |
These are Querio versions, not Git commits. A working copy is not a Git branch. Version and changeset IDs are opaque Querio IDs; a file's revision or HTTP ETag is a separate change token, not a version ID or content hash.
Edits survive reopening a working copy without a checkpoint. A checkpoint pins the bytes used for export or publication: if you checkpoint approved and then edit the file to draft, publishing that checkpoint uses approved.
Status compares current working files with their base and shows the latest checkpoint and canonical version. It does not update the base. Changed paths remain visible when binary content or a file pair larger than 512 KiB cannot show an inline text diff.
Publication and conflicts
Publication applies a pinned snapshot to canonical files. It does not update other working copies. Publishing a copy's latest checkpoint can advance that copy's base while preserving edits made after the checkpoint. New default copies start from current canonical state, or from the promoted source when Git manages the workspace.
Publication requires the expected canonical version to be current. A non-Git checkpoint must also have the current canonical state as its base; supplying a newer expected version cannot bypass that check. A base update can merge non-overlapping text changes, but unresolved conflicts leave the working files and base unchanged. Restoring a checkpoint restores its original base and files.
Review the complete diff and pause other writers before capture or publication. A single file replacement is atomic, but publication across files is not: failure can leave some canonical files changed without selecting the published version. Inspect the actual files, refresh canonical state and reconcile the difference before retrying. Do not retry a stale or failed publication blindly.
Git-backed source
GitHub and Bitbucket integrations are available to all customers; connecting a repository requires permission to manage workspace settings. Sync context with Git owns the connection, review and CI procedure. Get the Querio CLI; command syntax is in the CLI reference.
- Git upload selects committed bytes with repository-relative
[context].includeand[context].excludepatterns; exclusions win.[context].rootlocates context but does not limit upload selection. - Import records the supplied repository, commit and configuration identity. The file store does not fetch the repository or verify approval or commit ancestry. Import alone does not publish.
- A Git-backed working copy keeps its original source base. Open a pull request through the connected provider, merge it and let CI sync the resulting commit. Patch export is available for manual workflows. It cannot be rebased onto a different source in Querio.
- A Git-backed branch is marked Behind when its base snapshot differs from the currently promoted Git source snapshot. Editing the branch or uploading a version without promoting it does not make it behind. Promoting a newly imported snapshot can mark older branches behind even when the Git commit is unchanged. Non-Git branches compare their base with the current canonical version.
- Promoting an imported Git version removes previously Git-managed files absent from the new source, preserves unrelated canonical files and rejects conflicting unmanaged paths. Existing working copies remain unchanged.
- Once Git manages canonical source, a non-Git snapshot cannot replace it. A Git working-copy checkpoint is not an imported commit eligible for direct promotion.
Prepare the first sync
Start with the files already in your Querio workspace. The first sync lets Git take over those files when their contents match exactly.
- Connect Querio CLI to the existing workspace.
- From your local repository, list the workspace files with
querio files list . --json. List each context directory too; listing is one directory at a time. If a response includes a cursor, use--cursorto retrieve the next page. - Download
querio.tomland every context file your team needs, preserving their workspace-relative paths. These can include datasource catalogs and knowledge, memory and skills. - Commit the downloaded files unchanged and configure your provider's CI workflow with the repository identity. Run the first sync before editing any downloaded file.
For example, to retrieve the existing configuration and memory file:
querio files get querio.toml > querio.toml
mkdir -p memory
querio files get memory/MEMORY.md > memory/MEMORY.mdUse the actual memory path from your workspace and retrieve the other context files in the same way. These commands download individual files; the CLI has no recursive download command. Check that each download succeeds before committing it.
Keep querio.toml at the repository root and included in its own sync selection. If it does not contain a repository identity, supply the identity through the CI workflow rather than changing the file before the first sync.
First-sync conflicts
An incoming file that differs from an existing file Querio has not yet adopted from Git is rejected. This includes the querio.toml created with the workspace.
Retrieve the existing file with querio files get, commit it unchanged at the same path and run CI again. Once that sync succeeds, make your intended edit through a pull request. Deleting the existing configuration is not part of setup.
Context inside a repository folder
You can keep context under a folder such as querio/. The root-level querio.toml must point to that folder and select its files:
[context]
root = "querio/"
include = ["querio.toml", "querio/**"]This layout places memory at querio/memory/MEMORY.md, skills at querio/skills/ and datasource context at querio/datasources/. The configuration remains at the repository root.
root tells Querio where to find context. include selects what CI sends. New Git-backed branches contain only the synced files, so both the configuration and the context files must be selected. If querio.toml is omitted, the conversation defaults to looking for context at the workspace root.
Preserve your existing layout for the first sync. Make a folder move and its matching configuration change together in a later pull request. See Context files for supported paths and loading rules.
Patch, pull request and publication
| Action | Effect |
|---|---|
| Patch export | Captures a checkpoint and exports explicitly selected changed paths as a Git patch. It does not approve, merge or publish. Binary files, executable files and supported symlinks are preserved; empty directories are not Git patch entries. |
| Connected Git provider promotion | With GitHub or Bitbucket, publishing a changeset opens a pull request proposing its entire file tree on top of the default branch, even without a prior Git import. Repository files absent from that tree are deleted in the proposed commit. Opening a PR does not change canonical files. Merge and subsequent import/promotion are separate steps. |
| Promotion of an imported version | Publishes that imported Git source to canonical files, subject to the expected canonical version and source-ownership checks. |
| Working-copy promotion without a Git connection | Publishes the whole checkpoint to canonical. There is no partial publication. |
File operations
Canonical operations use /api/v3/files/*. Environment operations use /api/v3/environments/{environment_id}/files/* and require an active session bound to that environment, with matching workspace and session headers. Changeset file operations select the working copy explicitly. A session header on a canonical request does not change its target. See the API reference for request shapes.
| Operation | Contract |
|---|---|
| Stat | Returns path, type, size, timestamps in milliseconds and an opaque revision. |
| List | Returns one directory page, default 200 entries, maximum 1,000. Set recursive=true to include descendants with workspace-relative paths; directory symlinks are not traversed. Continue with its cursor using the same directory and recursive setting. Reserved paths remain hidden. An ordinary listing is not a frozen snapshot. |
| Read | Returns raw bytes as application/octet-stream and a quoted revision in ETag. Optional If-Match checks that revision. |
| Write | Accepts raw bytes, or a JSON content envelope for canonical writes, with explicit create or replace intent. The parent directory must exist. Staging prevents readers from seeing a partial upload. |
| Create directory | Creates the named directory, without creating missing parents. |
| Remove | Requires If-Match. A nonempty directory also needs recursive: true. The workspace root cannot be removed. |
| Rename or move | Requires source If-Match and explicit overwrite intent. Ancestor/descendant moves, different destination types and replacement of nonempty directories are rejected. |
| Events | Reports live change batches. There is no durable replay cursor; refresh the listing after reconnecting. |
Write intent and revisions
Choose one write form. Omitting both revision headers and query flags returns 428 with instructions for creating or replacing a file. If-Match: * never creates a file: a missing target returns 404. An empty If-Match value is invalid and returns 400.
| Form | Result |
|---|---|
If-None-Match: * | Create only; reject an existing file. |
If-Match: "REVISION" | Replace only if the file still has that revision. Use the server's quoted, lowercase 64-character token. |
If-Match: * | Replace an existing file without comparing revisions. |
Query flags create and overwrite, each true or false | Allow creation, replacement or both. An omitted flag is false. These flags do not compare revisions. |
Do not combine flags with revision headers. Remove and rename also accept If-Match: * for an unconditional operation. Conditions apply to the named entry, not a multi-file transaction. If a response is lost, read the current state before repeating the mutation.
Filesystem errors return domain messages such as Path not found, Path already exists, Expected a file, or Expected a directory, without exposing server filesystem paths or operating-system error codes.
Limits, reserved paths and permissions
| Boundary | Rule |
|---|---|
| File size | Reads, writes and version capture are limited to 100 MiB per file. |
| Encoding | Reads return raw bytes. For raw writes, use application/octet-stream, including for JSON files. Canonical writes also accept application/json with encoding (utf8 or canonical padded base64) and string content; the body and decoded file each have a 100 MiB limit. Git import accepts an uncompressed application/x-tar archive with binary file contents and .querio-source.json metadata; the archive is limited to 64 MiB. |
| Paths | Use workspace-relative paths. Absolute paths, .. traversal and resolved paths outside the workspace are rejected. The root cannot be mutated. |
| Reserved paths | File APIs hide .git and .querio components, .gitignore by default, and names ending in .querio-tmp. Other dotfiles are not automatically hidden. |
| Snapshots | Preserve regular files, executable bits, in-scope relative symlinks and empty directories. Ownership, ACLs, timestamps and other POSIX permission bits are not versioned. Unsafe symlinks and special files are rejected. |
| Git exclusions | .git and root .querio runtime state are excluded from snapshots. .gitignore is preserved by import/export; its patterns do not exclude snapshot content. |
Raw file writes cannot create or write through symbolic links. They also do not turn data files into queryable tables; use Upload files for analysis for ingestion and result checks.
File reads, writes, deletion, rename and directory creation use separate workspace file permissions. Promotion requires write and delete permission; working-copy promotion also requires read permission. Choosing a workspace, environment or changeset does not grant file access. Datasource query permissions are separate; see Roles.
| Status | Typical cause |
|---|---|
400 | Invalid path, header/flag combination, rename or directory operation. |
403 | Missing permission. |
404 | Missing or hidden path, changeset/version, or active environment/session. |
409 | Existing create-only destination, stale canonical version, attached working copy, or changesets requested in canonical mode. |
412 | File revision changed. Read and review the current file before writing again. |
413 | File or encoded transfer exceeds its limit. |
422 | Invalid Git transfer or patch selection. |
428 | Required file mutation condition is missing. |
Operation history records successful version operations and supplied attribution. It does not establish who wrote each byte or provide a tamper-proof audit log. Closing compute does not delete version history; automatic reclamation of retained version objects is not implemented.
Last updated on November 18, 2026