Spaces:
Sleeping

ARD-RGL commited on
Commit
572e20a
·
verified ·
1 Parent(s): 222baef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +129 -181
app.py CHANGED
@@ -1,209 +1,173 @@
1
- ````python
2
  import gradio as gr
3
  from datetime import datetime
4
 
5
- APP_TITLE = "Sourceborn — All-in-One Package"
6
 
7
  ACCEPTED_CONCEPTS = [
8
- "Point Zero",
9
- "Source Point",
10
- "Halt Point",
11
- "Mystery",
12
- "Invention",
13
- "Point Zero with Product",
14
- "Point Zero + Product",
15
- ]
16
-
17
- CODEX_FILES = [
18
- "Project: Sourceborn → 00_TALK_AND_CONTROL → 00_SOURCEBORN_LOCK_STATUS.md",
19
- "Project: Sourceborn → CODEX_HANDOFF → 00_CODEX_MASTER_PROMPT.md",
20
- "Project: Sourceborn → CODEX_HANDOFF → 01_PHASEWISE_BUILD_PLAN.md",
21
- "Project: Sourceborn → 01_SOURCEBORN_ENGINE → 03_BACKEND_CONTRACT.md",
22
- "Project: Sourceborn → 01_SOURCEBORN_ENGINE → 05_FILTER_AND_PARAMETER_SPEC.md",
23
- "Project: Sourceborn → 02_URR → 01_URR_REVIEW_GATE_SPEC.md",
24
  ]
25
 
26
  BACKEND_SUPPORT = [
27
- "raw source lock",
28
- "session and run tracking",
29
- "node definitions",
30
- "high-parameter memory entries",
31
- "filter results",
32
- "halt points",
33
- "loop creation",
34
- "merge proposals",
35
- "URR PASS / HOLD / REJECT reviews",
36
- "human gate decisions",
37
- "master log events",
38
- "archive/source references",
39
- ]
40
-
41
- DO_NOT_DO = [
42
- "Do not finalize naming.",
43
- "Do not freeze the core.",
44
- "Do not rename Sourceborn folders.",
45
- "Do not treat old ARD/RGL/RH material as active Sourceborn modules.",
46
- "Do not expose private engine details in public UI.",
47
- "Do not force product early.",
48
- "Do not treat Halt Point as failure.",
49
- "Do not remove Mystery or Invention.",
50
  ]
51
 
52
  PHASES = [
53
- ("Phase 0", "Repo safety + Sourceborn lock", "Ready"),
54
- ("Phase 1", "Database models", "Pending"),
55
- ("Phase 2", "Master Log service", "Pending"),
56
- ("Phase 3", "Raw source lock + filter pipeline", "Pending"),
57
- ("Phase 4", "Halt Point → Loop/Sub-loop engine", "Pending"),
58
- ("Phase 5", "URR PASS / HOLD / REJECT gates", "Pending"),
59
- ("Phase 6", "Human gate decisions", "Pending"),
60
- ("Phase 7", "Memory search + merge proposal", "Pending"),
61
- ("Phase 8", "Archive/source ingestion", "Pending"),
62
- ("Phase 9", "Modern control dashboard", "Ready"),
63
- ("Phase 10", "Tests + deploy safety", "Pending"),
64
  ]
65
 
66
-
67
  def make_list(items):
68
- return "\n".join([f"- {item}" for item in items])
69
-
70
 
71
  def make_phase_table():
72
- rows = "| Phase | Task | Status |\n|---|---|---|\n"
73
- for phase, task, status in PHASES:
74
- rows += f"| {phase} | {task} | {status} |\n"
75
- return rows
76
-
77
 
78
  def generate_review(raw_input, clarity_check, risk_check, improved_output, decision):
79
- now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
 
 
 
 
80
 
81
- return f"""
82
  # {decision} Review
83
 
84
  **Time:** {now}
85
 
86
  ## Raw Input
 
87
  {raw_input or "No raw input provided."}
88
 
89
  ## Clarity Check
 
90
  {clarity_check or "No clarity check provided."}
91
 
92
  ## Risk Check
 
93
  {risk_check or "No risk check provided."}
94
 
95
  ## Improved Verified Output
 
96
  {improved_output or "No improved output provided."}
97
 
98
  ## Sourceborn Lock
99
- - Sourceborn Sequence = v0.1 Review Status
100
- - Concepts = Keep
101
- - Naming = Review
102
- - Core = Not final
103
- - Freeze = Not approved
104
- """
105
 
 
 
 
 
 
 
106
 
107
  CSS = """
108
  .gradio-container {
109
- max-width: 1220px !important;
110
- margin: auto !important;
111
  }
112
 
113
  .sb-hero {
114
- padding: 28px;
115
- border-radius: 24px;
116
- background:
117
- radial-gradient(circle at top left, rgba(99,102,241,0.35), transparent 34%),
118
- linear-gradient(135deg, rgba(15,23,42,0.98), rgba(30,41,59,0.92));
119
- border: 1px solid rgba(148,163,184,0.22);
120
- box-shadow: 0 24px 70px rgba(2,6,23,0.35);
121
  }
122
 
123
  .sb-title {
124
- font-size: 38px;
125
- font-weight: 850;
126
- letter-spacing: -0.04em;
127
- margin-bottom: 8px;
128
  }
129
 
130
  .sb-subtitle {
131
- color: #cbd5e1;
132
- font-size: 16px;
133
- line-height: 1.6;
134
  }
135
 
136
  .sb-badge {
137
- display: inline-block;
138
- padding: 7px 13px;
139
- margin: 10px 8px 0 0;
140
- border-radius: 999px;
141
- background: rgba(99,102,241,0.18);
142
- border: 1px solid rgba(165,180,252,0.35);
143
- color: #e0e7ff;
144
- font-size: 14px;
145
- font-weight: 650;
146
- }
147
-
148
- .sb-warning {
149
- padding: 16px;
150
- border-radius: 16px;
151
- background: rgba(251,191,36,0.10);
152
- border: 1px solid rgba(251,191,36,0.28);
153
  }
154
  """
155
 
156
-
157
  with gr.Blocks(css=CSS, title=APP_TITLE) as demo:
158
- gr.HTML(
159
- """
160
- <div class="sb-hero">
161
- <div class="sb-title">Sourceborn — All-in-One Package</div>
162
- <div class="sb-subtitle">
163
- One clean starting point, one locked status, and one phasewise build path.
164
- This dashboard is public-safe and does not expose private Sourceborn core logic.
165
- </div>
166
- <span class="sb-badge">v0.1 Review Status</span>
167
- <span class="sb-badge">Concepts = Keep</span>
168
- <span class="sb-badge">Naming = Review</span>
169
- <span class="sb-badge">Core = Not final</span>
170
- <span class="sb-badge">Freeze = Not approved</span>
171
- </div>
172
  """
173
- )
174
 
175
- with gr.Tab("Lock Status"):
176
- gr.Markdown(
177
- """
178
  # Current Lock
179
 
180
- | Area | Status |
181
- |---|---|
182
- | Sourceborn Sequence | v0.1 Review Status |
183
- | Concepts | Keep |
184
- | Naming | Review |
185
- | Core | Not final |
186
- | Freeze | Not approved |
187
- | Next | Test with more examples later before freeze |
188
 
189
  ## Active Structure Only
190
 
191
- ```text
192
  Sourceborn/
193
- ├── 00_TALK_AND_CONTROL
194
- ├── 01_SOURCEBORN_ENGINE
195
- ├── 02_URR
196
- └── 99_ARCHIVE
197
- ````
198
 
199
- """
200
- )
 
 
 
 
201
 
202
- ```
203
- with gr.Tab("Accepted Concepts"):
204
- gr.Markdown(
205
- f"""
206
- ```
207
 
208
  # Accepted Concepts Only
209
 
@@ -212,45 +176,17 @@ with gr.Tab("Accepted Concepts"):
212
  )
213
 
214
  ```
215
- with gr.Tab("Codex Start"):
216
  gr.Markdown(
217
  f"""
218
  ```
219
 
220
- # First Instruction for Codex
221
-
222
- Open this file first, then open:
223
-
224
- {make_list(CODEX_FILES)}
225
-
226
- ## What Codex Must Build First
227
-
228
- Codex must build the Sourceborn control shell and backend foundation before any full engine expansion.
229
-
230
- The backend must support:
231
 
232
  {make_list(BACKEND_SUPPORT)}
233
  """
234
  )
235
 
236
- ```
237
- with gr.Tab("Do Not Change"):
238
- gr.Markdown(
239
- f"""
240
- ```
241
-
242
- # What Codex Must Not Do
243
-
244
- {make_list(DO_NOT_DO)}
245
-
246
- <div class="sb-warning">
247
-
248
- **HOLD rule:** If any change touches core, naming freeze, folder rename, private sequence exposure, or archive activation, stop and mark HOLD.
249
-
250
- </div>
251
- """
252
- )
253
-
254
  ```
255
  with gr.Tab("Phasewise Build"):
