# Fluid portals and open reservoir boundaries

**Plan status:** `Deferred` — implementation proposal awaiting explicit admission; the user authorized chapter/plan publication, including PR creation, merge and deployment after checks pass; production implementation remains unadmitted.

**Current phase:** M0 scientific, ownership and publication review.

**Next slice:** M1, one complete minimal periodic MAC vertical capability, only after M0 closes and the user admits this plan for implementation.

**Acceptance status:** `pending` for the fluid feature. No portal numerical acceptance exists.

**Execution ledger:** [execution-ledger.md](execution-ledger.md). **Issues:** [issues.md](issues.md). **Standards and ownership:** [reports/standards-and-design.md](reports/standards-and-design.md). **Verification:** [reports/verification.md](reports/verification.md). Mathematical owner: [Chapter 40](../../research-book/chapters/40-fluid-portals-and-open-boundaries.md); source/license owner: [scope guide](../../research-book/implementation/fluid-portals-sources-and-scope.md).

## Objective and user intent

Allow a Rheon user to choose how selected domain faces exchange fluid. A periodic pair returns the same outgoing material and transported momentum through its opposite face. An open reservoir allows a wake to leave the retained domain, supplies coherent incoming fluid and hydrostatic support, and does not recycle the wake. The motivating propeller should be distinguishable in a recirculating tunnel and a finite approximation to surrounding open water. Gravity is retained physically; pressure equilibrium, not force-origin filtering, prevents a spurious rest current.

The outcome includes core public stepping, the real native-carrier desktop/worker route, validated face controls, saved intent and cold inspection. Headless topology alone is not completion of the user-facing milestone. Periodicity alone does not close the open-water objective. Actual propeller/boat thrust calibration, free-moving rigid-body reaction and infinite-domain accuracy are separate capabilities.

## Authority, repository basis and constraints

Baseline main is `f95cac0dbc7b283370fb0e9a845599db613d79de`, containing the 24-path FEM PR147 integration. At initial inspection UI PR146 at `1adc7980a2adbbd09ee63eba48635faf25ef7781` was open/unmerged. It subsequently merged to main `b9218038d138d1c73818cf4158757521853a5cd7`; this accepted main is integrated unchanged for publication. The portal contribution remains documentation-only against that main. GPU chapters 37–39 remain separate unpublished research; this chapter is 40. No ancestor/repository `AGENTS.md` or applicable `.agents/skills` file was found. [Repository inventory](../../research-book/sources/fluid-portals-repository-audit.json) pins exact inspected bytes.

Rheon declares Apache-2.0; Rust is pinned to 1.92.0/edition 2024 with unsafe code forbidden. Existing dependency/feature contracts, allocation/cancellation/accepted-state ownership, numerical residual/divergence limits and source-admission gates stay authoritative. Generated fields, numerical logs, recordings, PDFs, browser receipts and archives belong in fresh disposable output, not commits. No historical result or generic proof count may be relabelled as portal qualification.

The adopted [Coding-Standards](https://github.com/MrScripty/Coding-Standards/tree/188beda1fa477d21d576c233dd8c7f4c4c267d23) revision is `188beda1`; its Core/Router/Planning/Architecture/Documentation files are identical to inspected current `0fc92a2`. This is source-guided standards application, not an engine certificate. Documentation preparation does not authorize production implementation, broad experiments, a main merge, Pages deployment or changing any acceptance threshold. Parent owns serial publication/integration.

## Current-code inventory and consequences

| Owner | Observed baseline contract | Required disposition |
| --- | --- | --- |
| `src/geometry.rs`, `src/operator.rs`, `src/pressure.rs` | Rectangular MAC geometry; connected sealed box pressure; gauge cell zero and RHS compatibility; opt-in slab/column pressure domains; Jacobi/SGS-PCG variants. | Geometry retains coordinates; validated boundary topology owns adjacency/face identity. Derive pressure, correction, compatibility and gauges from that same topology. Qualify a method per supported domain. |
| `src/sampling.rs`, `src/advection.rs` | Clamped RK2 departure/interpolation; default normal boundary velocities zero; appearance tracer and velocity are semi-Lagrangian, not integral-conservative transport. | Periodic stencils and trajectories must cross the seam. Introduce conservative periodic scalar/dual-momentum transport as part of M1; keep sealed appearance transport's existing meaning. |
| `src/box_flux.rs`, `src/box_flux_step.rs` | Uniform prescribed normal speed on each complete face; balanced net flux required; pressure work/residual ledger; `ClampedAppearance` tracer policy. | Preserve this controlled-flux API. Do not reinterpret it as periodic or reservoir. Reuse its affine flux/work principles under the new owner rather than duplicate closed pressure internals. |
| `src/liquid_volume.rs`, `src/liquid_step.rs` | Donor-cell liquid amount; inflow fraction and outflow volume ledger; separate carrier/interface composition and unsupported combinations. | Add periodic transfer to its one-face/one-transfer ledger. Start fully filled with constant hydrodynamic density; do not imply mixture inertia from a passive fraction. |
| `src/simulation.rs`, `src/forces.rs`, `src/force_field.rs`, `src/session.rs` | Candidate preparation and one accepted publication; immutable force snapshots; configured provider composition rejects boundary/surface path. | Same owner atomically publishes boundary snapshot, fields, time and ledger. Never expose candidate portal state, silently remove mean thrust or let a sealed provider solve a periodic/reservoir request. |
| `src/viscosity.rs` and existing wall/column operators | Qualified scopes differ; current whole-box viscosity is not an open-traction solver. | M1 excludes viscosity and declares unsupported composition. M2 must derive pressure/viscous boundary splitting together before positive-viscosity backflow support. |
| `src/particle_fluid.rs`, `src/material.rs`, `src/material_session.rs` | SPH preview; clipped liquid EOS, ideal-gas pressure; gravity plus pair/authored forces; box clamp/contact response; no periodic images or reservoir lifecycle; `(run_id,index)` is append-only. | Particle mode remains unsupported for portals until M3/M4. Periodic neighbors precede center wrapping. Exit/birth/reuse requires its own identity and ledger contract. |
| `src/bin/rheon-desktop.rs`, `src/bin/desktop/{settings,inspector,run_sets}.rs`, `run_sets/{source,configured}.rs` | Real Worker owns launch/cancel/recording; native/configured saved contracts are versioned; previews are distinct from physical fields. | Add controls to the actual supported native-carrier route and capture typed boundary intent. Use the accepted PR146 owners and recheck later changes before implementation; do not fork its Scene/selection/worker owners. |
| `src/recording{,/carrier,/provider,/material}.rs`, VTK readers | Accepted publications and immutable cold inspection, canonical stages/units; generic SQLite container version 1 has typed solver profiles. | New boundary-aware solver/profile metadata must be decoded with original fields. Do not alter old profile interpretation or invent integrator restart from an inspectable archive. |

The original inventory above is pinned to f95cac0. Publication integration with b9218038 adds accepted Scene/force controls, immutable force snapshots through native-carrier/material Worker and Inspector paths, and distinct native frozen-intent v1/v2 semantics while retaining run-set manifest v1. The production force policy now selects Validated for its supported native/material owners; configured/session/provider/free-surface/AI owners remain unsupported. These are PR146 capabilities, not portal support or acceptance. Future boundary controls must extend those accepted owners and preserve their versioned custody. The pinned [integration addendum](../../research-book/sources/fluid-portals-repository-audit.json) records selected updated paths. Core boundary/pressure/transport/particle/EOS files used in the scientific analysis are unchanged by this integration.

## Scope and non-goals

M1 supports a filled constant-density rectangular MAC domain, one matching translation-periodic axis, homogeneous stationary free-slip side walls, no viscosity/interface/obstacle/provider composition, finite forces and zero gravity component along the periodic axis. One verified native Jacobi-PCG implementation is sufficient initially; request of unqualified SGS/domain combinations returns unsupported. Other axes and viscosity are extensions, not silent approximations. Supported forcing may have net impulse: the mean flow must then accelerate according to its budget.

M2 adds selected whole-face hydrostatic reservoir openings in a filled single-density domain with a common stationary exterior, equal-density incoming scalar/material labels and local bidirectional flow. Begin with a positive-viscosity Newtonian traction formulation only after its discrete splitting is derived; a plain pressure-Dirichlet projection is a restricted comparison baseline, not accepted general backflow support. Extending this to an inviscid configuration requires a separate normal-stress/characteristic analysis. All six faces may be opened after mixed/corner tests pass; the top remains submerged unless a later interface milestone says otherwise.

M3 adds translation-periodic SPH neighbors and particle transport. M4 adds buffered particle reservoirs. Partial patches, arbitrary rotations/nonmatching maps, moving portals, general free surfaces/two-phase inertia, capillary exits, cavitation, compressible acoustic accuracy, infinite-ocean guarantees, GPU/model-provider support and artistic wake reset/filtering are deferred. No portal or advection production code is part of this documentation PR.

## Binding design decisions and ownership

| Decision | Owner | Reason / preserved contract |
| --- | --- | --- |
| Two modes, periodic versus reservoir | Numerical domain owner | Different topology, state and energy exchange; no universal “portal strength.” |
| One validated boundary configuration and immutable per-step snapshot | Core boundary owner, consumed by existing Simulation/Session | Pressure, sampling, transport, force-domain handling and reports cannot observe different face categories. |
| Complete conservative periodic transport in M1 | MAC transport owner | Returning a displayed marker or dye while losing momentum is insufficient for the stated periodic flow objective. No total-energy conservation guarantee for dissipative upwind transport. |
| Single conservative transfer and one inertia owner per seam | Topology/transport owners | Opposite signed cell updates and no doubled seam mass/energy. |
| Pressure gauge depends on connected/anchored component | Pressure owner | Pure periodic/Neumann compatibility is distinct from pressure anchoring; never hide incompatible flux by shifting RHS. |
| Native-only supported first path | Existing Worker/Session/recording owners | A sealed learned provider cannot be reused under changed operator semantics by geometry shape alone. |
| Hydrostatic reference is physical data, not a force filter | Reservoir/force owners | Same gradient/gravity samples; reduced/full pressure interpretation retained for inspection. |
| No new global runtime registry or persistence subsystem | Existing composition/store owners | There is one current simulation and existing saved-run/recording infrastructure. Additional universal machinery would obscure authority. |
| Immutable topology during a run initially | Session and host controls | Mode/partner/hydrostatic-reference edits create a new validated run; no mid-CG topology edits or guessed migration. |

These are proposed decisions. No code API or persisted format is accepted by this plan's publication alone.

## Core and host API boundary

Proposed `src/boundary.rs` owns validated whole-face semantics, reciprocal-pair validation, unique face ownership and coordinate transforms. A small public construction input describes the six faces; validated `BoundaryConfig` and derived `BoundarySnapshot` expose read-only facts. A private topology assembly owns neighbor lookup and unique unknown-face indexing. Domain types have no UI, filesystem, process-global selection or compulsory serde dependency. Current `GridGeometry` remains physical coordinates; periodic topology must not silently alter saved geometry.

`Simulation`/`LiquidTransportSimulation` own construction, candidate state and the accepted commit. An additive boundary-aware constructor/step capability may use `BoundaryConfig`; the existing constructor means exactly the existing sealed profile. `SimulationSession` remains time/generation/stop/deadline/publication owner. Separately capped workspace construction happens before stepping. Pressure scratch is not accepted state; the snapshot/report is published only after all existing pressure, stored-field divergence, transport, finite-value and budget gates succeed.

Internal operator/sampler/transport consumers receive the same validated immutable snapshot and geometry, not six unrelated flags. Force evaluation uses the correct periodic boundary unknowns and returns physical impulse/work. Old sealed `BodyForce` behavior stays unchanged. The report includes topology identity, accepted boundary revision and pressure convention; no reclassification from preview voxels is allowed.

A mode-specific support query returns supported or an explicit unsupported reason before allocating or launching work. Invalid data, unsupported valid mode/domain, unavailable required state, capacity failure, numerical rejection and cancellation preserve their distinct existing error categories. No fallback to sealed walls, zero scalars, old pressure or another solver is allowed merely to obtain a successful step. Qualified solver selection can fall back only within the same declared physical operator and its existing contract.

### Per-face configuration and serialization

The host owns a strict DTO and versioned frozen intent; the core owns semantic construction. Use the existing optional host serde and digest facilities rather than making the reusable core depend on JSON. This table is a semantic schema proposal, not pseudocode or a generated executable contract.

| Field | Meaning / validation |
| --- | --- |
| `schema_version` | Boundary payload version 1; unsupported versions return unsupported, never attempt another parser because a field is invalid. |
| `faces` | Exactly `x_min`, `x_max`, `y_min`, `y_max`, `z_min`, `z_max`; reject missing, duplicate and unknown faces/fields. Coordinates are physical SI. |
| Face `mode` | Tagged wall, periodic pair, prescribed flux, or hydrostatic reservoir. Only implemented milestone variants are enabled. No unrelated parameters accepted for a variant. |
| Periodic `partner_face` | Opposite face on the same axis with a reciprocal declaration; matching full area/counts. Translation is derived from geometry, not a freely authored offset. M1 permits one pair. |
| Wall policy | Stationary impermeability; M1 tangential free-slip. A requested no-slip or moving wall needs its qualified viscous/moving profile. |
| Controlled flux | Existing outward-speed convention in m/s; retain existing balanced fixed-volume constraint. This mode is not required to broaden M1. |
| Reservoir reference | One shared density, gravity vector and reference pressure at an explicit reference point/water level; pressure convention full or reduced; matching incoming scalar state. Reject conflicting per-face hydrostatic references. |
| Exterior velocity/current | Rest reference in M2. Later current is a matching/incoming datum, not an independent normal-velocity prescription over pressure. |
| Numerical outlet policy | Explicit qualified traction/backflow scheme and parameters with units, not hidden “auto” damping. Unavailable/unqualified schemes cannot execute. |
| Snapshot identity | Derive canonical material identity from validated geometry, topology, boundary data and scheme convention; use existing digest ownership. A host source ID/version labels provenance, not authenticity. |

Decode finite numbers, positive density/spacing, admissible fractions, vector frames, units, reciprocal relationships and supported compositions before allocating/launching. Canonical identity distinguishes signed-zero behavior where existing saved contracts do; choose and test the precise encoding under the saved-intent owner, not independent ad hoc hashing in every consumer. Pressure reference changes invalidate the corresponding accepted context even if cell counts are unchanged.

### User interaction and durable state

The native-carrier controls show all six face modes. Selecting a periodic axis updates both faces in one draft edit; users cannot commit a half-pair. Unselected faces are explicit walls. Reservoir controls show the common water-level/reference state and per-face openness. Invalid drafts do not mutate accepted/frozen intent. Apply/reset starts a new validated run; the UI shows the active mode and actual accepted budgets. Do not place a working control in unsupported particle/configured-provider modes; show their specific unsupported state.

The existing Worker freezes this intent before launch and sends it to the existing Session. Selection/viewport/preview are consumers of the same accepted report; camera movement does not advance physics. Save, close producer and cold-open must retain face topology, pressure interpretation, physical fields, actual intervals, ledger and unsupported-feature declarations. A new-version rerun uses the boundary-aware constructor; a recording alone is not an integrator checkpoint.

Keep SQLite container version 1 when its existing generic typed fields/metadata suffice; add a distinct boundary-aware solver profile and its decoder rather than relabelling old carrier/provider/material profiles. If storage invariants cannot represent the required state, stop and design an owned migration instead of assuming a new schema is enough. Frozen native/configured run-set versioning is owned separately from the recording container. Choose an additive tagged boundary-aware intent/version only after inventorying supported readers; old explicit versions continue their exact sealed meaning. Missing boundary data in an old recognised sealed profile means that historical profile, not a default for an unknown new profile. Older readers must refuse unsupported new variants. Never rewrite historical archives/hashes or infer boundary intent from a video/preview.

## Numerical implementation contract

### M1 pressure, sampling and conservative transport together

One seam has one velocity unknown and full dual mass. Pressure incidence joins the last cell to the first with opposite signs; any duplicated storage end samples are derived aliases, excluded from reductions. Domain bounds remain half-open for wrapped coordinates; finite multi-length departures reduce to the same periodic location. Periodic extension occurs at every RK/interpolation/reconstruction evaluation, not only the final particle/trajectory endpoint. Transverse walls keep their declared extension.

Use the same positive areas, distances and density in integrated divergence, gradient, graph operator and correction. Validate compatibility and one gauge on each unanchored connected component, including one-cell self seams and two-cell parallel edges. Jacobi-PCG is the initial supported periodic pressure method. Existing SGS is not declared supported until its cyclic topology/order dependencies are independently checked. Full residual and all-cell stored-f32 divergence remain separate acceptance gates.

Select first-order conservative donor-cell scalar/liquid-amount transport and MAC dual-control-volume momentum transport for the new periodic profile. For a component's dual face, construct the advecting volume flux as the arithmetic average of the two adjacent primal fluxes displaced in that component's direction, with periodic identification and zero transverse wall flux. The interior dual divergence is the corresponding average of the two primal divergences. Compute each dual momentum flux once using the upstream component velocity, then apply opposite signed impulses to its neighboring dual volumes. Use the mass/dual geometry used by the pressure-work ledger. The initial supported periodic-axis momentum has no unaccounted side-wall tangential impulse under the declared inviscid free-slip scope. Other components retain explicit wall pressure reactions; do not assert full vector momentum is constant in a walled tunnel.

Before implementation is accepted, independently derive/test the boundary and seam completion of this dual-flux construction, its CFL restriction and constant-state preservation. Do not mix current clamped semi-Lagrangian velocity advection with a claim of conservative momentum. Preserve that appearance path for existing sealed consumers; do not change its historic output to make periodic tests pass. Scheme-specific kinetic dissipation is measured; the exact pressure-substep energy proof does not qualify the whole split step. Net propeller force appears as a mean impulse/acceleration, not a hidden velocity subtraction.

### M2 hydrostatic reference and backflow

Use one exterior reference with hydrostatic pressure gradient equal to density times gravity. Full-pressure and reduced-pressure representations must produce the same supported rest state; removing the reference gravity algebraically and then applying full gravity again is invalid. Use half-cell reservoir pressure distance, include each provisional open flux once, anchor pressure only on components reaching reservoirs, and keep per-component compatibility/gauges elsewhere. Do not mean-shift a pressure RHS to repair a flux defect.

Adopt the negative-part full-vector traction family analysed in Chapter 40 as the first positive-viscosity candidate, with a stationary hydrostatic exterior. Derive its pressure/velocity boundary substeps from the same symmetric stress, predictor and stored-face metrics. The full vector condition needs a compatible viscous traction; simply setting viscosity to zero can impose unintended tangential restrictions. No inviscid backflow support is inferred. Outgoing transport uses interior state; incoming material/scalar state comes from the reservoir. Exterior current remains deferred until its incoming momentum/power model is derived.

M2 cannot proceed beyond a restricted pressure-opening baseline until the actual time-discrete boundary work and stability estimate are written, reviewed and tested. If the candidate cannot fit Rheon's split scheme consistently, re-plan between an explicitly derived alternative pressure/traction split and a coupled velocity-pressure solve; do not silently clamp backflow or retune damping. All-face openness requires coherent corner extensions and balanced total flux. Opening every face is not a free-surface feature or a domain-size guarantee.

### Conservation, impulse and work ledgers

The accepted step records old/new physical inventory and independently accumulated terms: entering/leaving volume; each carried material amount; body/actuator impulse; advected momentum; wall/pressure/viscous traction impulse; kinetic energy; pressure/traction work; force work; advected kinetic energy; viscous and upwind dissipation; any stabilizer/sponge work; potential-energy convention; pressure-correction/divergence/rounding defects. Report each term's discrete definition and units. Avoid an asserted thermodynamic total-energy budget where the preview has no energy equation.

Periodic face transfers cancel globally in common coordinates; rotated portals, if later admitted, require separate mapped world-momentum impulse/work. Reservoir budgets need not be zero: physical exchange is expected. Shared transfer ownership prevents double-counting at edges. Existing numerical gates stay unchanged; any new acceptance criterion/tolerance needs an independently justified definition and later explicit approval. A budget computed as a residual of itself is not an independent deciding oracle.

### M3/M4 particle obligations

M3 wraps positions but retains mass, velocity, temperature, material and stable identity. Neighbor images/minimum-image distances participate in density and pair forces before center crossing; specify support/domain-size restrictions, corner images and self/double-count prevention. Images are support, not physical inventory. Keep append-only IDs when wrapping; no slot reuse is needed.

M4 defines an interior control surface and kernel-support buffer of justified width. Outgoing fluid remains available until it no longer supports interior kernels. Incoming mass/volume demand accumulates fractionally and births use an admissible EOS/hydrostatic/material state and spacing. Reverse flow has one ownership event; it cannot duplicate, reset or prematurely delete a particle. Support radius, neighbor structure, buffer capacity and timestep/crossing bounds are preflighted. Capacity/cancellation rejects the candidate transactionally, preserving accepted particles and IDs.

Before deletion/recycling, replace `(run_id,index)` with an explicitly versioned stable-ID/generation model for the new particle profile, preserving old append-only archives. Record birth/exit mass, represented volume, momentum and available energy terms at named stages. Current diagnostics are pre-integration while positions are post-integration; do not pretend they are simultaneous. Particle boundary physics remains independent of MAC pressure-provider APIs. No emitter disguise substitutes for an exterior reservoir.

## Dependency graph and milestones

The dependency graph is M0 → M1 → M2; M1 → M3; M2 plus M3 → M4. M5 advanced geometry/surfaces depends on whichever accepted MAC/particle stages it extends. This specifies semantic dependencies, not Git parentage, commit count or branch-per-stage policy. Parent integrates serially after current-source review.

| Milestone / state | Goal and coherent unit | Allowed future write set | Gate and reopening condition |
| --- | --- | --- | --- |
| M0 / `Verifying` manuscript only | Review Chapter 40, this proposal, source/license facts, API ownership, dual-momentum closure and open-traction scientific gate. | Current documentation write set below only. | Document/source/math review and publication checks. Implementation remains Deferred; unresolved boundary derivation stops its dependent stage. |
| M1 / `Deferred` | Complete one-axis periodic constant-density MAC from face controls through Worker/Session, conservative flow/material transport, accepted reports and saved/cold intent. | `src/{boundary,operator,pressure,sampling,advection,liquid_volume,liquid_step,simulation,session,forces,lib}.rs`; private boundary/transport submodules if needed; `src/recording.rs`, `src/recording/carrier.rs`; `src/bin/rheon-desktop.rs`, `src/bin/desktop/{settings,inspector,run_sets}.rs`, `src/bin/desktop/run_sets/{source,configured}.rs`, proposed `boundary_controls.rs`; focused `tests/{boundary,periodic_transport,periodic_session,recording}_contract.rs`; bounded example; `docs/api/` boundary/recording descriptions and this plan. No unrelated worker/Scene rewrite. | A1–A4 and A8; actual native-carrier workflow/cold read. Reopen for unavailable dual conservation, unexpected supported-consumer propagation, changed UI owner or insufficient profile encoding. |
| M2 / `Deferred` | Selected whole-face positive-viscosity hydrostatic reservoirs with qualified bidirectional backflow; add all-six-face support only after corners. | M1 numerical/host owners plus `src/viscosity.rs` and its focused tests; `tests/{reservoir,hydrostatic,backflow}_contract.rs`; boundary-aware recording profile; bounded example/API/plan. | A5 and A8; reviewed discrete estimate, lake-at-rest, vortex/backflow, mass/work and mixed faces. Reopen for inconsistent splitting, inviscid request or sensitivity beyond declared domain. |
| M3 / `Deferred` | Complete translation-periodic SPH neighbor support and particle/recording path. | `src/{particle_fluid,material,material_session,boundary,lib}.rs`, `src/recording/material.rs`, existing host boundary controls/Worker/inspector; `tests/particle_periodic_contract.rs`; material API/plan. | A6/A8; no density seam, pair impulse/image accounting and stable identity. Reopen if support exceeds unique-image assumptions. |
| M4 / `Deferred` | Buffered open particle reservoir with birth/exit lifecycle and coherent cold inspection. | M3 owners plus versioned particle profile/IDs and focused reservoir/recording tests; no new archive store. | A7/A8; rest, reverse flow, fractional demand, capacity/cancellation and identity/history tests. Reopen for EOS equilibrium or discretization instability. |
| M5 / `Deferred` | Separately admitted patches, arbitrary rotations, moving portals, variable density/free surfaces, advanced radiation/sponges. | No implementation write set admitted. | New design/scientific evidence and owner review required. |

These are bounded ownership sets, not permission to edit them now. A directly affected new internal file can be added under the same owner when its obligations remain unchanged; a new public/persisted/physical promise triggers re-planning. Core and host work forming a user-visible capability stay together for review; unsupported partial paths remain unavailable.

## Objective acceptance and bounded evidence

Every row is future, unexecuted fluid-feature evidence. No current numerical limit is modified. Documentation checks below cannot satisfy these rows.

| ID | Observable criterion | Kind | Environment | Mode | Status | Evidence |
| --- | --- | --- | --- | --- | --- | --- |
| A1 | One-axis periodic topology, pressure/correction/sampling agree; tiny independent matrices have correct gauge/nullspace and stored divergence. | focused | Linux CPU, pinned Rust | automated | pending | Future independent exact/dense oracle, not reuse of assembly. |
| A2 | Material and periodic-axis momentum crossing the seam have conservative shared transfers; uniform state and forced mean impulse obey analytic budgets. | integration | Linux CPU | automated | pending | Future translated packet, impulse and one/two-cell seam cases. |
| A3 | Real native-carrier face edit → frozen Worker intent → Session → accepted report → selected preview/inspection; invalid/unsupported mode is refused before launch. | user-workflow | supported native desktop/display | automated plus manual observation | pending | Future actual control workflow; headless UI state alone insufficient. |
| A4 | Save, terminate producer, cold-open and supported exact rerun retain boundary intent and accepted fields; old sealed versions retain original interpretation. | system | real SQLite/filesystem, fresh process | automated | pending | Future version/identity/corruption and no-fallback cases. |
| A5 | Reservoir lake-at-rest, exiting vortex, reversal, mixed/all-open faces satisfy derived flux/work/stability requirements in the declared domain. | focused | Linux CPU | automated | pending | Future analytic rest and independently bounded domain comparison; no universal ocean claim. |
| A6 | Periodic SPH density/force support and center transfer agree; image mass excluded and pair impulse correct. | integration | Linux CPU | automated | pending | Future kernel-complete seam/corner and stable-ID tests. |
| A7 | Particle reservoir births/exits/reversal/capacity preserve accepted-state and inventory/identity ledgers. | integration/contract | Linux CPU and cold reader | automated | pending | Future fractional-mass demand and failure-stage tests. |
| A8 | Applicable fmt/Clippy/contracts and unchanged sealed/native/configured/material consumers pass; independent scientific/source review limits are resolved. | integration | pinned supported feature matrix | automated/review | pending | Future source-specific evidence, not total test-count inference. |

Proposed resource envelopes must be confirmed before execution: exact algebra ≤4 cells; first operator cases ≤4³ cells/4 projections; first periodic trajectory ≤8³ cells/32 accepted intervals; initial particle cases ≤256 physical particles/32 accepted steps plus separately capped images/buffers. Use unchanged residual/divergence settings and named iteration ceilings at or below existing caller limits. A first subprocess has a 30 s wall deadline, 20 CPU seconds, 512 MiB address-space ceiling, 128 MiB numerical-allocation cap and 1 MiB log/file caps; outputs use a fresh owned directory and a declared aggregate cap. These are proposed campaign bounds, not a claimed current hard-cap implementation. If unsupported platform limit enforcement or sufficient scientific fidelity cannot fit, stop and seek an explicitly revised envelope. No broad propeller sweep, large-domain refinement or GPU work is implied.

Begin with manufactured hydrostatic pressure and uniform periodic transport; then controlled channel, weak exiting vortex/wave and reverse flow. Independently derive the deciding oracle: face cancellation and exact matrices, analytic mean acceleration, Poiseuille only for the correct no-slip/viscous model, acoustic invariants only for WCSPH, free-surface invariants only for a later surface model. Measure pressure residual, stored divergence, material/impulse/work and interpolation errors separately. Domain-size and space/time refinement are distinct axes; proposed propeller studies require separate duration/cost admission. Preserve failed runs and actual accepted dt; no rebaselining current tolerances or synthetic expected outputs from the same solver.

## Simplicity and composed-design review

**Applicability:** `applicable`. This proposal changes a numerical seam and its public/configuration/recording consumers; the complete produced capability is assessed below.

1. **Independent concerns/dimensions.** Physical boundary policy says what exterior is modelled and why. Core topology says where faces/cells connect and how flux is owned. Session says when state becomes accepted and who can stop it. Transport/pressure/viscosity own their equations. Host controls and persistence own representation and lifetime, not physics. The data shared between them is one validated immutable boundary snapshot.
2. **Required versus accidental interleavings.** Geometry/topology, pressure convention, force/reference state and accepted interval must agree; this interleaving is inherent. Camera/preview resolution, JSON field ordering, global selection and model-runtime state must not decide physical face ownership. Versions have separate roles: boundary payload semantics, solver profile, frozen intent envelope and SQLite container. A new snapshot invalidates its pressure history; it need not create an independent registry or cache generation per face.
3. **Caller/composition knowledge.** Callers choose physical faces/reference, supply limits/forces and request a supported profile. They need not know ghost-array order, gauge representative, incidence signs or periodic end duplication. They do need explicit unsupported combinations, snapshot immutability, actual dt and failure/recording outcomes. The existing Worker is the composition root; it does not reimplement validation or pressure topology.
4. **Representative change paths.** Another periodic axis changes topology validation, momentum/sampling domain tests and supported-profile declarations, not archive storage. New reservoir constitutive/backflow law changes numerical boundary/pressure-viscosity coupling and that scheme's evidence, not camera/selection. New saved-intent version changes DTO/decoder and cold-consumer tests, not the mathematical operator. Particle birth changes material identity/profile and neighbors, not MAC Poisson. A change propagating farther reopens this probe.
5. **Stable interfaces versus hidden knowledge.** Geometry, typed face semantics, immutable snapshots and accepted ledgers are stable values. Array aliasing, duplicate-face synchronization, pressure scratch and ghost ordering remain private. Serialization cannot require private buffer layouts. An external provider interface must declare the new domain or refuse it; tensor shape is insufficient.
6. **Independent evolution/failure/replacement.** A reservoir law can replace another behind the numerical domain contract only with its discrete proof/evidence; it cannot promise equivalence by interface alone. Core numerical failure preserves accepted state. Recording failure may leave an explicitly unrecorded accepted tail under existing policy; it is not a physics rollback. Cold inspection can remain available while rerun of an unsupported profile is refused. SPH and MAC operators are separate, sharing configuration vocabulary only where meanings coincide.
7. **Deletion test.** Removing the boundary owner would spread reciprocal checks and face identity among pressure, sampler, transport and UI. Removing the proposed solver-profile discriminator would make old decoders misinterpret new semantics. Removing a new universal plugin registry, second archive, per-face mutable authority or generic graph DSL eliminates unnecessary complexity, so none is proposed. Keep dual-momentum construction with transport and weighted adjacency with pressure/topology; do not create public extension seams solely for tests.
8. **Cumulative machinery.** Retain one domain configuration/snapshot, one topology authority, existing Simulation/Session/Worker, existing store and mode-specific numerical workspaces. Necessary complexity is conservative staggered transport, pressure nullspaces and exterior work; contain it with their numerical owners. UI and storage are projections. No new scheduler, service, renderer or durability subsystem is justified.

## Blockers

Production implementation has no admission. M1 conservation/dual-boundary completion and M2 discrete viscous/backflow compatibility need their named derivation/review gates. Independent source/math review and normal sandboxed Pages/PDF/browser qualification remain publication requirements, not inferred passes. Required-real native UI/cold-workflow evidence for the future feature is unexecuted. These block their specific acceptance claims; they do not prevent this documentation draft.

## Migration, rollout, rollback and re-plan triggers

Ship a supported periodic profile only after M1's whole vertical gate; keep sealed constructors and historical runs unchanged. New boundary controls cannot silently enable unqualified particle/provider/interface behavior. Preserve original saved bytes/hashes; create a new run for changed boundary physics. Reconcile future host edits against the accepted PR146 owner/version and any subsequent main changes. Update API/profile descriptions and all declared consumers in the same acceptance unit; do not maintain duplicate “latest” settings alongside frozen intent.

Rollback means disable launch of the new profile or revert its coherent source unit while retaining archives and their decoders for explicitly supported inspection. It does not delete recordings, overwrite accepted state, change tolerances, hide a failed conservation test or convert a reservoir run to sealed semantics. Unsupported new rerun returns unsupported. A topology/reference edit never mutates a running pressure solve.

Re-plan for dual-flux closure/CFL or gauge failure; an inconsistent discrete backflow estimate; EOS hydrostatic failure; changed UI/recording owner; unsupported retained-state encoding; new moving/rotated/partial/interface physics; or observed propagation beyond the composed-design paths. Treat errors inside the chosen contract as repairs; do not use an error as permission for a larger physical model. Highest-risk scientific questions remain in [issues](issues.md), with explicit owner and stopping gate.

## Documentation write set, coordination and final acceptance

This task may write only new Chapter 40, `docs/research-book/implementation/fluid-portals-sources-and-scope.md`, `docs/research-book/sources/fluid-portals-*.json`, this plan directory, and one additive portal discovery paragraph in `docs/research-book/README.md`. The existing builder discovers chapters/guides automatically: no shared renderer/nav/workflow edit is planned. No root solver, tests, Cargo, proofs, acceptance/admission manifest, FEM chapter/guide, GPU file or PR146 code is owned here.

Task-created worktree `/workspace/Rheon-portals-book`, branch `documentation/fluid-portals-chapter40-plan-20261021`, targets main. It isolates publication text from reviewed research branch `research/fluid-portals-open-boundaries-20261021` and concurrent UI/GPU work. Parent is the serial integration/deployment owner. The documentation branch was pushed. An initial draft-PR attempt was denied and preserved. After explicit clarification and the user’s subsequent yes authorizing documentation creation/merge/deployment after checks, one retry created draft PR148 at reviewed head dcf5b56726aaccefb7ed7fffdd428929f16777bc. Normal source-specific checks and exact final-head verification are required before integration/deployment; no production implementation or cleanup is admitted. Retain both worktrees/branches for review and parent-controlled disposition. Chapter number and main/PR scope were reported before shared README editing.

The concurrent-plan-integration profile is not selected for this single-writer, non-authorizing new proposal: no other actor is editing this canonical plan from the same mutable revision. Shared publication coordination is still real: recheck current main and preserved FEM paths before preparing the PR, and hand off overlap or changed ownership without silently rebasing another owner's work.

Feature final acceptance is **pending**. Deferred stages remain owned by this plan's numerical/host integration lead, triggered only by explicit future implementation admission. Chapter/plan publication acceptance is recorded separately in the verification report; a successful Pages build does not close A1–A8.
