The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
chore(secrets): cover the spawn ledger and meet-node token in the private-writer invariant; drop unused import
teknium1602801baa187
diff --git a/agent/secret_sources/_cache.py b/agent/secret_sources/_cache.pyindex 9e40e63285c..fab398b2dda 100644--- a/agent/secret_sources/_cache.py+++ b/agent/secret_sources/_cache.py@@ -11,7 +11,6 @@ from __future__ import annotationsimport hashlibimport json-import osimport timefrom dataclasses import dataclassfrom pathlib import Pathdiff --git a/tests/test_private_credential_writers.py b/tests/test_private_credential_writers.pyindex 3f4765d3df0..0992249c256 100644--- a/tests/test_private_credential_writers.py+++ b/tests/test_private_credential_writers.py@@ -2,7 +2,7 @@The credential writers (auth.json, MCP OAuth tokens, secret-source cache, iron-proxy state, theexchanged-JWT store, the Photon sidecar record, pairing data, the vault blob, the third-party-credential file) all funnel through ``utils.atomic_json_write`` / ``atomic_write_text`` /+credential file, the spawn ledger, the meet-node token) all funnel through ``utils.atomic_json_write`` / ``atomic_write_text`` /``atomic_write_bytes`` with ``mode=0o600``. The contract under test: the *temp* file is createdwith mode 0600 (``O_EXCL``) BEFORE any byte lands and the final file carries 0600 — never"open at umask, then chmod" (the #19673 window). POSIX-only: mode bits are not enforced on Windows.@@ -49,13 +49,18 @@ def _writers(home: Path, monkeypatch):from agent.vault_store import VaultStorefrom gateway import pairingfrom hermes_cli import auth as auth_mod, copilot_auth+ from hermes_cli import process_identityfrom tools import mcp_oauth+ from plugins.google_meet.node.server import NodeServerfrom plugins.platforms.photon import adapter as photon_adapterphoton_record = home / "runtime" / "photon.json"monkeypatch.setattr(photon_adapter, "_runtime_record_path", lambda: photon_record)+ ledger = home / "spawn-ledger.json"+ monkeypatch.setattr(process_identity, "_ledger_path", lambda: ledger)cache = DiskCache("probe.json", key_serializer=str)vault = VaultStore(home / "vault")+ meet_node = NodeServer(token_path=home / "meetings" / "node_token.json")return [("auth.json", lambda: auth_mod._save_auth_store({"version": auth_mod.AUTH_STORE_VERSION, "providers": {}}),auth_mod._auth_file_path()),@@ -71,6 +76,8 @@ def _writers(home: Path, monkeypatch):("photon sidecar record", lambda: photon_adapter._write_runtime_record(1, "tok", 2), photon_record),("pairing", lambda: pairing._save_json_file(home / "pairing" / "p.json", {"a": 1}), home / "pairing" / "p.json"),("vault blob", lambda: vault._write_all([]), vault._vault_path),+ ("spawn ledger", lambda: process_identity.register_self("probe"), ledger),+ ("meet node token", meet_node.ensure_token, meet_node.token_path),]