speclogician 0.0.0b1__py3-none-any.whl → 0.0.0.dev1__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.
Files changed (153) hide show
  1. speclogician/agent/funcs.py +29 -0
  2. speclogician/cmd/agent_cmd.py +89 -0
  3. speclogician/cmd/data_cmd.py +24 -0
  4. speclogician/cmd/model_cmd.py +42 -0
  5. speclogician/cmd/overlay_cmd.py +30 -0
  6. speclogician/cmd/scenario_cmd.py +61 -0
  7. speclogician/cmd/state_cmd.py +52 -0
  8. speclogician/data/artifact.py +8 -50
  9. speclogician/data/container.py +18 -384
  10. speclogician/data/mapping.py +18 -17
  11. speclogician/data/refs.py +12 -11
  12. speclogician/data/reports.py +11 -0
  13. speclogician/data/traces.py +15 -6
  14. speclogician/llms/llmtools.py +102 -0
  15. speclogician/llms/overlay.py +264 -0
  16. speclogician/main.py +36 -102
  17. speclogician/modeling/__init__.py +0 -31
  18. speclogician/modeling/component.py +4 -60
  19. speclogician/modeling/conflict.py +5 -19
  20. speclogician/modeling/domain.py +93 -280
  21. speclogician/modeling/model.py +206 -0
  22. speclogician/modeling/predicates.py +20 -22
  23. speclogician/modeling/report.py +33 -0
  24. speclogician/modeling/scenario.py +119 -87
  25. speclogician/sl_cmd.py +76 -0
  26. speclogician/state/change.py +98 -378
  27. speclogician/state/state.py +183 -399
  28. speclogician/tui/box.tcss +10 -0
  29. speclogician/tui/tui.py +131 -0
  30. speclogician/utils/__init__.py +1 -70
  31. speclogician/utils/imx.py +195 -0
  32. speclogician/utils/load.py +25 -147
  33. speclogician/utils/prompt.md +1 -325
  34. speclogician-0.0.0.dev1.dist-info/METADATA +21 -0
  35. speclogician-0.0.0.dev1.dist-info/RECORD +43 -0
  36. speclogician/commands/__init__.py +0 -15
  37. speclogician/commands/cmd_ch.py +0 -616
  38. speclogician/commands/cmd_find.py +0 -256
  39. speclogician/commands/cmd_view.py +0 -202
  40. speclogician/commands/runner.py +0 -149
  41. speclogician/commands/utils.py +0 -101
  42. speclogician/demos/.DS_Store +0 -0
  43. speclogician/demos/cmd_demo.py +0 -278
  44. speclogician/demos/loader.py +0 -135
  45. speclogician/demos/model.py +0 -27
  46. speclogician/demos/runner.py +0 -51
  47. speclogician/logic/__init__.py +0 -11
  48. speclogician/logic/api/__init__.py +0 -29
  49. speclogician/logic/api/client.py +0 -606
  50. speclogician/logic/api/decomp.py +0 -67
  51. speclogician/logic/api/scenario.py +0 -102
  52. speclogician/logic/api/traces.py +0 -59
  53. speclogician/logic/lib/__init__.py +0 -19
  54. speclogician/logic/lib/complement.py +0 -107
  55. speclogician/logic/lib/domain_model.py +0 -59
  56. speclogician/logic/lib/predicates.py +0 -151
  57. speclogician/logic/lib/scenarios.py +0 -369
  58. speclogician/logic/lib/traces.py +0 -114
  59. speclogician/logic/lib/transitions.py +0 -104
  60. speclogician/logic/main.py +0 -246
  61. speclogician/logic/strings.py +0 -194
  62. speclogician/logic/utils.py +0 -135
  63. speclogician/modeling/complement.py +0 -104
  64. speclogician/modeling/spec.py +0 -306
  65. speclogician/modeling/spec_stats.py +0 -39
  66. speclogician/presentation/api.py +0 -244
  67. speclogician/presentation/builders/_links.py +0 -44
  68. speclogician/presentation/builders/container.py +0 -53
  69. speclogician/presentation/builders/data_artifact.py +0 -42
  70. speclogician/presentation/builders/domain.py +0 -54
  71. speclogician/presentation/builders/instances_list.py +0 -38
  72. speclogician/presentation/builders/predicate.py +0 -51
  73. speclogician/presentation/builders/recommendations.py +0 -41
  74. speclogician/presentation/builders/scenario.py +0 -41
  75. speclogician/presentation/builders/scenario_complement.py +0 -82
  76. speclogician/presentation/builders/smart_find.py +0 -39
  77. speclogician/presentation/builders/spec.py +0 -39
  78. speclogician/presentation/builders/state_diff.py +0 -150
  79. speclogician/presentation/builders/state_instance.py +0 -42
  80. speclogician/presentation/builders/state_instance_summary.py +0 -84
  81. speclogician/presentation/builders/trace.py +0 -58
  82. speclogician/presentation/ctx.py +0 -38
  83. speclogician/presentation/models/container.py +0 -44
  84. speclogician/presentation/models/data_artifact.py +0 -33
  85. speclogician/presentation/models/domain.py +0 -50
  86. speclogician/presentation/models/instances_list.py +0 -23
  87. speclogician/presentation/models/predicate.py +0 -60
  88. speclogician/presentation/models/recommendations.py +0 -34
  89. speclogician/presentation/models/scenario.py +0 -31
  90. speclogician/presentation/models/scenario_complement.py +0 -40
  91. speclogician/presentation/models/smart_find.py +0 -34
  92. speclogician/presentation/models/spec.py +0 -32
  93. speclogician/presentation/models/state_diff.py +0 -34
  94. speclogician/presentation/models/state_instance.py +0 -31
  95. speclogician/presentation/models/state_instance_summary.py +0 -102
  96. speclogician/presentation/models/trace.py +0 -42
  97. speclogician/presentation/preview/__init__.py +0 -13
  98. speclogician/presentation/preview/cli.py +0 -50
  99. speclogician/presentation/preview/fixtures/__init__.py +0 -205
  100. speclogician/presentation/preview/fixtures/artifact_container.py +0 -150
  101. speclogician/presentation/preview/fixtures/data_artifact.py +0 -144
  102. speclogician/presentation/preview/fixtures/domain_model.py +0 -162
  103. speclogician/presentation/preview/fixtures/instances_list.py +0 -162
  104. speclogician/presentation/preview/fixtures/predicate.py +0 -184
  105. speclogician/presentation/preview/fixtures/scenario.py +0 -84
  106. speclogician/presentation/preview/fixtures/scenario_complement.py +0 -81
  107. speclogician/presentation/preview/fixtures/smart_find.py +0 -140
  108. speclogician/presentation/preview/fixtures/spec.py +0 -95
  109. speclogician/presentation/preview/fixtures/state_diff.py +0 -158
  110. speclogician/presentation/preview/fixtures/state_instance.py +0 -128
  111. speclogician/presentation/preview/fixtures/state_instance_summary.py +0 -80
  112. speclogician/presentation/preview/fixtures/trace.py +0 -206
  113. speclogician/presentation/preview/registry.py +0 -42
  114. speclogician/presentation/renderers/__init__.py +0 -24
  115. speclogician/presentation/renderers/container.py +0 -136
  116. speclogician/presentation/renderers/data_artifact.py +0 -144
  117. speclogician/presentation/renderers/domain.py +0 -123
  118. speclogician/presentation/renderers/instances_list.py +0 -120
  119. speclogician/presentation/renderers/predicate.py +0 -180
  120. speclogician/presentation/renderers/recommendations.py +0 -90
  121. speclogician/presentation/renderers/scenario.py +0 -94
  122. speclogician/presentation/renderers/scenario_complement.py +0 -59
  123. speclogician/presentation/renderers/smart_find.py +0 -307
  124. speclogician/presentation/renderers/spec.py +0 -105
  125. speclogician/presentation/renderers/state_diff.py +0 -102
  126. speclogician/presentation/renderers/state_instance.py +0 -82
  127. speclogician/presentation/renderers/state_instance_summary.py +0 -143
  128. speclogician/presentation/renderers/trace.py +0 -122
  129. speclogician/shell/app.py +0 -170
  130. speclogician/shell/shell_ch.py +0 -263
  131. speclogician/shell/shell_view.py +0 -153
  132. speclogician/state/change_result.py +0 -32
  133. speclogician/state/diff.py +0 -191
  134. speclogician/state/inst.py +0 -574
  135. speclogician/state/recommendation.py +0 -13
  136. speclogician/state/recommender.py +0 -577
  137. speclogician/state/state_stats.py +0 -133
  138. speclogician/tui/__init__.py +0 -0
  139. speclogician/tui/app.py +0 -257
  140. speclogician/tui/app.tcss +0 -160
  141. speclogician/tui/demo.py +0 -45
  142. speclogician/tui/images/speclogician-full.png +0 -0
  143. speclogician/tui/images/speclogician-minimal.png +0 -0
  144. speclogician/tui/main_screen.py +0 -454
  145. speclogician/tui/splash_screen.py +0 -51
  146. speclogician/tui/stats_screen.py +0 -125
  147. speclogician/utils/testing.py +0 -151
  148. speclogician-0.0.0b1.dist-info/METADATA +0 -116
  149. speclogician-0.0.0b1.dist-info/RECORD +0 -139
  150. /speclogician/{presentation → agent}/__init__.py +0 -0
  151. /speclogician/{presentation/builders → cmd}/__init__.py +0 -0
  152. /speclogician/{presentation/models → llms}/__init__.py +0 -0
  153. {speclogician-0.0.0b1.dist-info → speclogician-0.0.0.dev1.dist-info}/WHEEL +0 -0
