7 Commits

Author SHA1 Message Date
tiennm99 f51306add1 v0.0.4.0 feat(module-2): tam giác đồng dạng (lớp 8, scale slider) (#4)
* feat(component): similarity-scale slider controller

Single-slider similarity demo for Module 2. Fixed △ABC, scaled △A'B'C' computed
each frame as `centroid_target + k · (vertex − centroid_ABC)` for k ∈ [0.5, 2].
The slider's input event is the only event listener — no Pointer Events here
(we're not dragging vertices in this MVP). AbortController teardown on
astro:before-swap as before.

The renderTicks helper is duplicated from congruence-sss.ts for now — when
Module 4 lands we'll factor it out into a shared module. Premature
abstraction would force a circular import structure for one helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(module-2): tam giác đồng dạng (lớp 8) with scale slider

Page at /lop-8/tam-giac-dong-dang/. △ABC fixed on the left at scalene scale-72.8 / 83.2 / 93.4 sides. △A'B'C' is the runtime scaled image, controlled by a
single range input k ∈ [0.5, 2] step 0.05.

Live readout table shows all six side lengths and all three ratios. The killer
moment: drag the slider, watch all 3 ratios stay numerically equal to each
other (= 1/k). That equality IS the definition of similarity, made visible.

Tick marks per Decision D3: 1/2/3 ticks color-paired (#D7263D / #1B998B /
#F46036). Triangle 1 ticks rendered once on mount; triangle 2 ticks redrawn
on every slider input.

Hub: lớp 8 card flips to live status. All 3 grade cards now active —
the autoplan 3-module hero set is complete.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: VERSION 0.0.4.0 + CHANGELOG + TODOS update

v0.0.4.0 = scaffold + Module 3 (góc nội tiếp) + Module 1 (tam giác bằng nhau)
+ Module 2 (tam giác đồng dạng). All three MVP modules from autoplan now live.

Move 2 P1 items to Completed (scale slider, ratio readout) and reduce Module 2
remaining items to P2 (free-drag mode) + P3 (numeric angle readouts).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:25:08 +07:00
tiennm99 638af314ea v0.0.3.0 feat(module-1): drag-to-explore tam giác bằng nhau (lớp 7, SSS) (#3)
* feat(geom-engine): triangle module + position-strict congruentSSS

Third pure module under src/geom-engine/. Adds Triangle type, sides() (returns
named AB / BC / CA lengths), and congruentSSS() with position-strict semantics:
labels define the correspondence (AB↔A'B', BC↔B'C', CA↔C'A'), permuted matches
are NOT counted as congruent. This preserves SGK pedagogy where the labels and
the matched-pair encoding (color + tick marks) carry meaning.

10 new unit tests: identical, translated-congruent, similar-not-congruent (2x scale),
shape-different, EPSILON_LEN tolerance (within and just outside), label-permutation
rejection, and symmetry of the relation.

Total tests: 29 → 39.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(module-1): drag-to-explore tam giác bằng nhau (lớp 7, SSS)

Second interactive theorem demo. Page at /lop-7/tam-giac-bang-nhau/.

Component: src/components/congruence-sss.ts owns 6 draggable vertices (3 per
triangle), each independently captured via setPointerCapture per vertex.
Drag-clamping (16px viewBox padding) keeps every vertex on-screen.

Encoding per autoplan Decision D3 (a11y + SGK-correct in one move):
  AB / A'B' → pair1 #D7263D + 1 tick
  BC / B'C' → pair2 #1B998B + 2 ticks
  CA / C'A' → pair3 #F46036 + 3 ticks
Tick marks are SVG line segments perpendicular to each side at the midpoint,
spaced 5 viewBox-units apart for multi-tick. Redrawn live during drag.

Page: viewBox 400x300 (4:3, side-by-side triangles), single 6KB page including
inline JS bundle (entire geom-engine + canvas controller, minified).

Live side-length readout table + green badge "Hai tam giác bằng nhau (c.c.c)"
that appears when SSS condition holds within EPSILON_LEN. Badge has
role="status" + aria-live="polite" so screen readers announce the moment the
triangles become congruent.

Rigid-motion overlay animation EXPLICITLY DROPPED per autoplan — color+tick
match is the success state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(hub): activate lớp 7 card linking to tam giác bằng nhau module

Status flips from sap-ra-mat to live; href points at the new module.
i18n/vi.ts gains module1.* strings (intro, instruction, theorem, example,
SGK-aligned theorem statement) so every user-facing string still routes
through t() — adding English in the future is one en.ts file away.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: VERSION 0.0.3.0 + CHANGELOG + TODOS update

v0.0.3.0 = scaffold + Module 3 (góc nội tiếp) + Module 1 (tam giác bằng nhau).
2 of 3 MVP modules now live. Module 2 (tam giác đồng dạng) is next.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: TODOS Module 1 reflects v0.0.3.0 (SSS shipped)

Original P1 items "SSS detector" + "SGK tick-mark encoding" already moved to
Completed in the previous commit. Replace the still-pending M1 section with
the actual remaining work: P2 toggles for SAS/ASA/AAS/cạnh huyền cases, P3 for
extra examples.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:17:26 +07:00
tiennm99 bc3df68e5b v0.0.2.0 feat(module-3): drag-to-explore góc nội tiếp (lớp 9) (#2)
* chore: ignore .gstack/ deploy reports

/land-and-deploy writes per-deploy artifacts to .gstack/deploy-reports/. Those
shouldn't enter the repo. Captured here so future runs don't surface stale diffs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(geom-engine): circle module + inscribed-angle invariance test

Add the second pure module per autoplan eng decision E1: src/geom-engine/circle.ts
with circle(), pointOnCircle(), projectToCircle() (snap-to-circle for Module 3 drag),
and angleAtVertex() (clamped against IEEE-754 drift to prevent acos NaN at exactly
collinear angles).

The killer-demo property test pins the inscribed-angle theorem as a CI gate: pick
two fixed points A and B on a unit circle, sample 7 different M positions on the
major arc, and assert all sampled inscribed angles AMB stay within 0.5° of the
reference. If this test ever fails, Module 3's central premise is broken.

13 new unit tests, total 29 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(module-3): drag-to-explore góc nội tiếp page (lớp 9)

Ship the first interactive theorem demo. Page lives at /lop-9/goc-noi-tiep/.

Component: src/components/inscribed-angle.ts wires Pointer Events +
setPointerCapture per autoplan eng decision E1. Drag M; on every pointermove,
project the pointer to the circle (M = center + r·normalize(pointer − center))
so M never escapes the circle. Live readouts: ∠AMB at M (inscribed, pair1 red),
∠AOB at center O (central, pair2 teal). All listeners use AbortController
keyed on astro:before-swap so view-transition navigation doesn't leak.

Page: src/pages/lop-9/goc-noi-tiep.astro holds the SVG canvas (viewBox 400x400,
touch-action: none scoped to canvas), theorem panel, and one worked example
walking the 120°/60° canonical case. Astro bundles the script inline so the
single page ships ~7KB total (including the entire geom-engine + component).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(hub): link lớp 9 card to góc nội tiếp module

Hub landing page now branches each grade card on grade.href:
- live cards render as <a> with hover affordance (lớp 9 only, for now)
- coming-soon cards stay as <li> with opacity 0.7 and "Sắp ra mắt" badge

Status taxonomy extended: 'sap-ra-mat' | 'live' so future modules just flip the
status when their page ships.

i18n/vi.ts gains module3.* (intro, theorem, example, instruction copy) plus a new
'live' status string ("Khám phá") so every user-facing string stays inside vi.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: VERSION 0.0.2.0 + CHANGELOG entry

First feature release. v0.0.2.0 = scaffold + Module 3 góc nội tiếp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: mark TODOS items completed by v0.0.2.0

- Drag M with circle constraint → DONE in src/components/inscribed-angle.ts
- TheoremCanvas primitive first cut → DONE (built directly in Astro)
- Theorem panel + worked examples → PARTIAL (1 of 3 examples shipped)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:03:34 +07:00
tiennm99 c5388349c0 v0.0.1.0 chore: scaffold Hình Học Sống (Astro + GitHub Pages) (#1)
* chore: add gstack skill routing rules to CLAUDE.md

Append a "## Skill routing" section so future Claude Code sessions in this repo route
each task through the matching gstack skill (e.g., /investigate for bugs, /ship for PRs,
/office-hours for product brainstorming).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: scaffold Astro 5 + TypeScript strict with base /try-gstack/

Initialize the project per the autoplan-locked decisions:
- Astro 5 SSG, output static, base path /try-gstack/ for GitHub Pages subdirectory hosting
- TypeScript strict (Astro's strict tsconfig + path alias ~/* -> src/*)
- @astrojs/sitemap for SEO meta
- bun as the package manager (lockfile committed)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: Vietnamese landing page with Be Vietnam Pro + i18n stub

Implement the locked design decisions D2 (typography) and D3 (palette) plus the i18n
discipline from autoplan eng review:
- Be Vietnam Pro single family (woff2, weights 400/500/700, vietnamese subset) self-hosted
  via @fontsource so KaTeX/CDN-blocking ISPs cannot break the page
- font-feature-settings: "kern", "locl" for proper VN diacritic positioning
- 17px body / 1.6 line-height / max-w-prose 56ch (denser than English)
- 3-color SGK-aligned palette in tailwind config: pair1 #D7263D, pair2 #1B998B, pair3 #F46036
- BaseLayout with lang="vi", canonical URL, OpenGraph (vi_VN), X-Frame-Options DENY
- src/i18n/vi.ts holds every user-facing string; t() helper resolves the active locale.
  Adding English later means adding en.ts; no string churn through templates.
- Landing page lists three grade cards with "Sắp ra mắt" status (modules ship later)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: bootstrap Vitest with pure geom-engine vec module

Establish the math-engine boundary and test discipline from autoplan eng decision E2:
- src/geom-engine/ is pure (no DOM imports allowed); first module is vec.ts
- Vec2 helpers: vec, add, sub, scale, dot, len, dist, normalize, approxEqualLen
- EPSILON_LEN=0.5 viewBox units justified vs ~4px human drag precision
- scale() normalizes IEEE-754 -0 back to +0 so consumers don't see signed-zero ghosts
- Vitest config gates the module at 95% line/function/statement, 90% branch
- 16 unit tests covering commutativity, mutation safety, orthogonality, normalization,
  and EPSILON tolerance behavior

Property tests via fast-check come with the first canvas module; this commit establishes
the test scaffold so adding them later is one dependency away.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: GitHub Actions test workflow + Pages deploy via deploy-pages@v4

Wire the autoplan-locked CI/CD pipeline (decision E3) for GitHub Pages hosting:
- ci.yml: typecheck + tests + build on every PR and push to main
- deploy.yml: build + actions/deploy-pages@v4 on push to main, concurrency-grouped
  so a force-push retry doesn't abort an in-flight rollback
- Build env pins SITE_URL=https://tiennm99.github.io and SITE_BASE=/try-gstack so
  astro.config.mjs produces correct canonical/OG URLs against the subdirectory host
- bun 1.3.13 pinned for both workflows

Lighthouse-CI + size-limit gates deferred until the first canvas module ships
(no JS bundle to budget yet — current pages are zero-JS).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: VERSION 0.0.1.0 + CHANGELOG + RUNBOOK + README rewrite

Initial 4-digit gstack version (matches package.json), changelog entry for the scaffold,
operations runbook covering rollback and the deferred .vn domain trigger (500 sessions/30d
OR 1 organic teacher share OR 5+ modules shipped). README rewritten as the project README
for Hình Học Sống with the locked architectural decisions visible to teammates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: TODOS.md tracking deferred autoplan items

Capture the deferred work surfaced by the /office-hours + /autoplan reviews so the
backlog is visible to teammates and bisectable from the source-of-truth design doc.
Organized by component (Phase 0 distribution, TheoremCanvas, Module 3/1/2, testing
infrastructure, retention, domain) then priority P0–P4. Per the gstack TODOS.md
format conventions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 23:43:37 +07:00
tiennm99 adeeb70e64 chore: add Apache-2.0 license 2026-04-29 21:33:27 +07:00
tiennm99 b70a1c776d Add CLAUDE.md so teammates pick up gstack
Documents the one-time install steps, the /browse-only browsing policy,
and lists the available gstack slash commands so a Claude Code session
in this repo has the convention loaded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:08:07 +07:00
tiennm99 c745bbe560 Initial commit: sandbox for trying gstack
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:31:32 +07:00