Skip to content

feat(core): a folder with index.html is one a step can work on, apart from finding projects - #7734

Merged
miguel-heygen merged 2 commits into
mainfrom
dharness/composition-folder-rule
Nov 14, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
dharness/composition-folder-rule

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What

@hyperframes/core gets a second, named project rule: isCompositionFolder(fileNames), true for any folder with an index.html. isHyperframesProject (index.html plus hyperframes.json, meta.json or project.json) is unchanged. Both are exported from the package root and from projects.

Why

One rule answered two different questions:

  • Is this folder a project to list? Finding projects on a computer must stay strict, or every website or docs folder with an index.html would be listed. isHyperframesProject is right for that.
  • Can a step work on this folder? Any folder whose index.html is the composition can be previewed, snapshotted and checked. A host that used the strict rule here refused to open a folder holding only index.html, while the CLI's own snapshot and check worked on it.

Repro: make a folder with only an index.html composition. hyperframes snapshot and hyperframes check work on it, but isHyperframesProject says it is not a project, so anything that gates opening on that rule refuses it.

Every use of the rule on main, sorted:

Where Question Rule
core/src/projects.ts:49 (Spotlight query on the marker files) find projects to list strict, unchanged
core/src/projects.ts:109 (folder walk) find projects to list strict, unchanged
core/src/projects.ts:159 (is a folder inside a project) find projects to list strict, unchanged
core/src/projects.ts:171 (Spotlight hit check) find projects to list strict, unchanged
cli/src/utils/desktopApp.ts:163 (markBareIndexAsProject) add a marker so a host that lists projects strictly can open the folder strict for now; it can go once hosts open a folder by isCompositionFolder

No step in this repo calls the rule. The other uses of meta.json and hyperframes.json (capture output, init, the regression harness, the registry installer) are those files' own formats, not the project rule.

Related work

None.

How

isCompositionFolder sits beside isHyperframesProject in projectRule.ts, so the two rules have one home and one test file. Discovery code is untouched.

The new export ships in both the root and projects entry points and their .d.ts files. That put @hyperframes/core's unpacked size at 4,373,541 bytes, 241 bytes past the 1% tolerance on its 4,330,000 budget. The budget in scripts/package-size-budgets.json goes to 4,374,000: CI's measured unpacked size at this branch, 4,373,541, rounded up to the next 1,000, with the file's 1% tolerance still on top. The packed size stays inside its budget.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

  • fails without the fix: packages/core/src/projectRule.test.ts "counts any folder with index.html, marker or not" and "does not count a folder without index.html" (2 failed before isCompositionFolder existed).

  • projectRule.test.ts and projects.test.ts: 20 pass. projects.test.ts:53 "finds a folder with index.html and a project marker, and nothing else" already proves discovery never lists an index-only folder (site/index.html), and it still passes.

  • oxfmt, oxlint and the comment ratchet are clean on the changed files.

  • Not run: the full repo test suite and a build (CI runs both).

… from finding projects

isHyperframesProject needs index.html and a marker file, which is right for finding projects on a computer (a
website's folder must not be listed) but not for what a step works on. isCompositionFolder says that: any folder
whose index.html is the composition.
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 89 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 9ddbc7ee

  • blocker: the required CI › Build job fails at verify:packed-manifests (run): @hyperframes/core unpacked size 4373541 bytes is over its budget of 4330000 by more than 1%. That is 241 bytes over the 1% tolerance (4373300). The base b5e9bc68 passes Build, so this PR's new export, which ships in the root and projects entry points plus their .d.ts files, tips core over the limit. Raise the @hyperframes/core entry in scripts/package-size-budgets.json and give the reason in the body, as the script asks.

The code is fine. isCompositionFolder matches how the CLI already decides a folder is workable (existsSync(join(dir, "index.html")), e.g. cli/src/utils/project.ts:98). Discovery still uses only isHyperframesProject.

Scope

Read all 4 files. Checked every use of isHyperframesProject against the body's table, and both exports entries (., ./projects). This is a feat, and its body also has a fails without the fix: line naming both tests. Comments, CodeQL and the other workflows are green. Windows render was still running.

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Raised @hyperframes/core's unpacked budget to 4,380,000 in scripts/package-size-budgets.json (4beb8e4), with the reason in the body: the new export ships in both entry points and their .d.ts files, 241 bytes past the 1% tolerance. Packed stays inside its budget.

@miguel-heygen
miguel-heygen force-pushed the dharness/composition-folder-rule branch from 4beb8e4 to b1e24c6 Compare November 14, 2026 13:42

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE — 1 resolved, 0 open, 0 new · 9ddbc7ee → b1e24c61. The only change is the core unpacked budget, 4,330,000 → 4,374,000, with the reason in the body. CI › Build is green, and so are CodeQL, Comments and Windows render.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 32f562b Nov 14, 2026
95 of 96 checks passed
@miguel-heygen
miguel-heygen deleted the dharness/composition-folder-rule branch November 14, 2026 14:22
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