Problem
When an agent creates project scaffolding (pyproject.toml, package.json), configuration errors aren't detected until later gates (pytest, npm-test) fail. By then:
- The agent has written more code based on the broken foundation
- The error message is misleading ("pytest failed" when really build failed)
- The agent doesn't understand it's a config issue, not a code issue
Example from v2 CLI Testing
Agent created pyproject.toml with:
# Wrong TOML section name:
[tool.hatchling.build.targets.wheel]
packages = ["src/task_tracker"]
Should have been:
# Correct:
[tool.hatch.build.targets.wheel]
packages = ["src/task_tracker"]
This caused all subsequent tasks to fail with "hatchling.build.build_editable failed" but the agent couldn't diagnose the root cause.
Proposed Solutions
Option 1: Add a "build" gate
Add a new gate that explicitly validates the project can be built:
def _run_build(repo_path: Path, verbose: bool = False) -> GateCheck:
"""Verify project can be built/installed."""
# For Python: uv sync --no-install-project or pip install -e . --dry-run
# For Node: npm install --ignore-scripts
Run this gate immediately after pyproject.toml or package.json is created/modified.
Option 2: Better error parsing in existing gates
When uv run pytest fails due to build error, parse the output to detect:
- "Failed to build" → Report as BUILD_FAILED, not TEST_FAILED
- Provide actionable error message pointing to pyproject.toml
Option 3: Tech stack templates
When initializing with --detect or --tech-stack, provide the agent with proven pyproject.toml/package.json templates for that stack, reducing reliance on agent memory.
Acceptance Criteria
Related
Labels
enhancement, quality-gates, agent-system
Problem
When an agent creates project scaffolding (pyproject.toml, package.json), configuration errors aren't detected until later gates (pytest, npm-test) fail. By then:
Example from v2 CLI Testing
Agent created pyproject.toml with:
Should have been:
This caused all subsequent tasks to fail with "hatchling.build.build_editable failed" but the agent couldn't diagnose the root cause.
Proposed Solutions
Option 1: Add a "build" gate
Add a new gate that explicitly validates the project can be built:
Run this gate immediately after pyproject.toml or package.json is created/modified.
Option 2: Better error parsing in existing gates
When
uv run pytestfails due to build error, parse the output to detect:Option 3: Tech stack templates
When initializing with
--detector--tech-stack, provide the agent with proven pyproject.toml/package.json templates for that stack, reducing reliance on agent memory.Acceptance Criteria
Related
Labels
enhancement, quality-gates, agent-system