Daily PM Case Lab is a local-first learning system with a Streamlit web UI and CLI. It researches and publishes Persian product/business case studies designed to improve Product Sense, problem framing, strategy, metrics, trade-off analysis, and decision-making through real technology-company cases.
Daily PM Case Lab
Daily PM Case Lab is a local-first learning system with a Streamlit web UI and CLI. It researches and publishes Persian product/business case studies designed to improve Product Sense, problem framing, strategy, metrics, trade-off analysis, and decision-making through real technology-company cases.
The MVP uses deterministic Python orchestration around a small number of typed OpenAI Agents SDK calls. The scout and researcher use OpenAI's hosted WebSearchTool; synthesis and critical review operate only on the structured evidence packet. A case is published only when it clears every hard check and scores at least 75/100.
Each successful run writes:
cases/YYYY-MM-DD-company-case-slug/
00-overview.md # spoiler-free orientation
01-challenge.md # solve this before reading further
02-evidence-pack.md # facts, inferences, timeline, Who Said What
03-what-company-did.md # observed decision and outcome
04-pm-analysis.md # senior-PM critique and alternatives
05-model-answer.md # independent model PM answer
06-interview-drill.md # questions and evaluation rubric
sources.json # structured source provenance
manifest.json # publication metadata and quality score
The append-only data/history.jsonl is updated only after all files are atomically published.
Python 3.12+
uv
an OpenAI Platform API key with access to the configured model
GitHub CLI only when using Issue delivery
Current implementation choices follow the official OpenAI Agents SDK guide, web-search guide, and Structured Outputs guide. The default gpt-5.6-terra model is configurable; measure quality, latency, and cost against your own evals before changing it.
uv sync --all-groups --python 3.12
Copy-Item .env.example .env.local
Set OPENAI_API_KEY in .env.local. Never commit that file. The provided .gitignore excludes all .env* files except the intentionally blank .env.example.
Configuration:
Variable | Default | Purpose |
|---|---|---|
|
| Responses-based model used by Agents SDK |
|
| Maximum daily candidate count |
|
| Research retries per candidate |
|
| Maximum sources returned in a packet |
|
| Absolute SDK-call budget per command |
|
| Maximum reviewer-guided draft correction cycles |
|
| Maximum time for one Agents SDK model attempt |
|
| Maximum end-to-end UI generation time |
|
| structured-log level |
|
| retain an ignored local diagnostic for rejected drafts |
| unset |
|
The application does not contain token prices. Usage, tool calls, duration, and stage outcome are logged as sanitized JSON when exposed by the SDK.
Install the locked environment and configure the ignored .env.local file as described above, then start the local UI from the repository root:
uv run pm-case-ui
The equivalent direct command is:
uv run streamlit run src/daily_pm_case_lab/ui/app.py
Open http://localhost:8501 if the browser does not open automatically. The sidebar provides Dashboard, Generate Case, Case Library, Companies, Validation, History, and Settings / System Status.
On Generate Case, leave Automatic Selection enabled or choose a searchable catalog company, select the Tehran run date, and choose either normal generation or Dry Run. Dry Run calls the existing deterministic selection path without agent calls or filesystem writes. GitHub Issue delivery is enabled only when the existing repository, token, and GitHub CLI requirements are available.
The Case Library reads existing manifest.json files and opens each case with the Challenge first. Decision and answer sections require an explicit reveal, and Persian Markdown is presented RTL. Validation invokes the same validator as pm-case-lab validate.
Local UI generation writes cases/history exactly like the local CLI; it never commits or pushes Git changes. The independent GitHub Actions workflow remains manual-only and performs its existing generated-artifact commit, push, and Issue-delivery steps when launched from GitHub.
During a real run, the page reports backend-confirmed stages with timestamps: selection, research, evidence checks, scoring, synthesis, quality validation, publishing, history, and optional Issue delivery. Model attempts and the full UI run have configurable time limits, so a failure reaches a visible terminal state instead of leaving the page indefinitely busy. An invalid structured model response receives one fresh attempt when call budget remains; both attempts count against MAX_AGENT_RUNS. A rejected draft can receive up to MAX_REVISION_PASSES evidence-preserving revisions; every revision is independently reviewed and must pass the unchanged hard gate.
Validate the exact 100-company catalog:
uv run pm-case-lab catalog-check
Preview deterministic company selection without API calls or writes:
uv run pm-case-lab generate --dry-run
uv run pm-case-lab generate --dry-run --company Uber --date 2026-08-30
Generate today's case (date is evaluated in Asia/Tehran):
uv run pm-case-lab generate
Run a focused smoke case and optionally create an Issue:
uv run pm-case-lab generate --company Uber --date 2026-08-30
$env:PM_CASE_GITHUB_REPOSITORY = "OWNER/daily-pm-case-lab"
uv run pm-case-lab generate --company DoorDash --deliver-issue
Validate a published directory and inspect history:
uv run pm-case-lab validate cases/2026-08-30-uber-example-slug
uv run pm-case-lab history
Run code quality and tests:
uv run ruff check .
uv run pytest
uv run python evals/run_local.py --fixtures
Selection prefers the lowest-covered companies, categories with less history, and companies not seen recently. A stable date/company hash breaks ties, so a dry run is reproducible. --company is a research override, not a quality bypass.
Candidates are scored with the required weights: evidence 30%, learning value 25%, trade-off richness 20%, business relevance 15%, and source diversity 10%. Local code recomputes the evidence dimensions from the packet. A model reviewer may lower the score or add blockers but cannot override local hard checks.
Hard failures include fewer than five distinct sources, weak source diversity, unresolved citations, missing primary evidence without an explicit evidence gap, duplicate history, spoiler terms in the challenge, missing analytical sections, or API-key-like content. Exhausting candidates or the call budget exits non-zero without mutating history.
.github/workflows/daily-case.yml runs only when manually dispatched from GitHub → Actions → Daily PM Case Lab → Run workflow. Leave the optional company input empty for automatic catalog selection, or enter a catalog company ID, name, or alias to target a company. No automatic schedule is configured.
Repository settings required:
Actions secret OPENAI_API_KEY.
Workflow permissions for contents: write and issues: write (already requested in YAML; the organization/repository policy must allow them).
Default branch main.
The workflow serializes runs with a non-cancelling concurrency group, installs the locked environment, runs Ruff and pytest, generates a case, commits only cases/ and data/history.jsonl, pushes it, then creates a concise Issue. The application never stores GITHUB_TOKEN or the OpenAI key in artifacts.
Educational content defaults to professional Persian while retaining useful English terms such as Retention, Marketplace Liquidity, Unit Economics, North Star Metric, Guardrail Metric, CAC, LTV, MVP, Experiment, Funnel, and Conversion. Significant facts require nearby [Sxx] references. Unknowns stay unknown; inferences and counterfactuals are explicit.
Video and podcast records describe the actual access level. Metadata discovery is never represented as full-content review. Long quotations, brittle scraping, access-control bypasses, and paid search APIs are outside the MVP.
URL shape, source identity, and claim references are checked locally, but a future adapter should independently fetch and archive source excerpts for stronger entailment verification.
The spoiler gate combines distinctive decision terms with adversarial model review; nuanced semantic spoilers can still require human review.
Public evidence may not reveal internal experiments, rationale, or metrics. The correct behavior is to publish an evidence gap or reject the candidate.
GitHub Issues are notifications, not a transactional delivery queue. A post-publication delivery failure leaves the generated case intact and returns a failure for explicit retry.
GitHub Actions generation is manual-only; no case is generated until a user runs the workflow.
See the architecture contract for the full state machine and design rationale.
Evidence-driven extensions include independent URL/content verification, RSS and public-transcript adapters, human approval, semantic duplicate embeddings, platform trace graders, cost dashboards, and additional output languages. A database, queue, paid search, and scraping remain intentionally out of scope.