Skip to content

Add generated project health and release status report#28

Merged
ProfRandom92 merged 1 commit into
mainfrom
codex/add-generated-project-health-report
May 11, 2026
Merged

Add generated project health and release status report#28
ProfRandom92 merged 1 commit into
mainfrom
codex/add-generated-project-health-report

Conversation

@ProfRandom92

Copy link
Copy Markdown
Owner

Motivation

  • Provide a deterministic, reviewable snapshot that summarizes agent workflow readiness, contract validation, API/export validation, and cross-repo promotion readiness for Comptextv7.
  • Make it safe for agents and CI to produce a release-readiness artifact without network access, live servers, or reading sensitive payloads.
  • Ensure future PRs and reviewers have a single machine-readable Markdown snapshot that is deterministic and safe to commit.

Description

  • Add scripts/generate_project_health_report.py, a Python 3.11+ standard-library-only generator that inspects repository paths and file-existence metadata, uses a static generated_at (2026-01-01T00:00:00Z), and writes docs/reports/project-health-report.md.
  • Commit the generated snapshot at docs/reports/project-health-report.md and include the report sections required by the issue (repository overview, workflows, scripts, contracts/examples, existing reports, validation commands, release readiness, cross-repo checklist, next PRs, and safety notes).
  • Update .github/workflows/agent-checks.yml to compile and run the new generator as part of agent checks by adding python -m py_compile scripts/generate_project_health_report.py and python scripts/generate_project_health_report.py.
  • Update docs/AGENT_WORKFLOW.md and docs/CROSS_REPO_RELEASE_CHECKLIST.md to reference the generator and the generated report and to instruct agents when to generate/review the health report.

Testing

  • Compiled the generator with python -m py_compile scripts/generate_project_health_report.py which completed without errors.
  • Executed python scripts/generate_project_health_report.py which wrote docs/reports/project-health-report.md successfully.
  • Verified static/deterministic output and that the CI workflow now compiles and runs the new generator; no new dependencies or network access were introduced.

Closes #27.


Codex Task

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a project health and release status reporting mechanism. It adds a new script, scripts/generate_project_health_report.py, which generates a deterministic Markdown report summarizing workflow readiness, contract validation surfaces, and cross-repo promotion status. The agent workflow and release checklists have been updated to include this report as a mandatory step. Feedback on the implementation suggests optimizing the file system traversal to prune ignored directories, ensuring the report consistently includes itself for better determinism, and refining the logic for detecting contract schemas to avoid false positives.

Comment on lines +61 to +70
def iter_repo_files(root: Path) -> list[Path]:
"""Return repository files in stable order while skipping bulky trees."""
files: list[Path] = []
for path in root.rglob("*"):
rel = path.relative_to(root)
if any(part in SKIP_DIRS for part in rel.parts):
continue
if path.is_file():
files.append(rel)
return sorted(files, key=lambda item: item.as_posix())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation using rglob("*") followed by a filter is inefficient for repositories with large ignored directories (like .git or node_modules), as it traverses the entire tree before filtering. Pruning the traversal at the directory level would significantly improve performance, especially in an industrial context where repository size can grow.

Suggested change
def iter_repo_files(root: Path) -> list[Path]:
"""Return repository files in stable order while skipping bulky trees."""
files: list[Path] = []
for path in root.rglob("*"):
rel = path.relative_to(root)
if any(part in SKIP_DIRS for part in rel.parts):
continue
if path.is_file():
files.append(rel)
return sorted(files, key=lambda item: item.as_posix())
def iter_repo_files(root: Path) -> list[Path]:
"""Return repository files in stable order while skipping bulky trees."""
files: list[Path] = []
def _walk(current: Path):
for path in sorted(current.iterdir(), key=lambda p: p.name):
if path.is_dir():
if path.name in SKIP_DIRS:
continue
_walk(path)
elif path.is_file():
files.append(path.relative_to(root))
_walk(root)
return files

scripts = [path for path in files if path.parts[:1] == ("scripts",) and path.suffix == ".py"]
contract_files = [path for path in files if path.parts[:1] == ("contracts",) and path.suffix == ".json" and "examples" not in path.parts]
contract_examples = [path for path in files if path.parts[:2] == ("contracts", "examples") and path.suffix == ".json"]
report_files = [path for path in files if path.parts[:2] == ("docs", "reports")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The report includes itself in the "Existing report files" section only if it already exists on disk when the script starts. This makes the output non-deterministic depending on whether the file was present before the script ran. To ensure a truly deterministic snapshot as intended, the report should always include itself in this list.

Suggested change
report_files = [path for path in files if path.parts[:2] == ("docs", "reports")]
report_path_rel = REPORT_PATH.relative_to(ROOT)
report_files = sorted({path for path in files if path.parts[:2] == ("docs", "reports")} | {report_path_rel}, key=lambda item: item.as_posix())

contract_examples = [path for path in files if path.parts[:2] == ("contracts", "examples") and path.suffix == ".json"]
report_files = [path for path in files if path.parts[:2] == ("docs", "reports")]

contract_schema_present = any(path.parts[:1] == ("contracts",) and path.name.endswith(".schema.json") for path in files)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for contract_schema_present is inconsistent with contract_files because it does not explicitly exclude the examples directory. This could lead to a false positive if a schema file is incorrectly placed in contracts/examples/. It is better to derive this status from the already filtered contract_files list.

Suggested change
contract_schema_present = any(path.parts[:1] == ("contracts",) and path.name.endswith(".schema.json") for path in files)
contract_schema_present = any(path.name.endswith(".schema.json") for path in contract_files)

@ProfRandom92 ProfRandom92 merged commit 1941960 into main May 11, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add generated project health and release status report

1 participant