Repository navigation
Expand file tree
/
Copy pathpanll_gui.affine
More file actions
105 lines (93 loc) · 3.17 KB
/
Copy pathpanll_gui.affine
File metadata and controls
105 lines (93 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// SPDX-License-Identifier: AGPL-3.0-or-later
// PanLL GUI — AffineScript TEA Interface
// Underpinned by Cadre Router (Affine Stack Implementation)
//
// Purpose: Provide a formally verified, resource-safe interface for the
// PanLL Panel Layout Language — Mission Control for the hyperpolymath ecosystem.
//
// Nature: AffineScript TEA loop where Model and Msg are consumed linearly
// to ensure state transition integrity.
// ── PanLL Panes ───────────────────────────────────────────────────────────
enum PanLLPane {
PaneL, // Symbolic
PaneN, // Neural
PaneW, // World (Barycentre)
Vexometer
}
// ── Model ───────────────────────────────────────────────────────────────────
/**
* PanLL GUI Model.
* history_depth tracks the navigation stack size.
*/
struct Model {
current_pane: PanLLPane,
history_depth: Int
}
// ── Msg ──────────────────────────────────────────────────────────────────────
enum Msg {
Navigate(PanLLPane),
PopState
}
// ── TEA Logic ────────────────────────────────────────────────────────────────
/**
* Initial state: PaneW (Task Barycentre) with no history.
*/
fn panll_init() -> Model {
#{
current_pane: PanLLPane::PaneW,
history_depth: 0
}
}
/**
* Affine TEA Update function.
* @linear annotations enforce that every state transition is accounted for.
* Underpinned by Cadre Router: navigation pushes current to stack.
*/
fn panll_update(@linear msg: Msg, @linear model: Model) -> Model {
match model {
{ current_pane: c, history_depth: h } => {
match msg {
Navigate(new_pane) => {
// Consume old model, produce new model with incremented history depth
#{
current_pane: new_pane,
history_depth: h + 1
}
}
PopState => {
if h > 0 {
// Return to PaneW if stack has items
#{
current_pane: PanLLPane::PaneW,
history_depth: h - 1
}
} else {
// No-op transition: return model as-is
#{
current_pane: c,
history_depth: 0
}
}
}
}
}
}
}
/**
* View function: Renders the current pane name.
* Owned model prevents codegen errors with refs.
*/
fn panll_view(model: Model) -> String {
match model.current_pane {
PaneL => "PANE-L: SYMBOLIC MASS (Strict Logic & Constraints)",
PaneN => "PANE-N: NEURAL STREAM (Inference Manifold)",
PaneW => "PANE-W: WORLD BARYCENTRE (Shared Task Canvas)",
Vexometer => "VEXOMETER (Cognitive Friction Monitor)"
}
}
/**
* Subscriptions function.
*/
fn panll_subs(model: Model) -> String {
"None"
}