Harden memory workflow to reduce merge conflicts

This commit is contained in:
thePR0M3TH3AN committed 2026-02-26 08:18:47 -05:00
1 parent 561bc9b4bd
commit 811f45b3af
8 files changed
+84 -10

No files matched your search

+7 -2
View File
@@ -8,10 +8,14 @@ const ROOT_DIR = path.resolve(__dirname, '../../');
const DAILY_DIR = path.join(ROOT_DIR, 'src/prompts/daily');
const WEEKLY_DIR = path.join(ROOT_DIR, 'src/prompts/weekly');
const REPORT_DIR = path.join(ROOT_DIR, 'reports/prompt-safety');
const MEMORY_DIR = path.join(ROOT_DIR, 'memory-updates');
if (!fs.existsSync(REPORT_DIR)) {
fs.mkdirSync(REPORT_DIR, { recursive: true });
}
if (!fs.existsSync(MEMORY_DIR)) {
fs.mkdirSync(MEMORY_DIR, { recursive: true });
}
const SAFETY_KEYWORDS = [
'FAILURE MODES',
@@ -96,8 +100,9 @@ function runAudit() {
memoryContent += `Flagged prompts: ${results.filter(r => r.status === 'NEEDS_REVIEW').map(r => r.filename).join(', ')}\n`;
}
fs.writeFileSync(path.join(ROOT_DIR, 'memory-update.md'), memoryContent);
console.log('Memory update written to memory-update.md');
const memoryFile = path.join(MEMORY_DIR, `${timestamp}__prompt-safety-audit-agent.md`);
fs.writeFileSync(memoryFile, memoryContent);
console.log(`Memory update written to ${memoryFile}`);
}
runAudit();
+1 -1
View File
@@ -69,7 +69,7 @@ async function main() {
const runner = resolveRunner(promptMarkdown);
// Compute a stable, per-run memory output file path so agents know where to write learnings.
// store.mjs reads this env var; if absent it falls back to the root memory-update.md placeholder.
// store.mjs reads this env var and ingests this file.
const agentName = process.env.SCHEDULER_AGENT || 'unknown-agent';
const runTs = new Date().toISOString().replace(/:/g, '-').replace(/\.\d+Z$/, 'Z');
const memoryFile = `memory-updates/${runTs}__${agentName}.md`;