Skip to main content

Module folder_overlap

Module folder_overlap 

Source
Expand description

A host agent whose folder a container agent can write.

A container agent changes the files of its workspace and of every writable volume. A host agent that works in one of those folders, or in a folder that holds one, runs what the container agent left there, as the person. Where a host agent is opened or created, or a container agent’s workspace or volumes are saved, so that the two share a folder, the person is asked and the choice is kept for that pair of agents. Nothing but the person’s window records the choice (accept); a caller that is not the person is refused with refusal.

A choice is a file, and a file is not proof that the person made it: each go-ahead is also recorded as a row of the audit log made by the window, written before the file, and a choice file with no such row does not count (accepted): the pair asks again and says why (Overlap::untrusted).

The folders are those of the two agents’ definitions: a container agent’s workspace and its writable host volumes (container::mounts::writable), a host agent’s working folder.

Structs§

Overlap
A host agent and a container agent whose folders overlap.

Constants§

GO_AHEAD_ACTION
The audit action that records the person’s go-ahead for a pair.
OPEN_REFUSAL_CODE
What an agent.open refusal for a shared folder starts with, so the window knows to ask the person and try again.

Functions§

accept
Keeps the person’s choice for the pair, naming both agents by their ids. Only the person’s window calls this (app_api::folder_overlap).
accept_as
accept, with the agents’ names (id, name) for the record. The audit row is written first and the file after, so a file is never kept without the record of who made it.
accepted
Whether the person has gone ahead with this host agent and this container agent sharing a folder: a choice is kept and the audit log records that the person made it.
check
Err with refusal when def, as saved or opened, shares a folder with an agent of the other kind that the person has not gone ahead with.
check_open
check for an agent being opened, in open_folder, with the refusal marked OPEN_REFUSAL_CODE. A container agent is not refused here: it is asked when its own folders are saved.
folders_changed
Whether a save of new over old changes a folder an agent works in or can write.
for_host_in
The container agents whose writable folders overlap folder, the folder the host agent host works in.
forget_agent
Forgets every choice the person made for a pair that includes agent id: the agent is deleted.
is_a_pair
Whether host_id names a host agent and container_id a container agent.
of
The overlaps of def as it is saved or opened: for a host agent, with the container agents; for a container agent, with the host agents. host_folder is the folder a host agent opens in when it is not the one its definition names (a blank one opens in the agent’s own folder).
open_folder
The folder agent.open runs a host agent in, expanded: the one it names, else its own folder.
refusal
What the person is told, and what a caller that is not the person is refused with: both agents, what the shared folder means, and what to do instead.
row_note
The note of an audit row about a pair: the action and the two agents’ ids, which find the row (a name changes), then the names, for whoever reads the Audit view.
unchosen
The overlaps the person has not gone ahead with.
untrusted
Whether a choice is kept for the pair that the audit log has no record of: it does not count.
waiting_reason
Why the start of host agent def waits, for an agent that asks what its state is: the pairs it shares a folder with that the person has not gone ahead with. None when nothing waits.