sync cleaned docs: dsh-plugin/compaction-agentframe/tests/smoke.ts
Browse files
dsh-plugin/compaction-agentframe/tests/smoke.ts
CHANGED
|
@@ -18,11 +18,11 @@ async function main() {
|
|
| 18 |
|
| 19 |
// Verify it's exposed on ctx.compaction.
|
| 20 |
const registered = ctx.get('compaction')
|
| 21 |
-
console.log('[smoke] ctx.compaction =', registered ? '
|
| 22 |
|
| 23 |
// Verify class identity.
|
| 24 |
console.log('[smoke] engine instanceof AgentFrameCompactionEngine =',
|
| 25 |
-
engine instanceof AgentFrameCompactionEngine ? '
|
| 26 |
|
| 27 |
// Verify config.
|
| 28 |
console.log('[smoke] config =', JSON.stringify(engine.config))
|
|
@@ -30,7 +30,7 @@ async function main() {
|
|
| 30 |
// Verify abstract methods are implemented.
|
| 31 |
const methods = ['compactIfNeeded', 'compactNow', 'compactRegion']
|
| 32 |
for (const m of methods) {
|
| 33 |
-
console.log(`[smoke] ${m} =`, typeof (engine as any)[m] === 'function' ? '
|
| 34 |
}
|
| 35 |
|
| 36 |
// Verify condense logic with a fake session.
|
|
@@ -59,13 +59,13 @@ async function main() {
|
|
| 59 |
// Verify chatter was dropped (no "天气不错" in summary).
|
| 60 |
const chatterDropped = !summary.includes('天气不错')
|
| 61 |
const codeKept = summary.includes('socket')
|
| 62 |
-
console.log('[smoke] 闲聊被剔除 =', chatterDropped ? '
|
| 63 |
-
console.log('[smoke] 关键代码保留 =', codeKept ? '
|
| 64 |
|
| 65 |
-
console.log('\n
|
| 66 |
}
|
| 67 |
|
| 68 |
main().catch((e) => {
|
| 69 |
-
console.error('
|
| 70 |
process.exit(1)
|
| 71 |
})
|
|
|
|
| 18 |
|
| 19 |
// Verify it's exposed on ctx.compaction.
|
| 20 |
const registered = ctx.get('compaction')
|
| 21 |
+
console.log('[smoke] ctx.compaction =', registered ? '✓ registered' : '× missing')
|
| 22 |
|
| 23 |
// Verify class identity.
|
| 24 |
console.log('[smoke] engine instanceof AgentFrameCompactionEngine =',
|
| 25 |
+
engine instanceof AgentFrameCompactionEngine ? '✓' : '×')
|
| 26 |
|
| 27 |
// Verify config.
|
| 28 |
console.log('[smoke] config =', JSON.stringify(engine.config))
|
|
|
|
| 30 |
// Verify abstract methods are implemented.
|
| 31 |
const methods = ['compactIfNeeded', 'compactNow', 'compactRegion']
|
| 32 |
for (const m of methods) {
|
| 33 |
+
console.log(`[smoke] ${m} =`, typeof (engine as any)[m] === 'function' ? '✓' : '×')
|
| 34 |
}
|
| 35 |
|
| 36 |
// Verify condense logic with a fake session.
|
|
|
|
| 59 |
// Verify chatter was dropped (no "天气不错" in summary).
|
| 60 |
const chatterDropped = !summary.includes('天气不错')
|
| 61 |
const codeKept = summary.includes('socket')
|
| 62 |
+
console.log('[smoke] 闲聊被剔除 =', chatterDropped ? '✓' : '×')
|
| 63 |
+
console.log('[smoke] 关键代码保留 =', codeKept ? '✓' : '×')
|
| 64 |
|
| 65 |
+
console.log('\n✓ smoke test complete')
|
| 66 |
}
|
| 67 |
|
| 68 |
main().catch((e) => {
|
| 69 |
+
console.error('× smoke test failed:', e)
|
| 70 |
process.exit(1)
|
| 71 |
})
|