hive-c0re: scrub attribution cookies across background-task modules (#715 batch 6)
This commit is contained in:
parent
50a1eb41cf
commit
d62a9518c0
4 changed files with 25 additions and 28 deletions
|
|
@ -199,8 +199,7 @@ pub fn write_payload(agent: &str, host_path: &Path, message: &str) -> Result<(),
|
|||
/// under. Every agent sees its state at `/agents/<container>/state/`
|
||||
/// (see `lifecycle::set_nspawn_flags`). Auto-file paths use the same
|
||||
/// prefix so the round-trip is symmetric. The manager logical name
|
||||
/// maps to its container name (`hm1nd`) per `lifecycle::MANAGER_NAME` —
|
||||
/// the pre-#604 legacy `/state/` alias is gone.
|
||||
/// maps to its container name (`hm1nd`) per `lifecycle::MANAGER_NAME`.
|
||||
#[must_use]
|
||||
pub fn container_state_prefix(agent: &str) -> String {
|
||||
if agent == hive_sh4re::MANAGER_AGENT {
|
||||
|
|
@ -277,16 +276,15 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn manager_uses_container_name_prefix() {
|
||||
// Post-#604: manager's container view of its state is at
|
||||
// Manager's container view of its state is at
|
||||
// `/agents/<MANAGER_NAME>/state/` (= `/agents/hm1nd/state/`),
|
||||
// same as every other agent — the legacy bare `/state/` mount
|
||||
// was dropped from lifecycle::set_nspawn_flags.
|
||||
// same as every other agent.
|
||||
assert_eq!(container_state_prefix("manager"), "/agents/hm1nd/state/");
|
||||
let p = resolve_host_path("manager", "/agents/hm1nd/state/reminders/x.md").unwrap();
|
||||
// NB: the host path still resolves under `agents/manager/`
|
||||
// (Coordinator::agent_notes_dir takes the broker LOGICAL name).
|
||||
// That's a pre-existing manager-logical-vs-container-name
|
||||
// discrepancy tracked separately in #162; out of scope here.
|
||||
// discrepancy tracked separately; out of scope here.
|
||||
assert_eq!(
|
||||
p,
|
||||
PathBuf::from("/var/lib/hyperhive/agents/manager/state/reminders/x.md")
|
||||
|
|
|
|||
Loading…
Reference in a new issue