Skip to content

[Human Guide] Update Resource Pools pattern with affine + async interaction warning #55

Description

@hyperpolymath

Proposal

The current Resource Pools idiomatic pattern uses synchronous withFile. Real-world async game/server code consumes affine resources across await points, which raises a real design question: if the async is cancelled mid-flight while holding the affine Engine/File, what happens? AI.a2ml flags effect handlers as out-of-scope partly because "multi-shot resume of continuations that captured affine resources is a soundness hole" — same family of issue.

Source observation

The pilot's Boot.run returns a Result[StartupError, RunningGame] from an async context. The Engine is affine; if Boot.run's async is cancelled mid-init, the engine may be partially constructed. The current Resource Pools pattern doesn't address this — it's all synchronous.

What to add

Even if the answer is "design TBD; here's the risk" — naming the issue in the guide so migrators expect it is half the win.


Filed from idaptik Wave 3 pilot. See LESSONS.md and PILOT.md. Idaptik commit hyperpolymath/idaptik@aef38db.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions