Skip to content

fix(app-center): fence stale factory snapshots#1472

Open
jomeswang wants to merge 1 commit into
mainfrom
codex/app-factory-ux-metadata-20260721
Open

fix(app-center): fence stale factory snapshots#1472
jomeswang wants to merge 1 commit into
mainfrom
codex/app-factory-ux-metadata-20260721

Conversation

@jomeswang

@jomeswang jomeswang commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fence in-flight factory list reads whenever an authoritative factory snapshot is applied
  • treat agentTargetId changes as meaningful factory-job state changes
  • add regression coverage for stale initial reads and target-only updates
  • add a patch changeset for @tutti-os/workspace-app-center

Root cause

The shared controller sequenced only list requests against other list requests. A newer host-pushed snapshot did not advance that sequence, so an older initial GET could complete later and replace the authoritative snapshot with an empty result. Factory-job equality also omitted agentTargetId, which could suppress a navigation-target update.

Validation

  • pnpm --filter @tutti-os/workspace-app-center test — 117 passed
  • pnpm --filter @tutti-os/workspace-app-center typecheck — passed
  • pnpm check:changed — 8 lanes passed after rebase
  • pre-push pnpm check:changed -- --push-ready — 9 lanes passed

Compatibility and rollback

No public API or persisted-data shape changes. The changeset is patch-level. Rollback is a single commit revert; consumers that retain their own host-side stale-read fence remain safe during a staggered rollout.


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines +92 to +94
// Any authoritative factory snapshot supersedes reads that started before
// it, including the factory half of an in-flight full refresh.
this.factoryLoadSequence += 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Core controller file grows further past the mandated size limit

New logic is added to a core controller file that is already 882 lines (appCenterControllerState.ts:88-111), which exceeds the repository's 800-line business-code ceiling and its rule to decompose before adding more logic.
Impact: The file drifts further past the size limit the repository requires, deferring the decomposition the rules mandate.

Repository size-limit rule

Both AGENTS.md ("Business-code files should stay at or below 800 lines. Prefer decomposition before adding more logic.") and CONTRIBUTING.md ("Business-code files should stay at or below 800 lines; crossing the limit is a refactoring signal") set an explicit 800-line ceiling for business-code files. packages/workspace/app-center/src/core/appCenterControllerState.ts is 882 lines, and this PR adds the factoryLoadSequence increment logic at appCenterControllerState.ts:92-94 rather than decomposing first.

Prompt for agents
The file packages/workspace/app-center/src/core/appCenterControllerState.ts is 882 lines, exceeding the repository's 800-line business-code limit documented in AGENTS.md and CONTRIBUTING.md. The rule states to prefer decomposition before adding more logic. Consider extracting cohesive groups of methods (e.g. the install-refresh scheduling helpers, or the snapshot-application helpers) into a separate module to bring the file back under the 800-line ceiling before or as part of adding this new fencing logic.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Signed-off-by: jomeswang <1551403343@qq.com>
@jomeswang
jomeswang force-pushed the codex/app-factory-ux-metadata-20260721 branch from 1f5bc03 to 4aacafc Compare July 21, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant