gm surface: home flow, run identity, full-assembly editor, notepad, wrap replay; sigils and dateless rings

This commit is contained in:
2026-11-14 09:04:13 +00:00
parent ba72d2ed1f
commit 9f85adc3c6
20 changed files with 2014 additions and 433 deletions
+4 -6
View File
@@ -30,10 +30,7 @@ const readRun = (runId, f) => fs.readFileSync(path.join(runDir(runId), f), 'utf8
export function renderTranscript(lines) {
const L = [];
for (const e of lines) {
if (e.t === 'bundle') {
if (e.part === 'turn-0') L.push('[GM: opening beat]', e.m.content, '');
continue;
}
if (e.t === 'bundle') continue; // context, not exchange — provided as separate inputs
if (e.t === 'msg') {
if (e.m.role === 'user') {
L.push('[GM]', e.m.content, '');
@@ -70,7 +67,7 @@ export function buildMessages(runId, lines, stamp) {
? 'available — this character keeps files; the archive op is valid'
: 'none — this character keeps no files; the archive op is invalid'}. The ended session is ${stamp}.`;
return [
{ role: 'system', content: expandVars(runId, readRun(runId, 'housekeeper.md')) },
{ role: 'system', content: expandVars(runId, fs.readFileSync(path.join(ROOT, 'housekeeper.md'), 'utf8').trim()) }, // substrate-internal, repo-fed
{ role: 'user', content: runState },
{ role: 'user', content: expandVars(runId, readRun(runId, 'character.md')) },
{ role: 'user', content: expandVars(runId, readRun(runId, 'backdrop.md')) },
@@ -145,6 +142,7 @@ async function callHousekeeper(ctx, runId, messages) {
const data = await ctx.provider.chat(model, messages, undefined, ctx.cfg.params ?? {});
return data.choices[0].message.content ?? '';
}
export { callHousekeeper };
// apply -> mark housekept -> autorestart. Shared by the chain and the
// manual apply endpoint (hand-edited manifests).
@@ -186,7 +184,6 @@ export function latestLog(runId) {
function mockManifest(stamp) {
return JSON.stringify({
window: stamp.toLowerCase(),
date: new Date().toISOString().slice(0, 10),
summary: 'Mock wrap: she left the container, crossed the hot sand and entered the dark hold.',
touch: [{ id: 'e1', reason: 'the cuffs shaped every move she made' }],
insert: [{
@@ -196,3 +193,4 @@ function mockManifest(stamp) {
}],
});
}
export { mockManifest };