Skip to content

Conversation

@Data-Wise
Copy link
Owner

@Data-Wise Data-Wise commented Feb 10, 2026

Summary

  • Pure ZSH state machine (_check_math_blanks) for display math validation
  • Detects blank lines inside $$ blocks (breaks Quarto PDF rendering)
  • Detects unclosed $$ blocks (breaks all rendering)
  • CI mode blocks deploy on math issues; interactive mode warns only
  • Pre-commit gate via lint-staged catches .qmd math issues at commit time
  • Quality Gates documentation maps every validation layer

Changes

Core

  • lib/dispatchers/teach-deploy-enhanced.zsh_check_math_blanks() function + deploy preflight integration
  • scripts/check-math.zsh — standalone wrapper for lint-staged pre-commit hook
  • package.json*.qmd lint-staged entry

Documentation

  • docs/guides/QUALITY-GATES.md — new comprehensive quality gates reference
  • docs/guides/TEACH-DEPLOY-GUIDE.md — pre-commit cross-reference admonition
  • docs/reference/REFCARD-DEPLOY-V2.md — deploy refcard updates
  • docs/reference/MASTER-API-REFERENCE.md — API reference updates
  • mkdocs.yml — Quality Gates nav entry
  • CLAUDE.md — test count 137→143, scripts/ dir, deploy preflight mention

Tests

  • 41 new tests across 3 suites (unit, E2E with sandboxed repos, dogfood against demo course)

Test plan

  • 13 unit tests — state machine edge cases (blanks, unclosed, padded delimiters, inline $$)
  • 13 E2E tests — full preflight in sandboxed git repos with bare remotes
  • 15 dogfood tests — real plugin loaded against demo course fixture
  • 58 existing deploy v2 tests still passing
  • Pre-commit E2E — staged broken .qmd blocked by lint-staged, clean files pass
  • mkdocs build --strict — no new warnings
  • GitHub CI: SUCCESS

🤖 Generated with Claude Code

Data-Wise pushed a commit that referenced this pull request Feb 10, 2026
…etection

Address all 5 issues from PR #368 code review:
- Replace inline Python with native ZSH state machine (_check_math_blanks)
- Fix path resolution using git rev-parse --show-toplevel
- Add ci_mode handling (return 1 to block deploy)
- Remove reference to nonexistent scripts/fix-math-blanks.sh
- Add unclosed $$ block detection (return code 2)
- Add 13-case unit test suite (test-math-blanks-unit.zsh)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pure ZSH state machine that detects blank lines and unclosed $$ blocks
in .qmd files during deploy preflight. Replaces inline Python dependency.

- _check_math_blanks: returns 0 (clean), 1 (blank line), 2 (unclosed)
- Path resolution via git rev-parse --show-toplevel
- CI mode blocks deploy on math issues; interactive mode warns only
- Actionable fix messages (no reference to nonexistent scripts)
- 41 tests: 13 unit, 13 E2E (sandboxed git repos), 15 dogfood (demo course)
- Docs: deploy guide, refcard, API reference updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise force-pushed the feature/math-blanks-preflight branch from 607c013 to ee4b2a1 Compare February 10, 2026 17:19
@Data-Wise Data-Wise changed the title feat(deploy): math blank-line preflight check feat(deploy): add display math preflight validation Feb 10, 2026
Test User and others added 3 commits February 10, 2026 10:41
- Declare _line and _stripped as local in _check_math_blanks
- Move _abs_path and _qmd_file declarations before loop body
- Print "[ok] Display math blocks valid" even when no .qmd files changed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire _check_math_blanks into the pre-commit hook so display-math
issues (blank lines in $$ blocks, unclosed $$ blocks) are caught at
commit time, not just deploy time.

