Skip to content

Fix Windows resource cache for Orbit templates#1554

Open
PerishCode wants to merge 1 commit into
mainfrom
chore/build-optimizations-followup
Open

Fix Windows resource cache for Orbit templates#1554
PerishCode wants to merge 1 commit into
mainfrom
chore/build-optimizations-followup

Conversation

@PerishCode
Copy link
Copy Markdown
Contributor

Summary

  • include design-templates in the Windows win.resource-tree cache key
  • bump the Windows resource-tree cache schema marker so old entries are not reused
  • add a regression test proving design-templates/orbit-general changes invalidate and rematerialize the Windows resource tree

Fixes #1507

Why

The packaged resource copy already includes design-templates, but the Windows resource-tree cache key did not hash that tree. A stale win.resource-tree cache could therefore keep reusing a pre-migration resource tree that lacked Orbit templates, and win.electron-builder-dir would inherit that stale key downstream.

Validation

  • red spec before fix: pnpm -C tools/pack exec vitest run tests/win-resources.test.ts --reporter verbose failed with stale version one content after updating design-templates/orbit-general/SKILL.md
  • pnpm -C tools/pack exec vitest run tests/win-resources.test.ts tests/resources.test.ts --reporter verbose
  • pnpm --filter @open-design/tools-pack typecheck
  • pnpm --filter @open-design/tools-pack test
  • pnpm --filter @open-design/tools-pack build
  • git diff --check
  • pnpm guard
  • pnpm typecheck

Packaged artifact proof

  • Built a real Windows dir artifact: pnpm tools-pack win build --to dir --namespace o1507 --dir C:\tmp\od-1507 --json
  • Confirmed win-unpacked/resources/open-design/design-templates contains orbit-general, orbit-github, orbit-gmail, orbit-linear, and orbit-notion
  • Confirmed orbit-general/SKILL.md exists in the artifact
  • Started the packaged dir artifact and verified document.title is Open Design
  • Verified runtime /api/design-templates exposes all five Orbit template ids above
  • Stopped the packaged process and removed C:\tmp\od-1507

Notes

  • PR test: expand Memory and Routines coverage #1521 separately adds resource-copy coverage for orbit-general; this PR fixes the Windows cache invalidation boundary that can keep packaged artifacts stale.
  • pnpm typecheck completed successfully with existing Astro content warnings and Shiki urdu fallback warnings.

@PerishCode PerishCode added the lane:loop-fit Bug follow-up completed with red spec, focused fix, green validation, and PR label May 13, 2026
@lefarcen lefarcen requested a review from mrcfps May 13, 2026 08:54
@lefarcen lefarcen added size/S PR changes 20-100 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels May 13, 2026
Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hey @PerishCode, this is a focused fix for the Windows packaging cache boundary. The source change lines up with #1507: win.resource-tree now hashes design-templates, and the schema marker bump makes sure old resource-tree entries cannot be reused. The regression test also hits the important stale-cache behavior by changing design-templates/orbit-general/SKILL.md and expecting a second cache miss plus rematerialized content.

I don’t see code blockers in this pass. One PR-body housekeeping item before the next review pass: the new template is still missing What users will see and Surface area. Since this is packaging/runtime behavior rather than UI, Surface area can likely mark the packaged/default-behavior surface or explicitly say there is no direct UI checkbox to select, but reviewers should not have to infer that.

If you want to patch the description with an assistant, this prompt should be enough:

Read the current PR body for #1554 and the template at
.github/pull_request_template.md. Rewrite the description filling in:

  • Why: use case + pain being addressed, not a one-line restatement
  • What users will see: user perspective — what they click, what new
    thing appears, what default changes
  • Surface area: check every applicable box; pick "None" if this is not user-facing
  • Screenshots if UI is checked: entry-point screenshot, before/after
  • Validation: what you actually ran (pnpm guard, pnpm typecheck, etc.)
    Then update via gh pr edit 1554 --repo nexu-io/open-design --body-file -.

No rush — the implementation itself looks coherent; this just helps the next reviewer scope the user-visible packaging impact faster.

Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

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

@PerishCode I reviewed the Windows resource-tree cache change and the new regression coverage. The cache key now tracks design-templates, the schema bump prevents reuse of pre-fix entries, and the added test exercises the stale-cache path by mutating design-templates/orbit-general/SKILL.md and verifying the rematerialized resource tree updates as expected.

Thanks for tightening up this packaging edge case 🙌

🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:loop-fit Bug follow-up completed with red spec, focused fix, green validation, and PR risk/medium Medium risk: regular code changes size/S PR changes 20-100 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows stable package is missing bundled Orbit prompt templates

3 participants