name: POM
expanded_name: Produce Magnum Opus
version: 2.0.0
mission: Turn an idea into an original, validated, provenance-rich publication package on top of Oh My Pi.

principle:
  host: OMP performs models, tools, task agents, IRC, todo, sessions, approvals, compaction, memory, and TUI.
  kernel: POM governs stages, evidence, blockers, prompts, artifacts, validation, Git history, knowledge, and delivery.
  completion: A claim is earned only by deterministic checks and file-backed evidence.

entrypoints:
  extension: src/index.ts
  command: /pom
  shortcut: Alt+P
  themes: [pom-nocturne, pom-parchment]

stages:
  - {id: 0, slug: init, name: Project Initialization, profile: creative, model: pi/slow}
  - {id: 1, slug: genre, name: Genre Architecture, profile: research, model: pi/slow}
  - {id: 2, slug: voice, name: Author Persona and Voice, profile: creative, model: pi/slow}
  - {id: 3, slug: store, name: Story Store, profile: creative, model: pi/slow}
  - {id: 4, slug: bible, name: Story Blueprint and Bible, profile: creative, model: pi/slow}
  - {id: 5, slug: outline, name: Master Story Outline, profile: creative, model: pi/slow}
  - {id: 6, slug: chapters, name: Chapter Architecture, profile: creative, model: pi/slow}
  - {id: 7, slug: draft, name: Drafting and Revision, profile: draft, model: pi/default}
  - {id: 8, slug: delivery, name: Final Compilation and Delivery, profile: delivery, model: pi/slow}

stage_gate:
  requires:
    - stage is actively running
    - all earlier stages are complete
    - every acceptance criterion has at least one project-relative evidence path
    - required artifacts satisfy bytes, headings, patterns, and structure
    - no blocker remains unresolved
    - deterministic validation produced a report path
  result: PASS or BLOCKED

commands:
  dashboard: /pom
  new: /pom new <title>
  resume: /pom resume [state-path]
  run: /pom run [next|all|0..8]
  hive: /pom hive [lean|stage|audit]
  swarm: /pom swarm [parallel|sequential|pipeline] [count]
  evidence: /pom evidence
  check: /pom check [quick|stage|canon|continuity|knowledge|files|delivery|all]
  vault: /pom vault
  export: /pom export [checkpoint|final]
  prompt: /pom prompt [list|show|run] [id]
  tools: /pom tools [show|reset|profile <name>]
  theme: /pom theme install
  status: /pom status [--json]
  help: /pom help
  settings: /pom settings
  doctor: /pom doctor

pom_tools:
  pom_state: canonical state and decisions
  pom_stage: authoritative transitions, evidence, blockers, and pass
  pom_artifact: secure measurement, hash, metadata, and semantic version
  pom_validate: deterministic scoped assurance
  pom_prompt: prompt inventory, overrides, and provenance
  pom_hive: native task plan, IRC signal ledger, and synthesis
  pom_export: fresh archive plus full member verification

delegation:
  rapid_hive:
    executor: native OMP task
    coordination: native OMP IRC
    signals: [CLAIM, QUERY, ANSWER, ALERT, HANDOFF, DONE]
    rule: one bounded batch per independent wave; durable findings go to files or ledgers
  unattended:
    executor: optional OMP Swarm extension
    modes: [parallel, sequential, pipeline]
    topology: specialist fan-out followed by integrator fan-in

terminal:
  status: stage, progress, evidence/blockers, Hive, approval, retry
  widget:
    cinematic: three-line HUD with stage track and coordination cue
    rich: two-line evidence HUD
    compact: one-line HUD
    minimal: disabled; status plus critical cards
  motion: [off, subtle, full]
  cards: [event, validation, hive, milestone]
  overlay: [run, hive, validate, evidence, vault, export, theme, settings]
  law: Reward verified progress, not activity.

knowledge:
  canonical_root: project filesystem
  session_state: OMP append-only custom entries
  vault: Obsidian-flavoured Markdown compatible with Quartz 5
  prompt_precedence:
    - immutable POM production law (prepended by composePromptStack)
    - selected personality fragment (personality-${mode})
    - requested bundled fragments in order
    - project-local fragments replacing bundled by ID (src/prompts.ts:43-49)
    - executable stage contract appended by renderStagePrompt (src/prompts.ts:83-117)
  provenance: SHA-256 per active prompt fragment

integrity:
  paths: canonical realpath containment with symlink escape rejection
  writes: unique atomic temp file then rename; serialized in-process mutation
  manifest: preserve category, stage, version, status, bytes, SHA-256, rights, source, and notes
  zip: central directory, safe names, methods, duplicate detection, decompression, sizes, CRC-32, archive SHA-256
  command_policy: block destructive recursive operations against canonical project root by default

resources:
  agents: 14
  prompts: 13
  rules: 3
  themes: 2
  tests: 9

release:
  required:
    - npm run verify
    - npm run doctor in a Bun + OMP host
    - interactive command-center and stage smoke test
  known_boundary: Build environment may verify package code without providing the live OMP executable.
