Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

mo-trace

Latest version: v0.3.1

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
PyPI package Publisher: josh_zastrow
4 Versions
134 Downloads

Scan summary

mo-trace was last scanned on 24 Nov 2026 at version 0.3.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions; the latest 2 were published on 24 Nov 2026.
  • Findings: No rules fired in version 0.3.1.
  • Downloads: 134 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.1 LATEST 24 Nov 2026 No rules fired
0.3.0 24 Nov 2026 No rules fired
0.2.0 17 Nov 2026 No rules fired
0.1.0 17 Nov 2026 Not shown

No rules fired in 0.3.1

Findings

Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

motrace

A minimal nbdev for marimo notebooks. Write the code, its docs and its tests in a marimo notebook. motrace turns the exported cells into a normal Python package and keeps the two in sync.

motrace nbdev equivalent does
motrace-export nbdev-export notebook cells → modules in lib_path
motrace-export --update nbdev-update edits made in modules → back into the notebook cells
motrace-prepare nbdev-prepare export, run every notebook's tests in parallel, then clean
motrace-clean nbdev-clean normalize notebooks so diffs and merges stay clean

Run motrace --help for a guide to using it in a notebook and the CLI, and to organizing notebooks.

Install

pip install mo-trace       # or: uv add --dev mo-trace   (imported as `motrace`)

Add a [tool.motrace] table to your project's pyproject.toml:

[tool.motrace]
lib_path = "mypkg"   # default: [project].name, with - replaced by _
nbs_path = "jobs"    # default: jobs

Writing notebooks

Directives are #| comments on the first lines of a cell. They work the same as in nbdev.

with app.setup:
    #| default_exp core          # where `#| export` cells go -> mypkg/core.py
    import numpy as np

@app.cell
def _():
    #| export                    # -> mypkg/core.py, listed in __all__
    def norm(x): return x / np.linalg.norm(x)
    return (norm,)

@app.cell
def _(norm):
    #| export metrics.distance   # choose the file for this cell -> mypkg/metrics/distance.py
    def cosine(a, b): return norm(a) @ norm(b)
    return (cosine,)

@app.cell
def _(cosine):
    assert cosine(np.ones(3), np.ones(3)) == 1   # an ordinary cell is a test
    return

@app.cell
def _():
    #| eval: false                 # skipped by motrace-prepare
    slow_benchmark()
    return

Supported directives: default_exp, export [module], exporti [module] (exported but left out of __all__), exports, and eval: false. motrace also follows nbdev for these details:

  • __all__ is built from the public names in exported cells, plus any names listed in _all_.
  • from mypkg.x import y becomes a relative import in the generated module, and becomes absolute again when synced back.
  • The module docstring comes from the > summary line under the notebook's # Title markdown cell.
  • Notebooks whose names start with _ or . are skipped.

Differences from nbdev (by design or necessity)

  • Imports across modules are generated for you. Marimo forbids defining a name in more than one cell, so a cell exported to metrics/distance.py cannot re-import norm the way an nbdev notebook would. motrace reads marimo's dataflow graph instead. Each module gets an # %% auto #1 block that imports what its cells use but don't define: import statements from other cells, such as the setup cell, are copied, and names exported to other modules are imported from those modules.
  • #| export other_module can create a new file. nbdev requires the target module to already exist.
  • Cells are identified by position. Marimo files have no stable cell ids, so the # %% ../jobs/nb.py #3 markers use the cell's position. --update refuses to write if that cell is no longer an exported cell of the same module. Run motrace-export again after reordering cells.
  • Tests run the notebook as a script, python nb.py, one process per notebook, in the notebook's directory, with IN_TEST=1 set. Cells execute in marimo's dependency order.
  • Clean has less to remove. Marimo files contain no outputs or execution counts. motrace-clean rewrites each notebook in marimo's own canonical format and strips trailing whitespace. It keeps __generated_with unchanged, so upgrading marimo doesn't change every notebook. motrace-clean --stdin works as a git filter.
  • Not included: docs, README generation, _modidx.py, llms.txt and Quarto. motrace-prepare is export + test + clean.
  • Private marimo APIs. motrace uses marimo's internal parser and code generator, so it pins marimo>=0.25,<0.26.

Example: a tiny language model from one notebook

examples/tinylm is a character-level bigram language model, the classic first language model. It trains on a list of names, reports perplexity and samples new names. All of it is in jobs/tinylm.py. Each cell picks its target file, giving tinylm/{data,tokenizer,model,train}.py. The tests sit next to the code they check.

cd examples/tinylm
motrace-prepare            # export, test, clean  -> Success.
pip install .              # or: pip install -e .
tinylm-train               # {'train_ppl': 11.14, 'val_ppl': 11.58} + sampled names
marimo edit jobs/tinylm.py  # keep developing in the notebook

