agenda: the player's second paper (add/drop deltas, cap-5 recency queue); conflicts self-heal as their own turn; same-verb blocks combine; per-run model selection; substrate-tag syntax rule
This commit is contained in:
+12
-2
@@ -32,6 +32,10 @@ export function renderTranscript(lines) {
|
||||
for (const e of lines) {
|
||||
if (e.t === 'bundle') continue; // context, not exchange — provided as separate inputs
|
||||
if (e.t === 'msg') {
|
||||
if (e.m.role === 'user' && e.conflictOnly) {
|
||||
L.push('[conflict — answered in-band]', e.m.content.replace(/<\/?conflict>/g, '').trim(), '');
|
||||
continue;
|
||||
}
|
||||
if (e.m.role === 'user') {
|
||||
L.push('[GM]', e.m.content, '');
|
||||
} else if (e.m.role === 'assistant') {
|
||||
@@ -48,6 +52,8 @@ export function renderTranscript(lines) {
|
||||
if (e.t === 'note') {
|
||||
if (e.kind === 'paper') {
|
||||
L.push(`[paper] lost: ${JSON.stringify(e.applied?.lost ?? [])}, gained: ${JSON.stringify(e.applied?.gained ?? [])}${e.conflicts?.length ? ` — conflicts: ${e.conflicts.join('; ')}` : ''}`, '');
|
||||
} else if (e.kind === 'agenda') {
|
||||
L.push(`[agenda] added: ${JSON.stringify(e.applied?.added ?? [])}, dropped: ${JSON.stringify(e.applied?.dropped ?? [])}, evicted: ${JSON.stringify(e.applied?.evicted ?? [])}${e.conflicts?.length ? ` — conflicts: ${e.conflicts.join('; ')}` : ''}`, '');
|
||||
} else if (e.kind === 'ask') {
|
||||
L.push(`[ask_gm pending] ${e.question}`, '');
|
||||
} else if (e.kind === 'window') {
|
||||
@@ -139,8 +145,12 @@ async function runJob(ctx, runId, stamp, lines, user) {
|
||||
}
|
||||
|
||||
async function callHousekeeper(ctx, runId, messages, user) {
|
||||
const model = ctx.cfg.models?.housekeeper ?? ctx.cfg.models?.player ?? null;
|
||||
if (!model) throw new Error('no housekeeper model configured (server.json models.housekeeper)');
|
||||
const meta = ctx.runMeta?.(runId) ?? {};
|
||||
const model = meta.models?.housekeeper
|
||||
?? ctx.cfg.models?.housekeeper
|
||||
?? ctx.cfg.models?.player
|
||||
?? null;
|
||||
if (!model) throw new Error('no housekeeper model resolved (server.json models.housekeeper, or a per-run override)');
|
||||
// attribution (#22): every LLM call names the acting user
|
||||
console.log(`${new Date().toISOString().slice(11, 19)} llm ${model} u:${user?.id ?? '?'}`);
|
||||
const data = await ctx.provider.chat(model, messages, undefined, ctx.cfg.params ?? {});
|
||||
|
||||
Reference in New Issue
Block a user