Skip to content

feat: model multi-edit, create, rename and delete tools and registry credentials (C18-C20) - #40

Open
James-Chapman wants to merge 5 commits into
codex/checkpoint-ledger-compactionfrom
codex/model-file-tools
Open

James-Chapman wants to merge 5 commits into
codex/checkpoint-ledger-compactionfrom
codex/model-file-tools

Conversation

@James-Chapman

Copy link
Copy Markdown
Contributor

Summary

Phase C18 to C20: four new approval-gated model file tools, and registry credentials for packages fetch. Version 0.38.0.

Stacked on codex/checkpoint-ledger-compaction. There are three commits, one per phase, and each can be reviewed on its own.

What changed

  • C18 (795d8ce, 0.36.0, ADR-0054)
    • workspace_multi_edit_file makes 1 to 16 exact replacements in one existing file through one checkpointed apply.
    • workspace_create_file creates a new file exclusively, without a checkpoint.
    • On Windows, a missing path now classifies as the recoverable not_found. This also changes read, list and edit.
  • C20 (f274094, 0.37.0, ADR-0056)
    • New trusted commands workspace package-credential-set and package-credential-remove bind one stored secret, bearer or basic, to one declared origin of a package-network profile.
    • packages fetch sends the secret as a sensitive Authorization header, only to the longest matching origin.
    • Redirects stay refused.
    • If a bound secret can't be read, the fetch is refused before anything is sent or recorded.
    • Journals record only the credential ID.
    • The header buffer reserves its full size up front, so no unwiped copy of the secret is left after a reallocation.
  • C19 (2a8b529, 0.38.0, ADR-0055)
    • workspace_rename_file never replaces an existing name and takes no checkpoint.
      • Linux uses renameat2(RENAME_NOREPLACE) and checks the destination inode afterwards.
      • Windows uses FileRenameInformationEx with POSIX semantics and no replace flag.
    • workspace_delete_file deletes a regular file of up to 1 MiB after a durable checkpoint of its bytes.
      • Windows deletes through the verified handle.
      • Linux uses unlinkat and then requires nlink == 0. Otherwise it reports the outcome as uncertain.
    • Ledger operation records gain an optional kind (replace or remove).
    • The trusted file restore --removed recreates a deleted file with an exclusive create.
  • Shared by all four file tools
    • They reuse the file_write approval and the writers-stopped gate, each under its own digest domain.
    • The tool schema is 0.5.0. All 8 tool slots are now used.
  • The docs, CHANGELOG, implementation plan and ADR index are updated.

Why it changed

These are the remaining Phase C items chosen for this round. The model could make only one exact edit per approval and could not create, rename or delete files. Package fetches could not reach registries that need authentication.

Tests

  • Windows: fmt and clippy are clean. 1,095 workspace tests and 163 frontend tests pass.
  • Linux (WSL, clean clone of 2a8b529): fmt and clippy are clean. 51 suites, 1,092 passed, 0 failed. The native rename and removal tests were confirmed by name.
  • Not covered:
    • live HTTPS registries;
    • running the desktop UI for real;
    • another writer creating the file after a create was approved;
    • power-loss behaviour of the new paths.

Updated

  • Model tools: crates/omgcode-cli/tests/model_tools.rs, crates/omgcode-core/tests/turn_runtime.rs, crates/omgcode-core/tests/approval_review.rs and crates/omgcode-app/tests/desktop_approvals.rs cover the new tools, digests and approval binding.
  • Ledger: crates/omgcode-core/src/files/replacement/tests.rs, crates/omgcode-core/tests/replacement_records.rs, crates/omgcode-cli/tests/checkpoint_lifecycle.rs and crates/omgcode-cli/tests/file_workflow.rs cover remove records and restore of removed files.
  • Windows broker: crates/omgcode-platform/src/broker/windows/replacement/tests.rs covers handle-based removal.
  • Package profiles: crates/omgcode-core/src/control/package/tests.rs and crates/omgcode-core/src/packages/tests.rs cover credential binding and fetch.
  • Frontend: crates/omgcode-desktop/ui/tests/approvals.test.ts and mock.test.ts cover the "File change" approval label.

New

  • crates/omgcode-cli/tests/package_credential_workflow.rs
  • crates/omgcode-core/src/control/package/credential/tests.rs
  • crates/omgcode-core/src/packages/authorization/tests.rs
  • crates/omgcode-core/src/test_support.rs
  • Native Linux rename and removal tests, including the swap and fault cases.

🤖 Generated with Claude Code

