oh-my-knowledge 0.47.0 → 0.49.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 +50 -18
- package/README.zh.md +55 -23
- package/dist/analysis/coverage-analyzer.d.ts +1 -0
- package/dist/analysis/coverage-analyzer.js +125 -62
- package/dist/analysis/failure-clusterer.js +2 -1
- package/dist/analysis/gap-analyzer.d.ts +2 -2
- package/dist/analysis/gap-analyzer.js +13 -3
- package/dist/analysis/hedging-classifier.d.ts +2 -2
- package/dist/analysis/hedging-classifier.js +3 -4
- package/dist/analysis/report-diagnostics.js +9 -7
- package/dist/analysis/sample-diagnostics.js +6 -6
- package/dist/artifact-graph/doctor.js +15 -7
- package/dist/assets/agent-skills/omk/SKILL.md +27 -7
- package/dist/assets/agent-skills/omk/references/commands.md +19 -17
- package/dist/authoring/evolver.d.ts +10 -6
- package/dist/authoring/evolver.js +496 -83
- package/dist/authoring/generator.d.ts +3 -3
- package/dist/authoring/generator.js +5 -10
- package/dist/authoring/sample-fixer.d.ts +8 -6
- package/dist/authoring/sample-fixer.js +76 -5
- package/dist/cli/commands/doctor.js +31 -14
- package/dist/cli/commands/eval/index.d.ts +3 -0
- package/dist/cli/commands/eval/index.js +163 -17
- package/dist/cli/commands/evolve.d.ts +4 -4
- package/dist/cli/commands/evolve.js +27 -13
- package/dist/cli/commands/init.js +16 -3
- package/dist/cli/commands/observe/inbox.js +44 -21
- package/dist/cli/commands/observe/index.js +20 -11
- package/dist/cli/commands/observe/ingest.d.ts +3 -0
- package/dist/cli/commands/observe/ingest.js +35 -4
- package/dist/cli/commands/sample.d.ts +9 -3
- package/dist/cli/commands/sample.js +91 -74
- package/dist/cli/lib/cmd-flags.d.ts +1 -0
- package/dist/cli/lib/codex-model-hint.d.ts +9 -0
- package/dist/cli/lib/codex-model-hint.js +45 -0
- package/dist/cli/lib/generation-failure-hint.d.ts +2 -0
- package/dist/cli/lib/generation-failure-hint.js +61 -0
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/common.js +4 -0
- package/dist/cli/lib/i18n-dict/gen.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/gen.js +38 -6
- package/dist/cli/lib/i18n-dict/help.js +6 -6
- package/dist/cli/lib/i18n-dict/init.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/init.js +13 -9
- package/dist/cli/lib/i18n-dict/run.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/run.js +34 -2
- package/dist/cli/lib/llm-failure-classifier.d.ts +2 -0
- package/dist/cli/lib/llm-failure-classifier.js +8 -0
- package/dist/cli/lib/parse-run-config.d.ts +6 -5
- package/dist/cli/lib/parse-run-config.js +16 -9
- package/dist/cli/lib/runtime-defaults.d.ts +21 -0
- package/dist/cli/lib/runtime-defaults.js +79 -0
- package/dist/diagnosis/observe-mapper.js +14 -15
- package/dist/diagnosis/observe-producer.js +3 -1
- package/dist/diagnosis/studio-projection.js +14 -7
- package/dist/diagnosis/types.d.ts +2 -0
- package/dist/diagnosis/types.js +12 -0
- package/dist/doctor/endpoint-rule.js +2 -1
- package/dist/eval-core/artifact-file-names.js +18 -1
- package/dist/eval-core/artifact-index.d.ts +7 -11
- package/dist/eval-core/artifact-index.js +139 -80
- package/dist/eval-core/cache.d.ts +12 -3
- package/dist/eval-core/cache.js +89 -29
- package/dist/eval-core/comparability.js +10 -6
- package/dist/eval-core/evaluation-execution.d.ts +2 -1
- package/dist/eval-core/evaluation-execution.js +122 -37
- package/dist/eval-core/evaluation-job.d.ts +4 -1
- package/dist/eval-core/evaluation-job.js +4 -1
- package/dist/eval-core/evaluation-reporting.d.ts +15 -13
- package/dist/eval-core/evaluation-reporting.js +54 -52
- package/dist/eval-core/execution-strategy.d.ts +2 -0
- package/dist/eval-core/execution-strategy.js +11 -9
- package/dist/eval-core/fact-checker.js +15 -7
- package/dist/eval-core/holdout.js +3 -2
- package/dist/eval-core/judge-independence.d.ts +2 -2
- package/dist/eval-core/mock-hook.cjs +23 -6
- package/dist/eval-core/mocks-runtime.js +30 -8
- package/dist/eval-core/report-document.d.ts +12 -0
- package/dist/eval-core/report-document.js +1151 -0
- package/dist/eval-core/report-extensions.d.ts +4 -0
- package/dist/eval-core/report-extensions.js +500 -0
- package/dist/eval-core/report-file-migration.js +7 -2
- package/dist/eval-core/resume-compatibility.d.ts +31 -0
- package/dist/eval-core/resume-compatibility.js +141 -0
- package/dist/eval-core/sample-fingerprint.d.ts +12 -0
- package/dist/eval-core/sample-fingerprint.js +193 -0
- package/dist/eval-core/schema.js +86 -31
- package/dist/eval-core/verdict.d.ts +8 -4
- package/dist/eval-core/verdict.js +24 -10
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts +2 -1
- package/dist/eval-workflows/batch-evaluation-workflow.js +25 -12
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +10 -5
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +58 -21
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +3 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +4 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js +4 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +6 -5
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +17 -10
- package/dist/eval-workflows/evaluation-pipeline.js +12 -7
- package/dist/eval-workflows/run-evaluation.d.ts +9 -7
- package/dist/eval-workflows/run-evaluation.js +79 -51
- package/dist/executors/anthropic-api.js +65 -9
- package/dist/executors/claude-cli.js +16 -79
- package/dist/executors/claude-protocol.d.ts +28 -0
- package/dist/executors/claude-protocol.js +180 -0
- package/dist/executors/claude-sdk-trace.js +56 -28
- package/dist/executors/claude-sdk.d.ts +1 -0
- package/dist/executors/claude-sdk.js +39 -93
- package/dist/executors/codex-cli-trace.js +166 -31
- package/dist/executors/codex-cli.d.ts +6 -8
- package/dist/executors/codex-cli.js +49 -151
- package/dist/executors/codex-protocol.d.ts +24 -0
- package/dist/executors/codex-protocol.js +234 -0
- package/dist/executors/codex-sdk.js +68 -120
- package/dist/executors/gemini.js +88 -13
- package/dist/executors/index.d.ts +2 -3
- package/dist/executors/index.js +5 -3
- package/dist/executors/openai-api.js +70 -9
- package/dist/executors/runtime-fingerprint.js +88 -11
- package/dist/executors/script-command.d.ts +8 -0
- package/dist/executors/script-command.js +87 -0
- package/dist/executors/script.js +202 -29
- package/dist/executors/shared.d.ts +35 -3
- package/dist/executors/shared.js +113 -15
- package/dist/grading/assertions.d.ts +1 -1
- package/dist/grading/assertions.js +19 -9
- package/dist/grading/diagnostic.d.ts +9 -2
- package/dist/grading/diagnostic.js +25 -2
- package/dist/grading/index.js +10 -4
- package/dist/grading/judge.js +19 -6
- package/dist/grading/layered-scores.d.ts +2 -3
- package/dist/grading/layered-scores.js +2 -3
- package/dist/inputs/load-samples.d.ts +1 -2
- package/dist/inputs/load-samples.js +23 -1
- package/dist/inputs/mcp-resolver.js +6 -3
- package/dist/inputs/sample-document.d.ts +11 -0
- package/dist/inputs/sample-document.js +96 -0
- package/dist/managed/evidence.d.ts +1 -0
- package/dist/managed/evidence.js +1 -1
- package/dist/managed/store.js +200 -91
- package/dist/observability/codex-trace-adapter.d.ts +5 -0
- package/dist/observability/codex-trace-adapter.js +850 -0
- package/dist/observability/experience.d.ts +32 -6
- package/dist/observability/experience.js +2695 -459
- package/dist/observability/feedback-matchers.js +16 -1
- package/dist/observability/inbox-view-model.d.ts +2 -1
- package/dist/observability/inbox-view-model.js +20 -14
- package/dist/observability/inbox.d.ts +7 -1
- package/dist/observability/inbox.js +632 -124
- package/dist/observability/problem-patterns.js +2 -0
- package/dist/observability/review-state.d.ts +6 -0
- package/dist/observability/review-state.js +235 -63
- package/dist/observability/skill-chain-advisories.js +1 -1
- package/dist/observability/skill-chain.js +17 -4
- package/dist/observability/skill-health-analyzer.d.ts +32 -7
- package/dist/observability/skill-health-analyzer.js +194 -121
- package/dist/observability/skill-health-report.d.ts +10 -0
- package/dist/observability/skill-health-report.js +620 -0
- package/dist/observability/soft-standards/constants.d.ts +0 -1
- package/dist/observability/soft-standards/constants.js +0 -1
- package/dist/observability/soft-standards/index.d.ts +1 -1
- package/dist/observability/soft-standards/index.js +1 -1
- package/dist/observability/soft-standards/llm-extractor.js +8 -10
- package/dist/observability/soft-standards/skill-standards-store.d.ts +2 -1
- package/dist/observability/soft-standards/skill-standards-store.js +59 -18
- package/dist/observability/soft-standards/types.d.ts +2 -2
- package/dist/observability/trace-adapter.d.ts +12 -7
- package/dist/observability/trace-adapter.js +11 -9
- package/dist/observability/trace-attribution.d.ts +13 -5
- package/dist/observability/trace-attribution.js +315 -21
- package/dist/observability/trace-ingestion.d.ts +9 -0
- package/dist/observability/trace-ingestion.js +80 -0
- package/dist/observability/trace-ir.d.ts +113 -0
- package/dist/observability/trace-ir.js +87 -0
- package/dist/observability/trace-segmenter.d.ts +19 -6
- package/dist/observability/trace-segmenter.js +377 -196
- package/dist/observability/trace-session-index.d.ts +19 -0
- package/dist/observability/trace-session-index.js +68 -0
- package/dist/observability/trace-source.d.ts +12 -4
- package/dist/observability/trace-source.js +939 -215
- package/dist/renderer/html-renderer.js +37 -6
- package/dist/renderer/icons.js +3 -0
- package/dist/renderer/observation-inbox-renderer.js +227 -91
- package/dist/renderer/skill-detail-renderer.js +452 -109
- package/dist/renderer/skill-health-renderer.js +69 -12
- package/dist/renderer/summary.js +28 -7
- package/dist/renderer/table.js +21 -4
- package/dist/renderer/test-view.d.ts +1 -0
- package/dist/renderer/test-view.js +44 -9
- package/dist/server/indexed-report-store.js +14 -18
- package/dist/server/job-store.js +64 -26
- package/dist/server/report-server.js +190 -78
- package/dist/server/report-store.js +57 -80
- package/dist/server/skill-index.js +143 -49
- package/dist/server/skill-insights.js +44 -5
- package/dist/shared/artifact-graph.d.ts +3 -0
- package/dist/shared/artifact-graph.js +224 -0
- package/dist/shared/assertion-types.d.ts +8 -0
- package/dist/shared/assertion-types.js +46 -0
- package/dist/shared/atomic-json.d.ts +8 -0
- package/dist/shared/atomic-json.js +33 -0
- package/dist/shared/diagnosis-schema.d.ts +9 -0
- package/dist/shared/diagnosis-schema.js +181 -0
- package/dist/shared/doctor-report.d.ts +3 -0
- package/dist/shared/doctor-report.js +103 -0
- package/dist/shared/evaluation-job.d.ts +6 -0
- package/dist/shared/evaluation-job.js +217 -0
- package/dist/shared/executor-result.d.ts +17 -0
- package/dist/shared/executor-result.js +221 -0
- package/dist/shared/file-lock.d.ts +12 -0
- package/dist/shared/file-lock.js +129 -0
- package/dist/shared/json-value.d.ts +5 -0
- package/dist/shared/json-value.js +36 -0
- package/dist/shared/keyed-mutex.d.ts +7 -0
- package/dist/shared/keyed-mutex.js +24 -0
- package/dist/shared/record-count.d.ts +8 -0
- package/dist/shared/record-count.js +43 -0
- package/dist/shared/sample-contract.d.ts +3 -0
- package/dist/shared/sample-contract.js +332 -0
- package/dist/shared/shell-quote.d.ts +2 -0
- package/dist/shared/shell-quote.js +7 -0
- package/dist/shared/timestamp.d.ts +6 -0
- package/dist/shared/timestamp.js +64 -0
- package/dist/shared/token-usage.d.ts +19 -0
- package/dist/shared/token-usage.js +50 -0
- package/dist/shared/tool-call-status.d.ts +8 -0
- package/dist/shared/tool-call-status.js +28 -0
- package/dist/shared/tool-identity.d.ts +21 -0
- package/dist/shared/tool-identity.js +84 -0
- package/dist/shared/tool-search.js +73 -16
- package/dist/shared/trace-projection.d.ts +5 -0
- package/dist/shared/trace-projection.js +20 -0
- package/dist/shared/trace-source-kind.d.ts +3 -0
- package/dist/shared/trace-source-kind.js +12 -0
- package/dist/types/diagnosis.d.ts +2 -0
- package/dist/types/eval.d.ts +4 -0
- package/dist/types/executor.d.ts +32 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/judge.d.ts +2 -0
- package/dist/types/observability.d.ts +116 -9
- package/dist/types/report.d.ts +58 -6
- package/dist/types/skill-index.d.ts +7 -0
- package/dist/types/trace.d.ts +2 -0
- package/dist/types/trace.js +1 -0
- package/package.json +9 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TraceSession } from './trace-ir.js';
|
|
2
|
+
export interface TraceSessionRef {
|
|
3
|
+
traceId?: string;
|
|
4
|
+
traceSessionId?: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
sourceTrace?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TraceSessionIndex {
|
|
9
|
+
resolve(ref: TraceSessionRef): TraceSession | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function traceSessionRefIdentity(ref: TraceSessionRef): string;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve projected segments back to their physical evidence stream.
|
|
14
|
+
*
|
|
15
|
+
* `sourcePath` is not an identity: one Markdown log can contain many sessions.
|
|
16
|
+
* Prefer the globally unique traceId, then source + concrete run id. Single-key
|
|
17
|
+
* fallbacks are only retained when unambiguous.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createTraceSessionIndex(sessions: TraceSession[]): TraceSessionIndex;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export function traceSessionRefIdentity(ref) {
|
|
2
|
+
return ref.traceId
|
|
3
|
+
?? `${ref.sourceTrace ?? ''}\u0000${ref.traceSessionId ?? ref.sessionId}`;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Resolve projected segments back to their physical evidence stream.
|
|
7
|
+
*
|
|
8
|
+
* `sourcePath` is not an identity: one Markdown log can contain many sessions.
|
|
9
|
+
* Prefer the globally unique traceId, then source + concrete run id. Single-key
|
|
10
|
+
* fallbacks are only retained when unambiguous.
|
|
11
|
+
*/
|
|
12
|
+
export function createTraceSessionIndex(sessions) {
|
|
13
|
+
const byTraceId = uniqueIndex(sessions, (session) => session.traceId);
|
|
14
|
+
const bySourceAndRun = uniqueIndex(sessions, (session) => `${session.sourcePath}\u0000${session.runId}`);
|
|
15
|
+
const byRunId = uniqueIndex(sessions, (session) => session.runId);
|
|
16
|
+
const bySourcePath = uniqueIndex(sessions, (session) => session.sourcePath);
|
|
17
|
+
const byRootRunId = uniqueIndex(sessions, (session) => session.rootRunId);
|
|
18
|
+
return {
|
|
19
|
+
resolve(ref) {
|
|
20
|
+
if (ref.traceId) {
|
|
21
|
+
return matchingSession(byTraceId.get(ref.traceId), ref);
|
|
22
|
+
}
|
|
23
|
+
if (ref.sourceTrace && ref.traceSessionId) {
|
|
24
|
+
return matchingSession(bySourceAndRun.get(`${ref.sourceTrace}\u0000${ref.traceSessionId}`), ref);
|
|
25
|
+
}
|
|
26
|
+
if (ref.traceSessionId) {
|
|
27
|
+
const concrete = byRunId.get(ref.traceSessionId);
|
|
28
|
+
if (concrete)
|
|
29
|
+
return matchingSession(concrete, ref);
|
|
30
|
+
}
|
|
31
|
+
if (ref.sourceTrace) {
|
|
32
|
+
const source = bySourcePath.get(ref.sourceTrace);
|
|
33
|
+
if (source)
|
|
34
|
+
return matchingSession(source, ref);
|
|
35
|
+
}
|
|
36
|
+
return matchingSession(byRootRunId.get(ref.sessionId) ?? byRunId.get(ref.sessionId), ref);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function matchingSession(session, ref) {
|
|
41
|
+
if (!session)
|
|
42
|
+
return undefined;
|
|
43
|
+
if (ref.traceId && session.traceId !== ref.traceId)
|
|
44
|
+
return undefined;
|
|
45
|
+
if (ref.sourceTrace && session.sourcePath !== ref.sourceTrace)
|
|
46
|
+
return undefined;
|
|
47
|
+
if (ref.traceSessionId && session.runId !== ref.traceSessionId)
|
|
48
|
+
return undefined;
|
|
49
|
+
if (session.rootRunId !== ref.sessionId)
|
|
50
|
+
return undefined;
|
|
51
|
+
return session;
|
|
52
|
+
}
|
|
53
|
+
function uniqueIndex(sessions, keyFor) {
|
|
54
|
+
const index = new Map();
|
|
55
|
+
const ambiguous = new Set();
|
|
56
|
+
for (const session of sessions) {
|
|
57
|
+
const key = keyFor(session);
|
|
58
|
+
if (ambiguous.has(key))
|
|
59
|
+
continue;
|
|
60
|
+
if (index.has(key)) {
|
|
61
|
+
index.delete(key);
|
|
62
|
+
ambiguous.add(key);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
index.set(key, session);
|
|
66
|
+
}
|
|
67
|
+
return index;
|
|
68
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/** Trace source loading and parsing for Claude
|
|
1
|
+
/** Trace source loading and parsing for Claude / Codex / OpenClaw JSONL and generic markdown logs. */
|
|
2
2
|
import type { TraceSourceMetadata } from '../types/index.js';
|
|
3
|
+
import type { TraceCorpus, TraceSession, TraceSourceKind } from './trace-ir.js';
|
|
3
4
|
export interface CcAssistantContent {
|
|
4
5
|
type: 'thinking' | 'text' | 'tool_use';
|
|
5
6
|
thinking?: string;
|
|
@@ -58,10 +59,12 @@ export type CcRecord = CcAssistantRecord | CcUserRecord | {
|
|
|
58
59
|
[k: string]: unknown;
|
|
59
60
|
};
|
|
60
61
|
export type { TraceSourceMetadata } from '../types/index.js';
|
|
62
|
+
/** @deprecated Compatibility shape for callers that still construct Claude-style fixtures. */
|
|
61
63
|
export interface CcSession {
|
|
62
64
|
sessionId: string;
|
|
63
65
|
/**
|
|
64
|
-
* Logical
|
|
66
|
+
* Logical root session used to aggregate a main trace and all descendants.
|
|
67
|
+
* For a directory shaped as:
|
|
65
68
|
* A/main.jsonl
|
|
66
69
|
* A/subagents/x1.jsonl
|
|
67
70
|
* A/subagents/x2.jsonl
|
|
@@ -74,7 +77,7 @@ export interface CcSession {
|
|
|
74
77
|
traceRole?: 'standalone' | 'main' | 'subagent';
|
|
75
78
|
traceLabel?: string;
|
|
76
79
|
sourcePath: string;
|
|
77
|
-
sourceKind?:
|
|
80
|
+
sourceKind?: TraceSourceKind;
|
|
78
81
|
records: unknown[];
|
|
79
82
|
cwd?: string;
|
|
80
83
|
gitBranch?: string;
|
|
@@ -83,9 +86,14 @@ export interface CcSession {
|
|
|
83
86
|
startTimestamp?: string;
|
|
84
87
|
endTimestamp?: string;
|
|
85
88
|
}
|
|
89
|
+
export type { TraceEvent, TraceSession } from './trace-ir.js';
|
|
86
90
|
/**
|
|
87
91
|
* 加载一个目录(或单个 JSONL/agent markdown log 文件)下的所有 session。
|
|
88
92
|
* 递归扫描目录,覆盖 Claude Code 主 session 旁边的 subagents/*.jsonl,
|
|
89
93
|
* 也支持 agent workspace/logs/*.log 里的 Markdown 对话记录。
|
|
90
94
|
*/
|
|
91
|
-
export declare function
|
|
95
|
+
export declare function loadTraceSessions(path: string): TraceSession[];
|
|
96
|
+
export declare function loadTraceCorpus(path: string): TraceCorpus;
|
|
97
|
+
/** @deprecated Use `loadTraceSessions`. */
|
|
98
|
+
export declare const loadCcSessions: typeof loadTraceSessions;
|
|
99
|
+
export declare function legacyCcSessionToTraceSession(session: CcSession): TraceSession;
|