The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
chore(install-e2e): print the verifier's own .env view beside the driver's probe
ethernetd87ddc0e079f
diff --git a/tests/install/e2e-assets/verify-user-state.py b/tests/install/e2e-assets/verify-user-state.pyindex d6dc0623b4e..2f3b8a69937 100644--- a/tests/install/e2e-assets/verify-user-state.py+++ b/tests/install/e2e-assets/verify-user-state.py@@ -408,6 +408,27 @@ def _render(report: dict) -> str:return "\n".join(lines)+def env_key_report(home: str, profiles_dir: str | None = None) -> list[str]:+ """Every .env this verifier judges, with its key names -- names only.++ Exists to be compared against the driver's own view of ``$HERMES_HOME/.env``.+ The install e2e's probe showed OPENAI_BASE_URL present immediately before AND+ after the snapshot while the report called it an ADDITION, which can only mean+ the snapshot read a different file than the run wrote. Printing the paths the+ verifier actually enumerated settles that in one run instead of three.+ """+ snap = snapshot_home(home, profiles_dir)+ lines: list[str] = []+ for label, entries in (("judged", snap["entries"]), ("advisory", snap.get("advisory", {}))):+ for rel in sorted(entries):+ if not rel.endswith(".env"):+ continue+ keys = sorted((entries[rel].get("env_keys") or {}).keys())+ path = os.path.join(os.path.abspath(home), rel.replace("/", os.sep))+ lines.append(f"{label} {path}: {' '.join(keys) if keys else '(no keys)'}")+ return lines++def main(argv: list[str] | None = None) -> int:ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])sub = ap.add_subparsers(dest="mode", required=True)@@ -424,12 +445,26 @@ def main(argv: list[str] | None = None) -> int:p_ver.add_argument("--report")p_ver.add_argument("--profiles-dir")+ p_env = sub.add_parser("env-keys",+ help="print every judged .env and its key names (names only)")+ p_env.add_argument("--home", required=True)+ p_env.add_argument("--profiles-dir")+args = ap.parse_args(argv)if not os.path.isdir(os.path.abspath(args.home)):print(f"error: --home is not a directory: {args.home}", file=sys.stderr)return 2+ if args.mode == "env-keys":+ try:+ for line in env_key_report(args.home, args.profiles_dir):+ print(line)+ except (OSError, ScanError) as exc:+ print(f"env-keys failed: {exc}", file=sys.stderr)+ return 2+ return 0+if args.mode == "snapshot":try:snap = snapshot_home(args.home, args.profiles_dir)diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.shindex 05714421649..298f17024c2 100755--- a/tests/install/installer-script-e2e.sh+++ b/tests/install/installer-script-e2e.sh@@ -340,6 +340,19 @@ env_key_names "after snapshot"grep -q '^OPENAI_BASE_URL=' "$HERMES_HOME/.env" \|| fail "the snapshot phase cleared OPENAI_BASE_URL from $HERMES_HOME/.env"+# The verifier's OWN view of every .env it judges, printed right after its+# snapshot. When this disagrees with the probe above, the snapshot recorded a+# different file than the run wrote -- which is what "0 deleted, 1 modified ...+# OPENAI_BASE_URL ADDED" looked like while the probe saw the key present both+# immediately before and immediately after the snapshot.+env_verifier_view() {+ local py+ py="$(_user_state_python)"+ printf ' [env] verifier view:\n'+ "$py" "$USER_STATE_VERIFIER" env-keys --home "$HERMES_HOME" 2>&1 | sed 's/^/ /' || true+}+env_verifier_view+# --- update OLD -> HEAD ----------------------------------------------------------step "advancing served main to $TARGET_LABEL ($TARGET_SHA)"