(sectionId, status, message, author = "agent")
| 657 | } |
| 658 | |
| 659 | function updateSectionStatus(sectionId, status, message, author = "agent") { |
| 660 | if (!VALID_STATUS.has(status)) { |
| 661 | throw new CanvasError("invalid_status", `Unsupported status: ${status}`); |
| 662 | } |
| 663 | const section = findSectionOrThrow(sectionId); |
| 664 | section.status = status; |
| 665 | section.lastModified = nowIso(); |
| 666 | stateCache.lastUpdated = section.lastModified; |
| 667 | addChange({ |
| 668 | type: "status_change", |
| 669 | summary: `${section.name} moved to ${status}`, |
| 670 | timestamp: section.lastModified, |
| 671 | sectionId, |
| 672 | }); |
| 673 | if (message) { |
| 674 | addNote(sectionId, message, author); |
| 675 | } |
| 676 | return section; |
| 677 | } |
| 678 | |
| 679 | function appendFileChange(sectionId, filePath) { |
| 680 | if (!filePath) { |
no test coverage detected