James-Chapman and others added 3 commits November 17, 2026 20:36
Add approval-gated workspace_multi_edit_file (1 to 16 exact replacements,
one checkpointed apply) and workspace_create_file (exclusive create, no
checkpoint). Both reuse the file_write approval and writers-stopped gate
under their own digest domains. Tool schema 0.4.0, version 0.36.0, ADR-0054.
Windows missing paths now classify as the recoverable not_found.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bind one stored secret, bearer or basic, to one declared origin of a
package-network profile and send it from the trusted packages fetch as a
sensitive Authorization header, only to the longest matching origin.
A bound secret that cannot be read refuses the fetch before anything is
sent or recorded. Journals record only the opaque credential id.
Phase C20, ADR-0056, version 0.37.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add approval-gated workspace_rename_file (no-replace rename, no checkpoint)
and workspace_delete_file (removal after a durable checkpoint). Both reuse
the file_write approval and writers-stopped gate under their own digest
domains. Operation records gain an optional kind (replace or remove);
trusted file restore --removed recreates a deleted file. Tool schema 0.5.0,
version 0.38.0, ADR-0055. Linux paths are not compiled or run here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ec2ebd7 and 1fc2b7f.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 72

  • AGENTS.md
  • CHANGELOG.md
  • Cargo.toml
  • IMPLEMENTATION_PLAN.md
  • README.md
  • crates/omgcode-app/src/tool_mode.rs
  • crates/omgcode-app/tests/desktop_approvals.rs
  • crates/omgcode-cli/src/control_cli.rs
  • crates/omgcode-cli/src/credential_cli.rs
  • crates/omgcode-cli/src/file_cli.rs
  • crates/omgcode-cli/src/main.rs
  • crates/omgcode-cli/tests/checkpoint_lifecycle.rs
  • crates/omgcode-cli/tests/file_workflow.rs
  • crates/omgcode-cli/tests/model_tools.rs
  • crates/omgcode-cli/tests/package_credential_workflow.rs
  • crates/omgcode-core/src/control.rs
  • crates/omgcode-core/src/control/credential.rs
  • crates/omgcode-core/src/control/package.rs
  • crates/omgcode-core/src/control/package/credential.rs
  • crates/omgcode-core/src/control/package/credential/tests.rs
  • crates/omgcode-core/src/control/package/tests.rs
  • crates/omgcode-core/src/file_audit.rs
  • crates/omgcode-core/src/files.rs
  • crates/omgcode-core/src/files/checkpoint.rs
  • crates/omgcode-core/src/files/replacement.rs
  • crates/omgcode-core/src/files/replacement/tests.rs
  • crates/omgcode-core/src/lib.rs
  • crates/omgcode-core/src/packages.rs
  • crates/omgcode-core/src/packages/authorization.rs
  • crates/omgcode-core/src/packages/authorization/tests.rs
  • crates/omgcode-core/src/packages/tests.rs
  • crates/omgcode-core/src/replacement.rs
  • crates/omgcode-core/src/replacement/manifest.rs
  • crates/omgcode-core/src/replacement/replay.rs
  • crates/omgcode-core/src/replacement/store.rs
  • crates/omgcode-core/src/test_support.rs
  • crates/omgcode-core/src/turn.rs
  • crates/omgcode-core/src/turn/review.rs
  • crates/omgcode-core/tests/approval_review.rs
  • crates/omgcode-core/tests/replacement_records.rs
  • crates/omgcode-core/tests/turn_runtime.rs
  • crates/omgcode-desktop/ui/src/approvals/model.ts
  • crates/omgcode-desktop/ui/src/mock/backend.ts
  • crates/omgcode-desktop/ui/tests/approvals.test.ts
  • crates/omgcode-desktop/ui/tests/mock.test.ts
  • crates/omgcode-platform/src/broker.rs
  • crates/omgcode-platform/src/broker/linux.rs
  • crates/omgcode-platform/src/broker/linux/rename.rs
  • crates/omgcode-platform/src/broker/linux/replacement.rs
  • crates/omgcode-platform/src/broker/windows.rs
  • crates/omgcode-platform/src/broker/windows/rename.rs
  • crates/omgcode-platform/src/broker/windows/replacement.rs
  • crates/omgcode-platform/src/broker/windows/replacement/tests.rs
  • crates/omgcode-platform/src/credentials.rs
  • crates/omgcode-platform/src/private_store/windows.rs
  • docs/README.md
  • docs/adr/0035-fetch-packages-through-a-trusted-allowlisted-cache.md
  • docs/adr/0054-add-multi-edit-and-create-model-file-tools.md
  • docs/adr/0055-add-checkpointed-delete-and-no-replace-rename-model-tools.md
  • docs/adr/0056-send-registry-credentials-to-one-declared-origin.md
  • docs/adr/index.md
  • docs/agent-instructions.md
  • docs/desktop-interface.md
  • docs/development-tools.md
  • docs/development.md
  • docs/execution.md
  • docs/file-access.md
  • docs/platform-support.md
  • docs/security-coding-rules.md
  • docs/session-storage.md
  • docs/testing-standards.md
  • docs/workspace-permissions.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@James-Chapman
James-Chapman added this pull request to stack #41 November 17, 2026 22:28
CodeQL flagged cleartext logging: the validation test loops printed the
secret bytes and the validation result in their failure messages. They
now name only the case index and auth scheme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants