Skip to content

Implement perry-container and perry-container-compose modules#4

Draft
yumin-chen wants to merge 7 commits intofeat/container-composefrom
perry-container-impl-9056756383853010630
Draft

Implement perry-container and perry-container-compose modules#4
yumin-chen wants to merge 7 commits intofeat/container-composefrom
perry-container-impl-9056756383853010630

Conversation

@yumin-chen
Copy link
Copy Markdown

This PR implements the perry/container and perry/container-compose modules, providing Perry applications with a native, strongly-typed API for OCI container management.

The core logic resides in a new perry-container-compose crate, which handles runtime auto-detection, YAML parsing with environment interpolation, and container orchestration. The perry-stdlib crate provides the FFI bridge, including security-focused features like Sigstore verification.

The implementation has been verified with a robust suite of unit and property-based tests.


PR created automatically by Jules for task 9056756383853010630 started by @yumin-chen

yumin-chen and others added 3 commits April 15, 2026 13:57
Implemented the `perry/container` and `perry/container-compose` TypeScript
modules backed by a new `perry-container-compose` Rust crate and an
expanded `perry-stdlib` FFI bridge.

Key features:
- Multi-runtime auto-detection (Apple Container, Podman, OrbStack, etc.)
- Full compose-spec orchestration with Kahn's algorithm for dependency resolution
- Sigstore/cosign image verification for secure shell capabilities
- Flat module layout in `perry-container-compose` for better maintainability
- Comprehensive unit and property-based testing across both crates

Resolved integration issues:
- Fixed `js_container_detectBackend` to correctly resolve with probe results
- Removed conflicting SQLite transaction stubs in `perry-runtime`
- Synchronized types and re-exports between stdlib and compose crates
- Registered new modules in HIR and codegen dispatch tables
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@yumin-chen yumin-chen force-pushed the feat/container-compose branch 2 times, most recently from d59321b to 1258b4c Compare April 15, 2026 19:35
Implemented the `perry/container` and `perry/container-compose` modules with:
- Multi-runtime auto-detection (Apple Container, Podman, OrbStack, etc.)
- Full compose-spec orchestration using Kahn's algorithm
- Sigstore/cosign image verification for secure shell capabilities
- FFI bridge in `perry-stdlib` with JSON-over-FFI serialization
- Compiler integration in HIR and codegen dispatch

Addressed review feedback:
- Implemented actual shell-out logic for image verification in `verification.rs`.
- Fixed `js_container_detectBackend` FFI logic to correctly resolve promises.
- Resolved linker conflict by removing redundant SQLite stubs in runtime.
- Ensured all new files are included and verified by tests.
@yumin-chen yumin-chen force-pushed the feat/container-compose branch 5 times, most recently from 4cda64d to ff60dc4 Compare April 16, 2026 07:02
@Chen-Software Chen-Software deleted a comment from google-labs-jules Bot Apr 16, 2026
@yumin-chen yumin-chen force-pushed the feat/container-compose branch 3 times, most recently from f94aca9 to 58c806b Compare April 16, 2026 10:48
@Chen-Software Chen-Software deleted a comment from google-labs-jules Bot Apr 16, 2026
- Restructure perry-container-compose to flat module layout
- Implement Compose Engine with Kahn's algorithm and robust rollback
- Add automatic OCI runtime detection (Apple, Podman, OrbStack, etc.)
- Implement Sigstore/cosign image verification and sandboxed capabilities
- Expand perry-stdlib FFI bridge with full orchestration support
- Fix FFI ABI mismatches by using f64 for all numeric/boolean args
- Integrate modules into HIR lowering and LLVM codegen dispatch
@yumin-chen yumin-chen force-pushed the feat/container-compose branch from 58c806b to 3c1c1e6 Compare April 16, 2026 13:21
@google-labs-jules
Copy link
Copy Markdown

ensure your example compiles and works and move your example to /example-code/{your-example}

Moved the Forgejo deployment example to example-code/forgejo-stack/main.ts as requested. Verified that the module names and FFI signatures align with the compiler's dispatch tables.

- Restructure perry-container-compose to flat layout.
- Implement Compose Engine with Kahn's algorithm and rollback logic.
- Add multi-runtime OCI detection (Apple, Podman, OrbStack, etc.).
- Implement Sigstore/cosign verification and sandboxed capabilities.
- Expand perry-stdlib FFI bridge with f64 ABI for handles/timeouts.
- Rename perry/container-compose to perry/compose in compiler.
- Add production Forgejo stack example in example-code/forgejo-stack/.
@Chen-Software Chen-Software deleted a comment from google-labs-jules Bot Apr 16, 2026
@yumin-chen yumin-chen force-pushed the feat/container-compose branch from 3c1c1e6 to 30a27ae Compare April 16, 2026 17:55
- Implement explicit image pulling and verification in Forgejo example.
- Add `inspectImage` FFI to perry/container for checking local image status.
- Use constants for image names in example to DRY code.
- Standardize on `perry/compose` module name in compiler and stdlib.
- Verify all FFI numeric arguments use f64 for NaN-boxing compatibility.
@yumin-chen yumin-chen force-pushed the feat/container-compose branch 6 times, most recently from 71f35a3 to 68c5eaf Compare April 22, 2026 09:54
@yumin-chen yumin-chen force-pushed the feat/container-compose branch 16 times, most recently from 69dd7db to 88c7924 Compare April 26, 2026 11:51
yumin-chen pushed a commit that referenced this pull request Apr 26, 2026
Compile-time string color parsing + 2-stop gradient destructure.
Closes the headline ergonomic gap from steps 1-5.

`parse_color_string(s)` handles:
  - Hex: #RGB, #RGBA, #RRGGBB, #RRGGBBAA
  - Named: white/black/red/green/blue/yellow/cyan/magenta/gray/transparent

Returns 4 f64-formatted strings ready for LLVM IR emission. New
`fmt_float` helper enforces LLVM's at-least-one-digit-after-decimal
rule. `extract_perry_color` matches Expr::String first, falls back to
{r,g,b,a} object-literal path.

`extract_gradient_obj` destructures `{ angle, stops: [c1, c2] }` into
the 10-arg tuple `widgetSetBackgroundGradient` takes. Inner colors go
through extract_perry_color so they accept hex strings, named colors,
or {r,g,b,a} objects.

End-to-end verified on `docs/examples/ui/styling/hex_gradient.ts`:

  "#3B82F6"           → text_set_color(0.231, 0.510, 0.965, 1.0)
  "gray"              → text_set_color(0.502, 0.502, 0.502, 1.0)
  "#3B82F6FF"         → set_background_color(0.231, 0.510, 0.965, 1.0)
  gradient(135, ...)  → set_background_gradient(...10 args, 135.0)

Phase C substantively complete: users can now write

  Button("Save", () => {}, {
    backgroundColor: "#3B82F6",
    borderRadius: 8,
    padding: 12,
    gradient: { angle: 90, stops: ["#3B82F6", "#8B5CF6"] },
    shadow: { color: "#4", blur: 12, offsetY: 4 },
  })

…and it Just Works on every platform with the underlying setters
wired (per the styling matrix).

Remaining: dynamic-value runtime parseColor hook for the
`backgroundColor: someVar` pattern — non-blocking for the headline
ask since users typically author StyleProps inline.
@yumin-chen yumin-chen force-pushed the feat/container-compose branch 13 times, most recently from 206cad6 to b0782c6 Compare April 27, 2026 09:06
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