Files
deepseek-harness/scripts/verify-agent-note-classification.ts
T

28 lines
987 B
TypeScript
Raw Normal View History

2026-07-19 22:50:49 +08:00
/**
2026-07-19 23:15:23 +08:00
* Enforce Agent Note lifecycle/class paths and dated filenames. Structural rules
2026-08-09 15:27:21 +08:00
* are shared with `agent-note-tree.ts`; the closed classification rules live
2026-07-19 23:15:23 +08:00
* in `.agents/notes/README.md`.
2026-07-19 22:50:49 +08:00
*/
2026-07-19 23:15:23 +08:00
import { existsSync } from 'node:fs'
2026-07-19 22:50:49 +08:00
import { resolve } from 'node:path'
2026-07-19 23:15:23 +08:00
import { walkAgentNoteTree } from './agent-note-tree.ts'
2026-07-19 22:50:49 +08:00
const { notes, errors } = walkAgentNoteTree()
// Keep the former homes unavailable so new notes cannot silently escape this tree.
for (const legacyRoot of ['docs/rfc', 'docs/rfcs']) {
if (existsSync(resolve(import.meta.dirname, '..', legacyRoot))) {
errors.push(`legacy-path: ${legacyRoot}/ is forbidden — put Agent Notes under .agents/notes/`)
}
}
if (errors.length === 0) {
2026-07-19 23:15:23 +08:00
console.log(`verify-agent-note-classification: ${notes.length} Agent Note(s) checked, structure consistent.`)
2026-07-19 22:50:49 +08:00
process.exit(0)
}
console.error('verify-agent-note-classification: violations found:')
for (const e of errors) console.error(` ${e}`)
process.exit(1)