256
  gr.Markdown(
@@ -277,9 +213,9 @@ Codex must complete one phase at a time and report:
277
 
278
  # Output Rule
279
 
280
- For public-safe review output, show only:
281
 
282
- **Raw Input → Clarity Check → Risk Check → Improved Verified Output**
283
  """
284
  )
285
 
@@ -307,16 +243,33 @@ For public-safe review output, show only:
307
  outputs=result,
308
  )
309
 
310
- with gr.Tab("Resume Later"):
311
  gr.Markdown(
312
  """
313
  ```
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  # Resume Point
316
 
317
  Resume from:
318
 
319
- **Sourceborn Sequence v0.1 — Review Status**
320
 
321
  Current accepted status:
322
 
@@ -325,13 +278,8 @@ Current accepted status:
325
  * Core = Not final
326
  * Freeze = Not approved
327
  * Next = Test with more examples later before freeze
328
-
329
- Do not change core unless approved.
330
- """
331
- )
332
 
333
  if **name** == "**main**":
334
  demo.launch()
335
-
336
- ```
337
- ```
 
 
1
  import gradio as gr
2
  from datetime import datetime
3
 
4
+ APP_TITLE = "Sourceborn URR Control Shell"
5
 
6
  ACCEPTED_CONCEPTS = [
7
+ "Point Zero",
8
+ "Source Point",
9
+ "Halt Point",
10
+ "Mystery",
11
+ "Invention",
12
+ "Point Zero with Product",
13
+ "Point Zero + Product",
 
 
 
 
 
 
 
 
 
14
  ]
15
 
16
  BACKEND_SUPPORT = [
17
+ "raw source lock",
18
+ "session and run tracking",
19
+ "node definitions",
20
+ "high-parameter memory entries",
21
+ "filter results",
22
+ "halt points",
23
+ "loop creation",
24
+ "merge proposals",
25
+ "URR PASS / HOLD / REJECT reviews",
26
+ "human gate decisions",
27
+ "master log events",
28
+ "archive/source references",
 
 
 
 
 
 
 
 
 
 
 
29
  ]
30
 
31
  PHASES = [
32
+ ("Phase 0", "Repo safety + Sourceborn lock", "Ready"),
33
+ ("Phase 1", "Database models", "Pending"),
34
+ ("Phase 2", "Master Log service", "Pending"),
35
+ ("Phase 3", "Raw source lock + filter pipeline", "Pending"),
36
+ ("Phase 4", "Halt Point → Loop/Sub-loop engine", "Pending"),
37
+ ("Phase 5", "URR PASS / HOLD / REJECT gates", "Pending"),
38
+ ("Phase 6", "Human gate decisions", "Pending"),
39
+ ("Phase 7", "Memory search + merge proposal", "Pending"),
40
+ ("Phase 8", "Archive/source ingestion", "Pending"),
41
+ ("Phase 9", "Modern control dashboard", "Ready"),
42
+ ("Phase 10", "Tests + deploy safety", "Pending"),
43
  ]
44
 
 
45
  def make_list(items):
46
+ return "\n".join([f"- {item}" for item in items])
 
47
 
48
  def make_phase_table():
49
+ rows = "| Phase | Task | Status |\n|---|---|---|\n"
50
+ for phase, task, status in PHASES:
51
+ rows += f"| {phase} | {task} | {status} |\n"
52
+ return rows
 
53
 
54
  def generate_review(raw_input, clarity_check, risk_check, improved_output, decision):
55
+ now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
56
+
57
+ ```
58
+ return f"""
59
+ ```
60
 
 
61
  # {decision} Review
62
 
63
  **Time:** {now}
64
 
65
  ## Raw Input
66
+
67
  {raw_input or "No raw input provided."}
68
 
69
  ## Clarity Check
70
+
71
  {clarity_check or "No clarity check provided."}
72
 
73
  ## Risk Check
74
+
75
  {risk_check or "No risk check provided."}
76
 
77
  ## Improved Verified Output
78
+
79
  {improved_output or "No improved output provided."}
80
 
81
  ## Sourceborn Lock
 
 
 
 
 
 
82
 
83
+ * Sourceborn Sequence = v0.1 Review Status
84
+ * Concepts = Keep
85
+ * Naming = Review
86
+ * Core = Not final
87
+ * Freeze = Not approved
88
+ """
89
 
90
  CSS = """
91
  .gradio-container {
92
+ max-width: 1220px !important;
93
+ margin: auto !important;
94
  }
95
 
96
  .sb-hero {
97
+ padding: 28px;
98
+ border-radius: 24px;
99
+ background:
100
+ radial-gradient(circle at top left, rgba(99,102,241,0.35), transparent 34%),
101
+ linear-gradient(135deg, rgba(15,23,42,0.98), rgba(30,41,59,0.92));
102
+ border: 1px solid rgba(148,163,184,0.22);
103
+ box-shadow: 0 24px 70px rgba(2,6,23,0.35);
104
  }
105
 
106
  .sb-title {
107
+ font-size: 38px;
108
+ font-weight: 850;
109
+ letter-spacing: -0.04em;
110
+ margin-bottom: 8px;
111
  }
112
 
113
  .sb-subtitle {
114
+ color: #cbd5e1;
115
+ font-size: 16px;
116
+ line-height: 1.6;
117
  }
118
 
119
  .sb-badge {
120
+ display: inline-block;
121
+ padding: 7px 13px;
122
+ margin: 10px 8px 0 0;
123
+ border-radius: 999px;
124
+ background: rgba(99,102,241,0.18);
125
+ border: 1px solid rgba(165,180,252,0.35);
126
+ color: #e0e7ff;
127
+ font-size: 14px;
128
+ font-weight: 650;
 
 
 
 
 
 
 
129
  }
130
  """
131
 
 
132
  with gr.Blocks(css=CSS, title=APP_TITLE) as demo:
133
+ gr.HTML(
134
+ """ <div class="sb-hero"> <div class="sb-title">Sourceborn URR Control Shell</div> <div class="sb-subtitle">
135
+ Public-safe dashboard for Sourceborn v0.1 Review Status.
136
+ This shell does not expose private Sourceborn core logic. </div> <span class="sb-badge">v0.1 Review Status</span> <span class="sb-badge">Concepts = Keep</span> <span class="sb-badge">Naming = Review</span> <span class="sb-badge">Core = Not final</span> <span class="sb-badge">Freeze = Not approved</span> </div>
137
+ """
138
+ )
139
+
140
+ ```
141
+ with gr.Tab("Lock Status"):
142
+ gr.Markdown(
 
 
 
 
143
  """
144
+ ```
145
 
 
 
 
146
  # Current Lock
147
 
148
+ | Area | Status |
149
+ | ------------------- | ------------------------------------------- |
150
+ | Sourceborn Sequence | v0.1 Review Status |
151
+ | Concepts | Keep |
152
+ | Naming | Review |
153
+ | Core | Not final |
154
+ | Freeze | Not approved |
155
+ | Next | Test with more examples later before freeze |
156
 
157
  ## Active Structure Only
158
 
 
159
  Sourceborn/
 
 
 
 
 
160
 
161
+ * 00_TALK_AND_CONTROL
162
+ * 01_SOURCEBORN_ENGINE
163
+ * 02_URR
164
+ * 99_ARCHIVE
165
+ """
166
+ )
167
 
168
+ with gr.Tab("Accepted Concepts"):
169
+ gr.Markdown(
170
+ f"""
 
 
171
 
172
  # Accepted Concepts Only
173
 
 
176
  )
