Skip to content

feat(cli): implement iterate test + experiments with local persistence #442

@emil07770

Description

@emil07770

Problem

sh1pt iterate test <hypothesis> and sh1pt iterate experiments are stubs that print placeholder output but don't persist any state.

Solution

Implement local-file persistence (same atomic-write pattern as iterate goals):

  • iterate test <hypothesis> creates an Experiment entry in ~/.config/sh1pt/iterate-experiments.json
  • iterate experiments lists active/paused/ended experiments with formatted output or --json
  • iterate experiments --end <id> / --pause <id> / --resume <id> mutate status
  • --winner A|B|inconclusive and --note flags record outcome when ending

State schema:

interface Experiment {
  id: string;           // random 8-char hex
  hypothesis: string;
  variants: string[];
  traffic: number;
  minSample: number;
  createdAt: string;
  updatedAt: string;
  status: 'active' | 'ended' | 'paused';
  significance?: number;
  sampleCount?: number;
  winner?: 'A' | 'B' | 'inconclusive';
  note?: string;
}

Fixes #133

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions