/**
 * 发布问题场景注册表 — 共享 fixture 创建
 */
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
export function createDesignFixtureDir() {
    const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "soloforge-b62-"));
    const archDir = path.join(tmpDir, "docs", "architecture");
    fs.mkdirSync(archDir, { recursive: true });
    return tmpDir;
}
export function createDesignFixtureWithPartialDocs() {
    const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "soloforge-b62-partial-"));
    const archDir = path.join(tmpDir, "docs", "architecture");
    fs.mkdirSync(archDir, { recursive: true });
    fs.writeFileSync(path.join(archDir, "api-spec.md"), "# API\n\n## /users\n\nGET /users\n", "utf-8");
    return tmpDir;
}
/** 创建完整设计产物 fixture（所有标准文档齐全、内容合规） */
export function createCompleteDesignFixture(tmpDir) {
    const archDir = path.join(tmpDir, "docs", "architecture");
    const apiDir = path.join(tmpDir, "docs", "api");
    const traceDir = path.join(tmpDir, "docs", "traceability");
    const sqlDir = path.join(tmpDir, "db", "migrations");
    fs.mkdirSync(archDir, { recursive: true });
    fs.mkdirSync(apiDir, { recursive: true });
    fs.mkdirSync(traceDir, { recursive: true });
    fs.mkdirSync(sqlDir, { recursive: true });
    fs.writeFileSync(path.join(archDir, "00-架构决策记录.md"), "# 决策记录\n\n## D1 微服务\n\n选择微服务\n", "utf-8");
    fs.writeFileSync(path.join(archDir, "01-架构设计文档.md"), "# 架构设计\n\n## 来源追踪\n\nREQ-001、PROTO-001。\n\n## 系统概述\n\n微服务\n\n## 架构决策\n\nARCH-001 微服务\n\n## 技术选型\n\nTS\n\n## 模块设计\n\n模块\n", "utf-8");
    fs.writeFileSync(path.join(archDir, "02-数据库设计文档.md"), "# 数据库设计\n\n追踪: DD-T001 | 上游: ARCH-001\n\n## 数据模型\n\n用户\n\n## 实体关系\n\n1:N\n\n## 表结构\n\n| 字段 | 类型 | 约束 | 说明 |\n|------|------|------|------|\n| id | uuid | PK | 主键 |\n", "utf-8");
    // 合规 API 文档: 含完整字段表
    fs.writeFileSync(path.join(archDir, "03-API接口规格文档.md"), "# 接口概览\n\n追踪: DD-A001 | 上游: ARCH-001\n\n用户管理 API。\n\n# 请求响应规范\n\n## GET /api/users\n\n### 请求字段表\n\n| 请求字段名 | 类型 | 必填 | 来源 | 说明 | 示例 | 校验规则 | 错误语义 |\n|--------|------|------|------|------|------|----------|----------|\n| page | int | 否 | query | 页码 | 1 | >=1 | 页码无效 |\n\n### 响应字段表\n\n| 响应字段名 | 类型 | 必填 | 来源 | 说明 | 示例 | 校验规则 | 错误语义 |\n|--------|------|------|------|------|------|----------|----------|\n| id | string | 是 | db | 用户ID | usr-1 | uuid | 用户不存在 |\n", "utf-8");
    fs.writeFileSync(path.join(archDir, "04-开发切片计划.md"), "# 开发切片计划\n\nPHASE-001\nSLICE-001\n设计来源: DD-T001, DD-A001\n验收: AC-001\n", "utf-8");
    fs.writeFileSync(path.join(archDir, "99-设计一致性验收报告.md"), "# 一致性报告\n\n通过\n", "utf-8");
    fs.writeFileSync(path.join(apiDir, "openapi.yaml"), "openapi: 3.0.0\ninfo:\n  title: API\n  version: '1.0'\npaths:\n  /api/users:\n    get:\n      summary: List users\n      responses:\n        '200':\n          description: OK\n", "utf-8");
    fs.writeFileSync(path.join(traceDir, "01-需求原型设计实现追踪矩阵.md"), [
        "# 需求原型设计实现追踪矩阵",
        "",
        "| ID | 类型 | 来源 | 关联 |",
        "|----|------|------|------|",
        "| REQ-001 | 需求 | docs/requirements.md | PROTO-001 ARCH-001 |",
        "| PROTO-001 | 原型 | docs/prototype.md | REQ-001 ARCH-001 |",
        "| ARCH-001 | 架构 | docs/architecture/01-架构设计文档.md | REQ-001 PROTO-001 DD-T001 DD-A001 |",
        "| DD-T001 | 数据库详细设计 | docs/architecture/02-数据库设计文档.md | ARCH-001 SLICE-001 |",
        "| DD-A001 | API 详细设计 | docs/architecture/03-API接口规格文档.md | ARCH-001 SLICE-001 |",
        "| PHASE-001 | 阶段 | docs/architecture/04-开发切片计划.md | SLICE-001 |",
        "| SLICE-001 | 切片 | docs/architecture/04-开发切片计划.md | PHASE-001 DD-T001 DD-A001 AC-001 |",
        "| AC-001 | 验收 | docs/acceptance/AC-001.md | SLICE-001 |",
    ].join("\n"), "utf-8");
    fs.writeFileSync(path.join(sqlDir, "001-init.sql"), "CREATE TABLE users (id UUID PRIMARY KEY);\n", "utf-8");
}
//# sourceMappingURL=fixtures.js.map