Skip to content

fix: address PR #62 review feedback for zero-argument CLI demos#63

Merged
lchoquel merged 13 commits into
devfrom
feature/Codegen
Jul 15, 2026
Merged

fix: address PR #62 review feedback for zero-argument CLI demos#63
lchoquel merged 13 commits into
devfrom
feature/Codegen

Conversation

@lchoquel

@lchoquel lchoquel commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Guard bootstrap.py against package names that collide with the piper placeholder (e.g. piper_tools), which would otherwise corrupt the pyproject transform
  • Refine sample-input fallback and error handling in the attended CLI mode
  • Update docs (CLI architecture, codegen) and tests to match

Test plan

  • make agent-check
  • make agent-test

🤖 Generated with Claude Code

https://claude.ai/code/session_01AA5fmhTMLRLTJgVmCsW6da

Review in cubic

lchoquel and others added 11 commits July 10, 2026 12:02
Delete the hand-written output models: pipelex codegen projects each method's
concepts into piper/generated/<method>/models.py (stamped, locked by a sibling
codegen.lock); the examples keep only the bundle path, pipe code, and the
parse() narrower. generate-image now parses into the generated built-in Image
model. New make codegen (regen, write-if-changed) + make codegen-check
(offline drift check) targets — the pipelex CLI is not a dependency, point
the PIPELEX make variable at an install that ships codegen; CI wiring is
release-gated on a published pipelex. Adds inputs.template.json scaffolds
beside each bundle, offline smoke tests for the generated clients, and
docs/codegen.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EaRwjPbPsan4rCeyWirKpp
…p comments

Cold-review triage: package each codegen.lock as package data so the offline
drift check also works against an installed copy, and cross-reference the three
places the method list is enumerated (piper/methods/*, pyproject packages, the
Makefile codegen targets).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EaRwjPbPsan4rCeyWirKpp
…+ flattened Image

Regenerated with the codegen engine after the native-materialization change: Image now emits width/height integer fields instead of the interim dict-with-imprecision size, and native field descriptions come from the pinned normative definitions (storage-neutral url wording, described Text). Crate fingerprints and stamps updated accordingly; codegen-check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ight)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Added `piper.detached` package with CLI commands for starting and managing durable runs.
- Implemented commands: `extract-entities`, `summarize-pdf`, `generate-image`, `wait`, `status`, and `result`.
- Created shared input handling functions in `piper.inputs` for text and document inputs.
- Enhanced error presentation in `piper.errors` to provide mode-specific hints.
- Updated tests to cover the new detached mode and ensure symmetry across CLI modes.
- Refactored existing tests to align with the new structure and added new unit tests for input handling.
…ples

- Updated all demo commands to utilize bundled sample inputs when no arguments are provided, ensuring a working result on the first command execution.
- Introduced a `sample` parameter in `read_text_input()` to facilitate this feature.
- Enhanced error handling to surface detailed API error messages instead of generic httpx errors, improving user feedback.
- Refactored execution modes into self-contained units, removing the previous shared dispatch structure for clarity and maintainability.
- Updated documentation to reflect changes in execution modes and sample usage.
- Added tests to verify that demos correctly fall back to sample inputs when no user input is provided.
Guards bootstrap against package names that collide with the piper
placeholder, and refines sample-input/error handling in the attended
CLI mode with corresponding test coverage updates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AA5fmhTMLRLTJgVmCsW6da
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes each CLI demo runnable without explicit input and reorganizes execution around mode-specific commands. The main changes are:

  • Built-in sample fallbacks for zero-argument demos.
  • Separate blocking, attended, and detached CLI packages.
  • Structured API error messages and lifecycle hints.
  • Generated output models with code-generation checks.
  • Updated bootstrap transforms, documentation, and tests to match.

Confidence Score: 4/5

The installed zero-argument PDF demo needs a fix before merging.

Text sample fallbacks and mode-specific lifecycle paths are consistent. Installed wheels do not contain the PDF at the path used by all three summarize-pdf commands. The remaining error and generated-model changes have no concrete blocking issue.

piper/inputs.py and pyproject.toml

T-Rex T-Rex Logs

What T-Rex did

  • Built the repository wheel and installed it into an isolated virtual environment outside the source checkout.
  • Validated that the wheel listing shows the sample PDF is absent from the installed package.
  • Confirmed that build_document_input(SAMPLE_INVOICE) raises FileNotFoundError due to the missing sample.
  • Ran the three zero-argument summarize-pdf CLI modes and observed that all exit with code 2 and report No such file.
  • Collected and cataloged artifacts documenting the reproduction harness, wheel build and install outputs, missing-sample evidence, and CLI results.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
piper/inputs.py Adds shared input handling and sample fallbacks, but the default PDF points to a file that is absent from installed wheels.
piper/blocking/cli.py Adds blocking demo commands around the execute lifecycle and uses the shared input fallbacks.
piper/attended/cli.py Adds attended start-and-wait commands with interruption recovery guidance.
piper/detached/cli.py Adds detached starts and generic status, result, and wait commands.
piper/errors.py Adds structured handling for SDK errors and protocol-route problem responses.
pyproject.toml Packages the new CLI and generated-model subpackages, but does not include the repository-level PDF sample.
.claude/skills/bootstrap/scripts/bootstrap.py Rejects placeholder-colliding package names and generalizes package-token replacement.
Makefile Adds generation and offline drift-check targets for the three generated clients.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
piper/inputs.py:33
**Installed PDF Sample Is Missing**

The default path leaves the `piper` package and relies on the repository-level `samples` directory, which is not included in the wheel package data. After a normal installation, running `piper blocking summarize-pdf` without an argument—and likewise the attended or detached variant—fails with `No such file` instead of using the advertised sample.

Reviews (1): Last reviewed commit: "fix: address PR #62 review feedback for ..." | Re-trigger Greptile

# Conflicts:
#	CHANGELOG.md
#	CLAUDE.md
#	README.md
#	docs/cli-architecture.md
#	docs/codegen.md
#	piper/attended/cli.py
#	piper/errors.py
#	piper/inputs.py
#	tests/e2e/test_extract_entities.py
#	tests/unit/test_errors.py
#	tests/unit/test_inputs.py
Comment thread piper/inputs.py

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

Copy link
Copy Markdown

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: 02c7a44f15

ℹ️ 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 Makefile
The bootstrap script's rewrite set never included the Makefile, so the
codegen targets kept pointing at piper/generated and piper/methods after
a rename, breaking make codegen / make codegen-check on bootstrapped
projects. Same gap for the docs under docs/, which went stale. Both are
now in the rewrite set (the generic context-aware token pass handles
their path/command forms), SKILL.md lists them, and a non-dry-run test
asserts the rewritten paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AA5fmhTMLRLTJgVmCsW6da
@lchoquel lchoquel merged commit f13e619 into dev Jul 15, 2026
12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
@lchoquel lchoquel deleted the feature/Codegen branch July 15, 2026 09:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant