solprop.driver.service#

The service loop: Python’s side of an execution session (SEP 47 section 5).

A session (solprop.backends.session) owns the run’s numerical state and its schedule. This loop advances it and services what it reports – saved planes and their output transactions, plane observers and progress, snapshot persistence, warnings and the terminal record – then acknowledges each batch. It holds no numerical state of its own: it never rediscovers the next plane, rebuilds a statistic or replays the attempts to reconstruct a controller.

Ordering follows SEP 47 section 5.3: a plane is committed with its method history and its execution record in one transaction (solprop._interrupts.committing); a snapshot is serviced after that commit; the plane observer and the reporter follow. A service failure leaves the batch unacknowledged, so the field it names can still be exported for the terminal checkpoint, and the primary failure is preserved.

Module Attributes

MONITOR_RECONSTRUCTED

How a resumed execution's boundary monitor was restored (SEP 47 section 5.5).

Functions

serve(session, output, context)

Advance a session to its end, servicing every event it reports.

Classes

ServiceContext(problem, request, metadata, ...)

What the service loop needs besides the session and the output.

solprop.driver.service.MONITOR_RECONSTRUCTED = {'reason': 'persisted_records', 'restarted': ['check_cadence', 'transverse_cap'], 'restored': ['cumulative_totals', 'quiet_state', 'transverse_record'], 'state': 'reconstructed'}#

How a resumed execution’s boundary monitor was restored (SEP 47 section 5.5).

Today’s reconstruction from the persisted records: the cumulative totals, the quiet state and the transverse record are restored, and the check cadence and the transverse cap restart from that restored state; persisting them is not claimed.

class solprop.driver.service.ServiceContext(problem, request, metadata, reporter, retention, resume_history, snapshots, tdse_binding, tdse_archive, recipe, start_plane, stop=None, restoration=None)[source]#

Bases: object

What the service loop needs besides the session and the output.

Attributes:
problemsolprop.translate.problem.PropagationProblem

The translated problem.

requestsolprop.translate.run_request.RunRequest

The run’s policies.

metadatasolprop.output.schema.RunMetadata

The run’s record.

reportersolprop.log.ProgressReporter

Where progress goes.

retentionsolprop.output.schema.FieldRetention

Which planes keep their field.

resume_historybool or None

The public method-history retention choice.

snapshotssolprop.output.snapshots.SnapshotController or None

Snapshot requests, when enabled.

tdse_bindingsolprop.translate.tdse.TDSEBinding or None

A live atomic runtime.

tdse_archivesolprop.output.tdse_archive.TDSEArchiveWriter or None

A live archive to suspend beside the optical writer.

recipesolprop.output.schema.RecipeRecord or None

The recipe the run was built from.

start_planeint

The first save plane beyond the starting state.

stopsolprop.log.StopFlag or None

The run’s stop flag, polled between batches as well as inside the session.

restorationcollections.abc.Mapping or None, optional

What a resumed execution restored of the method history (Simulation._continue_march), for its execution record; None for a fresh run or a caller that says nothing.

metadata: RunMetadata#
problem: PropagationProblem#
recipe: RecipeRecord | None#
reporter: ProgressReporter#
request: RunRequest#
restoration: Mapping[str, object] | None = None#
resume_history: bool | None#
retention: FieldRetention#
snapshots: SnapshotController | None#
start_plane: int#
stop: StopFlag | None = None#
tdse_archive: TDSEArchiveWriter | None#
tdse_binding: TDSEBinding | None#
solprop.driver.service.serve(session, output, context)[source]#

Advance a session to its end, servicing every event it reports.

Any RunSession is served: the reference’s HostSession, whose driver gives the execution facts and method history, or a backend’s own session, through its protocol alone (SessionFacts).

Parameters:
sessionsolprop.backends.session.RunSession

The started session.

outputsolprop.output.schema.Output

Where the planes go; closed when the loop ends, whether or not it succeeded.

contextServiceContext

Everything else the service needs.

Raises:
BaseException

The run’s primary failure, a stop request or a signal, after its terminal record and any checkpoint are written.