feat(GOV-007): 建立开发库 Schema 基线门禁

This commit is contained in:
2026-08-13 12:50:37 +08:00
parent 2c502ebbec
commit da056681b6
30 changed files with 1734 additions and 18 deletions
+5
View File
@@ -2,6 +2,7 @@ import { execFileSync } from 'node:child_process';
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { assertCurrentReleasedBaselinePublished } from '../database/schema-baseline.mjs';
import { getFeatureDirectory, validateFeatureId } from './feature-record.mjs';
const [featureId, slug] = process.argv.slice(2);
@@ -15,6 +16,10 @@ const featureDirectory = getFeatureDirectory(repositoryRoot, featureId, slug);
const gitnexusDirectory = path.join(featureDirectory, 'gitnexus');
const beforeReport = path.join(gitnexusDirectory, 'before.md');
// Schema 基线必须在新版本的功能档案和 GitNexus 分析之前已经独立提交;
// 这里仅做只读验证,绝不在一般功能开发命令中连接数据库或静默生成历史产物。
assertCurrentReleasedBaselinePublished(repositoryRoot);
if (existsSync(beforeReport)) {
throw new Error(`开发前报告已存在,为保护历史不会覆盖:${beforeReport}`);
}