Skip to content

fix: harden deploy, validate-content-rules, CSS selectors, teaching CI, and stale search#76

Merged
VatsalSy merged 6 commits into
mainfrom
fix/issues-63-64-66-67-68
Mar 20, 2026
Merged

fix: harden deploy, validate-content-rules, CSS selectors, teaching CI, and stale search#76
VatsalSy merged 6 commits into
mainfrom
fix/issues-63-64-66-67-68

Conversation

@comphy-bot

Copy link
Copy Markdown
Member

Summary

This PR fixes five open issues in one batch. Each change is isolated to its own commit and can be reviewed independently.


#63 — Harden scripts/deploy.sh strict-mode behaviour and CLI validation

  • Added 4 missing smoke-test cases to tests/deploy-script-regression.sh: missing --port value, flag-as-value for --port, missing --host value, non-numeric port.

Note: the deploy.sh argument validation already existed from prior work; this commit adds the regression tests that were specified in the acceptance criteria.


#64 — Fail fast in validate-content-rules for missing files and malformed month/year headings

  • Fixed require_file error message format.
  • Moved year-context check before month-name validity check (was masking the real error).
  • Improved all error messages to include the offending heading text.

#66 — Remove non-standard CSS selectors and lock design-token correctness

  • Replaced :has(:contains()) in command-palette.css with .command-palette-section--search-results.
  • Replaced 4 :contains("Course Schedule") rules in teaching.css with .course-schedule-heading / .schedule-container class-based selectors.
  • Fixed two wrong CSS token fallback values.

#67 — Expand teaching markdown CI gate to cover shared teaching docs

  • Added assets/images/teaching/README.md to workflow path trigger and lint commands.
  • Documented local equivalent one-liner in CLAUDE.md.

#68 — Add stale-result regression tests for async command palette search

  • Added _searchToken monotonic counter in command-palette.js to discard out-of-order async results.
  • Added tests/command-palette-stale-search.test.js with 3 behaviour-focused regression scenarios.

Test Results

  • Jest: 51/51 pass across 9 suites
  • deploy-script-regression.sh: 9/9 pass
  • validate-content-rules.sh: clean

Closes

Closes #63, closes #64, closes #66, closes #67, closes #68

comphy-bot and others added 6 commits March 20, 2026 12:03
- Test --port with no value (flag-as-value and bare missing arg)
- Test --host with no value
- Test non-numeric --port value
All new test cases exercise existing validation in deploy.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…closes #64)

- Change require_file message to "file not found: <path>" as specified
- Check year-context before validating month name (prevents masking the
  "appears before any year heading" error with an unrelated invalid-name error)
- Improve error messages to include the offending heading text and context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…loses #66)

- command-palette.css: replace non-standard :has(:contains()) with
  .command-palette-section--search-results class
- command-palette.js: set the new class when building the Search Results section
- teaching.css: replace :contains("Course Schedule") rules with
  .course-schedule-heading and .schedule-container child selectors
- teaching.css: correct two wrong CSS custom property fallback values
  (#ff6b6b→#0156b3 for --color-heading-h2, #000→#333 for --color-heading-h3)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/README.md (closes #67)

- Add assets/images/teaching/README.md to the paths trigger in
  teaching-content-checks.yml so changes to it fire the workflow
- Run both markdownlint and prettier --check against the file alongside
  the existing _teaching/**/*.md scope
- Document the local equivalent one-liner in CLAUDE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
 #68)

- Add a monotonic _searchToken counter in command-palette.js; each call
  to renderCommandResults captures the current token and the async
  SearchManager callback discards its result if the token no longer
  matches, preventing out-of-order results from overwriting fresh ones
- Expose _getSearchToken() on window for white-box testability
- Add tests/command-palette-stale-search.test.js with three behaviour-
  focused regression scenarios: stale-first resolved last, normal
  single-search flow, and stale-first resolved after current result

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0330b87cec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread assets/js/command-palette.js
@VatsalSy
VatsalSy merged commit c4d5e84 into main Mar 20, 2026
4 checks passed
@VatsalSy
VatsalSy deleted the fix/issues-63-64-66-67-68 branch March 20, 2026 14:06
comphy-bot added a commit that referenced this pull request Mar 21, 2026
- weekly-tests.yml: add content-rules parity, validate-content-rules,
  deploy regression, news-bullet/stale-search targeted tests, teaching
  markdown lint, ruby toolchain check, and jekyll build to the weekly
  schedule so maintenance guardrails from PRs #73/#76 run continuously

- tests/utils.test.js: 18 new Jest tests covering initScrollReveal
  (IO available + unavailable + no blocks), copyToClipboard (clipboard
  API, execCommand fallback, rejected clipboard, missing text, attribute
  variants), safeQuery/safeQueryAll (valid, no-match, invalid selector,
  context), and window.Utils export shape

- pr-hygiene-check.yml: new workflow that warns when a dependency/security
  PR also changes unrelated app/content files; warning-only mode, suppress
  with 'mixed-changes-ok' label, flip ENFORCE=true to hard-fail

- PR template: add checklist item requiring a regression test or linked
  follow-up issue for every accepted review finding that identifies a
  reproducible bug or edge case
VatsalSy added a commit that referenced this pull request Jun 29, 2026
fix: harden deploy, validate-content-rules, CSS selectors, teaching CI, and stale search
VatsalSy pushed a commit that referenced this pull request Jun 29, 2026
- weekly-tests.yml: add content-rules parity, validate-content-rules,
  deploy regression, news-bullet/stale-search targeted tests, teaching
  markdown lint, ruby toolchain check, and jekyll build to the weekly
  schedule so maintenance guardrails from PRs #73/#76 run continuously

- tests/utils.test.js: 18 new Jest tests covering initScrollReveal
  (IO available + unavailable + no blocks), copyToClipboard (clipboard
  API, execCommand fallback, rejected clipboard, missing text, attribute
  variants), safeQuery/safeQueryAll (valid, no-match, invalid selector,
  context), and window.Utils export shape

- pr-hygiene-check.yml: new workflow that warns when a dependency/security
  PR also changes unrelated app/content files; warning-only mode, suppress
  with 'mixed-changes-ok' label, flip ENFORCE=true to hard-fail

- PR template: add checklist item requiring a regression test or linked
  follow-up issue for every accepted review finding that identifies a
  reproducible bug or edge case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment