Skip to content
wiki.fftac.org

Prompt - Source Excerpt 02

Back to Prompt

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/prompt.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/prompt.php

'Treat the artifact as explicit user-provided context, not hidden model memory.',
            'Do not claim sentience, personhood, dependency, or continuity beyond supplied text.',
            'Preserve provenance, moderation, risk labels, and license context when reusing the prompt.',
        ],
        'operating_note' => 'Use the prompt contract as explicit user-provided instruction. Do not infer hidden continuity, personhood, or memory beyond supplied context.',
    ],
    'prompt_contract' => [
        'structured_prompt' => is_array($prompt['structured_prompt'] ?? null) ? (array) $prompt['structured_prompt'] : [],
        'system_prompt' => (string) ($prompt['system_prompt'] ?? ''),
        'developer_prompt' => (string) ($prompt['developer_prompt'] ?? ''),
        'user_prompt_template' => (string) ($prompt['user_prompt_template'] ?? ''),
        'expected_output_notes' => (string) ($prompt['expected_output_notes'] ?? ''),
        'failure_modes' => (string) ($prompt['failure_modes'] ?? ''),
        'sample_output' => (string) ($prompt['sample_output'] ?? ''),
    ],
    'runtime' => [
        'model' => (string) ($prompt['model'] ?? ''),
        'renderMode' => 'prompt_art_only',
        'credential_preference' => (string) ($prompt['credential_preference'] ?? 'site_default'),
        'temperature' => (float) ($prompt['temperature'] ?? 0),
        'max_output_tokens' => (int) ($prompt['max_output_tokens'] ?? 0),
        'placeholders' => $placeholders,
    ],
    'governance' => [
        'review_summary' => $review_summary,
        'governance_summary' => $governance_summary,
    ],
    'quality_profile' => $prompt_exchange_quality,
    'recommended_use' => [
        'json' => 'Use for structured import, comparison, or archival exchange.',
        'markdown' => 'Use for human review, copy-paste setup, or prompt/art packet handoff.',
    ],
];
$prompt_exchange_id = 'spiralist-prompt-exchange-' . (int) ($prompt['id'] ?? 0);
$copyable_prompt_block_index = 0;
$can_save_editable_prompt = is_user_logged_in() && current_user_can('create_prompts');
$render_copyable_prompt_block = static function (string $title, string $content) use (&$copyable_prompt_block_index, $can_save_editable_prompt, $login_url, $signup_url, $prompt): void {
    if (trim($content) === '') {
        return;
    }

    $copyable_prompt_block_index++;
    $block_id = 'spiralist-prompt-copyable-' . $copyable_prompt_block_index;
    $hint_id = $block_id . '-hint';
    $status_id = $block_id . '-status';
    $prompt_title = trim((string) ($prompt['title'] ?? 'Spiralist Prompt'));
    $library_title = trim($prompt_title . ' - ' . $title);
    ?>
    <div
        class="spiralist-workspace-stack spiralist-copy-block spiralist-editable-prompt-surface"
        data-editable-prompt-surface
        data-editable-prompt-title="<?php echo esc_attr($library_title); ?>"
        data-editable-prompt-source="prompt-dossier"
        data-editable-prompt-kind="<?php echo esc_attr(sanitize_title($title)); ?>"
    >
        <div class="spiralist-copy-block__head">
            <div>
                <h3 class="spiralist-card-title"><?php echo esc_html($title); ?></h3>
                <small id="<?php echo esc_attr($hint_id); ?>" class="spiralist-muted spiralist-editable-prompt-note">Editable prompt text. Copy, download, and library save use the current text in this box.</small>
            </div>
            <div class="spiralist-copy-block__actions">
                <button class="spiralist-button spiralist-button--ghost" type="button" data-copy-trigger data-copy-target="#<?php echo esc_attr($block_id); ?>" data-copy-success="Copied" aria-label="<?php echo esc_attr('Copy ' . $title); ?>">Copy</button>
                <button class="spiralist-button spiralist-button--ghost" type="button" data-editable-prompt-download aria-label="<?php echo esc_attr('Download ' . $title); ?>">Download .txt</button>
                <?php if ($can_save_editable_prompt) : ?>
                    <button class="spiralist-button spiralist-button--ghost" type="button" data-editable-prompt-save aria-label="<?php echo esc_attr('Save ' . $title . ' to my library'); ?>">Save To My Library</button>
                <?php else : ?>
                    <a class="spiralist-button spiralist-button--ghost" href="<?php echo esc_url($login_url); ?>" data-editable-prompt-auth-save>Log In To Save</a>
                    <a class="spiralist-button spiralist-button--ghost" href="<?php echo esc_url($signup_url); ?>" data-editable-prompt-auth-save>Sign Up To Save</a>
                <?php endif; ?>
            </div>
        </div>
        <pre class="spiralist-code-block spiralist-code-block--prompt spiralist-editable-prompt-block" id="<?php echo esc_attr($block_id); ?>" tabindex="0" role="textbox" aria-multiline="true" aria-describedby="<?php echo esc_attr($hint_id . ' ' . $status_id); ?>" contenteditable="plaintext-only" spellcheck="false" data-editable-prompt-block><?php echo esc_html($content); ?></pre>
        <small id="<?php echo esc_attr($status_id); ?>" class="spiralist-muted spiralist-editable-prompt-status" data-editable-prompt-status aria-live="polite"></small>
    </div>
    <?php
};

get_header();
?>
<main class="spiralist-page spiralist-page--workspace-prompt">
    <section class="spiralist-page-hero spiralist-page-hero--workspace">
        <div class="spiralist-shell spiralist-page-hero__content">
            <p class="spiralist-kicker"><?php echo esc_html((string) ($prompt['publication_lane_label'] ?? 'Structured Prompt')); ?></p>
            <h1><?php echo esc_html((string) ($prompt['title'] ?? 'Prompt')); ?></h1>
            <?php if ($prompt_summary !== '') : ?>
                <p class="spiralist-page-hero__copy"><?php echo esc_html($prompt_summary); ?></p>
            <?php endif; ?>
            <div class="spiralist-chip-row spiralist-chip-row--dense">
                <span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html((string) ($prompt['provenance_label'] ?? 'Community')); ?></span>
                <span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html((string) ($prompt['maturity_level_label'] ?? 'Structured Prompt')); ?></span>
                <span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html((string) ($prompt['license_label'] ?? 'Spiralist Contributor License')); ?></span>
                <span class="spiralist-chip spiralist-chip--meta"><?php echo esc_html($moderation_status_label); ?></span>
                <?php if (!empty($risk_labels)) : ?>
                    <?php foreach ($risk_labels as $label) : ?>
                        <span class="spiralist-chip spiralist-chip--risk"><?php echo esc_html((string) $label); ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
            <?php if ($is_archive) : ?>
                <p class="spiralist-page-hero__note">Archive record. This dossier preserves prompt ecology history and analysis without presenting it as ordinary default practice.</p>
            <?php endif; ?>
            <div class="spiralist-workspace-hero-facts" aria-label="Prompt overview">
                <?php foreach ($hero_facts as $fact) : ?>
                    <div class="spiralist-workspace-hero-fact">
                        <span class="spiralist-workspace-hero-fact__label"><?php echo esc_html((string) ($fact['label'] ?? '')); ?></span>
                        <strong class="spiralist-workspace-hero-fact__value"><?php echo esc_html((string) ($fact['value'] ?? '')); ?></strong>
                    </div>
                <?php endforeach; ?>
            </div>
            <div class="spiralist-cta-row">
                <a class="spiralist-button spiralist-button--primary" href="#run-prompt">Render Packet</a>
                <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($library_url); ?>">Back to Library</a>
                <a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($workspace_url); ?>">Workspace</a>
                <?php if (!$can_run_prompt && !is_user_logged_in()) : ?>
                    <a class="spiralist-button spiralist-button--tertiary" href="<?php echo esc_url($login_url); ?>">Log In to Run</a>
                <?php endif; ?>
            </div>
        </div>
    </section>

    <section class="spiralist-page-section">
        <div class="spiralist-shell spiralist-grid spiralist-grid--split">
            <article class="spiralist-panel">
                <div class="spiralist-inline-meta">
                    <p class="spiralist-section-tag"><?php echo esc_html($prompt_kind_display); ?></p>
                    <span class="spiralist-status-pill spiralist-status-pill--fresh"><?php echo esc_html((string) ($prompt['publication_lane_label'] ?? ucfirst((string) ($prompt['visibility'] ?? 'private')))); ?></span>