diff --git a/README.md b/README.md index 9a2a17c..e68c181 100644 --- a/README.md +++ b/README.md @@ -186,16 +186,23 @@ python scripts/build_rag_index.py --- -## Kaggle Notebook +## Notebook -Explore the dataset, RAG corpus, and a prototype Critic → Retriever → Fixer pipeline on Kaggle: +The project's experimentation and prototyping notebook is available both on Kaggle and as a local export: -https://www.kaggle.com/code/omchoksi04/codereview +| Resource | Link | +|----------|------| +| **Kaggle Notebook** | [https://www.kaggle.com/code/omchoksi04/codereview](https://www.kaggle.com/code/omchoksi04/codereview) | +| **Local Export** | [`notebooks/codereview.ipynb`](notebooks/codereview.ipynb) | +| **Notebook README** | [`notebooks/README.md`](notebooks/README.md) | The notebook demonstrates: -- Dataset exploration (28,548 records from CodeXGLUE + OWASP) -- RAG corpus embedding and similarity search -- Prototype review pipeline +- Dataset loading and exploration (28,548 records from CodeXGLUE + OWASP) +- RAG corpus inspection and semantic search +- Critic → Retriever → Fixer prototype pipeline +- Evaluation examples + +See [`notebooks/README.md`](notebooks/README.md) for full details. --- diff --git a/docs/demo.md b/docs/demo.md index e222dc1..304b43c 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -97,9 +97,11 @@ curl -X POST https://OMCHOKSI108-codereview-agent.hf.space/rag/search \ ## Kaggle Notebook -Explore the dataset and prototype pipeline on Kaggle: +Explore the dataset, RAG corpus, and prototype Critic → Retriever → Fixer pipeline: -https://www.kaggle.com/code/omchoksi04/codereview +- **Kaggle**: https://www.kaggle.com/code/omchoksi04/codereview +- **Local export**: [`notebooks/codereview.ipynb`](../notebooks/codereview.ipynb) +- **Notebook docs**: [`notebooks/README.md`](../notebooks/README.md) ## Screenshot Checklist diff --git a/docs/project_status.md b/docs/project_status.md index 2a731ad..5a5e41e 100644 --- a/docs/project_status.md +++ b/docs/project_status.md @@ -5,7 +5,7 @@ | Component | Status | Notes | |---|---|---| | Dataset (CodeSecAudit-RAG) | **Done** | 28,548 records, 2,833 RAG chunks, published to HF + Kaggle | -| Kaggle Notebook | **Done** | Dataset exploration + RAG prototype | +| Kaggle Notebook | **Done** | [Dataset exploration + RAG prototype](../notebooks/README.md) | | Review Engine (core) | **Done** | Critic, fixer, retriever, risk scorer, pipeline | | GitHub Action | **Done** | PR triggers, summary + inline comments, max caps | | Inline PR Comments | **Done** | 10-comment cap, duplicate detection via fingerprint | diff --git a/notebooks/README.md b/notebooks/README.md new file mode 100644 index 0000000..a5a2cff --- /dev/null +++ b/notebooks/README.md @@ -0,0 +1,36 @@ +# Notebooks + +## CodeSecAudit AI Dataset + RAG Exploration + +| Field | Value | +|-------|-------| +| **Title** | CodeSecAudit AI Dataset + RAG Exploration | +| **Author** | Om Choksi | +| **Platform** | Kaggle | +| **Kaggle Link** | [https://www.kaggle.com/code/omchoksi04/codereview](https://www.kaggle.com/code/omchoksi04/codereview) | +| **Local Export** | [`codereview.ipynb`](codereview.ipynb) | + +### What it demonstrates + +The notebook is the experimentation phase of the CodeSecAudit AI system. It proves the core dataset + RAG + reviewer logic end-to-end: + +1. **Dataset Loading** — Loads the `OMCHOKSI108/CodeSecAudit-RAG` dataset (28,548 records from CodeXGLUE + OWASP Benchmark Python) directly from Hugging Face. +2. **CodeSecAudit-RAG Exploration** — Explores dataset quality, source distributions (CodeXGLUE vs OWASP), language balance (C vs Python), label distributions (vulnerable vs clean), CWE coverage, severity breakdown, and OWASP categories using interactive Plotly visualizations. +3. **RAG Corpus Inspection** — Loads and inspects the 2,833 OWASP Cheat Sheet Series chunks that power the retrieval-augmented guidance. +4. **Semantic Search** — Builds a ChromaDB vector index using `all-MiniLM-L6-v2` embeddings (384-dim) and runs similarity search queries against the OWASP corpus. +5. **Critic → Retriever → Fixer Prototype** — Runs a lightweight end-to-end pipeline: the Critic scans code for CWE patterns, the Retriever fetches relevant OWASP guidance, and the Fixer generates suggested remediations. +6. **Evaluation Examples** — Tests the pipeline against known vulnerable and safe code samples with structured output. + +### Pipeline Path + +``` +Notebook prototype → CLI reviewer → FastAPI API → Streamlit UI → GitHub PR bot → Docker deployment +``` + +### File + +- `codereview.ipynb` — Exported Kaggle notebook (local copy for reference) + +### Note + +The live notebook is hosted on Kaggle. The local `.ipynb` export may lag behind the latest Kaggle version. Run or fork the notebook directly on Kaggle for the most up-to-date interactive experience.