Commit 1c70d13
fix(python): output-prompt emitter — nested field.object crashed gen/verify (#144)
The nested-object branch appended an inline `# FR-010: nested prompt deferred`
comment to the emitted PromptField literal. spec_literal joins every field onto ONE
line, so the Python '#' swallowed the rest of the line — including the closing '])' —
emitting invalid Python (unterminated list, 'SyntaxError: [ was never closed'), which
hard-crashed `gen` + `verify --codegen` (not just a diff) for any template.output
whose payload has a nested field.object. The note now lives in the function source; the
emitted literal carries no comment. (Python-only: TS/Java/Kotlin/C# use inline-safe
/* */ block comments.) PromptField already defaults nested=None, so the placeholder is
both valid syntax + constructible.
Regression test fails pre-fix (SyntaxError), passes post-fix; FR-010 suite green.
Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
Co-authored-by: Doug Mealing <noreply@anthropic.com>1 parent 5741b16 commit 1c70d13
2 files changed
Lines changed: 67 additions & 4 deletions
File tree
- server/python
- src/metaobjects/codegen
- tests/codegen
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments