-
Notifications
You must be signed in to change notification settings - Fork 0
[Draft] PhysicsRegistry + SAT helpers + events + perf overlay + Project Newton scaffolding #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b4decd5
ab70dba
2a5c3bd
f999f8e
a2b6dc7
6d6987a
eb2d1eb
90647e9
7309f9e
83e2eee
f8b45cd
481eca2
d2345ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: PR Policy | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize] | ||
|
|
||
| jobs: | ||
| policy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check milestone and tests present | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const pr = context.payload.pull_request | ||
| if (!pr) { | ||
| core.setFailed('No PR context') | ||
| return | ||
| } | ||
| // Require milestone | ||
| if (!pr.milestone) { | ||
| core.setFailed('PR must have a milestone assigned') | ||
| return | ||
| } | ||
| // Require at least one test file changed in the PR (tests-first discipline) | ||
| const files = await github.paginate(github.rest.pulls.listFiles, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: pr.number, | ||
| per_page: 100, | ||
| }) | ||
| // Escape hatch via label and audit line in body | ||
| const labels = (pr.labels || []).map(l => typeof l === 'string' ? l : l.name) | ||
| const skip = labels.includes('skip-test-check') | ||
| if (skip && /skip-test-check:/i.test(pr.body || '')) { | ||
| core.notice('tests-first check skipped via label + audit line') | ||
| return | ||
| } | ||
flyingrobots marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Allowlist infra/docs only changes | ||
| const infraOnly = files.every(f => ( | ||
| f.filename.startsWith('.github/') || | ||
| /\.(ya?ml|md|txt)$/.test(f.filename) || | ||
| /(^|\/)Dockerfile$/.test(f.filename) || | ||
| /(^|\/)package-lock\.json$/.test(f.filename) | ||
| )) | ||
| if (infraOnly) { | ||
| core.notice('infra/docs-only change: tests change not required') | ||
| return | ||
| } | ||
flyingrobots marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const hasTest = files.some(f => /__tests__|\.test\.[tj]sx?$/.test(f.filename)) | ||
| if (!hasTest) { | ||
| core.setFailed('PR must include changes to tests (tests-first).') | ||
| return | ||
| } | ||
flyingrobots marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Optional: Encourage acceptance criteria section | ||
| const body = pr.body || '' | ||
| if (!/Acceptance Criteria/i.test(body)) { | ||
| core.notice('Consider adding an "Acceptance Criteria" section to the PR description.') | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,4 @@ dist-ssr | |
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
| feedback.md | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||||||
|
|
||||||||||
| # PhysicsRegistry — discovery, descriptors, and change events | ||||||||||
|
|
||||||||||
| Labels: architecture, physics, registry, project:newton | ||||||||||
| Milestone: PROJECT: Newton | ||||||||||
|
|
||||||||||
| ## Summary | ||||||||||
|
|
||||||||||
| Design and implement a PhysicsRegistry that discovers DOM nodes, stores typed descriptors (type, tag, attrs, origins), emits change events on layout/resize, and serves as the single source of truth for activation/reset/inspector. | ||||||||||
|
|
||||||||||
| ## Acceptance Criteria | ||||||||||
|
|
||||||||||
| - [ ] Discovers `.cloth-enabled`, `.rigid-dynamic`, `.rigid-static` and nodes with `data-phys-*` or `data-cloth-*` attributes | ||||||||||
| - [ ] Descriptor includes: { id, tag, type, attrs (parsed), origin (rect/world), active state } | ||||||||||
| - [ ] Emits events: `registry:add`, `registry:update`, `registry:remove` with prior/next descriptors | ||||||||||
| - [ ] Diffing works: only changed fields emitted; stable ids across runs | ||||||||||
| - [ ] Inspector/activation can subscribe to the registry | ||||||||||
|
|
||||||||||
| ## Tests (write first) | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix heading spacing to satisfy markdownlint. Missing blank line below the "## Tests" heading violates MD022. Past comments addressed identical issues at lines 6, 9, and 16—this one slipped through. Apply this diff: ## Tests (write first)
+
- [ ] physicsRegistry.spec: discovery from a test DOM, descriptor diffing, events on resize📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)19-19: Headings should be surrounded by blank lines (MD022, blanks-around-headings) 🤖 Prompt for AI Agents |
||||||||||
| - [ ] physicsRegistry.spec: discovery from a test DOM, descriptor diffing, events on resize | ||||||||||
| - [ ] integration: inspector or controller subscribes and receives `registry:update` | ||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.