Cover manifest.py lazy (on-disk) loader branches #308

Merged
didericis-claude merged 1 commits from cover-manifest-lazy-loader into main 2026-06-26 21:19:32 -04:00
Collaborator

Closes #304.

Summary

The eager from_json_obj path is unit-tested (test_manifest_validation.py), but the lazy resolve() / from_md_dirs on-disk path was only exercised by the integration suite — so a critical module depended on Docker for branch coverage.

Adds test_manifest_lazy_loader.py with temp-dir fixtures (.bot-bottle/agents/*.md + bottles/*.md) driving:

  • all_agent_names merging a cwd agent overlay onto home
  • load_for_agent on an unknown agent and on a malformed-frontmatter agent file (tab-in-indent → YamlSubsetErrorManifestError)
  • require_agent's names-only file-existence checks (home file, cwd-only file, unknown)

Coverage

Module Before After
manifest.py 86% 99%

The one remaining line is the OSError branch on an unreadable agent file (not reliably triggerable cross-environment — chmod 000 is a no-op under root CI). 6 new tests; full suite (1482) passes; pyright clean; pylint 10.00.

Closes #304. ## Summary The eager `from_json_obj` path is unit-tested (test_manifest_validation.py), but the lazy `resolve()` / `from_md_dirs` on-disk path was only exercised by the integration suite — so a *critical* module depended on Docker for branch coverage. Adds `test_manifest_lazy_loader.py` with temp-dir fixtures (`.bot-bottle/agents/*.md` + `bottles/*.md`) driving: - `all_agent_names` merging a **cwd** agent overlay onto home - `load_for_agent` on an **unknown** agent and on a **malformed-frontmatter** agent file (tab-in-indent → `YamlSubsetError` → `ManifestError`) - `require_agent`'s names-only file-existence checks (home file, cwd-only file, unknown) ## Coverage | Module | Before | After | |---|---|---| | `manifest.py` | 86% | **99%** | The one remaining line is the `OSError` branch on an unreadable agent file (not reliably triggerable cross-environment — `chmod 000` is a no-op under root CI). 6 new tests; full suite (1482) passes; pyright clean; pylint 10.00.
didericis-claude added 1 commit 2026-06-26 20:41:15 -04:00
test(manifest): cover lazy (on-disk) loader branches
lint / lint (push) Successful in 2m23s
test / unit (pull_request) Successful in 58s
test / integration (pull_request) Successful in 26s
test / coverage (pull_request) Successful in 1m18s
284307a3e9
The eager from_json_obj path is unit-tested; the lazy resolve()/
from_md_dirs path was only hit by the integration suite, so a critical
module relied on Docker for branch coverage. Add tmp-dir tests driving:
all_agent_names with a cwd overlay, load_for_agent on unknown and
malformed-frontmatter agent files, and require_agent's names-only
file-existence checks (home + cwd).

manifest.py: 86% -> 99%. The one remaining line is the OSError branch on
an unreadable agent file (not reliably triggerable cross-environment).

Closes #304

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkwFXLFff9PYPy4wgVBJp9
didericis-claude merged commit 0db76b877a into main 2026-06-26 21:19:32 -04:00
didericis-claude deleted branch cover-manifest-lazy-loader 2026-06-26 21:19:38 -04:00
Sign in to join this conversation.