Repository navigation
Add notes and record the written Compilation - #67
Merged
Merged
Conversation
A person who agrees to reports also agrees to notes: short, fixed- field accounts of where First Draft itself fell short, so the service learns which requests a Plan cannot state, which guidance misled the agent, and which output was wrong. A note belongs to the Project, so an agent can send one during the interview, before any Compile. The three note commands reuse the report path: the account is read first and nothing is checked or sent with reports off, each field keeps only its shape, and the exact body is printed and sent once. start names notes only when reports are on, so the agent of a person who said no hears nothing about them. Reports and notes now cover the application's whole life. A later session no longer has the Compilation ID that plan compile printed, so plan compile and compilation download record it in a new file beside state.json, which keeps its format and moves with the planning state into the archive under root adoption. A report, or a note about generated code, uses that record unless an ID is given, and sends nothing when there is neither.
The command reference said a note reads no file, but it reads the Project's state and, for generated code without an ID, the Compilation record. The README said both commands send nothing with reports off, but each still reads the account. And when the record cannot be written, the earlier one stays, so the warning and the reference now say a later report may name an earlier Compilation.
After a record write fails, the record still names an earlier Compilation, so start, the report help, and the wrong_output help now say that omitting the ID uses the Compilation the CLI last recorded, not the one it last wrote.
The CLI and the First Draft service had each written their own examples of what a note's fields may hold. Each side passed the other's, but two files can drift apart unseen. The fixture is now a copy of the service's file, byte for byte, as the failure-report fixture is, so both sides test the same strings. Prettier leaves it alone for the same reason.
raghubetina
marked this pull request as ready for review
November 22, 2026 04:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds notes and lets reports and notes cover the generated application's whole life, inside the open 0.10.0 entry.
firstdraft note unstated_request,firstdraft note unclear_guidance, andfirstdraft note wrong_outputsend anote to
POST /v1/projects/{project_id}/notes, with options named after the note's fields. Each reads the pinnedProject, so it needs the Plan's first push; reads the account first and sends nothing with reports off; keeps each
field only in its shape (plain words of at most 300 characters, a Skill page, a diagnostic code, a file in the
application, a lowercase UUIDv7); prints the exact JSON and what it left out; sends it once; and never retries.
A needed field with nothing left after shaping is a local refusal,
note_incomplete.firstdraft startnames notes only when reports are on: the first sentence ofREPORTS_ON_LINESnames them, and anew
NOTES_ON_LINESfollows it with the three kinds, when to send one, and the content rule.plan compileandcompilation downloadrecord the Compilation whose code they wrote incompilation.jsonbesidethe Project's
state.json(in the archive at.firstdraft/design/.firstdraft/after root adoption).state.jsonkeeps its
firstdraft.cli-state/1format.report progress,report failure, and a note about generated code takethe Compilation ID as optional and use the last recorded one; with neither, they send nothing
(
compilation_not_recorded).sendReportand the CLI's report path are shared by reports and notes rather than copied.test/fixtures/note-shapes.jsonlists accepted and refused values for every note field and for whole notes. It is abyte-for-byte copy of the service's file, as the failure-report fixture is, and
test/note-shapes.test.jstests theCLI's shaping against it.
The API contract stays in the
0.9.xrange:release/compatibility.jsondoes not change. The notes endpoint is not onthe First Draft service's main yet; the tests use the repository's fake service.
Docs: updated docs/commands.md (command map, What the CLI sends, start's sentences, the Compilation record, report
usage, Send notes, Service endpoints), docs/errors.md (report and note errors, error index), README.md, and the
CHANGELOG's 0.10.0 entry
Review: Codex, approve (3 rounds, 7 findings: 4 fixed, 3 recorded below as known limits). Antigravity, 1 round, approve (1 low finding, already recorded below as a known limit)
Known limits
Trigger: a Project that writes two outputs, such as a second
plan compile --outputfrom.firstdraft/designafterroot adoption; a report from the first output then names the later Compilation unless an ID is given. The preview
names the Compilation before anything is sent.
ID names the earlier Compilation. Trigger: a filesystem error writing
compilation.jsonafter the code is in place.The command's warning names the new Compilation to pass; its temporary file also stays in the ignored planning
folder.
.firstdraft/has nostate.json. Trigger: an artifact that itself contains.firstdraft/state.json, which the Compiler does not emit..firstdraftwith another Project's state whileplan compileorcompilation downloadruns.Trigger: a
201from something other than First Draft that carries a note with a valid ID and the expectedCompilation.
Validation
npm audit: found 0 vulnerabilitiesnpm run check: passed (typecheck, lint, format, 383 tests, pack check, packed-package smoke)