Skip to content

feat(demo): world-file fitting demo with contrast presets and GitHub Pages deploy - #6

Merged
kochizufan merged 5 commits into
train/2026-12from
dec26/m1-t11d-demo
Oct 27, 2026
Merged

kochizufan merged 5 commits into
train/2026-12from
dec26/m1-t11d-demo

Conversation

@kochizufan

Copy link
Copy Markdown
Member

Summary

  • pnpm run dev opens a demo portal (index.html) and demo/worldfile-fit.html. The same pages are built for GitHub Pages by the new deploy.yml on pushes to master (base /Daedalus/).
  • The page shows the input (pixel board with v axis up; planar metre board near Kyoto Station, JGD2011 / Plane Rectangular CS VI) and the output of fitWorldFile: adopted model, the six world-file values (with the similarity shape note), residual arrows with their magnification, F against its critical value (log-scale bars; F = ∞ is spelled out), similarity/affine SSE, warnings with a one-line explanation each, qualityGate, status, rmsMeters, and the package version.
  • Preset buttons load GCP sets whose results clearly differ:
    • similarity map vs. the same points with a horizontal shear (similarity vs. affine, F ≈ 0.15 vs. ≈ 1×10⁵ against 6.94)
    • 2 / 3 / 5 points (preview / adoptable without affine / affine evaluated)
    • spread vs. nearly collinear points (only the latter warns nearCollinearSource and skips affine)
    • correct points vs. one point moved ~75 m (RMS 0.42 m → 30 m, gate stays adoptable, point 3 has the longest residual)
  • Pixel markers can be dragged; releasing recomputes once.
  • src is unchanged. The demo imports src directly. vite and jsdom are devDependencies only (no dependencies key).

Tests

  • tests/demo-presets.test.ts: calls the real fitWorldFile with every preset and checks each contrast splits as promised (properties, not baked numbers).
  • tests/demo-wiring.test.ts (jsdom, injected fake fit, getContext not stubbed): each preset button calls fit exactly once with the preset GCPs and fills the outputs; drag recomputes once on release; F text/bars for finite, infinite and missing F; version footer; errors are shown without throwing; number formatting and arrow magnification helpers.
  • scripts/verify-demo-pages-build.mjs (pnpm run verify:demo): both pages exist, assets resolve under /Daedalus/assets/, no redirect stub / service worker shim / COOP-COEP.

Local: pnpm run test (73 passed), typecheck, build, test:types, verify:demo all exit 0.

Notes

  • The Pages deploy runs only on master, so it is first exercised after this branch reaches master.
  • Actions in deploy.yml are pinned to commit SHAs; the workflow defaults to contents: read and only the deploy job gets pages: write / id-token: write.

🤖 Generated with Claude Code

kochizufan and others added 5 commits October 27, 2026 17:01
`pnpm run dev` now opens a demo portal and a fitting page that show the
input GCPs (pixel board, v axis up; planar metre board near Kyoto) and the
output: adopted model, the six world-file values, residual arrows, the F
test against its critical value, similarity/affine SSE and warnings.

Preset buttons load GCP sets whose results clearly differ: similarity vs
sheared map, 2/3/5 points, spread vs nearly collinear points, and one wrong
point. The presets live in demo/presets.js and are shared with the tests,
which call the real fitWorldFile from src and check that each pair splits.

vite and jsdom are devDependencies only; the demo imports src directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test.yml now also runs verify:demo, and its header note describes the demo
and deploy.yml instead of saying there is none. The new deploy.yml builds the
same demo on pushes to master and publishes dist-demo; actions are pinned to
commit SHAs, the workflow defaults to contents: read and only the deploy job
gets pages: write and id-token: write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstall on every PR

pnpm 11 makes strictDepBuilds the default, so a clean
pnpm install --frozen-lockfile with lifecycle scripts enabled stops with
ERR_PNPM_IGNORED_BUILDS for esbuild. Keep the allowBuilds list in
ci/pnpm-workspace.ci.yaml and copy it to pnpm-workspace.yaml right before
the install in deploy.yml. A new CI job repeats the same install so the
deploy path is exercised before it reaches master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ty gate measures

Moving a point by hand changes the input, so the pressed preset button
and its expectation line no longer describe it. Release the button and
replace the line once a point actually moves; a click without moving
keeps the preset.

Say next to the quality gate that adoptable is decided by the number of
points and does not look at the size of the errors, and bind the wrong
point's gate to the correct one's in the preset tests, since the
expectation line and both READMEs rely on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kochizufan
kochizufan marked this pull request as ready for review October 27, 2026 10:05
@kochizufan
kochizufan merged commit a6ba04c into train/2026-12 Oct 27, 2026
5 checks passed
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