Skip to content

fix(photos): validate orientation option - #102

Open
anmoljauhar1 wants to merge 1 commit into
Nutlope:mainfrom
anmoljauhar1:fix/validate-photo-orientation
Open

anmoljauhar1 wants to merge 1 commit into
Nutlope:mainfrom
anmoljauhar1:fix/validate-photo-orientation

Conversation

@anmoljauhar1

Copy link
Copy Markdown

Summary

Reject unsupported values passed to photos --orient instead of silently returning an empty photo list.

Previously, a typo such as --orient sideways produced valid-looking JSON with "picks": [], which could be mistaken for a search with no matching photos. The CLI now reports the supported values (landscape, portrait, square) and exits with status 2.

Changes

  • Validate --orient against the documented values before filtering the photo library.
  • Add Node.js built-in regression tests for rejecting an unsupported orientation and accepting landscape with matching results.

Verification

  • node --test skills/hallmark/scripts/tests/theme-photos-orient.test.mjs — 2 passed
  • node --check skills/hallmark/scripts/theme.mjs — passed
  • node skills/hallmark/scripts/refcheck.mjs — clean across 101 reference files
  • node skills/hallmark/scripts/theme.mjs validate skills/hallmark/references/themes/*.md — all 50 theme files validated

Notes for review

The documented usage lists landscape|portrait|square as the supported orientations. Invalid-value behavior is not otherwise explicitly specified, so this PR proposes rejecting unsupported values with a clear message rather than silently producing no results.

@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Together AI Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Author

Reproduction and verification

Before this change, running:

node skills/hallmark/scripts/theme.mjs photos "mountain landscape" --orient sideways --json

returned a successful-looking JSON result with an empty picks array, while --orient landscape returned matching photos. A typo in the orientation could therefore look like a genuine “no matching photos” result.

With this change, unsupported non-empty orientation values print the supported values and exit with status 2. The regression tests cover both rejection of sideways and successful landscape results.

Checks run locally:

  • node --test skills/hallmark/scripts/tests/theme-photos-orient.test.mjs — 2 passed
  • node --check skills/hallmark/scripts/theme.mjs — passed
  • node skills/hallmark/scripts/refcheck.mjs — clean across 101 reference files
  • node skills/hallmark/scripts/theme.mjs validate skills/hallmark/references/themes/*.md — all 50 themes validated

The current Vercel check is asking for Together AI team authorization; its bot message indicates a team member must authorize the deployment.

@anmoljauhar1

Copy link
Copy Markdown
Author

Hi maintainers! The local regression tests and validation checks pass. I noticed the GitHub Actions verify workflow is marked action_required, and the Vercel check requests Together AI team authorization. Could a maintainer please review whether the workflow needs approval and clarify whether the Vercel deployment check is required for this CLI-only change? Thank you!

This branch has not been deployed

No deployments
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