dsh-auto-model-routing 0.4.2 → 0.5.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/CHANGELOG.md +10 -0
- package/README.md +8 -8
- package/README.zh.md +8 -8
- package/docs/feedback-evaluation.md +4 -4
- package/docs/host-capability-report.md +2 -0
- package/docs/jev-policy-v2-validation.md +3 -1
- package/docs/magpie-live-acceptance.md +2 -0
- package/docs/policy-v2-development.md +5 -3
- package/docs/policy-v2-real-evaluation-plan.md +2 -0
- package/lib/client/control.d.ts +2 -2
- package/lib/client/control.js +10 -20
- package/lib/client/index.d.ts +0 -1
- package/lib/client/index.js +9 -6
- package/lib/client/label.d.ts +7 -10
- package/lib/client/label.js +17 -30
- package/lib/client/settings-section.d.ts +2 -2
- package/lib/client/settings-section.js +7 -69
- package/lib/client/strategy-details.js +3 -4
- package/lib/client.js +165 -481
- package/lib/context.d.ts +1 -3
- package/lib/context.js +3 -4
- package/lib/effort.d.ts +2 -10
- package/lib/effort.js +1 -31
- package/lib/endpoints.d.ts +11 -10
- package/lib/endpoints.js +29 -46
- package/lib/feedback.d.ts +60 -7
- package/lib/feedback.js +15 -5
- package/lib/index.d.ts +4 -0
- package/lib/index.js +17 -86
- package/lib/jev.d.ts +17 -29
- package/lib/jev.js +6 -34
- package/lib/policy-host.d.ts +6 -8
- package/lib/policy-host.js +39 -38
- package/lib/policy-store.d.ts +9 -20
- package/lib/policy-store.js +28 -16
- package/lib/routing.d.ts +20 -0
- package/lib/routing.js +51 -0
- package/lib/rubric.json +15 -6
- package/lib/settings-contract.d.ts +5 -21
- package/lib/settings-contract.js +3 -2
- package/lib/settings-host.d.ts +4 -8
- package/lib/settings-host.js +9 -10
- package/lib/settings-validation.d.ts +1 -7
- package/lib/settings-validation.js +0 -51
- package/lib/settings.d.ts +3 -8
- package/lib/settings.js +18 -177
- package/lib/state.d.ts +2 -4
- package/lib/state.js +2 -7
- package/lib/strategies/claude.d.ts +21 -0
- package/lib/strategies/claude.js +8 -0
- package/lib/strategies/codex.d.ts +21 -0
- package/lib/strategies/codex.js +9 -0
- package/lib/strategies/index.d.ts +22 -0
- package/lib/strategies/index.js +85 -0
- package/lib/strategies/types.d.ts +14 -0
- package/lib/strategies/types.js +1 -0
- package/lib/subagent-tool.d.ts +7 -7
- package/lib/subagent-tool.js +33 -76
- package/lib/support.d.ts +7 -8
- package/lib/support.js +9 -13
- package/lib/usage-report.d.ts +2 -2
- package/lib/usage-report.js +25 -17
- package/package.json +3 -4
- package/skills/auto-model-routing-report/SKILL.md +4 -3
- package/skills/subagent-model-routing/SKILL.md +14 -30
- package/lib/client/route-picker.d.ts +0 -21
- package/lib/client/route-picker.js +0 -75
- package/lib/judgements.d.ts +0 -41
- package/lib/judgements.js +0 -55
- package/lib/policy-v2-rubric.json +0 -21
- package/lib/policy-v2.d.ts +0 -21
- package/lib/policy-v2.js +0 -54
- package/lib/router.d.ts +0 -68
- package/lib/router.js +0 -153
- package/scripts/label-report.mjs +0 -50
package/scripts/label-report.mjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Read-only report over judgements.jsonl (design D13): per rubric version, how the labels compare with Jev.
|
|
3
|
-
// Zero dependencies; never reads message text, never touches the network, never writes.
|
|
4
|
-
import { readFileSync } from 'node:fs'
|
|
5
|
-
import { homedir } from 'node:os'
|
|
6
|
-
import { resolve } from 'node:path'
|
|
7
|
-
import { parseArgs } from 'node:util'
|
|
8
|
-
|
|
9
|
-
const TIERS = ['simple', 'standard', 'complex', 'escalated']
|
|
10
|
-
const { values } = parseArgs({ options: { file: { type: 'string' }, json: { type: 'boolean' } } })
|
|
11
|
-
const home = process.env.DSH_HOME ?? resolve(homedir(), '.dsh')
|
|
12
|
-
const file = values.file ?? resolve(home, 'state/auto-model-routing/judgements.jsonl')
|
|
13
|
-
|
|
14
|
-
let text = ''
|
|
15
|
-
try { text = readFileSync(file, 'utf8') } catch (error) { if (error.code !== 'ENOENT') throw error }
|
|
16
|
-
|
|
17
|
-
// Fold by (sessionId, turn): the last judgement line and the last label line win; bad lines are skipped.
|
|
18
|
-
const turns = new Map()
|
|
19
|
-
for (const raw of text.split('\n')) {
|
|
20
|
-
if (!raw.trim()) continue
|
|
21
|
-
let line
|
|
22
|
-
try { line = JSON.parse(raw) } catch { continue }
|
|
23
|
-
if (typeof line?.sessionId !== 'string' || !Number.isInteger(line.turn)) continue
|
|
24
|
-
const key = `${line.sessionId}\0${line.turn}`
|
|
25
|
-
const entry = turns.get(key) ?? { sessionId: line.sessionId, turn: line.turn }
|
|
26
|
-
if (TIERS.includes(line.tier) && typeof line.rubricVersion === 'string') Object.assign(entry, { tier: line.tier, rubricVersion: line.rubricVersion })
|
|
27
|
-
if (TIERS.includes(line.label)) entry.label = line.label
|
|
28
|
-
turns.set(key, entry)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const versions = {}
|
|
32
|
-
const mismatches = []
|
|
33
|
-
for (const entry of turns.values()) {
|
|
34
|
-
if (!entry.tier || !entry.label) continue
|
|
35
|
-
const row = versions[entry.rubricVersion] ??= { labeled: 0, agree: 0, over: 0, under: 0 }
|
|
36
|
-
row.labeled++
|
|
37
|
-
const diff = TIERS.indexOf(entry.tier) - TIERS.indexOf(entry.label)
|
|
38
|
-
if (diff === 0) { row.agree++; continue }
|
|
39
|
-
if (diff > 0) row.over++; else row.under++
|
|
40
|
-
mismatches.push({ sessionId: entry.sessionId, turn: entry.turn, rubricVersion: entry.rubricVersion, tier: entry.tier, label: entry.label })
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (values.json) {
|
|
44
|
-
console.log(JSON.stringify({ versions, mismatches }, null, 2))
|
|
45
|
-
} else {
|
|
46
|
-
console.log(`file: ${file}`)
|
|
47
|
-
for (const [version, row] of Object.entries(versions)) console.log(`rubric ${version}: labeled ${row.labeled}, agree ${row.agree}, judged higher ${row.over}, judged lower ${row.under}`)
|
|
48
|
-
if (!Object.keys(versions).length) console.log('no labeled turns yet')
|
|
49
|
-
for (const m of mismatches) console.log(` ${m.sessionId} turn ${m.turn} [${m.rubricVersion}]: Jev ${m.tier}, label ${m.label}`)
|
|
50
|
-
}
|