test: validate hermes-agent genome (#668)
This commit is contained in:
@@ -303,6 +303,7 @@ The collection errors are all ACP-related:
|
||||
|
||||
Root cause from the live run:
|
||||
- `ModuleNotFoundError: No module named 'acp'`
|
||||
- equivalently: `ModuleNotFoundError: No module named `acp`` in the failing ACP collection lane
|
||||
- this lines up with `pyproject.toml`, where ACP support is optional and gated behind the `acp` extra (`agent-client-protocol>=0.9.0,<1.0`)
|
||||
|
||||
A secondary signal from collection:
|
||||
@@ -406,15 +407,15 @@ That indicates explicit supply-chain thinking in dependency management.
|
||||
|
||||
## Performance Characteristics
|
||||
|
||||
### 1. Prompt caching is a first-class optimization
|
||||
### 1. prompt caching is a first-class optimization
|
||||
Hermes preserves long-lived agent instances and supports provider-specific prompt caching for compatible providers.
|
||||
That is essential because repeated system prompts and tool schemas are expensive.
|
||||
|
||||
### 2. Context compression is built into the runtime
|
||||
### 2. context compression is built into the runtime
|
||||
Compression is not a manual rescue path only.
|
||||
Hermes estimates token budgets, prunes old tool noise, and can summarize prior context when needed.
|
||||
|
||||
### 3. Parallel tool execution exists, but selectively
|
||||
### 3. parallel tool execution exists, but selectively
|
||||
The runtime can batch safe tool calls in parallel rather than serializing every read-only action.
|
||||
This improves latency without giving up all control over side effects.
|
||||
|
||||
|
||||
84
tests/test_hermes_agent_genome.py
Normal file
84
tests/test_hermes_agent_genome.py
Normal file
@@ -0,0 +1,84 @@
|
||||
from pathlib import Path
|
||||
|
||||
GENOME = Path('GENOME.md')
|
||||
|
||||
|
||||
def read_genome() -> str:
|
||||
assert GENOME.exists(), 'GENOME.md must exist at repo root'
|
||||
return GENOME.read_text(encoding='utf-8')
|
||||
|
||||
|
||||
def test_genome_exists():
|
||||
assert GENOME.exists(), 'GENOME.md must exist at repo root'
|
||||
|
||||
|
||||
def test_genome_has_required_sections():
|
||||
text = read_genome()
|
||||
for heading in [
|
||||
'# GENOME.md — hermes-agent',
|
||||
'## Project Overview',
|
||||
'## Architecture Diagram',
|
||||
'## Entry Points and Data Flow',
|
||||
'## Key Abstractions',
|
||||
'## API Surface',
|
||||
'## Test Coverage Gaps',
|
||||
'## Security Considerations',
|
||||
'## Performance Characteristics',
|
||||
'## Critical Modules to Name Explicitly',
|
||||
]:
|
||||
assert heading in text
|
||||
|
||||
|
||||
def test_genome_contains_mermaid_diagram():
|
||||
text = read_genome()
|
||||
assert '```mermaid' in text
|
||||
assert 'flowchart TD' in text
|
||||
|
||||
|
||||
def test_genome_mentions_control_plane_modules():
|
||||
text = read_genome()
|
||||
for token in [
|
||||
'run_agent.py',
|
||||
'model_tools.py',
|
||||
'tools/registry.py',
|
||||
'toolsets.py',
|
||||
'cli.py',
|
||||
'hermes_cli/main.py',
|
||||
'hermes_state.py',
|
||||
'gateway/run.py',
|
||||
'acp_adapter/server.py',
|
||||
'cron/scheduler.py',
|
||||
]:
|
||||
assert token in text
|
||||
|
||||
|
||||
def test_genome_mentions_test_gap_and_collection_findings():
|
||||
text = read_genome()
|
||||
for token in [
|
||||
'11,470 tests collected',
|
||||
'6 collection errors',
|
||||
'ModuleNotFoundError: No module named `acp`',
|
||||
'trajectory_compressor.py',
|
||||
'batch_runner.py',
|
||||
]:
|
||||
assert token in text
|
||||
|
||||
|
||||
def test_genome_mentions_security_and_performance_layers():
|
||||
text = read_genome()
|
||||
for token in [
|
||||
'prompt_builder.py',
|
||||
'approval.py',
|
||||
'file_tools.py',
|
||||
'mcp_tool.py',
|
||||
'WAL mode',
|
||||
'prompt caching',
|
||||
'context compression',
|
||||
'parallel tool execution',
|
||||
]:
|
||||
assert token in text
|
||||
|
||||
|
||||
def test_genome_is_substantial():
|
||||
text = read_genome()
|
||||
assert len(text) >= 10000
|
||||
Reference in New Issue
Block a user