You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are creating an implementation plan for the following idea.
code
Idea:
Scaffold a new monorepo at /Users/user_c042661f/Documents/reigh-workspace/prompt-adapters/ that will house a research program building "prompt adapters" (reference-conditioning adapters that inject encoded-reference latents into frozen base models) across multiple modalities — text, audio, music, video.
Repository structure:
core/ — placeholder dirs for shared framework: encoder/, projector/, injection/, training/, eval/, data/. Each with stub init.py and a README.md.
modality/ — placeholder subdirs for text/, audio/, music/, video/ each with a stub README.
experiments/ — scaffold ONE experiment at experiments/2026-04-text-001-gemma3-adapter/ referencing ../text-ip-adapter/ (do NOT symlink; add MIGRATION.md).
site/ — MkDocs Material source with mkdocs.yml (Home / Experiments / Architecture / Learnings / Replicate), empty docs/, .github/workflows/pages.yml for GH Pages deploy.
The one populated experiment (experiments/2026-04-text-001-gemma3-adapter/):
Fill experiment.yaml with real metadata for current text-ip-adapter run.
Fill README.md with real write-up, five eval tests, current status (in progress, preliminary results).
LEARNINGS.md notes: (a) reference discrimination kicks in around step 600-1100, (b) prompted-baseline beaten 67% at step 1500, (c) T3 style-carryover WEAK, (d) data scale (971 pairs) is main suspect.
run.sh: "see ../text-ip-adapter/scripts/train.py — will be migrated in later."
MIGRATION.md explaining actual code lives at ../../text-ip-adapter/ today.
Assistant
The target directory is empty except for a .git dir — clean slate for scaffolding. The sibling ../text-ip-adapter/ isn't readable from this sandbox, but the brief explicitly says "do not migrate, just reference," so I don't need to inspect it.
Assistant
Plan drafted. Key calls:
Scaffold only — no framework code, no text-ip-adapter migration, stubs for build-site.sh / replicate.sh.
Experiment 001 authored by hand (not via new-experiment.sh) since it needs real metadata from the brief; the script is canonicalized for future experiments.
GH Pages workflow uses modern actions/deploy-pages@v4 artifact flow (user must separately flip Pages→Actions source; noted in README).
One final commit on existing main, no push.
Main open questions flagged (LICENSE copyright name, Python version, intentional test4_* key duplication, etc.) — safe defaults assumed so work can proceed without blocking.
User
Assistant
The flag is correct: ../text-ip-adapter/ resolves correctly only from the repo root, and ../../text-ip-adapter/ is wrong from anywhere — the experiment dir needs ../../../text-ip-adapter/ (three levels up to escape prompt-adapters/experiments/<exp>/ back to the workspace root). This is a wrong-content flag, not a wrong-approach flag — the scaffolding strategy is fine; only the path strings need fixing. I'll also add a validation step that actually resolves each path from its own file's directory.
Assistant
Plan revised. One flag addressed:
FLAG-001 (path resolution): every sibling-repo path inside experiments/2026-04-text-001-gemma3-adapter/ is now ../../../text-ip-adapter/ (correct from three levels deep); top-level README.md keeps ../text-ip-adapter/ (correct from repo root). Added Step 8 sub-step that actually test -ds the paths and greps to prove the wrong strings don't appear in the experiment dir. New success criterion locks this in.
Todo tracking isn't relevant here — this is a single-turn plan revision, not multi-step execution.
Experiment 001 metadata:
id: 2026-04-text-001-gemma3-adapter
modality: text
status: running
consequential: true
question: Can a reference-conditioned prefix K/V adapter on a frozen Gemma-3-4B beat prompting for style transfer?
hypothesis: At 2000 steps on 971 author-paired pairs across 4 registers, the adapter will beat prompted_baseline on LLM-judge win rate.
parent: null
base_model: google/gemma-3-4b-pt, arch gemma3, 34 layers, hidden 2560, GQA 8/4 heads, head_dim 256
dataset: local at ../text-ip-adapter/data/pairs/, 971 train pairs across poetry/essay/speech/screenplay from Gutenberg + Miller Center + IMSDb
core_commit: TBD
compute: RTX 4090, ~1.5 hours projected, ~0.83(at0.69/hr)
results:
test1_discrimination: PASS (step 1500, jaccard 0.002)
test2_vs_prompting: PASS (step 1500, 67% win rate)
test3_style_carryover: WEAK
test4_memorization: PASS
test4_ref_leak: PASS
test5_loss_curve: SLOW-still-improving
headline: Adapter works mechanically and beats prompting 2/3 on Claude judge; style-carryover is weak — next: more data or contrastive loss.
next: TBD (likely 2026-05-text-002-contrastive-loss or 2026-05-text-002-data-scale)
Site: Material default theme, light-mode default, dark toggle, minimal customization. Home page = mission + experiment grid filtered by consequential=true with toggle for minor. Per-experiment page = rendered README + eval_report.json verdicts table. Architecture page = stub. Learnings page = aggregated. Replicate page = explains ./tools/replicate.sh.
NOT to do:
Do NOT migrate text-ip-adapter code. Just reference it.
Do NOT implement core/ framework code — just empty shape.
Do NOT write build-site.sh parsing logic — stub that prints "TODO: implement" is fine.
Do NOT set up HF org or external storage.
Do NOT publish anywhere. Local repo + GH Actions config only.
No tests beyond a smoke import or two.
Keep total code output small — scaffolding only.
Final step: make initial git commit with message "Scaffold prompt-adapters monorepo with MkDocs Material site and experiment 001 placeholder". Do not push.
code
Project directory:
/Users/user_c042661f/Documents/reigh-workspace/prompt-adapters
No prior clarification artifact exists. Identify ambiguities, ask clarifying questions, and state your assumptions inside the plan output.
Requirements:
- If the engineering brief suggests an approach, use it as your starting hypothesis — but before committing, consider if there's a simpler or more fundamental fix. The brief is well-researched input, not a final answer.
- If the brief is absent, incomplete, or says "skip", inspect the repository yourself before planning.
- Stay focused on the requested idea. If repo exploration surfaces unrelated issues or docs, ignore them and return to the task.
- Prefer source code, tests, and directly relevant config files. Avoid `.megaplan/`, prior plan artifacts, and unrelated `docs/` or ops/deployment material unless the task explicitly depends on them.
- Stop exploring once you have enough evidence to name the concrete touch points and validation path. Do not keep browsing after you can write the plan.
- Produce a concrete implementation plan in markdown.
- Define observable success criteria as objects with `criterion` (string) and `priority` (`must`, `should`, or `info`):
- `must` — hard gate. The reviewer will block on failure. Use for correctness, functional requirements, and verifiable outcomes (e.g., "all existing tests pass", "API returns 200 for valid input"). Every `must` criterion must have a clear yes/no answer.
- `should` — quality target. The reviewer flags but does not block. Use for subjective goals, numeric guidelines, and best-effort improvements (e.g., "file under ~300 lines", "no deeply nested conditionals", "each function has a single responsibility").
- `info` — documented for humans, reviewer skips. Use for criteria that cannot be verified in this pipeline (e.g., "13 manual smoke tests pass", "stakeholder sign-off obtained").
- Each success criterion should include a `requires` field listing the capabilities needed for verification. Valid capability strings: `run_shell`, `read_files`, `run_tests`, `parse_diff`, `read_build_output`, `run_linter` (container), `drive_browser`, `inspect_runtime_ui`, `observe_runtime_logs`, `subjective_judgment`, `verify_physical_device` (human). `must` criteria MUST have non-empty `requires`. Example: `{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}`.
- Use the `questions` field for ambiguities that would materially change implementation.
- Use the `assumptions` field for defaults you are making so planning can proceed now.
- Prefer cheap validation steps early.
- Keep the plan proportional to the task. A 1-line fix needs a 2-step plan (apply fix + run tests), not a 5-step investigation.
- If user notes answer earlier questions, incorporate them into the draft plan instead of re-asking them.
- Fix the problem fully. Do not limit scope just to avoid breaking existing tests — update the tests too if needed.
- Prefer the simplest, most direct fix. No fallbacks, type conversions, or defensive wrappers without concrete evidence they are needed.
- If the task or issue hints suggest a specific approach, follow it. Only deviate with concrete counter-evidence.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are revising an implementation plan after critique and gate feedback.
Scaffold a new monorepo at /Users/user_c042661f/Documents/reigh-workspace/prompt-adapters/ that will house a research program building "prompt adapters" (reference-conditioning adapters that inject encoded-reference latents into frozen base models) across multiple modalities — text, audio, music, video.
Repository structure:
core/ — placeholder dirs for shared framework: encoder/, projector/, injection/, training/, eval/, data/. Each with stub init.py and a README.md.
modality/ — placeholder subdirs for text/, audio/, music/, video/ each with a stub README.
experiments/ — scaffold ONE experiment at experiments/2026-04-text-001-gemma3-adapter/ referencing ../text-ip-adapter/ (do NOT symlink; add MIGRATION.md).
site/ — MkDocs Material source with mkdocs.yml (Home / Experiments / Architecture / Learnings / Replicate), empty docs/, .github/workflows/pages.yml for GH Pages deploy.
The one populated experiment (experiments/2026-04-text-001-gemma3-adapter/):
Fill experiment.yaml with real metadata for current text-ip-adapter run.
Fill README.md with real write-up, five eval tests, current status (in progress, preliminary results).
LEARNINGS.md notes: (a) reference discrimination kicks in around step 600-1100, (b) prompted-baseline beaten 67% at step 1500, (c) T3 style-carryover WEAK, (d) data scale (971 pairs) is main suspect.
run.sh: "see ../text-ip-adapter/scripts/train.py — will be migrated in later."
MIGRATION.md explaining actual code lives at ../../text-ip-adapter/ today.
Experiment 001 metadata:
id: 2026-04-text-001-gemma3-adapter
modality: text
status: running
consequential: true
question: Can a reference-conditioned prefix K/V adapter on a frozen Gemma-3-4B beat prompting for style transfer?
hypothesis: At 2000 steps on 971 author-paired pairs across 4 registers, the adapter will beat prompted_baseline on LLM-judge win rate.
parent: null
base_model: google/gemma-3-4b-pt, arch gemma3, 34 layers, hidden 2560, GQA 8/4 heads, head_dim 256
dataset: local at ../text-ip-adapter/data/pairs/, 971 train pairs across poetry/essay/speech/screenplay from Gutenberg + Miller Center + IMSDb
core_commit: TBD
compute: RTX 4090, ~1.5 hours projected, ~0.83(at0.69/hr)
results:
test1_discrimination: PASS (step 1500, jaccard 0.002)
test2_vs_prompting: PASS (step 1500, 67% win rate)
test3_style_carryover: WEAK
test4_memorization: PASS
test4_ref_leak: PASS
test5_loss_curve: SLOW-still-improving
headline: Adapter works mechanically and beats prompting 2/3 on Claude judge; style-carryover is weak — next: more data or contrastive loss.
next: TBD (likely 2026-05-text-002-contrastive-loss or 2026-05-text-002-data-scale)
Site: Material default theme, light-mode default, dark toggle, minimal customization. Home page = mission + experiment grid filtered by consequential=true with toggle for minor. Per-experiment page = rendered README + eval_report.json verdicts table. Architecture page = stub. Learnings page = aggregated. Replicate page = explains ./tools/replicate.sh.
NOT to do:
Do NOT migrate text-ip-adapter code. Just reference it.
Do NOT implement core/ framework code — just empty shape.
Do NOT write build-site.sh parsing logic — stub that prints "TODO: implement" is fine.
Do NOT set up HF org or external storage.
Do NOT publish anywhere. Local repo + GH Actions config only.
No tests beyond a smoke import or two.
Keep total code output small — scaffolding only.
Final step: make initial git commit with message "Scaffold prompt-adapters monorepo with MkDocs Material site and experiment 001 placeholder". Do not push.
code
Current plan (markdown):
# Implementation Plan: Scaffold `prompt-adapters` Monorepo
Overview
The target directory /Users/user_c042661f/Documents/reigh-workspace/prompt-adapters/ currently contains only a .git/ directory (clean slate, already git init-ed, on main). The goal is to lay down a scaffolding for a multi-modality "prompt adapters" research monorepo — shared core/ shape, per-modality placeholders, an experiments/ dir with one real (text-001) experiment metadata-only entry, an MkDocs Material site, a few helper shell scripts, and top-level files. No framework code, no code migration from the sibling ../text-ip-adapter/, no site build logic, no pushing. End with one initial commit.
Because the existing .git/ is present, I'll skip git init and just stage/commit at the end. All paths below are relative to the project root unless prefixed with /.
Create README.md with a short overview: mission (reference-conditioning prompt adapters across modalities), top-level directory map (core/, modality/, experiments/, site/, tools/), pointer to site/ for rendered docs, and a note that experiments/2026-04-text-001-gemma3-adapter/ currently references code in the sibling ../text-ip-adapter/ repo.
Create core/__init__.py (empty) and core/README.md with a one-paragraph description of core as the shared-framework home (encoder = reference encoders; projector = latent → K/V / prefix projection; injection = how/where latents enter the frozen base; training = loops & losses; eval = judge + automatic tests; data = pair loading).
For each ofencoder/, projector/, injection/, training/, eval/, data/: create core/<name>/__init__.py (empty) and core/<name>/README.md with a single-sentence description of the sub-module's responsibility. No implementation code.
Create modality/README.md explaining modality subdirs hold modality-specific glue (data loaders, base-model wiring, modality-specific eval) on top of core/.
Create modality/<name>/README.md stubs for text, audio, music, video — one line each describing scope. No __init__.py needed (modality dirs may not be Python packages; just placeholders).
Create tools/new-experiment.sh — a bash script that takes <experiment-id> as $1, creates experiments/$1/, and writes the per-experiment template files listed in the brief:
experiment.yaml with all specified fields blank/placeholder: id prefilled from $1, modality, status: planned, consequential: true, question, hypothesis, parent: null, base_model, dataset, core_commit, compute, results: {}, headline, next.
config.yaml (empty placeholder with one # TODO comment).
requirements.lock (empty file).
CORE_COMMIT (empty file).
run.sh (placeholder: #!/usr/bin/env bash\n# TODO: implement training entrypoint\n).
results/.gitkeep (empty).
LEARNINGS.md (placeholder # Learnings header).
Use heredocs. Make script idempotent-ish: refuse to overwrite if experiments/$1/experiment.yaml already exists (set -euo pipefail + early check).
Create tools/build-site.sh — stub that echoes TODO: implement site build (aggregate experiment.yaml + eval_report.json into docs/) and exits 0. #!/usr/bin/env bash + set -euo pipefail.
Create tools/replicate.sh — stub that echoes TODO: implement replicate flow (pin core commit, recreate env, re-run experiment) and exits 0.
chmod +x all three scripts.
Step 5: experiments/ scaffold and populated experiment 001 (experiments/2026-04-text-001-gemma3-adapter/)
Scope: Medium
Create the experiment dir and materialize every template file listed in Step 4 structure, but filled with real content per the brief:
experiment.yaml — all fields per brief metadata block. parent: null, core_commit: TBD, compute as string "RTX 4090, ~1.5 hours projected, ~$0.83 (at $0.69/hr)", results as a nested mapping with the 6 keyed values (test1_discrimination, test2_vs_prompting, test3_style_carryover, test4_memorization, test4_ref_leak, test5_loss_curve). Preserve the duplicate-looking test4_* keys as written in the brief — YAML will accept both since the second key is test4_ref_leak (distinct from test4_memorization).
README.md — filled sections:
Question: the brief's question verbatim.
Hypothesis: the brief's hypothesis verbatim.
Method: 1-paragraph summary (frozen Gemma-3-4B, prefix K/V adapter, 971 pairs, 4 registers, 2000 steps, RTX 4090). Point to ../../text-ip-adapter/scripts/train.py as the actual training entrypoint today.
Results: a table of the five eval tests with their pass/weak/slow verdicts and current-step notes (step 1500 discrimination + win-rate, T3 weak, T4 memorization/ref-leak pass, T5 loss still improving). Mark status "in progress, preliminary results."
Learnings: cross-link to LEARNINGS.md.
Replicate: reference ./run.sh (currently a pointer) and ../../text-ip-adapter/.
LEARNINGS.md — four bullet notes verbatim from brief:
(a) reference discrimination kicks in around step 600–1100
(b) prompted-baseline beaten 67% at step 1500
(c) T3 style-carryover WEAK
(d) data scale (971 pairs) is main suspect.
run.sh — #!/usr/bin/env bash + echo "see ../text-ip-adapter/scripts/train.py — will be migrated in later." (chmod +x).
MIGRATION.md — one-paragraph note: "This experiment's code currently lives at ../../text-ip-adapter/ (sibling repo). We intentionally did not symlink — when the training code is refactored onto core/ it will be copied here and core_commit updated. Until then, treat ../../text-ip-adapter/ as the source of truth for this run."
Step 6: site/ MkDocs Material scaffold (site/mkdocs.yml, site/docs/)
Scope: Medium
Create site/mkdocs.yml with:
site_name: Prompt Adapters
theme: { name: material, palette: [{ scheme: default, toggle: { icon: material/weather-sunny, name: Switch to dark } }, { scheme: slate, toggle: { icon: material/weather-night, name: Switch to light } }] } — default light, dark toggle.
Create .github/workflows/pages.yml — triggers on push to main and workflow_dispatch. Job: checkout, setup-python@v5 (3.11), pip install mkdocs-material, mkdocs build -f site/mkdocs.yml -d site/site, then actions/upload-pages-artifact on site/site/ and actions/deploy-pages@v4. Include permissions: { pages: write, id-token: write, contents: read } and concurrency: { group: "pages", cancel-in-progress: false }. This matches the standard GH-Pages-via-Actions flow and requires the user to enable Pages→Actions in the repo settings later (note in README).
Step 8: Sanity smoke check and initial commit
Scope: Small
Run a smoke check: python -c "import core; import core.encoder; import core.projector; import core.injection; import core.training; import core.eval; import core.data" from the repo root (to confirm the __init__.py files are in place). Also run bash -n tools/new-experiment.sh && bash -n tools/build-site.sh && bash -n tools/replicate.sh to syntax-check the scripts. Optionally, spot-check by running bash tools/new-experiment.sh 2026-04-text-000-smoketest in a throwaway path (or just dry-read — to avoid creating an extra dir, skip the actual run; syntax check is sufficient).
Verify directory tree matches the brief (find . -maxdepth 3 -not -path './.git/*' | sort).
Stage and commit all new files in one commit:
code
git add -A
git commit -m "Scaffold prompt-adapters monorepo with MkDocs Material site and experiment 001 placeholder"
core/ and modality/ placeholders (Steps 2–3) — pure directory shape.
tools/ scripts (Step 4) — needed before experiments so the template is canonical, but experiment 001 is authored by hand (brief specifies real content), not via new-experiment.sh.
Experiment 001 (Step 5) — the only non-trivial content block.
site/ + GH Pages workflow (Steps 6–7) — independent; can go after experiments.
Smoke check + commit (Step 8) — last.
Validation Order
python -c "import core.<subpkg>" for each of the 6 subpackages — confirms __init__.py placement.
bash -n syntax check on all three tools/*.sh scripts.
find-based tree walk to confirm every file the brief lists is present (compare against a written checklist of expected paths).
git status after commit should be clean; git log --oneline should show exactly one commit with the specified message.
(info-only, not run here) mkdocs build -f site/mkdocs.yml would validate the site config but requires mkdocs-material installed — skipped to keep scope tight; GH Actions will exercise it on first push.
code
Current plan metadata:
{
"version": 1,
"timestamp": "2026-04-24T16:14:43Z",
"hash": "sha256:70aabf76433a7bde575068e1ed0fc241694965b829207999ae56079f506604dc",
"questions": [
"LICENSE copyright holder: using 'Peter [REDACTED]' based on git user email ([REDACTED]). Correct, or should it be a different name/org?",
"Python version for the GH Pages workflow: assuming 3.11. OK, or should it match the text-ip-adapter project's version?",
"The brief's results block lists two keys starting with test4_ (test4_memorization and test4_ref_leak). Assuming both are intentional separate YAML keys (not a typo) \u2014 confirm?",
"tools/new-experiment.sh: assuming it only scaffolds files and does NOT git-commit or open an editor. Correct?",
"MkDocs site: assuming mkdocs-material is the only pip dep for the GH Pages build (no plugins like mkdocs-awesome-pages, no mermaid, no social cards). Minimal is fine?"
],
"success_criteria": [
{
"criterion": "Repo root contains README.md, .gitignore, LICENSE (MIT full text), and the five top-level directories core/, modality/, experiments/, site/, tools/.",
"priority": "must",
"requires": [
"read_files",
"run_shell"
]
},
{
"criterion": "core/ has __init__.py and six subdirs (encoder/, projector/, injection/, training/, eval/, data/), each with its own __init__.py and README.md. python -c 'import core, core.encoder, core.projector, core.injection, core.training, core.eval, core.data' succeeds from repo root.",
"priority": "must",
"requires": [
"run_shell",
"read_files"
]
},
{
"criterion": "modality/ has a top-level README.md and four subdirs text/, audio/, music/, video/ each with a README.md stub.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "tools/new-experiment.sh, tools/build-site.sh, tools/replicate.sh exist, are executable (+x), and pass bash -n syntax check. build-site.sh and replicate.sh are stubs that print a TODO and exit 0. new-experiment.sh creates the full template structure specified in the brief when run.",
"priority": "must",
"requires": [
"run_shell",
"read_files"
]
},
{
"criterion": "experiments/2026-04-text-001-gemma3-adapter/ contains , , , , , , , , and . parses as valid YAML and contains every field specified in the brief with the brief's exact values.",
"priority": "must",
"requires": [
"run_shell",
"read_files"
]
},
{
"criterion": " contains the four specific notes from the brief (step 600\u20131100 discrimination, 67% win-rate at step 1500, T3 weak, 971-pair data-scale suspect).",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": " explicitly states the actual training code lives at and was intentionally not symlinked.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": " configures the Material theme with a light-default palette and a working dark-mode toggle, and declares a with Home / Experiments / Architecture / Learnings / Replicate. contains matching stub pages for each nav entry.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": " exists, triggers on push to , installs , runs , and deploys via with correct and blocks.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "Exactly one new git commit exists on with the message 'Scaffold prompt-adapters monorepo with MkDocs Material site and experiment 001 placeholder', and the working tree is clean afterward. The commit is NOT pushed.",
"priority": "must",
"requires": [
"run_shell"
]
},
{
"criterion": "No code from is copied, imported, or symlinked into the new repo \u2014 only referenced by path in README/MIGRATION/run.sh text.",
"priority": "must",
"requires": [
"run_shell",
"read_files"
]
},
{
"criterion": "No implementation code is written beyond empty and short stubs \u2014 the package shape compiles but does nothing.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "Total new lines of code/text stays modest and scaffolding-flavored \u2014 no large generated docs, no framework implementations, no migrated training code.",
"priority": "should",
"requires": [
"run_shell",
"subjective_judgment"
]
},
{
"criterion": " would succeed on a machine with installed (config is valid, referenced pages exist).",
"priority": "should",
"requires": [
"run_shell"
]
},
{
"criterion": "Filenames, YAML field names, and directory names exactly match the brief's spellings (e.g. , , , , , ).",
"priority": "must",
"requires": [
"read_files"
]
}
],
"assumptions": [
"The existing on is intentional; no needed \u2014 just one commit at the end on the existing branch.",
"LICENSE copyright: (derived from git user email and today's date 2026-04-24).",
" is written as the YAML string (not a null/reserved value), matching the brief's intent that it's a placeholder awaiting migration.",
" is emitted as literal YAML (not the string ).",
" is authored by hand; experiment 001 is ALSO authored by hand with its real content \u2014 the script is not run to produce 001. The script exists for future experiments.",
"MkDocs Material is the only site dependency; uses the default Material theme with the standard light/dark palette toggle, no plugins beyond the defaults.",
"GH Pages workflow uses the modern flow with artifact upload \u2014 user will separately enable Pages\u2192'GitHub Actions' source in repo settings (noted in top-level README).",
" excludes contents except , so empty-but-tracked results dirs persist.",
"Python 3.11 for the GH Pages workflow.",
"No , , or at the repo root \u2014 the brief says no framework code, and dependencies for the site are installed inline in the workflow.",
" dirs get a only, no \u2014 they're not yet Python packages. dirs do get because the brief explicitly says so.",
"The dir itself gets no top-level unless needed; if a one-line readme adds clarity it'll be included, otherwise the directory is implicit via its single subdir."
],
"structure_warnings": []
}
code
Gate summary:
{
"recommendation": "ITERATE",
"rationale": "Light robustness: single revision pass to incorporate critique feedback.",
"signals_assessment": "",
"warnings": [],
"settled_decisions": []
}
code
Open significant flags:
[
{
"id": "FLAG-001",
"severity": "significant",
"status": "open",
"concern": "Experiment references: the plan uses broken relative paths to the sibling text-ip-adapter repo from inside experiments/2026-04-text-001-gemma3-adapter/.",
"evidence": "The actual sibling repo is /Users/user_c042661f/Documents/reigh-workspace/text-ip-adapter. From the planned experiment directory, ../text-ip-adapter resolves to prompt-adapters/experiments/text-ip-adapter and ../../text-ip-adapter resolves to prompt-adapters/text-ip-adapter; both do not exist. The working relative path from the experiment directory is ../../../text-ip-adapter, while ../text-ip-adapter is only correct when referenced from the repo root."
}
]
code
Requirements:
- Before addressing individual flags, check: does any flag suggest the plan is targeting the wrong code or the wrong root cause? If so, consider whether the plan needs a new approach rather than adjustments. Explain your reasoning.
- Update the plan to address the significant issues.
- Keep the plan readable and executable.
- Return flags_addressed with the exact flag IDs you addressed.
- Include `changes_summary` as a short plain-English summary of what changed in the revision. If there were no concrete flags, say that explicitly (for example: `No critique flags were raised; refined wording and kept the plan aligned for execution.`).
- Preserve or improve success criteria quality. Each criterion must have a `priority` of `must`, `should`, or `info`. Promote or demote priorities if critique feedback reveals a criterion was over- or under-weighted.
- Verify that the plan remains aligned with the user's original intent, not just internal plan quality.
- Remove unjustified scope growth. If critique raised scope creep, narrow the plan back to the original idea unless the broader work is strictly required.
- Maintain the structural template: H1 title, ## Overview, phase sections with numbered step sections, ## Execution Order or ## Validation Order.
- CRITICAL: Your entire revised plan markdown (all sections) must be output as the `plan` field in the structured output. The prose response must not contain the plan text.
- CRITICAL: Return only the structured JSON object for the schema fields `plan`, `changes_summary`, `flags_addressed`, `assumptions`, `success_criteria`, and `questions`. Do not add commentary before or after the JSON object.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
Dataset releases
Not yet included in a published release.
config.yaml — placeholder comment pointing at ../../text-ip-adapter/configs/ for now.
requirements.lock — empty file.
CORE_COMMIT — empty file (placeholder; will be populated post-migration).