2sagaco48 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/diagnostics.mjs +141 -0
  2. package/dist/compute.worker-j5ahIpF-.js +1 -0
  3. package/dist/graph.worker-DG6iGCB9.js +1 -0
  4. package/dist/index.html +2314 -0
  5. package/flatten-guide.md +248 -0
  6. package/index.html +12 -0
  7. package/package.json +38 -0
  8. package/src/App.orig.tsx +204 -0
  9. package/src/App.orig1.tsx +27 -0
  10. package/src/App.orig2.tsx +25 -0
  11. package/src/App.tsx +3 -0
  12. package/src/BaseApp.tsx +18 -0
  13. package/src/INTEGRATION_LEDGER.md +22 -0
  14. package/src/PERSIST_CANARY.orig.txt +1 -0
  15. package/src/PERSIST_CANARY.txt +1 -0
  16. package/src/REGRESSION_LEDGER.md +651 -0
  17. package/src/TEMPLATE_PIPELINE_AUDIT.md +208 -0
  18. package/src/WILLIAMS_PERSONA_GUIDE.md +62 -0
  19. package/src/chat/VeritasChat.tsx +69 -0
  20. package/src/chat/synthesis.ts +31 -0
  21. package/src/chat/tier.ts +45 -0
  22. package/src/components/AdaptersPage.orig.tsx +99 -0
  23. package/src/components/AdaptersPage.tsx +3 -0
  24. package/src/components/AdversarialPanel.tsx +136 -0
  25. package/src/components/AnchorBaselinePanel.tsx +75 -0
  26. package/src/components/AnswerPanel.tsx +60 -0
  27. package/src/components/ArtifactPanel.tsx +43 -0
  28. package/src/components/ChatApp.orig.tsx +1582 -0
  29. package/src/components/ChatApp.orig1.tsx +722 -0
  30. package/src/components/ChatApp.tsx +95 -0
  31. package/src/components/ChatAugmentPanels.tsx +73 -0
  32. package/src/components/CitationLedgerPanel.tsx +313 -0
  33. package/src/components/ComputeSandboxPanel.tsx +130 -0
  34. package/src/components/ConfigPanel.tsx +110 -0
  35. package/src/components/ControlPlanePage.tsx +195 -0
  36. package/src/components/CreativeTreeLifePage.tsx +234 -0
  37. package/src/components/CreativeTreeOfLifePanel.tsx +149 -0
  38. package/src/components/DebugTracePanel.tsx +137 -0
  39. package/src/components/DeepReasoningTrace.tsx +48 -0
  40. package/src/components/EntitySheetPanel.tsx +51 -0
  41. package/src/components/FailureModesPanel.tsx +104 -0
  42. package/src/components/GBSDashboard.tsx +239 -0
  43. package/src/components/GraphView.tsx +116 -0
  44. package/src/components/HUD.tsx +125 -0
  45. package/src/components/HypothesisPanel.tsx +67 -0
  46. package/src/components/InnovationGenomeEngine.tsx +792 -0
  47. package/src/components/InnovationPersonaGuide.tsx +348 -0
  48. package/src/components/InnovationPersonaPanel.tsx +289 -0
  49. package/src/components/LiveResourceHUD.tsx +109 -0
  50. package/src/components/LongWriterPanel.tsx +112 -0
  51. package/src/components/MainPipelineV10Bridge.tsx +72 -0
  52. package/src/components/MarkdownLite.tsx +63 -0
  53. package/src/components/MemoryInspector.tsx +38 -0
  54. package/src/components/MemoryMonitor.tsx +52 -0
  55. package/src/components/MemoryStressPanel.tsx +176 -0
  56. package/src/components/ModulesPage.tsx +171 -0
  57. package/src/components/PipelineDebugConsole.orig.tsx +1856 -0
  58. package/src/components/PipelineDebugConsole.tsx +3 -0
  59. package/src/components/PreFlightHUD.tsx +67 -0
  60. package/src/components/PrismaFetchTracePanel.tsx +87 -0
  61. package/src/components/ReportOSPanel.tsx +165 -0
  62. package/src/components/ResourceEstimatorPage.tsx +327 -0
  63. package/src/components/RichText.tsx +181 -0
  64. package/src/components/SagaOsPanel.tsx +605 -0
  65. package/src/components/SagaOsReference.tsx +421 -0
  66. package/src/components/SagaOsV2Panel.tsx +594 -0
  67. package/src/components/SagaStyleTab.tsx +382 -0
  68. package/src/components/SageBlueprintPanel.tsx +416 -0
  69. package/src/components/SharedChatInput.tsx +77 -0
  70. package/src/components/StatFinancePanel.tsx +190 -0
  71. package/src/components/StylePersonaPanel.tsx +128 -0
  72. package/src/components/TemplatesPage.tsx +300 -0
  73. package/src/components/TestPanel.tsx +63 -0
  74. package/src/components/TraceLog.tsx +89 -0
  75. package/src/components/V15CalibrationAugment.tsx +1134 -0
  76. package/src/components/V15CalibrationDialog.tsx +1871 -0
  77. package/src/components/V15Overlay.orig.tsx +120 -0
  78. package/src/components/V15Overlay.tsx +4 -0
  79. package/src/components/V15OverlayWrapper.tsx +362 -0
  80. package/src/components/V15Toggle.tsx +34 -0
  81. package/src/console/DiagnosticRecoveryPanel.tsx +358 -0
  82. package/src/console/EngineeringConsole.tsx +103 -0
  83. package/src/console/FictionSystemPanels.tsx +882 -0
  84. package/src/console/InspectorPanels.tsx +254 -0
  85. package/src/console/ManuscriptGraderPanel.tsx +182 -0
  86. package/src/console/RecursiveReviserPanel.tsx +245 -0
  87. package/src/console/SeedControlPanel.tsx +135 -0
  88. package/src/console/StoryControllerPanel.tsx +443 -0
  89. package/src/console/engineBridge.ts +258 -0
  90. package/src/console/gemini.ts +106 -0
  91. package/src/console/grading.ts +250 -0
  92. package/src/console/util.ts +45 -0
  93. package/src/fiction/continuity.ts +372 -0
  94. package/src/fiction/crash-protection.ts +111 -0
  95. package/src/fiction/diagnostics.ts +208 -0
  96. package/src/fiction/diff.ts +74 -0
  97. package/src/fiction/entity-state-machine.ts +214 -0
  98. package/src/fiction/nive-engine.ts +404 -0
  99. package/src/fiction/pipeline-selftest.ts +132 -0
  100. package/src/fiction/seed-control.ts +193 -0
  101. package/src/fiction/story-engine.ts +326 -0
  102. package/src/fiction/types.ts +68 -0
  103. package/src/flatten-guide.md +379 -0
  104. package/src/index.css +14 -0
  105. package/src/index.orig.css +13 -0
  106. package/src/lib/academic-sources.base.ts +188 -0
  107. package/src/lib/academic-sources.orig.ts +28 -0
  108. package/src/lib/academic-sources.ts +10 -0
  109. package/src/lib/advanced-math.ts +119 -0
  110. package/src/lib/adversarial-engine.base.ts +409 -0
  111. package/src/lib/adversarial-engine.ts +82 -0
  112. package/src/lib/ai-revision.ts +623 -0
  113. package/src/lib/app-state.tsx +426 -0
  114. package/src/lib/artifact-registry.ts +97 -0
  115. package/src/lib/artifacts.ts +180 -0
  116. package/src/lib/atlas-dr.ts +167 -0
  117. package/src/lib/browser-mtls.ts +127 -0
  118. package/src/lib/browser-queue.ts +221 -0
  119. package/src/lib/browser-search-scraper.base.ts +382 -0
  120. package/src/lib/browser-search-scraper.orig.ts +90 -0
  121. package/src/lib/browser-search-scraper.ts +10 -0
  122. package/src/lib/calc-interceptor.ts +82 -0
  123. package/src/lib/citation-lane-tap.ts +78 -0
  124. package/src/lib/citation-ledger-store.ts +369 -0
  125. package/src/lib/citation-ledger.ts +203 -0
  126. package/src/lib/compute-sandbox.ts +215 -0
  127. package/src/lib/compute.worker.ts +153 -0
  128. package/src/lib/connectors/gemini.ts +120 -0
  129. package/src/lib/connectors/jina.ts +233 -0
  130. package/src/lib/connectors/marketdata.ts +51 -0
  131. package/src/lib/connectors/prismafetch.base.ts +175 -0
  132. package/src/lib/connectors/prismafetch.ts +1 -0
  133. package/src/lib/connectors/serpapi.ts +65 -0
  134. package/src/lib/connectors/wikidata.ts +44 -0
  135. package/src/lib/constraints.ts +331 -0
  136. package/src/lib/continuation-detector.base.ts +153 -0
  137. package/src/lib/continuation-detector.ts +48 -0
  138. package/src/lib/contradraft.ts +168 -0
  139. package/src/lib/cors-proxy.ts +120 -0
  140. package/src/lib/coverage.ts +81 -0
  141. package/src/lib/debug/architecture-prescription.ts +556 -0
  142. package/src/lib/debug/covea-repair.ts +543 -0
  143. package/src/lib/debug/helios-ground.ts +319 -0
  144. package/src/lib/debug/intent-decomposer.ts +281 -0
  145. package/src/lib/debug/intent-lattice.ts +349 -0
  146. package/src/lib/debug/pipeline-diagnosis.ts +1149 -0
  147. package/src/lib/debug/pipeline-trace-bus.ts +424 -0
  148. package/src/lib/debug/prompt-forge.ts +678 -0
  149. package/src/lib/debug/repair-sites.ts +513 -0
  150. package/src/lib/debug/research-phase.ts +266 -0
  151. package/src/lib/debug/retrieval-context.ts +76 -0
  152. package/src/lib/debug/retrieval-hardener.ts +142 -0
  153. package/src/lib/debug/scraper-debug-runner.ts +576 -0
  154. package/src/lib/debug/scraper-forensics.ts +418 -0
  155. package/src/lib/debug/scraper-lane-roadmap.ts +136 -0
  156. package/src/lib/debug/self-test.ts +415 -0
  157. package/src/lib/debug/step-attribution.ts +211 -0
  158. package/src/lib/debug/template-rubric.ts +301 -0
  159. package/src/lib/debug/unified-innovation.ts +126 -0
  160. package/src/lib/debug/veritas-hybrid-scraper.ts +335 -0
  161. package/src/lib/defense-registry.ts +104 -0
  162. package/src/lib/defenses.ts +162 -0
  163. package/src/lib/deterministic-citation-ledger.ts +174 -0
  164. package/src/lib/elo-registry.base.ts +117 -0
  165. package/src/lib/elo-registry.ts +1 -0
  166. package/src/lib/entity-resolver.ts +291 -0
  167. package/src/lib/failure-modes.ts +267 -0
  168. package/src/lib/feature-registry.ts +69 -0
  169. package/src/lib/flaw-registry.ts +143 -0
  170. package/src/lib/flaws/_template.ts +52 -0
  171. package/src/lib/flaws/builtins.ts +63 -0
  172. package/src/lib/flaws/finance.ts +169 -0
  173. package/src/lib/flaws/fixers.ts +10 -0
  174. package/src/lib/flaws/index.ts +32 -0
  175. package/src/lib/flaws/legal.ts +157 -0
  176. package/src/lib/flaws/medical.ts +188 -0
  177. package/src/lib/flaws/original-defenses-pack.ts +81 -0
  178. package/src/lib/flaws/sample-declarative-pack.json +38 -0
  179. package/src/lib/flaws/selftest.ts +201 -0
  180. package/src/lib/flaws/software-extended.ts +125 -0
  181. package/src/lib/flaws/software-rn-webgl.ts +182 -0
  182. package/src/lib/flaws/statistics-advanced.ts +46 -0
  183. package/src/lib/flaws/statistics.ts +61 -0
  184. package/src/lib/gbse/config.ts +20 -0
  185. package/src/lib/gbse/engine.ts +226 -0
  186. package/src/lib/gbse/graph.ts +118 -0
  187. package/src/lib/gbse/graph.worker.ts +21 -0
  188. package/src/lib/gbse/tests.ts +117 -0
  189. package/src/lib/gbse/tiers.ts +65 -0
  190. package/src/lib/gbse/types.ts +94 -0
  191. package/src/lib/innovation-genome-engine-v2.orig.ts +1001 -0
  192. package/src/lib/innovation-genome-engine-v2.ts +3 -0
  193. package/src/lib/innovation-genome-engine.orig.ts +330 -0
  194. package/src/lib/innovation-genome-engine.ts +3 -0
  195. package/src/lib/innovation-genome-v10.orig.ts +314 -0
  196. package/src/lib/innovation-genome-v10.ts +2 -0
  197. package/src/lib/innovation-genome-v3.orig.ts +2015 -0
  198. package/src/lib/innovation-genome-v3.ts +2 -0
  199. package/src/lib/innovation-genome-v4.orig.ts +1959 -0
  200. package/src/lib/innovation-genome-v4.ts +2 -0
  201. package/src/lib/innovation-genome-v5.orig.ts +1210 -0
  202. package/src/lib/innovation-genome-v5.ts +2 -0
  203. package/src/lib/innovation-genome-v7.orig.ts +2549 -0
  204. package/src/lib/innovation-genome-v7.ts +2 -0
  205. package/src/lib/innovation-genome-v8.orig.ts +1485 -0
  206. package/src/lib/innovation-genome-v8.ts +2 -0
  207. package/src/lib/innovation-genome-v9.orig.ts +643 -0
  208. package/src/lib/innovation-genome-v9.ts +2 -0
  209. package/src/lib/jina.base.ts +293 -0
  210. package/src/lib/jina.ts +1 -0
  211. package/src/lib/live-telemetry.ts +61 -0
  212. package/src/lib/longwriter.ts +84 -0
  213. package/src/lib/manuscript-grade-v2.ts +298 -0
  214. package/src/lib/memory-governor.ts +173 -0
  215. package/src/lib/memory-stress-tests.ts +248 -0
  216. package/src/lib/model-intelligence.ts +48 -0
  217. package/src/lib/model-rotator.ts +75 -0
  218. package/src/lib/models.orig.ts +513 -0
  219. package/src/lib/models.ts +151 -0
  220. package/src/lib/n-deep.base.ts +592 -0
  221. package/src/lib/n-deep.ts +51 -0
  222. package/src/lib/nih-simulator.ts +56 -0
  223. package/src/lib/nih-vulnerability-fixes.ts +460 -0
  224. package/src/lib/omega-templates.base.ts +294 -0
  225. package/src/lib/omega-templates.ts +225 -0
  226. package/src/lib/omni-nexus.ts +64 -0
  227. package/src/lib/oracle-adapters.ts +67 -0
  228. package/src/lib/oracle-registry.ts +163 -0
  229. package/src/lib/orchestrator.ts +357 -0
  230. package/src/lib/output-boundary.ts +235 -0
  231. package/src/lib/overrides/vite-native-chaos-harness.ts +154 -0
  232. package/src/lib/overrides/vite-native-contract-plane.ts +245 -0
  233. package/src/lib/overrides/vite-native-doctor-plane.ts +208 -0
  234. package/src/lib/overrides/vite-native-knowledge-store.ts +267 -0
  235. package/src/lib/overrides/vite-native-policy-plane.ts +190 -0
  236. package/src/lib/overrides/vite-native-replay-plane.ts +197 -0
  237. package/src/lib/overrides/vite-native-runtime-plane.ts +106 -0
  238. package/src/lib/overrides/vite-native-scraper.ts +848 -0
  239. package/src/lib/overrides/vite-native-selftest-functional.ts +217 -0
  240. package/src/lib/overrides/vite-native-selftest.ts +183 -0
  241. package/src/lib/overrides/vite-native-snapshot-plane.ts +123 -0
  242. package/src/lib/philosophy-toolkit.ts +75 -0
  243. package/src/lib/pipeline.orig.ts +659 -0
  244. package/src/lib/pipeline.ts +42 -0
  245. package/src/lib/precache.ts +128 -0
  246. package/src/lib/py-sandbox.ts +205 -0
  247. package/src/lib/quality-score.ts +96 -0
  248. package/src/lib/quant-engine.ts +231 -0
  249. package/src/lib/quant-lib.ts +80 -0
  250. package/src/lib/reportos.ts +175 -0
  251. package/src/lib/research-os.ts +306 -0
  252. package/src/lib/resource-estimator.ts +114 -0
  253. package/src/lib/rpm-governor.ts +93 -0
  254. package/src/lib/runtime-estimator.ts +135 -0
  255. package/src/lib/sage/empty-space-v6.ts +560 -0
  256. package/src/lib/sage/empty-space-v7.ts +222 -0
  257. package/src/lib/sage/empty-space.ts +733 -0
  258. package/src/lib/sage/engine.ts +786 -0
  259. package/src/lib/sage/index.ts +17 -0
  260. package/src/lib/sage/judge.ts +246 -0
  261. package/src/lib/sage/prng.ts +53 -0
  262. package/src/lib/sage/reality-grounding.ts +380 -0
  263. package/src/lib/sage/repetition.ts +151 -0
  264. package/src/lib/sage/saga-os-v2-engines.ts +1870 -0
  265. package/src/lib/sage/saga-os-v2.ts +274 -0
  266. package/src/lib/sage/saga-os-v3-core.ts +1491 -0
  267. package/src/lib/sage/saga-os-v3-release.ts +739 -0
  268. package/src/lib/sage/saga-os-v4-aureate.ts +1161 -0
  269. package/src/lib/sage/saga-os-v4.ts +212 -0
  270. package/src/lib/sage/saga-os-v5.ts +205 -0
  271. package/src/lib/sage/saga-os-v6.ts +346 -0
  272. package/src/lib/sage/saga-os-v7.ts +314 -0
  273. package/src/lib/sage/saga-os-v8.ts +505 -0
  274. package/src/lib/sage/saga-os.ts +329 -0
  275. package/src/lib/sage/taxonomy.ts +403 -0
  276. package/src/lib/sage/unified-roll.ts +524 -0
  277. package/src/lib/sage/worked-sketches.ts +44 -0
  278. package/src/lib/sage.ts +166 -0
  279. package/src/lib/scraper-debug-bus.ts +53 -0
  280. package/src/lib/scraper-enhanced.orig.ts +153 -0
  281. package/src/lib/scraper-enhanced.ts +10 -0
  282. package/src/lib/scraper-hardener.base.orig.ts +155 -0
  283. package/src/lib/scraper-hardener.base.ts +317 -0
  284. package/src/lib/scraper-hardener.ts +1 -0
  285. package/src/lib/scraper-palisade/palisade-adjudicator.orig.ts +419 -0
  286. package/src/lib/scraper-palisade/palisade-adjudicator.ts +13 -0
  287. package/src/lib/scraper-vnext/arbiter-omega.orig.ts +688 -0
  288. package/src/lib/scraper-vnext/arbiter-omega.ts +13 -0
  289. package/src/lib/scraper-vnext/canonical-portfolio-augments.ts +479 -0
  290. package/src/lib/scraper-vnext/canonical-portfolio-orchestrator.orig.ts +1529 -0
  291. package/src/lib/scraper-vnext/canonical-portfolio-orchestrator.ts +13 -0
  292. package/src/lib/scraper-vnext/conclave-omega.ts +1830 -0
  293. package/src/lib/scraper-vnext/content-extractor-v2.ts +226 -0
  294. package/src/lib/scraper-vnext/diagnostics-suite.ts +36 -0
  295. package/src/lib/scraper-vnext/epistemic-packer.ts +97 -0
  296. package/src/lib/scraper-vnext/fusion-v2.ts +65 -0
  297. package/src/lib/scraper-vnext/hydra-reader.orig.ts +1216 -0
  298. package/src/lib/scraper-vnext/hydra-reader.ts +13 -0
  299. package/src/lib/scraper-vnext/native-scraper-browser-vnext.orig.ts +91 -0
  300. package/src/lib/scraper-vnext/native-scraper-browser-vnext.ts +13 -0
  301. package/src/lib/scraper-vnext/nexus-consensus.orig.ts +905 -0
  302. package/src/lib/scraper-vnext/nexus-consensus.ts +13 -0
  303. package/src/lib/scraper-vnext/portfolio-consensus-adjudicator.ts +804 -0
  304. package/src/lib/scraper-vnext/portfolio-consensus-memory.ts +377 -0
  305. package/src/lib/scraper-vnext/portfolio-terminal-governor.ts +548 -0
  306. package/src/lib/scraper-vnext/query-strategist.orig.ts +224 -0
  307. package/src/lib/scraper-vnext/query-strategist.ts +423 -0
  308. package/src/lib/scraper-vnext/retrieval-accelerator.ts +708 -0
  309. package/src/lib/scraper-vnext/retrieval-audit-augments.ts +477 -0
  310. package/src/lib/scraper-vnext/retrieval-control-plane.ts +904 -0
  311. package/src/lib/scraper-vnext/retrieval-policy-augments.ts +358 -0
  312. package/src/lib/scraper-vnext/safe-fetch-v2.ts +157 -0
  313. package/src/lib/scraper-vnext/sentinel-omega.ts +56 -0
  314. package/src/lib/scraper-vnext/sentinel-orchestrator.ts +69 -0
  315. package/src/lib/scraper-vnext/sibyl-oracle.orig.ts +413 -0
  316. package/src/lib/scraper-vnext/sibyl-oracle.ts +13 -0
  317. package/src/lib/scraper-vnext/smart-read-v2.ts +55 -0
  318. package/src/lib/scraper-vnext/spa-rescue-bridge.ts +608 -0
  319. package/src/lib/scraper-vnext/strata-engine.orig.ts +2666 -0
  320. package/src/lib/scraper-vnext/strata-engine.ts +13 -0
  321. package/src/lib/scraper-vnext/structured-source-adapter.orig.ts +369 -0
  322. package/src/lib/scraper-vnext/structured-source-adapter.ts +34 -0
  323. package/src/lib/scraper-vnext/terminal-complete.ts +224 -0
  324. package/src/lib/scraper-vnext/terminal-final.ts +277 -0
  325. package/src/lib/scraper-vnext/terminal-saturation.ts +345 -0
  326. package/src/lib/scraper-vnext/terminal-wire.ts +425 -0
  327. package/src/lib/scraper-vnext/vanguard-titanium.orig.ts +467 -0
  328. package/src/lib/scraper-vnext/vanguard-titanium.ts +17 -0
  329. package/src/lib/search-cache.ts +138 -0
  330. package/src/lib/sloop-runner.base.ts +223 -0
  331. package/src/lib/sloop-runner.ts +104 -0
  332. package/src/lib/sloop.ts +114 -0
  333. package/src/lib/small-model-adapters.ts +82 -0
  334. package/src/lib/sscp.ts +86 -0
  335. package/src/lib/system-map.ts +54 -0
  336. package/src/lib/uni-node.ts +86 -0
  337. package/src/lib/universal-rigor-guard.ts +433 -0
  338. package/src/lib/v15-gate-testbed.ts +274 -0
  339. package/src/lib/v15-gemini.base.ts +89 -0
  340. package/src/lib/v15-gemini.ts +1 -0
  341. package/src/lib/v15-grounding.orig.ts +241 -0
  342. package/src/lib/v15-grounding.ts +79 -0
  343. package/src/lib/v15-pipeline.base.ts +769 -0
  344. package/src/lib/v15-pipeline.orig.ts +1154 -0
  345. package/src/lib/v15-pipeline.ts +674 -0
  346. package/src/lib/v15-questions.ts +64 -0
  347. package/src/lib/v15-rate-limiter.orig.ts +91 -0
  348. package/src/lib/v15-rate-limiter.ts +48 -0
  349. package/src/lib/v15-state.base.ts +87 -0
  350. package/src/lib/v15-state.ts +28 -0
  351. package/src/lib/visual-table-generator.tsx +207 -0
  352. package/src/lib/wasm-runtime.ts +133 -0
  353. package/src/lib/williams-persona-guide.ts +265 -0
  354. package/src/lib/williams-style.base.ts +464 -0
  355. package/src/lib/williams-style.ts +59 -0
  356. package/src/lib/worker-pool.ts +96 -0
  357. package/src/lib/writing-tiers.ts +125 -0
  358. package/src/main.orig.tsx +10 -0
  359. package/src/main.tsx +10 -0
  360. package/src/utils/cn.orig.ts +6 -0
  361. package/src/utils/cn.ts +6 -0
  362. package/src/vite-env.d.ts +1 -0
  363. package/tsconfig.json +31 -0
  364. package/unify.mjs +537 -0
  365. package/vite.config.ts +18 -0
