baseline¶
Deterministic SHA-256 manifests of an emission output tree for regression detection. Used by the CLI flags --capture-baseline PATH and --check-baseline PATH, and consumed by tests/test_baseline.py to pin per-target emission contracts (tests/baselines/<team>-<framework>.json).
The capture skips the full generation pipeline — it walks an existing output tree, hashes every regular file (no symlinks, no excluded path components), and writes a JSON manifest. The diff is per-file SHA equality.
Public Surface¶
Compute a baseline manifest forroot. label is a free-form identifier (e.g. copilot-vscode, bridge-overlay). exclude defaults to caches and VCS metadata. The returned dict has shape {schema_version, label, root, file_count, files: [{path, sha256}, ...]}.
Write the manifest as deterministic JSON (sorted keys, 2-space indent, trailing newline). Parent dirs created as needed.
Load and parse a baseline manifest from disk.
Return {added, removed, changed} — three sorted lists of relative path strings. A file is changed iff present in both with differing SHA-256.
CLI Workflow¶
# Capture (after a known-good emission)
agentteams --capture-baseline tests/baselines/myteam-copilot-vscode.json \
--baseline-label copilot-vscode --output .github/agents
# Verify (CI / pre-merge)
agentteams --check-baseline tests/baselines/myteam-copilot-vscode.json \
--output .github/agents
--check-baseline exits non-zero on any diff and lists added/removed/changed file paths to stderr; --capture-baseline skips the normal generation pipeline.
Notes¶
- Hashing skips symlinks (no
realpathfollow). - Excluded path components (default:
__pycache__,.git,.pytest_cache,.mypy_cache,.ruff_cache,node_modules,.DS_Store) are skipped at any depth. - The manifest's
rootis recorded as an absolute POSIX path — useful for forensics, not for portable diffing. Per-filepathentries are root-relative.
See also¶
drift— the template→artifact drift scan (a related but distinct regression signal).- Update lifecycle guide — where baseline capture/check fits into the update flow.