Skip to content

[codex] Bootstrap parser-first Python project harness#1

Merged
GTrunSec merged 16 commits intomainfrom
codex/python-harness-bootstrap
May 1, 2026
Merged

[codex] Bootstrap parser-first Python project harness#1
GTrunSec merged 16 commits intomainfrom
codex/python-harness-bootstrap

Conversation

@GTrunSec
Copy link
Copy Markdown
Contributor

@GTrunSec GTrunSec commented May 1, 2026

Summary

  • Bootstrap python-lang-project-harness as a standalone Python library package with the project distribution name and console script.
  • Add python_lang_parser as the parser-owned foundation for AST/compile/tokenize/symtable facts, module identity, public surface, symbol roles, source lines, compact parser diagnostics, and parser-owned reasoning-tree facts.
  • Add parser reasoning-tree models for project nodes, package branches, module/package owner shadows, parser-resolved internal import edges, and compact public export facts from parser export candidates / __all__ contract kind.
  • Add python_lang_project_harness as the consumer-facing harness layer for project-wide discovery, rule packs, compact rendering, JSON rendering, CLI, pytest embedding, and advisory PY-AGENT-* policy.
  • Make harness policy configurable through PythonHarnessConfig, [tool.python-lang-project-harness] in pyproject.toml, CLI, and pytest plugin options: selected rule ids can be disabled or promoted to blocking without changing rule catalog severities.
  • Align default project scope with the whole Python project root while keeping src/tests as policy classification roots; --no-tests remains the explicit parser exclusion for tests.
  • Add policy alignment for reasoning-tree ownership: blocking PY-MOD-R007 for module/package owner shadows and advisory PY-AGENT-R007 for branch packages lacking intent docstrings.
  • Add render_python_reasoning_tree(report) so repair agents can consume a compact project tree with nodes, branch flags, export names, internal imports, and shadows before editing code.
  • Harden review feedback paths: ignored directory filtering is now scan-root relative, and syntax diagnostics no longer crash on parser error codes outside the stable syntax catalog.
  • Add PyPA-backed project metadata policy rules for [project].name, [project].requires-python, and [build-system].requires, with compact snapshots.
  • Add pytest dev-dependency support through both a public helper (python_lang_project_harness.pytest) and a pytest11 plugin (--python-project-harness), including a pytest optional extra and subprocess coverage for downstream plugin usage.
  • Add GitHub CI covering uv sync, ruff format/check, pytest, self-harness, build, and diff hygiene.

Validation

  • uv sync --group test --locked
  • uv run --group test ruff format --check src tests
  • uv run --group test ruff check src tests
  • uv run --group test pytest tests -q (196 passed)
  • uv run python-project-harness . (Files: 98 Parsed: 98)
  • uv build
  • git diff --check && git diff --cached --check
  • old package-name / legacy-name scan: no matches
  • parser-first harness boundary scan: no direct ast / tokenize / symbol-shape hardcoding matches

Notes

The remote repository was empty, so I pushed an empty main initialization commit first and opened this PR from codex/python-harness-bootstrap into main.

@GTrunSec GTrunSec marked this pull request as ready for review May 1, 2026 01:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5bee112802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/python_lang_project_harness/_discovery.py Outdated
Comment thread src/python_lang_project_harness/_syntax.py
@GTrunSec GTrunSec merged commit 11bd8e6 into main May 1, 2026
1 check passed
@GTrunSec GTrunSec deleted the codex/python-harness-bootstrap branch May 1, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant