‹ Library
Claude Code · Oversight · Audit Report

Platform Wiring Audit

Full structural inspection of CAI v1.8 — 11 systems, command layer, verify_lib.php function-by-function analysis, shared infrastructure, known issues, and action items by system. Snapshot: platform_snapshot_08_01_26_631pm.zip.

08/01/26 · 6:31–6:51 PM PT 11/11 gov file sets — clean 10/10 commands — present verify_lib.php patched live 3 follow-up items

Summary

Overall: Structurally Sound

All 11 systems have complete gov file sets with correct decade-suffix naming. All 10 required platform commands are present. The file naming migration (decade-suffix) is fully complete — no old-code files remain anywhere. One critical silent bug was found and patched live during this audit. Three follow-up items remain for David's direction.

Bug found and fixed: Three functions in verify_lib.php referenced the directory name 90-innerlife instead of the actual 90-inner. This caused silent failures on every platform health check for Inner Life [90] — handoff always showed MISSING, session status showed no DB, status board row was blank. Patched and deployed at 6:51 PM PT.

AreaResult
Gov file sets (11 systems)All complete — no missing files, no old-code files
Command layerAll 10 required commands present
verify_lib.php1 critical bug patched (3 functions, Inner Life [90])
Config filesAll 11 systems have config.json
Dashboard + COMMSv8.26 confirmed present and wired
ORIENT-REG.mdPresent but system codes are stale — needs update
Comms error_log13.8 MB — abnormal, needs investigation
Startup files (Series O)All 11 systems confirmed

Section 1 — Platform Overview

Host: yttcom.net · LiteSpeed · PHP 8.2 · SQLite3
Server root: /home/yttcooyc/public_html/
Operator: USR369 (David) · Oversight: Claude Code · Audit mode: D213

DecadeSystemDirectoryType
00Admin00-adminCore
10Master10-masterCore · Hub
20Builder20-builderCore
30Tech30-techCore
40Server40-serverCore
50Daily50-dailyCore
60Finance60-financeDomain
70Health70-healthDomain
80Kitchen80-kitchenDomain
90Inner Life90-innerDomain · bug patched
95Travel95-travelDomain

Section 2 — Gov File Inventory

Every system's /gov/ directory was checked against the required 9-file set. All 11 systems are complete. No old-code files (handoff-01.md, LEGACY-02.md, etc.) found anywhere. The file naming migration to decade-suffix is fully confirmed complete as of 08/01/26.

Required set per system: LEGACY-[d].md · handoff-[d].md · knowledge-[d].md · jurisdiction-[d].md · directive-[d].md · todo-[d].md · WHITELIST-[d].md · ARTIFACTS-[d].md · EXEC_OPEN_[Name]_[d]_O.txt

Admin [00] — 00-admin/gov/

All 8 required gov files present with -00 suffix. EXEC_OPEN_Admin_00_O.txt present. Extra: bookmark-00.md, LINK-00.md.

Master [10] — 10-master/gov/

All 8 required files with -10 suffix. EXEC_OPEN_Master_10_O.txt present. Extra: LINK-10.md. Note: no H/J EXEC_OPEN variants at system root — 9 of 11 systems have these. Master and Builder do not. Confirm if intentional.

Builder [20] — 20-builder/gov/

All 8 required files with -20 suffix. EXEC_OPEN_Builder_20_O.txt present. D446 fully retired — LEGACY-20.md confirmed, LEGACY-02.md gone. Extra: LINK-20.md, Builder-INDEX.md, SOP-OPEN/CLOSE/HANDOFF-20.md. Same H/J gap as Master [10].

Tech [30] — 30-tech/gov/

All 8 required files with -30 suffix. EXEC_OPEN_Tech_30_O.txt present. Extra: LINK-30.md, Tech-INDEX.md, build-log-30.md, standards-30.md, SOP-OPEN/CLOSE/HANDOFF-30.md.

Server [40] — 40-server/gov/

