Skip to content

feat: add compose image transforms and explicit file export - #127

Merged
danielkov merged 2 commits into
feat/compose-files-phase-1from
feat/compose-files-phase-2
Sep 8, 2026
Merged

feat: add compose image transforms and explicit file export#127
danielkov merged 2 commits into
feat/compose-files-phase-1from
feat/compose-files-phase-2

Conversation

@danielkov

Copy link
Copy Markdown
Contributor

Summary

Add hidden image_rotate, image_crop, image_resize, and export_file callables that consume session-authorized managed File references. A complete pipeline runs in one compose invocation; only final returned references deliver pixels.

Depends on #126. This PR is intentionally based on feat/compose-files-phase-1, not main, and implements phase 2 of the compose-managed-files plan.

Impact

Transforms create immutable RGBA8 PNG snapshots after EXIF normalization. Explicit export preserves exact stored bytes and refuses existing destinations; interrupted exports may retain a partial file. PNG compressed profiles and compressed/international text metadata are rejected before decoding to bound ancillary expansion.

Technical details

  • Define clockwise rotations, nine crop anchors, integer rounding, and contain/cover/stretch resizing with Triangle filtering.
  • Reuse existing session authorization, durable storage, and compose delivery, including provider user-image fallback and replay.
  • Enforce decode, pixel, resize-scratch, estimated live-work, and encoded-output limits without changing dependencies or the persistent File envelope.
  • Export with process OS authority using disk-only create-new, private Unix permissions, and a documented cancellation/commit boundary. Export receipts contain path, byte count, and status rather than a File marker.

Subagent multimodality and generalized image presentation remain separate phases.

@danielkov

Copy link
Copy Markdown
Contributor Author

Local checks passed for 24746c29941e4489f87f14dcd7ec5e3d70c64532:

  • cargo fmt --check
  • scripts/tests/test_next_release_version.sh
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • RUST_TEST_THREADS=2 cargo test --locked: 1,148 library tests, 33 binary tests, and all integration suites passed. Five library helpers are ignored by the ordinary harness; the managed-file subprocess helpers are explicitly invoked by their parent tests.

Coverage includes all eight EXIF orientations, nine crop anchors, aspect/fit rounding, scratch/output-budget rejection, session authorization and immutable bytes, exact no-clobber exports, a real OS file-size-limit failure retaining partial output, unused effect execution, final-return-only image delivery, and replay after source/export deletion.

CI and actual current-head GitHub reviewer approval are tracked separately. This stacked PR depends on #126; no merge or auto-merge is authorized.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue: transparent PNG resizing filters straight-alpha pixels directly, producing dark halos or color bleeding at transparent edges.

Comment thread src/managed_files/operations.rs Outdated

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Sep 8, 2026

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@danielkov
danielkov merged commit c0d2139 into feat/compose-files-phase-1 Sep 8, 2026
9 checks passed
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