@tekmidian/pai 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1196,7 +1196,22 @@ const TOPIC_OVERLAP_THRESHOLD = .15;
1196
1196
  * - Different topic (overlap < 30%) → create a NEW note
1197
1197
  * - If it's from a different day, create a new note
1198
1198
  */
1199
+ /**
1200
+ * Return true if the summarizer output has a meaningful body — i.e. content
1201
+ * beyond the TOPIC:/title/metadata/horizontal-rule scaffolding.
1202
+ *
1203
+ * A summary that is only headers (no Work Done items) must NOT create or update
1204
+ * a note: doing so births an empty-bodied scaffold that later rename/finalize
1205
+ * can strip to a footer-only stub. This is the born-stub failure mode.
1206
+ */
1207
+ function summaryHasContent(summaryText) {
1208
+ return summaryText.replace(/^TOPIC:.*$/m, "").replace(/^# Session:.*$/m, "").replace(/^\*\*(Date|Status|Completed):\*\*.*$/gm, "").replace(/^#{1,6}\s.*$/gm, "").replace(/^---$/gm, "").replace(/<!--[\s\S]*?-->/g, "").trim().length > 0;
1209
+ }
1199
1210
  function writeSessionNote(cwd, summaryText, filesModified) {
1211
+ if (!summaryHasContent(summaryText)) {
1212
+ process.stderr.write(`[session-summary] Summary has no meaningful body — skipping note write.\n`);
1213
+ return null;
1214
+ }
1200
1215
  const notesInfo = findNotesDir(cwd);
1201
1216
  let notePath = getCurrentNotePath(notesInfo.path);
1202
1217
  const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
@@ -1821,4 +1836,4 @@ function extractWorkFromTranscript(lines) {
1821
1836
 
1822
1837
  //#endregion
1823
1838
  export { enqueue as a, work_queue_worker_exports as i, startWorker as n, getStats as o, stopWorker as r, loadQueue as s, notifyNewWork as t };
1824
- //# sourceMappingURL=work-queue-worker-DHOIVVQ7.mjs.map
1839
+ //# sourceMappingURL=work-queue-worker-0tUMEhSS.mjs.map