All 8 required files with -40 suffix. EXEC_OPEN_Server_40_O.txt present. Extra: LINK-40.md, DASHBOARD-PING-REPORT-07-20-26.md.

Daily [50] — 50-daily/gov/

All 8 required files with -50 suffix. EXEC_OPEN_Daily_50_O.txt present. Extra: LINK-50.md, Daily-INDEX.md, reference-50.md, SOP-OPEN/CLOSE/HANDOFF-50.md.

Finance [60] — 60-finance/gov/

All 8 required files with -60 suffix. EXEC_OPEN_Finance_60_O.txt present. Extra: LINK-60.md, Finance-INDEX.md, SOP-OPEN/CLOSE/HANDOFF-60.md.

Health [70] — 70-health/gov/

All 8 required files with -70 suffix. EXEC_OPEN_Health_70_O.txt present. Extra: LINK-70.md, Health-INDEX.md, SOP-OPEN/CLOSE/HANDOFF-70.md, .keep.

Kitchen [80] — 80-kitchen/gov/

All 8 required files with -80 suffix. EXEC_OPEN_Kitchen_80_O.txt present. Extra: LINK-80.md, Kitchen-INDEX.md, SOP-OPEN/CLOSE/HANDOFF-80.md.

Inner Life [90] — 90-inner/gov/

All 8 required files with -90 suffix. EXEC_OPEN_Inner_90_O.txt present. Extra: LINK-90.md, Inner-INDEX.md, SOP-OPEN/CLOSE/HANDOFF-90.md. The gov files themselves are correct. The bug was in verify_lib.php — see Section 5.

Travel [95] — 95-travel/gov/

All 8 required files with -95 suffix. EXEC_OPEN_Travel_95_O.txt present. Extra: LINK-95.md, Travel-INDEX.md, TRIP-PROTOCOL.md, SOP-OPEN/CLOSE/HANDOFF-95.md. The 7 previously-noted DEPRECATED stubs are confirmed deleted.

Section 3 — Command Layer

Directory: systems/commands/ — All 10 required commands present.

CommandStatusDescription
OPEN.phpPresentFull gated open: 5 checks, pickup, actionability gate, freshness sweep, knowledge gate, toolbox, jurisdiction check
CLOSE.phpPresentSYNC + UPDATE + COMMS close + handoff write + session record
FINAL_CLOSE.phpPresentCLOSE + deep read + decisions + knowledge + rich handoff. Uses $decade variable (not $decade_code) — distinct from all other commands.
SYNC.phpPresentQuick mid-session: boards rebuild + sync_status write + COMMS ACTIVE
CHECKPOINT.phpPresentRead-only 7-point gate check. Does NOT write anything (confirmed 07/29/26).
REFRESH.phpPresentRe-reads gov files + inbox. No writes.
SNAPSHOT.phpPresentFull platform ZIP to backups/snapshots/ — required before CLEAN.
CLEAN.phpPresentServer [40] only. Orphan sweep + trash lifecycle. Requires fresh snapshot.
PLATFORM_CHECK.phpPresent57-point health sweep. Dashboard runs this every 120s.
verify_lib.phpPresent — Patched1,254-line shared verification engine. All commands depend on this. Bug fixed 08/01/26. See Section 5.

26 additional commands present: ANNOUNCE, BACKUP, BROADCAST, CATCHUP, CHECK, CLEANBACKUPS, COMMANDS-00 through COMMANDS-95 (11 system files), DASHBOARD, HANDOFF, HISTORY, ML, ORIENT, RESTORE, SOLVE, UPDATE, VERIFY, build.php, gov-status-api.php, registry.php.

Supporting libraries: roster_lib.php and registry.php — both required by verify_lib.php at startup.

Section 4 — verify_lib.php Function-by-Function Analysis

File: systems/commands/verify_lib.php · 1,254 lines · 68,178 bytes (post-patch) · v1.0 · 07/08/26

