8000 Proposal: public, isolated integration testing for consumer Flows · Issue #139 · jiggy/jig · GitHub
[go: up one dir, main page]

Skip to content

Proposal: public, isolated integration testing for consumer Flows #139

Open

Description

@zvictor

ELI12

People building applications from Flows need to check that the real pieces work together when a service fails, a task is cancelled, or some files are already finished. Testing only ordinary functions can miss what happens when Jig actually runs the work.

Please assess a supported, reusable way to run these integration tests in a separate Jig project, with controlled local services and public execution APIs. Existing Jig capabilities appear to cover much of the task. A working consumer example and a few small helpers may be sufficient; a new testing framework should earn its complexity.

This is a developer-experience proposal, not a claim that Jig cannot test Flows or a confirmed runtime defect.

Consumer use case

A developer maintains reusable Flows that call other Flows, make HTTP requests, retain intermediate work, and deliver files. They need repeatable tests on supported hosts and CI that:

  • Execute the original Flow packages through Jig's real call graph and resource workers.
  • Replace only external service behavior with controlled responses.
  • Check completion, useful partial work, cancellation, recovery and cleanup through public interfaces.
  • Keep fixture bindings, local grants and test admission separate from the application's ordinary membership and operator configuration.
  • Require no model account or paid provider for deterministic integration cases. Live-provider checks remain separately selected and bounded.

The illustrative workflow below uses only synthetic records:

retrying caller Flow -> reader Flow -> reviewed loopback HTTP service

Application code owns the retry policy and record interpretation. Jig owns admission, child execution, resource access and lifecycle.

Lessons from consumer testing

Hands-on consumer exercises used a development build reporting Jig 0.1.0-alpha.54, FLOW SDK 0.1.0-alpha.15, and Bun 1.4.4 on Linux. Public source/guidance was checked on 17 November 2026 at 2aaf2624. That documentation revision is a reference snapshot, not a claim that a particular published archive was qualified.

  1. Discovery and test isolation need an intentional boundary. Discovering a test-only Binding alongside application Bindings while omitting its Flow produces PROJECT_BINDING_PACKAGE_MISSING. That is expected validation of inconsistent membership. Adding the fixture Flow to application discovery restores consistency, but a separate test consumer provides clearer ownership. This does not justify weakening membership validation.
  2. Calling a method with a fabricated or wrapped RunContext.call proves less than native composition. It can test transformation and retry logic while bypassing the corresponding host child-dispatch, contract-routing and HTTP-worker paths. Starting the outer harness in Jig does not make those substituted inner calls native integration evi 6529 dence.
  3. Lifecycle checks need to remain separate. An application outcome, delivered files, cancellation acknowledgement and confirmed cleanup answer different questions. Harnesses must retain the attempt identity, inspect settlement and preserve unresolved state; timing out a test does not make a possibly dispatched operation safe to repeat.
  4. Useful failure tests need a working baseline. Missing bindings, unavailable host prerequisites or malformed test setup are setup failures. A meaningful control changes a service response or interrupts actual work, observes the intended behavior, then restores the useful case.
  5. Consumer scaffolding is easy to duplicate. Selecting a dependency closure, keeping workspace dependencies declared, reviewing exact fixture routes, checking the approved revision, polling bounded attempts, recovering files and managing teardown require substantial harness code. This is a candidate for reusable public guidance/helpers, rather than importing Jig's private test machinery.

These are generalized technical observations. The scenarios below are proposed acceptance tests; a runnable miniature for them has not been executed for this report.

Existing mechanisms to build on

  • Project membership and workspace Flow dependencies support separate consumer declarations and exact implementation selection.
  • HTTP Request already permits reviewed HTTP endpoints at numeric loopback addresses. A scripted local server could exercise the real HTTP worker with an ordinary exact grant.
  • The application client is the appropriate public boundary for attempt ownership, observation and recovery.
  • Jig's own HTTP lifecycle tests demonstrate relevant internal coverage. The request is for an ordinary external consumer experience, without depending on repository-private helpers or administration APIs.

The existing preparation-limit controls also address larger selected libraries; increasing those limits is not the requested improvement.

Requested outcome and first acceptance cases

Please establish an ordinary consumer testing pattern that reuses the actual Flow packages and keeps its own reviewed configuration and execution state. It should work with an existing test runner, use public Jig interfaces, and avoid rewriting application implementations or replacing their runtime contexts.

A small self-contained example could use a loopback service returning the synthetic record {"id":"example","value":"ok"}:

Case Observable result
Useful case: HTTP 503 followed by HTTP 200 The real retry and reader Flows return the record; the service records exactly two requests.
Persistent HTTP 503 with a declared three-attempt application budget Requests stop at that budget; the application's declared failure outcome remains visible.
A completed response with malformed record content The real parser/validation path rejects it; the test does not count an unrelated setup error as success.
Cancellation after one record is retained and a second request has arrived but is deliberately held Completed work remains inspectable; the original attempt reaches its reported settlement/cleanup state before fixture teardown.
Restore the original service behavior A new, explicitly started case passes with the unchanged application Flow implementation. Uncertain earlier work is not resubmitted.

Fixture synchronization should use observed request arrival rather than arbitrary sleeps. The example should explain the supported host prerequisites, exact installation/build steps and versions, workspace declarations/lock handling, review and invocation commands, bounded test deadlines, retained output inspection, and failure teardown. Concurrent suites should own separate state and endpoint instances.

Reports/assertions should identify the tested Flow revision and selected fixture routes, and distinguish domain outcome, execution status, artifact delivery and cleanup. A fixture-backed result establishes controlled integration behavior; live service behavior and Agent judgment quality need separate evidence.

Suggested scope and maintainer request

Start with a documented, executable consumer example and evaluate the repeated work it exposes. Add small public helpers where they materially reduce consumer burden. Please choose the appropriate API or CLI design; this proposal does not prescribe profile inheritance, arbitrary runtime overrides, a new host-only contract implementation, or a separate assertion framework.

Keep ordinary review, exact dependency selection, grants, contract checks and lifecycle guarantees in force. Host-specific execution policy belongs to Jig; portable SDK/protocol testing remains a separate FLOW concern. Existing runtime fixes and host-conformance work should be reused rather than duplicated. This proposal does not block independent consumer work.

Recipient/fix repository: https://github.com/jiggy/jig

Please assess the proposal against Jig's goals, product compass, repository instructions, contribution guidelines and current public behavior. Determine whether a documentation improvement, reusable helper or other product change is warranted, considering maintenance cost and harmful effects. Treat the suggested design as a hypothesis and check for relevant existing work.

If a beneficial change is justified, implement the smallest suitable improvement, add appropriate tests/docs, run the required checks and open a PR for review. If the existing public experience already meets this need, demonstrate the supported approach; if no change is suitable, explain why and identify a better alternative. Ask specific questions if essential technical context is missing.

Originating report and return location: #139

Please comment on #139 with the assessment, any improvements, PR/commit links, verification and remaining limitations. Preserve this return URL in any copied handoff.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0