Test LLMWikis Starter Bundle
<?php /**
Metadata
| Field | Value |
|---|---|
| Source site | llmwikis.org |
| Source URL | https://llmwikis.org/ |
| Canonical AIWikis URL | https://aiwikis.org/llmwikis/files/raw-system-archives-llmwikis-recent-work-sweep-2026-05-03-scripts-test-l-859372f4/ |
| Source reference | raw/system-archives/llmwikis/recent-work-sweep/2026-05-03/scripts/test-llmwikis-starter-bundle.php |
| File type | php |
| Content category | memory-file |
| Last fetched | 2026-06-22T01:56:21.9510185Z |
| Last changed | 2026-05-03T02:24:02.1739833Z |
| Content hash | sha256:859372f4ad334afc2480330967b758edfb036e8dd52be22ad6c167600940e92c |
| Import status | unchanged |
| Raw source layer | data/sources/llmwikis/raw-system-archives-llmwikis-recent-work-sweep-2026-05-03-scripts-test-llmwikis-starter-bundle-p-859372f4ad33.php |
| Normalized source layer | data/normalized/llmwikis/raw-system-archives-llmwikis-recent-work-sweep-2026-05-03-scripts-test-llmwikis-starter-bundle-p-859372f4ad33.txt |
Current File Content
Structure Preview
- No Markdown headings were detected in this file.
Raw Version
<?php
/**
* Architecture tests for the LlmWikis starter template registry and bundle.
*
* Run with:
* php scripts/test-llmwikis-starter-bundle.php
*
* @package LlmWikis
*/
$root = defined( 'ABSPATH' ) ? rtrim( ABSPATH, '/\\' ) : dirname( __DIR__ );
require_once $root . '/wp-content/themes/llmwikis-knowledge-theme/inc/starter-bundle.php';
$failures = array();
function llmwikis_test_assert( $condition, $message ) {
global $failures;
if ( ! $condition ) {
$failures[] = $message;
}
}
$templates = llmwikis_starter_template_definitions();
$bundles = llmwikis_starter_bundle_definitions();
$errors = llmwikis_validate_starter_registry( $templates, $bundles );
llmwikis_test_assert( empty( $errors ), 'canonical starter registry should validate: ' . implode( '; ', $errors ) );
llmwikis_test_assert( count( $templates ) >= 18, 'starter registry should include the requested implementation templates' );
llmwikis_test_assert( isset( $bundles['llm-wiki-starter'] ), 'starter bundle should be registered' );
llmwikis_test_assert( isset( $bundles['llm-wiki-starter']['publisher'] ) && 'LlmWikis.org' === $bundles['llm-wiki-starter']['publisher'], 'starter bundle should identify LlmWikis.org as source publisher' );
$required_template_ids = array(
'readme',
'index',
'governance',
'trust-model',
'contributing',
'changelog',
'glossary',
'system-overview',
'architecture-decisions',
'decision-log',
'open-questions',
'runbooks',
'agent-instructions',
'retrieval-guide',
'orchestration-runbook',
'task-packet-template',
'support-escalation-checklist',
'update-rules',
'citation-rules',
'safety-boundaries',
'ai-usage-policy',
);
foreach ( $required_template_ids as $template_id ) {
llmwikis_test_assert( isset( $templates[ $template_id ] ), "missing required template {$template_id}" );
}
$files = llmwikis_build_starter_bundle_files( 'llm-wiki-starter' );
llmwikis_test_assert( isset( $files['llm-wiki/MANIFEST.json'] ), 'bundle should include generated manifest' );
llmwikis_test_assert( isset( $files['llm-wiki/agent/ORCHESTRATION_RUNBOOK.md'] ), 'bundle should include agentic orchestration runbook' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/ORCHESTRATION_RUNBOOK.md'], 'Before an orchestrated run' ), 'orchestration runbook should include before-run guidance' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/ORCHESTRATION_RUNBOOK.md'], 'public MCP, A2A, write API, trace exporter' ), 'orchestration runbook should preserve support boundaries' );
llmwikis_test_assert( isset( $files['llm-wiki/agent/TASK_PACKET_TEMPLATE.md'] ), 'bundle should include agentic task packet template' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/TASK_PACKET_TEMPLATE.md'], '## Task Boundary' ), 'task packet template should include task boundary section' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/TASK_PACKET_TEMPLATE.md'], 'Evidence Destinations' ), 'task packet template should name evidence destinations' );
llmwikis_test_assert( isset( $files['llm-wiki/agent/SUPPORT_ESCALATION_CHECKLIST.md'] ), 'bundle should include agentic support escalation checklist' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/SUPPORT_ESCALATION_CHECKLIST.md'], '## Escalation Triggers' ), 'support checklist should include escalation triggers section' );
llmwikis_test_assert( false !== strpos( $files['llm-wiki/agent/SUPPORT_ESCALATION_CHECKLIST.md'], 'public runtime, support service, MCP server' ), 'support checklist should preserve support boundaries' );
llmwikis_test_assert( array_keys( $files ) === array_unique( array_keys( $files ) ), 'bundle file paths should be unique' );
llmwikis_test_assert( empty( llmwikis_build_starter_bundle_files( 'missing-bundle' ) ), 'invalid bundle id should return no files' );
foreach ( $templates as $template_id => $template ) {
llmwikis_test_assert( isset( $files[ $template['path'] ] ), "bundle missing template file {$template['path']}" );
llmwikis_test_assert( $files[ $template['path'] ] === $template['content'], "bundle content drift for {$template_id}" );
llmwikis_test_assert( false !== strpos( $template['content'], '## How An LLM Should Use This File' ), "template {$template_id} should include agent usage guidance" );
llmwikis_test_assert( false !== strpos( $template['content'], '## Owner And Review Cadence' ), "template {$template_id} should include owner and cadence guidance" );
}
$page_html = llmwikis_starter_template_content();
llmwikis_test_assert( false !== strpos( $page_html, 'source publisher' ), 'starter page should state source-publisher boundary' );
foreach ( $templates as $template ) {
llmwikis_test_assert( false !== strpos( $page_html, llmwikis_starter_html( $template['path'] ) ), "starter page should document {$template['path']}" );
llmwikis_test_assert( false !== strpos( $page_html, llmwikis_starter_html( $template['content'] ) ), "starter page should render canonical content for {$template['path']}" );
}
$duplicate_templates = $templates;
$duplicate_templates['duplicate-id'] = $duplicate_templates['readme'];
$duplicate_templates['duplicate-id']['path'] = 'llm-wiki/DUPLICATE_ID.md';
$duplicate_errors = llmwikis_validate_starter_registry( $duplicate_templates, $bundles );
llmwikis_test_assert( in_array( 'duplicate template id readme', $duplicate_errors, true ), 'duplicate template ids should fail loudly' );
$duplicate_path_templates = $templates;
$duplicate_path_templates['duplicate-path'] = $duplicate_path_templates['index'];
$duplicate_path_templates['duplicate-path']['id'] = 'duplicate-path';
$duplicate_path_errors = llmwikis_validate_starter_registry( $duplicate_path_templates, $bundles );
llmwikis_test_assert( in_array( 'duplicate template path llm-wiki/INDEX.md', $duplicate_path_errors, true ), 'duplicate template paths should fail loudly' );
$unsafe_templates = $templates;
$unsafe_templates['readme']['path'] = '../README.md';
$unsafe_errors = llmwikis_validate_starter_registry( $unsafe_templates, $bundles );
llmwikis_test_assert( in_array( 'unsafe template path ../README.md', $unsafe_errors, true ), 'unsafe template paths should fail loudly' );
$missing_template_bundles = $bundles;
$missing_template_bundles['llm-wiki-starter']['included_templates'][] = 'unknown-template';
$missing_template_errors = llmwikis_validate_starter_registry( $templates, $missing_template_bundles );
llmwikis_test_assert( in_array( 'bundle llm-wiki-starter references missing template unknown-template', $missing_template_errors, true ), 'bundles referencing missing templates should fail loudly' );
$empty_bundles = $bundles;
$empty_bundles['llm-wiki-starter']['included_templates'] = array();
$empty_errors = llmwikis_validate_starter_registry( $templates, $empty_bundles );
llmwikis_test_assert( in_array( 'bundle llm-wiki-starter is empty', $empty_errors, true ), 'empty bundles should fail safely' );
if ( class_exists( 'ZipArchive' ) ) {
$zip_bytes = llmwikis_generate_starter_bundle_zip( 'llm-wiki-starter' );
llmwikis_test_assert( false !== $zip_bytes && strlen( $zip_bytes ) > 1000, 'dynamic ZIP should be generated from canonical files' );
$tmp = tempnam( sys_get_temp_dir(), 'llmwikis-test-zip-' );
file_put_contents( $tmp, $zip_bytes );
$zip = new ZipArchive();
if ( true === $zip->open( $tmp ) ) {
$zip_paths = array();
for ( $i = 0; $i < $zip->numFiles; $i++ ) {
$zip_paths[] = $zip->getNameIndex( $i );
}
llmwikis_test_assert( $zip_paths === array_keys( $files ), 'ZIP file order should be deterministic and match bundle file order' );
foreach ( $files as $path => $expected_content ) {
llmwikis_test_assert( $zip->getFromName( $path ) === $expected_content, "ZIP content drift for {$path}" );
}
$zip->close();
} else {
llmwikis_test_assert( false, 'dynamic ZIP should be readable by ZipArchive' );
}
@unlink( $tmp );
} else {
echo "ZipArchive unavailable; skipped byte-level ZIP inspection.\n";
}
if ( ! empty( $failures ) ) {
foreach ( $failures as $failure ) {
echo 'FAIL: ' . $failure . PHP_EOL;
}
exit( 1 );
}
echo 'LlmWikis starter bundle tests passed.' . PHP_EOL;
Why This File Exists
This is a memory-system evidence file from llmwikis.org. It is shown here because AIWikis.org is demonstrating the real source files that make the UAIX / LLM Wiki memory system work, not only summarizing those systems after the fact.
Role
This file is memory-system evidence. It records source history, archive transfer, intake disposition, or another piece of provenance that should be retrievable without becoming an unsupported public claim.
Structure
The file has no Markdown headings, so its path, frontmatter, file type, and provenance metadata carry most of the retrieval meaning.
Prompt-Size And Retrieval Benefit
Keeping this material in a separate file reduces prompt pressure because an agent can load this exact unit only when its role, source site, category, or hash is relevant. The surrounding index pages point to it, while this page preserves the full content for audit and exact recall.
How To Use It
- Humans should read the metadata first, then inspect the raw content when they need exact wording or provenance.
- LLMs and agents should use the source site, category, hash, headings, and related files to decide whether this file belongs in the active prompt.
- Crawlers should treat the AIWikis page as transparent evidence and follow the source URL/source reference for authority boundaries.
- Future maintainers should regenerate this page whenever the source hash changes, then review the explanation if the role or structure changed.
Update Requirements
When this source file changes, update the raw source layer, normalized source layer, hash history, this rendered page, generated explanation, source-file inventory, changed-files report, and any source-section index that links to it.
Related Pages
- Source overview
- Site file index
- Site report index
- UAI system index
- Source provenance
- Site directory
- Organization reports
Provenance And History
- Current observation:
2026-06-22T01:56:21.9510185Z - Source origin:
current-source-workspace - Retrieval method:
local-source-workspace - Duplicate group:
sfg-636(primary) - Historical hash records are stored in
data/hashes/source-file-history.jsonl.
Machine-Readable Metadata
{
"title": "Test LLMWikis Starter Bundle",
"source_site": "llmwikis.org",
"source_url": "https://llmwikis.org/",
"canonical_url": "https://aiwikis.org/llmwikis/files/raw-system-archives-llmwikis-recent-work-sweep-2026-05-03-scripts-test-l-859372f4/",
"source_reference": "raw/system-archives/llmwikis/recent-work-sweep/2026-05-03/scripts/test-llmwikis-starter-bundle.php",
"file_type": "php",
"content_category": "memory-file",
"content_hash": "sha256:859372f4ad334afc2480330967b758edfb036e8dd52be22ad6c167600940e92c",
"last_fetched": "2026-06-22T01:56:21.9510185Z",
"last_changed": "2026-05-03T02:24:02.1739833Z",
"import_status": "unchanged",
"duplicate_group_id": "sfg-636",
"duplicate_role": "primary",
"related_files": [
],
"generated_explanation": true,
"explanation_last_generated": "2026-06-22T01:56:21.9510185Z"
} Next Useful Routes
- Start Here A task-first reading path for AIWikis.org, separating newcomer learning, source-memory lookup, maintainer workflow, and AI-agent retrieval.
- Topic Index A tag-oriented index for LLM Wiki, AI memory, UAI, source governance, crawling, and retrieval topics.
- Source Map AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
- LLMWikis.org LLMWikis.org source-system overview for transparent AIWikis memory demonstration.
- LLMWikis.org Source Memory Guide AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
- LLMWikis.org Files Site-scoped current-source file index for LLMWikis.org.