- scripts/check-math.zsh: standalone wrapper for lint-staged
- package.json: add *.qmd lint-staged entry
- docs/guides/QUALITY-GATES.md: comprehensive validation layer docs
- mkdocs.yml: add Quality Gates nav entry
- TEACH-DEPLOY-GUIDE.md: cross-reference to pre-commit gate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test file count 137 → 143
- Add scripts/ dir and check-math.zsh to project structure
- Add deploy preflight mention to teaching subcommands
- Update last-updated date

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise changed the title feat(deploy): add display math preflight validation feat(deploy): display math preflight + pre-commit validation Feb 10, 2026
@Data-Wise Data-Wise merged commit eb2f812 into dev Feb 10, 2026
1 check passed
Data-Wise added a commit that referenced this pull request Feb 10, 2026
* chore: update .STATUS for v6.6.0 release session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(deploy): display math preflight + pre-commit validation (#368)

* feat(deploy): add display math preflight validation

Pure ZSH state machine that detects blank lines and unclosed $$ blocks
in .qmd files during deploy preflight. Replaces inline Python dependency.

- _check_math_blanks: returns 0 (clean), 1 (blank line), 2 (unclosed)
- Path resolution via git rev-parse --show-toplevel
- CI mode blocks deploy on math issues; interactive mode warns only
- Actionable fix messages (no reference to nonexistent scripts)
- 41 tests: 13 unit, 13 E2E (sandboxed git repos), 15 dogfood (demo course)
- Docs: deploy guide, refcard, API reference updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(deploy): declare loop vars local, add status line for no-qmd case

- Declare _line and _stripped as local in _check_math_blanks
- Move _abs_path and _qmd_file declarations before loop body
- Print "[ok] Display math blocks valid" even when no .qmd files changed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(preflight): add pre-commit math validation via lint-staged

Wire _check_math_blanks into the pre-commit hook so display-math
issues (blank lines in $$ blocks, unclosed $$ blocks) are caught at
commit time, not just deploy time.

- scripts/check-math.zsh: standalone wrapper for lint-staged
- package.json: add *.qmd lint-staged entry
- docs/guides/QUALITY-GATES.md: comprehensive validation layer docs
- mkdocs.yml: add Quality Gates nav entry
- TEACH-DEPLOY-GUIDE.md: cross-reference to pre-commit gate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update CLAUDE.md for math preflight feature

- Test file count 137 → 143
- Add scripts/ dir and check-math.zsh to project structure
- Add deploy preflight mention to teaching subcommands
- Update last-updated date

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* chore: release v6.7.0 — Math Preflight + Quality Gates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Data-Wise added a commit that referenced this pull request Feb 10, 2026
* chore: update .STATUS for v6.6.0 release session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(deploy): display math preflight + pre-commit validation (#368)

* feat(deploy): add display math preflight validation

Pure ZSH state machine that detects blank lines and unclosed $$ blocks
in .qmd files during deploy preflight. Replaces inline Python dependency.

- _check_math_blanks: returns 0 (clean), 1 (blank line), 2 (unclosed)
- Path resolution via git rev-parse --show-toplevel
- CI mode blocks deploy on math issues; interactive mode warns only
- Actionable fix messages (no reference to nonexistent scripts)
- 41 tests: 13 unit, 13 E2E (sandboxed git repos), 15 dogfood (demo course)
- Docs: deploy guide, refcard, API reference updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(deploy): declare loop vars local, add status line for no-qmd case

- Declare _line and _stripped as local in _check_math_blanks
- Move _abs_path and _qmd_file declarations before loop body
- Print "[ok] Display math blocks valid" even when no .qmd files changed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(preflight): add pre-commit math validation via lint-staged

Wire _check_math_blanks into the pre-commit hook so display-math
issues (blank lines in $$ blocks, unclosed $$ blocks) are caught at
commit time, not just deploy time.

- scripts/check-math.zsh: standalone wrapper for lint-staged
- package.json: add *.qmd lint-staged entry
- docs/guides/QUALITY-GATES.md: comprehensive validation layer docs
- mkdocs.yml: add Quality Gates nav entry
- TEACH-DEPLOY-GUIDE.md: cross-reference to pre-commit gate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update CLAUDE.md for math preflight feature

- Test file count 137 → 143
- Add scripts/ dir and check-math.zsh to project structure
- Add deploy preflight mention to teaching subcommands
- Update last-updated date

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* chore: release v6.7.0 — Math Preflight + Quality Gates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update What's New callout for v6.7.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise deleted the feature/math-blanks-preflight branch February 10, 2026 18:51
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