test(core): fix contradictory composition-discovery file-tree test (#1385)#1399
Merged
Merged
Conversation
…1385) #1385 ("exclude dot-directories from composition discovery", b952dc9) merged with a failing test, leaving main red. Its commit message assumed "walkDir only skipped three exact names (.thumbnails, node_modules, .git)", but `.hyperframes` had already been added to walkDir's IGNORE_DIRS by the backup feature (with its own passing "hides internal backup files" test). So the new test "keeps dot-directory files visible in the file tree" used `.hyperframes/examples/preset.html` — the one dot-dir that walkDir hides — and asserted it appears in `files`, which can never hold: `files = walkDir(...)` filters `.hyperframes`. The implementation is coherent; the test picked the wrong fixture and never exercised the isInHiddenOrVendorDir gating it meant to. Fix the fixtures (test-only, no production change): - Add a genuinely-vendored dot-dir `.cache/examples/preset.html` — walkDir does not special-case it, so it stays in the file tree but must be gated out of composition discovery by isInHiddenOrVendorDir. This is what #1385 actually targets, now properly exercised. - Keep `.hyperframes/examples/preset.html` and assert it is hidden from the file tree (IGNORE_DIRS) — documenting the deliberate divergence so the two features (Studio-internal backups vs. browsable vendored dot-dirs) don't collide again. Full non-producer suite green; the walkDir "hides backups" test is untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
miguel-heygen
approved these changes
Jun 13, 2026
miguel-heygen
approved these changes
Jun 13, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Strengths:
projects.test.ts:27-38— the fixture comment is excellent; it precisely distinguishes the two dot-directory contracts (walkDir-hidden vs. composition-gated-only) so the next reader doesn't repeat #1385's mistake.- The split assertion (
not.toContain(".hyperframes/...")for the file tree +not.toContain(".cache/...")for compositions) documents both invariants in a single test, giving regression coverage for the deliberate divergence.
Findings: none.
CI: All checks green — Test ✓, Tests on windows-latest ✓, all 8 regression shards ✓. Confirms main is restored.
Audited: packages/core/src/studio-api/routes/projects.test.ts (only file changed; test-only diff).
Verdict: APPROVE
Reasoning: Test-only fix with a tight, well-documented 1-file diff. Root cause analysis in the PR body is correct (.hyperframes is in IGNORE_DIRS, so the old assertion was impossible). New fixture exercises the actual contract and all CI is green.
— magi
2 tasks
jrusso1020
added a commit
that referenced
this pull request
Jun 13, 2026
main went red again at e2cc134: my #1399 fix branched off the pre-#1366 state (where `.hyperframes` was wholesale-hidden via IGNORE_DIRS) and, when it merged on top of #1366, overwrote #1366's corrected test with an assertion that `.hyperframes/examples` is hidden. #1366 is the authoritative behavior: walkDir now hides only `.hyperframes/backup` (shouldIgnoreDir), so `.hyperframes/examples` — like any other vendored dot-dir — stays visible in the file tree and is gated out of composition discovery by isInHiddenOrVendorDir. That is the original #1384 intent. Correct the file-tree test to match: - `.cache/examples/preset.html` and `.hyperframes/examples/preset.html` are both visible in `files` (kept the `.cache` case from #1399 — it exercises isInHiddenOrVendorDir gating for a non-special dot-dir). - `.hyperframes/backup/snapshot.html` is the only thing hidden from the tree. - Compositions still exclude every dot-dir example. Full non-producer suite green; walkDir "hides backups" test untouched. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
mainis currently red —CI / Test(andTests on windows-latest) have failed on every commit since #1385 (b952dc9). This makes one test consistent with the implementation, restoring a greenmain. Test-only; no production code changes.Why
#1385's commit message states "walkDir only skipped three exact names (.thumbnails, node_modules, .git)" — but
.hyperframeshad already been added towalkDir'sIGNORE_DIRSby the backup feature (which has its own passingwalkDirtest: "hides internal HyperFrames backup files from project listings").Working from that stale assumption, #1385 added:
projects.tsbuildsfiles = walkDir(project.dir), andwalkDirfilters.hyperframes— sofilescan never contain it. The assertion is impossible, the test failed, and #1385 merged red anyway.The implementation is actually coherent.
.hyperframesis special-cased as hidden; other dot-dirs (.cache, …) stay in the file tree but are gated out of composition discovery byisInHiddenOrVendorDir. The test simply picked the one dot-dir that's hidden, so it never exercised the gating it was meant to verify.How (test-only)
.cache/examples/preset.html.walkDirdoes not special-case.cache, so it stays listed in the file tree but must be excluded from compositions byisInHiddenOrVendorDir— exactly what fix(core): exclude dot-directories and node_modules from studio composition discovery and lint #1385 targets, now actually exercised..hyperframes/examples/preset.htmland assert it's hidden from the file tree (IGNORE_DIRS), documenting the deliberate split between Studio-internal dirs (backups) and browsable vendored dot-dirs so the two features don't silently collide again.walkDirtest is untouched.Test plan
projects.test.tsnow passes (2/2);safePath.test.tswalkDir test andlint.test.tsstill pass.bun run --filter '!@hyperframes/producer' testsuite is green (exit 0);tsc --noEmit,oxlint,oxfmt --checkclean.🤖 Generated with Claude Code