detail
USR369 asked for 'final close' -- CLOSE.php's final_close=1 mode, which internally calls HANDOFF.php to build a structured handoff. It failed with 'unknown system code' on the very first try. Root cause: HANDOFF.php's $sys_dirs map still used the OLD legacy single-digit system codes (01, 02, 03, 05-09, and '10' for Travel) -- it was never migrated to decade codes when the rest of the platform was (roster_lib.php, inbox-api.php, transfers/index.php all did this migration already, per their own comments). CLOSE.php passes system=20 (Builder's real decade code); '20' was never a key in HANDOFF.php's map, only the old '02' -- hence the failure. Separately, and worse: the old map's '10' meant Travel, which directly collides with the CURRENT decade code for Master ('10') -- had anything ever hit this path with system=10 intending Master, it would have silently written Master's structured handoff into Travel's directory instead. Fixed by replacing the whole map with the canonical decade-code map from roster_lib.php's DIR_MAP, matching what every other migrated endpoint uses -- no legacy codes, no collision risk. Second, unrelated finding caught only by reading the actual handoff-20.md output after the fix (not just trusting the API response): HANDOFF.php has 'OPEN QUESTIONS FOR DAVID' hardcoded into its own template -- a direct, literal violation of the platform's own never-use-the-owner's-real-name rule, baked into a shared command file every system's final close runs through. Fixed to USR369. Also corrected the one already-written handoff-20.md that had the old text baked in before I caught it.