feat(content): note(scope='handoff') write-path for role note sections (WIP)

Agents could not author dev_notes / quick_context / auditor_notes — note() only wrote the journal, so those sections were always empty (the root cause of 'nobody leaves notes'). This adds the write path: note(scope='handoff') routes by role to the section's content model via the apply_structured_note chokepoint (content_type_for_role + TaskService.record_section_note), threaded through the do-server note tool and /api/v1/do/note. ruff/mypy/format clean.

WIP checkpoint before a fresh session: no unit tests yet and the obligations (tracing VERB_REQUIREMENTS) are not wired — do not deploy until completed + gated. See the project_notes_mandate_feature memory for the full design and remaining work.
This commit is contained in:
Renn F
2026-06-21 19:35:24 +02:00
parent 4e4d25d8f9
commit 23e6ee579b
6 changed files with 146 additions and 3 deletions
+11 -2
View File
@@ -195,8 +195,11 @@ def note(
what_learned: str = "",
what_struggled: str = "",
next_steps: list[str] | str | None = None,
section: dict[str, Any] | None = None,
) -> dict[str, Any]:
"""Write a journal entry. scope in note|decision|reflect|learning|struggle.
"""Write a journal entry, or (scope='handoff') your note SECTION.
scope in note|decision|reflect|learning|struggle|handoff.
``text`` is always the short summary (one paragraph max). For ``decision``
and ``reflect`` scopes the structured fields are RECOMMENDED — fill what
@@ -214,7 +217,12 @@ def note(
List-typed fields (``options``, ``consequences``, ``next_steps``) tolerate
a lone value — pass either a list or a single item.
Other scopes (note / learning / struggle) just need ``text``.
Other journal scopes (note / learning / struggle) just need ``text``.
scope='handoff' writes your dedicated SECTION (dev_notes / quick_context /
auditor_notes) instead of the journal: pass ``section={...}`` with the
section's fields (PM/resumption needs done+next; auditor needs
summary+severity), or just ``text`` for a developer summary.
"""
return _post(
"/api/v1/do/note",
@@ -232,6 +240,7 @@ def note(
"what_learned": what_learned,
"what_struggled": what_struggled,
"next_steps": next_steps,
"section": section,
},
)