Write a complete Python 3.10+ command-line program using only argparse, json, sys and pathlib from the standard library. Return only the entire Python source, with no Markdown or explanation. Read a UTF-8 JSON file named by the first positional argument. It contains a list of objects with a unique string id, string text and boolean confirmed. Validate this shape and reject duplicate IDs. A missing file, invalid JSON or invalid record must print a helpful error to stderr and exit 2. Preserve every character in text, including leading/trailing spaces and accents. Sort records by id. Read the input; never modify it. Make no network requests, run no other programs and write no files. Include a main entry point.
Build Publication Desk: help a writer prepare confirmed quotations and find the follow-up work before sharing a draft. By default print READY as the first section and NEEDS REVIEW as the second. Put confirmed true notes in READY and confirmed false notes in NEEDS REVIEW. For each note print its id alone on one line and its exact text on the next line. Each empty section prints (empty). Add --ready-only to print only the READY section, so the reader can redirect it into a draft file. In both modes exit 1 if any note needs review, otherwise exit 0. Exit 1 means useful output with follow-up pending, not invalid input. Explain these exit codes and --ready-only in --help. Treat confirmed as the writer's supplied decision; perform no factual verification.
