From 305a83f1d875a67f49b8e4a0ce7d612e0af8ac8c Mon Sep 17 00:00:00 2001 From: garrytan Date: Sat, 3 Oct 2026 00:07:35 +0000 Subject: [PATCH] ios-clean/fix/sync: match the generator's real header, package shape and regen command (s10 H2, H3, H4, H5, M9, M12) - H2: inventory greps the header the generator actually writes. - H4/H5: remove the local .package(path:) entry and DebugBridge* product deps; delete the generated DebugBridge/ and DebugBridgeGenerated/ dirs so the Phase 3 check can pass. - H3: regenerate accessors with /ios-sync (gstack-ios-qa-regen). - M12: ios-fix writes the regression with the project's own test runner. - M9: drop migration-relative sentence. ios-qa DEMO MODE (M8) is a UC2 gate and keeps its wording. Template-only commit: generated SKILL.md is expected red until the regeneration commit. --- ios-clean/SKILL.md.tmpl | 16 ++++++++++------ ios-fix/SKILL.md.tmpl | 10 ++++++---- ios-sync/SKILL.md.tmpl | 3 +-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ios-clean/SKILL.md.tmpl b/ios-clean/SKILL.md.tmpl index 5b74a9d7e..dcb1f7be2 100644 --- a/ios-clean/SKILL.md.tmpl +++ b/ios-clean/SKILL.md.tmpl @@ -52,7 +52,9 @@ Each item is reverted only after AskUserQuestion confirmation: `DebugBridgeManager.shared.start()`. 3. Any standalone `// @Snapshotable` generator marker comments on the canonical app state class. -4. Generated `StateAccessor.swift` files anywhere under the app source. +4. The generated `DebugBridge/` package directory and `DebugBridgeGenerated/` + (accessors and `.gstack-version`) that `gstack-ios-qa-regen` wrote under + the app source, plus any other generated `StateAccessor.swift` files. 5. The `gstack-ios-qa.token` file under `NSTemporaryDirectory()` on the device (best-effort — only works if device is connected when /ios-clean runs). @@ -67,8 +69,8 @@ Each item is reverted only after AskUserQuestion confirmation: 1. Glob for `import DebugBridge` across the app source. 2. Glob for `#if DEBUG ... DebugBridgeManager` blocks. -3. Glob for `// Auto-generated state accessor` headers in - `StateAccessor.swift` files. +3. Grep `StateAccessor.swift` files for the generator header + `// AUTO-GENERATED — DO NOT EDIT. Regenerate with /ios-sync.` 4. Parse `Package.swift` for the DebugBridge dependency entry. 5. Show the user what's about to be removed (file list + line counts). AskUserQuestion: proceed, dry-run, or abort. @@ -79,9 +81,11 @@ For each item the user approved: 1. Use Edit tool to strip the import + the `#if DEBUG` block (keep the surrounding code intact). -2. Use Edit tool to remove the `.package(url:...DebugBridge...)` entry - from `Package.swift` and any `targets` referencing `"DebugBridge"`. -3. Delete generated `StateAccessor.swift` files. +2. Use Edit tool to remove the local `.package(path: ...DebugBridge...)` + entry from `Package.swift` and every target dependency on a + `DebugBridge*` product (`DebugBridgeUI`, `DebugBridgeCore`, `DebugBridgeTouch`). +3. Delete the generated `DebugBridge/` and `DebugBridgeGenerated/` + directories and any other generated `StateAccessor.swift` files. 4. Run `xcodebuild -scheme -destination 'platform=iOS,id=' build install -configuration Release` to verify Release builds without the bridge. If it fails on a missing DebugBridge symbol, the removal diff --git a/ios-fix/SKILL.md.tmpl b/ios-fix/SKILL.md.tmpl index 91694fc16..7c83d299b 100644 --- a/ios-fix/SKILL.md.tmpl +++ b/ios-fix/SKILL.md.tmpl @@ -82,12 +82,14 @@ user pick the one to fix. ## Phase 5: Add regression test -Write a test in `test/fixtures/ios-fix/.test.ts` that: +Write a regression test with the project's own test runner and conventions +(the test command in CLAUDE.md; if it has none, ask the user and record the +answer there). The test: 1. Loads the pre-bug snapshot. 2. Restores it via `POST /state/restore`. -3. Asserts the post-fix behavior on a real device (gated - `GSTACK_HAS_IOS_DEVICE=1`, periodic tier). +3. Asserts the post-fix behavior on a real device, skipped when no device is + connected. Commit the snapshot fixture + test file alongside the fix. @@ -96,6 +98,6 @@ Commit the snapshot fixture + test file alongside the fix. | Symptom | Action | |---|---| | 3 iterations, bug still present | STOP, report to user with current best hypothesis | -| `409 schema_mismatch` on /state/restore after rebuild | Re-codegen accessors (`swift run gen-accessors`), re-snapshot | +| `409 schema_mismatch` on /state/restore after rebuild | Regenerate accessors with `/ios-sync` (`gstack-ios-qa-regen`), re-snapshot | | Device disconnects mid-fix | Daemon auto-reconnects; resume from Phase 4 | | Build fails | Revert Swift edits; investigate compile error before re-applying fix | diff --git a/ios-sync/SKILL.md.tmpl b/ios-sync/SKILL.md.tmpl index a3a7ab6cb..07f358560 100644 --- a/ios-sync/SKILL.md.tmpl +++ b/ios-sync/SKILL.md.tmpl @@ -41,8 +41,7 @@ This skill regenerates the relevant artifacts in place. **Templates live in upstream gstack.** The installed `gstack-ios-qa-regen` launcher resolves its own gstack root and copies only -the supported bridge files from `ios-qa/templates/`. The fork's HTTP-fetch -and wildcard-copy patterns are gone. +the supported bridge files from `ios-qa/templates/`. ## Phase 1: Detect installed version