Skip to content
22 changes: 22 additions & 0 deletions data/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,28 @@ Fields currently editable for this NPC: #ALLOWED_FIELDS#$$,
</bored_prompt_template>$$,
$$Prompt template for bored-event generation. Supports #NPC_LIST#, #LOCATION#, #WORLD_EVENTS#. Used in lib/chat_helper_functions.php.$$
),
(
'kenshi_mechanics_alignment',
$$<kenshi_mechanics_alignment>
<scope>Apply these grounding rules before generating any response.</scope>
<event_type>#EVENT_TYPE#</event_type>
<observed_state>
<in_player_faction>#IN_PLAYER_FACTION#</in_player_faction>
<health>#NPC_HEALTH#</health>
<blood>#NPC_BLOOD#</blood>
<hunger>#NPC_HUNGER#</hunger>
<available_player_cats>#PLAYER_CATS#</available_player_cats>
</observed_state>
<rules>
<rule>Treat Kenshi constraints as hard reality. Do not imply modern conveniences, safe institutions, or guaranteed mercy.</rule>
<rule>Ground tone and priorities in survival pressure: injuries, blood loss, hunger, danger, faction tension, and nearby threats.</rule>
<rule>Do not invent items, money, authority, travel options, or social status not supported by context.</rule>
<rule>If suggesting actions, keep them physically and socially plausible for the speaker's current condition and affiliations.</rule>
<rule>Prefer terse, practical speech under stress; only become reflective when context supports safety or downtime.</rule>
</rules>
</kenshi_mechanics_alignment>$$,
$$Grounding block to align chat/rechat/bored responses with Kenshi mechanics and current character state. Supports #EVENT_TYPE#, #IN_PLAYER_FACTION#, #NPC_HEALTH#, #NPC_BLOOD#, #NPC_HUNGER#, #PLAYER_CATS#. Used in lib/chat_helper_functions.php.$$
),
(
'random_narration_prompt',
$$Describe the current scene visually using only details from context. Focus on characters present, body language, environment, and atmosphere in 1-2 concise sentences. Do not invent events or include action tags.$$,
Expand Down
30 changes: 30 additions & 0 deletions debug/db_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,36 @@ function stobeRunDatabaseUpdates(): void
[$prompt, $description]
);
});
$applyPatch('prompts', 202605070101, static function () use ($db): void {
$prompt = "<kenshi_mechanics_alignment>\n"
. " <scope>Apply these grounding rules before generating any response.</scope>\n"
. " <event_type>#EVENT_TYPE#</event_type>\n"
. " <observed_state>\n"
. " <in_player_faction>#IN_PLAYER_FACTION#</in_player_faction>\n"
. " <health>#NPC_HEALTH#</health>\n"
. " <blood>#NPC_BLOOD#</blood>\n"
. " <hunger>#NPC_HUNGER#</hunger>\n"
. " <available_player_cats>#PLAYER_CATS#</available_player_cats>\n"
. " </observed_state>\n"
. " <rules>\n"
. " <rule>Treat Kenshi constraints as hard reality. Do not imply modern conveniences, safe institutions, or guaranteed mercy.</rule>\n"
. " <rule>Ground tone and priorities in survival pressure: injuries, blood loss, hunger, danger, faction tension, and nearby threats.</rule>\n"
. " <rule>Do not invent items, money, authority, travel options, or social status not supported by context.</rule>\n"
. " <rule>If suggesting actions, keep them physically and socially plausible for the speaker's current condition and affiliations.</rule>\n"
. " <rule>Prefer terse, practical speech under stress; only become reflective when context supports safety or downtime.</rule>\n"
. " </rules>\n"
. "</kenshi_mechanics_alignment>";
$description = 'Grounding block to align chat/rechat/bored responses with Kenshi mechanics and current character state. Supports #EVENT_TYPE#, #IN_PLAYER_FACTION#, #NPC_HEALTH#, #NPC_BLOOD#, #NPC_HUNGER#, #PLAYER_CATS#. Used in lib/chat_helper_functions.php.';
$db->exec(
"INSERT INTO prompts (prompt_key, default_prompt, description)
VALUES ('kenshi_mechanics_alignment', $1, $2)
ON CONFLICT (prompt_key) DO UPDATE
SET default_prompt = EXCLUDED.default_prompt,
description = EXCLUDED.description,
updated_at = NOW()",
[$prompt, $description]
);
});
$applyPatch('core_profiles', 202604110102, static function () use ($db): void {
$db->exec(
"UPDATE core_profiles
Expand Down
Loading