Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ workflow-compute. The step owns product-capture-specific validation and submits
a generic provider workload using the `product-capture.browser.v1` contract.
`workflow-plugin-compute` should only provide generic dispatch/wait/catalog
plumbing.

BuyMyWishlist live wiring details are in
[`docs/buymywishlist-live-usage.md`](docs/buymywishlist-live-usage.md).
83 changes: 83 additions & 0 deletions docs/buymywishlist-live-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# BuyMyWishlist Live Usage

`workflow-plugin-product-capture` lets BuyMyWishlist submit product URLs to a
wfcompute deployment through a generic provider workload. BuyMyWishlist should
own the user-facing wishlist/product workflow; wfcompute owns task admission,
lease placement, agent execution, proof verification, and artifact retention.

## wfcompute Prerequisites

Before BuyMyWishlist enables live capture, the target wfcompute environment must
have:

- provider contract `product-capture.browser.v1` registered from this plugin;
- a network product such as `bmw-product-capture` whose provider config points
at `workflow-plugin-product-capture` provider `browser`;
- a digest-pinned provider image ref from this plugin release;
- a promoted provider package or runtime image available to agents;
- at least one online agent advertising executor provider
`product-capture-browser`, workload kind `provider`, execution tier
`sandboxed-container`, and proof tier `artifact-hash`;
- a scoped task token for BuyMyWishlist. Do not use a dashboard admin,
bootstrap, or operator token from the application.

The deployment is not live-ready until a BMW-shaped provider task returns an
accepted proof from a `product-capture-browser` agent in the target wfcompute
environment.

## Workflow Step

Use `step.product_capture` with a secret reference for the scoped wfcompute
token:

```yaml
steps:
- id: capture_product
type: step.product_capture
config:
server_url: https://<wfcompute-host>
auth_token_ref: secret:wfcompute_product_capture_token
product_id: bmw-product-capture
org_id: <org-id>
pool_id: <pool-id>
policy_id: <policy-id>
timeout_seconds: 120
url_field: product_url
allowed_hosts:
- www.amazon.com
- amazon.com
provider_image_ref: ghcr.io/gocodealone/workflow-plugin-product-capture/product-capture-browser@sha256:<digest>
capture_timeout_seconds: 60
max_html_bytes: 1048576
max_image_count: 8
poll_interval: 2s
wait_timeout: 5m
```

The step submits a generic `provider` workload with operation
`capture_product`. It does not call a product-capture-specific wfcompute API.

## Application Handling

BuyMyWishlist should treat the proof preview as user-confirmation data, not as a
silent purchase instruction. Expected fields include `title`, `canonical_url`,
`external_id`, `price`, `currency`, `seller`, `ships_from`,
`shipping_summary`, `image_url`, `images`, `availability`, and
`requires_user_confirmation`.

The app should persist the wfcompute `task_id`, `proof_id`, artifact hash, and
selected preview fields with the wishlist item. It should not store raw HTML,
provider cookies, wfcompute admin credentials, browser runtime paths, or
operator-only artifacts.

## Failure Handling

- If the step returns `error`, keep the wishlist item in a user-actionable
review state.
- If no accepted proof arrives before `wait_timeout`, retry by submitting a new
task rather than mutating the old task.
- If wfcompute reports no compatible agent capacity, keep capture disabled for
live traffic until the provider package and `product-capture-browser` agents
are promoted again.
- If the product URL host is outside `allowed_hosts`, reject it in
BuyMyWishlist before submission.
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ go 1.26.0

require (
github.com/GoCodeAlone/workflow v0.64.0
github.com/GoCodeAlone/workflow-compute v0.0.0-20260523064329-58fe23d9f596
github.com/GoCodeAlone/workflow-plugin-compute-core v0.4.0
golang.org/x/net v0.54.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/DataDog/datadog-go/v5 v5.8.3 // indirect
github.com/GoCodeAlone/go-plugin v1.7.0 // indirect
Expand Down Expand Up @@ -41,7 +42,6 @@ require (
github.com/cloudevents/sdk-go/v2 v2.16.2 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/danieljoos/wincred v1.2.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
Expand Down Expand Up @@ -96,8 +96,6 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ github.com/GoCodeAlone/modular/modules/eventbus/v2 v2.8.0 h1:buYs0TGNbAZgtTq1Qb+
github.com/GoCodeAlone/modular/modules/eventbus/v2 v2.8.0/go.mod h1:329flAKmwrPq2JEwu9iltWv6A83H/Di82Xze+kvdKDw=
github.com/GoCodeAlone/workflow v0.64.0 h1:2CpbYPwIqdGDb3xi3YJpwcteIum4ehBSrnRql/1YvB4=
github.com/GoCodeAlone/workflow v0.64.0/go.mod h1:659GGDrw3QJ7b625y9rf8QhKIpt1VCoEG0MxKu5tGQs=
github.com/GoCodeAlone/workflow-compute v0.0.0-20260523064329-58fe23d9f596 h1:+ydGmjmP5Sh7l/qdtC+k9G4S65Xxlkxie/fXoIg4fuk=
github.com/GoCodeAlone/workflow-compute v0.0.0-20260523064329-58fe23d9f596/go.mod h1:T8yGXrRBm2USwkRFvMaoq4aPDt/f7JciZY9Y/l/upYs=
github.com/GoCodeAlone/workflow-plugin-compute-core v0.4.0 h1:0jpBwHsX3YorjPWdz/rBs39TmgK+ipOttBJjRXF95gQ=
github.com/GoCodeAlone/workflow-plugin-compute-core v0.4.0/go.mod h1:1T6uCpUWPCNk6XPYgKq5CL/7LkD24MphKYsYVzF4jnI=
github.com/GoCodeAlone/yaegi v0.17.2 h1:WK6Y6e0t1a6U7r+S2dN3CGWW1PizYD3zO0zneToZPxM=
github.com/GoCodeAlone/yaegi v0.17.2/go.mod h1:z5Pr6Wse6QJcQvpgxTxzMAevFarH0N37TG88Y9dprx0=
github.com/IBM/sarama v1.47.0 h1:GcQFEd12+KzfPYeLgN69Fh7vLCtYRhVIx0rO4TZO318=
Expand Down Expand Up @@ -417,6 +417,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
157 changes: 0 additions & 157 deletions internal/plugin/client.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

"github.com/GoCodeAlone/workflow-compute/pkg/protocol"
"github.com/GoCodeAlone/workflow-plugin-compute-core/protocol"
)

const testProviderImageRef = "ghcr.io/gocodealone/workflow-plugin-product-capture/product-capture-browser@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Expand Down
2 changes: 1 addition & 1 deletion internal/plugin/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/json"
"time"

"github.com/GoCodeAlone/workflow-compute/pkg/protocol"
"github.com/GoCodeAlone/workflow-plugin-compute-core/protocol"
)

func buildTask(cfg taskConfig, workload protocol.WorkloadSpec) protocol.Task {
Expand Down
Loading
Loading