|
| 1 | +# Generation + Quality Workflow Run — 2026-06-01 |
| 2 | + |
| 3 | +**Course**: Complete SQL Mastery (CodeWithMosh) |
| 4 | +**Sections covered**: `getting-started-0025`, `data-types-0035` |
| 5 | +**Providers tested**: AWS Bedrock (Claude Sonnet 4.6), MiniMax M2.7, Ollama gemma4:latest |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Summary Table |
| 10 | + |
| 11 | +| Provider | Status | Quality Rounds | Gen-Error Retries | Flashcard Score | Quiz Score | API OK | Rendered | |
| 12 | +|---|---|---|---|---|---|---|---| |
| 13 | +| AWS Bedrock — Claude Sonnet 4.6 | APPROVED | 1 | 0 | 9/10 | 9/10 | Yes | Yes | |
| 14 | +| MiniMax M2.7 | **FAILED** | 3 (judge) + 2 gen errors = 4 total | 3 | 8/10 (last judge) | 4/10 (last judge) | Yes | Yes | |
| 15 | +| Ollama — gemma4:latest | APPROVED | 4 | 0 | 8/10 | 7/10 | Yes | Yes | |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## Provider Detail |
| 20 | + |
| 21 | +### AWS Bedrock — Claude Sonnet 4.6 |
| 22 | + |
| 23 | +**Status**: APPROVED in 1 round (no retries required). |
| 24 | + |
| 25 | +**Final verdict** (round 1): |
| 26 | +> Both decks are accurate, non-trivial, and teach the real WHY behind each concept. Content is approved for use. |
| 27 | +
|
| 28 | +**Strengths**: |
| 29 | +- Flashcards test genuine understanding (FK vs denormalisation trade-off, FLOAT IEEE 754 accumulation, `->` vs `->>` silent failure) rather than rote recall. |
| 30 | +- Every answer is self-contained and correct. |
| 31 | +- Quiz distractors are plausible — e.g. "FLOAT is slower than DECIMAL" is deliberately inverted from reality; "avoid JOINs" is the exact wrong reason engineers cite for denormalisation; "ENUM cannot be indexed" is correctly attributed to TEXT not ENUM (cross-card reinforcement). |
| 32 | +- Rationales are educational, distinguishing mechanism from motivation. SQL examples are syntactically valid. |
| 33 | +- The intentional-denormalisation exception card is a standout — it captures the nuance most intro courses skip. |
| 34 | +- Getting-started deck covers both tool knowledge (Workbench execution model) and foundational principles (declarative vs procedural) without near-duplicates. |
| 35 | + |
| 36 | +**Weaknesses**: |
| 37 | +- The ENUM rebuild card/question does not mention that MySQL 8.0 supports `ALGORITHM=INSTANT` for appending new ENUM values at the end, avoiding a full table rebuild in many cases. This is a course-level abstraction and not a correctness error, but a senior engineer may notice the gap. |
| 38 | +- The Workbench Execute-button flashcard is more tool-mechanics than SQL understanding — acceptable given it is a getting-started module, but the weakest card in the set. |
| 39 | + |
| 40 | +**Round-by-round history**: |
| 41 | + |
| 42 | +| Round | Kind | Approved | Flashcard Score | Quiz Score | |
| 43 | +|---|---|---|---|---| |
| 44 | +| 1 | judge | Yes | 9 | 9 | |
| 45 | + |
| 46 | +**Output files**: |
| 47 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__bedrock/flashcards/getting-started-0025-flashcards.json` (5 cards) |
| 48 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__bedrock/quizzes/getting-started-0025-quiz.json` (5 questions) |
| 49 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__bedrock/flashcards/data-types-0035-flashcards.json` (5 cards) |
| 50 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__bedrock/quizzes/data-types-0035-quiz.json` (5 questions) |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +### MiniMax M2.7 |
| 55 | + |
| 56 | +> **ATTENTION: This provider hit the retry ceiling without achieving approval. Human decision required — see section below.** |
| 57 | +
|
| 58 | +**Status**: FAILED. Exhausted 3 gen-error retries and 3 judge rounds without approval. The final generation attempt (retry 3) produced an incomplete output — `data-types-0035-quiz.json` was never written because MiniMax returned XML-style tool-call markup instead of the expected `tool_use` block format. |
| 59 | + |
| 60 | +**Final judge reasons** (round 3, last successful evaluation): |
| 61 | +> Fix these specific defects before resubmitting: |
| 62 | +> 1. Getting Started quiz Q1 (Elka/relational model): The correct answer option contains garbled non-English text ("看到她新地址") embedded in an otherwise English sentence. |
| 63 | +> 2. Data Types quiz Q4 (JSON_SET path prefix): Marks "JSON_SET automatically normalizes bare paths by prepending $ internally" as CORRECT — this is factually wrong. MySQL's JSON_SET does NOT auto-prefix bare paths. |
| 64 | +> 3. Data Types quiz Q1, distractor D rationale: States VARCHAR(2) and CHAR(2) store the same number of bytes — incorrect; CHAR(2) stores 2 bytes, VARCHAR(2) stores 3 bytes. |
| 65 | +
|
| 66 | +**Round-by-round history**: |
| 67 | + |
| 68 | +| Round | Kind | Approved | Flashcard Score | Quiz Score | Detail | |
| 69 | +|---|---|---|---|---|---| |
| 70 | +| 1 | judge | No | 8 | 4 | Two critical defects: Q1 option text contained a question fragment not an answer; Q5 `isCorrect` flag on wrong option | |
| 71 | +| 2 | gen_error | — | — | — | Generation failed: "1 task(s) failed" (retry 1) | |
| 72 | +| 2 | judge | No | 8 | 6 | Three distractor errors: wrong topic in distractor C; TINYINT UNSIGNED as a 5M-row distractor; copy-paste rationale error in Q5 distractor D | |
| 73 | +| 3 | judge | No | 8 | 4 | Garbled non-English characters in Q1 correct option; factually wrong correct answer in Q4; incorrect byte-count rationale in Q1 distractor D | |
| 74 | +| 4 | gen_error | — | — | — | Generation failed: "1 task(s) failed" (retry 2) | |
| 75 | +| 4 | gen_error | — | — | — | Generation failed: "1 task(s) failed" (retry 3 — ceiling reached) | |
| 76 | + |
| 77 | +**Last generation partial output** (3 of 4 files written; 1 failed): |
| 78 | +- `getting-started-0025-flashcards.json`: OK (12.1s) |
| 79 | +- `getting-started-0025-quiz.json`: OK (60.1s) |
| 80 | +- `data-types-0035-flashcards.json`: OK (36.6s) |
| 81 | +- `data-types-0035-quiz.json`: **FAILED** — MiniMax returned XML-style `<minimax:tool_call>` markup instead of a `tool_use` block; the parser could not extract `emit_quiz_deck`. |
| 82 | + |
| 83 | +**Root cause pattern**: MiniMax alternated between content quality failures (garbled text, incorrect `isCorrect` flags, factual errors) and tool-call format failures. The format failure (`<minimax:tool_call>` instead of JSON `tool_use`) is a protocol-level bug, not a content quality issue — it recurred on retries 2 and 3 and appears to be a reliability regression in the model's tool-use compliance. |
| 84 | + |
| 85 | +**Output files** (incomplete — missing data-types quiz): |
| 86 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__minimax/flashcards/getting-started-0025-flashcards.json` (5 cards) |
| 87 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__minimax/quizzes/getting-started-0025-quiz.json` (5 questions) |
| 88 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__minimax/flashcards/data-types-0035-flashcards.json` (5 cards) |
| 89 | +- `data-types-0035-quiz.json` — **NOT WRITTEN** |
| 90 | + |
| 91 | +**Note on API/render validation**: Despite the failed generation, the validation report shows `flashcard_count=10` and `quiz_count=10` for the minimax course. This is inconsistent with the generation record (only 3 of 4 files written). The validation agent may have encountered stale data from a prior run or the API is counting from a partially-consistent state. This discrepancy requires investigation. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +### Ollama — gemma4:latest |
| 96 | + |
| 97 | +**Status**: APPROVED in 4 rounds (no gen-error retries). This provider required the maximum number of judge iterations but ultimately met the approval bar. |
| 98 | + |
| 99 | +**Final verdict** (round 4): |
| 100 | +> Content is genuinely useful and accurate. Approve with these improvements for the next generation pass. |
| 101 | +
|
| 102 | +**Strengths**: |
| 103 | +- Data Types 0035 flashcards are outstanding — all five test design reasoning (ENUM rebuild cost, IEEE 754 vs DECIMAL, Y2K38 TIMESTAMP limit, JSON sparse-table avoidance, BIGINT range) with correct SQL examples. |
| 104 | +- Getting Started 0025 flashcards for FK/SSOT, junction tables, and Views are well-framed with concrete scenarios. |
| 105 | +- Quiz distractors throughout are plausible real-world anti-patterns (comma-separated columns, nullable column explosion, SET type, VARCHAR PKs) rather than throwaway wrong answers. |
| 106 | +- Rationales are educational and explain the why, not just the what. |
| 107 | +- Data Types 0035 quiz Q3 (ENUM-to-lookup-table migration) is particularly strong — all four options are patterns engineers actually propose. |
| 108 | + |
| 109 | +**Weaknesses (final round — deferred improvements, not blockers)**: |
| 110 | +- Getting Started 0025 has one trivia flashcard (loopback IP / default port) that adds no SQL design value. Replacement suggested: View vs CTE trade-offs. |
| 111 | +- Quiz Q5 tests MySQL Workbench UI mechanics rather than transferable SQL knowledge. |
| 112 | +- Quiz Q4 distractor D has a logically unsound rationale — dismisses a trigger as a design flaw when a trigger is actually a valid implementation mechanism. |
| 113 | +- Data Types 0035 quiz Q2 distractor B risks misleading learners: DECIMAL(19,4) is marked wrong for being "arbitrary" but it is the dominant industry convention for financial data; the rationale needs nuance. |
| 114 | + |
| 115 | +**Round-by-round history**: |
| 116 | + |
| 117 | +| Round | Kind | Approved | Flashcard Score | Quiz Score | Key issues | |
| 118 | +|---|---|---|---|---|---| |
| 119 | +| 1 | judge | No | 8 | 6 | Duplicate distractors in data-types Q5; imprecise correct answer in getting-started Q3; throwaway distractors; UI-trivia flashcard | |
| 120 | +| 2 | judge | No | 7 | 6 | Two quiz questions test GUI/CLI knowledge not SQL; Q3 "correct" answer contestable; getting-started flashcard 4 is Workbench trivia | |
| 121 | +| 3 | judge | No | 9 | 6 | Data Types Q5 JSON_EXTRACT rationale factually wrong in MySQL 8; Getting Started Q4 tests Workbench UI mechanics | |
| 122 | +| 4 | judge | Yes | 8 | 7 | Approved with deferred improvements noted above | |
| 123 | + |
| 124 | +**Output files**: |
| 125 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__ollama/flashcards/getting-started-0025-flashcards.json` (5 cards) |
| 126 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__ollama/quizzes/getting-started-0025-quiz.json` (5 questions) |
| 127 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__ollama/flashcards/data-types-0035-flashcards.json` (5 cards) |
| 128 | +- `/Users/taylaand/Obsidian/Personal/Study/CodeWithMosh/Complete_SQL_Mastery__ollama/quizzes/data-types-0035-quiz.json` (5 questions) |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Playwright / API Validation |
| 133 | + |
| 134 | +### Complete_SQL_Mastery__bedrock |
| 135 | + |
| 136 | +- **API**: `/api/courses` confirms course present with `flashcard_count=10`, `quiz_count=10`. Both `/api/cards` calls returned 10 items each. |
| 137 | +- **Rendered**: Playwright navigated to `http://127.0.0.1:8567/#flashcards`; course card visible showing "10 flashcards 10 quiz questions" with Flashcards/Quiz buttons. |
| 138 | +- **Console errors**: 5 non-blocking pre-existing errors; no new regressions. |
| 139 | +- **Sample flashcard front**: "You need to store product prices in MySQL. A colleague suggests using FLOAT for efficiency. Why is this wrong, and what should you use instead?" |
| 140 | +- **Sample quiz question**: "A financial application stores product prices. A developer defines the column as `price FLOAT`. What is the most serious consequence of this choice in production?" |
| 141 | + |
| 142 | +### Complete_SQL_Mastery__minimax |
| 143 | + |
| 144 | +- **API**: `/api/courses` reports `flashcard_count=10`, `quiz_count=10`. Both `/api/cards` calls returned 10 items each. |
| 145 | +- **Rendered**: Playwright confirmed course card present with "10 flashcards 10 quiz questions". |
| 146 | +- **Discrepancy**: The generation run recorded only 3 of 4 files successfully written (data-types quiz failed). The API and render counts of 10/10 are inconsistent with this. Either the API is serving stale data from a prior successful run, or there is a partial-write scenario that needs investigation. |
| 147 | +- **Sample flashcard front**: "A colleague argues that MySQL's `JSON_SET` is smart enough to normalize bare paths like `'weight'` automatically. They write `JSON_SET(properties, 'weight', 20)` and expect it to work. Are they right? If not, what is the correct syntax?" |
| 148 | +- **Sample quiz question**: "You need to store two-character US state abbreviations (always exactly 2 characters). Which storage comparison is correct?" |
| 149 | + |
| 150 | +### Complete_SQL_Mastery__ollama |
| 151 | + |
| 152 | +- **API**: `/api/courses` confirms course present with `flashcard_count=10`, `quiz_count=10`. Both `/api/cards` calls returned 10 items each. |
| 153 | +- **Rendered**: Playwright confirmed course card renders at `#flashcards` with "10 flashcards 10 quiz questions" and Flashcards/Quiz buttons visible. |
| 154 | +- **Sample flashcard front**: "When designing a schema, why is using a lookup table pattern (e.g., for 'size') superior to using an ENUM type?" |
| 155 | +- **Sample quiz question**: "When designing a product catalog where products have highly variable attributes (e.g., a TV has a resolution, a shirt has a size), which pattern is best suited to store these optional, schema-per-row attributes while maintaining relational integrity?" |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## What Needs Human Decision |
| 160 | + |
| 161 | +### 1. MiniMax — FAILED provider: decide whether to retry or deprecate |
| 162 | + |
| 163 | +MiniMax hit the 3-gen-error-retry ceiling and produced unapproved content across 3 judge rounds. The failures fall into two distinct categories: |
| 164 | + |
| 165 | +- **Content quality**: Garbled non-English characters in output, incorrect `isCorrect` flags, factual SQL errors. These suggest the model does not reliably follow the judge's remediation instructions across multiple rounds. |
| 166 | +- **Protocol failure**: MiniMax returned `<minimax:tool_call>` XML-style markup instead of the expected JSON `tool_use` block. This is a tool-call compliance bug that prevented the `data-types-0035-quiz.json` from being written at all on the final two retries. |
| 167 | + |
| 168 | +**Decision needed**: Should MiniMax be retried with a different prompt strategy (e.g., stricter tool-call formatting instructions), or should it be removed from the provider rotation until the XML markup regression is investigated and fixed? |
| 169 | + |
| 170 | +### 2. MiniMax API/render count discrepancy |
| 171 | + |
| 172 | +The validation report shows `flashcard_count=10` and `quiz_count=10` for the minimax course, but the generation run only wrote 3 of 4 files. Someone needs to confirm whether the API is serving data from a previous (stale) run or whether there is genuinely a complete set of cards for this course that pre-dates this run. If the quiz counts are stale, the minimax course data should be treated as invalid for use. |
| 173 | + |
| 174 | +### 3. Ollama — deferred improvements (approved but non-trivial feedback) |
| 175 | + |
| 176 | +The Ollama content was approved but with four documented improvement items that the judge explicitly flagged for the "next generation pass". These are not blockers, but if content quality is a priority they should be addressed before the course is distributed to learners: |
| 177 | + |
| 178 | +- Replace connectivity-trivia flashcard (127.0.0.1 / port 3306) with a View vs CTE trade-offs card. |
| 179 | +- Fix quiz Q4 distractor D rationale (trigger dismissal is logically unsound). |
| 180 | +- Replace quiz Q5 (Workbench highlight-to-execute) with transferable SQL knowledge question. |
| 181 | +- Nuance the DECIMAL(19,4) distractor rationale in data-types quiz Q2. |
| 182 | + |
| 183 | +**Decision needed**: Accept as-is for learner use, or queue a targeted regeneration pass for these four items? |
| 184 | + |
| 185 | +### 4. Bedrock ENUM/ALGORITHM=INSTANT gap |
| 186 | + |
| 187 | +The judge noted that the ENUM rebuild card does not mention `ALGORITHM=INSTANT` for MySQL 8.0 (appending ENUM values without a full table rebuild). This is a course-level abstraction and not a correctness error, but it is a meaningful omission for a senior engineer audience. |
| 188 | + |
| 189 | +**Decision needed**: Accept the omission as appropriate course-level simplification, or add a follow-up card covering the MySQL 8.0 exception? |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## STEP-3 ADDENDUM (post-workflow targeted fixes) — 2026-06-01 |
| 194 | + |
| 195 | +After the workflow completed, I root-caused MiniMax's FAILED status and fixed the |
| 196 | +**code** defects it exposed, then re-ran MiniMax. Summary of what changed: |
| 197 | + |
| 198 | +### MiniMax code bugs found & fixed (proven live) |
| 199 | + |
| 200 | +1. **error 2013 → tool_result correction** (commit `2c26c2a`, fixed earlier in the |
| 201 | + night before the workflow): the schema-correction retry appended a plain-text |
| 202 | + user turn after an assistant `tool_use`; MiniMax's strict `/anthropic` shim |
| 203 | + rejects that. Now emits a protocol-valid `tool_result`. |
| 204 | +2. **inline-XML tool calls** (commit `c4b2030`): MiniMax M2.7 intermittently emits |
| 205 | + the forced tool call as `<minimax:tool_call><invoke …><parameter …>` text |
| 206 | + markup instead of a native `tool_use` block (~half the time). Added |
| 207 | + `_parse_inline_tool_call` fallback **plus** a transient-retry in |
| 208 | + `call_with_correction` (a single bad emission no longer hard-fails). This is the |
| 209 | + exact protocol failure the workflow flagged as needing investigation. |
| 210 | +3. **`--max-retries` knob** (commit `209d0e4`): flaky providers can be given a |
| 211 | + larger retry budget so consecutive bad emissions don't exhaust it. |
| 212 | + |
| 213 | +**Proof**: MiniMax data-types quiz (previously failed reliably) now generates |
| 214 | +4/4 clean consecutive runs (0 errors); a full clean two-section run wrote 4/4 |
| 215 | +files (5+5+5+5 = 20 cards). |
| 216 | + |
| 217 | +### MiniMax content quality — STILL below bar (model limitation, NOT code) |
| 218 | + |
| 219 | +After clean generation, an Opus-4.8 judge re-assessed the fresh MiniMax decks: |
| 220 | + |
| 221 | +> **VERDICT: REJECTED — flashcard 9/10, quiz 6/10.** Getting-Started quiz Q4 has |
| 222 | +> `isCorrect` on the wrong option for the scenario described (Workbench |
| 223 | +> execution-scope confusion); the Data-Types quiz has two rationale-to-option |
| 224 | +> copy-paste mismatches. Flashcards are excellent; quizzes carry subtle |
| 225 | +> correctness defects. |
| 226 | +
|
| 227 | +This matches the workflow's 3 in-loop rejections. **Conclusion: MiniMax M2.7's |
| 228 | +generation pipeline is now fully working (zero errors), but its quiz content |
| 229 | +quality is a model limitation the strict judge keeps catching.** Its flashcards |
| 230 | +(score 9) are genuinely strong. |
| 231 | + |
| 232 | +### Final provider scorecard |
| 233 | + |
| 234 | +| Provider | Generates cleanly? | Judge verdict | Notes | |
| 235 | +|---|---|---|---| |
| 236 | +| **Bedrock Sonnet 4.6** | ✅ | **APPROVED 9/9** (round 1) | Best — accurate, deep, plausible distractors | |
| 237 | +| **Ollama gemma4** | ✅ | **APPROVED 8/7** (round 4) | Needed 4 judge rounds; approved with deferred nits | |
| 238 | +| **MiniMax M2.7** | ✅ (after code fixes) | **REJECTED 9/6** | Flashcards strong; quiz quality is a model limit, not a bug | |
| 239 | + |
| 240 | +### Decision for the user (MiniMax) |
| 241 | + |
| 242 | +The code is fixed and committed — MiniMax no longer errors. The open question is |
| 243 | +purely product: **keep MiniMax (it produces excellent flashcards) and accept |
| 244 | +weaker quizzes, restrict MiniMax to flashcard-only generation, or drop it from |
| 245 | +the rotation for quizzes.** No further code work is required for MiniMax to |
| 246 | +*function*; the gap is content quality intrinsic to the model. |
0 commit comments