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
31 changes: 21 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ the clipboard only, with icon buttons named in their tooltips
Chat offers the session's model read and list tools; when the workspace
also enables `read` and `write`, six file-write tools (exact edit, multi-edit,
create, rename, delete, and directory creation); and, when it also enables `execute`, `read`, and
`write` and at least one toolchain profile is recorded for the running
platform, one command tool whose `profile` parameter lists those profiles. A
command that names another profile is answered with `profile_not_recorded`
before any approval is requested
`write` and at least one toolchain profile of the running platform is
assigned to the workspace, one command tool whose `profile` parameter lists
those profiles. A command that names another profile is answered with
`profile_not_recorded` before any approval is requested
([ADR-0100](docs/adr/0100-list-the-recorded-toolchain-profiles-in-the-command-tool.md)).
A workspace runs only the profiles assigned to it, through the trusted CLI
`workspace profile-assign` or a switch on its page in the `settings` window.
On Windows assigning is the operator's consent to grant the workspace's
AppContainer read and execute on the profile's folders that this account can
change, after a confirmation that names them; registering a workspace grants
its folder read and write; and unassigning, removing a profile, or
unregistering revokes the grants no longer needed. Existing profiles start
assigned to no workspace
([ADR-0107](docs/adr/0107-assign-toolchain-profiles-to-workspaces-and-grant-on-assignment.md)).
Each workspace preference except `model_tools` is
`deny`, `prompt`, or `allow`, and each file-write tool has a limit that can
only narrow `write` ([ADR-0063](docs/adr/0063-deny-prompt-or-allow-each-preference-wait-for-approvals-in-the-turn-and-journal-model-actions.md)).
Expand Down Expand Up @@ -181,8 +190,9 @@ skills for one turn ([ADR-0059](docs/adr/0059-configure-trusted-settings-in-an-i
The `settings` window changes the development root, workspace registrations,
workspace preferences, and package cache roots, and lists workspaces under
**Workspaces** in its navigation. It can unregister a workspace, which keeps
its folder, files, and sessions and is refused while a container grant names
it ([ADR-0081](docs/adr/0081-unregister-a-workspace.md)). Rust opens a native folder
its folder, files, and sessions, revokes its container grants first, and
stays registered if one cannot be revoked
([ADR-0081](docs/adr/0081-unregister-a-workspace.md), ADR-0107). Rust opens a native folder
dialog for each folder and a native confirmation before each change that
widens access, and creates an empty settings store on first use
([ADR-0060](docs/adr/0060-change-workspace-settings-from-the-desktop-with-native-dialogs.md)).
Expand Down Expand Up @@ -234,10 +244,11 @@ reads install folders, the operator's `PATH`, and installer-written files,
runs no program, and never reads repository configuration such as
`rust-toolchain.toml`. The operator selects
proposals, and one native confirmation per batch records them through the
core add call on every platform. On Windows a separate command, after its
own confirmation, grants a workspace's container the folders it needs that
this account can change; discovery grants nothing
([ADR-0103](docs/adr/0103-generate-toolchain-profiles-from-installed-toolchains.md)).
core add call on every platform. With a workspace chosen, the same
confirmation also assigns the profiles to it and, on Windows, grants its
container the folders they need that this account can change; discovery
itself grants nothing
([ADR-0103](docs/adr/0103-generate-toolchain-profiles-from-installed-toolchains.md), ADR-0107).
Other credentials, apart from ChatGPT sign-in and sign-out, still change, and packages are fetched and programs run,
only through the trusted CLI. The desktop shell has no working terminal, diff
view, installer, or recovery interface. CI publishes unsigned archives of the newest tested merge to
Expand Down
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,81 @@ Changes are recorded here before a release version is assigned.

### Changed

- Version 0.70.0 also assigns toolchain profiles to workspaces and grants a
profile's folders when it is assigned (ADR-0107). A workspace now runs only
the profiles assigned to it: the runner refuses any other recorded profile
before anything starts, the run watcher withdraws a run whose profile is
unassigned, and the model command tool is offered only while a profile of
this platform is assigned, listing only those (tool schema 0.10.0; the
`profile_not_recorded` code is kept). Two control events,
`profile_assigned` and `profile_unassigned`, record the change, and an older
build refuses them. On Windows assigning is the consent to grant: core plans
read-execute grants for the profile's roots that the workspace's
AppContainer cannot read yet, the operator confirms the plan, and core
refuses the assignment if the plan changed, then applies the grants and
records the assignment last, granting only a folder that is still the
confirmed directory. An assignment whose grant fails, or that cannot be
recorded, revokes the grants it made that no assigned profile needs,
waits for the runs those revocations withdrew, and reports each grant it
could not revoke, and a
workspace with a pending or revoking grant is refused a plan. Folders that
need an administrator, or whose access could not be read, are listed and
not granted. Registering a
workspace grants its container read-write on its folder, and registering an
existing folder again grants it if that grant is missing. Unassigning or
removing a profile revokes the workspace's read-execute grants on its roots,
or on a folder that holds one, that no other assigned profile and not the
package cache root needs, never the workspace folder's grant; a grant on a
folder that holds a still-assigned profile's root, which got no grant of
its own, is kept until that profile is unassigned too, while no other
active grant covers that root. A moved or removed root is matched by its
recorded path, so it neither releases the grant early nor keeps it after
its profile goes. Every grant is
attempted, and each one not revoked is named. Unregistering revokes every
grant of the workspace first and leaves it registered if a revocation
fails or its removal cannot be recorded. Each caller waits only for the
runs of the workspaces whose grants it revoked. The
trusted CLI adds `workspace profile-assign` and `workspace
profile-unassign`, and `register`, `unregister`, and `profile-remove` report
what they granted or revoked. The desktop `settings` window shows one
switch per profile on each workspace page, through
`settings_assign_toolchain_profile` and
`settings_unassign_toolchain_profile`, each after a native confirmation that
names the folders it grants or the grants it revokes. Adding discovered
profiles with a workspace chosen also assigns them in the same
confirmation, the workspace choice is shown on every platform, and
`settings_grant_discovered_roots` is removed, so the `settings` window has
33 commands and the shell 67. Existing profiles start assigned to no
workspace: assign each workspace's profiles once. On Windows a profile whose
folders are already granted grants nothing new. Granting at run time was
drafted and dropped before it was committed. Windows CLI and desktop
service tests apply and revoke real grants on temporary folders; the
desktop shell's native dialogs were not driven.

- Version 0.70.0 makes a Windows run refused for a missing container grant
say which grant is missing (ADR-0106). The refusal used to be one fixed
sentence, "a confinement path is not granted to the container at its
listed level", for every path, so neither the operator nor a model relaying
the command tool's result could tell which folder to grant. An operator's
`rust` profile had four roots; the rustup toolchain under their own folder
had no grant, and the other three are readable by every application
package. Finding it took reading each root's access-control list by hand.
The Windows runner now returns `ProcessError::Ungranted` with the refused
entry, its path, the access it needs, and the access the container has.
Core matches the path against the paths it listed and returns
`RunError::NotGranted`, whose text names the role: root N of toolchain
profile `NAME` (numbered from 1 as `profile-show` and the `settings`
window list them), the workspace's package cache root, the workspace
folder, or the program file. The text gives the needed and held access and
says where to grant it, but never includes the path. The command tool sends
that text to the model, and a path under the user's folder can name the
account. The trusted CLI's `run` error keeps the same message and adds
`refused_path` with the role, `needed`, `granted`, and the path as `path`,
`path_display`, and `path_native`. The checked paths, their order, the
levels, the `not_started` record, and the tool's `command_failed` code are
unchanged. Windows platform and CLI tests apply real grants to temporary
folders; the desktop shell was not driven.

- Version 0.69.0 makes the read-write container grant say what it does
(ADR-0104). In the desktop `settings` window, **Grant a folder** with read
and write no longer opens a folder dialog: core accepts that access only on
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.69.0"
version = "0.70.0"
edition = "2024"
rust-version = "1.99.1"
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions crates/omgcode-app/src/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ pub use self::processes::{
use self::review_tokens::ReviewTokens;
pub use self::settings_changes::{Confirmation, FolderPurpose, SettingsPrompt};
pub use self::settings_discovery::{
DiscoveredGrantsRequest, DiscoveredProfilesRequest, MAX_SELECTED_PROPOSALS, ProposedRootView,
ProposedVariableView, ToolchainDiscovery, ToolchainDiscoveryRequest, ToolchainProposalView,
discovery_host,
DiscoveredProfilesRequest, MAX_SELECTED_PROPOSALS, ProposedRootView, ProposedVariableView,
ToolchainDiscovery, ToolchainDiscoveryRequest, ToolchainProposalView, discovery_host,
};
pub use self::settings_execution::{
ContainerAccessChoice, ContainerGrantRequest, ContainerRevokeRequest, EnvironmentEntry,
PackageProfileAddRequest, ProfileRemoveRequest, ToolchainProfileAddRequest,
PackageProfileAddRequest, ProfileAssignmentRequest, ProfileRemoveRequest,
ToolchainProfileAddRequest,
};
pub use self::settings_skills::{SkillChoice, SkillRemoveRequest, SkillStateRequest};
pub use self::settings_web_hosts::WebHostChangeRequest;
Expand Down
12 changes: 12 additions & 0 deletions crates/omgcode-app/src/desktop/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ pub(super) fn overview_of(inner: &Inner, store: ControlStore) -> SettingsOvervie
.map(|pattern| display_safe_line(pattern.as_str()))
.collect(),
write_tools: permissions.write_tools,
profiles: store
.assigned_profiles(workspace.id())
.iter()
.filter_map(|id| {
store
.profiles()
.iter()
.find(|status| status.profile().id() == *id)
.map(|status| status.profile().name().to_owned())
})
.collect(),
package_cache_root: store.package_cache_root_display(workspace.id()),
instructions: workspace_instructions_view(
&inner.data_root,
Expand Down Expand Up @@ -203,6 +214,7 @@ pub(super) fn overview_of(inner: &Inner, store: ControlStore) -> SettingsOvervie
connection,
provider_profiles,
toolchain_profiles,
profile_platform: ProfilePlatform::current().map(platform_name),
package_profiles,
container_grants,
container_grants_supported: omgcode_core::control::CONTAINER_GRANTS_SUPPORTED,
Expand Down
Loading