Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ without an installer, has run only on Windows, and gives the webview no authorit
Rust side authorizes every command and the trusted CLI remains. Follow the
[desktop interface](docs/desktop-interface.md) contract.
Chat offers the local LM Studio model read and list tools; when the workspace
also enables `read` and `write`, one exact-edit tool; and, when it also enables
`execute`, `read`, and `write`, one command tool. The edit and command tools
each require a trusted single-use approval. The edit tool replaces one exact
text occurrence in an existing file through checkpointed apply and needs the
operator's writers-stopped acknowledgement. No model create, delete, rename,
network, Git, or MCP tool exists. Chat offers tools only for a
also enables `read` and `write`, five file-write tools (exact edit, multi-edit,
create, rename, and delete); and, when it also enables `execute`, `read`, and
`write`, one command tool. The file-write and command tools each require a
trusted single-use approval. The edit tool replaces one exact text occurrence
in an existing file, and the multi-edit tool several exact occurrences in one
existing file, each through checkpointed apply. The create tool makes one new
file through the exclusive create, without a checkpoint. The rename tool moves
one regular file to a name that does not exist and never replaces an entry,
without a checkpoint. The delete tool removes one regular file of at most 1 MiB
after a durable checkpoint of its bytes, which the trusted CLI can restore. All
five need the operator's writers-stopped acknowledgement. No model network,
Git, or MCP tool exists. Chat offers tools only for a
workspace whose `model_tools` preference is enabled. There are no unapproved
model writes, other provider adapters, or unreviewed model-callable process
execution. The
Expand Down
155 changes: 155 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,161 @@ Changes are recorded here before a release version is assigned.

### Added

