Skip to content

margin 0.1.3

Choose a tag to compare

@Waddah0-0 Waddah0-0 released this 23 Nov 01:39
· 29 commits to main since this release

File uploads and downloads in the web UI, plus a round of security fixes across the core, CLI, API and Data Storyteller.

pip install -U margin-core margin-cli margin-api margin-data-storyteller

File uploads and run downloads. In the web UI, you can now drop or choose a data file instead of typing a local path (POST /uploads), and download a run's output files (such as Data Storyteller's cleaned table and report) next to the JSON and Markdown exports (GET /runs/{run_id}/files/{name}). Uploads have a 200 MB limit (MARGIN_API_MAX_UPLOAD_BYTES) and expire with the run; MARGIN_API_FILES_DIR sets where files are kept.

Security fixes:

  • Breaking change for .env users: margin no longer reads a .env file in the current folder automatically, because an untrusted repository could use one to change settings or open the server to the network. Only a file named by MARGIN_ENV_FILE is read now. If you keep settings in .env, set MARGIN_ENV_FILE=.env.
  • Git history reading is further locked down: commit signatures aren't checked (log.showSignature=false) and reading history never fetches over the network.
  • Reports, CLI warnings, errors and progress messages no longer carry control characters or Rich markup that could rewrite what a terminal shows.
  • In margin-api, requests that change state are refused with 403 when they come from another web page (requires FastAPI 0.132+), MARGIN_API_CORS_ORIGINS is empty by default (add http://localhost:3000 for the UI dev server), and output folders can no longer be chosen over HTTP (422).
  • In margin-data-storyteller, CSV cells that a spreadsheet would run as formulas get a leading ' (plain negatives and phone numbers are left alone), Excel and Parquet files unpacking past 2 GB are refused, SQLite schemas can't call functions with side effects (and #/? in paths are read literally), verification SQL can't touch files or the network, and column/table names are fenced as data in model prompts.

Also fixed: Data Storyteller's description of stop_after no longer says the story isn't built yet.

Versions: margin-core 0.1.3, margin-cli 0.1.2, margin-api 0.1.2 and margin-data-storyteller 0.1.1. margin-ai-code-detector is unchanged at 0.2.1.