Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -297,65 +297,65 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="sky", slate_hue="slate"), title
|
|
| 297 |
|
| 298 |
gr.Markdown("---")
|
| 299 |
|
| 300 |
-
with gr.Row():
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
gr.Markdown("---")
|
| 335 |
-
audit_output_display = gr.Markdown()
|
| 336 |
-
|
| 337 |
-
# Event Handlers
|
| 338 |
-
def on_phase_change(phase_name):
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
phase_selector.change(
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
)
|
| 348 |
-
|
| 349 |
-
audit_btn.click(
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
)
|
| 354 |
-
|
| 355 |
-
demo.load(
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
)
|
| 360 |
if name == "main":
|
| 361 |
demo.launch()
|
|
|
|
| 297 |
|
| 298 |
gr.Markdown("---")
|
| 299 |
|
| 300 |
+
with gr.Row():
|
| 301 |
+
with gr.Column(scale=3):
|
| 302 |
+
phase_title = gr.Markdown()
|
| 303 |
+
framework_scope = gr.Markdown()
|
| 304 |
+
critical_warning = gr.Markdown()
|
| 305 |
+
|
| 306 |
+
gr.Markdown("### 🔍 Granular Verification Checklist")
|
| 307 |
+
task_checkboxes = gr.CheckboxGroup(
|
| 308 |
+
choices=get_all_tasks_for_phase(list(DETAILED_PHASES.keys())[0]),
|
| 309 |
+
label="Check off each verified artifact/control during audit:",
|
| 310 |
+
interactive=True
|
| 311 |
+
)
|
| 312 |
+
|
| 313 |
+
with gr.Column(scale=2):
|
| 314 |
+
gr.Markdown("### 📦 Required Gate Deliverables")
|
| 315 |
+
deliverables_box = gr.JSON(label="Mandatory Artifact Sign-offs")
|
| 316 |
+
|
| 317 |
+
gr.Markdown("---")
|
| 318 |
+
gr.Markdown("### ✍️ Consultant Gate Audit Sign-Off")
|
| 319 |
+
|
| 320 |
+
gate_decision = gr.Radio(
|
| 321 |
+
choices=["APPROVED (PASS GATE)", "CONDITIONAL APPROVAL (WAIVER REQUIRED)", "REJECTED (FAIL GATE)"],
|
| 322 |
+
value="CONDITIONAL APPROVAL (WAIVER REQUIRED)",
|
| 323 |
+
label="Phase Gate Decision"
|
| 324 |
+
)
|
| 325 |
+
|
| 326 |
+
consultant_notes = gr.Textbox(
|
| 327 |
+
lines=6,
|
| 328 |
+
placeholder="Enter non-conformances, identified architectural debt, missing ISO controls, or mandatory remediation steps...",
|
| 329 |
+
label="Auditor Findings & Non-Conformance Log"
|
| 330 |
+
)
|
| 331 |
+
|
| 332 |
+
audit_btn = gr.Button("Generate Formal Audit Record", variant="primary")
|
| 333 |
+
|
| 334 |
+
gr.Markdown("---")
|
| 335 |
+
audit_output_display = gr.Markdown()
|
| 336 |
+
|
| 337 |
+
# Event Handlers
|
| 338 |
+
def on_phase_change(phase_name):
|
| 339 |
+
title, scope, warning, deliverables = load_phase_data(phase_name)
|
| 340 |
+
new_tasks = get_all_tasks_for_phase(phase_name)
|
| 341 |
+
return title, scope, warning, gr.CheckboxGroup(choices=new_tasks, value=[]), deliverables
|
| 342 |
+
|
| 343 |
+
phase_selector.change(
|
| 344 |
+
on_phase_change,
|
| 345 |
+
inputs=[phase_selector],
|
| 346 |
+
outputs=[phase_title, framework_scope, critical_warning, task_checkboxes, deliverables_box]
|
| 347 |
+
)
|
| 348 |
+
|
| 349 |
+
audit_btn.click(
|
| 350 |
+
generate_audit_report,
|
| 351 |
+
inputs=[phase_selector, task_checkboxes, consultant_notes, gate_decision],
|
| 352 |
+
outputs=[audit_output_display]
|
| 353 |
+
)
|
| 354 |
+
|
| 355 |
+
demo.load(
|
| 356 |
+
on_phase_change,
|
| 357 |
+
inputs=[phase_selector],
|
| 358 |
+
outputs=[phase_title, framework_scope, critical_warning, task_checkboxes, deliverables_box]
|
| 359 |
+
)
|
| 360 |
if name == "main":
|
| 361 |
demo.launch()
|