Skip to content

fix(spec-014): CodeRabbit follow-ups (PR #74 review)#75

Merged
danko-nobre merged 1 commit into
mainfrom
fix/spec-014-coderabbit-followup
May 31, 2026
Merged

fix(spec-014): CodeRabbit follow-ups (PR #74 review)#75
danko-nobre merged 1 commit into
mainfrom
fix/spec-014-coderabbit-followup

Conversation

@danko-nobre

Copy link
Copy Markdown
Contributor

Summary

PR #74 was merged before the CodeRabbit review fix-up commit landed. This PR carries that work to main as a small follow-up.

Three findings + one nit, all locked by new tests:

# Finding Fix
1 `UintPair` allowed negatives (anchor/position/size/origin) Item type tightened to `Annotated[int, Field(ge=0)]`; tests cover negative anchor + layer position
2 Discriminators returned `"unknown"` for bad tags Both `_layer_discriminator` (PSD manifest) and `_sprite_discriminator` (.proscenio, kept consistent) return `None` so pydantic raises `union_tag_not_found`
3 `main.py` docstring grouped `ts` with placeholders Docstring rewritten: `ts` documents the TS bindings emit; only `godot` / `docs` stay placeholders
4 Local `build_psd_manifest_schema` import in test body Lifted to module scope

New `tests/codegen/test_psd_manifest.py` (6 cases) locks polygon / mesh / sprite_frame routing + unknown-kind rejection + non-negative UintPair contract. Regenerated schemas + TS bindings; `apps/blender/wheels/proscenio_models-0.1.0-py3-none-any.whl` rebuilt.

Test plan

  • CI green
  • `uv run pytest tests/codegen/` -> 35/35 (was 29 + 6 new)
  • `pnpm typecheck` from `apps/photoshop/` green
  • `pnpm test` from `apps/photoshop/` 136/136

Refs: PR #74 review comment r3330752267 + outside-diff nits.

Three findings, all valid, all locked by new tests.

1. `UintPair` rejects negative integers. The name implied unsigned
   but the schema only enforced length; CodeRabbit caught that an
   `anchor: [-1, 0]` would slip through silently. Element type
   tightens to `Annotated[int, Field(ge=0)]`; new
   tests/codegen/test_psd_manifest.py covers anchor + position.

2. Callable discriminators in both proscenio.py and psd_manifest.py
   return `None` for unexpected kind/type values (was `"unknown"`).
   Pydantic raises a clearer `union_tag_not_found` ValidationError
   instead of dispatching to a non-existent variant.

3. `__main__.py` docstring no longer groups `ts` with the placeholder
   subcommands. `ts` documents the TS bindings emit; only `godot`
   and `docs` stay as placeholders.

Also lifts the `build_psd_manifest_schema` import in
`test_schema_roundtrip.py` to module scope (was a local import in
the test body).

New tests under `tests/codegen/test_psd_manifest.py` lock the
PSD manifest discriminated union behaviour - polygon, mesh, and
sprite_frame routes + the unknown-kind rejection + the
non-negative UintPair contract.

Schemas + TS bindings regenerated (negative-aware UintPair surfaces
in the dumped schema as `"minimum": 0` per item).
proscenio-models wheel rebuilt.

Refs: PR #74 review comments r3330752267 and the outside-diff
__main__.py + test_schema_roundtrip.py nits.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@danko-nobre, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 15 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76fb9f6d-2678-436d-988a-00ebd7383494

📥 Commits

Reviewing files that changed from the base of the PR and between 03b1df8 and 6f31e90.

📒 Files selected for processing (7)
  • apps/blender/wheels/proscenio_models-0.1.0-py3-none-any.whl
  • packages/codegen/src/proscenio_codegen/__main__.py
  • packages/models/schemas/psd_manifest.schema.json
  • packages/models/src/proscenio_models/proscenio.py
  • packages/models/src/proscenio_models/psd_manifest.py
  • tests/codegen/test_psd_manifest.py
  • tests/codegen/test_schema_roundtrip.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@danko-nobre
danko-nobre merged commit 92ebf8d into main May 31, 2026
10 of 11 checks passed
@danko-nobre
danko-nobre deleted the fix/spec-014-coderabbit-followup branch May 31, 2026 19:26
danko-nobre added a commit that referenced this pull request Jul 11, 2026
Three findings, all valid, all locked by new tests.

1. `UintPair` rejects negative integers. The name implied unsigned
   but the schema only enforced length; CodeRabbit caught that an
   `anchor: [-1, 0]` would slip through silently. Element type
   tightens to `Annotated[int, Field(ge=0)]`; new
   tests/codegen/test_psd_manifest.py covers anchor + position.

2. Callable discriminators in both proscenio.py and psd_manifest.py
   return `None` for unexpected kind/type values (was `"unknown"`).
   Pydantic raises a clearer `union_tag_not_found` ValidationError
   instead of dispatching to a non-existent variant.

3. `__main__.py` docstring no longer groups `ts` with the placeholder
   subcommands. `ts` documents the TS bindings emit; only `godot`
   and `docs` stay as placeholders.

Also lifts the `build_psd_manifest_schema` import in
`test_schema_roundtrip.py` to module scope (was a local import in
the test body).

New tests under `tests/codegen/test_psd_manifest.py` lock the
PSD manifest discriminated union behaviour - polygon, mesh, and
sprite_frame routes + the unknown-kind rejection + the
non-negative UintPair contract.

Schemas + TS bindings regenerated (negative-aware UintPair surfaces
in the dumped schema as `"minimum": 0` per item).
proscenio-models wheel rebuilt.

Refs: PR #74 review comments r3330752267 and the outside-diff
__main__.py + test_schema_roundtrip.py nits.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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