@@ -0,0 +1,403 @@
1
+ /**
2
+ * SAGE Taxonomy — complete narrative-element catalog from the
3
+ * "Comprehensive Taxonomy of Narrative Elements Across World Fiction"
4
+ * specification. Every numbered row is present. Earliest-surviving-
5
+ * attestation claims are stored as strings (scholarly ranges, not proofs).
6
+ *
7
+ * HONESTY: this is a taxonomy of attested forms, not an exhaustive census
8
+ * of world fiction. ATU/Thompson remain the research-grade catalogs.
9
+ */
10
+
11
+ export type Taxon = {
12
+ id: string;
13
+ name: string;
14
+ attestation: string;
15
+ function: string;
16
+ };
17
+
18
+ // ── PART I — Macro story structures (30) ────────────────────────────────────
19
+ export const MACRO_STRUCTURES: readonly Taxon[] = [
20
+ { id: "M01", name: "The Monomyth / Hero's Journey", attestation: "Epic of Gilgamesh (~2100–1800 BCE)", function: "Maps external quest onto internal transformation; return forces communal meaning" },
21
+ { id: "M02", name: "Tragic arc", attestation: "Oedipus Rex (~429 BCE)", function: "Rise → hamartia → peripeteia → fall → catharsis; fate and character fuse" },
22
+ { id: "M03", name: "Comic arc", attestation: "Aristophanes Acharnians (425 BCE); Menander", function: "Disorder → confusion → reintegration ending in union/feast" },
23
+ { id: "M04", name: "Three-act structure", attestation: "Aristotle Poetics (~335 BCE)", function: "Causal inevitability; each act boundary closes a door behind the protagonist" },
24
+ { id: "M05", name: "Five-act structure", attestation: "Horace Ars Poetica (~19 BCE); Freytag 1863", function: "Explicit rising action / climax / falling action breathing architecture" },
25
+ { id: "M06", name: "Kishōtenketsu", attestation: "Chinese jueju → East Asian prose (Tang ~7th–9th c. CE)", function: "Plot without central conflict; twist recontextualizes rather than opposes" },
26
+ { id: "M07", name: "In medias res", attestation: "Iliad (~8th c. BCE)", function: "Front-loads momentum; converts backstory into revelation" },
27
+ { id: "M08", name: "Frame narrative", attestation: "Westcar Papyrus (~1700 BCE); Shipwrecked Sailor (~2000 BCE)", function: "Narrative relativity; unreliable transmission; thematic mirroring" },
28
+ { id: "M09", name: "Nested/recursive frames", attestation: "Panchatantra; One Thousand and One Nights (~9th c. CE)", function: "Storytelling as survival mechanism; fractal thematic echo" },
29
+ { id: "M10", name: "Ring composition / chiasmus", attestation: "Gilgamesh; Homer; Hebrew Bible", function: "Ending mirrors beginning with transformation visible in differences" },
30
+ { id: "M11", name: "Episodic / picaresque", attestation: "Satyricon (~60 CE); Golden Ass (~160 CE); Lazarillo (1554)", function: "Social panorama; the world changes, not the hero" },
31
+ { id: "M12", name: "Epistolary structure", attestation: "Ovid Heroides; Pamela (1740)", function: "Eliminates narrator; biased delayed performative information" },
32
+ { id: "M13", name: "Nonlinear chronology / analepsis-heavy", attestation: "Odyssey Books 9–12", function: "Sequences information for meaning rather than time" },
33
+ { id: "M14", name: "Reverse chronology", attestation: "Merrily We Roll Along (1934); Betrayal (1978)", function: "Replaces what-next with how-did-this; dramatic irony" },
34
+ { id: "M15", name: "Multi-perspective / Rashomon", attestation: "The Ring and the Book (1868–69); In a Grove (1922)", function: "Truth itself is the antagonist; reader authors the verdict" },
35
+ { id: "M16", name: "Braided / parallel plotlines", attestation: "Mahabharata; Shakespeare double plots", function: "Themes rhyme across strands; mutual commentary" },
36
+ { id: "M17", name: "Anthology-with-armature", attestation: "Panchatantra; Decameron (1353); Canterbury Tales (~1400)", function: "Diversity of voice inside unity of occasion" },
37
+ { id: "M18", name: "Quest structure", attestation: "Gilgamesh's quest for immortality (~1800 BCE)", function: "Externalizes internal lack as findable object" },
38
+ { id: "M19", name: "Voyage and return", attestation: "Tale of the Shipwrecked Sailor (~2000 BCE)", function: "Other world tests traveler; home legible only after departure" },
39
+ { id: "M20", name: "Overcoming the monster", attestation: "Gilgamesh vs. Humbaba (~2100 BCE)", function: "Community-scale fear condensed into a killable body" },
40
+ { id: "M21", name: "Rags to riches", attestation: "Rhodopis / Cinderella variant (Strabo ~1st c. BCE); Joseph", function: "Justice as eventual recognition of hidden worth" },
41
+ { id: "M22", name: "Rebirth structure", attestation: "Descent of Inanna (~1900–1600 BCE)", function: "Change arrives from outside; grace as moral physics" },
42
+ { id: "M23", name: "Tragedy of overreach (Icarus/Faust)", attestation: "Etana (~2000 BCE); Icarus/Phaethon", function: "Aspiration itself becomes hamartia" },
43
+ { id: "M24", name: "Metafictional structure", attestation: "Don Quixote Part II (1615); Tristram Shandy (1759)", function: "Collapses story-world and reader-world wall" },
44
+ { id: "M25", name: "Stream-of-consciousness architecture", attestation: "Dujardin 1887; Ulysses 1922", function: "Replaces plot-time with mind-time" },
45
+ { id: "M26", name: "Circular narrative", attestation: "Finnegans Wake (1939)", function: "Ending feeds beginning; theme becomes recurrence" },
46
+ { id: "M27", name: "Time-loop structure", attestation: "Ivan Osokin (1915); Doubled and Redoubled (1941)", function: "Iteration replaces journey; character change is the only variable" },
47
+ { id: "M28", name: "Branching/interactive structure", attestation: "Consider the Consequences! (1930); CYOA (1979)", function: "Transfers authorship of sequence to the reader" },
48
+ { id: "M29", name: "Psychological-interiority novel", attestation: "The Tale of Genji (~1010 CE)", function: "Plot subordinated to inner life; mono no aware structural" },
49
+ { id: "M30", name: "The dream-vision", attestation: "Dream of Scipio (~54 BCE); Roman de la Rose (~1230)", function: "Licenses allegory and impossible geography under realistic frame" },
50
+ ] as const;
51
+
52
+ export const META_FRAMEWORKS: readonly string[] = [
53
+ "Aristotle Poetics",
54
+ "Polti 36 Dramatic Situations (1895)",
55
+ "Propp Morphology of the Folktale (1928)",
56
+ "Frye four mythoi (1957)",
57
+ "Campbell monomyth (1949)",
58
+ "Booker Seven Basic Plots (2004)",
59
+ "Tobias 20 Master Plots",
60
+ "ATU tale-type index (~2,400 types)",
61
+ "Thompson Motif-Index (~46,000 motifs)",
62
+ ] as const;
63
+
64
+ // ── PART II-A — Campbell monomyth beats (12) ────────────────────────────────
65
+ export const CAMPBELL_BEATS: readonly Taxon[] = [
66
+ { id: "C01", name: "Call to adventure", attestation: "Gilgamesh hears of Humbaba", function: "Disturbs equilibrium; poses the dramatic question" },
67
+ { id: "C02", name: "Refusal of the call", attestation: "Moses; Achilles in his tent", function: "Establishes stakes and cost of change" },
68
+ { id: "C03", name: "Supernatural aid / mentor meeting", attestation: "Shamash; Athena", function: "Externalizes the hero's latent competence" },
69
+ { id: "C04", name: "Crossing the first threshold", attestation: "Gilgamesh leaves Uruk's walls", function: "Point of no return; genre contract activates" },
70
+ { id: "C05", name: "Belly of the whale", attestation: "Jonah; Inanna descent", function: "Symbolic death/gestation; old self digested" },
71
+ { id: "C06", name: "Road of trials", attestation: "Odysseus' island sequence", function: "Escalating competence test; episodic engine" },
72
+ { id: "C07", name: "Meeting with the goddess / sacred marriage", attestation: "Dumuzi-Inanna courtship", function: "Integration of the anima/other" },
73
+ { id: "C08", name: "Temptation from the path", attestation: "Circe; Lotus-Eaters", function: "Tests desire vs. duty" },
74
+ { id: "C09", name: "Atonement with the father", attestation: "Utnapishtim; Telemachus/Odysseus", function: "Confrontation with origin and authority" },
75
+ { id: "C10", name: "Apotheosis / ultimate boon", attestation: "Flood secret; plant of youth", function: "Quest object materializes the theme" },
76
+ { id: "C11", name: "Refusal of return / magic flight", attestation: "Serpent steals the plant", function: "Denies clean victory; forces wisdom over prize" },
77
+ { id: "C12", name: "Master of two worlds / freedom to live", attestation: "Gilgamesh reads the walls of Uruk", function: "Journey's value is testimony, not treasure" },
78
+ ] as const;
79
+
80
+ // ── PART II-B — Propp's 31 functions ────────────────────────────────────────
81
+ export const PROPP_FUNCTIONS: readonly { id: string; name: string }[] = [
82
+ { id: "P01", name: "Absentation" },
83
+ { id: "P02", name: "Interdiction" },
84
+ { id: "P03", name: "Violation" },
85
+ { id: "P04", name: "Reconnaissance" },
86
+ { id: "P05", name: "Delivery" },
87
+ { id: "P06", name: "Trickery" },
88
+ { id: "P07", name: "Complicity" },
89
+ { id: "P08", name: "Villainy / Lack" },
90
+ { id: "P09", name: "Mediation" },
91
+ { id: "P10", name: "Counteraction" },
92
+ { id: "P11", name: "Departure" },
93
+ { id: "P12", name: "Donor's test" },
94
+ { id: "P13", name: "Hero's reaction" },
95
+ { id: "P14", name: "Receipt of magical agent" },
96
+ { id: "P15", name: "Guidance" },
97
+ { id: "P16", name: "Struggle" },
98
+ { id: "P17", name: "Branding" },
99
+ { id: "P18", name: "Victory" },
100
+ { id: "P19", name: "Liquidation of lack" },
101
+ { id: "P20", name: "Return" },
102
+ { id: "P21", name: "Pursuit" },
103
+ { id: "P22", name: "Rescue" },
104
+ { id: "P23", name: "Unrecognized arrival" },
105
+ { id: "P24", name: "Unfounded claims (false hero)" },
106
+ { id: "P25", name: "Difficult task" },
107
+ { id: "P26", name: "Solution" },
108
+ { id: "P27", name: "Recognition" },
109
+ { id: "P28", name: "Exposure" },
110
+ { id: "P29", name: "Transfiguration" },
111
+ { id: "P30", name: "Punishment" },
112
+ { id: "P31", name: "Wedding" },
113
+ ] as const;
114
+
115
+ // ── PART II-C — Other micro-units (15) ──────────────────────────────────────
116
+ export const MICRO_UNITS: readonly Taxon[] = [
117
+ { id: "U01", name: "Anagnorisis (recognition scene)", attestation: "Odysseus' scar / Eurycleia", function: "Identity revelation as emotional detonation" },
118
+ { id: "U02", name: "Peripeteia (reversal)", attestation: "Oedipus Rex messenger", function: "Fuses revelation with reversal for maximum catharsis" },
119
+ { id: "U03", name: "Deus ex machina", attestation: "Euripides Medea (431 BCE)", function: "Resolution by external power; now mostly ironic" },
120
+ { id: "U04", name: "Cliffhanger", attestation: "Scheherazade; Hardy 1873 term", function: "Weaponizes incompleteness; curiosity as hostage" },
121
+ { id: "U05", name: "Ticking clock", attestation: "Cinderella midnight (Perrault 1697; motif older)", function: "Converts time into antagonist" },
122
+ { id: "U06", name: "Dark night of the soul / all-is-lost", attestation: "Gilgamesh grief-wandering after Enkidu", function: "Strips false solutions so the true one can be earned" },
123
+ { id: "U07", name: "False victory / false defeat (midpoint)", attestation: "Greek tragedy; modern screenwriting", function: "Prevents monotonic tension; recalibrates the goal" },
124
+ { id: "U08", name: "The mentor's death", attestation: "Enkidu's death (~1800 BCE)", function: "Transfers responsibility; grief as fuel" },
125
+ { id: "U09", name: "The sacrificial death", attestation: "Alcestis (438 BCE); Sydney Carton", function: "Converts love into plot causality" },
126
+ { id: "U10", name: "Meet-cute / lovers' first encounter", attestation: "Greek romance; Callirhoe (~1st c. CE)", function: "Compresses fate into a single charged scene" },
127
+ { id: "U11", name: "Agon (formal debate scene)", attestation: "Aristophanic comedy; Job", function: "Theme argued openly through opposed voices" },
128
+ { id: "U12", name: "Threshold-guardian encounter", attestation: "Humbaba; scorpion-men of Mashu", function: "Prices admission to the special world" },
129
+ { id: "U13", name: "Catalog / muster", attestation: "Homer Catalog of Ships", function: "Scale, stakes, and communal memory in list form" },
130
+ { id: "U14", name: "Prophecy scene", attestation: "Delphic oracle; Gilgamesh dreams", function: "Installs dramatic irony; makes fate a character" },
131
+ { id: "U15", name: "Recognition token", attestation: "Odysseus' scar; Sakuntala's ring", function: "Physical object carries identity across time" },
132
+ ] as const;
133
+
134
+ // ── PART III — Setting archetypes (32) ──────────────────────────────────────
135
+ export const SETTINGS: readonly Taxon[] = [
136
+ { id: "S01", name: "Primordial garden / paradise", attestation: "Dilmun; Eden", function: "Baseline of innocence whose loss creates story-time" },
137
+ { id: "S02", name: "The underworld", attestation: "Descent of Inanna", function: "Death made traversable; grief given geography" },
138
+ { id: "S03", name: "Dark forest / wilderness", attestation: "Cedar Forest (Gilgamesh)", function: "Externalized unconscious; law's absence" },
139
+ { id: "S04", name: "The sea", attestation: "Shipwrecked Sailor", function: "Chaos, fate, and providence as environment" },
140
+ { id: "S05", name: "The island", attestation: "Shipwrecked Sailor serpent island", function: "Isolated moral laboratory; world-in-miniature" },
141
+ { id: "S06", name: "The city", attestation: "Uruk's walls", function: "Civilization as achievement and cage" },
142
+ { id: "S07", name: "The palace / court", attestation: "Westcar Papyrus", function: "Concentrated power → concentrated intrigue" },
143
+ { id: "S08", name: "The labyrinth", attestation: "Minotaur myth (~8th c. BCE+)", function: "Space as puzzle; monster at the center of the self" },
144
+ { id: "S09", name: "The tower", attestation: "Babel; Danaë's bronze chamber", function: "Isolation, hubris, or preserved virginity" },
145
+ { id: "S10", name: "The mountain (sacred/forbidden)", attestation: "Mashu; Sinai; Olympus", function: "Vertical interface between human and divine" },
146
+ { id: "S11", name: "The cave", attestation: "Polyphemus; Plato's cave", function: "Womb/tomb ambiguity; ignorance or refuge" },
147
+ { id: "S12", name: "The wasteland", attestation: "Grail legend (~1180); Ugaritic Baal (~1300 BCE)", function: "Land mirrors ruler's/protagonist's spiritual state" },
148
+ { id: "S13", name: "The river / crossing", attestation: "Styx; waters of death in Gilgamesh", function: "Irreversibility made liquid" },
149
+ { id: "S14", name: "The crossroads", attestation: "Oedipus kills Laius; folklore worldwide", function: "Choice-point sanctified; fate's junction box" },
150
+ { id: "S15", name: "The tavern / inn", attestation: "Siduri's tavern (Gilgamesh)", function: "Neutral ground; wisdom from strangers" },
151
+ { id: "S16", name: "The haunted house", attestation: "Plautus Mostellaria; Pliny ghost-house", function: "Past sins localized in architecture" },
152
+ { id: "S17", name: "Pastoral Arcadia", attestation: "Theocritus Idylls (~270 BCE)", function: "Nostalgic counter-world critiquing court/city" },
153
+ { id: "S18", name: "The utopia", attestation: "Plato Republic/Atlantis; More 1516", function: "Thought-experiment as geography" },
154
+ { id: "S19", name: "The dystopia", attestation: "Zamyatin We (1921); Swift precursors", function: "Present fears extrapolated into habitable warning" },
155
+ { id: "S20", name: "Otherworld / fairyland", attestation: "Tír na nÓg; Urashima Tarō (8th c. CE)", function: "Different time-flow; desire's country with hidden costs" },
156
+ { id: "S21", name: "The dream world", attestation: "Egyptian dream texts; Yellow Millet Dream", function: "Consequence-free zone that turns out to have consequences" },
157
+ { id: "S22", name: "The afterlife tour", attestation: "Book of the Dead; Dante (~1320)", function: "Moral order rendered as architecture" },
158
+ { id: "S23", name: "Outer space / other planets", attestation: "Lucian True History (~2nd c. CE)", function: "Ultimate estrangement; satire and wonder" },
159
+ { id: "S24", name: "Fully invented secondary world", attestation: "Tolkien Middle-earth (1937/1954)", function: "Total worldbuilding; setting as co-protagonist" },
160
+ { id: "S25", name: "The ship", attestation: "Argo; Noah's ark", function: "Society compressed and set adrift" },
161
+ { id: "S26", name: "The prison / dungeon", attestation: "Joseph's prison; Prometheus bound", function: "Stasis as crucible; the mind as remaining territory" },
162
+ { id: "S27", name: "The battlefield", attestation: "Iliad", function: "Values tested at mortal stakes" },
163
+ { id: "S28", name: "The frontier / borderland", attestation: "Gilgamesh edge-of-world; American Western", function: "Law and identity negotiable" },
164
+ { id: "S29", name: "The school", attestation: "Rabelais; Tom Brown's School Days (1857)", function: "Microcosm of socialization; sorting of selves" },
165
+ { id: "S30", name: "The village / small town", attestation: "Folktale default", function: "Community as character; conformity's pressure vessel" },
166
+ { id: "S31", name: "The ruins", attestation: "Sumerian city-lament (~2000 BCE)", function: "Time's verdict made visible; memento mori" },
167
+ { id: "S32", name: "Liminal non-places", attestation: "Gates of horn and ivory (Odyssey)", function: "Transitions localized; rules suspended between rule-sets" },
168
+ ] as const;
169
+
170
+ // ── PART IV-A — Human character archetypes (28) ─────────────────────────────
171
+ export const HUMAN_CHARS: readonly Taxon[] = [
172
+ { id: "H01", name: "The hero", attestation: "Gilgamesh", function: "Community's ideal self under trial" },
173
+ { id: "H02", name: "The tragic hero", attestation: "Gilgamesh proto; Oedipus perfected", function: "Greatness and flaw as the same trait" },
174
+ { id: "H03", name: "The antihero", attestation: "Thersites; picaro (Lazarillo 1554)", function: "Virtue's absence exposes society's pretenses" },
175
+ { id: "H04", name: "The mentor", attestation: "Utnapishtim; Mentor in Odyssey", function: "Wisdom's relay; hero's future self" },
176
+ { id: "H05", name: "The trickster (human)", attestation: "Odysseus; Plautus Pseudolus", function: "Intelligence vs. power; rule-breaking as innovation" },
177
+ { id: "H06", name: "The sidekick / loyal companion", attestation: "Enkidu", function: "Hero's mirror and conscience; grief-generator" },
178
+ { id: "H07", name: "The shadow / villain", attestation: "Humbaba; tragic human villainy", function: "Protagonist's disowned possibilities" },
179
+ { id: "H08", name: "The femme fatale / seductress", attestation: "Ishtar propositioning Gilgamesh", function: "Desire as danger; tests self-knowledge" },
180
+ { id: "H09", name: "The damsel in distress", attestation: "Andromeda (~5th c. BCE)", function: "Prize/stakes made human — now heavily subverted" },
181
+ { id: "H10", name: "The wise old woman / crone", attestation: "Siduri the tavern-keeper", function: "Unofficial wisdom outside institutions" },
182
+ { id: "H11", name: "The innocent / child", attestation: "Astyanax (Iliad)", function: "Stakes-multiplier; unjudging witness" },
183
+ { id: "H12", name: "The fool / jester", attestation: "Egyptian court entertainers; Lear's Fool", function: "Licensed truth-teller; wisdom as nonsense" },
184
+ { id: "H13", name: "The tyrant", attestation: "Opening Gilgamesh oppressing Uruk", function: "Power without restraint; cautionary origin" },
185
+ { id: "H14", name: "The rebel", attestation: "Prometheus (Hesiod ~700 BCE)", function: "Challenges cosmic/social order; progress's martyr" },
186
+ { id: "H15", name: "The chosen one", attestation: "Sargon legend; Moses", function: "Destiny vs. agency tension" },
187
+ { id: "H16", name: "The everyman", attestation: "Eloquent Peasant (~1850 BCE)", function: "Audience surrogate; justice tested from below" },
188
+ { id: "H17", name: "The braggart soldier", attestation: "Aristophanes Lamachus; Miles Gloriosus", function: "Deflates martial vanity" },
189
+ { id: "H18", name: "The blocking elder (senex)", attestation: "Greek New Comedy", function: "Obstacle to young love; generational conflict" },
190
+ { id: "H19", name: "The detective", attestation: "Daniel in Susanna; Dupin (1841)", function: "Reason as heroism; plot run backward" },
191
+ { id: "H20", name: "The mad scientist", attestation: "Victor Frankenstein (1818)", function: "Knowledge divorced from responsibility" },
192
+ { id: "H21", name: "The Byronic hero", attestation: "Childe Harold (1812)", function: "Charisma of damage; Romantic interiority" },
193
+ { id: "H22", name: "The double / doppelgänger", attestation: "Menaechmi; William Wilson (1839)", function: "Identity destabilized; self as stranger" },
194
+ { id: "H23", name: "The false hero", attestation: "Proppian function; Odyssey suitors", function: "Tests recognition; defines true merit by contrast" },
195
+ { id: "H24", name: "The ingenue", attestation: "Greek New Comedy's maiden", function: "Innocence entering the world's market" },
196
+ { id: "H25", name: "The caregiver / nurse", attestation: "Eurycleia (Odyssey)", function: "Continuity of love; keeper of identity" },
197
+ { id: "H26", name: "The scapegoat", attestation: "Pharmakos; Oedipus as plague-bearer", function: "Community guilt localized and expelled" },
198
+ { id: "H27", name: "The convert / redeemed sinner", attestation: "Valmiki legend; Augustine Confessions", function: "Change is possible; the arc made doctrine" },
199
+ { id: "H28", name: "The unreliable confessor", attestation: "Lucius in The Golden Ass", function: "First-person as performance, not transparency" },
200
+ ] as const;
201
+
202
+ // ── PART IV-B — Non-human character archetypes (27) ─────────────────────────
203
+ export const NONHUMAN_CHARS: readonly Taxon[] = [
204
+ { id: "N01", name: "The dragon / chaos-serpent", attestation: "Tiamat (Enūma Eliš)", function: "Primordial chaos requiring heroic ordering" },
205
+ { id: "N02", name: "The monster / hybrid", attestation: "Humbaba; Egyptian composite beasts", function: "Category violation embodied; killable unknown" },
206
+ { id: "N03", name: "The intervening god", attestation: "Sumerian epic throughout", function: "Fate personified; cosmic stakes localized" },
207
+ { id: "N04", name: "The ghost", attestation: "Enkidu's shade; Patroclus' ghost", function: "Past's unfinished business given a voice" },
208
+ { id: "N05", name: "The talking animal", attestation: "Eden serpent; Shipwrecked Sailor; Aesop", function: "Moral speech from outside human order" },
209
+ { id: "N06", name: "The animal helper", attestation: "Folktale-universal; Rhodopis' eagle", function: "Nature allied with the deserving" },
210
+ { id: "N07", name: "The animal-as-protagonist", attestation: "Lucius the donkey (Golden Ass)", function: "Humanity viewed from beneath" },
211
+ { id: "N08", name: "The giant", attestation: "Humbaba; Polyphemus; Goliath", function: "Brute scale vs. cleverness" },
212
+ { id: "N09", name: "The witch / sorceress", attestation: "Circe (Odyssey)", function: "Transformative female power outside social control" },
213
+ { id: "N10", name: "The shapeshifter", attestation: "Proteus (Odyssey)", function: "Truth that must be wrestled from changing forms" },
214
+ { id: "N11", name: "The fairy / hidden folk", attestation: "Medieval Celtic/Norse recordings", function: "Amoral otherness beside the human world" },
215
+ { id: "N12", name: "The demon", attestation: "Lamashtu/Pazuzu narratives", function: "Malice with theology; possession of the interior" },
216
+ { id: "N13", name: "The angel / divine messenger", attestation: "Ugaritic and Hebrew texts", function: "Vertical channel; annunciation of plot" },
217
+ { id: "N14", name: "The vampire", attestation: "Polidori The Vampyre (1819); folklore older", function: "Predation eroticized; parasitic aristocrat" },
218
+ { id: "N15", name: "The werewolf", attestation: "Niceros' tale in Satyricon (~60 CE)", function: "The beast inside the neighbor" },
219
+ { id: "N16", name: "The artificial being / automaton", attestation: "Talos; Pygmalion; Golem", function: "Creation answering to its creator — or not" },
220
+ { id: "N17", name: "The robot", attestation: "Čapek R.U.R. (1920)", function: "Labor, servitude, and revolt industrialized" },
221
+ { id: "N18", name: "The artificial intelligence", attestation: "Modern form ~1940s–60s SF (HAL 1968)", function: "Mind without body; humanity's mirror-test" },
222
+ { id: "N19", name: "The alien", attestation: "Lucian True History moon-dwellers", function: "The Other at maximum distance" },
223
+ { id: "N20", name: "The undead revenant", attestation: "Norse draugr sagas", function: "Death that refuses its boundary" },
224
+ { id: "N21", name: "The mermaid / siren", attestation: "Sirens (Odyssey); Atargatis", function: "Desire that drowns; the sea given a voice" },
225
+ { id: "N22", name: "The phoenix", attestation: "Herodotus (~440 BCE) Egyptian tradition", function: "Cyclical renewal embodied" },
226
+ { id: "N23", name: "The unicorn", attestation: "Ctesias Indica (~400 BCE)", function: "Purity that can only be betrayed, not captured" },
227
+ { id: "N24", name: "The personified abstraction", attestation: "Sumerian Death/Fate; Psychomachia (~405 CE)", function: "Ideas given bodies so they can fight" },
228
+ { id: "N25", name: "The eldritch / incomprehensible entity", attestation: "Chaos-gods; Lovecraft (1920s)", function: "Horror of scale and indifference" },
229
+ { id: "N26", name: "The sentient object", attestation: "Argo speaking beam; folklore objects", function: "Animism narrativized; the world watching back" },
230
+ { id: "N27", name: "The land / setting-as-character", attestation: "Waste Land / Fisher King (~1180)", function: "Environment given agency and moral state" },
231
+ ] as const;
232
+
233
+ // ── PART V — Other story elements (40) ──────────────────────────────────────
234
+ export const STORY_ELEMENTS: readonly Taxon[] = [
235
+ { id: "E01", name: "Foreshadowing", attestation: "Gilgamesh prophetic dreams", function: "Buys ending's plausibility; rereading dividend" },
236
+ { id: "E02", name: "Chekhov's gun", attestation: "Odysseus' bow; named by Chekhov 1880s", function: "Economy of detail; every element earns its place" },
237
+ { id: "E03", name: "The plot twist", attestation: "Oedipus Rex investigator-is-culprit", function: "Recontextualizes everything prior" },
238
+ { id: "E04", name: "Surprise / twist ending", attestation: "Three Apples (1001 Nights); O. Henry", function: "Final-position reversal; memory rewritten" },
239
+ { id: "E05", name: "Narrator is the killer", attestation: "Christie Roger Ackroyd (1926)", function: "Weaponizes narrative convention itself" },
240
+ { id: "E06", name: "It was all a dream (and subversions)", attestation: "Yellow Millet Dream; Alice (1865)", function: "Consequence erased — or displaced inward" },
241
+ { id: "E07", name: "Mystery / whodunit", attestation: "Three Apples; Rue Morgue (1841)", function: "Story as puzzle; reader competes with detective" },
242
+ { id: "E08", name: "Locked-room problem", attestation: "Murders in the Rue Morgue (1841)", function: "Impossibility as hook; re-teaches seeing" },
243
+ { id: "E09", name: "Red herring", attestation: "Three Apples; Moonstone (1868)", function: "Misdirection that must be fair in retrospect" },
244
+ { id: "E10", name: "Dramatic irony", attestation: "Oedipus — audience knows", function: "Converts information gap into dread or comedy" },
245
+ { id: "E11", name: "Verbal & situational irony", attestation: "Socratic irony; Hebrew Bible", function: "Meaning doubled; the text winks" },
246
+ { id: "E12", name: "Unreliable narrator", attestation: "Lucius; Tell-Tale Heart; Booth 1961 term", function: "Reader promoted to judge of testimony" },
247
+ { id: "E13", name: "The MacGuffin", attestation: "Golden Fleece; Grail; Hitchcock term", function: "Pure plot-fuel; desire's placeholder" },
248
+ { id: "E14", name: "Prophecy & self-fulfilling prophecy", attestation: "Oedipus exposed because of prophecy", function: "Fate and agency collapsed into one mechanism" },
249
+ { id: "E15", name: "Flashback (analepsis)", attestation: "Odyssey Books 9–12", function: "Past delivered when it means most" },
250
+ { id: "E16", name: "Flash-forward (prolepsis)", attestation: "Epic prophecy; Spark 1961 systematic", function: "Outcome revealed; interest transfers to causation" },
251
+ { id: "E17", name: "Frame reveal", attestation: "Turn of the Screw (1898)", function: "The container becomes the twist" },
252
+ { id: "E18", name: "Mistaken identity", attestation: "Menaechmi (~200 BCE)", function: "Identity as social construction" },
253
+ { id: "E19", name: "Disguise & revelation", attestation: "Odysseus as beggar; Inanna's gates", function: "Truth staged as striptease of identity" },
254
+ { id: "E20", name: "Bed-trick / substituted lover", attestation: "Genesis Leah/Rachel; Shakespeare", function: "Consent and identity interrogated by plot" },
255
+ { id: "E21", name: "Rule of three", attestation: "Universal oral tale (Olrik epic laws)", function: "Pattern-establish, confirm, break" },
256
+ { id: "E22", name: "Repetition with escalation", attestation: "Three trials; Peter's three denials", function: "Rhythm as meaning; third time transforms" },
257
+ { id: "E23", name: "Leitmotif / recurring image", attestation: "Homeric epithets; Wagner term", function: "Meaning accrues by return; theme made sensory" },
258
+ { id: "E24", name: "Callback / bookend", attestation: "Ring composition", function: "Closure via echo; measures distance traveled" },
259
+ { id: "E25", name: "Symbolism", attestation: "Serpent, plant, walls in Gilgamesh", function: "Concrete objects carry abstract freight" },
260
+ { id: "E26", name: "Allegory", attestation: "Plato's Cave; Psychomachia", function: "Two coherent stories in one text" },
261
+ { id: "E27", name: "The dramatic question", attestation: "Implicit since Gilgamesh", function: "The spine every scene must load-bear" },
262
+ { id: "E28", name: "Suspense vs. surprise", attestation: "Hitchcock bomb-under-table theory", function: "Info early = dread; withheld = shock" },
263
+ { id: "E29", name: "Comic relief", attestation: "Satyr plays; Porter in Macbeth", function: "Pressure valve that deepens the dark" },
264
+ { id: "E30", name: "Fourth-wall break", attestation: "Aristophanic parabasis (425 BCE)", function: "Complicity with audience; frame made visible" },
265
+ { id: "E31", name: "Bathos & anticlimax", attestation: "Aristophanes; named by Pope 1727", function: "Deflation as commentary" },
266
+ { id: "E32", name: "Poetic justice", attestation: "Egyptian peasant tales; Rymer 1678 term", function: "Moral order enforced by plot" },
267
+ { id: "E33", name: "Ambiguous ending", attestation: "The Lady, or the Tiger? (1882); Genji", function: "Meaning delegated to reader permanently" },
268
+ { id: "E34", name: "Prophecy-with-loophole", attestation: "No man of woman born (Macbeth lineage)", function: "Fate as riddle; language as trapdoor" },
269
+ { id: "E35", name: "Reveal of parentage", attestation: "Sargon / Moses / Oedipus", function: "Identity as buried inheritance" },
270
+ { id: "E36", name: "Countdown / deadline", attestation: "Scheherazade's dawn; Persephone terms", function: "Time weaponized" },
271
+ { id: "E37", name: "Nested revelation", attestation: "Oedipus; 1001 Nights frame", function: "Solutions that open larger questions" },
272
+ { id: "E38", name: "Mimesis vs. diegesis choice", attestation: "Plato Republic Book III", function: "Showing vs. telling ratio defines style" },
273
+ { id: "E39", name: "Defamiliarization (ostranenie)", attestation: "Shklovsky 1917; practiced since metaphor", function: "Art makes the stone stony again" },
274
+ { id: "E40", name: "Ending as retroactive organizer", attestation: "Aristotle's insight", function: "The end is what the middle was for" },
275
+ ] as const;
276
+
277
+ // ── PART VI — Invisible load-bearing walls (18) ─────────────────────────────
278
+ export const LOAD_BEARING: readonly Taxon[] = [
279
+ { id: "L01", name: "Point of view / narration", attestation: "Sinuhe first-person (~1900 BCE); epic omniscient; Flaubert/James limited third", function: "POV determines what can be known — and therefore what the story is" },
280
+ { id: "L02", name: "Mimesis vs. diegesis", attestation: "Plato Republic III", function: "Every sentence chooses show or tell; ratio defines style" },
281
+ { id: "L03", name: "Narrator ≠ author", attestation: "Implicit in Sinuhe; theorized 20th c.", function: "Enables irony, unreliability, modern novel" },
282
+ { id: "L04", name: "Character arc / interiority", attestation: "Epic external → Genji / Augustine internal", function: "Migration of story from world to mind" },
283
+ { id: "L05", name: "Conflict typology", attestation: "All axes in Gilgamesh except technology", function: "Chosen conflict axis is the genre's DNA" },
284
+ { id: "L06", name: "Theme", attestation: "Gilgamesh: meaning in works and love", function: "The proposition the plot argues" },
285
+ { id: "L07", name: "Suspension of disbelief", attestation: "Coleridge 1817 name; operative since campfire", function: "Reader's contractual contribution; genre is the fine print" },
286
+ { id: "L08", name: "Genre as manipulable system", attestation: "Don Quixote kills chivalric romance", function: "Conventions kept, broken, or renegotiated" },
287
+ { id: "L09", name: "Medium and its constraints", attestation: "Oral formula → verse → prose → drama → serial → film → interactive", function: "Medium's economics silently author structure" },
288
+ { id: "L10", name: "Intertextuality and retelling", attestation: "Virgil rewriting Homer; Ovid myth system", function: "No fiction is an orphan; originality is recombination" },
289
+ { id: "L11", name: "Oral-formulaic composition", attestation: "Parry/Lord 1930s", function: "Pre-literate fiction assembled live from formulas" },
290
+ { id: "L12", name: "Translation and transmission", attestation: "Panchatantra → Persian → Arabic → European fable", function: "Structures migrate; stories are viral media" },
291
+ { id: "L13", name: "Censorship, taboo, patronage", attestation: "Aesopian animal-speech; court epic; market novel", function: "What cannot be said generates half of fiction's techniques" },
292
+ { id: "L14", name: "Audience ritual context", attestation: "Greek tragedy as civic ritual; fireside; binge-watch", function: "Reception context rewrites which structures work" },
293
+ { id: "L15", name: "Defamiliarization root function", attestation: "Shklovsky 1917", function: "Root function beneath every device" },
294
+ { id: "L16", name: "Names and titles", attestation: "Odysseus = man of pain/trouble", function: "Onomastic meaning; title as first sentence" },
295
+ { id: "L17", name: "Chapter/scene division and white space", attestation: "Invisible structural tool across media", function: "Where a text breaks controls suspense and meaning" },
296
+ { id: "L18", name: "The ending as retroactive organizer", attestation: "Aristotle", function: "Highest-leverage structural choice" },
297
+ ] as const;
298
+
299
+ export const CONFLICT_AXES = [
300
+ "person vs. person",
301
+ "person vs. nature",
302
+ "person vs. self",
303
+ "person vs. society",
304
+ "person vs. fate",
305
+ "person vs. technology",
306
+ ] as const;
307
+
308
+ export const POV_OPTIONS = [
309
+ "first-person retrospective",
310
+ "omniscient third",
311
+ "limited third",
312
+ "second person",
313
+ "multiple rotating limited third",
314
+ "epistolary collage",
315
+ ] as const;
316
+
317
+ export const ENDING_TYPES = [
318
+ "closed / resolved",
319
+ "open",
320
+ "twist",
321
+ "circular",
322
+ "ambiguous",
323
+ "tragic fall",
324
+ "comic reintegration",
325
+ "bittersweet pyrrhic",
326
+ ] as const;
327
+
328
+ export const TONE_PALETTE = [
329
+ "mythic-elevated",
330
+ "intimate-domestic",
331
+ "ironic-satirical",
332
+ "lyrical-elegiac",
333
+ "hardboiled-spare",
334
+ "baroque-ornate",
335
+ "uncanny-estranged",
336
+ "comic-picaresque",
337
+ "tragic-austere",
338
+ "oneiric-dreamlike",
339
+ ] as const;
340
+
341
+ export const LENGTH_PROFILES = [
342
+ { id: "short", label: "Short story", chapters: 1, wordsPerChapter: 3500, pages: 8 },
343
+ { id: "novelette", label: "Novelette", chapters: 4, wordsPerChapter: 4000, pages: 16 },
344
+ { id: "novella", label: "Novella", chapters: 8, wordsPerChapter: 4500, pages: 32 },
345
+ { id: "novel", label: "Novel", chapters: 16, wordsPerChapter: 4500, pages: 64 },
346
+ { id: "epic", label: "Epic / saga", chapters: 28, wordsPerChapter: 5000, pages: 120 },
347
+ ] as const;
348
+
349
+ export type LengthId = (typeof LENGTH_PROFILES)[number]["id"];
350
+
351
+ /** Catalog counts for honesty / UI badges. */
352
+ export const TAXONOMY_COUNTS = {
353
+ macro: MACRO_STRUCTURES.length,
354
+ campbell: CAMPBELL_BEATS.length,
355
+ propp: PROPP_FUNCTIONS.length,
356
+ micro: MICRO_UNITS.length,
357
+ settings: SETTINGS.length,
358
+ human: HUMAN_CHARS.length,
359
+ nonhuman: NONHUMAN_CHARS.length,
360
+ elements: STORY_ELEMENTS.length,
361
+ loadBearing: LOAD_BEARING.length,
362
+ metaFrameworks: META_FRAMEWORKS.length,
363
+ } as const;
364
+
365
+ export const TAXONOMY_TOTAL =
366
+ TAXONOMY_COUNTS.macro +
367
+ TAXONOMY_COUNTS.campbell +
368
+ TAXONOMY_COUNTS.propp +
369
+ TAXONOMY_COUNTS.micro +
370
+ TAXONOMY_COUNTS.settings +
371
+ TAXONOMY_COUNTS.human +
372
+ TAXONOMY_COUNTS.nonhuman +
373
+ TAXONOMY_COUNTS.elements +
374
+ TAXONOMY_COUNTS.loadBearing;
375
+
376
+ /**
377
+ * P2 expanded taxonomy contract.
378
+ *
379
+ * The user-provided P2 catalog uses a stable numeric ID scheme. SAGE accepts
380
+ * the full scheme as a band contract and keeps the hand-authored, high-detail
381
+ * arrays above as the active seed pools. This separates two concerns:
382
+ * selectable runtime craft axes use validated local arrays; import/export and
383
+ * future flattening preserve the P2 row/count boundaries exactly.
384
+ */
385
+ export const CONFIDENCE_TAGS = ["ATT", "CONV", "COD", "UNC", "DISP", "MOD", "ASSUM", "POST-CUTOFF"] as const;
386
+
387
+ export const EXPANDED_TAXONOMY_BANDS = [
388
+ { band: "1000", name: "Macro structures", first: 1001, last: 1150, rows: 150 },
389
+ { band: "2000", name: "Micro structures / beats", first: 2001, last: 2148, rows: 148 },
390
+ { band: "3000", name: "Location / setting archetypes", first: 3001, last: 3100, rows: 100 },
391
+ { band: "4000", name: "Human character archetypes", first: 4001, last: 4137, rows: 137 },
392
+ { band: "5000", name: "Non-human character archetypes", first: 5001, last: 5106, rows: 106 },
393
+ { band: "6000", name: "Twists / mystery / devices", first: 6001, last: 6112, rows: 112 },
394
+ { band: "7000", name: "Foundational / meta elements", first: 7001, last: 7052, rows: 52 },
395
+ { band: "8000", name: "Non-Western structural systems", first: 8001, last: 8056, rows: 56 },
396
+ { band: "9000", name: "Motif / theme classes", first: 9001, last: 9060, rows: 60 },
397
+ ] as const;
398
+
399
+ export const EXPANDED_TAXONOMY_TOTAL = EXPANDED_TAXONOMY_BANDS.reduce((n, b) => n + b.rows, 0);
400
+
401
+ export function expandedBandForId(id: number) {
402
+ return EXPANDED_TAXONOMY_BANDS.find((b) => id >= b.first && id <= b.last) ?? null;
403
+ }