Spaces:
Running
Running
Added code snapshot download
Browse files
SDLC.py
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -206,6 +206,19 @@ def initialize_state():
|
|
206 |
st.session_state.final_deployment_path = None
|
207 |
st.session_state.final_deployment_pdf_path = None
|
208 |
# --- END ADDED ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
logger.info("Streamlit session state initialized/reset including PDF paths.")
|
211 |
|
@@ -495,32 +508,68 @@ with st.sidebar:
|
|
495 |
# Indicates UML stage hasn't run or failed before saving
|
496 |
st.caption("*UML diagrams have not been generated yet.*")
|
497 |
|
498 |
-
|
499 |
st.markdown("---")
|
500 |
st.subheader("Code Snapshots (ZIP)")
|
501 |
-
st.caption("Download code versions from
|
502 |
-
|
|
|
|
|
503 |
create_zip_and_download_button(
|
504 |
-
folder_path_key="
|
505 |
-
zip_path_key="
|
506 |
-
zip_basename="
|
507 |
-
button_label_prefix="
|
508 |
sidebar_context=st.sidebar
|
509 |
)
|
510 |
create_zip_and_download_button(
|
511 |
-
folder_path_key="
|
512 |
-
zip_path_key="
|
513 |
-
zip_basename="
|
514 |
-
button_label_prefix="
|
515 |
sidebar_context=st.sidebar
|
516 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
create_zip_and_download_button(
|
518 |
-
folder_path_key="
|
519 |
-
zip_path_key="
|
520 |
-
zip_basename="
|
521 |
-
button_label_prefix="Final Code",
|
522 |
sidebar_context=st.sidebar
|
523 |
)
|
|
|
524 |
|
525 |
st.divider()
|
526 |
|
@@ -853,6 +902,12 @@ with main_col:
|
|
853 |
"final_deployment_path": None, # MD path
|
854 |
"final_deployment_pdf_path": None, # PDF path
|
855 |
# --- END ADDED/MODIFIED ---
|
|
|
|
|
|
|
|
|
|
|
|
|
856 |
}
|
857 |
|
858 |
# Update the main session state variables
|
|
|
206 |
st.session_state.final_deployment_path = None
|
207 |
st.session_state.final_deployment_pdf_path = None
|
208 |
# --- END ADDED ---
|
209 |
+
# Snapshot paths
|
210 |
+
st.session_state.snapshot_path_codegen_initial = None
|
211 |
+
st.session_state.snapshot_path_codegen_refined = None
|
212 |
+
st.session_state.snapshot_path_review_refined = None
|
213 |
+
st.session_state.snapshot_path_testing_refined = None
|
214 |
+
st.session_state.snapshot_path_qa_polished = None
|
215 |
+
# Keep final folder paths (might point to last snapshot or dedicated folder)
|
216 |
+
st.session_state.review_code_snapshot_folder = None # Points to post_review snapshot
|
217 |
+
st.session_state.testing_passed_code_folder = None # Points to snapshot saved by save_testing_outputs
|
218 |
+
st.session_state.final_code_folder = None # Points to post_qa snapshot
|
219 |
+
# --- END ADDED/MODIFIED ---
|
220 |
+
|
221 |
+
logger.info("Streamlit session state initialized/reset including PDF and Snapshot paths.")
|
222 |
|
223 |
logger.info("Streamlit session state initialized/reset including PDF paths.")
|
224 |
|
|
|
508 |
# Indicates UML stage hasn't run or failed before saving
|
509 |
st.caption("*UML diagrams have not been generated yet.*")
|
510 |
|
511 |
+
# --- MODIFIED: Code Snapshot Downloads (ZIP) ---
|
512 |
st.markdown("---")
|
513 |
st.subheader("Code Snapshots (ZIP)")
|
514 |
+
st.caption("Download code versions from various stages.")
|
515 |
+
|
516 |
+
# Code Generation Cycle Snapshots
|
517 |
+
st.markdown("**Code Generation Cycle:**")
|
518 |
create_zip_and_download_button(
|
519 |
+
folder_path_key="snapshot_path_codegen_initial", # Use the new state key
|
520 |
+
zip_path_key="zip_path_cg_initial", # Unique key for session state zip path
|
521 |
+
zip_basename="snapshot_codegen_initial",
|
522 |
+
button_label_prefix="Initial Code",
|
523 |
sidebar_context=st.sidebar
|
524 |
)
|
525 |
create_zip_and_download_button(
|
526 |
+
folder_path_key="snapshot_path_codegen_refined", # Use the new state key
|
527 |
+
zip_path_key="zip_path_cg_refined", # Unique key
|
528 |
+
zip_basename="snapshot_codegen_refined",
|
529 |
+
button_label_prefix="Refined Code (Latest)", # Label indicates latest
|
530 |
sidebar_context=st.sidebar
|
531 |
)
|
532 |
+
st.markdown("---")
|
533 |
+
|
534 |
+
# Review & Security Cycle Snapshot
|
535 |
+
st.markdown("**Review & Security Cycle:**")
|
536 |
+
create_zip_and_download_button(
|
537 |
+
folder_path_key="snapshot_path_review_refined", # Use the new state key
|
538 |
+
zip_path_key="zip_path_review_refined", # Unique key
|
539 |
+
zip_basename="snapshot_review_refined",
|
540 |
+
button_label_prefix="Post-Review Code",
|
541 |
+
sidebar_context=st.sidebar
|
542 |
+
)
|
543 |
+
st.markdown("---")
|
544 |
+
|
545 |
+
# Testing Cycle Snapshots
|
546 |
+
st.markdown("**Testing Cycle:**")
|
547 |
+
create_zip_and_download_button(
|
548 |
+
folder_path_key="snapshot_path_testing_refined", # Use the new state key for failed refinement
|
549 |
+
zip_path_key="zip_path_testing_refined", # Unique key
|
550 |
+
zip_basename="snapshot_testing_refined",
|
551 |
+
button_label_prefix="Post-Failure Refined Code (Latest)",
|
552 |
+
sidebar_context=st.sidebar
|
553 |
+
)
|
554 |
+
create_zip_and_download_button(
|
555 |
+
folder_path_key="testing_passed_code_folder", # Keep the one saved on PASS
|
556 |
+
zip_path_key="zip_path_testing_passed", # Unique key
|
557 |
+
zip_basename="snapshot_testing_passed",
|
558 |
+
button_label_prefix="Passed Testing Code",
|
559 |
+
sidebar_context=st.sidebar
|
560 |
+
)
|
561 |
+
st.markdown("---")
|
562 |
+
|
563 |
+
# Quality Analysis Cycle Snapshot (Final Code)
|
564 |
+
st.markdown("**Quality Analysis Cycle:**")
|
565 |
create_zip_and_download_button(
|
566 |
+
folder_path_key="snapshot_path_qa_polished", # Use the new state key (points to final code)
|
567 |
+
zip_path_key="zip_path_qa_polished", # Unique key
|
568 |
+
zip_basename="snapshot_qa_polished_final",
|
569 |
+
button_label_prefix="Final Polished Code",
|
570 |
sidebar_context=st.sidebar
|
571 |
)
|
572 |
+
# --- END MODIFIED Code Snapshots ---
|
573 |
|
574 |
st.divider()
|
575 |
|
|
|
902 |
"final_deployment_path": None, # MD path
|
903 |
"final_deployment_pdf_path": None, # PDF path
|
904 |
# --- END ADDED/MODIFIED ---
|
905 |
+
# Intermediate Snapshot Paths
|
906 |
+
"snapshot_path_codegen_initial": None,
|
907 |
+
"snapshot_path_codegen_refined": None,
|
908 |
+
"snapshot_path_review_refined": None,
|
909 |
+
"snapshot_path_testing_refined": None,
|
910 |
+
"snapshot_path_qa_polished": None,
|
911 |
}
|
912 |
|
913 |
# Update the main session state variables
|