onec-interactive-runtime-core 0.1.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onec_interactive_runtime_core-0.1.19.dist-info/METADATA +12 -0
- onec_interactive_runtime_core-0.1.19.dist-info/RECORD +87 -0
- onec_interactive_runtime_core-0.1.19.dist-info/WHEEL +4 -0
- onec_interactive_runtime_core-0.1.19.dist-info/licenses/COPYRIGHT +9 -0
- onec_interactive_runtime_core-0.1.19.dist-info/licenses/LICENSE +232 -0
- onec_interactive_runtime_core-0.1.19.dist-info/licenses/THIRD_PARTY_NOTICES.txt +32 -0
- onec_runtime/AGENTS.md +7 -0
- onec_runtime/__init__.py +3 -0
- onec_runtime/artifacts.py +59 -0
- onec_runtime/bootstrap.py +310 -0
- onec_runtime/breakpoint_workspace.py +249 -0
- onec_runtime/bsl/__init__.py +139 -0
- onec_runtime/bsl/diagnostics.py +1046 -0
- onec_runtime/bsl/full_ast_worker_projection.py +522 -0
- onec_runtime/bsl/generated_semantic_parser.py +6322 -0
- onec_runtime/bsl/lexer.py +164 -0
- onec_runtime/bsl/module_catalog.py +420 -0
- onec_runtime/bsl/module_delta.py +1079 -0
- onec_runtime/bsl/module_universe.py +1877 -0
- onec_runtime/bsl/notebook_cells.py +232 -0
- onec_runtime/bsl/notebook_method_globals.py +74 -0
- onec_runtime/bsl/notebook_methods.py +175 -0
- onec_runtime/bsl/parser_artifact_identity.py +119 -0
- onec_runtime/bsl/parser_target.py +388 -0
- onec_runtime/bsl/preprocessor.py +16 -0
- onec_runtime/bsl/semantic_lowering.py +1539 -0
- onec_runtime/bsl/source_maps.py +2411 -0
- onec_runtime/bsl/worker_dependency_resolver.py +289 -0
- onec_runtime/bsl/worker_preprocessor.py +247 -0
- onec_runtime/bsl/worker_projection_model.py +137 -0
- onec_runtime/bsl/worker_reload_source_map.py +1697 -0
- onec_runtime/capture.py +113 -0
- onec_runtime/capture_source.py +453 -0
- onec_runtime/compact_table.py +376 -0
- onec_runtime/compact_table_backend.py +500 -0
- onec_runtime/config.py +198 -0
- onec_runtime/configurator_agent.py +520 -0
- onec_runtime/controller_worker.py +400 -0
- onec_runtime/credentials.py +18 -0
- onec_runtime/epf_container.py +196 -0
- onec_runtime/errors.py +205 -0
- onec_runtime/experiment.py +130 -0
- onec_runtime/extension_bundle.py +944 -0
- onec_runtime/extension_lifecycle.py +402 -0
- onec_runtime/extension_state.py +222 -0
- onec_runtime/fault_injection.py +30 -0
- onec_runtime/kernel.py +179 -0
- onec_runtime/lease.py +123 -0
- onec_runtime/observation.py +287 -0
- onec_runtime/performance_profile.py +245 -0
- onec_runtime/privacy.py +263 -0
- onec_runtime/processes.py +265 -0
- onec_runtime/prototype_runtime.py +2644 -0
- onec_runtime/rdbg/__init__.py +1 -0
- onec_runtime/rdbg/models.py +130 -0
- onec_runtime/rdbg/reconnect.py +59 -0
- onec_runtime/rdbg/session.py +913 -0
- onec_runtime/rdbg/transport.py +138 -0
- onec_runtime/rdbg/xml_codec.py +980 -0
- onec_runtime/recovery.py +106 -0
- onec_runtime/recovery_journal.py +79 -0
- onec_runtime/resources/extension/OnecInteractiveRuntime.cfe +0 -0
- onec_runtime/resources/extension/extension-manifest.json +108 -0
- onec_runtime/runtime_api.py +5272 -0
- onec_runtime/runtime_contracts.py +196 -0
- onec_runtime/server_worker.py +2034 -0
- onec_runtime/session.py +2123 -0
- onec_runtime/startup_diagnostics.py +45 -0
- onec_runtime/stop_routing.py +65 -0
- onec_runtime/supervised_processes.py +232 -0
- onec_runtime/supervised_runtime.py +512 -0
- onec_runtime/supervisor.py +363 -0
- onec_runtime/supervisor_model.py +148 -0
- onec_runtime/supervisor_protocol.py +77 -0
- onec_runtime/table_materialization.py +471 -0
- onec_runtime/table_transfer_backend.py +203 -0
- onec_runtime/table_value.py +311 -0
- onec_runtime/toolchain.py +730 -0
- onec_runtime/value_materialization.py +432 -0
- onec_runtime/value_transfer_backend.py +199 -0
- onec_runtime/worker_breakpoints.py +1431 -0
- onec_runtime/worker_epf.py +313 -0
- onec_runtime/worker_epf_template.py +53 -0
- onec_runtime/worker_stage_protocol.py +516 -0
- onec_runtime/worker_universe.py +3772 -0
- onec_runtime_build/__init__.py +1 -0
- onec_runtime_build/parser_target_development.py +116 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Minimal HTTP/RDBG protocol support for the file-mode spike."""
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class TargetId:
|
|
9
|
+
id: UUID
|
|
10
|
+
infobase_alias: str
|
|
11
|
+
seance_id: UUID | None = None
|
|
12
|
+
seance_no: int | None = None
|
|
13
|
+
infobase_instance_id: UUID | None = None
|
|
14
|
+
config_version: str = ""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class DebugTarget:
|
|
19
|
+
target_id: TargetId
|
|
20
|
+
target_type: str
|
|
21
|
+
state: str
|
|
22
|
+
state_number: int | None = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class ModuleLocation:
|
|
27
|
+
module_type: str
|
|
28
|
+
url: str
|
|
29
|
+
object_id: UUID
|
|
30
|
+
property_id: UUID
|
|
31
|
+
line: int
|
|
32
|
+
extension_name: str = ""
|
|
33
|
+
ext_id: int = 0
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass(frozen=True)
|
|
37
|
+
class StackFrame:
|
|
38
|
+
target_id: TargetId
|
|
39
|
+
level: int
|
|
40
|
+
location: ModuleLocation
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(frozen=True)
|
|
44
|
+
class StopEvent:
|
|
45
|
+
target_id: TargetId
|
|
46
|
+
location: ModuleLocation
|
|
47
|
+
reason: str
|
|
48
|
+
stop_by_breakpoint: bool | None = None
|
|
49
|
+
suspended_by_other: bool | None = None
|
|
50
|
+
stack: tuple[ModuleLocation, ...] = ()
|
|
51
|
+
runtime_error: str = ""
|
|
52
|
+
stack_frames: tuple[StackFrame, ...] = ()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True, slots=True, eq=False, repr=False)
|
|
56
|
+
class PendingEvaluation:
|
|
57
|
+
target_id: TargetId
|
|
58
|
+
result_id: UUID
|
|
59
|
+
owner: object
|
|
60
|
+
|
|
61
|
+
def __post_init__(self) -> None:
|
|
62
|
+
if (
|
|
63
|
+
type(self.target_id) is not TargetId
|
|
64
|
+
or type(self.result_id) is not UUID
|
|
65
|
+
):
|
|
66
|
+
raise ValueError("pending evaluation identity is invalid")
|
|
67
|
+
|
|
68
|
+
def __repr__(self) -> str:
|
|
69
|
+
return (
|
|
70
|
+
"PendingEvaluation(target_id=<redacted>, "
|
|
71
|
+
"result_id=<redacted>, owner=<redacted>)"
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@dataclass(frozen=True)
|
|
76
|
+
class CollectionCell:
|
|
77
|
+
name: str
|
|
78
|
+
type_name: str
|
|
79
|
+
presentation: str
|
|
80
|
+
value_string: str = ""
|
|
81
|
+
value_decimal: str = ""
|
|
82
|
+
value_date_time: str = ""
|
|
83
|
+
value_boolean: bool | None = None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass(frozen=True)
|
|
87
|
+
class CollectionRow:
|
|
88
|
+
index: int
|
|
89
|
+
cells: tuple[CollectionCell, ...]
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@dataclass(frozen=True)
|
|
93
|
+
class EvaluationResult:
|
|
94
|
+
result_id: UUID
|
|
95
|
+
type_name: str
|
|
96
|
+
presentation: str
|
|
97
|
+
error_occurred: bool
|
|
98
|
+
error_text: str = ""
|
|
99
|
+
type_code: int | None = None
|
|
100
|
+
value_string: str = ""
|
|
101
|
+
collection_size: int | None = None
|
|
102
|
+
collection_rows: tuple[CollectionRow, ...] = ()
|
|
103
|
+
value_decimal: str = ""
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@dataclass(frozen=True)
|
|
107
|
+
class ModifyResult:
|
|
108
|
+
result_id: UUID
|
|
109
|
+
type_name: str
|
|
110
|
+
presentation: str
|
|
111
|
+
error_occurred: bool
|
|
112
|
+
error_text: str = ""
|
|
113
|
+
type_code: int | None = None
|
|
114
|
+
value_string: str = ""
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@dataclass(frozen=True)
|
|
118
|
+
class FrameVariable:
|
|
119
|
+
name: str
|
|
120
|
+
type_name: str
|
|
121
|
+
presentation: str
|
|
122
|
+
collection_size: int | None = None
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@dataclass(frozen=True)
|
|
126
|
+
class LocalVariablesResult:
|
|
127
|
+
result_id: UUID
|
|
128
|
+
variables: tuple[FrameVariable, ...]
|
|
129
|
+
error_occurred: bool = False
|
|
130
|
+
error_text: str = ""
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
from onec_runtime.errors import RecoveryIdentityMismatch
|
|
6
|
+
from onec_runtime.recovery import (
|
|
7
|
+
RecoveryCheckpoint,
|
|
8
|
+
RecoveryIdentityEvidence,
|
|
9
|
+
is_paused_target_state,
|
|
10
|
+
)
|
|
11
|
+
from onec_runtime.rdbg.session import RdbgSession, SessionState
|
|
12
|
+
from onec_runtime.rdbg.transport import RdbgTransport
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True, slots=True)
|
|
16
|
+
class ReconnectedSession:
|
|
17
|
+
session: RdbgSession
|
|
18
|
+
evidence: RecoveryIdentityEvidence | None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def reconnect_session(
|
|
22
|
+
transport: RdbgTransport,
|
|
23
|
+
previous: RdbgSession,
|
|
24
|
+
checkpoint: RecoveryCheckpoint,
|
|
25
|
+
*,
|
|
26
|
+
observe_executing: bool,
|
|
27
|
+
timeout_s: float = 5.0,
|
|
28
|
+
) -> ReconnectedSession:
|
|
29
|
+
session = RdbgSession(
|
|
30
|
+
transport,
|
|
31
|
+
previous.expected_location,
|
|
32
|
+
alias=previous.alias,
|
|
33
|
+
ui_id=previous.ui_id,
|
|
34
|
+
break_on_next=False,
|
|
35
|
+
)
|
|
36
|
+
session.initialize()
|
|
37
|
+
matches = [
|
|
38
|
+
target
|
|
39
|
+
for target in session.list_targets()
|
|
40
|
+
if target.target_id == checkpoint.target.target_id
|
|
41
|
+
and target.target_type == checkpoint.target.target_type
|
|
42
|
+
]
|
|
43
|
+
if len(matches) != 1:
|
|
44
|
+
raise RecoveryIdentityMismatch(
|
|
45
|
+
f"Expected one recovered target, found {len(matches)}"
|
|
46
|
+
)
|
|
47
|
+
target = matches[0]
|
|
48
|
+
session.attach_target(target)
|
|
49
|
+
session.set_breakpoints(checkpoint.breakpoint_workspace)
|
|
50
|
+
if is_paused_target_state(target.state):
|
|
51
|
+
stop = session.read_current_stack(timeout_s=timeout_s)
|
|
52
|
+
return ReconnectedSession(
|
|
53
|
+
session,
|
|
54
|
+
RecoveryIdentityEvidence(target, stop),
|
|
55
|
+
)
|
|
56
|
+
if not observe_executing:
|
|
57
|
+
raise RecoveryIdentityMismatch("Paused checkpoint target is not stopped")
|
|
58
|
+
session.state = SessionState.EXECUTING
|
|
59
|
+
return ReconnectedSession(session, None)
|