Skip to content

Commit eb45b11

Browse files
port(src/ui/tea/invariant_path_gui.affine): ReScript surface -> AffineScript (Refs #229) (#4)
Oracle-validated Tier-1 port (affinescript main @ #229 canonical map, docs/RESCRIPT-ELIMINATION.adoc): - List(T) -> [T] (3 occurrences) - expression-position record literals { ... } -> #{ ... } (the record sigil, spec.md:414-421). Match record-PATTERNS and struct/enum/type decl bodies correctly left as { } (sigil is expression-literal-only, oracle-confirmed). - ReScript string `+` -> AffineScript `++` where present (concat is `++`; `+` is numeric — left a String/Int unify error beneath the parse wall; numeric `+`/`-` untouched). Verified: `affinescript main check src/ui/tea/invariant_path_gui.affine` -> Type checking passed (was: parse error / DRIFT-SYNTAX pre-port). Self-contained file, no imports. Refs #229 (estate-wide, sequenced, human-gated — not Closes). Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7614ed7 commit eb45b11

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/ui/tea/invariant_path_gui.affine

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Claim {
1717
struct TraceStep {
1818
step_id: Int,
1919
description: String,
20-
affected_claims: List(Claim)
20+
affected_claims: [Claim]
2121
}
2222

2323
enum ViewState {
@@ -30,7 +30,7 @@ enum ViewState {
3030

3131
struct Model {
3232
view_state: ViewState,
33-
active_trace: List(TraceStep),
33+
active_trace: [TraceStep],
3434
current_step_index: Int,
3535
is_scanning: Bool,
3636
history_depth: Int
@@ -41,15 +41,15 @@ struct Model {
4141
enum Msg {
4242
Navigate(ViewState),
4343
StartScan,
44-
ScanComplete(List(TraceStep)),
44+
ScanComplete([TraceStep]),
4545
SelectStep(Int),
4646
PopState
4747
}
4848

4949
// ── TEA Logic ────────────────────────────────────────────────────────────────
5050

5151
fn invariant_path_init() -> Model {
52-
{
52+
#{
5353
view_state: ViewState::Dashboard,
5454
active_trace: [],
5555
current_step_index: -1,
@@ -63,7 +63,7 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
6363
{ view_state: v, active_trace: t, current_step_index: i, is_scanning: s, history_depth: h } => {
6464
match msg {
6565
Navigate(new_state) => {
66-
{
66+
#{
6767
view_state: new_state,
6868
active_trace: t,
6969
current_step_index: i,
@@ -73,7 +73,7 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
7373
}
7474

7575
StartScan => {
76-
{
76+
#{
7777
view_state: v,
7878
active_trace: t,
7979
current_step_index: i,
@@ -83,7 +83,7 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
8383
}
8484

8585
ScanComplete(new_trace) => {
86-
{
86+
#{
8787
view_state: ViewState::TraceViewer,
8888
active_trace: new_trace,
8989
current_step_index: 0,
@@ -93,7 +93,7 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
9393
}
9494

9595
SelectStep(new_idx) => {
96-
{
96+
#{
9797
view_state: v,
9898
active_trace: t,
9999
current_step_index: new_idx,
@@ -104,15 +104,15 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
104104

105105
PopState => {
106106
if h > 0 {
107-
{
107+
#{
108108
view_state: ViewState::Dashboard,
109109
active_trace: t,
110110
current_step_index: -1,
111111
is_scanning: false,
112112
history_depth: h - 1
113113
}
114114
} else {
115-
{
115+
#{
116116
view_state: v,
117117
active_trace: t,
118118
current_step_index: i,
@@ -129,7 +129,7 @@ fn invariant_path_update(@linear msg: Msg, @linear model: Model) -> Model {
129129
fn invariant_path_view(model: Model) -> String {
130130
match model.view_state {
131131
Dashboard => "INVARIANT PATH: Claim Tracing Dashboard",
132-
TraceViewer => "TRACE VIEWER: Step " + (if model.current_step_index >= 0 { "Active" } else { "None" }),
132+
TraceViewer => "TRACE VIEWER: Step " ++ (if model.current_step_index >= 0 { "Active" } else { "None" }),
133133
IntegrityReport => "INTEGRITY REPORT: Factual Claim Grounding"
134134
}
135135
}

0 commit comments

Comments
 (0)