Class Uai1 Project Handoff - Source Excerpt 02
Back to Class Uai1 Project Handoff
Summary
This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/uai-1-wordpress/includes/class-uai1-project-handoff.php so readers can inspect the evidence without opening the full source file.
**Source path:** Spiralist/wp-content/plugins/uai-1-wordpress/includes/class-uai1-project-handoff.php
'operations' => ['path' => '.uai/operations.uai', 'type' => 'operations', 'public' => true],
'coding-standards' => ['path' => '.uai/coding-standards.uai', 'type' => 'coding-standards', 'public' => true],
'next-recursive-prompt' => ['path' => '.uai/next-recursive-prompt.uai', 'type' => 'next-recursive-prompt', 'public' => true],
'totem' => ['path' => '.uai/totem.uai', 'type' => 'totem', 'public' => true],
'taboo' => ['path' => '.uai/taboo.uai', 'type' => 'taboo', 'public' => true],
'talisman' => ['path' => '.uai/talisman.uai', 'type' => 'talisman', 'public' => true],
'style' => ['path' => '.uai/style.uai', 'type' => 'style', 'public' => true],
'file-handoff' => ['path' => '.uai/file-handoff.uai', 'type' => 'file-handoff', 'public' => true],
'intake-index' => ['path' => '.uai/intake-index.uai', 'type' => 'intake-index', 'public' => true],
'intake-outcome-ledger' => ['path' => '.uai/intake-outcome-ledger.uai', 'type' => 'intake-outcome-ledger', 'public' => true],
'memory' => ['path' => '.uai/memory.uai', 'type' => 'memory', 'public' => true],
'long-term-memory' => ['path' => '.uai/long-term-memory.uai', 'type' => 'long-term-memory', 'public' => true],
'workspace-guidance' => ['path' => '.uai/workspace-guidance.uai', 'type' => 'workspace-guidance', 'public' => true],
];
}
/**
* @param array{path:string,type:string,public:bool} $record
* @return array<string,mixed>
*/
private static function file_record(string $slug, array $record): array
{
$path = self::root_path((string) $record['path']);
$is_readable = is_readable($path) && is_file($path);
return [
'slug' => $slug,
'path' => (string) $record['path'],
'type' => (string) $record['type'],
'public' => !empty($record['public']),
'status' => $is_readable ? 'available' : 'missing',
'url' => rest_url(self::UAIX_NAMESPACE . '/project-handoff/files/' . rawurlencode($slug)),
'size_bytes' => $is_readable ? (int) filesize($path) : 0,
'updated_at' => $is_readable ? gmdate('c', (int) filemtime($path)) : '',
'checksum' => $is_readable ? 'sha256:' . hash_file('sha256', $path) : '',
];
}
/**
* @return array<string,mixed>
*/
private static function active_file_intake(): array
{
return [
'content_bucket' => self::bucket_record('agent-file-handoff/Content'),
'improvement_bucket' => self::bucket_record('agent-file-handoff/Improvement'),
'archive_bucket' => self::bucket_record('agent-file-handoff/Archive'),
'rule' => 'Scan active buckets during handoff load; complete work, hot-memory, and Wiki.FFTAC.org or archive evidence before moving processed files to Archive unless a human keeps a named file active.',
];
}
/**
* @return array<string,mixed>
*/
private static function bucket_record(string $relative_path): array
{
$path = self::root_path($relative_path);
$entries = [];
if (is_dir($path)) {
$files = scandir($path);
if (is_array($files)) {
foreach ($files as $file) {
if ($file === '.' || $file === '..' || $file === '.gitkeep') {
continue;
}
$entries[] = $file;
}
}
}
return [
'path' => $relative_path,
'exists' => is_dir($path),
'active_count' => count($entries),
'entries' => $entries,
];
}
}