177
 
178
  ```
179
+ with gr.Tab("Backend Foundation"):
180
  gr.Markdown(
181
  f"""
182
  ```
183
 
184
+ # Backend Must Support
 
 
 
 
 
 
 
 
 
 
185
 
186
  {make_list(BACKEND_SUPPORT)}
187
  """
188
  )
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  ```
191
  with gr.Tab("Phasewise Build"):
192
  gr.Markdown(
 
213
 
214
  # Output Rule
215
 
216
+ For public/external output, show only:
217
 
218
+ Raw Input → Clarity Check → Risk Check → Improved Verified Output
219
  """
220
  )
221
 
 
243
  outputs=result,
244
  )
245
 
246
+ with gr.Tab("Do Not Change"):
247
  gr.Markdown(
248
  """
249
  ```
250
 
251
+ # What Codex Must Not Do
252
+
253
+ * Do not finalize naming.
254
+ * Do not freeze the core.
255
+ * Do not rename Sourceborn folders.
256
+ * Do not treat old ARD/RGL/RH material as active Sourceborn modules.
257
+ * Do not expose private engine details in public UI.
258
+ * Do not force product early.
259
+ * Do not treat Halt Point as failure.
260
+ * Do not remove Mystery or Invention.
261
+ """
262
+ )
263
+
264
+ with gr.Tab("Resume Later"):
265
+ gr.Markdown(
266
+ """
267
+
268
  # Resume Point
269
 
270
  Resume from:
271
 
272
+ Sourceborn Sequence v0.1 — Review Status
273
 
274
  Current accepted status:
275
 
 
278
  * Core = Not final
279
  * Freeze = Not approved
280
  * Next = Test with more examples later before freeze
281
+ """
282
+ )
 
 
283
 
284
  if **name** == "**main**":
285
  demo.launch()