Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,7 @@ from datetime import datetime
|
|
| 3 |
import subprocess
|
| 4 |
import sys
|
| 5 |
|
| 6 |
-
# --- SELF-FIX HELPER ---
|
| 7 |
-
# If this file ever breaks again with IndentationError:
|
| 8 |
-
# 1. Add 'autopep8' to requirements.txt
|
| 9 |
-
# 2. Run in the terminal: python -m autopep8 -i app.py --select=E101,E111,E121
|
| 10 |
-
# 3. Factory reboot the Space
|
| 11 |
def self_fix():
|
| 12 |
"""Attempt to auto-fix indentation using autopep8."""
|
| 13 |
try:
|
|
@@ -29,7 +25,6 @@ ACCEPTED_CONCEPTS = [
|
|
| 29 |
"Mystery",
|
| 30 |
"Invention",
|
| 31 |
"Point Zero with Product",
|
| 32 |
-
"Point Zero + Product",
|
| 33 |
]
|
| 34 |
|
| 35 |
BACKEND_SUPPORT = [
|
|
@@ -61,10 +56,31 @@ PHASES = [
|
|
| 61 |
("Phase 10", "Tests + deploy safety", "Pending"),
|
| 62 |
]
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
def format_items(items):
|
| 66 |
return "\n".join([f"- {item}" for item in items])
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
def make_phase_table():
|
| 70 |
rows = "| Phase | Task | Status |\n|---|---|---|\n"
|
|
@@ -72,7 +88,6 @@ def make_phase_table():
|
|
| 72 |
rows += f"| {phase} | {task} | {status} |\n"
|
| 73 |
return rows
|
| 74 |
|
| 75 |
-
|
| 76 |
def generate_review(raw_input, clarity_check, risk_check, improved_output, decision):
|
| 77 |
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 78 |
return f"""# {decision} Review
|
|
@@ -80,23 +95,18 @@ def generate_review(raw_input, clarity_check, risk_check, improved_output, decis
|
|
| 80 |
**Time:** {now}
|
| 81 |
|
| 82 |
## Raw Input
|
| 83 |
-
|
| 84 |
{raw_input or "No raw input provided."}
|
| 85 |
|
| 86 |
## Clarity Check
|
| 87 |
-
|
| 88 |
{clarity_check or "No clarity check provided."}
|
| 89 |
|
| 90 |
## Risk Check
|
| 91 |
-
|
| 92 |
{risk_check or "No risk check provided."}
|
| 93 |
|
| 94 |
## Improved Verified Output
|
| 95 |
-
|
| 96 |
{improved_output or "No improved output provided."}
|
| 97 |
|
| 98 |
## Sourceborn Lock
|
| 99 |
-
|
| 100 |
* Sourceborn Sequence = v0.1 Review Status
|
| 101 |
* Concepts = Keep
|
| 102 |
* Naming = Review
|
|
@@ -104,7 +114,6 @@ def generate_review(raw_input, clarity_check, risk_check, improved_output, decis
|
|
| 104 |
* Freeze = Not approved
|
| 105 |
"""
|
| 106 |
|
| 107 |
-
|
| 108 |
CSS = """
|
| 109 |
.gradio-container {
|
| 110 |
max-width: 1220px !important;
|
|
@@ -123,7 +132,7 @@ CSS = """
|
|
| 123 |
|
| 124 |
.sb-title {
|
| 125 |
font-size: 38px;
|
| 126 |
-
font-weight:
|
| 127 |
letter-spacing: -0.04em;
|
| 128 |
margin-bottom: 8px;
|
| 129 |
}
|
|
@@ -143,11 +152,10 @@ CSS = """
|
|
| 143 |
border: 1px solid rgba(165,180,252,0.35);
|
| 144 |
color: #e0e7ff;
|
| 145 |
font-size: 14px;
|
| 146 |
-
font-weight:
|
| 147 |
}
|
| 148 |
"""
|
| 149 |
|
| 150 |
-
|
| 151 |
with gr.Blocks(css=CSS, title=APP_TITLE) as demo:
|
| 152 |
gr.HTML(
|
| 153 |
"""
|
|
@@ -168,26 +176,14 @@ with gr.Blocks(css=CSS, title=APP_TITLE) as demo:
|
|
| 168 |
|
| 169 |
with gr.Tab("Lock Status"):
|
| 170 |
gr.Markdown(
|
| 171 |
-
"""
|
| 172 |
# Current Lock
|
| 173 |
|
| 174 |
-
|
| 175 |
-
| ------------------- | ------------------------------------------- |
|
| 176 |
-
| Sourceborn Sequence | v0.1 Review Status |
|
| 177 |
-
| Concepts | Keep |
|
| 178 |
-
| Naming | Review |
|
| 179 |
-
| Core | Not final |
|
| 180 |
-
| Freeze | Not approved |
|
| 181 |
-
| Next | Test with more examples later before freeze |
|
| 182 |
|
| 183 |
## Active Structure Only
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
* 00_TALK_AND_CONTROL
|
| 188 |
-
* 01_SOURCEBORN_ENGINE
|
| 189 |
-
* 02_URR
|
| 190 |
-
* 99_ARCHIVE
|
| 191 |
"""
|
| 192 |
)
|
| 193 |
|
|
@@ -278,7 +274,7 @@ Raw Input → Clarity Check → Risk Check → Improved Verified Output
|
|
| 278 |
|
| 279 |
with gr.Tab("Resume Later"):
|
| 280 |
gr.Markdown(
|
| 281 |
-
"""
|
| 282 |
# Resume Point
|
| 283 |
|
| 284 |
Resume from:
|
|
@@ -287,13 +283,10 @@ Sourceborn Sequence v0.1 — Review Status
|
|
| 287 |
|
| 288 |
Current accepted status:
|
| 289 |
|
| 290 |
-
|
| 291 |
-
* Naming = Review
|
| 292 |
-
* Core = Not final
|
| 293 |
-
* Freeze = Not approved
|
| 294 |
-
* Next = Test with more examples later before freeze
|
| 295 |
"""
|
| 296 |
)
|
| 297 |
|
| 298 |
if __name__ == "__main__":
|
| 299 |
-
demo.launch()
|
|
|
|
|
|
| 3 |
import subprocess
|
| 4 |
import sys
|
| 5 |
|
| 6 |
+
# --- SELF-FIX HELPER (stdlib only) ---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
def self_fix():
|
| 8 |
"""Attempt to auto-fix indentation using autopep8."""
|
| 9 |
try:
|
|
|
|
| 25 |
"Mystery",
|
| 26 |
"Invention",
|
| 27 |
"Point Zero with Product",
|
|
|
|
| 28 |
]
|
| 29 |
|
| 30 |
BACKEND_SUPPORT = [
|
|
|
|
| 56 |
("Phase 10", "Tests + deploy safety", "Pending"),
|
| 57 |
]
|
| 58 |
|
| 59 |
+
LOCK_STATUS_LINES = [
|
| 60 |
+
("Sourceborn Sequence", "v0.1 Review Status"),
|
| 61 |
+
("Concepts", "Keep"),
|
| 62 |
+
("Naming", "Review"),
|
| 63 |
+
("Core", "Not final"),
|
| 64 |
+
("Freeze", "Not approved"),
|
| 65 |
+
("Next", "Test with more examples later before freeze"),
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
ACTIVE_STRUCTURE = [
|
| 69 |
+
"Sourceborn/",
|
| 70 |
+
"00_TALK_AND_CONTROL",
|
| 71 |
+
"01_SOURCEBORN_ENGINE",
|
| 72 |
+
"02_URR",
|
| 73 |
+
"99_ARCHIVE",
|
| 74 |
+
]
|
| 75 |
|
| 76 |
def format_items(items):
|
| 77 |
return "\n".join([f"- {item}" for item in items])
|
| 78 |
|
| 79 |
+
def make_lock_table():
|
| 80 |
+
rows = "| Area | Status |\n|---|---|\n"
|
| 81 |
+
for area, status in LOCK_STATUS_LINES:
|
| 82 |
+
rows += f"| {area} | {status} |\n"
|
| 83 |
+
return rows
|
| 84 |
|
| 85 |
def make_phase_table():
|
| 86 |
rows = "| Phase | Task | Status |\n|---|---|---|\n"
|
|
|
|
| 88 |
rows += f"| {phase} | {task} | {status} |\n"
|
| 89 |
return rows
|
| 90 |
|
|
|
|
| 91 |
def generate_review(raw_input, clarity_check, risk_check, improved_output, decision):
|
| 92 |
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 93 |
return f"""# {decision} Review
|
|
|
|
| 95 |
**Time:** {now}
|
| 96 |
|
| 97 |
## Raw Input
|
|
|
|
| 98 |
{raw_input or "No raw input provided."}
|
| 99 |
|
| 100 |
## Clarity Check
|
|
|
|
| 101 |
{clarity_check or "No clarity check provided."}
|
| 102 |
|
| 103 |
## Risk Check
|
|
|
|
| 104 |
{risk_check or "No risk check provided."}
|
| 105 |
|
| 106 |
## Improved Verified Output
|
|
|
|
| 107 |
{improved_output or "No improved output provided."}
|
| 108 |
|
| 109 |
## Sourceborn Lock
|
|
|
|
| 110 |
* Sourceborn Sequence = v0.1 Review Status
|
| 111 |
* Concepts = Keep
|
| 112 |
* Naming = Review
|
|
|
|
| 114 |
* Freeze = Not approved
|
| 115 |
"""
|
| 116 |
|
|
|
|
| 117 |
CSS = """
|
| 118 |
.gradio-container {
|
| 119 |
max-width: 1220px !important;
|
|
|
|
| 132 |
|
| 133 |
.sb-title {
|
| 134 |
font-size: 38px;
|
| 135 |
+
font-weight: 800;
|
| 136 |
letter-spacing: -0.04em;
|
| 137 |
margin-bottom: 8px;
|
| 138 |
}
|
|
|
|
| 152 |
border: 1px solid rgba(165,180,252,0.35);
|
| 153 |
color: #e0e7ff;
|
| 154 |
font-size: 14px;
|
| 155 |
+
font-weight: 600;
|
| 156 |
}
|
| 157 |
"""
|
| 158 |
|
|
|
|
| 159 |
with gr.Blocks(css=CSS, title=APP_TITLE) as demo:
|
| 160 |
gr.HTML(
|
| 161 |
"""
|
|
|
|
| 176 |
|
| 177 |
with gr.Tab("Lock Status"):
|
| 178 |
gr.Markdown(
|
| 179 |
+
f"""
|
| 180 |
# Current Lock
|
| 181 |
|
| 182 |
+
{make_lock_table()}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
## Active Structure Only
|
| 185 |
|
| 186 |
+
{format_items(ACTIVE_STRUCTURE)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
"""
|
| 188 |
)
|
| 189 |
|
|
|
|
| 274 |
|
| 275 |
with gr.Tab("Resume Later"):
|
| 276 |
gr.Markdown(
|
| 277 |
+
f"""
|
| 278 |
# Resume Point
|
| 279 |
|
| 280 |
Resume from:
|
|
|
|
| 283 |
|
| 284 |
Current accepted status:
|
| 285 |
|
| 286 |
+
{format_items([f"{area} = {status}" for area, status in LOCK_STATUS_LINES])}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
"""
|
| 288 |
)
|
| 289 |
|
| 290 |
if __name__ == "__main__":
|
| 291 |
+
demo.launch()
|
| 292 |
+
python
|