- Version 0.38.0 adds two approval-gated model file tools, rename and delete
(Phase C19). See ADR-0055 and the
[rename and delete routes](docs/file-access.md#model-rename-and-delete-routes-adr-0055).
Until now the model could neither move nor remove a file. It is on branch
`codex/model-file-tools`, stacked on `codex/checkpoint-ledger-compaction`; it
is not merged. It adds no dependency.
- **Tools:** `workspace_rename_file` moves one regular file to a name that
does not exist and never replaces an entry. `workspace_delete_file` removes
one regular file after a durable checkpoint of its bytes. Both are advertised
and dispatched only under live `model_tools`, `read`, and `write`, with the
edit tool's per-call recheck and `edit_disabled` denial, in the order read,
list, edit, multi-edit, create, rename, delete, command. Tool schema 0.5.0;
0.2.0 to 0.4.0 sessions still replay. Eight of eight tool-name slots are used,
and no cap rose.
- **Approvals:** both reuse the `file_write` operation, so the
writers-stopped acknowledgement is required and no enum, wire type, or
TypeScript union changed. Each has its own digest domain tag
(`omgcode-file-rename-v1`, `omgcode-file-delete-v1`), so an approval for any
of the five file-write tools is never consumed by another. Before an
approval is recorded, a live audited read supplies the source's exact size
and SHA-256; a source over 1 MiB is the recoverable `edit_too_large`, and
non-UTF-8 content is accepted. A rename also needs an absent destination
(`file_exists`) and an existing parent (`not_found`).
- **Rename:** a new `FileBroker::rename_file` records a `rename_file`
file-operation intent that names both the source and the destination, then
calls the platform's `rename_no_replace`. The source is pinned, its bytes
are verified through the pinned handle, and directories, links, junctions,
hard-linked files, and other filesystems are refused. Linux uses
`renameat2` with `RENAME_NOREPLACE` and compares the name with the pinned
inode before and after. Windows holds a DELETE handle that denies other
writers and deleters and renames with POSIX semantics and no replace flag.
An error after the native call is uncertain, leaves the audit record pending,
and is never retried. Rename is not checkpointed.
- **Delete:** a new `FileBroker::apply_removal` follows the checkpointed
apply without a stage: the same binding, permission, admission, and
qualified-filesystem gates, a durable checkpoint, a recheck, commit intent,
one native removal, and the same uncertain-outcome recovery. Linux unlinks by
name and reports a swapped name as uncertain from the pinned inode's link
count; Windows deletes through the verified handle. Neither is power-loss
qualified.
- **Ledger:** operation records gain an optional `kind` of `replace` or
`remove`, omitted for `replace` so every earlier ledger, carried record, and
manifest stays byte-identical. A `remove` proposes exactly the empty artifact,
has no stage, and goes from `checkpoint_prepared` to `commit_intended`.
Replay refuses a `remove` that proposes bytes, has a stage record, or carries
a stage identity; compaction carries `kind`. Older binaries refuse a ledger
that holds a `remove` record. A `remove` entry's original need not be UTF-8.
- **Restore:** trusted `file restore --removed` (and
`FileBroker::restore_removed_file`) recreates a deleted file through the
audited exclusive create when its name is free, records no new operation, and
does not restore its mode, owner, access list, or timestamps. A replacement
checkpoint and a removal checkpoint each refuse the other route.
- **Review:** the desktop approvals window reproduces the digest from any of the
five file-write tools (at most eight distinct candidates) and shows `From`,
`To`, `Size`, and `SHA-256` for a rename and `File`, `Size`, and `SHA-256`
for a delete. A rename review is stale once its source changed or its
destination exists; a delete review is stale once the file changed or is gone.
- **Limits:** neither tool detects a concurrent writer, and neither is
power-loss qualified. The context estimate for tool definitions rises from
5 KiB to 6 KiB (the eight definitions serialize to 5,968 bytes). The Linux
paths are not qualified on a Linux host. A bounded read that exceeds its
limit now carries a typed marker, `is_oversize_entry`, so a source over
1 MiB is told from other invalid objects; the error kind is unchanged.
- **Tests:** new platform tests cover the no-replace rename (existing target,
directories, junctions, hard links, changed source, a swap the sharing mode
prevents, and faults before and after the call) and the verified-handle
removal (swapped name refused, single attempt, faults). New core tests cover
the `remove` ledger rules and refusals, removal and restore through the
broker, the audit record, strict parsing, the approval flow, cross-tool
non-consumption, refusals, live-permission gating, output-fit refusal, schema
0.4.0 replay, the eight-tool list, and review fields and staleness. New app,
CLI, and frontend tests drive both tools through the desktop service, the
operator flow, and `file restore --removed`.

- Version 0.37.0 adds registry credentials for the trusted `packages fetch`
(Phase C20). See ADR-0056 and
[registry credentials](docs/execution.md#registry-credentials). Until now
fetch sent no credentials, so a private registry could not be used. It is on
branch `codex/model-file-tools`, stacked on
`codex/checkpoint-ledger-compaction`; it is not merged. It adds no
dependency.
- **Binding:** `workspace package-credential-set <profile> --origin <origin>
--auth bearer|basic --revision <n>` reads one secret from piped input only
and binds it to one declared origin of a package-network profile.
`package-credential-remove` unbinds and deletes it, and removing the
profile unbinds every credential in the same event. Secrets are stored
through the existing DPAPI or Secret Service store; the control journal
records only the opaque ID and backend. Bearer secrets are visible ASCII
without spaces; Basic secrets need a non-empty user before the first `:`.
- **Fetch:** the request carries a sensitive `Authorization` header only when
the matched origin, chosen by the longest path prefix, has a binding.
Redirects stay refused, so the header cannot follow one. A bound secret
that cannot be read refuses the fetch before a start record, and nothing is
sent. The start record and report carry an optional `credential_id`.
- **Limits:** the secret still crosses the network to the declared origin,
which may log it. A journal with the new events cannot be read by an older
version. Only loopback HTTP is tested; live HTTPS registries are not.
- **Tests:** header shape for both schemes, no header on an unbound origin,
no request when the secret is missing, no credential on a refused
redirect, journal replay and refusals, store ordering, base64 vectors, and
a CLI workflow that scans every data file and output for the secret.
- Version 0.36.0 adds two approval-gated model file tools, multi-edit and create
(Phase C18). See ADR-0054 and the
[multi-edit and create routes](docs/file-access.md#model-multi-edit-and-create-routes-adr-0054).
Until now the model could change a file only one exact replacement at a time,
each needing its own approval and checkpoint, and could not create a file.
It is on branch `codex/model-file-tools`, stacked on
`codex/checkpoint-ledger-compaction`; it is not merged. It adds no dependency.
- **Tools:** `workspace_multi_edit_file` applies one to 16 exact replacements
to one existing file under one approval and one checkpointed apply.
`workspace_create_file` creates one new UTF-8 file through the broker's
exclusive create. Both are advertised and dispatched only under live
`model_tools`, `read`, and `write`, with the edit tool's per-call recheck
and `edit_disabled` denial. Tool schema 0.4.0; 0.2.0 and 0.3.0 sessions
still replay. Six of the eight tool-name slots are used, and no cap rose.
- **Approvals:** both reuse the `file_write` operation, so the
writers-stopped acknowledgement is required and no enum, wire type, or
TypeScript union changed. Each has its own digest domain tag
(`omgcode-file-multi-edit-v1`, `omgcode-file-create-v1`), so an approval for
`workspace_edit_file`, multi-edit, or create is never consumed by another
tool. The approval flow itself is one shared gate; the edit tool's digest,
codes, and messages are unchanged.
- **Multi-edit rules:** every `old_text` must occur exactly once in the
original live bytes and the matches may not overlap (`edit_overlap`);
touching matches are allowed. The messages name the 1-based edit index and
never file text. The result must differ and fit 1 MiB.
- **Create rules:** before an approval is recorded, a live audited read must
find the path absent (`file_exists`) and a listing must find the parent
(`not_found`). A file that another writer creates after approval is never
replaced; the call returns `file_exists` and the approval stays spent.
Creation is not checkpointed. An uncertain creation is a terminal failure
that leaves the pending file-operation record for the trusted
acknowledgement.
- **Review:** the desktop approvals window reproduces the digest from any of
the three tools (at most eight distinct candidates in total) and shows
numbered `Old text N` and `New text N` fields for a multi-edit and
`File`, `Size`, `SHA-256`, and `Content` for a create. A create review is
stale once its path exists. The approvals label reads "File change".
- **Limits:** the 4 KiB argument cap bounds create content and multi-edit
size. There is no multi-file atomicity and no concurrent-writer detection,
and neither tool is power-loss qualified. No model delete or rename tool
exists. The schema estimate for context accounting rises from 4 KiB to
5 KiB (the six definitions serialize to 4,546 bytes).
- **Windows missing paths:** the platform now exports `is_missing_entry`,
which recognises the native not-found status Windows keeps inside an
`ErrorKind::Other` error. A missing path in a read, list, edit, or create
call is now the recoverable `not_found` on Windows, as it already was on
Linux, instead of a terminal `native_error`.
- **Tests:** new core tests cover strict argument parsing, the approval flow,
cross-tool non-consumption, refusals, live-permission gating, output-fit
refusal, summaries, and schema 0.3.0 replay. New review tests cover exact
fields, staleness, the shared candidate bound, and hostile text. New app
and CLI tests drive both tools through the desktop service and the operator
flow. New frontend tests cover the review fields and the mock detail.

- Version 0.35.0 compacts the checkpoint ledger in place and raises its bounds
(Phase A5). See ADR-0053 and
[ledger compaction](docs/file-access.md#implemented-ledger-compaction-phase-a5).
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "3"
members = ["crates/omgcode-core", "crates/omgcode-cli", "crates/omgcode-platform", "crates/omgcode-app", "crates/omgcode-desktop"]

[workspace.package]
version = "0.35.0"
version = "0.38.0"
edition = "2024"
rust-version = "1.99.1"
license = "Apache-2.0"
Expand Down
Loading