New layoutMappings/layoutMappingVersions collections plus documents fields
(layoutMappingUsed/layoutMappingVersionUsed/layoutApplied/layoutFingerprintHash) and
a promote_shared_layout_mapping.pb.js hook that flips a mapping to "shared" once a
second, different user independently creates one with the same fingerprintHash.
Found and fixed a real security gap by testing the live rule rather than trusting the
rule text: the original updateRule only gated WHO could update a layoutMappings
record, not WHICH fields - letting an owner trivially self-promote their own mapping
to "shared" via a plain PATCH, defeating the whole confirmation requirement. Fixed in
a follow-up migration (6_fix_layout_mapping_update_rule.js) that blocks setting status
to "shared" directly while leaving ordinary edits and self-retiring untouched.
Verified against the real rebuilt PocketBase container: both collections and all four
new documents fields confirmed via the REST API; two real signed-up users with a
matching fingerprintHash both correctly flip to shared via the hook, visible to a
third user; a still-private mapping 404s for every other user; the self-promotion
gap reproduced before the fix and confirmed blocked after it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>