okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Version 0.2.10 / engine 0.1.56 follow-through: test_tui2_023_versions and AGENTS.md follow the bump; the '0.2.9.1' tags that meant this release now read 0.2.10; the test comment names 0.2.9.1 as the unpublished DeepSeek hotfix labelf31abf7bd

main
1.5 KiB30 linesraw
1/**
2 * 0.2.10: the agent's system prompt says which computer it is on, so a model on Windows does not spend its first steps on
3 * `ls`, `uname` and `wc`. Pure test of the preset; the check with a real model on Windows needs the owner's OK.
4 */
5import test from 'node:test';
6import assert from 'node:assert/strict';
7import { AGENT_PROMPT, agentPromptFor, standardPreset } from '../server/agent/preset.mjs';
8
9const promptOf = platform => standardPreset({ platform }).plugins.find(p => p.id === 'persona').config.prefix;
10
11test('the Windows prompt names PowerShell and the commands that do not exist', () => {
12  const text = promptOf('win32');
13  assert.match(text, /runs Windows and the shell tool is PowerShell/);
14  assert.match(text, /uname, wc and grep do not exist/);
15  assert.ok(text.length < 1900, `${text.length} chars`);
16  assert.ok(text.startsWith(AGENT_PROMPT.split('\n\n')[0]), 'the first line stays first');
17});
18
19test('macOS and Linux say so and do not mention PowerShell as the shell', () => {
20  assert.match(promptOf('darwin'), /runs macOS/);
21  assert.match(promptOf('linux'), /runs Linux/);
22  assert.doesNotMatch(promptOf('linux').split('\n\n')[1], /PowerShell/);
23});
24
25test('an unknown system keeps the plain prompt, and every other rule of it is still there', () => {
26  assert.equal(agentPromptFor('freebsd'), AGENT_PROMPT);
27  for (const p of ['win32', 'darwin', 'linux']) {
28    for (const rule of AGENT_PROMPT.split('\n\n').slice(1)) assert.ok(promptOf(p).includes(rule), `${p}: ${rule.slice(0, 40)}`);
29  }
30});