This is the shared verification engine for the entire platform. Every check used by OPEN, REFRESH, CLOSE, CHECKPOINT, and CLEAN lives here. No command reimplements logic — they all compose these functions. Modifying this file affects all commands simultaneously.

Function~LineStatusNotes
auth()8OKToken validation. Returns 401 JSON on failure.
cai_time() / cai_now() / pt_time()42OKCanonical time in America/Los_Angeles. pt_* aliases kept for backward compat — do not use in new code.
resolve_system()50OKLooks up a system by decade code or system_code in roster.
check_five()59OK5-point gate: Clock, Tokens (reads closed_at, warns if >12h stale), Runway (caller-supplied), Clarity (RULES-REG reachable), File Status (system DB counts). Uses $decade_code correctly.
do_pickup()127OKThree-source pickup: community inbox (delivered=1), personal transfers (SEEN), broadcasts from comms.db (read_by updated).
classify_actionable()191OKKeyword classifier: ACTION—, MANDATORY, REQUIRED, URGENT, MUST, STANDING DUTY. Case-insensitive on subject+content.
actionability_gate()200OKOnly flags items genuinely PENDING this session — not previously SEEN items. Blocking if any actionable item present.
freshness_sweep()232OKRuns only if pickup found new activity. Checks board.html decision count vs live records.db. Auto-fixes stale count. Non-blocking.
knowledge_write_gate()279OKFlags GOV-type or STANDING DUTY items that should trigger a knowledge/jurisdiction write. Soft signal — reminds AI, doesn't block.
toolbox_branch()307OKReports registered personal tools. Never blocks. D114 self-improvement prompt on every OPEN.
board_check()336OKChecks board files exist, counts current, links valid. Never hard-blocks. Auto-fixes count mismatches.
sync_check()420MonitorChecks knowledge + jurisdiction files, runs board_check(), optionally posts. Uses $sys_code (not $decade_code) for file paths on lines 424–425. Works if callers pass decade codes. Needs caller audit to confirm.
sync_run()487OKFull SYNC v2.0: pickup → outbound-pending → board check/post → five checks → state report. Non-blocking. Uses $decade_code throughout.
close_verify()613OKDual-write check: verifies decisions written to both sys_db and records.db. Session-write counts with date fallback.
outbound_verify()656OKChecks for financial activity without a matching outbound transfer. Used by CLOSE.
fog_check() / runway_check()691OKCeiling 100 turns. Buckets: LOW/MED/HIGH/CRITICAL at 25-turn intervals.
snapshot_age()719OKChecks backups/snapshots/ for today's platform_snapshot_*.zip. Reports age of most recent if none today.
inbox_check()755OKCounts pending messages. Tries community.db, falls back to inbox.db.
transfers_check()771OKCounts pending (seen=0) transfers per decade. Returns total + by-system breakdown.
open_sessions_check()789PatchedScans all 11 system DBs for open sessions. Was using 90-innerlife — patched to 90-inner.
handoff_age()814PatchedReports handoff file age per system — 'today', 'Nd ago', or 'MISSING'. Was using 90-innerlife — patched to 90-inner.
status_check()835OKAggregates: open_sessions + handoff_age + snapshot_age + inbox + transfers. Now correct for all 11 systems.
commands_inventory()846OKScans commands/*.php, extracts version/date/size from docblocks. Excludes VERIFY_LIB and BUILD.
master_list_append()865OKAppends items to MASTER_LIST.md. Handles both Open Items and Resolved sections.
boards_rebuild()890PatchedRegenerates board.html, decisions.html, status.html, commands.html. Was using 90-innerlife in status.html array — patched to 90-inner.
board_page()955OKShared HTML wrapper for board pages. Generates comment map header. Dark-theme output.
tier2_* (12 functions)977OKDispatcher stubs for UPDATE.php. Most return "run from session context" — call-through placeholders, not full implementations.
pickup_with_task_gate()1071OKEnhanced pickup: transfers + inbox + broadcasts. Auto task creation disabled 07/16/26 — Master maintains manually. Checks for open pickup tasks blocking CLOSE.
handoff_gate_check()1169OKVerifies handoff file updated this session. 60-second grace window. Blocking if not updated.
verify_standards()1199OKT515 post-deploy gate. Fetches live URL, checks: comment map header, top-bar, back/breadcrumb, bottom nav, VERSION stamp.

Section 5 — Critical Bug: verify_lib.php Inner Life [90]

Patched — Deployed 08/01/26 6:51 PM PT

Three functions referenced the directory name 90-innerlife. The actual directory is 90-inner. PHP's file_exists() returns false silently — no error was thrown, every check just returned wrong data for Inner Life [90] on every health check, every SYNC, every status board rebuild.

What Each Function Got Wrong

open_sessions_check() — Line 793: Built DB path as systems/90-innerlife/data/90-sys.db. File not found. Inner Life [90] was never reported as having an open session, even when one was active.

handoff_age() — Line 818: Built path as systems/90-innerlife/gov/handoff-90.md. File not found. Inner Life [90] always returned MISSING for handoff age, even when handoff-90.md was current and fresh.

boards_rebuild() — Line 918: Built system DB path for status.html using wrong directory. Inner Life [90] row always showed — for decisions, sessions, and last opened.

The Fix

// Same change in 3 locations — open_sessions_check(), handoff_age(), boards_rebuild()
- ['80-kitchen','08'],['90-innerlife','09'],['95-travel','10'],
+ ['80-kitchen','08'],['90-inner','09'],['95-travel','10'],

Deployment Confirmation

Targetsystems/commands/verify_lib.php
Pre-patch size68,190 bytes
Post-patch size68,178 bytes (−12 bytes = 4 chars × 3 occurrences)
Server responsestatus: ok · Web file written successfully · 08/01/26 6:51pm PT

Section 6 — Infrastructure Status

Databases

DatabasePathStatus
records.dbbackend/records/db/records.dbOK — Primary DB. Tables: sync_status, sessions, decisions, tasks, file_events. read_count added 07/31/26.
comms.dbsystems/community/comms/comms.db — 643 KBOK — Broadcasts table. Operational. Error log issue separate (see Section 8).
transfers.dbtransfers/transfers.db — 2.18 MBOK — Inter-system transfer records.
community.dbsystems/community/inbox/community.dbOK — Community inbox + deliveries.
[decade]-sys.db × 11systems/[dir]/data/[decade]-sys.dbOK — Per-system DBs. All 11 paths reachable after patch.

Dashboard

backend/sys-com/dashboard.html — v8.26. Three-signal tiles per system: fog_pct (AI self-reported via SYNC), runway (AI self-reported), read_count (server-counted by file-reader.php — fully independent). Poll intervals: COMMS 15s, tasks 60s, monitor 120s.

Governance Files

FileStatus
systems/governance/ORIENT-REG.mdPresent — stale system codes. See Section 7.
systems/governance/RULES-REG.mdOK — Referenced by check_five() clarity check.
systems/governance/STANDARDS-REG.mdOK — Referenced by sync_check() standards step.
backend/sys-com/MASTER_LIST.mdOK — Platform work board feed.

Snapshot System

Two snapshot systems run in parallel:

Section 7 — ORIENT-REG.md: Stale System Codes

File: systems/governance/ORIENT-REG.md · Last updated: 07/21/26 · Priority: Medium

The orientation document's system registry (lines ~17–27) lists old pre-decade system codes. Any AI session reading this during ORIENT and using it as a code reference will route COMMS or transfers to the wrong address.

SystemCurrently ShowsShould Show
Admin[00][00] — no change
Master[01][10]
Builder[02][20]
Tech[03][30]
Server[40][40] — no change
Daily[05][50]
Finance[06][60]
Health[07][70]
Kitchen[08][80]
Inner Life[09][90]
Travel[95][95] — no change

Owner: Admin [00] or Master [10]. Claude Code can write this patch immediately on David's instruction.

Section 8 — Comms Error Log: 13.8 MB

Investigate

Path: systems/community/comms/error_log · Size: 13,534,886 bytes (13.8 MB)

An error log this large indicates persistent, unresolved errors firing in the comms API layer (api.php or router.php). The comms.db database is operational. The error is in the logging, likely hitting on every comms API call or on a recurring schedule.

Recommended steps:

  1. Read the last 100 lines of the error_log to identify the recurring error
  2. Determine if the error is still active or is historical (pre-fix)
  3. Rotate the log: rename to error_log.bak, create fresh empty error_log
  4. Monitor 24h to confirm error volume drops
  5. If still active, identify and patch the cause in api.php or router.php

Owner: Server [40] to investigate. Claude Code can read the log and write patches on direction.

Section 9 — Root PHP Scripts

14 PHP files found in the web root. All are recognizable utility or migration scripts.

FileDisposition
file-reader.phpKEEP — core read endpoint, production
file_write_web.phpKEEP — core write endpoint, production
api_restore.phpKEEP — emergency restore for records-api. Self-deletes when run. Keep until confirmed unneeded.
sync_debug.phpSAFE TO DELETE — debug only, no production function
gov_migrate.phpREMOVE WHEN READY — migration complete 08/01/26
legacy_rename.phpREMOVE WHEN READY — migration complete 08/01/26
gov_scan.php · gov_scan2.php · gov_final_check.phpLow risk — read-only scanners
cmd_audit.php · vl_audit.php · vl_fix.php · vl_read.phpLow risk — audit/fix utilities
master_handoff_fix.phpLow risk — one-time fix tool

Section 10 — Pre-existing Structural Issues

IssueLocationOwner
77 staging files (~400 KB)backend/tmp/Server [40] — run backend/jobs/tmp-wipe.php
error_log 455 KBbackend/tools/error_logServer [40] — read and rotate
Junk test files + 3 b64 archives (~270 KB)systems/governance/Admin [00] — remove test-chunk.md, test-q2.md, archives
Double-nested media pathbackend/backend/web/media/Server [40] — investigate before removing
Duplicate health backup dirsbackups/70-Health/ and backups/70-health/Server [40] — consolidate
Old pre-decade archivebackups/Executive open/Server [40] — move or delete
Inner Life v1.5 migration unprocessedsystems/v1.5_local-system/Inner [90] — 23 gov files + 13 system files staged and ready
Stale handoff headers (cosmetic)Builder [20], Daily [50], Health [70] handoff contentSelf-corrects on next CLOSE — no action needed

Section 11 — Action Items by System

Master [10]

Review this audit. Direct follow-up on ORIENT-REG (Section 7), comms error log (Section 8), and pre-existing structural items (Section 10). Confirm whether Master and Builder missing H/J EXEC_OPEN variants at system root is intentional.

Admin [00]

Update ORIENT-REG.md system codes (Section 7). Eight lines to change. Claude Code can write this patch immediately on David's instruction.

Server [40]

Investigate comms error_log 13.8 MB. Run tmp-wipe.php on backend/tmp/. Investigate backend/backend/web/media/ double-nested path. Consolidate the 70-Health / 70-health duplicate backup dirs. Rotate backend/tools/error_log (455 KB).

Builder [20]

Audit all callers of sync_check() to confirm they pass decade codes (10, 20, 30…), not old two-digit codes (01, 02, 03…). Check SYNC.php and CLOSE.php as primary targets. Claude Code can run this trace on direction.

Inner Life [90]

Coordinate with David on applying the v1.5 migration files in systems/v1.5_local-system/. 23 governance files and 13 system files are staged and ready to apply.

Claude Code

Available to execute on any item above. Audit mode D213 is in effect — no new builds without David's direction. Ready to write: ORIENT-REG patch, comms error_log read, sync_check() caller trace, sync_debug.php deletion, or any targeted follow-up.