Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 56 additions & 29 deletions docs/CURSOR_PROMPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,67 @@ the file-scoped gate. Opt-in servers live in `overlay/mcp.optional.json`.

## Prompt A — first contribution ON THE FORK (paste this)

Launch a **new** Cloud Agent on `alex-16moro/diffusers`, branch `main`. Leave
MCP **off**.
Launch a **new** Cloud Agent on `alex-16moro/diffusers`, branch **`main`**. Leave
MCP **off**. The draft PR **base must be `main`** so overlay CI
(`ramp-kit-overlay` / `overlay-gate`) actually runs. Do not stack onto a
`cursor/…` topic branch.

```
You are a new engineer contributing to this huggingface/diffusers fork. A customer overlay (ramp-kit/, cloned from alex-16moro/diffuser_agent) encodes conventions as code. Do NOT rely on training memory. Do NOT open a PR against huggingface/diffusers — PR this fork, draft, title "[fork demo — not for upstream]".

Repo facts:
- This workspace IS the library (src/diffusers, docs/source/en, .ai/, AGENTS.md). Do not overwrite .ai/ or root AGENTS.md. Do not delete .github/workflows from Hugging Face.
- Overlay: ramp-kit/conventions/rules.yaml is the customer gate. python3 ramp-kit/tools/convention_check.py is CI-equivalent for overlay rules.
- Ground in THIS checkout, in this order:
1. Read src/diffusers/schedulers/scheduling_euler_discrete.py and scheduling_ddpm.py (code beats the philosophy doc).
2. Treat ramp-kit/conventions/rules.yaml / the gate as authoritative if anything disagrees.
3. Optional, only if asked: python3 ramp-kit/tools/docs_mcp_server.py --query "scheduler set_timesteps step SchedulerMixin register_to_config"
Do not wait for an MCP tool. Cite source file paths.
- Do not read or copy ramp-kit/examples/candidate_scheduler/ into the new files.
`EulerLiteScheduler` is already on fork `main`. This prompt scaffolds **HeunLite**.

Do these steps in order and narrate them:
```
You just joined. This is your first contribution on this huggingface/diffusers FORK (alex-16moro/diffusers). Customer overlay: ramp-kit/ (from alex-16moro/diffuser_agent). Conventions are code, not memory.

1. Catch-early:
python3 ramp-kit/tools/convention_check.py ramp-kit/examples/candidate_scheduler
Handoff: opening a draft PR against main is the job. Do not write PM/QA/DevOps briefings. Do not run grokbot_sim.py. Do not @ anyone.

