feat: add beginner A-to-Z runbook and improve UI / API resilience#9
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 323ac35638
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if reader.fieldnames is None: | ||
| raise AnalysisError("CSV header not found") | ||
|
|
||
| columns = [str(c).strip() for c in reader.fieldnames if str(c).strip()] |
There was a problem hiding this comment.
Normalize row keys after trimming CSV header names
Trimming reader.fieldnames here changes column names but the row dictionaries returned by csv.DictReader still keep the original untrimmed keys, so lookups in summarize_rows can silently miss entire columns. For CSVs with spaced headers like id, amount, the amount column is treated as fully missing (row.get("amount") never matches " amount"), which corrupts summary stats and the generated prompt/output.
Useful? React with 👍 / 👎.
Motivation
Description
BEGINNER_README.mdcontaining a step-by-step A-to-Z runbook (venv, install, Ollama, CLI, UI, troubleshooting).bitnet_tools/analysis.pywith CSV parsing,summarize_rows, prompt builder andAnalysisError.bitnet_tools/cli.pywithanalyzeanduisubcommands, friendlySystemExiton analysis errors, and optional model run viarun_ollama.bitnet_tools/web.pywithparse_timeout, endpoints/api/analyzeand/api/run, CSV size checks, and safe JSON error responses; add static UI assets underbitnet_tools/ui/(index.html,app.js,styles.css).tests/test_analysis.pyto includeparse_timeoutbounds/type checks and keep existing analysis/CLI regressions.Testing
python -m pytest -qwhich returned7 passed.parse_timeoutbehavior (type and bounds) and existing analysis/CLI regressions.Codex Task