mrs-core 0.1.2__py3-none-any.whl → 0.1.3__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.
- mrs/phases.py +37 -2
- mrs/registry.py +5 -0
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/METADATA +1 -1
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/RECORD +8 -8
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/WHEEL +0 -0
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/licenses/NOTICE +0 -0
- {mrs_core-0.1.2.dist-info → mrs_core-0.1.3.dist-info}/top_level.txt +0 -0
mrs/phases.py
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# phases.py — MRS-Core
|
|
2
|
+
# Defines legal phase transitions and validation logic.
|
|
3
|
+
|
|
4
|
+
# Phase transition map for strict reasoning flow
|
|
1
5
|
PHASE_FLOW = {
|
|
2
6
|
"start": "transform",
|
|
3
7
|
"transform": "reflect",
|
|
@@ -8,8 +12,39 @@ PHASE_FLOW = {
|
|
|
8
12
|
"done": "done",
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
def validate_phase(operator_name, current_phase):
|
|
12
|
-
return None # permissive for now
|
|
13
15
|
|
|
14
16
|
def next_phase(operator_name, current_phase):
|
|
17
|
+
"""
|
|
18
|
+
Given the current phase, return the next allowed phase.
|
|
19
|
+
Engine.py requires this — do NOT remove.
|
|
20
|
+
"""
|
|
15
21
|
return PHASE_FLOW.get(current_phase, "done")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Legal phase definitions for each operator
|
|
25
|
+
LEGAL_PHASES = {
|
|
26
|
+
"transform": ["start"],
|
|
27
|
+
"reflect": ["transform"],
|
|
28
|
+
"evaluate": ["reflect"],
|
|
29
|
+
"rewrite": ["evaluate"],
|
|
30
|
+
"summarize": ["rewrite"],
|
|
31
|
+
# Inspect & filter are utility ops usable later in the chain
|
|
32
|
+
"inspect": ["evaluate", "rewrite", "summarize"],
|
|
33
|
+
"filter": ["evaluate", "rewrite", "summarize"],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def validate_phase(operator_name, current_phase):
|
|
38
|
+
"""
|
|
39
|
+
Return an error string if operator is used in an illegal phase.
|
|
40
|
+
Return None if legal.
|
|
41
|
+
|
|
42
|
+
Engine.py expects:
|
|
43
|
+
- None = OK
|
|
44
|
+
- String = violation
|
|
45
|
+
"""
|
|
46
|
+
allowed = LEGAL_PHASES.get(operator_name, [])
|
|
47
|
+
if current_phase not in allowed:
|
|
48
|
+
return f"Operator '{operator_name}' not allowed in phase '{current_phase}'"
|
|
49
|
+
return None
|
|
50
|
+
|
mrs/registry.py
CHANGED
|
@@ -2,10 +2,10 @@ mrs/__init__.py,sha256=WoQ9QtnmAbFUsLWuXUTxwpBYm0LS9XBQOcZGPpbV4cs,844
|
|
|
2
2
|
mrs/diagnostics.py,sha256=zbAp0iM6Gko5R4Z2Yb8HKaesUuy-b21cwgxsUIjKM8I,606
|
|
3
3
|
mrs/engine.py,sha256=dYaGZkeuz1YHc-q-PG48TJ6est0OAX5SpmdD-J_zIIU,1365
|
|
4
4
|
mrs/exceptions.py,sha256=zTplNq6HbVzaZmIhJPOGUvuqQmE9rqprDzZRiJYxDQs,242
|
|
5
|
-
mrs/phases.py,sha256=
|
|
5
|
+
mrs/phases.py,sha256=caqEwMLQrDE0e9VUrpPbDFXZboEgWsa4v6RtF_v5tNU,1403
|
|
6
6
|
mrs/pipeline.py,sha256=8pIWEGOt9O42pxdwsYC3UsWSQFqT46rRLsHM-n8xR5A,288
|
|
7
7
|
mrs/presets.py,sha256=tBKDBwX-PTRoIfjV4xGX1Wng12zsH42mHQ4DFunY5cc,698
|
|
8
|
-
mrs/registry.py,sha256=
|
|
8
|
+
mrs/registry.py,sha256=j40vfx8yRs9_9_g3HklEArEnr05uSv3yJicntG8RUvw,546
|
|
9
9
|
mrs/state.py,sha256=tpQyKyqNpt4Y1hxWQ65ZoCYhK5vWam34FxBfVUsBdvI,479
|
|
10
10
|
mrs/operators/__init__.py,sha256=HWwj5ec_ktDVxWc8NNwRgx8rBllel1xxq9H5LP7HUIQ,274
|
|
11
11
|
mrs/operators/base.py,sha256=vGcQ_ucJ7qrrbTGmM06JEgYmYJoDgzVrzVpRlu9bIsE,142
|
|
@@ -16,9 +16,9 @@ mrs/operators/reflect.py,sha256=stlm4eeWRo50IQ1CAFB1Pk0KAkRRsGNTRFPJL9-huxo,299
|
|
|
16
16
|
mrs/operators/rewrite.py,sha256=UyyhkYeq1c1916Izh47YltjLJ-LRaYIP8Rw_ZfwXsyo,347
|
|
17
17
|
mrs/operators/summarize.py,sha256=Q-cMvU7Iu48kKi1RbggqItHSFqS6LFqf-qKJ5rlyenU,354
|
|
18
18
|
mrs/operators/transform.py,sha256=g5Aq2LeziG1Xeqncz053Xmv1SCS_d9Fq_Zsriiebd8A,368
|
|
19
|
-
mrs_core-0.1.
|
|
20
|
-
mrs_core-0.1.
|
|
21
|
-
mrs_core-0.1.
|
|
22
|
-
mrs_core-0.1.
|
|
23
|
-
mrs_core-0.1.
|
|
24
|
-
mrs_core-0.1.
|
|
19
|
+
mrs_core-0.1.3.dist-info/licenses/LICENSE,sha256=YhxJr-lCiJMIQLkwOsqof2ZhAr6cOMOnzKX_qOGWIwE,11489
|
|
20
|
+
mrs_core-0.1.3.dist-info/licenses/NOTICE,sha256=Gh8CDLuJ2Jgixu3sQ9PgTQv4nTLyNozncfw0wW3hl9U,132
|
|
21
|
+
mrs_core-0.1.3.dist-info/METADATA,sha256=f60-JAr0go0mU3X9og9yQBLrYsox6BCf1AQp1_UjyOo,5566
|
|
22
|
+
mrs_core-0.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
23
|
+
mrs_core-0.1.3.dist-info/top_level.txt,sha256=u-QA32S-jnY2FEXu4JwnPAZGDQdlPyQg2aCXHDAIjwY,4
|
|
24
|
+
mrs_core-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|