Make build identity, release name and artwork requirements host-configurable (GRD-488) #3

Merged
stephen merged 3 commits from stephen/grd-488-host-agnostic into main 2026-11-19 02:36:07 +00:00
Owner

GRD-488. The code moved unchanged from fjord-ios, so a second app hit Fjord iOS's identity in three places. This makes them host-configurable.

  • App identity. ObservabilityConfiguration gains a required identity: AppIdentity (store, development and optional lab bundle identifiers, Sentry release prefix). AnalyticsBuildChannel.classify, AnalyticsDefault.reportsByDefault, AnalyticsBuildAudience and SentryBootstrap.releaseName read it through default arguments, so explicit calls still work. AppIdentity.fjordIOS is the named constant fjord-ios passes. There is no default on identity: an app that omits it fails to compile instead of being classified and released as Fjord iOS. AnalyticsBuildChannel.current, AnalyticsDefault.current and AnalyticsBuildAudience.current are computed on each read (they were static let) so a late install is followed, not frozen.
  • Read before install. Reading the identity before install falls back to Fjord iOS's and logs one fault, in every build configuration (test runs exempt, since they install nothing).
  • Artwork. FjordLogo and SplashBackground log a debug fault, once per name, when the host's asset catalog lacks FjordMonogramWhite, LaunchSplash or LaunchSplashPlain. README lists them as host requirements.
  • Readable column. RegularWidthReadableColumn applies safeAreaPadding unconditionally (zero below the threshold), so crossing the threshold on a window resize no longer swaps view branches and resets the content's state.
  • Tests. Grid-style identity classification (store, TestFlight, dev, lab, sideload), the dev build reporting nothing by default, the default-argument path after install, the release name prefix, and the installed identity following changes.
  • Breaking for fjord-ios (0.2.0). ObservabilityConfiguration(identity:) is required, so the fjord-ios bump passes .fjordIOS in ObservabilityConfiguration.installForApp.

Deliberate (self-review round 3): the review prefers latching the identity at first read after install. The current values are recomputed instead because a latched early read would freeze a wrong classification for the whole process, and the fault now makes an early read visible.

Known edge cases (follow-up): AppBundle.base (Spotlight types, quick-action prefixes, notification names) is still com.rasterstate.fjord and is not part of AppIdentity; the README says so. Fonts and strings remain GRD-486.

GRD-488. The code moved unchanged from fjord-ios, so a second app hit Fjord iOS's identity in three places. This makes them host-configurable. - **App identity.** `ObservabilityConfiguration` gains a required `identity: AppIdentity` (store, development and optional lab bundle identifiers, Sentry release prefix). `AnalyticsBuildChannel.classify`, `AnalyticsDefault.reportsByDefault`, `AnalyticsBuildAudience` and `SentryBootstrap.releaseName` read it through default arguments, so explicit calls still work. `AppIdentity.fjordIOS` is the named constant fjord-ios passes. There is no default on `identity`: an app that omits it fails to compile instead of being classified and released as Fjord iOS. `AnalyticsBuildChannel.current`, `AnalyticsDefault.current` and `AnalyticsBuildAudience.current` are computed on each read (they were `static let`) so a late `install` is followed, not frozen. - **Read before install.** Reading the identity before `install` falls back to Fjord iOS's and logs one fault, in every build configuration (test runs exempt, since they install nothing). - **Artwork.** `FjordLogo` and `SplashBackground` log a debug fault, once per name, when the host's asset catalog lacks `FjordMonogramWhite`, `LaunchSplash` or `LaunchSplashPlain`. README lists them as host requirements. - **Readable column.** `RegularWidthReadableColumn` applies `safeAreaPadding` unconditionally (zero below the threshold), so crossing the threshold on a window resize no longer swaps view branches and resets the content's state. - **Tests.** Grid-style identity classification (store, TestFlight, dev, lab, sideload), the dev build reporting nothing by default, the default-argument path after `install`, the release name prefix, and the installed identity following changes. - **Breaking for fjord-ios (0.2.0).** `ObservabilityConfiguration(identity:)` is required, so the fjord-ios bump passes `.fjordIOS` in `ObservabilityConfiguration.installForApp`. Deliberate (self-review round 3): the review prefers latching the identity at first read after `install`. The `current` values are recomputed instead because a latched early read would freeze a wrong classification for the whole process, and the fault now makes an early read visible. Known edge cases (follow-up): `AppBundle.base` (Spotlight types, quick-action prefixes, notification names) is still `com.rasterstate.fjord` and is not part of `AppIdentity`; the README says so. Fonts and strings remain GRD-486.
Make build identity, release name and artwork requirements host-configurable (GRD-488)
Some checks failed
CI / Build and test (iOS Simulator) (pull_request) Failing after 21s
0172f1a547
ObservabilityConfiguration gains an AppIdentity (store, development and optional
lab bundle identifiers, Sentry release prefix). AnalyticsBuildChannel,
AnalyticsDefault, AnalyticsBuildAudience and SentryBootstrap.releaseName read
it, with Fjord iOS's values as the default, so fjord-ios behaves as before
without installing anything.

