Clarify repository validation layout#85
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for comptext-v7 canceled.
|
There was a problem hiding this comment.
Code Review
This pull request formalizes the repository's multi-app layout by introducing a dedicated validation guide and a layout verification script. It updates existing documentation to clarify that validation commands are layout-specific, specifically moving away from root-level npm commands. Review feedback suggests enhancing the documentation's layout overview for consistency with the README and improving the layout check script by adding a shebang line and directing error messages to stderr.
| Comptextv7/ | ||
| ├── dashboard/app/ # Vite + TypeScript dashboard application | ||
| ├── showcase/app/ # Vite + TypeScript showcase application | ||
| ├── tests/ # Python regression, replay, and foundation tests | ||
| ├── scripts/ # Python validation and repository utility scripts | ||
| ├── artifacts/ # Committed deterministic replay artifacts | ||
| └── docs/ # Reviewer and validation documentation |
There was a problem hiding this comment.
For completeness and consistency with the repository map in README.md, consider including the src/ and reports/ directories in this layout overview. These directories are central to the code being validated and the storage of validation artifacts.
| Comptextv7/ | |
| ├── dashboard/app/ # Vite + TypeScript dashboard application | |
| ├── showcase/app/ # Vite + TypeScript showcase application | |
| ├── tests/ # Python regression, replay, and foundation tests | |
| ├── scripts/ # Python validation and repository utility scripts | |
| ├── artifacts/ # Committed deterministic replay artifacts | |
| └── docs/ # Reviewer and validation documentation | |
| Comptextv7/ | |
| ├── dashboard/app/ # Vite + TypeScript dashboard application | |
| ├── showcase/app/ # Vite + TypeScript showcase application | |
| ├── src/ # KVTC engine and validation modules | |
| ├── tests/ # Python regression, replay, and foundation tests | |
| ├── scripts/ # Python validation and repository utility scripts | |
| ├── reports/ # Validation and continuity reports | |
| ├── artifacts/ # Committed deterministic replay artifacts | |
| └── docs/ # Reviewer and validation documentation |
| """Validate the expected multi-app repository layout. | ||
|
|
||
| The repository root intentionally has no package.json. Dashboard and showcase | ||
| Node commands belong to their app directories. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[1] |
There was a problem hiding this comment.
It is a best practice to include a shebang line for scripts intended to be executed directly. Additionally, importing sys will allow for better error reporting to stderr in the main function.
#!/usr/bin/env python3
"""Validate the expected multi-app repository layout.
The repository root intentionally has no package.json. Dashboard and showcase
Node commands belong to their app directories.
"""
from __future__ import annotations
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]| def main() -> int: | ||
| errors = check_repo_layout() | ||
| if errors: | ||
| for error in errors: | ||
| print(error) | ||
| return 1 | ||
|
|
||
| print("repository layout OK") | ||
| return 0 |
There was a problem hiding this comment.
Error messages should ideally be printed to sys.stderr to distinguish them from standard output in CI/CD environments and shell pipelines.
| def main() -> int: | |
| errors = check_repo_layout() | |
| if errors: | |
| for error in errors: | |
| print(error) | |
| return 1 | |
| print("repository layout OK") | |
| return 0 | |
| def main() -> int: | |
| errors = check_repo_layout() | |
| if errors: | |
| for error in errors: | |
| print(error, file=sys.stderr) | |
| return 1 | |
| print("repository layout OK") | |
| return 0 |
Motivation
package.json.ENOENTerrors and be clear which surface (dashboard, showcase, Python tests) owns each validation step.Description
docs/validation.mddocumenting the repository layout, exact validation commands fordashboard/app,showcase/app, and Python tests, and an explicit note that root npm commands are invalid.README.md,docs/AGENT_WORKFLOW.md, anddocs/BENCHMARK_INTEGRATION.mdto point to the new validation guide and to replace ambiguous root npm instructions with layout-specific commands.scripts/check_repo_layout.pythat verifiesdashboard/app/package.json,showcase/app/package.json, and key artifacts underartifacts/, and also flags an unexpected rootpackage.json.tests/test_check_repo_layout.pyto cover the guard script viapytestand kept all changes documentation/validation-only without altering runtime logic, assets, or architecture.Testing
python scripts/check_repo_layout.pyand it printedrepository layout OK(exit 0).pytest tests/test_check_repo_layout.py -qand it passed (1 passed).pytest -qand it passed (52 passed).(cd dashboard/app && npm run typecheck && npm run build)and the commands completed successfully.(cd showcase/app && npm run typecheck && npm run validate && npm run build)and the commands completed successfully.Codex Task