oh-my-knowledge 0.36.0 → 0.37.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.
- package/README.md +5 -3
- package/README.zh.md +5 -3
- package/dist/assets/agent-skills/omk/SKILL.md +4 -2
- package/dist/assets/agent-skills/omk/references/commands.md +86 -3
- package/dist/cli/commands/doctor.js +19 -4
- package/dist/cli/commands/evolve.d.ts +11 -0
- package/dist/cli/commands/evolve.js +105 -5
- package/dist/cli/commands/list.d.ts +5 -26
- package/dist/cli/commands/list.js +17 -142
- package/dist/cli/commands/promote.d.ts +24 -0
- package/dist/cli/commands/promote.js +158 -0
- package/dist/cli/commands/rollback.d.ts +20 -0
- package/dist/cli/commands/rollback.js +95 -0
- package/dist/cli/commands/sample.d.ts +1 -0
- package/dist/cli/commands/sample.js +10 -4
- package/dist/cli/lib/cell-format.d.ts +17 -0
- package/dist/cli/lib/cell-format.js +19 -0
- package/dist/cli/lib/cmd-flags.d.ts +1 -0
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/common.js +8 -0
- package/dist/cli/lib/i18n-dict/list.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/list.js +4 -0
- package/dist/cli/lib/i18n-dict/promote.d.ts +3 -0
- package/dist/cli/lib/i18n-dict/promote.js +54 -0
- package/dist/cli/lib/i18n-dict/rollback.d.ts +3 -0
- package/dist/cli/lib/i18n-dict/rollback.js +22 -0
- package/dist/cli/lib/i18n-dict.d.ts +3 -1
- package/dist/cli/lib/i18n-dict.js +4 -0
- package/dist/cli/lib/progress.d.ts +3 -0
- package/dist/cli/lib/progress.js +22 -0
- package/dist/cli/lib/source-probe.d.ts +15 -0
- package/dist/cli/lib/source-probe.js +129 -0
- package/dist/doctor/endpoint-rule.d.ts +60 -0
- package/dist/doctor/endpoint-rule.js +381 -0
- package/dist/doctor/health/load-custom-dimensions.d.ts +6 -0
- package/dist/doctor/health/load-custom-dimensions.js +43 -3
- package/dist/doctor/index.js +8 -1
- package/dist/executors/codex-cli.js +5 -1
- package/dist/managed/index.d.ts +1 -0
- package/dist/managed/index.js +1 -0
- package/dist/managed/list-view.d.ts +3 -0
- package/dist/managed/list-view.js +8 -4
- package/dist/managed/promote-gate.d.ts +40 -0
- package/dist/managed/promote-gate.js +37 -0
- package/dist/managed/store.d.ts +25 -2
- package/dist/managed/store.js +92 -3
- package/dist/renderer/doctor-detail-renderer.d.ts +9 -0
- package/dist/renderer/doctor-detail-renderer.js +114 -0
- package/dist/renderer/html-renderer.d.ts +3 -2
- package/dist/renderer/html-renderer.js +99 -99
- package/dist/renderer/icons.d.ts +29 -0
- package/dist/renderer/icons.js +66 -0
- package/dist/renderer/layout.js +81 -68
- package/dist/renderer/observation-inbox/styles.d.ts +1 -1
- package/dist/renderer/observation-inbox/styles.js +53 -53
- package/dist/renderer/report-shell.d.ts +77 -0
- package/dist/renderer/report-shell.js +223 -0
- package/dist/renderer/skill-detail-renderer.js +147 -352
- package/dist/renderer/skill-health-renderer.js +50 -73
- package/dist/renderer/skill-list-renderer.js +358 -306
- package/dist/renderer/summary.js +272 -162
- package/dist/renderer/test-view.d.ts +4 -3
- package/dist/renderer/test-view.js +386 -135
- package/dist/server/report-server.js +142 -28
- package/dist/types/doctor.d.ts +22 -0
- package/dist/types/managed.d.ts +17 -3
- package/package.json +1 -1
|
@@ -5,8 +5,9 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import { renderReportDocumentDetail, renderTrendsPage, renderRunList } from '../renderer/html-renderer.js';
|
|
7
7
|
import { renderSkillList } from '../renderer/skill-list-renderer.js';
|
|
8
|
-
import { renderSkillDetail } from '../renderer/skill-detail-renderer.js';
|
|
9
8
|
import { renderSkillHealthReport } from '../renderer/skill-health-renderer.js';
|
|
9
|
+
import { renderDoctorDetail } from '../renderer/doctor-detail-renderer.js';
|
|
10
|
+
import { assessHealth } from '../renderer/skill-detail-renderer.js';
|
|
10
11
|
import { renderObservationInboxPage } from '../renderer/observation-inbox-renderer.js';
|
|
11
12
|
import { DEFAULT_LANG, t, layout } from '../renderer/layout.js';
|
|
12
13
|
import { buildSkillIndex } from './skill-index.js';
|
|
@@ -80,6 +81,28 @@ function loadAnalysis(dir, id) {
|
|
|
80
81
|
return null;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
84
|
+
/** 扫 doctorsDir 找 id 匹配的 doctor 报告(文件名不一定等于 report id)。
|
|
85
|
+
* 批量 doctor 会按 skill 拆成多份共享同一 id 的 per-skill 文件,传 skillName 时
|
|
86
|
+
* 优先返回含该 skill 的那份;都不含时回退首个 id 命中(单 skill / 无参行为不变)。 */
|
|
87
|
+
function loadDoctorReport(dir, id, skillName) {
|
|
88
|
+
if (!existsSync(dir))
|
|
89
|
+
return null;
|
|
90
|
+
let fallback = null;
|
|
91
|
+
for (const file of readdirSync(dir)) {
|
|
92
|
+
if (!file.endsWith('.json'))
|
|
93
|
+
continue;
|
|
94
|
+
try {
|
|
95
|
+
const data = JSON.parse(readFileSync(join(dir, file), 'utf-8'));
|
|
96
|
+
if (data?.kind !== 'doctor' || data.id !== id)
|
|
97
|
+
continue;
|
|
98
|
+
if (!skillName || data.skills?.some((s) => s.skillName === skillName))
|
|
99
|
+
return data;
|
|
100
|
+
fallback ??= data;
|
|
101
|
+
}
|
|
102
|
+
catch { /* skip */ }
|
|
103
|
+
}
|
|
104
|
+
return fallback;
|
|
105
|
+
}
|
|
83
106
|
/**
|
|
84
107
|
* 扫 analyses/ 所有 JSON,按 skillName 过滤,按时间排序成 trend points。
|
|
85
108
|
*/
|
|
@@ -204,6 +227,85 @@ function readJsonBody(req, maxBytes = 1024 * 1024) {
|
|
|
204
227
|
req.on('error', reject);
|
|
205
228
|
});
|
|
206
229
|
}
|
|
230
|
+
function fmtHistDate(ts, lang) {
|
|
231
|
+
if (!ts)
|
|
232
|
+
return '-';
|
|
233
|
+
try {
|
|
234
|
+
const d = new Date(ts);
|
|
235
|
+
return d.toLocaleString(lang === 'zh' ? 'zh-CN' : 'en-US', { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return ts;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// 报告详情页顶部「skill 上下文」:doctor/eval/observe 维度切换器 + 「全部历史」弹框(该 skill 历次 run)。
|
|
242
|
+
// observe 详情是 fleet 级日报,无 per-skill 页,observe chip 只当状态点不可点。
|
|
243
|
+
function buildSkillContext(entry, currentDim, currentReportId, insights, lang) {
|
|
244
|
+
const zh = lang === 'zh';
|
|
245
|
+
const langQ = lang === DEFAULT_LANG ? '' : `?lang=${lang}`;
|
|
246
|
+
const amp = lang === DEFAULT_LANG ? '' : `&lang=${lang}`;
|
|
247
|
+
// 综合健康分(= 跨维度聚合,与首页列表同一口径)— 报告页只显单维度分数,这里把「总分」也带上。
|
|
248
|
+
const health = assessHealth(entry, insights, lang);
|
|
249
|
+
const d = entry.doctor;
|
|
250
|
+
const dTotal = d ? d.passCount + d.warnCount + d.failCount : 0;
|
|
251
|
+
const dScore = d && dTotal > 0 ? Math.round(((d.passCount + d.warnCount * 0.5) / dTotal) * 100) : null;
|
|
252
|
+
const dBand = d ? (d.failCount > 0 ? 'red' : d.warnCount > 0 ? 'yellow' : 'green') : 'gray';
|
|
253
|
+
const ev = entry.eval;
|
|
254
|
+
const evScore = ev && ev.compositeScore != null ? Math.round((ev.compositeScore / 5) * 100) : null;
|
|
255
|
+
const evBand = ev && ev.compositeScore != null
|
|
256
|
+
? (ev.compositeScore >= 4 ? 'green' : ev.compositeScore >= 3 ? 'yellow' : 'red') : 'gray';
|
|
257
|
+
const ob = entry.observe;
|
|
258
|
+
const obScore = ob ? Math.round((1 - ob.gapRate) * 100) : null;
|
|
259
|
+
const obBand = ob ? ob.healthBand : 'gray';
|
|
260
|
+
// 历史:eval + doctor 历次 run,各自新→旧。点行跳到那次报告。
|
|
261
|
+
// evalHistory 是「每轮一条」,但一份 evolve 报告(多轮)是同一个 reportId —— 按 reportId 去重,
|
|
262
|
+
// 一份报告只算一条(取末轮 treatment 分数,与报告头部一致),否则同一报告的多轮会都标「当前」。
|
|
263
|
+
const evalRoundCount = new Map();
|
|
264
|
+
const evalByReport = new Map();
|
|
265
|
+
for (const h of entry.evalHistory) {
|
|
266
|
+
evalRoundCount.set(h.reportId, (evalRoundCount.get(h.reportId) ?? 0) + 1);
|
|
267
|
+
evalByReport.set(h.reportId, h); // 末轮(最高 round)胜出 —— history 已按 timestamp#round 升序
|
|
268
|
+
}
|
|
269
|
+
const evalHist = [...evalByReport.values()].reverse().map((h) => {
|
|
270
|
+
const rounds = evalRoundCount.get(h.reportId) ?? 1;
|
|
271
|
+
return {
|
|
272
|
+
dim: 'eval',
|
|
273
|
+
dateText: fmtHistDate(h.timestamp, lang),
|
|
274
|
+
scoreText: h.compositeScore != null ? `${h.compositeScore.toFixed(2)} / 5` : '—',
|
|
275
|
+
band: (h.compositeScore == null ? 'gray' : h.compositeScore >= 4 ? 'green' : h.compositeScore >= 3 ? 'yellow' : 'red'),
|
|
276
|
+
metaText: `${h.passCount}/${h.totalSamples} ${zh ? '通过' : 'pass'}${h.failCount > 0 ? ` · ${h.failCount} ${zh ? '失败' : 'fail'}` : ''}${rounds > 1 ? ` · ${rounds} ${zh ? '轮' : 'rounds'}` : ''}`,
|
|
277
|
+
href: `/reports/${encodeURIComponent(h.reportId)}${langQ}`,
|
|
278
|
+
current: h.reportId === currentReportId,
|
|
279
|
+
};
|
|
280
|
+
});
|
|
281
|
+
const doctorHist = [...entry.doctorHistory].reverse().map((h) => {
|
|
282
|
+
const tot = h.passCount + h.warnCount + h.failCount;
|
|
283
|
+
return {
|
|
284
|
+
dim: 'doctor',
|
|
285
|
+
dateText: fmtHistDate(h.timestamp, lang),
|
|
286
|
+
scoreText: tot > 0 ? `${Math.round(((h.passCount + h.warnCount * 0.5) / tot) * 100)}` : '—',
|
|
287
|
+
band: (h.failCount > 0 ? 'red' : h.warnCount > 0 ? 'yellow' : 'green'),
|
|
288
|
+
metaText: `${h.passCount}✓ ${h.warnCount}⚠ ${h.failCount}✗`,
|
|
289
|
+
href: `/doctors/${encodeURIComponent(h.reportId)}?skill=${encodeURIComponent(entry.skillName)}${amp}`,
|
|
290
|
+
current: h.reportId === currentReportId,
|
|
291
|
+
};
|
|
292
|
+
});
|
|
293
|
+
return {
|
|
294
|
+
skillName: entry.skillName,
|
|
295
|
+
overall: { score: health.score, band: health.color },
|
|
296
|
+
// 当前维度 chip 不显分数(hero ring 已显示「本报告」分数,避免与「最新」分数冲突);非当前维度显「最新」分数 + 链接。
|
|
297
|
+
chips: [
|
|
298
|
+
{ dim: 'doctor', label: zh ? '体检' : 'Doctor', score: currentDim === 'doctor' ? null : dScore, band: dBand,
|
|
299
|
+
href: currentDim === 'doctor' || !d ? null : `/doctors/${encodeURIComponent(d.reportId)}?skill=${encodeURIComponent(entry.skillName)}${amp}`,
|
|
300
|
+
active: currentDim === 'doctor' },
|
|
301
|
+
{ dim: 'eval', label: zh ? '评测' : 'Eval', score: currentDim === 'eval' ? null : evScore, band: evBand,
|
|
302
|
+
href: currentDim === 'eval' || !ev ? null : `/reports/${encodeURIComponent(ev.reportId)}${langQ}`,
|
|
303
|
+
active: currentDim === 'eval' },
|
|
304
|
+
{ dim: 'observe', label: zh ? '观察' : 'Observe', score: obScore, band: obBand, href: null, active: false },
|
|
305
|
+
],
|
|
306
|
+
history: [...evalHist, ...doctorHist],
|
|
307
|
+
};
|
|
308
|
+
}
|
|
207
309
|
function renderSkillDiffPage(diff, lang = DEFAULT_LANG) {
|
|
208
310
|
const { fromId, toId, fromAt, toAt, rows } = diff;
|
|
209
311
|
const langQ = lang === DEFAULT_LANG ? '' : `?lang=${lang}`;
|
|
@@ -561,6 +663,29 @@ export function createReportServer({ port, host: hostOption, reportsDir = DEFAUL
|
|
|
561
663
|
res.end(JSON.stringify({ error: 'method not allowed' }));
|
|
562
664
|
return;
|
|
563
665
|
}
|
|
666
|
+
const doctorDetailMatch = path.match(/^\/doctors\/(.+)$/);
|
|
667
|
+
if (doctorDetailMatch) {
|
|
668
|
+
const id = decodeURIComponent(doctorDetailMatch[1]);
|
|
669
|
+
const skillName = parsed.searchParams.get('skill') ?? '';
|
|
670
|
+
const report = loadDoctorReport(doctorsDir, id, skillName || undefined);
|
|
671
|
+
if (!report) {
|
|
672
|
+
res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' });
|
|
673
|
+
res.end(lang === 'en' ? 'doctor report not found' : '体检报告不存在');
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
let ctx;
|
|
677
|
+
if (skillName) {
|
|
678
|
+
const runs = await reportStore.list();
|
|
679
|
+
const idx = buildSkillIndex(runs, analysesDir, doctorsDir, observationsDir);
|
|
680
|
+
const entry = idx.entries.find((en) => en.skillName === skillName);
|
|
681
|
+
if (entry)
|
|
682
|
+
ctx = buildSkillContext(entry, 'doctor', id, idx.insightsBySkill.get(entry.skillName) ?? [], lang);
|
|
683
|
+
}
|
|
684
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
685
|
+
const langQ = lang === DEFAULT_LANG ? '' : `?lang=${lang}`;
|
|
686
|
+
res.end(renderDoctorDetail(report, skillName, langQ, lang, ctx));
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
564
689
|
const analysisDetailMatch = path.match(/^\/analyses\/(.+)$/);
|
|
565
690
|
if (analysisDetailMatch) {
|
|
566
691
|
const id = decodeURIComponent(analysisDetailMatch[1]);
|
|
@@ -708,9 +833,19 @@ export function createReportServer({ port, host: hostOption, reportsDir = DEFAUL
|
|
|
708
833
|
}
|
|
709
834
|
const reportPageMatch = path.match(/^\/reports\/(.+)$/);
|
|
710
835
|
if (reportPageMatch) {
|
|
711
|
-
const
|
|
836
|
+
const reportId = decodeURIComponent(reportPageMatch[1]);
|
|
837
|
+
const report = await queryRun(reportStore, reportId);
|
|
838
|
+
let ctx;
|
|
839
|
+
if (report && report.kind === 'evaluation') {
|
|
840
|
+
const runs = await reportStore.list();
|
|
841
|
+
const idx = buildSkillIndex(runs, analysesDir, doctorsDir, observationsDir);
|
|
842
|
+
// 按 evalHistory 匹配(非仅最新),历史 eval 报告也能定位到所属 skill。
|
|
843
|
+
const entry = idx.entries.find((en) => en.evalHistory.some((h) => h.reportId === reportId));
|
|
844
|
+
if (entry)
|
|
845
|
+
ctx = buildSkillContext(entry, 'eval', reportId, idx.insightsBySkill.get(entry.skillName) ?? [], lang);
|
|
846
|
+
}
|
|
712
847
|
res.writeHead(report ? 200 : 404, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
713
|
-
res.end(renderReportDocumentDetail(report, lang));
|
|
848
|
+
res.end(renderReportDocumentDetail(report, lang, ctx));
|
|
714
849
|
return;
|
|
715
850
|
}
|
|
716
851
|
// 老 run 列表 — 兼容老书签。/skills/ 切换为默认后,run 列表挪这里。
|
|
@@ -745,31 +880,10 @@ export function createReportServer({ port, host: hostOption, reportsDir = DEFAUL
|
|
|
745
880
|
}));
|
|
746
881
|
return;
|
|
747
882
|
}
|
|
748
|
-
//
|
|
749
|
-
//
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const skillName = decodeURIComponent(skillDetailMatch[1]);
|
|
753
|
-
const runs = await reportStore.list();
|
|
754
|
-
const idx = buildSkillIndex(runs, analysesDir, doctorsDir, observationsDir);
|
|
755
|
-
const entry = idx.entries.find((e) => e.skillName === skillName);
|
|
756
|
-
if (!entry) {
|
|
757
|
-
res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' });
|
|
758
|
-
res.end(`Skill not found: ${skillName}`);
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
// 加载完整 eval 报告(为详情页提供 layered scores / coverage / per-sample diagnostic)
|
|
762
|
-
let evalReport = null;
|
|
763
|
-
if (entry.eval) {
|
|
764
|
-
const r = await reportStore.get(entry.eval.reportId);
|
|
765
|
-
if (r && r.kind === 'evaluation')
|
|
766
|
-
evalReport = r;
|
|
767
|
-
}
|
|
768
|
-
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
769
|
-
const insights = idx.insightsBySkill.get(skillName) ?? [];
|
|
770
|
-
res.end(renderSkillDetail(entry, evalReport, lang, insights));
|
|
771
|
-
return;
|
|
772
|
-
}
|
|
883
|
+
// 注:/skills/<name> 详情页(hub)已下线 — 首页点行直接进 eval/doctor 报告,跨维度靠
|
|
884
|
+
// 报告页 chip 条 +「全部历史」弹框,不再有中间汇总页。该路由不做兼容重定向:Studio
|
|
885
|
+
// 是本地临时服务器、端口每次启动都变,跨会话书签 localhost:<port> 本就失效,且 PR 内
|
|
886
|
+
// 已无任何链接指向它。未匹配的 /skills/<name> 直接落到下方通用 404。
|
|
773
887
|
const skillDiagnosticsApiMatch = path.match(/^\/api\/skills\/(.+)\/diagnostics$/);
|
|
774
888
|
if (skillDiagnosticsApiMatch) {
|
|
775
889
|
const skillName = decodeURIComponent(skillDiagnosticsApiMatch[1]);
|
package/dist/types/doctor.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export interface DoctorRule {
|
|
|
85
85
|
severity: DoctorSeverity;
|
|
86
86
|
/** i18n key,terminal 渲染时用作 rule 标题。 */
|
|
87
87
|
labelKey: string;
|
|
88
|
+
/** true = 需要外部 I/O(网络 / LLM)的"在线"检查,跟 skill_health composer 同档:
|
|
89
|
+
* 默认 `omk doctor` 会跑,`--static-only` 离线模式跳过。endpoint 自定义维度置 true。
|
|
90
|
+
* 缺省(undefined/false)= 纯静态低成本检查(内置 4 条),静态模式才跑。 */
|
|
91
|
+
external?: boolean;
|
|
88
92
|
check(ctx: DoctorContext): Promise<DoctorRuleCheckOutcome>;
|
|
89
93
|
}
|
|
90
94
|
export interface DoctorSkillReport {
|
|
@@ -126,6 +130,21 @@ export interface DoctorReport {
|
|
|
126
130
|
total: number;
|
|
127
131
|
};
|
|
128
132
|
}
|
|
133
|
+
/** 批量体检的 per-skill 进度事件。runDoctor 在遍历 artifacts 时,每个 skill
|
|
134
|
+
* 开始(skill_start)和结束(skill_done)各发一次,对齐 eval 的 per-sample 进度。 */
|
|
135
|
+
export interface DoctorProgressInfo {
|
|
136
|
+
phase: 'skill_start' | 'skill_done';
|
|
137
|
+
/** 第几个 skill(1-based)。 */
|
|
138
|
+
index: number;
|
|
139
|
+
/** skill 总数。 */
|
|
140
|
+
total: number;
|
|
141
|
+
skillName: string;
|
|
142
|
+
/** 仅 skill_done:该 skill 的最终状态。 */
|
|
143
|
+
status?: DoctorSkillStatus;
|
|
144
|
+
/** 仅 skill_done:该 skill 全部 rule 的执行耗时(ms)。 */
|
|
145
|
+
durationMs?: number;
|
|
146
|
+
}
|
|
147
|
+
export type DoctorProgressCallback = (info: DoctorProgressInfo) => void;
|
|
129
148
|
export interface DoctorRunOptions {
|
|
130
149
|
/** 单 skill 文件 / 目录 / null(=cwd 当前目录批量)。当 artifacts 显式提供时, target 被忽略。 */
|
|
131
150
|
target?: string | null;
|
|
@@ -153,4 +172,7 @@ export interface DoctorRunOptions {
|
|
|
153
172
|
* programmatic API 默认 false。 */
|
|
154
173
|
runHealthCheck?: boolean;
|
|
155
174
|
effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
175
|
+
/** 批量体检进度回调(per-skill)。CLI 非 gate 模式注入、写 stderr;eval 内嵌
|
|
176
|
+
* 调用不传(eval 有自己的进度体系,不应冒出 doctor 进度)。 */
|
|
177
|
+
onProgress?: DoctorProgressCallback;
|
|
156
178
|
}
|
package/dist/types/managed.d.ts
CHANGED
|
@@ -52,12 +52,25 @@ export interface ManagedEvidenceRef {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export type ManagedDecisionKind = 'promote' | 'reject' | 'rollback';
|
|
55
|
-
/** 一次人工管理决定。install 时为空,promote/reject/rollback
|
|
55
|
+
/** 一次人工管理决定。install 时为空,promote/reject/rollback 追加(append-only 事件流)。 */
|
|
56
56
|
export interface ManagedDecision {
|
|
57
57
|
decisionKind: ManagedDecisionKind;
|
|
58
58
|
actor: string;
|
|
59
59
|
decidedAt: string;
|
|
60
60
|
reason?: string;
|
|
61
|
+
/** 被该决定接受 / 回滚到的内容 hash —— 锚定「决定的是哪份内容」。promote 取决定时的 record.contentHash;
|
|
62
|
+
* 读时只把与当前 contentHash 匹配的 promote 决定算作「当前版本已 promoted」(旧内容的决定不冒充当前)。 */
|
|
63
|
+
contentHash?: string;
|
|
64
|
+
/** 该决定锚定的证据 report(promote 取 latestCurrentEvidence 那条的 reportId)——可回溯「凭什么 ship」。 */
|
|
65
|
+
reportId?: string;
|
|
66
|
+
/** 越门记录:门禁本应拦下,经 --force 显式越过时记下供审计(spec §7「Overrides must be explicit and
|
|
67
|
+
* recorded」)。无此字段 = 正常通过门禁。`verdict` 是越门时证据的 verdict(上下文);`overriddenBlocks`
|
|
68
|
+
* 是真正被越过的判据(drifted / incomparable / verdict_blocked),让审计能回答「越过了什么」—— 只看
|
|
69
|
+
* verdict 会误导(仅因 drift 越门时 verdict 可能仍是 PROGRESS)。 */
|
|
70
|
+
override?: {
|
|
71
|
+
verdict: string;
|
|
72
|
+
overriddenBlocks?: string[];
|
|
73
|
+
};
|
|
61
74
|
}
|
|
62
75
|
export interface ManagedArtifactSource {
|
|
63
76
|
/** 源类型(限定判别字,非裸 kind)。`file`=本地路径;`git`=当前仓库某 ref 或远端(带 url)。 */
|
|
@@ -92,8 +105,9 @@ export interface ManagedArtifactRecord {
|
|
|
92
105
|
evidence: ManagedEvidenceRef[];
|
|
93
106
|
decisions: ManagedDecision[];
|
|
94
107
|
}
|
|
95
|
-
/** 读时推导的生命周期标签——不持久(见文件头说明)
|
|
96
|
-
|
|
108
|
+
/** 读时推导的生命周期标签——不持久(见文件头说明)。`promoted` 由当前内容(contentHash 匹配)有一条
|
|
109
|
+
* promote 决定推出:它是 measurable 之上的「已人工接受当前版本」,故优先级高于 measurable。 */
|
|
110
|
+
export type ManagedLifecycleLabel = 'discovered' | 'installed' | 'measurable' | 'stale' | 'promoted';
|
|
97
111
|
export interface DerivedManagedState {
|
|
98
112
|
label: ManagedLifecycleLabel;
|
|
99
113
|
/** 当前源 hash 与记录的 contentHash 不一致(或源已不在)。 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-knowledge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"packageManager": "yarn@4.16.0",
|
|
5
5
|
"description": "Evaluation framework for LLM knowledge inputs — prompts, RAG corpora, skills, agent workflows. Fix the model, vary the artifact. Built-in statistical rigor: bootstrap CI, Krippendorff α, length-debias, saturation curves.",
|
|
6
6
|
"type": "module",
|