carlos / platform Public

retire-app-lock-407

Fixes #407: a follower created, or moved onto the channel, between the canary retire's final re-list and its pointer delete could slip through.

What changes (console only)

  • The canary retire holds the app lock (s.lockApp) from its final re-list (recordStamps) through the pointer DeleteIfMatch.
  • Every console write that can add a follower holds the same lock. That covers record creates (createRecordMarked, createSidecarMarked, the lifetimes-off first-route attach) and channel-bearing updates (the channel move, a confirmed channel-move proposal, instance update, gate, rate limit, updates, install). Lifetime paths already held it (withAppHost).
  • Each writer keeps its own provision call inside withRecordLock, so the record-write census still sees it in its handler.
  • Writes that cannot add a follower are deliberately not locked: moves, seed and run state, asset generations, tombstones and deletes.
  • A write that waits for the retire lands after the pointer is gone, which the create door already allows.

Tests. TestRetireSerialisesWithFollowerWrites starts a create, and separately a channel move, while the retire holds the lock. On main both land inside the window; here both wait, and the retire goes through.

Witness. Every console fixture fails a console create or channel change without the app lock. It checks the writing goroutine's own lock holder on its stack, not just "held by someone", and judges only accepted writes. On main's code it names createRecordMarked, createSidecarMarked and handleAPIInstanceChannel. TestRecordWriteWitnessNeedsTheWritersOwnLock is the negative probe.

Census. Root-read: not engaged (console is out of scope since C2). Record-write (9B8): ten units re-pinned with classes unchanged (retire_app_lock_407_census_test.go). Astra approved all ten.

Review. Astra round 1 (docs/superpowers/specs/CODEX-FINDINGS-RETIRE-APP-LOCK-407.md): READY AFTER FIXES, no P1. Both P2s are fixed in 8932c399 without another round.

Commits 7
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity