YOUR OWN AI WORKSHOP
Build the
source notebook.
By Alvin
The first program keeps an editor’s source notes in order. Each input has an id, the exact text and a confirmed value of true or false. The test expects every note to remain available, including unconfirmed ones.
Complete brief / keep the acceptance checks
Write Python 3 code containing exactly one function build_report(notes). Return only code, with no imports, markdown, file access, network access or top-level calls. notes is a list of dictionaries with string keys id, text and boolean confirmed. Build a source notebook for an editor. Return {"notes": [{"source_id": note id, "quote": note text}, ...]}, sorted by source_id. Preserve every text character exactly and keep repeated IDs as separate entries. Accept an empty list. Do not mutate the input. Use only ordinary builtins, list/dict operations and loops. No prose or example calls.
How this prompt becomes a program
“Source notebook” gives the program its job. Preserving text means keeping the quotation unchanged. Sorting by source_id puts the notes in a predictable order. Repeated IDs need separate list entries; using an ID as the sole lookup key could replace an earlier note.
The returned entries each have named fields: source_id identifies the note, and quote holds its text. A future screen could show one entry per row. The model chooses the code; our examples check the records it returns.