Skip to main content

Module browser_pane_records

Module browser_pane_records 

Source
Expand description

The browser panes an agent drives, and the sites a limited one may go to, kept across an srv restart (docs/specs/SPEC_BROWSER_PANE_RECORDS_SURVIVE_RESTART_2026_11_04.md).

Who owns a pane (browser_owner) and which sites its chain is limited to (browser_allowlist) are srvโ€™s own records, held in memory. Without a copy on disk a restart leaves a limited, agent-owned pane unlimited and unowned while its block still shows both. A file in the config folder holds the copy: written whenever either record changes, read once at startup.

The file is keyed by block id, and a duplicated pane is a new block with a new id, so a copy of a pane never inherits anything. A record is taken back only for a block that is still a browser pane whose browser:owner_agent (which only srv writes, and a personโ€™s Take over clears) names the same agent: the file alone grants nothing.

Structsยง

Records ๐Ÿ”’

Constantsยง

FILE_NAME ๐Ÿ”’
The file the records are kept in, in the config folder.

Functionsยง

current ๐Ÿ”’
What srv holds now.
path ๐Ÿ”’
restore ๐Ÿ”’
Read the file and put back what is still true. Called once at startup, before anything changes the records, so the first save doesnโ€™t replace the file with an empty copy.
save ๐Ÿ”’
Write the records to the file, unless they are what the last write left there.
still_true ๐Ÿ”’
The part of saved that is still true: a pane that is still there as a browser pane its agent still drives, and the limits of the panes that remain. block_of reads a block by id.