2. Scaffold EulerLiteScheduler:
- Copy ramp-kit/templates/scheduler/scheduling_TEMPLATE.py → src/diffusers/schedulers/scheduling_euler_lite.py
- Copy ramp-kit/tests/_templates/scheduler_test.py → tests/schedulers/test_scheduling_euler_lite.py (mention set_timesteps and step)
- Leave TODO(engineer) in step. Do not invent Euler math.
Hard nos:
- PR this fork only, never huggingface/diffusers.
- Draft PR, base = main (not a cursor/* topic branch). Title starts with [fork demo — not for upstream].
- Two files only: the new scheduler + its test. No __init__ export, no dummy object, no docs, no extra commits.
- Leave TODO(engineer) in step(). Do not invent sampler math.
- Never convention_check.py --all. File-scope only.
- Do not overwrite .ai/ or root AGENTS.md. Do not delete inherited .github/workflows.
- Do not copy ramp-kit/examples/candidate_scheduler/ into the new files.

3. Gate the NEW file only (never --all on this library):
python3 ramp-kit/tools/convention_check.py src/diffusers/schedulers/scheduling_euler_lite.py
If ramp-kit/ is missing:
git clone --depth 1 https://github.com/alex-16moro/diffuser_agent.git ramp-kit

4. python3 -m unittest tests.schedulers.test_scheduling_euler_lite -v
Behavioral skips without torch are expected.
Grounding, in this order, before writing files:
1. Read src/diffusers/schedulers/scheduling_euler_discrete.py and scheduling_ddpm.py.
Contract: set_timesteps + step, SchedulerMixin + ConfigMixin, @register_to_config. Not set_num_inference_steps.
2. Treat ramp-kit/conventions/rules.yaml / the gate as authoritative if anything disagrees.
3. Optional: python3 ramp-kit/tools/docs_mcp_server.py --query "scheduler set_timesteps step SchedulerMixin register_to_config"
Do not wait for an MCP tool.

5. Open a draft PR on this fork with those two files, titled "[fork demo — not for upstream]". Report rule ids, grounding (the two source files + gate), leftover math TODO, and that you did not copy the bad fixture.
Do these steps in order and narrate them:

Stop at a clean overlay gate. Do not implement the sampler.
1. Catch-early:
python3 ramp-kit/tools/convention_check.py ramp-kit/examples/candidate_scheduler
Summarise blocking rule ids. Do not copy that fixture.

2. Scaffold HeunLiteScheduler (EulerLite already exists — do not touch it):
Prefer /scaffold scheduler HeunLite if that command exists.
Else copy:
ramp-kit/templates/scheduler/scheduling_TEMPLATE.py
→ src/diffusers/schedulers/scheduling_heun_lite.py
ramp-kit/tests/_templates/scheduler_test.py
→ tests/schedulers/test_scheduling_heun_lite.py
Class HeunLiteScheduler. Test must mention set_timesteps and step, plus assertions / same-seed determinism / shape+dtype.
Leave TODO(engineer) in step(). Do not invent Heun math.

3. Gate the NEW file only:
python3 ramp-kit/tools/convention_check.py src/diffusers/schedulers/scheduling_heun_lite.py
Fix every BLOCKING finding until 0 findings.

4. python3 -m unittest tests.schedulers.test_scheduling_heun_lite -v
Signature/structural tests must pass. Behavioral skips without torch are expected.

5. Open a DRAFT PR on alex-16moro/diffusers, base main, only those two files.
Title: [fork demo — not for upstream] Scaffold HeunLiteScheduler contract
Expect check-run overlay-gate (ramp-kit-overlay). Inherited Hugging Face jobs may be red or idle — leave them.
Body: rule ids, the two source files you grounded in, leftover math TODO, file-scoped gate, did not copy the bad fixture.

Then stop. Report paths, 0-findings gate, tests (skips OK), and the draft PR URL.
Do not merge. Do not implement the sampler. Do not export the public API.
```

---
Expand Down Expand Up @@ -170,6 +196,7 @@ the tooling. Keep it minimal; do not implement a real model.
- **Multi-audience:** open `projections/pm|qa|devops/` and `.github/` — same
rules, different surface. Note the upstream-vs-customer split. One registry,
many projections — not a capability per SDLC step.
- **Fork PR hygiene:** draft, `[fork demo — not for upstream]`. Overlay green
does not mean Hugging Face CI is green; do not delete their workflows.
- **Fork PR hygiene:** draft, **base `main`**, `[fork demo — not for upstream]`.
Overlay-gate is the customer check-run. Overlay green does not mean Hugging
Face CI is green; do not delete their workflows. Two files only; math stays TODO.
- **Maintainability:** Prompt B — one edit propagates everywhere.
5 changes: 4 additions & 1 deletion docs/LIVE_DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ python3 ramp-kit/tools/docs_mcp_server.py --query "scheduler set_timesteps step"

If `/scaffold` does not appear: open `.cursor/commands/scaffold.md` and say “it’s a guided command, not a binary,” then Path B.

Open the PR **on this fork**, draft, title `[fork demo — not for upstream]`.
Open the PR **on this fork**, draft, **base `main`**, title
`[fork demo — not for upstream]`. Overlay CI (`overlay-gate`) only runs when
the base already has `ramp-kit-overlay.yml` — that is `main`, not a stacked
topic branch.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/TALK_TRACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ open on the fork until they have seen the registry and the gate.
`TODO(engineer)` in `step`. "Contract, not the algorithm."
3. **File-scoped gate only** — never `--all` on this library. 0 findings on the
new file; behavioral tests skip without torch.
4. **PR this fork**, draft, title `[fork demo — not for upstream]`. Overlay
4. **PR this fork**, draft, **base `main`**, title `[fork demo — not for upstream]`. Overlay
clearance ≠ Hugging Face CI. We do **not** delete inherited workflow files.

Do not run kit `KEEP=1` before the fork agent if you want those files to appear
Expand Down
16 changes: 11 additions & 5 deletions overlay/scaffold.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Cite provenance if you run that. Do not read or copy

## 1. Paths (library layout, not the kit stand-in)

- Implementation: `src/diffusers/schedulers/scheduling_euler_lite.py`
- Test: `tests/schedulers/test_scheduling_euler_lite.py`
Convert `$2` to snake_case (`HeunLite` → `heun_lite`). The class is `$2Scheduler`.

- Implementation: `src/diffusers/schedulers/scheduling_<snake>.py`
- Test: `tests/schedulers/test_scheduling_<snake>.py`

If `scheduling_euler_lite.py` already exists, do not overwrite it — use a new `$2`.

## 2. Copy from the overlay templates

Expand All @@ -48,9 +52,11 @@ assertions, same-seed determinism, and shape/dtype checks.

```bash
python3 ramp-kit/tools/convention_check.py ramp-kit/examples/candidate_scheduler
python3 ramp-kit/tools/convention_check.py src/diffusers/schedulers/scheduling_euler_lite.py
python3 -m unittest tests.schedulers.test_scheduling_euler_lite -v
python3 ramp-kit/tools/convention_check.py src/diffusers/schedulers/scheduling_<snake>.py
python3 -m unittest tests.schedulers.test_scheduling_<snake> -v
```

Catch-early uses the kit fixture path. Stop at 0 blocking. Do not fabricate numerics.
Do not open a PR against huggingface/diffusers — PR this fork.
Do not open a PR against huggingface/diffusers — PR this fork, **draft, base `main`**
(so `.github/workflows/ramp-kit-overlay.yml` runs). Two files only: scheduler + test.
No public-API export, no docs, no sampler math.
Loading