Exporter

pi-cyberneticsourcetypescript
Path: pi-cybernetic/src/enforcement/exporter.tsRelative: src/enforcement/exporter.tsSubproject: pi-cyberneticCategory: cybernetic-core
Lines: 108Bytes: 3,453Imports: 4Exports: 5

Content Preview

  1. /**
  2. * exporter.ts — emits enforcement artifacts to a file-based queue.
  3. *
  4. * Callable from MetaEngine.consolidateLesson() when a validated lesson is
  5. * promoted to skill. Writes one JSON file per artifact to the pending/
  6. * directory, with atomic write (tmp + rename).
  7. *
  8. * Idempotent: same lessonId already present in pending/ or applied/ → skip.
  9. * No LLM calls: mapping is deterministic via classifySkill().
  10. */
  11. import {
  12. existsSync,
  13. mkdirSync,
  14. renameSync,
  15. writeFileSync,
  16. readdirSync,