Skip to content

Petri 0.1.5

Latest

Choose a tag to compare

@Ivan825 Ivan825 released this 28 Nov 18:02
· 11 commits to main since this release

Extension 0.1.5 and petri-check 0.1.4 (CLI, MCP, Action).

Added

  • Staged rollout: a ramp change in petri.plan.json serves the decided
    winner to a share of users (10 → 50 → 100), refused while an experiment still
    runs on the flag (measured: 10% → 12%, 50% → 44% of 200 sampled users).
  • Experiments as pull requests: petri.plan.json with petri-check apply [--dry-run] (idempotent; production needs "production": true), the Action's
    command: apply / dry_run, and the MCP tool petri_plan_change (proposes
    an entry plus a dry run, changes nothing).
  • petri-check rehearse: real visitors through the running app (cookie
    identities; --convert form follows the page's form like a browser), then a
    recount of Flagsmith's enrolments and conversions. Refuses production; exits 1
    on a mismatch with likely causes. Proven on a throwaway Flagsmith: 30/30, 15/15
    on a correct shop, and 15 → 7 on one with an untracked checkout route.
  • Audience checks at launch: the start approval warns about other running
    experiments read in the same code, and segment overrides on the flag.
  • PETRI017–020: a per-user variant in a cached/static response; a browser
    event lost to navigation (no flush()); Python max_buffer_items=1; an
    experiment flag read from an SDK that sends no experiment events. All offline.
  • After completion: Watch alerts if users are still enrolled in a losing
    arm after an experiment was completed.
  • PETRI016: the installed Flagsmith SDK predates the experiment API
    (@flagsmith/nodejs < 9.1.0, @flagsmith/flagsmith < 12.1.0, or a legacy
    package), so nothing is recorded. Offline; points at package.json.
  • End-to-end CI on self-hosted Flagsmith: every push boots Flagsmith with
    experimentation, runs the bootstrap, creates the experiment, and runs
    petri-check live (clean, then a planted bug caught), plus lock, report and
    watch.
  • MCP prompt wire_experiment: Petri's wiring checklist (one item per
    rule) for any agent setting up an experiment, ending with a required clean
    petri_check.
  • Peek-safe sequential test: a mixture SPRT on the hourly timelines gives
    each variant an always-valid p-value (0.3% false ships under hourly peeking
    in the A/A simulation). Shown in experiments and report.
  • Health scorecard: traffic split (α = 0.001), arms vs variants, missing
    conversions per arm, event storage, measurement continuity, treatment lock,
    result freshness and novelty (early vs late lift). In the tree, results
    panel, experiments, report and MCP.
  • Watch → Pause: a Petri Watch alert in the editor offers to pause the
    experiment (approval-gated), so broken data stops accumulating.
  • "How much longer?": a keep-running verdict says how many more users per
    arm would decide it at the current lift.
  • False-ship eval (eval/aa.mjs): 2,000 simulated A/A experiments. Peeking
    ships a do-nothing variant 36.5% of the time, Petri's single look 8.0% (4.1%
    with the Bonferroni bar), and a real +39% winner is found 99.7% of the time.
  • petri-check report: a Markdown decision record (pre-registration,
    per-arm results with intervals and expected loss, sample ratio, treatment
    lock, Watch, planned stop, verdict, decision), also written to the GitHub job
    summary.
  • Safer self-host defaults: Flagsmith binds to 127.0.0.1, and secrets come
    from the environment (random in Codespaces).
  • Sample size and ETA: petri-check lock --mde 20% sizes the planned
    stop from the control rate (two-proportion power, 80%, Bonferroni across
    variants). The CodeLens and experiments line show progress and an ETA from
    the current enrolment rate.
  • Offline event checks from the lock: with a committed petri.lock.json,
    CI catches a renamed metric event (PETRI002) or a metric nothing sends any
    more (PETRI003) without a Flagsmith key.
  • PETRI014: a conversion tracked under a different identity than the
    exposure (user.email vs user.id), so it is never attributed.
  • PETRI015: a new random identity on every call (randomUUID()…), so
    every visit is a new user. Both run offline.
  • Production guard: every Flagsmith write to an environment named like
    production is titled [PRODUCTION] and warns that real users are affected.
  • Early decisions are labelled: completing before the pre-registered stop
    shows a warning and a Complete early button, and the decision memory
    records that it was decided early.
  • Verified edits: after an approved copilot edit (such as removing the
    losing code), Petri runs the project's tests (petri.verifyCommand or
    npm test) and restores the file if they fail.
  • Petri Watch: reads running experiments' hourly per-arm timelines and
    alerts when an arm stops converting or enrolling, enrolment stops, or the
    split breaks (Poisson and chi-square tests, complete hours only), blaming
    the last commit that touched the experiment's code. In the editor
    (notification and tree), petri-check watch (exit 1, --refresh), the
    Action (command: watch, on a schedule) and MCP.
  • Pre-registered stop: petri-check lock --stop-at/--stop-n or Petri:
    Pre-register When to Decide
    records when to decide. The CodeLens shows
    progress, and a SHIP before the stop is marked provisional in the copilot's
    report and petri-check experiments. Display only.
  • Decision memory: completing an experiment records the decision and its
    evidence (winner, value, lift, interval, chance to win, expected loss, n) in
    petri.lock.json, and a lens shows it above every line holding the shipped
    value.