@@ -1,84 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/builders/state_instance_summary.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from speclogician.presentation.ctx import RenderCtx
10
- from speclogician.presentation.models.state_instance_summary import StateInstanceSummaryPM
11
- from speclogician.state.inst import StateInstance
12
-
13
-
14
- def _g(obj: object, name: str, default):
15
- return getattr(obj, name, default)
16
-
17
-
18
- def build_state_instance_summary_pm(si: StateInstance, ctx: RenderCtx) -> StateInstanceSummaryPM:
19
- dm = si.spec.domain_model
20
- spec = si.spec
21
- art = si.art_container
22
-
23
- return StateInstanceSummaryPM(
24
- created_at=si.created_at.isoformat() if si.created_at else None,
25
- num_changes=len(si.changes or []),
26
-
27
- # ---- Domain model (base) ----
28
- base_status=str(_g(dm, "base_status", None)),
29
- base_has_state=_g(dm, "base_has_state", False),
30
- base_has_action=_g(dm, "base_has_action", False),
31
-
32
- # ---- State predicates ----
33
- num_state_preds_total=_g(dm, "num_state_preds_total", 0),
34
- num_state_preds_matched=_g(dm, "num_state_preds_matched", 0),
35
- num_state_preds_valid_logic=_g(dm, "num_state_preds_valid_logic", 0),
36
- num_state_preds_errored=_g(dm, "num_state_preds_errored", 0),
37
-
38
- # ---- Action predicates ----
39
- num_action_preds_total=_g(dm, "num_action_preds_total", 0),
40
- num_action_preds_matched=_g(dm, "num_action_preds_matched", 0),
41
- num_action_preds_valid_logic=_g(dm, "num_action_preds_valid_logic", 0),
42
- num_action_preds_errored=_g(dm, "num_action_preds_errored", 0),
43
-
44
- # ---- Predicates totals ----
45
- num_preds_total=_g(dm, "num_preds_total", 0),
46
- num_preds_matched=_g(dm, "num_preds_matched", 0),
47
- num_preds_valid_logic=_g(dm, "num_preds_valid_logic", 0),
48
- num_preds_errored=_g(dm, "num_preds_errored", 0),
49
-
50
- # ---- Transitions ----
51
- num_trans_total=_g(dm, "num_trans_total", 0),
52
- num_trans_matched=_g(dm, "num_trans_matched", 0),
53
- num_trans_valid_logic=_g(dm, "num_trans_valid_logic", 0),
54
- num_trans_errored=_g(dm, "num_trans_errored", 0),
55
-
56
- # ---- Scenarios ----
57
- num_sc_total=_g(spec, "num_sc_total", 0),
58
- num_sc_missing=_g(spec, "num_sc_missing", 0),
59
- num_sc_matched=_g(spec, "num_sc_matched", 0),
60
- num_sc_inconsistent=_g(spec, "num_sc_inconsistent", 0),
61
-
62
- # ---- Conflicts (spec-level) ----
63
- num_sc_conflicted=_g(spec, "num_sc_conflicted", 0),
64
- num_sc_overlap=_g(spec, "num_sc_overlap", 0),
65
- num_sc_consumed=_g(spec, "num_sc_consumed", 0),
66
-
67
- # ---- ArtifactContainer: test traces ----
68
- num_test_traces_total=_g(art, "num_test_traces_total", 0),
69
- num_test_traces_logic_good=_g(art, "num_test_traces_logic_good", 0),
70
- num_test_traces_matched=_g(art, "num_test_traces_matched", 0),
71
-
72
- # ---- ArtifactContainer: log traces ----
73
- num_log_traces_total=_g(art, "num_log_traces_total", 0),
74
- num_log_traces_logic_good=_g(art, "num_log_traces_logic_good", 0),
75
- num_log_traces_matched=_g(art, "num_log_traces_matched", 0),
76
-
77
- # ---- ArtifactContainer: src code ----
78
- num_src_code_arts_total=_g(art, "num_src_code_arts_total", 0),
79
- num_src_code_arts_matched=_g(art, "num_src_code_arts_matched", 0),
80
-
81
- # ---- ArtifactContainer: docs ----
82
- num_doc_arts_total=_g(art, "num_doc_arts_total", 0),
83
- num_doc_arts_matched=_g(art, "num_doc_arts_matched", 0),
84
- )
@@ -1,58 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/builders/trace.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from speclogician.presentation.ctx import RenderCtx
10
- from speclogician.presentation.models.trace import (
11
- TraceIMLValidityPM,
12
- TraceCorePM,
13
- TestTracePM,
14
- LogTracePM,
15
- )
16
-
17
- from speclogician.data.traces import TestTrace, LogTrace
18
-
19
-
20
- def _build_validity_pm(v) -> TraceIMLValidityPM:
21
- # v: TraceIMLValidity(iml_valid=IMLValidity, err=...)
22
- iml_valid = getattr(v, "iml_valid", None)
23
- # enum -> "valid"/"invalid"/"unknown"
24
- iml_valid_s = getattr(iml_valid, "value", None) or str(iml_valid)
25
- return TraceIMLValidityPM(iml_valid=str(iml_valid_s), err=getattr(v, "err", None))
26
-
27
-
28
- def _build_core_pm(tr: TestTrace | LogTrace) -> TraceCorePM:
29
- return TraceCorePM(
30
- art_id=tr.art_id,
31
- given=tr.given,
32
- when=tr.when,
33
- then=tr.then,
34
- time=tr.time or "",
35
- iml_validity=_build_validity_pm(tr.iml_validity),
36
- )
37
-
38
-
39
- def build_test_trace_pm(tr: TestTrace, ctx: RenderCtx) -> TestTracePM:
40
- # heavy fields obey ctx.show_code (or rename to ctx.show_contents if you prefer)
41
- contents = tr.contents if getattr(ctx, "show_code", True) else None
42
- return TestTracePM(
43
- core=_build_core_pm(tr),
44
- name=tr.name,
45
- filepath=tr.filepath or "",
46
- language=tr.language,
47
- contents=contents,
48
- )
49
-
50
-
51
- def build_log_trace_pm(tr: LogTrace, ctx: RenderCtx) -> LogTracePM:
52
- # heavy log contents also obey ctx.show_code
53
- contents = tr.contents if getattr(ctx, "show_code", True) else None
54
- return LogTracePM(
55
- core=_build_core_pm(tr),
56
- filename=tr.filename,
57
- contents=contents,
58
- )
@@ -1,38 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/ctx.py
5
- #
6
-
7
- from __future__ import annotations
8
- from pydantic import BaseModel
9
- from speclogician.data.container import ArtifactContainer
10
- from speclogician.data.mapping import ArtifactMap
11
-
12
- class RenderCtx(BaseModel):
13
- art_cont: ArtifactContainer | None = None
14
- art_map: ArtifactMap | None = None
15
-
16
- show_ids: bool = False
17
- show_art_ids: bool = False
18
-
19
- # --- global presentation toggles ---
20
- compact: bool = False # tighter tables/panels
21
- show_stats_only: bool = False # render only summary stats (no code blocks)
22
- show_code: bool = True # include code blocks (IML, src snippets)
23
-
24
- # --- domain-model specific ---
25
- show_base: bool = True
26
- show_predicates: bool = True
27
- show_transitions: bool = True
28
-
29
- # --- scenario specific (when you wire it) ---
30
- show_scenario_conflicts: bool = True
31
- show_missing_components: bool = True
32
-
33
- # --- artifacts/mapping (when you wire it) ---
34
- show_traces: bool = True
35
- show_artifacts: bool = True
36
-
37
- show_empty_sections: bool = False
38
- show_recommendations: bool = True
@@ -1,44 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/container.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel, Field
11
-
12
- from speclogician.presentation.models.trace import TestTracePM, LogTracePM
13
- from speclogician.presentation.models.data_artifact import DocRefPM, SrcCodeRefPM
14
-
15
-
16
- class ArtifactContainerCountsPM(BaseModel):
17
- # traces
18
- num_test_traces_total: int = 0
19
- num_test_traces_matched: int = 0
20
- num_test_traces_logic_good: int = 0
21
-
22
- num_log_traces_total: int = 0
23
- num_log_traces_matched: int = 0
24
- num_log_traces_logic_good: int = 0
25
-
26
- # data artifacts
27
- num_src_code_arts_total: int = 0
28
- num_src_code_arts_matched: int = 0
29
-
30
- num_doc_arts_total: int = 0
31
- num_doc_arts_matched: int = 0
32
-
33
-
34
- class ArtifactContainerItemsPM(BaseModel):
35
- test_traces: list[TestTracePM] = Field(default_factory=list)
36
- log_traces: list[LogTracePM] = Field(default_factory=list)
37
- doc_refs: list[DocRefPM] = Field(default_factory=list)
38
- src_code_refs: list[SrcCodeRefPM] = Field(default_factory=list)
39
-
40
-
41
- class ArtifactContainerPM(BaseModel):
42
- kind: Literal["artifact_container"] = "artifact_container"
43
- counts: ArtifactContainerCountsPM
44
- items: ArtifactContainerItemsPM
@@ -1,33 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/data_artifact.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel
11
-
12
-
13
- class DataArtifactCorePM(BaseModel):
14
- art_id: str
15
-
16
-
17
- class DocRefPM(BaseModel):
18
- kind: Literal["doc_ref"] = "doc_ref"
19
- core: DataArtifactCorePM
20
-
21
- text: str
22
- meta: str | None = None
23
-
24
-
25
- class SrcCodeRefPM(BaseModel):
26
- kind: Literal["src_code_ref"] = "src_code_ref"
27
- core: DataArtifactCorePM
28
-
29
- src_code: str
30
- language: str | None = None
31
- file_path: str | None = None
32
- iml_code: str | None = None
33
- meta: str | None = None
@@ -1,50 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/domain.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from pydantic import BaseModel
10
- from typing import Literal
11
-
12
- from speclogician.modeling.domain import BaseStatus
13
-
14
-
15
- class DomainCountsPM(BaseModel):
16
- # base flags
17
- base_status: BaseStatus
18
- base_has_state: bool
19
- base_has_action: bool
20
-
21
- # predicates
22
- num_state_preds_total: int = 0
23
- num_state_preds_valid_logic: int = 0
24
- num_state_preds_matched: int = 0
25
-
26
- num_action_preds_total: int = 0
27
- num_action_preds_valid_logic: int = 0
28
- num_action_preds_matched: int = 0
29
-
30
- num_preds_total: int = 0
31
- num_preds_valid_logic: int = 0
32
- num_preds_matched: int = 0
33
-
34
- # transitions
35
- num_trans_total: int = 0
36
- num_trans_valid_logic: int = 0
37
- num_trans_matched: int = 0
38
-
39
-
40
- class DomainCodePM(BaseModel):
41
- base: str = ""
42
- state_preds_iml: str = ""
43
- action_preds_iml: str = ""
44
- transitions_iml: str = ""
45
-
46
-
47
- class DomainModelPM(BaseModel):
48
- kind: Literal["domain_model"] = "domain_model"
49
- counts: DomainCountsPM
50
- code: DomainCodePM
@@ -1,23 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/instances_list.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel, Field
11
-
12
- from speclogician.presentation.models.state_instance_summary import StateInstanceSummaryPM
13
-
14
-
15
- class InstancesListRowPM(BaseModel):
16
- state_label: str # "latest" or index string
17
- changes: str # already formatted (short_str / class name join)
18
- summary: StateInstanceSummaryPM
19
-
20
-
21
- class InstancesListPM(BaseModel):
22
- kind: Literal["instances_list"] = "instances_list"
23
- rows: list[InstancesListRowPM] = Field(default_factory=list[InstancesListRowPM])
@@ -1,60 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/predicate.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from datetime import datetime
10
- from typing import Literal
11
-
12
- from pydantic import BaseModel, Field
13
-
14
- from speclogician.modeling.predicates import PredicateType
15
- from speclogician.utils import IMLValidity
16
-
17
-
18
- class LinkedArtifactsPM(BaseModel):
19
- total: int = 0
20
- test_traces: int = 0
21
- log_traces: int = 0
22
- doc_refs: int = 0
23
- src_code_refs: int = 0
24
- unresolved_ids: int = 0
25
- art_ids: list[str] = Field(default_factory=list)
26
-
27
-
28
- class PredicatePM(BaseModel):
29
- kind: Literal["state_predicate", "action_predicate"] # matches your model
30
- comp_id: str
31
- name: str
32
- last_updated: datetime
33
-
34
- pred_type: PredicateType
35
- signature: str
36
-
37
- src_code: str = ""
38
- iml: str = ""
39
-
40
- is_iml_valid: IMLValidity = IMLValidity.UNKNOWN
41
- iml_error: str | None = None
42
-
43
- links: LinkedArtifactsPM = Field(default_factory=LinkedArtifactsPM)
44
-
45
-
46
- class TransitionPM(BaseModel):
47
- kind: Literal["transition"] = "transition"
48
- comp_id: str
49
- name: str
50
- last_updated: datetime
51
-
52
- signature: str
53
-
54
- src_code: str = ""
55
- iml: str = ""
56
-
57
- is_iml_valid: IMLValidity = IMLValidity.UNKNOWN
58
- iml_error: str | None = None
59
-
60
- links: LinkedArtifactsPM = Field(default_factory=LinkedArtifactsPM)
@@ -1,34 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/recommendations.py
5
- #
6
-
7
-
8
- from __future__ import annotations
9
-
10
- from typing import Literal
11
- from pydantic import BaseModel, Field
12
-
13
-
14
- RecommendationKind = Literal["error", "warning", "next", "info"]
15
-
16
-
17
- class RecommendationPM(BaseModel):
18
- kind: RecommendationKind = "next"
19
- priority: int = 50 # lower = higher priority
20
- text: str
21
-
22
-
23
- class RecommendationsPM(BaseModel):
24
- """
25
- A presentable bundle of recommendations (already deduped/sorted upstream).
26
- """
27
- count: int = 0
28
- items: list[RecommendationPM] = Field(default_factory=list)
29
-
30
- # Optional: quick counts by kind (useful for compact views)
31
- num_error: int = 0
32
- num_warning: int = 0
33
- num_next: int = 0
34
- num_info: int = 0
@@ -1,31 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/scenario.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel, Field
11
-
12
-
13
- class ScenarioStatusPM(BaseModel):
14
- kind: Literal["valid", "missing", "inconsistent"]
15
- missing_preds: list[str] = Field(default_factory=list)
16
- missing_trans: list[str] = Field(default_factory=list)
17
-
18
-
19
- class ScenarioPM(BaseModel):
20
- comp_id: str
21
- name: str
22
-
23
- status: ScenarioStatusPM
24
-
25
- given: list[str] = Field(default_factory=list)
26
- when: list[str] = Field(default_factory=list)
27
- then: list[str] = Field(default_factory=list)
28
-
29
- given_preds_consistent: bool = True
30
- when_preds_consistent: bool = True
31
- all_preds_consistent: bool = True
@@ -1,40 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/scenario_complement.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel
11
-
12
-
13
- class ScenarioComplementRegionPM(BaseModel):
14
- """
15
- Lightweight representation of a single region.
16
-
17
- We store:
18
- - fp: stable-ish short fingerprint (from modeling/complement.py)
19
- - invariant/model/model_eval/constraints: optional strings for display
20
- """
21
- fp: str
22
-
23
- num_constraints: int = 0
24
- invariant: str | None = None
25
- model: str | None = None
26
- model_eval: str | None = None
27
-
28
- # optional: include a few constraints for preview
29
- constraints_preview: list[str] = []
30
-
31
-
32
- class ScenarioComplementPM(BaseModel):
33
- kind: Literal["scenario_complement"] = "scenario_complement"
34
-
35
- count_regions: int = 0
36
-
37
- # a small sample for UI
38
- regions_preview: list[ScenarioComplementRegionPM] = []
39
-
40
- regions_all: list[ScenarioComplementRegionPM] | None = None
@@ -1,34 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/smart_find.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel, Field
11
-
12
- from speclogician.presentation.models.trace import TestTracePM, LogTracePM
13
- from speclogician.presentation.models.data_artifact import DocRefPM, SrcCodeRefPM
14
-
15
-
16
- class SmartFindCountsPM(BaseModel):
17
- needle: str
18
- num_test_traces: int = 0
19
- num_log_traces: int = 0
20
- num_doc_refs: int = 0
21
- num_src_code_refs: int = 0
22
-
23
-
24
- class SmartFindItemsPM(BaseModel):
25
- test_traces: list[TestTracePM] = Field(default_factory=list)
26
- log_traces: list[LogTracePM] = Field(default_factory=list)
27
- doc_refs: list[DocRefPM] = Field(default_factory=list)
28
- src_code_refs: list[SrcCodeRefPM] = Field(default_factory=list)
29
-
30
-
31
- class SmartFindPM(BaseModel):
32
- kind: Literal["smart_find"] = "smart_find"
33
- counts: SmartFindCountsPM
34
- items: SmartFindItemsPM
@@ -1,32 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/spec.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
- from pydantic import BaseModel
11
-
12
- from speclogician.presentation.models.domain import DomainModelPM
13
- from speclogician.presentation.models.scenario_complement import ScenarioComplementPM
14
-
15
-
16
- class SpecCountsPM(BaseModel):
17
- num_sc_total: int = 0
18
- num_sc_missing: int = 0
19
- num_sc_matched: int = 0
20
- num_sc_inconsistent: int = 0
21
- num_sc_conflicted: int = 0
22
-
23
-
24
- class SpecPM(BaseModel):
25
- kind: Literal["spec"] = "spec"
26
- domain: DomainModelPM
27
- counts: SpecCountsPM
28
-
29
- # cheap “list view” for CLI
30
- scenario_names: list[str] = []
31
-
32
- scenario_complement: ScenarioComplementPM | None = None
@@ -1,34 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/state_diff.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Any, Literal
10
- from pydantic import BaseModel, Field
11
-
12
- from speclogician.state.diff import ComparisonOutcome
13
-
14
-
15
- class DiffRowPM(BaseModel):
16
- label: str
17
- before: Any
18
- after: Any
19
- outcome: ComparisonOutcome = ComparisonOutcome.UNKNOWN
20
- message: str = ""
21
-
22
-
23
- class DiffSectionPM(BaseModel):
24
- title: str
25
- rows: list[DiffRowPM] = Field(default_factory=list)
26
-
27
- def empty(self) -> bool:
28
- return not self.rows
29
-
30
-
31
- class StateDiffPM(BaseModel):
32
- kind: Literal["state_diff"] = "state_diff"
33
- has_changes: bool
34
- sections: list[DiffSectionPM] = Field(default_factory=list)
@@ -1,31 +0,0 @@
1
- #
2
- # Imandra Inc.
3
- #
4
- # speclogician/presentation/models/state_instance.py
5
- #
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Literal
10
-
11
- from pydantic import BaseModel
12
-
13
- from speclogician.presentation.models.state_instance_summary import StateInstanceSummaryPM
14
- from speclogician.presentation.models.spec import SpecPM
15
- from speclogician.presentation.models.container import ArtifactContainerPM
16
- from speclogician.presentation.models.state_diff import StateDiffPM
17
- from speclogician.presentation.models.recommendations import RecommendationsPM
18
-
19
-
20
- class StateInstancePM(BaseModel):
21
- kind: Literal["state_instance"] = "state_instance"
22
-
23
- summary: StateInstanceSummaryPM
24
-
25
- # Optional heavy sections
26
- spec: SpecPM | None = None
27
- artifacts: ArtifactContainerPM | None = None
28
- state_diff: StateDiffPM | None = None
29
-
30
- # Recommendations (computed after change/diff)
31
- recommendations: RecommendationsPM