(sectionId, text, author)
| 644 | } |
| 645 | |
| 646 | function addNote(sectionId, text, author) { |
| 647 | const section = findSectionOrThrow(sectionId); |
| 648 | const note = { |
| 649 | text: safeString(text), |
| 650 | author: author === "human" ? "human" : "agent", |
| 651 | timestamp: nowIso(), |
| 652 | }; |
| 653 | section.notes.push(note); |
| 654 | section.lastModified = note.timestamp; |
| 655 | stateCache.lastUpdated = note.timestamp; |
| 656 | return note; |
| 657 | } |
| 658 | |
| 659 | function updateSectionStatus(sectionId, status, message, author = "agent") { |
| 660 | if (!VALID_STATUS.has(status)) { |
no test coverage detected