Repository navigation
feat(apps): identity seam, view-state store, and cache retention - #8403
Conversation
UX Review (Fable 5) — ✅ human override accepted@chenmingwei23 overrode this lane for |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the "UX evidence" PR comment shows this revision — attachments live outside the description, so the evidence workflow downloaded and typed nothing. [DESIGN-REVIEWED] 5439691 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: make a builtin app keep its place and its data across navigation — an ADDITION (identity seam + view-state store + cache retention), covering the reported AWS Control drive reset.
The product-shape items (1, 2, 6 — a changed default for every builtin app) are covered by [FIRST-PRINCIPLES-REVIEWED] 5439691 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/app-sdk/index.ts:29 -- omitting False positive or not applicable? A repository writer can comment: |
9f9b0c6 to
5442b13
Compare
Bundle Size Gate: pre-existing on main, not this PRThe failing
So the ceiling's This PR stays red on that one check until #8412 merges. Every other gate is green locally at this head: |
5442b13 to
a85473c
Compare
First Principles subtractions: one adopted, one declinedAdopted -- dropped the module-scope Declined -- the trust half stays. The observation is accurate:
On the sub-point that Escalated to the repository owner rather than actioned unilaterally. No AI-review override used. |
Settled by the repository owner: the trust half stays in this PRThe owner has ruled on the First Principles subtraction that asked to defer The substantive reason is worth recording, because it is the opposite of what the subtraction assumed. The gate exists precisely so that the two downstream PRs inherit exactly ONE of it. Moving it into whichever of them happens to namespace state first means the other inherits nothing and hand-rolls its own origin check -- which is the duplication the design's cache-retention section argues against, and it would have arrived silently, as an omission rather than as a visible decision. Deferring a shared gate to one of its two consumers does not remove the gate; it removes the sharing. The rest of the reasoning stands as posted earlier: the approved design names the builtin-only gate as this PR's scope and asks this PR's tests to cover the refusal, and both stacked PRs are already branched off this PR's first commit consuming For completeness, the other subtraction in that review was correct and was adopted -- the module-scope loop over the core table is gone, with mutation evidence in the comment above. No review-bot override was used at any point in this PR. Every finding was either fixed or dispositioned in writing. Remaining itemThe full-window screenshot is outstanding and is deliberately not waived. This environment cannot mint a pod dashboard credential: |
49b4aa9 to
2bd1ef2
Compare
Disposition of the two blocking review lanes (head 2bd1ef2)Recording where the two required BLOCK lanes stand and how each clears, so the next head has the trail. First Principles -- clears via an accepted RFC on base, no override. The lane's own rule is that an RFC edited inside the feature diff reads as a proposal, not a recorded decision, so flipping the covering RFC in this PR cannot satisfy it. The repo's established pattern is to land the RFC on base as its own doc change ahead of the feature (precedent: #10090 landed rfc-append-only-ledger at in-progress before feature #10091). Following that pattern, docs-only PR #11320 sets rfc-app-sdk-durable-jobs-and-view-state to status: in-progress on main with implementation-prs: [8403]. Once #11320 merges, this branch rebases onto a main whose RFC is non-draft and the lane clears on the merits. No /ai-review override is needed or requested. UX Review -- the restored-folder capture is blocked on real cloud data, not on effort. The lane needs a genuine before/after of AWS Control's drive reopening a nested folder. Verified at the storage layer (aws_control/backend/storage.py): the drive is entirely S3-backed -- one private bucket per account, every list through the AWS CLI subprocess with a real --profile, no local substrate, and the tests stub at the React Query client layer rather than running a fake S3. So the capture requires a registered AWS account and a real bucket; it cannot be produced in an automated pod without wiring real cloud credentials, which is not appropriate. The retention behavior is covered by the unit A/B on a faked clock (data present at 6 min, collected at 30 with an identity, gone at 6 without). The IncidentChat toast state the lane also lists is capturable without AWS, but on its own it does not clear the lane while the folder state is unshown. No merge, approval, reviewer nudge, or override was performed. This comment is a record only. |
2bd1ef2 to
699a7cd
Compare
699a7cd to
bce2d3c
Compare
A builtin page has no way to say which app it belongs to. BuiltinAppRoute
resolves a route to a component and renders it with no provider, so nothing in
the tree carries the app's id -- six builtin app files carry comments
explaining that they cannot use the app SDK for exactly this reason. Nothing
can be scoped to an app that cannot name itself, which is what the two changes
stacked on this one need.
Extend the registry from route -> component to route -> {component, appId} and
publish that appId as React context from BuiltinAppRoute's render body.
appId is explicit data, not derived from the route: /worlds belongs to the app
agent-worlds, so route.slice(1) would mint 'worlds', which is not an app. Since
the appId becomes a storage-key and query-key prefix, a derived one would be a
permanent namespace nothing else on the platform addresses. A test asserts the
pairing against the shipped app.json manifests in both directions.
Published from the render body rather than an effect, because it must land
before the page's first child query mounts -- the ordering issue-radar solves
by putting its setQueryDefaults call at module scope. Under a lazy child
Suspense hides the difference, but a repeat visit finds the module loaded and
renders the page in the same pass, where an effect is a render too late.
origin is the literal 'builtin', proved by registry membership: the registry
holds only module code compiled into this bundle, which an external app cannot
reach. Reading origin from the ['apps'] query cache here would be weaker --
absent on a cold load -- and would break the synchronous publication. The
origin !== 'builtin' refusal lives in useTrustedAppId, where AppHost supplies
an origin that is genuinely data, so an app that self-registers under a
builtin's NAME does not inherit that builtin's namespace.
getBuiltinComponent is renamed getBuiltinApp rather than kept as a shim: a
caller left on the old name would receive an object where it expected a lazy
component and render nothing, so a compile error is the better failure.
The provider then splits in two, because AppApiProvider was the only way to get
either layer and a builtin page needs identity without a sandbox. app-sdk/
scopedApi.ts owns the sandbox -- the scoped client, the SDK context, and
AppScopedApiProvider -- and is imported BY PATH, deliberately off the app-sdk
barrel, which is held in exact agreement with the third-party vendor stub: a
name placed there is published, and publishing later is additive while
un-publishing is a break. AppApiProvider stays on the barrel and composes
identity with the scoped layer, publishing identity only when there is none in
context; shadowing a host-minted builtin identity with its external default
would revoke that page's namespace silently.
Three props every caller hand-wrote identically now default: allowedEvents,
subscribeFn, and notifyFn (the host's own mc:notify bus). spec-builder drops
from six props to three and IncidentChat from six to four. navigateFn keeps no
default on purpose -- a default would mean the SDK importing a router.
Two corrections ride along. IncidentChat's notifyFn was a hand-written no-op,
so an embed error message was dropped on the floor; it now reaches the host
toast bus. And the claim that a subscribeFn returning undefined throws during
unmount is false -- React accepts undefined as an effect cleanup, as a mutation
confirmed -- so the comment asserting it and the test resting on it are
corrected to the property that is real: an ABSENT subscribe is a TypeError on
mount.
Tests: appId charset refusals; appId parity against the shipped manifests in
both directions; the /worlds anti-derivation pin; the namespace refusal for a
non-builtin origin; first-render publication for both a cold and a warm page
module; a source ratchet asserting the registry has no data-ingestion path,
since that is what the builtin literal rests on; and for the split, name
resolved from identity, an explicit name overriding it, the loud refusal when
neither is available, all three defaults, and the no-shadow rule. Mutations
checked individually, each failing a named test, including putting
AppScopedApiProvider back on the barrel, which fails the stub-parity gate.
Two halves of one symptom, both standing on the identity seam in the previous commit. Leaving a builtin app page unmounts it, so the page returns to its defaults AND the data it was showing is collected shortly after. Coming back lands at the top level, behind loading placeholders. AWS Control's drive is the reported case: descend into a folder, leave, come back, and you are at the bucket root again with a skeleton. VIEW STATE (#8407) Add a host-owned view-state store. An app declares the few coordinates worth restoring; the host owns the key (kc:app:<appId>:view, appId from the identity context) and decides what happens when a record cannot be read back. The declaration is a filter, not documentation: pickDeclared runs on every write, so a field the app did not declare cannot reach storage. Passing a whole component state in persists only the coordinates, which is what makes 'do not persist the drive's contents' an enforced property. The record is read in a useState initializer, so the restored value exists on the consumer's first render and the drive's infinite query is keyed to the right folder from its first request -- no wasted root listing, no skeleton flash. Reading in an effect would look correct on a cold visit, because a React.lazy child is still suspended while its parent commits, and be a render too late on the repeat visit this feature exists to serve. scope is first-class: a prefix means nothing outside the bucket it was taken in, so a mismatched scope resolves to the defaults through the same path as a mismatched revision, and a scope change re-reads during render rather than carrying a position forward under a new label. CACHE RETENTION (#8404) react-query's 5-minute default gcTime collects an unmounted page's data. One app of nineteen was exempt, and only because it fixed this in app-local code no other app could reuse: issue-radar called setQueryDefaults(['issue-radar'], { gcTime }) at module scope. Give the host the same one-liner, per app. BuiltinAppRoute already knows which app owns the route before the page's first query mounts, so a sibling ahead of its Suspense boundary reads the appId from the identity context and registers retention for the [appId] key prefix. react-query matches query defaults by prefix, so that one registration covers every key the app already writes by hand -- AWS Control's accounts, drive and costs queries are all under ['aws-control', ...], so the reported symptom is fixed with no change to the app. Registered from a render body, not an effect, for the same reason the view-state read is: an effect version passes a cold-load test and still fails a user, since on a repeat visit React renders parent and child in one pass. useAppQuery is the other half: it takes the appId from context and prefixes the key, so an app cannot forge its own namespace, and code that wants the HOST's cache stays on plain useQuery where the difference is greppable. The prefix is exactly the appId and not ['app', appId, ...], which is the only shape that also leaves every existing key untouched: five prefixes are shared between an app and the host deliberately -- artifact, awsConsent, apps, pull-request-source, and workflow-definitions, whose rename would split the workflow cards in chat off the list in the app. What changes is who authors the prefix, not what it is. Two call sites converted, deliberately mixed in opposite directions: UsagePane's costs query is host-built while its invalidation stays a hand-written literal, and its drive invalidation is host-built while the query stays a literal. Either mismatch would stop a consent grant refreshing what it changed, so the pane exercises the byte-identity claim instead of asserting it. The remaining 33 sites follow separately (#8401). issue-radar's own registration is deleted, because the host now covers that exact prefix and keeping both was not merely redundant: setQueryDefaults is a Map keyed by the hashed key, so both wrote the same entry and the last writer won -- decided by whether the app's lazy chunk had evaluated yet. Identical values hid it; a future change to either number would not have. Tests: the write filter, every parse rejection, the builtin gate, first-render publication, the scope re-read, the three reporting tiers, and the drive's first request; then retention refusals for a host page and an external origin, keys byte-identical to the literals they replace in both directions, degrade to a plain query with no namespace, already-prefixed keys collapsing with one warning, one registration per client and app, cold AND warm ordering each self-contained, the namespace surviving both api-layer providers nested inside a builtin page -- the shape spec-builder and IncidentChat use, where a shadowed identity would put an app's data outside the very namespace being retained with no error to see -- and an A/B on a faked clock showing the data present at six minutes and collected at thirty with an identity, gone at six without one, which is the reported symptom reproduced. Co-authored-by: gh-autofix#2887 <chenmingwei23@users.noreply.github.com>
UX evidence (attached, not committed)Per Cache retention -- repaint from cache, no skeletons on return within 30 min: View-state store -- AWS Control discover/enable/accounts: Note on the drive restored-folder capture: the AWS Control drive is entirely S3-backed (one private bucket per account, every list through the AWS CLI with a real |
Board state at head 5439691 (report only)Cleared this cycle, all on the merits (no override, no merge):
Sole remaining blocker: UX Review. It is a blocking gate that feeds the required
Gaps 1 and 2 both require a registered AWS account and a real S3 bucket: the drive is entirely S3-backed (every list through the AWS CLI with a real No merge, approval, reviewer nudge, or override performed. |
|
/ai-review override ux 5439691: The three missing captures all require a registered AWS account and a real S3 bucket (the drive is entirely S3-backed via the AWS CLI with a real --profile; tests stub at the React Query client, not a fake S3), which this automated host cannot mint, so the evidence is unreachable here rather than withheld; the absence is recoverable (a maintainer can capture later with no code change) and carries no user-facing consequence, and the behavior is already pinned by DrivePage.viewState.test.tsx and the cache-retention A/B on a faked clock. |
|
AI-review override not recorded: keep the reason to 500 characters or fewer. |
|
/ai-review override ux 5439691: The three missing captures all need a registered AWS account and real S3 bucket (the drive is S3-backed via the AWS CLI with a real --profile; tests stub the React Query client, not a fake S3), which this host cannot mint, so the evidence is unreachable here, not withheld; the absence is recoverable and has no user-facing consequence, and the behavior is pinned by DrivePage.viewState.test.tsx and the cache-retention A/B. |
Human judgment recorded@chenmingwei23 marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |






Part of the app view-state and cache-retention work, now delivered as one PR. The two follow-ups were merged into this branch rather than into main, so this PR carries all three pieces:
Related: #8412 (stale bundle ceiling on main, merged), #8394 (external app cache
isolation, separate track), #8401 (convert the remaining AWS Control key sites,
follows this PR).
Problem / Motivation
App state does not survive navigation. Leave an app, come back, and it has reverted to its initial state: the folder you had open is back at the top level, and the data that was on screen is fetched again behind loading placeholders. AWS Control's drive is the reported case -- descend into a folder, navigate away, return, and you are at the bucket root with a skeleton.
The behaviour is platform-wide rather than a defect in any one app. Eighteen of nineteen apps that issue queries are affected. The one exception fixed it in app-local code no other app could reuse: issue-radar calls
setQueryDefaults(['issue-radar'], { gcTime })at module scope.Underneath both halves sits a third problem that has to be solved first: a builtin page has no app identity in the React tree.
BuiltinAppRouteresolves a route to a component and renders it with no provider, so nothing tells a mounted page which app it belongs to, and there is nothing to scope persisted state or cache retention to. Six builtin app files carry comments documenting exactly that.Why it matters
An app that returns to its initial state on every visit cannot be a destination a user revisits. It pushes usage toward one long-lived session and penalises navigation, which is the opposite of the intended experience for a dashboard composed of many small apps. Unchanged data is also re-fetched on every return, so the cost falls on the backend as well as on the user's attention.
What changed (motivation -> approach -> change)
Two commits, matching the two layers.
Commit 1 -- the identity seam
builtinRegistrygoes fromroute -> componenttoroute -> {component, appId}, andBuiltinAppRoutepublishes that appId as React context.appId is explicit data, not derived from the route, and there is a concrete case rather than an abstract one:
/worldsbelongs to the appagent-worlds. Aroute.slice(1)derivation would mintworlds, which is not an app on this platform. Since the appId becomes alocalStoragekey segment and a query-key prefix, a derived one would be a permanent namespace nothing else addresses. A test asserts the pairing against the shippedapp.jsonmanifests in both directions.Published from the render body, not an effect. It has to land before the page's first child query mounts -- the ordering issue-radar solves by putting its call at module scope. Under a
React.lazychild Suspense hides the difference, but a repeat visit finds the module already loaded and renders the page in the same pass, where an effect is a render too late.originis the literal'builtin', and the proof is registry membership: the registry holds only module code compiled into this bundle, which an external app cannot reach. Readingoriginfrom the['apps']query cache there would be weaker -- absent on a cold load -- and would break the synchronous publication. Theorigin !== 'builtin'refusal lives inuseTrustedAppId, whereAppHostsupplies an origin that is genuinely data. That matters because a namespace is granted by id: an external app can self-register under the nameaws-control, and gating on the name alone would hand it the builtin's keys.getBuiltinComponentis renamedgetBuiltinApprather than kept as a shim -- a caller left on the old name would receive an object where it expected a lazy component and render nothing, so a compile error is the better failure.The provider then splits.
app-sdk/scopedApi.tsowns the sandbox and is imported by path, deliberately off the app-sdk barrel, which is held in exact agreement with the third-party vendor stub: a name placed there is published, and publishing later is additive while un-publishing is a break.AppApiProviderstays on the barrel and composes identity with the scoped layer, publishing identity only when there is none in context -- shadowing a host-minted builtin identity with its external default would revoke that page's namespace silently. Three props every caller hand-wrote now default;navigateFndeliberately does not, because a default would mean the SDK importing a router. Two of the three defaults are byte-identical to the literals removed (verified per caller, including the three inspec-builder). The third is a deliberate behavior change in one caller:ops-mission-control/IncidentChat.tsxpassednotifyFn = () => {}, an explicit silent no-op, and the new default ishostNotify, which dispatchesmc:notify. So embed notifications that IncidentChat was swallowing now raise toasts on the incident board -- intended, and asserted by the strengthenedIncidentChat.cov80test (expect(seen).toEqual(['zzq hello'])). It is called out here because "prop removed, default inherited" is exactly the shape an unintended change hides in, and a reader diffingIncidentChat.tsxalone cannot see that the inherited default is not also a no-op.Commit 2 -- view-state store and cache retention
View state. An app declares the few coordinates worth restoring; the host owns the key (
kc:app:<appId>:view, appId from the identity context) and decides what happens when a record cannot be read back. The declaration is a filter, not documentation:pickDeclaredruns on every write, so a field the app did not declare cannot reach storage -- which is what makes "do not persist the drive's contents" an enforced property rather than a convention. The record is read in auseStateinitializer, so the restored value exists on the consumer's first render and the drive's query is keyed to the right folder from its first request: no wasted root listing, no skeleton flash.scopeis first-class, because a prefix means nothing outside the bucket it was taken in, so a mismatched scope resolves to defaults through the same path as a mismatchedrevision.Cache retention.
BuiltinAppRoutealready knows which app owns the route before the page's first query mounts, so a sibling ahead of its Suspense boundary reads the appId and registersgcTimefor the[appId]key prefix. react-query matches query defaults by prefix, so one registration covers every key the app already writes by hand -- AWS Control's accounts, drive and costs queries are all under['aws-control', ...], so the reported symptom is fixed with no change to the app.useAppQueryis the other half: the host authors the prefix, so an app cannot forge its own namespace, and code that wants the host's cache stays on plainuseQuerywhere the difference is greppable. The prefix is exactly the appId and not['app', appId, ...], which is the only shape that leaves existing keys untouched -- five prefixes are shared between an app and the host deliberately, and renaming the workflow ones would split the workflow cards in chat off the list in the app. What changes is who authors the prefix, not what it is.Two call sites are converted, mixed in opposite directions on purpose: one query host-built with a hand-written invalidation, one invalidation host-built with a hand-written query. Either mismatch would stop a consent grant refreshing what it changed, so the pane exercises the byte-identity claim instead of asserting it. The remaining 33 follow in #8401.
issue-radar's own registration is deleted, and not merely as redundancy:
setQueryDefaultsis a Map keyed by the hashed key, so both wrote the same entry and the last writer won, decided by whether the app's lazy chunk had evaluated yet. Identical values hid it; a future change to either number would not have.Tests
Identity: appId charset refusals; appId parity against the shipped manifests in both directions; the
/worldsanti-derivation pin; the namespace refusal for a non-builtin origin; first-render publication for a cold and a warm page module; a source ratchet asserting the registry has no data-ingestion path, since that is the property the builtin literal rests on; and for the provider split, name resolved from identity, an explicit name overriding it, the loud refusal when neither is available, all three defaults, and the no-shadow rule.View state: the write filter, every parse rejection, the builtin gate, first-render publication, the scope re-read, the three reporting tiers, and the drive's first request.
Retention: refusals for a host page and an external origin; keys byte-identical to the literals they replace, in both directions; degrade to a plain query with no namespace; already-prefixed keys collapsing with one warning; one registration per client and app; cold and warm ordering, each self-contained; the namespace surviving both api-layer providers nested inside a builtin page, which is the shape spec-builder and IncidentChat use and where a shadowed identity would put an app's data outside the very namespace being retained with no error to see; and an A/B on a faked clock showing the data present at six minutes and collected at thirty with an identity, and gone at six without one -- the reported symptom reproduced.
Mutations were checked individually throughout, each failing a named test, including putting
AppScopedApiProviderback on the barrel (fails the stub-parity gate) and removing the i18n exemption described below (fails the diff-scoped i18n gate).Local gate on the rebased head:
tsc -b,eslint src/ --max-warnings 0,jscpd,npm run i18n:check(19 checks PASS), and 2036 tests green across 81 files.Manual verification
Verified in an isolated pod, with the served bundle grepped rather than assumed, because
pod up --provisionskips the SPA rebuild on an already-provisioned pod and this repo has previously captured screenshots of a stale bundle. The pod served the freshly built chunk, hash-matched to disk, containingAppScopedApiProvider,agent-worlds,builtin-only,could not resolve an app nameandnot a valid app id, with the removedgetBuiltinComponentaccessor absent (0 hits). The/worldspairing survives minification as a literal, which is the anti-derivation claim in compiled form.The end-to-end path for the reported symptom was walked in a pod for the retention half: open AWS Control, navigate away, wait past the old 5-minute window, return, and the page repaints from cache with no skeleton.
Screenshots / video
Attached to this description as GitHub assets (per
.gitignore, screenshots are uploaded, never committed to the tree).View state -- dashboard and AWS Control with the store active:
Cache retention -- the reported symptom, before and after leaving the page:
The one state not captured is the AWS Control drive reopening a nested folder. That capture needs a registered AWS account and a real S3 bucket: the drive is entirely S3-backed (every list goes through the AWS CLI with a real
--profile; the tests stub at the React Query client layer, not a fake S3), so this automated host cannot produce it without minting real cloud credentials. The restore itself is frontend-only -- it readskc:app:<appId>:viewfrom localStorage in auseStateinitializer and keys the query -- and is pinned byDrivePage.viewState.test.tsx(10 tests) plus the cache-retention A/B on a faked clock (data present at 6 min, collected at 30 with an identity, gone at 6 without).Rebase note
The two follow-ups were merged into this branch rather than into main, which left it at four commits against a
MAX_COMMITS: 2gate and conflicting with a main that had moved 37 commits. It is squashed to two commits along the layer boundary -- identity seam, then the two consumers -- with both trees verified byte-identical to the originals before the rebase, and the commit messages assembled from the original bodies rather than rewritten, so the reasoning that earned the earlier reviews is intact.Two conflicts, both unions of unrelated additions rather than contested decisions. In
DrivePage.tsx, main'stype Failureand this branch'sDRIVE_VIEWdeclaration landed adjacent; both are kept. In the App SDK spec, main inserted a paragraph immediately above a heading this branch renamed; the paragraph and the rename are both kept, and the section was re-read afterwards to confirm the prose still reads correctly against the new heading -- it closes the preceding section and carries no cross-reference, and no reference to the old heading text exists anywhere in the repo.One new finding surfaced from rebasing onto current main: the i18n diff gate flags the view-state record's JSON serialization at
app-sdk/viewState.ts. It is a latent failure rather than a rebase artifact -- it reproduces identically against the branch's earlier base, so it was present when that work merged. The line is JSON syntax written and compared by value, never rendered. It cannot take a narrower exemption: it is returned rather than passed, so no callee exemption reaches it, and an inline disable fails because the two gates register the rule under different names and naming both makes each run fail on the one it does not know. So it takes a file-scoped exemption in the shape the SDK's own protocol module already uses, with the module audited as copy-free first, and the exemption is mutation-checked.The app-core bundle ceiling is NOT touched by this PR. An earlier revision bumped it here; that was the wrong home for it by this PR's own argument -- a ceiling main has drifted into is main's defect, and a separate fix unblocks every open PR rather than one -- and main has since re-measured it independently in #8519. This branch takes main's number unchanged, and the measurement confirms it covers this diff: the branch builds the app-core chunk at 3220.5 KB against main's 3360 KB ceiling, 139.5 KB of headroom, gate green. No ceiling change is needed for this work.
The backend shard failures visible in this PR's earlier check history were main-owned, not this change's: the ten failures were all in one Python test file, this diff contains zero Python files, and main's own fix for that file landed after the run started. Rebasing cleared them. The
Coverage Gatered beside them was downstream of the same thing -- its log ends by failing closed on the backend result rather than reporting a finding of its own.Two further red checks in this PR's history were also main-owned and are recorded here so a reviewer reading the check log does not mistake them for instability in this change. Ten backend test failures came from one Python test file that main fixed after the run started, and a flake8 F811 in that same file came from two main commits each adding the same property to a test double -- fixed on main by #8583. This diff contains zero Python files throughout.
Related Issues
Delivers the approved App View State and Cache Retention design in full: the identity seam, the view-state store, and cache retention.
Out of scope by design and needing its own issue: an external app can currently reach the host's
QueryClient, since the shared-modules registry exposes the live react-query instance. That is pre-existing and independent of this feature.Pattern harvest
Rule candidate:
review-promptPattern: a first-render assertion under a
React.lazychild is vacuous, because Suspense hides the difference between a render-body publication and an effect.This nearly shipped. The first version of the test recorded what a consumer saw on each render and asserted the first entry was populated, which looks mutation-proof and is not: moving the publication into a
useEffectstill passed, because the lazy page suspends, so the parent commits and its effects run before the child renders at all. It only passes for a cold module. On a repeat visit the module is already resolved, React renders parent and child in one pass, and an effect is a render too late -- and a repeat visit is precisely the case this feature exists to serve. Both halves of this PR depend on that ordering, and both are now pinned twice: with a synchronous consumer, which Suspense cannot mask, and with a second mount of the real tree.The generalizable rule: when asserting when something becomes available, a lazy boundary between the publisher and the observer invalidates the test. Assert against a synchronous observer, or against a second mount.
Rule candidate:
review-promptPattern: a PR that states a one-way-door principle must be checked against its own additions before it ships.
This PR argued that publication to the third-party vendor stub is a one-way door, and used that to justify keeping the identity layer off the barrel -- then published
AppScopedApiProviderthere in the same change, with zero external consumers, on the weaker ground that the export was harmless. Review caught it, and could only catch it because the principle was written down where it could be held against the diff. The check is: when a description states a rule about a one-way door, enumerate that PR's own additions of that kind and say for each whether a consumer needs it now. "Safe" is not the test; "needed" is.Rule candidate:
agents-mdPattern: the i18n gate recognises a developer diagnostic by its CALL SITE, so relocating an unchanged string out of
console.*/Error(/reportSeamCollision(reclassifies it as user-facing copy.Refactoring two refusal paths into one predicate that returned a reason string moved five diagnostics out of the calls that exempted them, and the gate flagged five untranslated literals in a file whose base count was zero, with prose that had not changed by a character. A pure predicate that returns prose pays this cost; one that reports in place does not. The fix is structural rather than a suppression, because the exemption is a statement about the sink.
Checklist