Repository navigation
feat: Remote Config inspector - #11
Conversation
Issue #6 asks to see which Remote Config values are active on a device and where each one came from. The hard question in practice is not what a value is but why it is that value — a key showing an in-app default because the fetch was throttled looks identical to one the console actually published, and that difference is the whole debugging story. Scoped read-only, and structured as a vendor-neutral core plus a reflection-based Firebase adapter so Firebase stays off the classpath of consumers that do not use it, matching the existing push triad. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Seeing a flag's value was never the hard part. The hard part is knowing whether it reads that way because you published it, or because the last fetch was throttled and the app quietly fell back to an in-app default. Those two look identical from inside the app, and the difference is "the rollout works" versus "the rollout never reached this device". So the source attribution, not the value, is the feature. Structured as a vendor-neutral core plus a reflection-based Firebase adapter, mirroring the push triad, so Firebase stays off the classpath of consumers that never touch it and a host on another vendor can implement RemoteConfigProvider instead. Gated by the existing STATE capture category rather than a new one: it is the same kind of data as state providers and feature flags, and a new category would have widened the wire format for nothing. Two details worth calling out, both of which bite silently: Firebase's LAST_FETCH_STATUS_SUCCESS is -1, not 0, and getFetchTimeMillis returns -1 before the first fetch. Verified against the SDK source rather than assumed; a "negative means unknown" mapping would have mislabelled every successful fetch, and a raw timestamp would have dated a never-fetched provider to 1969. Redaction runs at one boundary in :sdk:full, not at the HTTP route. The Compose inspector reads the registry in-process and never crosses that route, so redacting there would have protected the browser and left the device showing raw secrets. Matching is separator-insensitive because RedactionPolicy's defaults are an HTTP-header list compared by exact name, while Remote Config keys are snake_case and camelCase -- api_key would otherwise have sailed past the policy's api-key entry in full. Read-only by design; the OVERRIDE source is reserved so the deferred override-editing work lands additively rather than as a wire break. Design: docs/superpowers/specs/2026-08-13-remote-config-inspector-design.md Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
compose-app is the full showcase, so it is where the new inspector should be visible without a Firebase project standing in the way. The stand-in provider covers one key of each source -- server, in-app default, static fallback, local override -- so the source badges mean something at a glance rather than all reading "remote". api_key is written snake_case deliberately: that is how Remote Config keys are actually written, and it is exactly the shape a header-derived redaction allowlist misses, so the sample doubles as a live check that the masking works. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The feature was reachable only from docs/REMOTE_CONFIG.md, which is the wrong place to learn a coordinate exists. The README now carries the setup walkthrough next to the network one, the adapter's coordinate pair in the add-on table, and a row in the capability table. The source table is the part worth having in front of you: it is the column that separates "the value you published" from "a default the app fell back to when the fetch was throttled", which is the question the inspector exists to answer. Also corrects the module count from 31 to 34 in the README, CONTRIBUTING and MAVEN_PUBLISHING, which the three new modules invalidated. The 1.1.1 changelog entry keeps its 31 -- that was accurate when it shipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A Remote Config value is a string on the wire, so the table row could only ever preview it -- a JSON blob read as one elided line, which is the shape most non-trivial config actually takes. Clicking a key now opens the whole thing. Pretty JSON is the default, but only where it means something. The viewer parses first: on success it renders the existing syntax-highlighted block, and on failure it opens on Raw with the JSON segment disabled and says so. It never re-quotes a non-JSON value into a JSON string literal to make the toggle work -- the quotes would be this viewer's invention rather than something the server sent, which is the same rule the source badge follows. Values like `on` or `v2` are common enough that the fallback is the ordinary path, not an edge case. Truncated and redacted values are told apart from "just not JSON" in the notice line, so nobody debugs a parse failure that is really a length cut or a redaction. cardRowsHtml grew an optional `click` id that renders the row as a real <button>, so focus, Enter/Space and the role come free; every other caller omits it and renders byte-identical. That id is a [providerId, key] pair rather than an index, because the search box and the source filter re-render the list constantly and an index would point at a different key afterwards. codeLinesHtml is split out of codeBlockHtml so the modal can reuse the highlighted block without its fullscreen button: a second overlay opening from inside this one would fight it over Escape. openCodeFullscreen was already hand-building that same markup, so the helper pays for itself twice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Remote Config was a section on the Control screen, which is not where it belonged: it is read-only, so nothing on it was ever a control. It is now a Config tab on Observe, and tapping a key opens its value -- the same thing the dashboard's value window does, reached the same way. The tab is gated on `captures(STATE) && remoteConfig.isNotEmpty()`, the exact condition the Control section used, so which sessions can see Remote Config is unchanged; only where it lives moved. That does make it the first tab whose visibility reads data rather than its category alone, and deliberately so: InspectorTabRow is a fixed Row splitting its width equally between the tabs it is handed, and STATE is on by default, so a category-only gate would have narrowed every other tab in every app that registers no provider -- which is most of them. A provider list emptying mid-session needs no new code: the ViewModel's existing snap onto the first still-visible tab already covers it, and now has a test for it. The detail's Value section is a formattableTextBody, whose existing default is already the rule the dashboard follows -- formatted when the value parses, raw when it does not -- so the two surfaces agree without either one reimplementing it. A redacted entry gets an explicit note rather than a Raw/Formatted toggle over the literal placeholder, the same treatment a binary body gets. ObserveDetailContent gained a searchPlaceholder because the shared detail screen was offering to search "headers, payload, response" on a screen holding exactly one config value. It defaults to the old string, so only this screen changed. The sample gained a JSON-valued key: without one it demonstrated the inspector but not the reason to open a value at all. ObserveTab is public API, so the new constant is an accepted apiDump. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| // Redacted here, not in the route: the Compose inspector reads the same registry | ||
| // in-process and never crosses the HTTP boundary, so this is the shared boundary both | ||
| // surfaces go through. | ||
| remoteConfigSnapshots = { redactedRemoteConfigSnapshots(config) }, |
There was a problem hiding this comment.
This closure captures config from the first createServerEngine call, but reconfigure() never re-supplies it. So after a stop() + initialize(configB), the HTTP route is still redacting by configA's policy — and still serving even if configB dropped CaptureCategory.STATE.
What makes it awkward is that FullInspectorDataSource reads a live configSupplier, so the Compose side picks up configB fine. Same field, two surfaces, different answers — which is the exact thing the redaction-placement reasoning in the description was meant to rule out.
Adding remoteConfigSnapshots to the reconfigure() call alongside redactionPolicy would do it, or have the closure read from the same supplier the data source uses.
There was a problem hiding this comment.
Fixed in f710f87 — the closure reads activeConfig now, the same live field FullInspectorDataSource goes through, so the two surfaces can't answer differently after a re-initialize.
Went with that over adding remoteConfigSnapshots to reconfigure(): the supplier is the only thing that was stale, and threading it through reconfigure would leave the same trap set for the next parameter someone adds to createServerEngine.
redactedRemoteConfigSnapshots takes a nullable config as a result — null means initialize() hasn't landed, which reads as "nothing to serve", the same as the STATE gate being off.
| /** Null for an unknown id; a provider that throws yields an unavailable snapshot, never an exception. */ | ||
| fun snapshot(id: String): RemoteConfigSnapshot? = providers[id]?.let { read(id, it) } | ||
|
|
||
| fun snapshots(): List<RemoteConfigSnapshot> = providers.map { (id, provider) -> read(id, provider) } |
There was a problem hiding this comment.
providers is a plain LinkedHashMap and snapshots() maps straight over it. The runCatching is inside read(), so it covers a provider that throws but not the iteration itself.
Late registration is a documented path (DevConsole.registerRemoteConfigProvider), and the readers here are the Ktor thread and the VM dispatcher. A host registering from a post-fetch listener while the dashboard polls gets a ConcurrentModificationException out of the read path, landing on the host app — which is the one outcome the KDoc just above says we won't cause. registerRemoteConfigProvider is @Synchronized, but neither reader takes that lock.
ConcurrentHashMap would cost you the insertion order, so copying the map before mapping over it (or reading under the same lock) is probably the easier fix.
There was a problem hiding this comment.
Fixed in f710f87. Every access takes the lock, and snapshots() copies under it then calls into host code outside it — read() can be slow or can itself register, neither of which should happen holding the lock.
Copying rather than ConcurrentHashMap for the reason you gave: the insertion order is what every surface lists providers in.
StateRegistry had the identical shape, so it got the same treatment — it's the same documented late-registration path via registerStateProvider. Test reproduces the CME against the unguarded map; I checked it fails without the lock rather than assuming.
| } | ||
|
|
||
| private companion object { | ||
| fun String.collapseSeparators(): String = replace("-", "").replace("_", "") |
There was a problem hiding this comment.
This collapses - and _ but not ., so api.key slips through — matches neither api-key nor apikey, and gets shown in full.
Dotted keys aren't a stretch here either; the sample app already uses compose_sample.show_order_history for flags, so that naming style is in the codebase. Worth adding, since the KDoc above and docs/REMOTE_CONFIG.md both promise separator-insensitive matching.
There was a problem hiding this comment.
Fixed in f710f87 — the collapse is Regex("[-_.]") now, so api.key matches. Extended the separator-styles test with that case.
The sample precedent holds up: compose_sample.show_order_history is exactly the shape that would have sailed through.
| actions = | ||
| listOf( | ||
| InspectorTopAction( | ||
| contentDescription = "Copy value", |
There was a problem hiding this comment.
The Value section does the right thing — copy is disabled once the entry is redacted. But Copy value / Share value up in the header are still wired to entry.value unconditionally, so they'll happily emit the replacement string (or an empty one, for a provider that supplies an empty value).
Leaves two copy affordances on the same screen disagreeing about whether this value is copyable, and a share sheet that opens with nothing useful in it. Probably want to gate those on entry.redacted too.
There was a problem hiding this comment.
Fixed in f710f87 — the header actions list is empty when entry.redacted, so the screen has no copy affordance at all rather than two that disagree.
Dropping them rather than disabling them: an action that exists but never works reads as a bug in the button, and the Details section already carries an explicit redacted row saying why the value isn't there.
| private val remoteConfig: Any, | ||
| override val id: String = "firebase", | ||
| ) : RemoteConfigProvider { | ||
| override fun snapshot(): RemoteConfigSnapshot = |
There was a problem hiding this comment.
If the reflection fails outright — not Firebase-shaped, or getAll() blowing up under R8 — we land on emptyList() + unknown() and leave unavailableReason null. Both surfaces then render "No values — this provider has not completed a fetch yet.", which is a confident thing to say when we never actually got an answer out of Firebase.
That's the same confusion the no-op twin's KDoc is careful to avoid, so it'd be good to set a reason on this path.
Worth a look while you're here: an object that is not firebase shaped yields an unavailable snapshot instead of throwing only asserts on entries and fetchInfo, so it passes today without the snapshot being "unavailable" in any way a user would see.
There was a problem hiding this comment.
Fixed in f710f87. snapshot() checks getAll first and returns an unavailableReason when it isn't a Map — which is how both a non-Firebase object and a getAll that threw arrive, since call swallows the throw. The reason is a fixed string rather than the exception's message for that reason: there's no exception left to read at that point.
On the test — you're right that it asserted nothing a user would see. It now asserts unavailableReason is non-null, plus two new cases: a getAll that throws, and a readable config having no reason set, so the flag can't silently become always-on.
| @@ -694,6 +698,9 @@ internal class PlatformFacadeProvider : DevConsoleFacadeProvider { | |||
| redaction.updatePolicy(config.redactionPolicy) | |||
| if (config.capturesCategory(CaptureCategory.STATE)) { | |||
| config.stateProviders.forEach(stateRegistry::register) | |||
There was a problem hiding this comment.
The line just below wraps registration in safely {} for exactly the duplicate-id-on-reinit reason the comment describes — but stateRegistry::register has the same require(provider.id !in providers) and is still bare, so it throws straight out of initialize() on a stop() → initialize(sameConfig).
Pre-existing, not something this PR caused. But the new line right underneath makes the asymmetry pretty visible, and it's a small fix while you're in here.
There was a problem hiding this comment.
Fixed in f710f87 — wrapped in safely {} to match. Pre-existing as you say, but the asymmetry was the confusing part: one registry took down initialize() on a duplicate id and the other didn't.
This is paired with the clearing change on the thread below, which is what makes ignoring a duplicate correct rather than merely quiet.
| if (config.capturesCategory(CaptureCategory.STATE)) { | ||
| config.stateProviders.forEach(stateRegistry::register) | ||
| // A duplicate id from a host that both configured and late-registered a provider must | ||
| // not take down initialize(); the registration is simply ignored. |
There was a problem hiding this comment.
Following on from the line above — safely {} stops the crash, but since the registry isn't cleared between initializes and register() rejects duplicate ids, a replacement provider now gets silently dropped instead.
Host does stop() → initialize(configB) with a fresh FirebaseRemoteConfigAdapter under the same firebase id, registration is refused, and we carry on reading through the old adapter wrapping a torn-down instance. The return value is discarded at the forEach too, so nothing surfaces anywhere.
Clearing the registry along with the other per-init state is probably the cleaner call.
There was a problem hiding this comment.
Fixed in f710f87 — both registries are cleared before the config's providers are registered, so a replacement under the same id takes effect.
Went with clearing over making register upsert: the config's provider set is the whole truth for a session, and upsert would leave a provider registered late in session A alive through session B, which is the same class of surprise in the other direction.
Worth noting the clearing is what makes the safely {} on the thread above correct — a swallowed duplicate is now genuinely a duplicate within one config, not a refused replacement. Added a registry test for register-after-clear.
| } | ||
| function renderRemoteConfigCards() { | ||
| const total = remoteConfigProviders.reduce((sum, p) => sum + (p.entries || []).length, 0); | ||
| $('navCountRemoteConfig').textContent = total; |
There was a problem hiding this comment.
This sets textContent directly rather than going through setNavCount, and setNavCount is what adds the .show class — without it .rail-count is display: none (dashboard.css:356). So the badge never actually appears. Every other rail count in the file goes through the helper.
Two things ride along with that: you lose the 999+ clamp, so a large config prints the full number and stretches the rail; and since loadRemoteConfig returns before renderRemoteConfigCards on !r.ok, the count and remoteConfigBadge keep their values from the last successful load while the card itself says the fetch failed.
There was a problem hiding this comment.
Fixed in f710f87 — goes through setNavCount, so the badge gets .show and the 999+ clamp.
Also took the !r.ok path you flagged: it resets the count to 0 and the badge to "unavailable" rather than leaving the last successful load's numbers next to a card reporting the failure.
Covered in DashboardAssetsTest by asserting both that setNavCount('navCountRemoteConfig' appears and that the direct .textContent assignment doesn't — the negative is the half that would catch a regression here.
| // ================================================================ | ||
| const RAIL_ADVANCED_IDS = ['viewSdkHealth', 'viewComposer', 'viewCaptureRules', 'viewState', 'viewPreferences', 'viewDatabase', 'viewFiles', 'viewSession']; | ||
| const RAIL_ADVANCED_IDS = ['viewSdkHealth', 'viewComposer', 'viewCaptureRules', 'viewState', 'viewRemoteConfig', 'viewPreferences', 'viewDatabase', 'viewFiles', 'viewSession']; | ||
| const RAIL_ADVANCED_VIEWS = new Set(['sdkHealth', 'composer', 'captureRules', 'state', 'preferences', 'database', 'files', 'session']); |
There was a problem hiding this comment.
viewRemoteConfig got added here but 'remoteConfig' didn't make it into RAIL_ADVANCED_VIEWS — those two are meant to move together, and the comment above the check around line 1208 spells out why.
In practice: you're on Remote Config in Advanced mode, press a to switch to Simple, and the auto-expand doesn't fire — so the active button, still carrying aria-current="page", ends up stranded inside the collapsed group. Same for any programmatic show('remoteConfig').
There was a problem hiding this comment.
Fixed in f710f87 — 'remoteConfig' added to the set. DashboardAssetsTest now asserts both halves so they can't drift apart again.
| buildString { | ||
| append("last fetch: ") | ||
| append( | ||
| provider.lastFetchEpochMs?.let(::formatCaptureClockTime) ?: "never", |
There was a problem hiding this comment.
formatCaptureClockTime is HH:mm:ss with no date. Firebase's default minimum fetch interval is 12h, so a throttled provider's last fetch is routinely hours or days old — and last fetch: 09:14:02 reads identically whether that was 40 seconds ago or last Tuesday.
That's the one distinction this screen exists to make, going by the KDoc at the top of the file. The dashboard uses toLocaleString() and does get the date, so as it stands the two surfaces disagree about the same field.
There was a problem hiding this comment.
Fixed in f710f87. Added formatCaptureDateTime (d MMM, HH:mm:ss) and used it for the fetch line on both the tab header and the key detail.
A separate formatter rather than changing formatCaptureClockTime: captures are session-scoped and a bare clock reads better for them. The 12h default interval is exactly why this one field is different, so the new formatter's KDoc says so.
| </div> | ||
| <div class="toolbar"> | ||
| <label class="field search-field"><span>Find key</span><span class="search-wrap"><svg class="ic ic-sm search-lead" aria-hidden="true"><use href="#dc-search"/></svg><input type="search" id="remoteConfigSearch" placeholder="checkout_v2, banner…"></span></label> | ||
| <div class="toolbar-group"><span class="toolbar-group-label">Source</span><div class="seg" id="remoteConfigSourceSeg" role="group" aria-label="Filter by value source"><button type="button" class="active" data-value="all">All</button><button type="button" data-value="remote">Remote</button><button type="button" data-value="default">Default</button><button type="button" data-value="static">Static</button></div></div> |
There was a problem hiding this comment.
Filter is missing override and unknown. Both are real sources in the model — the sample app emits OVERRIDE for api_base_url — and the matcher is a straight e.source === remoteConfigSourceFilter, so there's currently no way to isolate either.
"Which keys is a local override masking?" is roughly the question the source column is there to answer, and on a config with a few hundred entries you can't get at it by scrolling.
There was a problem hiding this comment.
Fixed in f710f87 — both added, so all five wire sources plus All are reachable. DashboardAssetsTest asserts the full set against the model rather than the four that happened to be there.
| ``` | ||
|
|
||
| That's the whole setup. Values then appear on the dashboard's **Remote Config** page and in the | ||
| in-app inspector's **Control** screen, each tagged with where it came from: |
There was a problem hiding this comment.
This still sends people to the Control screen, but the last commit moved Remote Config to the Config tab on Observe. CHANGELOG and docs/REMOTE_CONFIG.md both got updated — looks like this one just got missed, and it's the main setup walkthrough so it's the one most people will land on.
Separately, the coordinates a few lines up pin :1.1.1, which doesn't contain these modules yet.
There was a problem hiding this comment.
Fixed in f710f87 — now points at the Config tab.
On the coordinates: bumped to 1.2.0 with a note that 1.1.1 predates these artifacts and a pointer to the JitPack section for trying them off the branch. 1.2.0 is inferred from the versioning policy (new modules = new API = minor) rather than from anything in the repo, so it's worth a second look at release time.
| }.sortedBy(RemoteConfigEntry::key) | ||
| } | ||
|
|
||
| private fun sourceOf(value: Any?): RemoteConfigSource = |
There was a problem hiding this comment.
Minor one, but this re-resolves everything on every call. javaClass.methods hands back a freshly allocated defensive copy each time and then we linear-scan it — twice per entry, once for asString and once for getSource. sourceOf / statusOf also put constant(...) inside the when conditions, so those field lookups re-run per call as well.
At a few hundred keys that's a fair bit of churn per snapshot, and it repeats on every inspector refresh and every dashboard poll. Resolving the Method / Field handles once in an init block or a by lazy would sort it.
There was a problem hiding this comment.
Fixed in f710f87. Method handles are cached keyed on (receiver class, name) — per class rather than per receiver, since the values are one FirebaseRemoteConfigValue per key, all the same class. Misses are cached too: a name that's absent stays absent.
The constants moved out of the when conditions into by lazy properties, which was the other half you spotted — those were re-running getField on every branch test.
| private fun readRemoteConfig(config: DevConsoleConfig?): List<InspectorRemoteConfigUi> { | ||
| val registry = remoteConfigRegistry ?: return emptyList() | ||
| val policy = config?.redactionPolicy ?: RedactionPolicy.default() | ||
| val redacting = RedactingRemoteConfig(RedactionEngine(policy), policy) |
There was a problem hiding this comment.
This builds a fresh RedactionEngine on every snapshot(), which recompiles the whole textPatterns set each time — redactionValidationError() wraps that in runCatching precisely because it isn't free.
PlatformFacadeProvider already holds a redaction engine that's kept current via updatePolicy and passes it to redactedRemoteConfigSnapshots. Passing that one in instead would skip the rebuild and keep both paths on the same engine.
There was a problem hiding this comment.
Fixed in f710f87 — FullInspectorDataSource takes a redactionEngine supplier and PlatformFacadeProvider hands it the engine it already keeps current through updatePolicy.
A supplier rather than the instance so the data source stays constructible without one; it falls back to building from the active policy, which is what the tests and any wiring that doesn't supply an engine rely on.
| fallback: Int, | ||
| ): Int = runCatching { remoteConfig.javaClass.getField(name).getInt(null) }.getOrDefault(fallback) | ||
|
|
||
| private fun Any.call(name: String): Any? = |
There was a problem hiding this comment.
This is byte-identical to the Any.call in FirebaseRemoteMessageAdapter over in push-firebase. Not urgent at all, but both modules sit on a shared leaf so it could live in one place — and the caching change above is exactly the kind of thing you'd otherwise have to remember to do in two files.
There was a problem hiding this comment.
Not doing this one, and I'd rather say so than leave it open.
There's no module both adapters can already see: remote-config-firebase depends only on remote-config, and push-firebase on push → security. So a shared home means either giving a config module a dependency on security, or adding a published artifact with its own ABI baseline, variant-policy wiring and README/CHANGELOG entry — for three lines.
The motivation doesn't survive the caching change either. What landed there is instance-scoped to a long-lived receiver whose same methods are re-called once per entry, hundreds of times per snapshot. FirebaseRemoteMessageAdapter gets a fresh RemoteMessage per delivery and calls each method once, so there's nothing to cache and no second copy of this fix to remember.
Happy to revisit if a third reflective adapter turns up — that's the point where a shared home pays for itself.
Fourteen of the fifteen review items; the fifteenth is answered on its
thread rather than implemented. Grouped by what they actually break.
Two registry defects, both of which reach the host app:
`StateRegistry` and `RemoteConfigRegistry` each held an unguarded
LinkedHashMap. Late registration is a documented path and the readers are
the Ktor thread and the inspector's dispatcher, so registering from a
post-fetch listener while the dashboard polls threw
ConcurrentModificationException out of the read path -- the one outcome
the read path's own doc promises not to cause. Guarded on every access
rather than swapped for a ConcurrentHashMap, which would drop the
insertion order surfaces list providers in; snapshots() copies under the
lock and calls into host code outside it. The added test reproduces the
CME against the unguarded map.
Neither registry was cleared between initializes, and both reject
duplicate ids, so a stop() -> initialize(configB) carrying a replacement
provider under the same id had its registration refused and every surface
carried on reading the torn-down original -- silently, since safely{}'s
result is discarded. Both are cleared with the rest of the per-init
state. State providers were also registered bare while Remote Config was
wrapped in safely{}, so a duplicate id took down initialize() on one
surface and not the other; both are wrapped now.
The HTTP route's snapshot supplier captured createServerEngine's config
parameter, which is bound once, while reconfigure() carries no supplier
of its own. After a re-initialize the route kept redacting by the first
config's policy and serving under its STATE gate, while
FullInspectorDataSource -- reading the live activeConfig -- had moved on.
Same field, two surfaces, two answers, which is exactly what redacting at
a shared boundary was meant to rule out. Reads activeConfig now.
Separator-insensitive matching collapsed `-` and `_` but not `.`, so
`api.key` matched neither `api-key` nor `apikey` and was shown in full.
Dotted keys are ordinary here; the sample's own flags use one.
The Firebase adapter reported an unreadable config -- not Firebase-shaped,
or getAll blowing up under R8 -- as an empty snapshot with no
unavailableReason, which both surfaces render as "has not completed a
fetch yet": a confident claim about a fetch that never happened. It sets a
reason now. The test named for that case only asserted on entries and
fetchInfo, so it passed without the snapshot being unavailable in any way
a user could see.
Everything else:
- Copy/Share in the key detail header emitted the redaction placeholder
while the Value section's own copy was already withheld -- two copy
affordances on one screen disagreeing about whether the value is
copyable. Dropped when redacted.
- The rail count set textContent directly instead of going through
setNavCount, which is what adds the `.show` class, so the badge was
`display: none` and never appeared; it also skipped the 999+ clamp. A
failed load now resets the count and badge instead of leaving the last
successful numbers beside a card reporting the failure.
- 'remoteConfig' was missing from RAIL_ADVANCED_VIEWS while
viewRemoteConfig was in RAIL_ADVANCED_IDS, so switching to Simple mode
stranded the active button inside the collapsed group.
- The source filter offered no `override` or `unknown`, which are real
sources the matcher compares exactly -- "what is a local override
masking?" was unanswerable on a config too long to scroll.
- The device fetch line used HH:mm:ss with no date. Firebase's default
minimum fetch interval is 12h, so `09:14:02` read the same whether the
fetch was a minute or a week ago -- the one distinction that surface
exists to make. The dashboard already showed the date.
- The adapter re-resolved every Method on each call (getMethods allocates
a fresh copy, then a linear scan, twice per entry) and re-read the
Firebase constants inside `when` conditions. Cached per receiver class
and per adapter.
- FullInspectorDataSource built a RedactionEngine per snapshot(),
recompiling every text pattern; it takes the engine
PlatformFacadeProvider already keeps current instead.
- README still sent people to the Control screen, and pinned coordinates
at 1.1.1, which predates these modules.
Not done: hoisting the duplicated `Any.call` into a module both Firebase
adapters share. remote-config-firebase depends only on remote-config and
push-firebase on push -> security, so it would mean either a security
dependency in a config module or a new published artifact with its own
ABI baseline, for three lines. The stated motivation -- remembering the
caching fix in two places -- does not apply either: the caching is
instance-scoped to a long-lived receiver whose methods are re-called per
entry, while the push adapter gets a fresh RemoteMessage per delivery and
calls each method once.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closes #6.
What
A read-only Remote Config inspector: every key active on the device, its value, and — the part that actually matters — where that value came from (remote / default / static / override), plus last fetch time, status, and minimum fetch interval.
Knowing a flag reads
falseis rarely the hard part. Knowing whether it readsfalsebecause you published it, or because the last fetch was throttled and the app fell back to an in-app default, is. Those look identical from inside the app, and the difference is "the rollout works" vs "the rollout never reached this device".Shape
Three modules, mirroring the existing
push/push-firebase/push-firebase-nooptriad::sdk:remote-config:sdk:remote-config-firebaseFirebaseRemoteConfigby reflection — no compile-time Firebase dependency.:sdk:remote-config-firebase-noopdisabled-buildrather than pretending config is empty.Neither adapter is re-exported by the
devconsoleumbrella, same reasoning aspush-firebase.Surfaces on the browser dashboard (Remote Config page under Data), the Compose inspector (Control screen), and
GET /api/v1/remote-config. Gated by the existingCaptureCategory.STATErather than a new category — it is the same kind of data as state providers and feature flags, and a new constant would have widened the wire format for no benefit.Two details that bite silently
Firebase's constants. Verified against
firebase-android-sdksource rather than assumed:LAST_FETCH_STATUS_SUCCESSis-1, not0, andgetFetchTimeMillis()returns-1before the first fetch. A "negative means unknown" mapping would have mislabelled every successful fetch; a raw timestamp would have dated a never-fetched provider to 1969. The adapter also resolves these reflectively from the Firebase class when present, so a renumbering can't silently mis-badge every row.Redaction placement. Applied once in
:sdk:full, not at the HTTP route. The Compose inspector reads the registry in-process and never crosses that route, so redacting there would have protected the browser and left the device showing raw secrets.Security / redaction note
Flagging explicitly per CONTRIBUTING: this change is redaction-adjacent.
Matching is separator-insensitive here, which the raw
RedactionPolicyis not. ItssensitiveFieldNamesdefaults are an HTTP-header list (api-key,apikey) compared by exact lowercased name, while Remote Config keys are written snake_case and camelCase. Without this,api_key— the likeliest name for a secret accidentally shipped through Remote Config — would not matchapi-keyand would have been displayed in full. Values also still run through the engine's text patterns, so a bearer token in an otherwise innocuous key is caught. Keys themselves are never redacted: knowing which value was withheld is the point of the view.This remains allowlist-based; a secret under a name nobody listed is still shown.
Scope
Read-only. DevConsole does not set overrides and never triggers
fetch()/activate(). TheOVERRIDEsource is displayed when a host applies one, and the enum case is reserved so the deferred override-editing work lands additively rather than as a wire break.API surface
./gradlew apiDumpis included.sdk:apihas zero ABI removals —remoteConfigProvidersis an additive field outside the primary constructor, following the rule already stated inDevConsoleConfig.ui-composeandserver-ktorcarry widened data-class/engine constructors, which is inherent to adding a field and matches the existing precedent inInspectorSnapshot.DevConsoleFacadeProvider.registerRemoteConfigProvideris deliberately abstract, not defaulted: a default makes Kotlin emit a syntheticaccess$…$jdbridge on the interface that no facade can implement, andNoopFacadeProviderContractTestexists precisely to keep full/no-op parity compiler-enforced.Gradle plugin
A protected adapter must be registered in four places or release-variant protection silently does not apply. All four are updated —
FULL_RUNTIME_COORDINATE,FORBIDDEN_SIGNATURES,protectedDependencyPaths, andNoopRuntimeExcludesFullModulesTest.:sdk:remote-configitself is deliberately not protected, exactly as:sdk:pushis not.Verification
All three
verifyDevConsoleProtectedArtifactsruns were forced with--rerun-tasksso they genuinely executed rather than reporting up-to-date. 57 new tests, all written before the code they cover.Also tested on a physical device (Android, debug build of
compose-app): the Compose Control screen renders every source badge correctly,GET /api/v1/remote-configreturns the documented wire shape over a real authenticated session, unauthenticated requests get401 AUTH_REQUIRED, andapi_keyis masked on both surfaces. Dashboard assets are served correctly from the device; its render logic was additionally exercised against the payload the device returned.Reviewer notes
samples/compose-appgains a stand-in provider (separate commit) so the feature is visible without requiring a Firebase project.docs/superpowers/specs/2026-08-13-remote-config-inspector-design.md.docs/REMOTE_CONFIG.md, plusPROTOCOL_REFERENCE.md,STATE_AND_FLAGS.md,docs/README.md,README.md,CHANGELOG.md.🤖 Generated with Claude Code