feat(compose-agent): cross-phase back-write + false-lead authoring guidance (4.3.1)#11
feat(compose-agent): cross-phase back-write + false-lead authoring guidance (4.3.1)#11hamen wants to merge 4 commits into
Conversation
…idance (4.3.1) Follow-up to 4.3.0. The audit catches cross-phase back-writes and no-op "recomposition fixes" after the fact; compose-agent now warns while the code is being written, closing the drift the 4.3.0 cross-review flagged. - performance.md: "Never Back-Write Across Phases" (layout->composition writes; snapshot-collection mutation in a @composable body, good/bad Kotlin) and "Optimizations That Do Nothing" (remember(index) on pure fns, remember-ing an auto-memoized callback under SSM, identity caches, hoisting without stabilizing captures). Grep triggers extended. - SKILL.md: Core Instruction, review-checklist line, Review Process step 4. - Versions: compose-agent -> 4.3.1; jetpack-compose-audit unchanged at 4.3.0. - evals description updated: compose-agent now covers the topic. Continues the chrisbanes/skills (Apache-2.0) adaptation, cited against developer.android.com. 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)LGTM. The PR correctly updates the via pr-review-relay · author: claude |
…, example Round-1 cross-review (Codex, Cursor; Antigravity LGTM) — no blockers: - SSM correctness (Codex + Cursor, the big one): removed the "...unless the lambda captures an unstable value" carve-out from BOTH skills. Per the official Strong Skipping docs, SSM memoizes lambdas even with unstable captures, so that exception could still bless the no-op the guard forbids. Fixed compose-agent performance.md + all four spots in jetpack-compose-audit scoring.md. Only remaining exception: SSM-off or @DontMemoize / @NonSkippableComposable. -> jetpack-compose-audit bumped to 4.3.1 (correctness patch). - Terminology (Cursor): compose-agent now labels snapshot-collection mutation as composition-phase self-invalidation, not cross-phase, in the section, the Core Instruction, and the example header. - Example fix (Cursor): the layout good/bad example now uses label AND value on both sides (value was orphaned before). - Grep-trigger parity: added addAll/remove/-= and SnapshotStateList/Map. - Stale note in release-notes-4.3.0.md updated (addressed in 4.3.1). - README top-summary no longer reads as a version conflict. Versions: compose-agent -> 4.3.1, jetpack-compose-audit -> 4.3.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
…mbdas section
Round-2 cross-review (Codex, Cursor) — addresses both blockers:
- BLOCKER: the "Bad" cross-phase example used Modifier.offset { } — a layout-phase
(deferred) read, i.e. the safe pattern, not a composition read. Switched to the
non-lambda Modifier.offset(x = labelWidth.toDp()) so it actually reads in
composition and demonstrates the layout->composition loop (matches eval 12).
- BLOCKER: the pre-existing "Lambdas In Composables" section still claimed manual
remember matters for cross-module/generic composables under SSM. Aligned to the
official docs + the false-lead guard: SSM wraps all lambdas (even unstable
captures); only SSM-off / @DontMemoize / @NonSkippableComposable remain.
- README hero line bumped to jetpack-compose-audit 4.3.1 (was stale at 4.3.0).
- Core Instruction: self-invalidation is mutate->recompose, not measure-driven.
- PR description updated to reflect the audit 4.3.1 bump.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY
…DME/notes Round-3 cross-review (Codex blocker + Cursor) — final pass: - BLOCKER: the Strong Skipping *baseline* list (top of performance.md) still said captured lambdas can churn via "opaque call sites / generics". Rewrote item 2: SSM memoizes every lambda passed to a composable (even unstable captures), so lambdas are not a skipping defeater; manual remember only matters SSM-off / @DontMemoize. Removed the obsolete cross-module bullet (memoization is at the caller's compilation regardless of callee module/generics) and documented why. - Example now compiles: gap computed in MeasureScope (a Density), not in the PlacementScope where dp.roundToPx() has no receiver. - "all lambdas" tightened to "every lambda passed to a composable". - README authoring-mode checklist gains step 8 (cross-phase / self-invalidation). - Core Instruction split into two bullets (cross-phase vs no-op optimizations). - release-notes-4.3.0 false-lead bullet marked corrected-in-4.3.1. - release-notes-4.3.1: documented the cross-module removal + eval coverage note. 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
Validation: read via pr-review-relay · author: claude |
🔵 Cursor review (automated cross-review)PR #11 review —
|
What
Follow-up to #10 / v4.3.0. That release taught
jetpack-compose-auditto catch cross-phase back-writes and no-op "recomposition fixes". This teachescompose-agent(the authoring skill) to avoid writing them — closing the drift the round-3 reviewers flagged. It also ships a suite-wide Strong Skipping correctness fix.Changes
compose-agent/references/performance.mdcompose-agent/SKILL.mdjetpack-compose-audit/references/scoring.mdcompose-agent→ 4.3.1,jetpack-compose-audit→ 4.3.1CHANGELOG.md,README.md,docs/release-notes-4.3.1.mdWhy the audit bump
The 4.3.0 false-lead guard still allowed manual callback
remember"when the lambda captures an unstable value." Per the official Strong Skipping docs that is wrong — SSM wraps lambdas inremembereven with unstable captures — so the carve-out could bless the exact no-op the guard forbids. Removed suite-wide; only SSM-off /@DontMemoize/@NonSkippableComposableremain.Validation
bin/ci✅. Continues thechrisbanes/skills(Apache-2.0) adaptation.🤖 Generated with Claude Code
https://claude.ai/code/session_016ysskXsKpwEbs1n9CX1ScY