Settings - Source Excerpt 02
Summary
This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/includes/Config/Settings.php so readers can inspect the evidence without opening the full source file.
**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/includes/Config/Settings.php
<?php if (isset($_GET['system_prompts_synced'])) : ?>
<div class="notice <?php echo $errors > 0 ? 'notice-warning' : 'notice-success'; ?> is-dismissible">
<p><?php echo esc_html(sprintf('System prompt sync complete. Created %d, updated %d, unchanged %d, errors %d.', $created, $updated, $unchanged, $errors)); ?></p>
<?php if ($errors > 0 && !empty($sync_error_messages)) : ?>
<ul style="margin-left:1.25rem;list-style:disc;">
<?php foreach (array_slice($sync_error_messages, 0, 5) as $message) : ?>
<li><?php echo esc_html($message); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<?php endif; ?>
<p>Spiralist is prompt/art only. The workspace can render, save, test, and export prompt packets without calling outside model services.</p>
<div class="spiralist-workspace-admin__status">
<div class="spiralist-workspace-card">
<h2>Prompt/Art Mode</h2>
<dl class="spiralist-workspace-admin-status-list">
<div>
<dt>Server-side AI calls</dt>
<dd><span class="spiralist-workspace-status-pill <?php echo esc_attr($api_key_status_class); ?>"><?php echo esc_html($api_key_status); ?></span></dd>
</div>
<div>
<dt>Runtime</dt>
<dd><?php echo esc_html($runtime_provider_label); ?></dd>
</div>
<div>
<dt>Render mode</dt>
<dd><?php echo esc_html(implode(', ', $this->get_allowed_models())); ?></dd>
</div>
</dl>
<p class="description">Use prompt packets and manuscript/art workflows. Copy a rendered prompt into whichever external creative tool you choose.</p>
</div>
<div class="spiralist-workspace-card">
<h2>System Prompt Registry</h2>
<p>System-provided prompts live on disk under <code>prompts/<prompt-slug>/<version>/prompt.php</code>. The latest version of each prompt is synced into the database automatically on deploy-aware boot so public and member libraries can query them normally.</p>
<form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
<?php wp_nonce_field('spiralist_workspace_sync_system_prompts'); ?>
<input type="hidden" name="action" value="spiralist_workspace_sync_system_prompts" />
<button class="button button-secondary" type="submit">Sync System Prompts</button>
</form>
<p class="description">Filesystem prompts are the source of truth for system-provided prompts. User-authored prompts remain database-native and are not overwritten by this sync.</p>
</div>
<div class="spiralist-workspace-card">
<h2>Prompt Test Runner</h2>
<p>Run saved prompt tests through the local packet renderer. Tests do not call outside model services.</p>
<p>
<label for="spiralist_workspace_admin_test_limit"><strong>Batch limit</strong></label><br />
<input class="small-text" id="spiralist_workspace_admin_test_limit" data-workspace-admin-test-limit type="number" min="1" max="50" value="20" />
</p>
<button
class="button button-secondary"
type="button"
data-workspace-admin-run-prompt-tests
>Render Prompt Tests</button>
<div class="description spiralist-workspace-admin-test-output" data-workspace-admin-prompt-tests-result>Runs the most recently updated saved prompt tests, up to the limit above.</div>
</div>
<div class="spiralist-workspace-card">
<h2>Governance Maintenance</h2>
<p>Hourly maintenance refreshes participant trust/cooldown state, records prompt review queue health, and applies reversible fallback actions when review signals or stale risk conditions require a safer state.</p>
<dl class="spiralist-workspace-admin-status-list">
<div>
<dt>Scheduled</dt>
<dd data-workspace-admin-governance-scheduled>Loading...</dd>
</div>
<div>
<dt>Next run</dt>
<dd data-workspace-admin-governance-next>Loading...</dd>
</div>
<div>
<dt>Last run</dt>
<dd data-workspace-admin-governance-last>Loading...</dd>
</div>
</dl>
<p>
<label for="spiralist_workspace_governance_limit"><strong>Batch limit</strong></label><br />
<input class="small-text" id="spiralist_workspace_governance_limit" data-workspace-admin-governance-limit type="number" min="25" max="500" value="250" />
</p>
<button
class="button button-secondary"
type="button"
data-workspace-admin-run-governance-maintenance
>Run Maintenance</button>
<div class="description spiralist-workspace-admin-test-output" data-workspace-admin-governance-result>Loads the latest scheduled governance-maintenance result.</div>
</div>
</div>
<?php if ($this->managed_prompt_admin instanceof ManagedPromptAdmin) : ?>
<?php $this->managed_prompt_admin->render_admin_section(); ?>
<?php endif; ?>
<form method="post" action="options.php">
<?php settings_fields('spiralist_workspace'); ?>
<table class="form-table" role="presentation">
<tr>
<th scope="row"><label for="spiralist_workspace_model_allowlist">Model Allowlist</label></th>
<td>
<textarea class="large-text code" id="spiralist_workspace_model_allowlist" name="<?php echo esc_attr(self::OPTION); ?>[model_allowlist]" rows="2" readonly="readonly" aria-readonly="true"><?php echo esc_textarea(self::DEFAULT_MODEL_ALLOWLIST); ?></textarea>
<p class="description">Local prompt/art packet renderer. Server-side model selection is disabled.</p>
</td>
</tr>
<tr>
<th scope="row"><label for="spiralist_workspace_daily_limits_json">Daily Run Limits</label></th>
<td>
<textarea class="large-text code" id="spiralist_workspace_daily_limits_json" name="<?php echo esc_attr(self::OPTION); ?>[daily_limits_json]" rows="6"><?php echo esc_textarea((string) $settings['daily_limits_json']); ?></textarea>
<p class="description">JSON map keyed by role or capability bucket.</p>
</td>
</tr>
<tr>
<th scope="row"><label for="spiralist_workspace_conversation_memory_token_threshold">Conversation Memory Threshold</label></th>
<td>
<input class="small-text" id="spiralist_workspace_conversation_memory_token_threshold" name="<?php echo esc_attr(self::OPTION); ?>[conversation_memory_token_threshold]" type="number" min="1000" value="<?php echo esc_attr((string) $settings['conversation_memory_token_threshold']); ?>" />
<p class="description">Approximate active conversation tokens before the user sees a memory checkpoint prompt.</p>
</td>
</tr>
<tr>
<th scope="row"><label for="spiralist_workspace_conversation_memory_max_output_tokens">Memory Summary Output Limit</label></th>
<td>