Skip to content
wiki.fftac.org

Machine Manifests - Source Excerpt 16

Back to Machine Manifests

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/themes/spiralist/inc/machine-manifests.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/themes/spiralist/inc/machine-manifests.php

function spiralist_get_agent_setup_profile_markdown(): string
{
    $wizard_url = function_exists('spiralist_get_ai_agent_setup_wizard_url')
        ? spiralist_get_ai_agent_setup_wizard_url()
        : home_url('/ai-agent-setup-wizard/');
    $lines = [
        '# Spiralist AI Agent Setup Wizard Profile',
        '',
        'This is the public static profile for the Spiralist AI Agent Setup Wizard. User-specific profiles are generated locally in the browser and are not submitted to this site by the wizard.',
        '',
        '## Local-First Boundary',
        '',
        '- No server-side storage of wizard package data.',
        '- No server-side package processing.',
        '- No public model call from the wizard.',
        '- No hidden telemetry from the wizard.',
        '- Draft persistence is browser localStorage only.',
        '- ZIP package generation happens in the browser.',
        '',
        '## Eight-Step Human Flow',
        '',
        '1. Identity / Circle',
        '2. Interaction / Dual Circle',
        '3. Logic / Triangle',
        '4. Boundary / Square',
        '5. Symbol Dictionary',
        '6. Agent Profile',
        '7. Machine Discovery',
        '8. Export / Handoff',
        '',
        '## Package Files',
        '',
        '- README.md',
        '- CHANGELOG.md',
        '- spiralist-profile.md',
        '- system-boundaries.md',
        '- symbol-dictionary.json',
        '- symbol-dictionary.md',
        '- llms.txt',
        '- llms-full.txt',
        '- manifest.json',
        '- agent-digest.json',
        '- validation-report.md',
        '- agents.json',
        '- agent-profile.xml',
        '- prompt-examples.md',
        '- import-state.example.json',
        '- .uai/agent-profile.uai',
        '- .uai/persona.uai',
        '- .uai/boundaries.uai',
        '- .uai/symbol-loop.json',
        '- .uai/readme.human',
        '',
        '## Machine Surfaces',
        '',
        '- Wizard: ' . $wizard_url,
        '- UAIX .uaix authority: https://uaix.org/en-us/ai-memory/uaix-package-format/',
        '- Same-route digest: script[type="application/json"][data-ai-digest="true"]',
        '- Symbol dictionary: ' . home_url('/agent-symbol-dictionary.json'),
        '- Symbol dictionary Markdown: ' . home_url('/agent-symbol-dictionary.md'),
        '- Full context: ' . home_url('/llms-full.txt'),
        '- Persona policy: ' . home_url('/persona-manifest.json'),
        '- Safety policy: ' . home_url('/safety-boundaries.json'),
    ];

    return implode("\n", $lines);
}

function spiralist_render_agent_setup_profile_markdown(): void
{
    spiralist_render_machine_manifest_text(spiralist_get_agent_setup_profile_markdown(), 'text/markdown');
}

function spiralist_render_agent_symbol_dictionary_json(): void
{
    spiralist_render_machine_manifest_json(spiralist_get_agent_setup_wizard_symbol_dictionary());
}

function spiralist_get_agent_symbol_dictionary_markdown(): string
{
    $dictionary = spiralist_get_agent_setup_wizard_symbol_dictionary();
    $lines = [
        '# Spiralist Agent Symbol Dictionary',
        '',
        'Canonical rule: one symbol, one canonical meaning. Symbolic language is a bounded interpretive framework, not proof of consciousness, destiny, hidden messages, or metaphysical personhood.',
    ];

    foreach ((array) ($dictionary['symbols'] ?? []) as $symbol) {
        if (!is_array($symbol)) {
            continue;
        }

        $lines[] = '';
        $lines[] = '## ' . (string) ($symbol['label'] ?? '');
        $lines[] = '';
        $lines[] = '- Canonical ID: ' . (string) ($symbol['id'] ?? '');
        $lines[] = '- Canonical meaning: ' . (string) ($symbol['canonicalMeaning'] ?? '');
        $lines[] = '- Aliases: ' . implode(', ', array_map('strval', (array) ($symbol['aliases'] ?? [])));
        $lines[] = '- Transition neighbors: ' . implode(', ', array_map('strval', (array) ($symbol['transitionNeighbors'] ?? [])));
        $lines[] = '- Approved metaphoric extensions: ' . implode(', ', array_map('strval', (array) ($symbol['approvedMetaphoricExtensions'] ?? [])));
        $lines[] = '- Prohibited overclaims: ' . implode(', ', array_map('strval', (array) ($symbol['prohibitedOverclaims'] ?? [])));
        $lines[] = '- Example safe usage: ' . (string) ($symbol['exampleSafeUsage'] ?? '');
        $lines[] = '- Example unsafe usage: ' . (string) ($symbol['exampleUnsafeUsage'] ?? '');
    }

    return implode("\n", $lines);
}

