feat(good-fences): code-mode prompt; the model writes code to mow
codeModeMessages turns what I say plus `about` into a prompt: a neighbor persona, rules for the reply (one async arrow function over `env`), and the lent things' types. Things are remote and calls on one are delivered in order, so a lamp example shows pipelining: await only for a value, or on a batch's last call. With only the rule, the model awaited every call; with the example, it pipelines. aboutMower gives the Mower type with Promise returns. The model test checks the code calls only Mower methods, pushes, and awaits less often than it calls; it saves the code to itest-output/ via a reporter, since the test runs in workerd, which can't write files. Model tests get 60s. Green: both model tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4a85143a66
commit
a2ca59a27e
6 files changed
+113
-4
No files matched your search
@@ -0,0 +1,15 @@
|
||||
/** @file The mower: Logo-turtle moves on a yard of cells. */
|
||||
|
||||
/** what a model is told about a mower: its type, with the moves explained */
|
||||
export const aboutMower = {
|
||||
ts: `interface Mower {
|
||||
/** put the mower down, facing north, and cut the cell under it */
|
||||
start(): Promise<void>;
|
||||
/** move forward one cell (10 yards), cutting the cell it enters */
|
||||
push(): Promise<void>;
|
||||
/** turn right 90 degrees, in place */
|
||||
turn(): Promise<void>;
|
||||
/** park the mower */
|
||||
stop(): Promise<void>;
|
||||
}`,
|
||||
};
|
||||
Reference in new issue
Block a user