FjordLogo and SplashBackground log a debug fault, once per name, when the host's
asset catalog lacks their artwork. RegularWidthReadableColumn applies its
safe-area padding unconditionally (zero below the threshold) so a window resize
keeps the content's identity and state.
Resolve the app identity inside the function, not in a public default argument
Some checks failed
CI / Build and test (iOS Simulator) (pull_request) Failing after 52s
90d41ed3d2
Run the release name tests on the main actor
All checks were successful
CI / Build and test (iOS Simulator) (pull_request) Successful in 1m22s
76598b8d14
gerri approved these changes 2026-11-19 02:35:26 +00:00
gerri left a comment

Automated Codex review (read-only) of head 76598b8d14.

No high or medium findings. The identity plumbing, the default-argument paths and the RegularWidthReadableColumn change are consistent across every changed caller I checked. The remaining items are low.

  • Low Sources/FjordObservability/ObservabilityConfiguration.swift:25, README.md (identity section). Invariant: a second app must not silently inherit Fjord iOS's identity. logSubsystem still defaults to "com.rasterstate.fjord", and FatalCrashReport logs under it (FatalCrashReport.swift:14). The README says to install "with the log subsystem", but its example omits logSubsystem. A host that copies the example logs its crash reports under Fjord's subsystem with no signal, which is the failure identity was made required to prevent. Fix: make logSubsystem required, or derive it from identity (for example the store bundle identifier). Otherwise add it to the README example and the AppBundle.base deferral note.

  • Low Sources/FjordObservability/AnalyticsBuildChannel.swift:36, AnalyticsDefault.swift:23. Invariant: the early-read fault should fire only when the fallback identity can affect the answer. let identity = identity ?? ObservabilityConfiguration.identity runs before the isSimulator and isDebugBuild short-circuits. A host that reads .current before install therefore logs the fault in every simulator and debug build, where the identity is irrelevant. That adds noise to the one signal this PR relies on. Fix: resolve the identity lazily, after those guards.

  • Low Tests/FjordObservabilityTests/FjordObservabilityTests.swift. Invariant: tests exercise the claim they name (STANDARDS item 13). Three claims in the PR body have no test:

    • The early-read fault. It is exempt under XCTest by design, so it cannot be tested as written.
    • The HostArtwork once-per-name fault.
    • Content state surviving a width change in RegularWidthReadableColumn.

    testAnInstalledIdentityIsWhatTheCurrentValuesUse and the sibling tests also call install(original) in their defer. That sets isInstalled = true for the rest of the process. Fix: inject the isRunningTests check, or the logger, so the early-read path is testable. The other two can go in the body as untested, with a reason.

  • Low Sources/FjordObservability/AnalyticsBuildChannel.swift:54, AnalyticsEnvelopeFacts.swift:70. Invariant: a hot read should stay cheap. current used to be a cached static let. It now takes the config lock and calls Bundle.main.appStoreReceiptURL on every read. If a host reads AnalyticsBuildAudience.current per event, that is repeated work for a value that only changes at install. This is a performance concern only. Fix: cache by installed-configuration generation if profiling shows it matters.

  • Low .forgejo/workflows/ci.yml. The build and test steps now write xcodebuild output to a log and print only error lines plus the tail on failure. The title and body do not mention this change. The logic is sound: || true on the grep pipeline is safe under pipefail, and a non-zero xcodebuild still exits 1. Mention it in the PR body, since it affects how CI failures are read.

  • Low (edge case, already deferred) AppBundle.base is still hard-coded to Fjord's identifier. It is listed in the PR body as a known edge case, so I'm not re-raising it.

