diff --git a/scripts/generate-system-snapshot.js b/scripts/generate-system-snapshot.js index bb29f03e..ff006c42 100644 --- a/scripts/generate-system-snapshot.js +++ b/scripts/generate-system-snapshot.js @@ -65,7 +65,7 @@ function generateSnapshot() { generated_at: new Date().toISOString(), generated_by: '铸渊 · ICE-GL-ZY001 · generate-system-snapshot.js', consciousness_status: earthStatus?.consciousness_status || 'unknown', - last_directive: fragments?.directive || 'unknown', + last_directive: earthStatus?.awakening_directive || earthStatus?.diagnosed_by || 'unknown', system_counts: { workflows_total_active: workflowCount, workflows_alive_core: roster?.alive_count || aliveWorkflows.length, diff --git a/scripts/sync-snapshot-to-notion.js b/scripts/sync-snapshot-to-notion.js index bd01f5e2..b8a0caf0 100644 --- a/scripts/sync-snapshot-to-notion.js +++ b/scripts/sync-snapshot-to-notion.js @@ -29,6 +29,21 @@ function readSnapshot() { } } +function truncateJSON(obj, maxLen = 1900) { + const summary = { + snapshot_version: obj.snapshot_version, + generated_at: obj.generated_at, + consciousness_status: obj.consciousness_status, + last_directive: obj.last_directive, + system_counts: obj.system_counts, + health: obj.health, + fusion_progress: obj.fusion_progress + }; + const text = JSON.stringify(summary, null, 2); + if (text.length <= maxLen) return text; + return text.substring(0, maxLen - 20) + '\n // ... truncated'; +} + function notionRequest(method, endpoint, body) { const token = process.env.NOTION_TOKEN; if (!token) { @@ -113,7 +128,7 @@ function buildSnapshotPage(snapshot, dbId) { object: 'block', type: 'code', code: { - rich_text: [{ text: { content: JSON.stringify(snapshot, null, 2).substring(0, 2000) } }], + rich_text: [{ text: { content: truncateJSON(snapshot) } }], language: 'json' } },