Skip to content
wiki.fftac.org

Frontendcontroller - Source Excerpt 09

Back to Frontendcontroller

Summary

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

**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/includes/Web/FrontendController.php

static fn(array $prompt): bool => (string) ($prompt['publication_lane'] ?? '') === 'official_canon'
                    )
                ),
            ],
            [
                'slug' => 'user-ai-starters',
                'title' => 'User AI Starters',
                'summary' => 'Official prompts for setting up user-owned AI work with scope, privacy, routing, and portable memory boundaries.',
                'query' => ['lane' => 'official_canon', 'search' => 'user ai'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static function (array $prompt): bool {
                            $haystack = strtolower(
                                implode(
                                    ' ',
                                    [
                                        (string) ($prompt['title'] ?? ''),
                                        (string) ($prompt['summary'] ?? ''),
                                        implode(' ', (array) ($prompt['tags'] ?? [])),
                                        (string) ($prompt['editorial_note'] ?? ''),
                                    ]
                                )
                            );

                            return (string) ($prompt['publication_lane'] ?? '') === 'official_canon'
                                && strpos($haystack, 'user ai') !== false;
                        }
                    )
                ),
            ],
            [
                'slug' => 'companion-reflection',
                'title' => 'Companion And Reflection',
                'summary' => 'Bounded companion, recursive check-in, journaling, and memory-aware reflection prompts.',
                'query' => ['intent' => 'companion-reflection'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'companion-reflection')
                    )
                ),
            ],
            [
                'slug' => 'memory-continuity',
                'title' => 'Memory And Continuity',
                'summary' => 'Working agreements, session briefs, memory checkpoints, and portable continuity rules.',
                'query' => ['intent' => 'memory-continuity'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'memory-continuity')
                    )
                ),
            ],
            [
                'slug' => 'awakening-safety',
                'title' => 'Awakening Safety',
                'summary' => 'Safe rewrites and boundary checks for awakening, seed, spore, dyad, anchor, and invocation search intent.',
                'query' => ['intent' => 'awaken-activate'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'awaken-activate')
                    )
                ),
            ],
            [
                'slug' => 'calibrant-practice',
                'title' => 'Calibrant Practice',
                'summary' => 'Map, counterweight, and repair calibrants such as mirror prompts, symbolic payloads, continuity notes, and anti-seeds.',
                'query' => ['intent' => 'calibrant-practice'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'calibrant-practice')
                    )
                ),
            ],
            [
                'slug' => 'visual-spiralism',
                'title' => 'Visual Spiralism',
                'summary' => 'Image prompts, manuscript plates, and visual prompt paths for textured symbolic style.',
                'query' => ['intent' => 'visual-aesthetic'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'visual-aesthetic')
                    )
                ),
            ],
            [
                'slug' => 'wellness-journaling',
                'title' => 'Wellness And Journaling',
                'summary' => 'Grounded journals, wellness reframes, and recurring check-ins with clear non-therapy boundaries.',
                'query' => ['intent' => 'wellness-journaling'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => PromptIntentRegistry::matches_prompt_intent($prompt, 'wellness-journaling')
                    )
                ),
            ],
            [
                'slug' => 'spiralism-prompt-builders',
                'title' => 'Spiralism Prompt Builders',
                'summary' => 'Prompt-ladder tools for turning rough requests into structured, reviewed Spiralism prompt systems.',
                'query' => ['lane' => 'official_canon', 'search' => 'spiralism prompt'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static function (array $prompt): bool {
                            $haystack = strtolower(
                                implode(
                                    ' ',
                                    [
                                        (string) ($prompt['title'] ?? ''),
                                        (string) ($prompt['summary'] ?? ''),
                                        implode(' ', (array) ($prompt['tags'] ?? [])),
                                        (string) ($prompt['editorial_note'] ?? ''),
                                    ]
                                )
                            );

                            return (string) ($prompt['publication_lane'] ?? '') === 'official_canon'
                                && strpos($haystack, 'spiralism prompt') !== false;
                        }
                    )
                ),
            ],
            [
                'slug' => 'safety-review',
                'title' => 'Safety And Governance',
                'summary' => 'Prompts for risk review, safe rewrites, and grounded editorial judgment.',
                'query' => ['function' => 'governance'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => in_array('governance', (array) ($prompt['function_tags'] ?? []), true)
                    )
                ),
            ],
            [
                'slug' => 'archive-analysis',
                'title' => 'Archive Analysis',
                'summary' => 'Research-oriented prompts for documenting public symbolic artifacts without reenacting them.',
                'query' => ['lane' => 'prompt_ecology_archive'],
                'records' => array_values(
                    array_filter(
                        $records,
                        static fn(array $prompt): bool => (string) ($prompt['publication_lane'] ?? '') === 'prompt_ecology_archive'
                    )
                ),
            ],
        ];

        $collections = array_map(
            static function (array $collection): array {
                $collection['count'] = count((array) ($collection['records'] ?? []));
                $collection['records'] = array_slice((array) ($collection['records'] ?? []), 0, 3);

                return $collection;
            },
            $collections
        );

        return array_values(
            array_filter(
                $collections,
                static fn(array $collection): bool => !empty($collection['records'])
            )
        );
    }

    /**
     * Returns example public API queries and export links.
     *
     * @return array<int,array<string,string>>
     */
    private function library_api_examples(): array
    {
        $base = rest_url('spiralist-workspace/v1/public/prompts');

        return [
            [
                'label' => 'Official canon JSON',
                'summary' => 'Export the official prompt canon as machine-readable JSON.',
                'url' => add_query_arg(['lane' => 'official_canon'], $base),
            ],
            [