feat(audit): cross-phase back-write detection + false-lead guard (4.3.0)#10
Conversation
jetpack-compose-audit gains axis 3 of the recomposition problem, plus a scoring guard against no-op "fixes". Axes 1-2 (stability/skipping, deferred reads) were already covered by this suite. - search-playbook.md: Cross-Phase Back-Write Heuristic (layout callbacks onSizeChanged/onGloballyPositioned/onPlaced writing state read in composition; SnapshotStateMap/List mutated in a @composable body) + red-flag bullet next to the existing same-body backwards-write rule. - scoring.md: matching Performance deduction (Critical when per-frame or across reused lazy items) + "Do Not Credit - False Leads" table so the auditor stops rewarding/suggesting remember(index) on pure fns, identity caches for derived maps, Exactly(1) on both rows, hoisting without stabilizing lambdas, etc. - diagnostics.md: Quick Triage Recipe step 7 to surface candidates up front. - Version: jetpack-compose-audit -> 4.3.0 (SKILL + both plugin.json). compose-agent unchanged at 4.2.1. Axis 3 and the false-lead cases adapted (reworded, re-cited against developer.android.com) from chrisbanes/skills compose-recomposition-performance (Apache-2.0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
🟠 Antigravity review (automated cross-review)Overall, this is a solid update to catch subtle performance bugs and prevent false-positive scoring. However, there are a few issues to address, primarily around regex usage for the AI agent. Should-fix / Blocker
Nit
via pr-review-relay · author: claude |
Addresses round-1 cross-review (Codex, Cursor, Antigravity) — no blockers, these are the should-fixes: - Taxonomy: split axis-3 cross-phase (layout->composition) from composition-phase self-invalidation (snapshot-collection mutation in a @composable body). The latter is NOT cross-phase; add a score-once note vs the existing same-body backwards-write rule to avoid double-deduction. (search-playbook, scoring, diagnostics, SKILL, canonical-sources) - SSM false-lead correctness: manually remember-ing callbacks is itself the no-op under Strong Skipping (auto-memoized); the "fresh lambda defeats skipping" lever only holds SSM-off / opt-out paths / unstable captures. Reworded the table row + added a compiler-track caveat. - Agent context blow-up: scope the snapshot-mutation search to the files that hit the collection search, not the whole repo. Added += / -= operators. - diagnostics step 7 regex aligned with the playbook (SnapshotStateList/Map). - SKILL.md Performance focus + canonical-sources list now name the new shapes. - Changelog: note the manifest jump 4.2.0 -> 4.3.0 (4.2.2 was docs-only). - evals.json: cases 12 (cross-phase back-write) and 13 (false-lead must not be credited/suggested under SSM) lock in the 4.3.0 behavior. - Softened the false-lead routing line: detectors live in the playbook, the guard lives in scoring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
Round-2 cross-review (Codex, Cursor) — no blockers: - SSM contradiction (Codex): the instance-recreation-churn rule no longer lists bare lambda literals as churn-to-remember — SSM auto-memoizes lambdas, so that would reintroduce the exact no-op advice the false-lead guard suppresses. Qualified both the Deduct bullet and the SSM-ON prose (lambdas churn only SSM-off / opt-out paths / unstable captures). - eval 12 (Codex, Cursor): dropped BoxWithConstraints from the accepted fix — it exposes parent constraints, not a sibling's measured width. Keep Modifier.layout / custom Layout / SubcomposeLayout. - addAll added to the scoring snapshot-mutation list (parity with the playbook). - red-flag narrowed from "layout- or draw-phase" to "layout-phase" to match the detectors (onSizeChanged/onGloballyPositioned/onPlaced). - Reward bullet added for absence of cross-phase back-writes (rubric symmetry). - evals description no longer claims cases 12-13 back compose-agent behavior (audit-only). - README/CHANGELOG: separated cross-phase (axis 3) from composition-phase self-invalidation; false-lead example now matches the table (manual remember under SSM), category table lists cross-phase back-writes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
🟢 Codex review (automated cross-review)Blocker Should-fix
Nit
via pr-review-relay · author: claude |
🔵 Cursor review (automated cross-review)PR #10 review —
|
…ion eval, 4.3.0 release notes Round-3 cross-review (Codex, Cursor) — no blockers: - Detector coverage (Codex): snapshot search now includes toMutableStateList() / toMutableStateMap() builders (create the types without naming the factory) in both the playbook heuristic and diagnostics step 7. - CHANGELOG split (Codex, Cursor): cross-phase (axis 3) and composition-phase self-invalidation are now separate bullets; the "cite writer+reader file:line" claim is scoped to the cross-phase shape only. - CHANGELOG 4.2.2 reconciled: the 4.2.2 entry now says content-only, matching the 4.3.0 note about the manifest jump. - eval 14 (Cursor): acceptance case for snapshot-collection self-invalidation in a @composable body — must not be labeled cross-phase, scored once, not a stability finding. - docs/release-notes-4.3.0.md added for parity with prior releases; linked from README What's new. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
What
Adds axis 3 of the recomposition problem to
jetpack-compose-audit, a related composition-phase self-invalidation check, and a scoring guard against no-op "fixes". Prompted bychrisbanes/skillscompose-recomposition-performance(Apache-2.0) — this suite already covered axes 1–2 (stability/skipping, deferred reads), so only the genuinely-missing parts are imported, reworded, and re-cited againstdeveloper.android.com.Why
The audit already deducted for same-body backwards writes but was blind to the subtler cross-phase shape (a layout-phase write into state composition read) and had no guard against crediting plausible-but-useless recomposition "fixes".
Changes
search-playbook.mdscoring.mddiagnostics.mdevals/evals.jsonjetpack-compose-audit→ 4.3.0;compose-agentunchanged at 4.2.1CHANGELOG.md,README.md,docs/release-notes-4.3.0.mdDetectors
onSizeChanged/onGloballyPositioned/onPlaced(layout) writing state a sibling reads in composition. Cites writer + readerfile:line.SnapshotStateMap/SnapshotStateList(incl.toMutableState*builders) mutated in a@Composablebody. Deduped against the same-body rule.remember(index)on pure fns, identity caches for derived maps, layout modifiers on both rows,Exactly(1)on both rows, and — under Strong Skipping — manuallyremember-ing an already auto-memoized callback. Never rewarded, never emitted inPrioritized Fixes.Vibe
Stays an auditor, not a tutorial: point it at your repo → it names the exact
file:linewhere you're back-writing across phases and losing frames.Review
Three rounds of cross-review (Codex, Cursor, Antigravity) — no blockers; all should-fixes addressed (taxonomy split, SSM lambda correctness,
BoxWithConstraintseval fix,toMutableState*coverage, dedup guard, eval coverage).bin/ci✅. Attribution tochrisbanes/skills(Apache-2.0).🤖 Generated with Claude Code
https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY