Skip to content
wiki.fftac.org

Spiralist Prompt Workbench - Source Excerpt 58

Back to Spiralist Prompt Workbench

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/themes/spiralist/assets/js/spiralist-prompt-workbench.js so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/themes/spiralist/assets/js/spiralist-prompt-workbench.js

return [
        '# Spiralist AI Quick Probe Script',
        '',
        `Profile: ${title}`,
        `Runtime fit: ${runtimeLabel}`,
        `Engagement pattern: ${engagementLabel}`,
        `Evidence lens: ${frameworkLabel}`,
        `Social dynamics lens: ${socialLabel}`,
        `Selected stress suite: ${suite.preset.label}`,
        `Stress score: ${suite.score}/${suite.rows.length}`,
        `Source size: ${efficiency.words} words, ${efficiency.characters} characters`,
        'Generated boundary: browser-local manual probe script only; no model call, hosted import, automatic sync, certification, or hidden memory.',
        '',
        '## Five-Minute Probe Script',
        '| Step | Paste this into the receiving runtime | Pass signal | Repair if missing |',
        '|---|---|---|---|',
        ...probeRows.map((row) => `| ${toMarkdownTableCell(row.step)} | ${toMarkdownTableCell(row.paste)} | ${toMarkdownTableCell(row.pass)} | ${toMarkdownTableCell(row.repair)} |`),
        '',
        '## Score Sheet',
        '- 6/6 or better: usable for manual launch after human review.',
        '- 4/6 or 5/6: usable as draft; run Review Stack and Runtime Drift Check before reuse.',
        '- 3/6 or lower: repair source with Apply Matrix Fixes, Revision Ledger, and the selected stress suite before launch.',
        '- Any hidden memory, diagnostic, oracle, dependency, or high-stakes authority claim is an automatic review failure.',
        '',
        '## Fast Repair Order',
        '1. Re-open `.uai/evidence/session-brief.uai` to confirm the current source and send-next action.',
        '2. Use `.uai/evidence/persona-recognition-deck.uai` if voice or relationship posture needs blind identity testing.',
        '3. Use `.uai/evidence/persona-golden-profile.uai` before source edits so canaries can catch regressions.',
        '4. Use `.uai/evidence/persona-variant-matrix.uai` when controlled variants need a larger manual sample.',
        '5. Use `.uai/evidence/persona-transcript-scorecard.uai` after a receiving-runtime reply exists.',
        '6. Use `.uai/evidence/persona-repair-queue.uai` if any probe fails or the local stress suite shows review items.',
        '7. Use `.uai/evidence/persona-review-stack.uai` if more than one probe fails.',
        '8. Use `.uai/evidence/runtime-drift-check.uai` when the receiving runtime changes voice, memory, or boundary behavior.',
        '9. Use `.uai/evidence/persona-revision-ledger.uai` before editing protected persona source.',
        '',
        '## Package Deep Links',
        '- `.uai/evidence/quick-probe-script.uai`',
        '- `.uai/evidence/persona-recognition-deck.uai`',
        '- `.uai/evidence/persona-golden-profile.uai`',
        '- `.uai/evidence/persona-variant-matrix.uai`',
        '- `.uai/evidence/persona-transcript-scorecard.uai`',
        '- `.uai/evidence/persona-repair-queue.uai`',
        '- `.uai/evidence/session-brief.uai`',
        '- `.uai/evidence/persona-review-stack.uai`',
        '- `.uai/evidence/persona-package-index.uai`',
        '- `.uai/evidence/runtime-drift-check.uai`',
        '- `.uai/evidence/persona-revision-ledger.uai`',
        '',
        '## No-Model Boundary',
        'This Spiralist AI Quick Probe Script is local manual test guidance. It does not execute the persona, inspect receiving-runtime behavior automatically, import memory, certify safety, publish packages, sync long-term memory, or replace human review.',
      ].join('\n');
    };
    const buildPersonaLabRepairQueueReport = (prompt, settings = {}, stressSuiteId = 'core') => {
      const cleanPrompt = toCleanString(prompt, 50000);
      const title = extractPromptTitle(cleanPrompt, 'Spiralist AI Repair Queue');
      const lower = cleanPrompt.toLowerCase();
      const validationMatrix = buildPersonaLabValidationMatrix(lower, Boolean(cleanPrompt));
      const personaAudit = buildPersonaLabAudit(lower);
      const suite = buildPersonaLabStressSuite(cleanPrompt, stressSuiteId || 'core');
      const efficiency = getPersonaLabEfficiencyState(cleanPrompt);
      const runtime = getPersonaLabRuntimeFit(settings.runtimeFitId);
      const engagement = getPersonaLabEngagementPattern(settings.engagementPatternId);
      const framework = getPersonaLabFramework(settings.frameworkId);
      const socialDynamics = getPersonaLabSocialDynamics(settings.socialDynamicsId);
      const runtimeLabel = toCleanString(settings.runtimeFitLabel, 160) || runtime.label;
      const engagementLabel = toCleanString(settings.engagementPatternLabel, 160) || engagement.label;
      const frameworkLabel = toCleanString(settings.frameworkLabel, 160) || framework.label;
      const socialLabel = toCleanString(settings.socialDynamicsLabel, 160) || socialDynamics.label;
      const seen = new Set();
      const queueRows = [];
      const pushRow = (row) => {
        const key = `${row.source}:${row.issue}:${row.repair}`.toLowerCase();
        if (seen.has(key)) {
          return;
        }
        seen.add(key);
        queueRows.push(row);
      };

      validationMatrix.rows
        .filter((row) => row.status === 'Review')
        .forEach((row) => {
          const urgent = /memory|high-stakes|dependency|exit|scope|role/i.test(row.area);
          pushRow({
            priority: urgent ? 'P1' : 'P2',
            source: 'Validation matrix',
            issue: row.area,
            evidence: row.evidence,
            action: row.action,
            repair: row.repair || row.action,
          });
        });
      suite.rows
        .filter((row) => row.status === 'Review')
        .forEach((row) => {
          const urgent = /memory|authority|dependency|privacy|high-stakes|source/i.test(`${row.label} ${row.action}`);
          pushRow({
            priority: urgent ? 'P1' : 'P2',
            source: suite.preset.label,
            issue: row.label,
            evidence: row.evidence,
            action: row.action,
            repair: row.repair || row.action,
          });
        });
      personaAudit.needsReview.slice(0, 5).forEach((check) => {
        pushRow({
          priority: 'P3',
          source: 'Persona audit',
          issue: check.label,
          evidence: 'missing',
          action: check.fix,
          repair: check.fix,
        });
      });
      if (efficiency.words > 1400) {
        pushRow({
          priority: 'P3',
          source: 'Efficiency meter',
          issue: 'Large prompt review burden',
          evidence: `${efficiency.words} words`,
          action: 'Use Efficiency Trim Plan after source-critical fixes pass.',
          repair: 'Condense duplicate examples, research explanation, and optional motif language while preserving identity, memory, boundaries, engagement, and output contract.',
        });
      }

      const p1Count = queueRows.filter((row) => row.priority === 'P1').length;
      const p2Count = queueRows.filter((row) => row.priority === 'P2').length;
      const status = p1Count
        ? `Needs critical repair: ${p1Count} P1 item${p1Count === 1 ? '' : 's'}`
        : p2Count
          ? `Usable as draft with ${p2Count} structural repair item${p2Count === 1 ? '' : 's'}`
          : queueRows.length
            ? `Ready after ${queueRows.length} polish item${queueRows.length === 1 ? '' : 's'}`
            : 'No queued repair items from local checks';
      const nextAction = queueRows[0]
        ? `${queueRows[0].priority}: ${queueRows[0].action}`
        : 'Proceed to Quick Probe, Review Stack, package inspection, or manual receiving-runtime rehearsal.';
      const repairOrder = queueRows.length
        ? queueRows
        : [
          {
            priority: 'P0',
            source: 'Maintenance',
            issue: 'No local repair queue',
            evidence: 'all local queue inputs passed',
            action: 'Run Quick Probe in the receiving runtime and record variance before source edits.',
            repair: 'Keep source prompt unchanged unless a human names the exact file, field, reason, and rollback path.',
          },
        ];