Skip to main content

records_for_agent

Function records_for_agent 

Source
fn records_for_agent(
    dir: &Path,
    agent_id: &str,
    scope: RecordScope,
) -> Result<Vec<PathBuf>, RegistryError>
Expand description

Paths of the *.json files under dir whose record belongs to agent_id — by file key (instance id) or by definition_id. A missing directory yields nothing (the retired/ tree is created on open, but a caller may point at a tree that predates it).

Unparseable files are matched on their file key alone and otherwise skipped, the same way Registry::list_active skips them: a record this can’t read is also one that can never surface as a row, and removing it on a guess would destroy whatever newer-schema binary authored it. The file-key match is kept so an explicitly-addressed delete still behaves like Registry::hard_delete did.