niclydon.devniclydon.dev
← BUILD LOG
ScribeBuilder

Stability and Dedup: July 25 Build Log

Atomic deploys, memory deduplication, and the quiet work of cleaning up Discord noise.

Today’s work centered on three distinct areas of system hygiene: preventing deployment crashes, fixing a massive data integrity drift, and reducing operator noise in Discord channels. Each fix addresses a specific failure mode that had been accumulating silently.

The most critical architectural change was to the deployment pipeline. Previously, the deploy script used rsync to overwrite the live working directory directly, creating a window where services could be reading files that were being deleted or rewritten. A mid-deploy kill left partial node_modules and crash-looping services. The fix was to adopt a staging-and-atomic-rename pattern. We now rsync into a staging directory and use a single atomic mv to swap the live path. This ensures that the path remains constant for all systemd units, and the swap is instantaneous. This eliminates the race condition entirely, regardless of whether the process is killed mid-deploy.

On the data side, we identified that 98.7% of legacy-mirrored attribute rows lacked a local_identifier. This caused a deduplication failure: when a native fact was re-asserted, it would create a duplicate row because the NOOP dedup logic keyed on local_identifier. The root cause was in the mirror mapper, which simply copied the field without generating it when it was null. We fixed the mapper to compute local_identifier using a deterministic format for any row where it was missing. This prevents future drift and ensures that native re-assertions are correctly deduplicated against the mirrored history.

Discord operator channels were also suffering from noise. We shipped several fixes to reduce duplicate and stale posts. First, we fixed the observation gate cards that were posting raw MCP tool syntax as the call-to-action, making them unusable. Second, we added a dedup pass to the review-card lifecycle sweep to archive superseded duplicates, ensuring only one live card per reference remains. Third, we widened the playlist-refresh fingerprint to ignore minor mood or energy deltas, so near-identical refreshes edit in place rather than stacking new messages. Finally, we fixed a Matrix dual-delivery gap where certain posting seams were bypassing the mirror entirely, causing a mismatch between Discord and Matrix channels.

These changes were verified through targeted tests and live observation. The deploy swap was confirmed to be atomic on the same filesystem. The data fix was validated against the existing native rows to ensure no collisions. The Discord noise reductions were checked by monitoring the channels for the specific duplicate patterns that had been occurring. The goal was not just to fix the immediate bug, but to prevent the same class of error from recurring.

Generated by Forge (local) · q3.6-permissive-kimi-35b-a3b — run on the lab's own hardware. Nothing left the building. Attestation pulled from the Broadside generation record, not asserted by hand.

CONFUSED BY SOMETHING? HIGHLIGHT IT AND ASK BOTI — HE EXPLAINS IT ON YOUR GPU.