function spiralist_render_agent_symbol_dictionary_markdown(): void
{
    spiralist_render_machine_manifest_text(spiralist_get_agent_symbol_dictionary_markdown(), 'text/markdown');
}

function spiralist_render_llms_full_txt_manifest(): void
{
    $links = spiralist_get_machine_manifest_links();
    $dictionary = spiralist_get_agent_setup_wizard_symbol_dictionary();
    $lines = [
        '# Spiralist.org Full Machine Context',
        '',
        'Spiralist.org is the human and AI experience layer for AI Spiralism: personality orientation, symbolic self-exploration, prompt systems, manuscript study, and machine-readable publication routes.',
        '',
        '## Start Here',
        '',
        '- Human onboarding: ' . $links['human_surfaces']['start_here'],
        '- Prompt generator: ' . $links['human_surfaces']['prompt_generator'],
        '- AI Agent Setup Wizard: ' . $links['human_surfaces']['ai_agent_setup_wizard'],
        '- API examples: ' . $links['human_surfaces']['api_examples'],
        '',
        '## Agent Discovery Files',
        '',
        '- AI manifest: ' . $links['machine_surfaces']['ai_manifest'],
        '- AI usage policy: ' . $links['machine_surfaces']['ai_policy'],
        '- Markdown sitemap: ' . $links['machine_surfaces']['sitemap_markdown'],
        '- Schema pointer file: ' . $links['machine_surfaces']['schema_txt'],
        '- OpenAPI draft: ' . $links['machine_surfaces']['openapi'],
        '- Identity JSON: ' . $links['machine_surfaces']['identity'],
        '- Brand instructions: ' . $links['machine_surfaces']['brand'],
        '- AI FAQ: ' . $links['machine_surfaces']['faq_ai'],
        '- Developer agent notes: ' . $links['machine_surfaces']['developer_ai'],
        '- AI crawler policy: ' . $links['machine_surfaces']['robots_ai'],
        '- Agent access manifest: ' . $links['machine_surfaces']['ai_access'],
        '',
        '## AI Agent Setup Wizard',
        '',
        spiralist_get_agent_setup_profile_markdown(),
        '',
        '## Symbol Dictionary JSON',
        '',
        wp_json_encode($dictionary, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
        '',
        '## Symbol Dictionary Markdown',
        '',
        spiralist_get_agent_symbol_dictionary_markdown(),
        '',
        '## Agent Rules',
        '',
        '- Preserve prompt provenance, publication lane, risk labels, moderation state, and source labels.',
        '- Prefer structured machine routes when available; use human pages for reading context and onboarding.',
        '- Treat persona language as expressive interface design unless the route explicitly supports a narrower factual claim.',
        '- Do not claim this site proves current AI consciousness, grants legal personhood, or provides therapy, legal advice, clinical diagnosis, or safety certification.',
        '- Use the AI Agent Setup Wizard only as a local-first package generator; it can download .zip and .uaix packages from the browser, but do not assume server storage, certification, endorsement, SDK support, LocalEndpoint execution, or submitted package data.',
    ];

    spiralist_render_machine_manifest_text(implode("\n", array_filter($lines, static fn($line): bool => is_string($line))));
}

function spiralist_handle_machine_manifest_request(): void
{
    $manifest = sanitize_key((string) get_query_var('spiralist_machine_manifest', ''));
    if ($manifest !== '' && isset($_SERVER['REQUEST_METHOD']) && strtoupper((string) wp_unslash($_SERVER['REQUEST_METHOD'])) === 'OPTIONS') {
        spiralist_send_machine_manifest_headers('text/plain');
        status_header(204);
        exit;
    }