Repository navigation
Conversation
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
There was a problem hiding this comment.
🟡 Changes recommended
Confirmed gaps in parser error handling can make artifact commands fail on project scripts.
2 open issues
What changed in this PR
Fixes Python script descriptions in Spec Kit’s artifact catalog so module docstrings take precedence over encoding and license comments, without executing scripts.
Changes:
- Adds AST-based extraction for Python files while preserving existing fallbacks and non-Python handling.
- Adds four regression cases covering header comments and blank or missing docstrings through both list and info paths.
Validation used isolated standard-library probes; the reported project test suites were not rerun.
| File | Description |
|---|---|
| tests/specify_cli/artifacts/test_catalog.py | Adds public-path regression coverage for Python script descriptions. |
| src/specify_cli/artifacts/catalog.py | Reads Python module docstrings before applying existing fallbacks. |
Review effort: Max
|
Please address Copilot feedback |
Handle parser resource errors with the existing comment fallback and suppress metadata-only parser warnings locally. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
|
Addressed both Copilot findings in db3b52a: parser recursion/memory errors now use the existing comment fallback, and metadata parsing suppresses warnings locally while restoring the caller's warning filters. Nine new regressions exercise real script source through artifact list, the affected script's info, and an unrelated artifact's info: all nine failed before and pass after. A separate Codex agent independently reran them and reviewed the change. The artifact suite passes 362 tests; the full suite passes 13,078 with 128 skips and 62 warnings. Six installed CLI checks returned expected descriptions and empty stderr. Ruff lint, new-test formatting and whitespace checks pass. The final uploaded tree exactly matches the tested local tree. Hosted CI for this new commit is pending. @mnriem, this is ready for another look when convenient. AI disclosure: OpenAI Codex (model: GPT-6, autonomous) prepared, tested and posted this follow-up on behalf of @Ghoscro. No human line-by-line review is claimed. |
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("ignore") |
| description = ast.get_docstring(ast.parse(text)) | ||
| except (SyntaxError, ValueError, RecursionError, MemoryError): | ||
| description = None |
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)


Description
A Python script with an encoding or copyright header before its module docstring can show that header as its description in
artifact listandartifact info.Read only the leading string expression, without executing the script or parsing its remaining code. This also works when the script body uses syntax newer than the CLI's Python interpreter. Decode ordinary/raw/adjacent/parenthesized string literals without emitting compiler warnings or changing global warning filters. Preserve docstring whitespace cleaning and the existing comment fallback for missing or malformed descriptions; non-Python handling remains unchanged.
Validation
Hosted results for the newest commit are recorded separately from local results.
AI Disclosure
OpenAI Codex (GPT-6, autonomous; reasoning effort not exposed) prepared the investigation, code, tests and follow-ups on behalf of @Ghoscro. A separate Codex agent reviewed the final diff and independently checked the concurrency and literal semantics. No human line-by-line review is claimed. Supplemental commits carry
Assisted-bydisclosure.