Training data: notebook ↔ agent trajectory (motrace-convert)

motrace-convert                                  # every notebook in nbs_path -> traces/<notebook>.jsonl
motrace-convert jobs/00_core.py -o all.jsonl     # one notebook (or a directory) into one JSONL file
motrace-convert jobs/ --run                       # execute notebooks first, so every tool result is fresh
motrace-convert traces/00_core.jsonl -o nbs/     # back: trajectory -> nbs/00_core.py
motrace-convert t.json --to-notebook -o x.py     # force the reverse direction for any file name

motrace-convert turns each notebook into a trajectory of an agent writing it one cell at a time:

  • a narration cell (a hidden cell holding only mo.md(r"""...""")) becomes the text of one assistant message;
  • every other cell becomes a run_cell tool call (code, plus name for the setup cell or a reusable function, and hide_code) on the message that carries the narration before it;
  • the cell's output, recorded in the notebook's marimo session (__marimo__/session/<name>.json), becomes the tool result. Outputs are matched by code hash, so a stale output is never attached to edited code; those cells get (output not recorded), and metadata.outputs_recorded counts the rest. Pass --run to execute each notebook first (marimo export session, from the notebook's folder like motrace-prepare), so every cell has a fresh output; notebooks whose session is already up to date are skipped (--rerun runs them anyway), and nothing is written if any cell fails. Errors and HTML outputs are reduced to plain text.

Each row is {"messages", "tools", "metadata"}: OpenAI-style chat messages and tool calls (tinker-cookbook's ToolCall shape), tool specs as {name, description, parameters}, and metadata with the notebook path, app config and file header (PEP 723 block, docstring). Converting a row back gives the notebook exactly as motrace-clean writes it. Only hide_code survives as a cell option, so cells that set disabled, column etc. are rejected. --instruction FILE sets the user turn (default: built from the first heading), --session picks another session file, and --max-output-chars truncates tool results. In Python: motrace.trajectory.to_trajectory(nb), to_notebook(row), and training_messages(row, renderer) for a tinker-cookbook renderer.

To keep trajectories next to the code, set traces_path = "traces" in [tool.motrace]: motrace-prepare then converts every notebook before exporting.

Pi rollout → Tinker (motrace-convert --pi)
pip install "mo-trace[tinker]"
motrace-convert examples/tinylm/jobs/tinylm.py --pi -o traces
python examples/tinker_train.py traces          # SFT, then on-policy distillation, on Tinker

motrace-convert --pi replays a notebook as a session of the Pi coding agent building it. The replay uses Pi 1.5.2's system prompt, its read/bash/edit/write tool schemas and its result strings. The agent explores the project, writes the first cells, then edits in each exported cell with its tests, in marimo dependency order. It runs motrace-prepare after every step and finally checks that the package imports. Every tool call runs for real in a scratch copy of the project, so tool results are real output. A notebook whose tests fail is rejected. The output files are:

file contents
pi_session.jsonl the rollout as a Pi v3 session file, with a custom entry recording its notebook source
messages.json the same conversation in OpenAI / tinker-cookbook format, plus Pi's system prompt and tool specs
sft.jsonl a Tinker Datum (model_input, target_tokens, 0/1 weights) of the whole trajectory, rendered with Inkling 2 Small's renderer. Only assistant tokens carry loss: reasoning, text, tool calls and end-of-turn
opd_prompts.jsonl one starting state per assistant turn for on-policy distillation. Each has prompt_tokens (a token prefix of the trajectory), teacher_prompt_tokens, the reference turn, and the workspace files at that point

Load the data with motrace.convert.load_sft(). motrace.convert.opd_datum() builds the importance_sampling datum, with advantage = teacher logprob − student logprob for each sampled token.

Notes:

  • Teacher. Inkling 2 Small's tokenizer isn't shared with any other Tinker model, Inkling v1 included. A token-level teacher therefore has to be Inkling 2 Small as well. teacher_prompt_tokens gives it privileged context: the same state, with the finished notebook in the task message. You can also use a stronger fine-tuned checkpoint.
  • Reasoning. The markdown cells before each step become that turn's thinking block (Pi's and the cookbook's format), which carries loss like the rest of the turn. A notebook with little prose gives little reasoning, so the default thinking effort stays at 0 (--effort).
  • Ideal path only. Traces don't yet include mistakes and recoveries. Distillation samples one turn per state; a multi-turn version would run the student's tool calls in the record's workspace snapshot.

Development

uv sync && uv run pytest   # includes parity tests that run real nbdev on equivalent .ipynb notebooks

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases mo-trace

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229