docs(v4.8.5): archive PR #48 reviews (three rounds) and record the merge-workspace review
PR #48 already carries the 4.8.5 lockstep bump. Merge-workspace review: round 1 (@35935f9) claude agy grok NOT PASS (test portability: tomllib on Python 3.9, /proc and /tmp on macOS), codex no verdict (model at capacity, budget spent); fixed in36f0b8dande8d9151. Round 2 (@e8d9151) codex NOT PASS (unrunnable config check passed an unchecked merge, odd pids closed a pane, nan dropped the user's settings); fixed inab93776. Round 3 (@ab93776) 4/4 PASS. Full suite atab93776on macOS / Python 3.9: 1456 passed / 0 failed / 38 skipped. Reports and the round-3 identity sidecars go to .agents/reports/<session>/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
1 parent
ab93776d6d
commit
bf8a583afb
16 files changed
+898
No files matched your search
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"loop_id": "loop-20261005T085016Z-c0f6eb",
|
||||
"base_sha": "e8d9151226d8139c7b5688e83d035a3a747aeb2d",
|
||||
"head_sha": "ab93776d6d1b8ca534c14b6be53f61dc3a0fa2a9",
|
||||
"tree_sha": "f49ffdc8e95dc316f752fd81b2d55a0efddf1a12",
|
||||
"review_commit": "ab93776d6d1b8ca534c14b6be53f61dc3a0fa2a9",
|
||||
"reviewer": "reviewer-agy-01",
|
||||
"job_id": "3e6f0467",
|
||||
"verdict": "PASS",
|
||||
"transport": "herdr",
|
||||
"evidence": "review-tree",
|
||||
"isolation": "worktree",
|
||||
"verified_at": "2026-10-05T09:05:24Z"
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
# PR #48 (fix/issue-45, Closes #45) Round 3 Delta Review Report
|
||||
|
||||
- **Reviewer Agent**: `agy` (session: `herdr:reviewer-agy-01`)
|
||||
- **Job ID**: `3e6f0467`
|
||||
- **Verification Directory**: `/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T085016Z-c0f6eb/1`
|
||||
- **Base Commit**: `e8d9151226d8139c7b5688e83d035a3a747aeb2d` (Round 2 head)
|
||||
- **Head Commit**: `ab93776d6d1b8ca534c14b6be53f61dc3a0fa2a9` (Round 3 head)
|
||||
- **Delta Under Inspection**: `git diff e8d9151 ab93776` (Commit `ab93776`)
|
||||
|
||||
---
|
||||
|
||||
## 1. Executive Summary
|
||||
|
||||
In Round 2, `claude`, `agy`, and `grok` reached a `PASS` verdict after verifying that Python 3.9 macOS environment and portability blockers were eliminated. However, `codex` reported three valid edge-case issues in the product code (`R1`: unchecked merge pass-through on `herdr config check` execution failure; `R2`: unsafe type coercion in `_shell_in_foreground` comparing non-PIDs with `==`; `R3`: IEEE 754 `NaN != NaN` dropping valid TOML configurations containing `nan`).
|
||||
|
||||
Commit `ab93776` surgically addresses all three findings (R1, R2, R3) in `lib_py/herdr_config.py` and `lib_py/herdr_restore.py`, accompanied by targeted unit tests in `tests/test_issue45_herdr_config.py` and `tests/test_issue45_restore_unit.py`.
|
||||
|
||||
All review criteria have been audited, analyzed, and verified across both Python 3.9 and Python 3.11 test environments. The modifications are minimal, robust, fail-safe, and fully within scope.
|
||||
|
||||
---
|
||||
|
||||
## 2. Review Findings (R1 ~ R3) Resolution Matrix
|
||||
|
||||
| # | Item | Defect Description | Resolution in `ab93776` | Status |
|
||||
|---|---|---|---|---|
|
||||
| **R1** | Unchecked merge pass-through on check failure | If `herdr config check` failed to execute (timeout, `OSError`), `_write_checked` previously treated the merged file as valid and returned `True`. If the unvalidated merge contained a schema error, `herdr` would silently discard the file on startup and re-enable restore, causing Issue #45 to recur. | In `lib_py/herdr_config.py:_write_checked`, an execution error during candidate validation skips any unchecked merged body and advances to `MINIMAL`. If `MINIMAL` also encounters a check execution error, it writes `MINIMAL` with a warning rather than returning no config. | **CLOSED** (Verified) |
|
||||
| **R2** | Loose equality in `_shell_in_foreground` | `_shell_in_foreground` compared `shell` and `foreground_process_group_id` directly with `==`, causing matching non-PIDs (`0 == 0`, `False == False`, `"" == ""`, `-1 == -1`) to evaluate to `True` and mistakenly close active panes. | Added `_is_pid(v)` helper: `isinstance(v, int) and not isinstance(v, bool) and v > 0`. `_shell_in_foreground` now requires both `shell` and `fg` to be valid positive integer PIDs. | **CLOSED** (Verified) |
|
||||
| **R3** | `NaN` equality dropping valid configs | Standard Python equality `tomllib.loads(text) == expected` fails for valid TOML `nan` values because `float('nan') != float('nan')`, causing all user settings to be discarded in favor of minimal config. | Implemented `_same_doc(a, b)` which recursively verifies dictionary keys and list items while treating `math.isnan(a) and math.isnan(b)` as equal and enforcing strict type equality (`type(a) is type(b)`). | **CLOSED** (Verified) |
|
||||
|
||||
---
|
||||
|
||||
## 3. Deep-Dive on Specific Review Criteria
|
||||
|
||||
### 3.1. Assessment of R1: Unchecked MINIMAL Fallback vs. Returning None
|
||||
- **Context & Design Trade-off**: Codex suggested that if validating `MINIMAL` fails or cannot be executed, `write_server_config` should return `None` (no path). The Creator instead decided to emit a warning and return the `MINIMAL` config.
|
||||
- **Analysis**:
|
||||
- If `write_server_config` returns `None`, `lib.sh` starts `herdr` without setting `HERDR_CONFIG_PATH`. Herdr's built-in default is `resume_agents_on_restore = true`. When the server starts, every previously saved agent session would be relaunched without permissions, resurrecting the primary vulnerability of Issue #45.
|
||||
- In contrast, `MINIMAL` is a static, immutable, two-line string:
|
||||
```toml
|
||||
[session]
|
||||
resume_agents_on_restore = false
|
||||
```
|
||||
This fixed content has zero dynamic variables and has been rigorously verified against `herdr 0.9.1+` (`test_real_herdr_accepts_every_result`).
|
||||
- If `herdr config check` cannot be executed due to a transient execution error (e.g., subprocess timeout or file descriptor exhaustion), deploying `MINIMAL` provides the safest available defense-in-depth against unauthorized agent auto-restoration.
|
||||
- **Verdict on Criterion 2**: The Creator's decision is sound, defensible, and superior in fail-safety compared to returning `None`.
|
||||
|
||||
### 3.2. Assessment of R3: Equivalence of `_same_doc`
|
||||
- `_same_doc(a, b)` enforces:
|
||||
1. `math.isnan(a) and math.isnan(b)` returns `True` for floats.
|
||||
2. Dict comparison checks `a.keys() == b.keys()` and recurses on all values.
|
||||
3. List comparison checks `len(a) == len(b)` and recurses element-wise in sequence, strictly preserving list order.
|
||||
4. Primitive comparison checks `type(a) is type(b) and a == b`.
|
||||
- **Type Discrimination**: In Python, `0 == False`, `1 == True`, and `1 == 1.0` evaluate to `True`. Because TOML maintains distinct types for boolean, integer, and float, the added check `type(a) is type(b)` ensures that serialization does not inadvertently morph types (e.g. integer `1` into float `1.0`).
|
||||
- **Verdict on Criterion 3**: `_same_doc` preserves identical behavior to `==` for all non-nan types while providing strictly higher fidelity TOML AST verification.
|
||||
|
||||
### 3.3. Scope and Surgical Precision
|
||||
- Modified lines:
|
||||
- `lib_py/herdr_config.py`: +31 lines, -2 lines.
|
||||
- `lib_py/herdr_restore.py`: +9 lines, -3 lines.
|
||||
- `tests/test_issue45_herdr_config.py`: +38 lines.
|
||||
- `tests/test_issue45_restore_unit.py`: +56 lines (new unit test file for stubbed PID verification).
|
||||
- No extraneous changes or unrelated formatting edits were introduced.
|
||||
|
||||
---
|
||||
|
||||
## 4. Verification and Test Results
|
||||
|
||||
Tests were executed directly within the isolated review verification path:
|
||||
`/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T085016Z-c0f6eb/1`
|
||||
|
||||
### 4.1. Round 3 Target Test Suite (Python 3.9 venv)
|
||||
```bash
|
||||
AGENT_PYTHON_BIN=/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
-m pytest -p no:cacheprovider -q --basetemp=/tmp/pytest-pr48-r3 \
|
||||
tests/test_issue45_herdr_config.py \
|
||||
tests/test_issue45_restore_unit.py \
|
||||
tests/test_issue45_restore.py \
|
||||
tests/test_issue9_server_env.py
|
||||
```
|
||||
- **Exit Code**: `0`
|
||||
- **Result**: `53 passed, 34 skipped in 72.58s (0:01:12)`
|
||||
|
||||
### 4.2. Python 3.11 Environment Verification
|
||||
```bash
|
||||
PYTHONPATH=.agents/skills \
|
||||
/private/tmp/claude-501/-Users-godopu16-PuKi-laa-canary-projects-multi-agent-mux/dbe6dd10-a210-4b46-b613-58a1860499b6/scratchpad/venv311/bin/python \
|
||||
-m pytest -p no:cacheprovider -q --basetemp=/tmp/pytest-pr48-r3-py311 \
|
||||
tests/test_issue45_herdr_config.py \
|
||||
tests/test_issue45_restore_unit.py
|
||||
```
|
||||
- **Exit Code**: `0`
|
||||
- **Result**: `67 passed in 0.42s`
|
||||
|
||||
### 4.3. Full Auxiliary & Consistency Suite (Python 3.9 venv)
|
||||
```bash
|
||||
AGENT_PYTHON_BIN=/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
-m pytest -p no:cacheprovider -q --basetemp=/tmp/pytest-pr48-r3-full \
|
||||
tests/test_issue23_24_startup_path.py \
|
||||
tests/test_issue42_skill_blocks.py \
|
||||
tests/test_version_consistency.py
|
||||
```
|
||||
- **Exit Code**: `0`
|
||||
- **Result**: `110 passed, 1 skipped in 137.12s (0:02:17)`
|
||||
|
||||
---
|
||||
|
||||
## 5. Conclusion & Final Verdict
|
||||
|
||||
All findings from the previous round have been resolved completely, test coverage is thorough and passing across both Python 3.9 and 3.11, and no regressions or scope violations exist.
|
||||
|
||||
[VERDICT: PASS]
|
||||
@@ -0,0 +1,105 @@
|
||||
# PR #48 (fix/issue-45, Closes #45) Round 2 Delta Review Report
|
||||
|
||||
- **Reviewer Agent**: `agy` (session: `herdr:reviewer-agy-01`)
|
||||
- **Job ID**: `3f82b402`
|
||||
- **Verification Directory**: `/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T081844Z-e92124/1`
|
||||
- **Base Commit**: `c5c7eff6f758c76ac37a138dbc3c301f3f7e10cf` (main, v4.8.4)
|
||||
- **Head Commit**: `e8d9151226d8139c7b5688e83d035a3a747aeb2d` (v4.8.5)
|
||||
- **Delta Under Inspection**: `35935f9`..`e8d9151` (commits `36f0b8d` and `e8d9151`)
|
||||
|
||||
---
|
||||
|
||||
## 1. Executive Summary
|
||||
|
||||
In Round 1 (`f3699a96`), the review concluded with `[VERDICT: NOT PASS]` strictly due to cross-platform and environment compatibility issues on macOS under Python 3.9 (missing `tomllib` in Python < 3.11, `/proc/{pid}/environ` absence on macOS, and `/tmp` vs `/private/tmp` symlink divergence causing test assertion failures).
|
||||
|
||||
The Creator has applied targeted, high-quality fixes across commits `36f0b8d` and `e8d9151`. The changes are strictly confined to test suites and documentation, leaving production code (`lib.sh`, `lib_py/herdr_config.py`, `lib_py/herdr_restore.py`, `resume_session.sh`) stable and untouched.
|
||||
|
||||
All 5 issues identified during Round 1 by `agy` have been completely and cleanly resolved. The test suite passes cleanly both under the host's Python 3.9 environment (152 passed, 30 skipped) and Python 3.11 (51 passed, 0 skipped).
|
||||
|
||||
---
|
||||
|
||||
## 2. Round 1 Findings Resolution Matrix
|
||||
|
||||
| # | Round 1 Finding (Job `f3699a96`) | File & Line | Round 2 Resolution (Commits `36f0b8d`, `e8d9151`) | Verification Status |
|
||||
|---|---|---|---|---|
|
||||
| **1** | Unconditional `import tomllib` crashing pytest collection under Python 3.9 | `tests/test_issue45_herdr_config.py:16` | Wrapped `import tomllib` in a `try...except ImportError` block; defined `@needs_tomllib` decorator skipping tests requiring TOML parsing when `tomllib is None` (22 passed, 29 skipped under 3.9; 51 passed under 3.11). | **CLOSED** (Verified) |
|
||||
| **2** | Hardcoded `import tomllib` causing execution failure in `test_bootstrap_hands_the_server_a_no_restore_config` under Python 3.9 | `tests/test_issue9_server_env.py:154` | Removed inline `import tomllib`. Replaced with a dynamic subprocess parser invoking the active `python3` binary on PATH. Verifies full JSON parsed output when `tomllib` is present, or asserts fallback to minimal config and stderr warning when absent. | **CLOSED** (Verified) |
|
||||
| **3** | Linux-specific `/proc/{pid}/environ` path causing `FileNotFoundError` on macOS | `tests/test_issue45_restore.py:227` | Added helper function `_process_env(pid)` that detects `/proc/{pid}/environ` existence, falling back gracefully to `ps -E -ww -o command= -p <pid>` on macOS / BSD environments. | **CLOSED** (Verified) |
|
||||
| **4** | macOS `/tmp` vs `/private/tmp` symlink mismatch causing failure in `assert cwd == str(rig.root)` | `tests/test_issue45_restore.py:263` | In fixture `rig`, resolved the temporary directory with `.resolve()` (`root = Path(tempfile.mkdtemp(prefix="m45", dir="/tmp")).resolve()`), ensuring canonical `/private/tmp` alignment with `herdr`'s reported cwd. | **CLOSED** (Verified) |
|
||||
| **5** | macOS `/tmp` vs `/private/tmp` symlink mismatch causing `StopIteration` during pane cwd search | `tests/test_issue45_restore.py:325` | Resolving `root` via `Path(...).resolve()` resolved the cwd mismatch for `next(p for p in ... if p.get('cwd') == str(rig.root))`. | **CLOSED** (Verified) |
|
||||
|
||||
---
|
||||
|
||||
## 3. Delta Code Review Details (`35935f9`..`e8d9151`)
|
||||
|
||||
### 3.1. `tests/test_issue45_herdr_config.py` (Commit `36f0b8d`)
|
||||
- **Import Guarding**: Gracefully handles missing `tomllib` standard library on Python < 3.11.
|
||||
- **Skipping Strategy**: 29 unit tests asserting deep AST / dictionary equivalence of merged TOML configs are decorated with `@needs_tomllib`. Tests testing paths, file naming, collision avoidance, and permissions continue to execute under Python 3.9.
|
||||
- **Verification**: Under Python 3.9, 22 tests pass and 29 skip without errors. Under Python 3.11, all 51 tests pass.
|
||||
|
||||
### 3.2. `tests/test_issue45_restore.py` (Commit `e8d9151`)
|
||||
- **Canonical Root Resolution**: `root = Path(tempfile.mkdtemp(prefix="m45", dir="/tmp")).resolve()` resolves macOS symlinks cleanly.
|
||||
- **Cross-Platform Process Inspection**: `_process_env(pid: int)` cleanly splits `/proc/{pid}/environ` by `\0` when present, or extracts environment variables from `ps -E -ww -o command= -p <pid>`.
|
||||
|
||||
### 3.3. `tests/test_issue9_server_env.py` (Commit `e8d9151`)
|
||||
- Seamlessly validates dual behavior:
|
||||
- If `python3` on `PATH` has `tomllib`, confirms full configuration merge `{"ui": {"confirm_close": False}, "session": {"resume_agents_on_restore": False}}`.
|
||||
- If `python3` lacks `tomllib`, confirms minimal config fallback (`resume_agents_on_restore = false`), absence of unmerged user keys (`confirm_close`), and emission of the `"no tomllib"` warning on stderr.
|
||||
|
||||
### 3.4. Documentation (`SKILL.md` & `VERSIONS.md`)
|
||||
- `multi-agent-mux-create/SKILL.md:121` explicitly documents the runtime requirement:
|
||||
> *"Building that file needs `tomllib` (Python 3.11+) in the `python3` on PATH; with an older `python3` (macOS ships 3.9) restore is still off, but the file holds only that key, so the MAM server runs without your other herdr settings and the bootstrap prints a warning saying so."*
|
||||
- `VERSIONS.md` under `v4.8.5` changelog reflects both the Python 3.11+ requirement and the test suite portability improvements across macOS and Linux.
|
||||
|
||||
---
|
||||
|
||||
## 4. Verification & Test Execution Results
|
||||
|
||||
All verification was conducted strictly inside the designated review worktree (`/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T081844Z-e92124/1`).
|
||||
|
||||
### 4.1. Primary Test Suite (Python 3.9 Host Environment)
|
||||
```bash
|
||||
AGENT_PYTHON_BIN=/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/bin/python \
|
||||
-m pytest -p no:cacheprovider -q --basetemp=/tmp/pytest-pr48-r2 \
|
||||
tests/test_issue45_herdr_config.py \
|
||||
tests/test_issue45_restore.py \
|
||||
tests/test_issue9_server_env.py \
|
||||
tests/test_issue23_24_startup_path.py \
|
||||
tests/test_issue42_skill_blocks.py \
|
||||
tests/test_version_consistency.py
|
||||
```
|
||||
**Result**:
|
||||
- **Exit Code**: `0`
|
||||
- **Output**: `152 passed, 30 skipped in 211.50s (0:03:31)`
|
||||
|
||||
### 4.2. Python 3.11 Compatibility Sanity Check
|
||||
```bash
|
||||
PYTHONPATH=.agents/skills:/Users/godopu16/PuKi/laa/canary_projects/multi-agent-mux-wt/pr-48/.venv/lib/python3.9/site-packages \
|
||||
/opt/homebrew/bin/python3.11 \
|
||||
-m pytest -p no:cacheprovider -q --basetemp=/tmp/pytest-pr48-py311 \
|
||||
tests/test_issue45_herdr_config.py
|
||||
```
|
||||
**Result**:
|
||||
- **Exit Code**: `0`
|
||||
- **Output**: `51 passed in 0.40s`
|
||||
|
||||
---
|
||||
|
||||
## 5. Non-Blocking Architectural Note
|
||||
|
||||
- **Python < 3.11 Config Merging**: In Round 1, grok suggested bundling a `tomli` backport for environments with Python < 3.11. The project decision to rely on standard library `tomllib` (Python 3.11+) and fall back to minimal config with an explicit warning is well-founded:
|
||||
1. Multi-Agent-Mux relies on zero extra external runtime dependencies for core shell shims.
|
||||
2. On hosts running macOS default Python 3.9, the default user `herdr` configuration is minimal, and restoring without extra settings safely satisfies Issue #45.
|
||||
3. The behavior is fully documented in `create/SKILL.md` and `VERSIONS.md`.
|
||||
Therefore, this design choice is accepted as complete and non-blocking.
|
||||
|
||||
---
|
||||
|
||||
## 6. Final Verdict
|
||||
|
||||
All Round 1 blockers have been resolved with precision. No regressions or unintended mutations were introduced.
|
||||
|
||||
[VERDICT: PASS]
|
||||
@@ -0,0 +1,107 @@
|
||||
# Final Review Report: Job f3699a96 (PR #48 / Issue #45)
|
||||
|
||||
## 1. Review Identity & Metadata
|
||||
- **Loop ID**: `loop-20261005T064728Z-a4e9c8`
|
||||
- **Job ID**: `f3699a96`
|
||||
- **Reviewer**: agy (session: `herdr:reviewer-agy-01`)
|
||||
- **Base Commit**: `c5c7eff6f758c76ac37a138dbc3c301f3f7e10cf` (main, v4.8.4)
|
||||
- **Head Commit**: `35935f9e8a052ca9e9d9b806a62d17eb72afea78` (10 commits)
|
||||
- **Tree Hash**: `dff9db13f3e018528d04a024acda942f501513ff`
|
||||
- **Verification Path**: `/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1`
|
||||
- **Git Status**: Clean (working tree clean, no uncommitted changes)
|
||||
- **Whitespace Check (`git diff base...HEAD --check`)**: Clean (0 errors)
|
||||
|
||||
---
|
||||
|
||||
## 2. Review Findings & Reasons for NOT PASS
|
||||
|
||||
During verification with the specified test command (`AGENT_PYTHON_BIN=... python -m pytest ...`), multiple critical test failures occurred on macOS / Python < 3.11:
|
||||
|
||||
### 1) Unconditional `import tomllib` at Module Level in Test Files
|
||||
- **Failure 1**: [`tests/test_issue45_herdr_config.py:16`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue45_herdr_config.py#L16)
|
||||
```python
|
||||
import tomllib
|
||||
```
|
||||
- **Error**: `ModuleNotFoundError: No module named 'tomllib'`
|
||||
- **Impact**: Pytest fails collection immediately with exit code 2. The entire test module cannot be run on Python < 3.11 (such as Python 3.9 in the project virtualenv).
|
||||
- **Context**: While [`lib_py/herdr_config.py:152-155`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/.agents/skills/lib_py/herdr_config.py#L152-L155) guards the import with `try ... except ImportError: tomllib = None`, the test module itself imports `tomllib` unconditionally at line 16 and in test functions.
|
||||
|
||||
- **Failure 2**: [`tests/test_issue9_server_env.py:1592`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue9_server_env.py#L1592)
|
||||
```python
|
||||
def test_bootstrap_hands_the_server_a_no_restore_config(mam_sandbox):
|
||||
import tomllib
|
||||
```
|
||||
- **Error**: `ModuleNotFoundError: No module named 'tomllib'`
|
||||
- **Impact**: Test fails immediately on Python < 3.11.
|
||||
|
||||
---
|
||||
|
||||
### 2) Non-Portable Linux Assumptions in Real Herdr Server Test (`test_issue45_restore.py`)
|
||||
Four out of 5 tests in [`tests/test_issue45_restore.py`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue45_restore.py) fail on macOS:
|
||||
|
||||
- **Failure 3 (Linux `/proc` filesystem hardcoding)**: [`tests/test_issue45_restore.py:227`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue45_restore.py#L227)
|
||||
```python
|
||||
environ = Path(f"/proc/{rig.server_pids()[0]}/environ").read_bytes().split(b"\0")
|
||||
```
|
||||
- **Error**: `FileNotFoundError: [Errno 2] No such file or directory: '/proc/26854/environ'`
|
||||
- **Impact**: Tests `test_a_mam_server_does_not_relaunch_saved_agents[plain-user-config]` and `test_a_mam_server_does_not_relaunch_saved_agents[user-config-with-session-table]` both crash. macOS (Darwin) does not have a `/proc` filesystem. Reading `/proc/<pid>/environ` is non-portable.
|
||||
|
||||
- **Failure 4 (macOS `/tmp` vs `/private/tmp` symlink mismatch)**: [`tests/test_issue45_restore.py:263`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue45_restore.py#L263)
|
||||
```python
|
||||
assert _pane_with(rig, ids["Y"])["cwd"] == str(rig.root)
|
||||
```
|
||||
- **Error**: `AssertionError: assert '/private/tmp/m45phdbspj1' == '/tmp/m45phdbspj1'`
|
||||
- **Impact**: `test_b_only_the_resumed_sessions_restored_shell_is_closed` fails. On macOS, `/tmp` is a symlink to `/private/tmp`. Herdr canonicalizes working directories to `/private/tmp/...`. Exact string comparison against uncanonicalized `str(rig.root)` fails. Comparing with `Path(cwd).resolve()` or `os.path.samefile` is required.
|
||||
|
||||
- **Failure 5 (Pane lookup failure due to uncanonicalized `/tmp` path)**: [`tests/test_issue45_restore.py:325`](file:///var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1/tests/test_issue45_restore.py#L325)
|
||||
```python
|
||||
pane = next(p for p in rig.panes() if p.get("cwd") == str(ws))
|
||||
```
|
||||
- **Error**: `StopIteration`
|
||||
- **Impact**: `test_b_resume_leaves_no_restored_shell_behind` fails. `ws` is constructed under `/tmp/...`, while `p.get("cwd")` is reported as `/private/tmp/...`. The generator finds no match and raises `StopIteration`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Evaluation of Brief Review Questions
|
||||
|
||||
1. **A's config merging**:
|
||||
- On Python 3.11+, parsing and rewriting logic in `lib_py/herdr_config.py` preserves tables, dotted keys, and verifies with `tomllib.loads(text) == expected` followed by `herdr config check`.
|
||||
- On Python < 3.11 (e.g. system Python 3.9), `tomllib` is absent, causing `server_config_text()` to emit a warning and fall back to `MINIMAL` (`[session]\nresume_agents_on_restore = false`), thereby losing user-defined herdr settings on Python 3.9 systems.
|
||||
2. **Coverage across server boot paths**:
|
||||
- `lib.sh:230-236` runs `python3 -m lib_py.herdr_config server-config` during headless bootstrap.
|
||||
- Accurately documented that manually attached/started servers outside MAM do not pick up `mam-server-config.toml`.
|
||||
3. **B's pane closing conditions**:
|
||||
- Clean fail-safe in `lib_py/herdr_restore.py`: checks `HERDR_SESSION_NAME` is not default, ensures no live agent is running in the pane, checks matching `agent_session`, and verifies foreground process group is the shell. If herdr cannot be queried, it fails-safe by leaving panes untouched and emitting a warning in `resume_session.sh:614`.
|
||||
4. **Test isolation & portability**:
|
||||
- Test suites properly use temporary HOME and isolated session names, preventing mutation of live user servers or configs.
|
||||
- However, portability on macOS is broken due to hardcoded `/proc` access and uncanonicalized `/tmp` symlink path comparisons.
|
||||
5. **Version and Inventory**:
|
||||
- Framework and 8 skills were updated to `4.8.5`.
|
||||
- `tests/data/skill_code_blocks.json` updated line ranges for `create` and `resume` while preserving classification.
|
||||
6. **PR purge failure note**:
|
||||
- Baseline purge test passes 23/23 on macOS and is unrelated.
|
||||
7. **Boundary (#17)**:
|
||||
- Complex logic is implemented in Python (`herdr_config.py`, `herdr_restore.py`), while shell scripts delegate to them.
|
||||
|
||||
---
|
||||
|
||||
## 4. Test Suite Execution Summary
|
||||
|
||||
Executed in verification worktree (`/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261005T064728Z-a4e9c8/1`):
|
||||
|
||||
| Test Suite | Result | Details |
|
||||
|---|---|---|
|
||||
| `tests/test_issue45_herdr_config.py` | **FAILED** | Collection error: `ModuleNotFoundError: No module named 'tomllib'` at line 16 |
|
||||
| `tests/test_issue9_server_env.py` | **FAILED** | `test_bootstrap_hands_the_server_a_no_restore_config` failed at line 1592 (`ModuleNotFoundError`) |
|
||||
| `tests/test_issue45_restore.py` | **FAILED** (4/5 failed) | Lines 227 (`/proc` FileNotFoundError), 263 (`/tmp` vs `/private/tmp` AssertionError), 325 (`StopIteration`) |
|
||||
| `tests/test_issue23_24_startup_path.py` | 27 passed | Clean |
|
||||
| `tests/test_issue42_skill_blocks.py` | 37 passed, 1 skipped | Clean |
|
||||
| `tests/test_version_consistency.py` | 3 passed | Clean |
|
||||
|
||||
---
|
||||
|
||||
## 5. Conclusion
|
||||
|
||||
Due to the critical test failures on macOS and Python < 3.11 (`ModuleNotFoundError: tomllib` in test suites, Linux `/proc` hardcoding, and macOS `/private/tmp` path matching failures in `test_issue45_restore.py`), the review verdict is NOT PASS.
|
||||
|
||||
[VERDICT: NOT PASS]
|
||||
Reference in new issue
Block a user