Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down
6 changes: 4 additions & 2 deletions docs/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/project_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
36 changes: 36 additions & 0 deletions notebooks/README.md
Original file line number Diff line number Diff line change
@@ -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.
Loading