BLOCKING: 0


Reviewed head 76598b8d14 at 2026-11-19T02:35:25Z by claude -p, read-only tools (Codex unavailable).

Automated Codex review (read-only) of head 76598b8d142f79218b84b20274719f815aadd83b. No high or medium findings. The identity plumbing, the default-argument paths and the `RegularWidthReadableColumn` change are consistent across every changed caller I checked. The remaining items are low. - **Low** `Sources/FjordObservability/ObservabilityConfiguration.swift:25`, `README.md` (identity section). Invariant: a second app must not silently inherit Fjord iOS's identity. `logSubsystem` still defaults to `"com.rasterstate.fjord"`, and `FatalCrashReport` logs under it (`FatalCrashReport.swift:14`). The README says to install "with the log subsystem", but its example omits `logSubsystem`. A host that copies the example logs its crash reports under Fjord's subsystem with no signal, which is the failure `identity` was made required to prevent. Fix: make `logSubsystem` required, or derive it from `identity` (for example the store bundle identifier). Otherwise add it to the README example and the `AppBundle.base` deferral note. - **Low** `Sources/FjordObservability/AnalyticsBuildChannel.swift:36`, `AnalyticsDefault.swift:23`. Invariant: the early-read fault should fire only when the fallback identity can affect the answer. `let identity = identity ?? ObservabilityConfiguration.identity` runs before the `isSimulator` and `isDebugBuild` short-circuits. A host that reads `.current` before `install` therefore logs the fault in every simulator and debug build, where the identity is irrelevant. That adds noise to the one signal this PR relies on. Fix: resolve the identity lazily, after those guards. - **Low** `Tests/FjordObservabilityTests/FjordObservabilityTests.swift`. Invariant: tests exercise the claim they name (STANDARDS item 13). Three claims in the PR body have no test: - The early-read fault. It is exempt under XCTest by design, so it cannot be tested as written. - The `HostArtwork` once-per-name fault. - Content state surviving a width change in `RegularWidthReadableColumn`. `testAnInstalledIdentityIsWhatTheCurrentValuesUse` and the sibling tests also call `install(original)` in their `defer`. That sets `isInstalled = true` for the rest of the process. Fix: inject the `isRunningTests` check, or the logger, so the early-read path is testable. The other two can go in the body as untested, with a reason. - **Low** `Sources/FjordObservability/AnalyticsBuildChannel.swift:54`, `AnalyticsEnvelopeFacts.swift:70`. Invariant: a hot read should stay cheap. `current` used to be a cached `static let`. It now takes the config lock and calls `Bundle.main.appStoreReceiptURL` on every read. If a host reads `AnalyticsBuildAudience.current` per event, that is repeated work for a value that only changes at `install`. This is a performance concern only. Fix: cache by installed-configuration generation if profiling shows it matters. - **Low** `.forgejo/workflows/ci.yml`. The build and test steps now write xcodebuild output to a log and print only error lines plus the tail on failure. The title and body do not mention this change. The logic is sound: `|| true` on the `grep` pipeline is safe under `pipefail`, and a non-zero `xcodebuild` still exits 1. Mention it in the PR body, since it affects how CI failures are read. - **Low** (edge case, already deferred) `AppBundle.base` is still hard-coded to Fjord's identifier. It is listed in the PR body as a known edge case, so I'm not re-raising it. BLOCKING: 0 --- Reviewed head 76598b8d142f79218b84b20274719f815aadd83b at 2026-11-19T02:35:25Z by claude -p, read-only tools (Codex unavailable).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rasterstate/fjord-apple-kit!3
No description provided.