Skip to main content

classify_owner

Function classify_owner 

Source
fn classify_owner(rel_path: &str, content: &str) -> InstructionOwner
Expand description

Who owns this file — by marker, or by construction.

Most files are classified by their managed marker, which is the honest test for a path AgentMux may or may not have written.

.claude/AGENTMUX_MEMORY.md is the exception, and it has to be: AgentMux writes that file’s content raw, with no marker (write_claude_md_respecting_ownership in agent_config.rs), because it is not a file anyone else was ever going to own — that function’s doc comment calls it “100% AgentMux’s own content”. Testing it by marker returns foreign every time, which is backwards for the one field that decides whether a file is ours to touch (#3156).

Classifying it by path is not a guess: AgentMux creates that exact path, regenerates it on every launch, and the ownership protection exists precisely because the other file at that location is not ours.