feat: initial commit

This commit is contained in:
2026-06-23 20:29:02 +08:00
commit ea8f6066c4
217 changed files with 60754 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"name": "Genesis Contract",
"description": "创世契约 - 定义故事的核心欲望、伦理沙盒与奇观日常化",
"version": "1.0.0",
"core_desire": {
"type": "object",
"description": "核心欲望 - 主角的终极追求",
"properties": {
"primary": {
"type": "string",
"description": "主欲望类型 (power, love, revenge, knowledge, survival, recognition)"
},
"secondary": {
"type": "array",
"description": "次级欲望列表"
},
"taboos": {
"type": "array",
"description": "角色绝不触碰的底线"
}
},
"required": ["primary"]
},
"ethical_inversion": {
"type": "object",
"description": "伦理沙盒 - 故事世界中废除的现实道德",
"properties": {
"inverted_norms": {
"type": "array",
"description": "被颠覆的社会/道德规范"
},
"alternative_values": {
"type": "object",
"description": "替代性价值观体系"
},
"world_rules": {
"type": "array",
"description": "这个世界特有的物理/社会规则"
}
}
},
"core_spectacle": {
"type": "object",
"description": "奇观日常化 - 震撼场景的常态化设计",
"properties": {
"ordinary_state": {
"type": "string",
"description": "日常状态描述"
},
"spectacle_trigger": {
"type": "string",
"description": "触发奇观的条件"
},
"frequency": {
"type": "string",
"description": "奇观出现频率 (constant, frequent, occasional, rare)"
}
}
},
"rag_weight": {
"type": "number",
"description": "RAG检索权重 (0-1), 此契约内容永远保留在Top 1权重",
"minimum": 0,
"maximum": 1,
"default": 1.0
}
}
+41
View File
@@ -0,0 +1,41 @@
# OpenSpec: 项目数据标准与契约
## 概述
OpenSpec 是 NovelMaster (Noma) 系统的全局数据标准与契约层,定义了所有项目必须遵循的数据结构和契约规范。
## 核心组件
### 1. Genesis Contract (创世契约)
位于 `genesis_contract.json`,包含:
- **core_desire**: 核心欲望定义
- **ethical_inversion**: 伦理沙盒配置
- **core_spectacle**: 奇观日常化设定
- **rag_weight**: RAG检索权重(始终为1.0
### 2. 项目元数据
每个项目必须包含:
```json
{
"project_name": "string",
"genre": "string",
"target_word_count": "number",
"current_chapter": "number",
"genesis_contract": "object"
}
```
## 数据契约原则
1. **不可变性**: 核心设定一旦确立,通过 Retcon Manager 处理变更
2. **版本追踪**: 所有设定变更记录在账本中
3. **RAG优先级**: 创世契约内容始终保持最高检索权重
## 与其他模块的关系
- `core_engine/state_manager/`: 使用 OpenSpec 进行状态验证
- `core_engine/memory_rag/`: 使用 OpenSpec 进行上下文压缩
- `agents/`: 使用 OpenSpec 进行审查和生成指导
- `matrices/`: 使用 OpenSpec 选择爽感模型