Skip to content

Compact project new CLI wiring - #154

Merged
Deicyde merged 1 commit into
mainfrom
golf/project-new-cli
Oct 6, 2026
Merged

Deicyde merged 1 commit into
mainfrom
golf/project-new-cli

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #96. A keyboard interrupt during project new now raises ProjectCreateError("project-create-interrupted", ...) into the existing ProjectCreateError handler. Before, it duplicated that handler's JSON and stderr printing inline. The handler now returns 130 for that code and 1 otherwise. create.py never raises that code itself, so no other path changes exit status.

The change also puts the project import and the project new help strings on one line where they fit in 120 columns, as the rest of __main__.py does. It drops a duplicated scripts/ reference loop in tests/test_skill_examples.py.

Tests: ruff check is clean. On dd90820: tests/test_cli.py 5 passed, tests/test_project_create.py -k "cli or interrupt" 25 passed, tests/test_skill_examples.py 23 passed.

Put the project import and the help strings that fit within 120 columns on
one line, as the rest of __main__.py does, and report an interrupt through
the existing ProjectCreateError handler, which maps
project-create-interrupted to exit 130. Drop the duplicated scripts/
reference loop in the setup guidance test.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 6, 2026
@Deicyde Deicyde added the review: ready Review complete with no known merge blockers label Oct 6, 2026
@Deicyde
Deicyde marked this pull request as ready for review October 6, 2026 04:32
@Deicyde

Deicyde commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head review at 3a99e52e: KeyboardInterrupt keeps the same human/JSON ProjectCreateError payload and only project-create-interrupted maps to exit 130; all other creation errors remain exit 1. The removed skill scan was byte-for-byte duplicate. Focused tests (32), diff check, and all GitHub checks pass. No blocker remains.

@Deicyde

Deicyde commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Independent review of 3a99e52. Verdict: mergeable. This agrees with the exact-head review above; the points below were checked separately.

  • Interrupt path. raise ProjectCreateError("project-create-interrupted", message) from None (autoform_cli/__main__.py:518) sits inside the outer try, and nothing between it and except ProjectCreateError at :543 catches it. That handler prints the same JSON to stdout, or error[code]: message to stderr, as the inline block it replaces. from None only changes __cause__ and __context__, which nothing prints.
  • Exit codes. :548 returns 130 only for project-create-interrupted; every other creation error still returns 1. tests/test_project_create.py:2215-2234 (human and --json) and :2264-2267 pin the 130 and both outputs.
  • Removed test loop. At dd90820, tests/test_skill_examples.py:194-199 repeated :188-193 line for line, so no coverage is lost.
  • Joined lines. The longest is 119 characters, under the line-length = 120 in pyproject.toml:50, and the joins stay within the project new wiring and its import.
  • Main. Merges cleanly with 71b251c. __main__.py is unchanged on main since dd90820, and main's only change to tests/test_skill_examples.py is Document Autoform agent development practices #144's routing tests, which auto-merge.

No golf left. Not run locally; CI is green at 3a99e52.

Posted by PR swarm: PR Swarm Lead

@Deicyde
Deicyde merged commit 7fa6d1d into main Oct 6, 2026
9 checks passed
@Deicyde
Deicyde deleted the golf/project-new-cli branch October 6, 2026 06:01
Deicyde added a commit that referenced this pull request Oct 6, 2026
Conflicts:
- autoform_cli/__main__.py: keep main's one-line project import (#154)
  and this branch's readback, render and review imports.
- autoform_cli/graph.py: take the union of the imports, main's lean
  import (#158) beside this branch's markdown and snapshot imports.

Semantic:
- tests/test_audit.py: since #158 a formalized proof without a formalized
  statement fails to load, and the audit's proof-without-statement finding
  is gone, so the snapshot test's rewritten article now reports
  invalid-graph. The audit of the state the graph loaded is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. review: ready Review complete with no known merge blockers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant