Skip to content

htaccess test harness: Windows Git Bash fix + live/origin resolution checks - #49

Open
stevenchalem wants to merge 6 commits into
mainfrom
stevenchalem/htaccess-test-windows-fix
Open

htaccess test harness: Windows Git Bash fix + live/origin resolution checks#49
stevenchalem wants to merge 6 commits into
mainfrom
stevenchalem/htaccess-test-windows-fix

Conversation

@stevenchalem

@stevenchalem stevenchalem commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This branch started as a Windows Git Bash fix for run-tests.sh and grew to add a live resolution harness that covers the failure mode behind the /gistCore.rdf incident.

1. Windows / Git Bash fix for run-tests.sh

Problem: on Windows under Git Bash, all 17 routing tests returned 404 / Location = <none> — the rewrite rules never fired. MSYS POSIX-path conversion rewrote the container-side bind-mount target /usr/local/apache2/htdocs/.htaccess into a Windows path, so the .htaccess mounted nowhere Apache looks and no rules loaded.

Fix: on MSYS/MINGW/Cygwin, export MSYS_NO_PATHCONV=1 and translate the host path with cygpath -m for the docker calls (Linux/macOS unchanged); resolve HTACCESS to an absolute path up front (Docker bind mounts require it); README gains a Windows/Git Bash note. Tests also updated to match current rewrite behavior.

2. New check-live-deref.sh — whole-ontology resolution checks

run-tests.sh asserts the redirect target (Location), not that the target resolves — the exact gap behind the /gistCore.rdf incident, where the redirect fired correctly but the destination on ontologies.semanticarts.com 404'd. This script verifies the whole-ontology files actually exist and resolve, in two modes:

  • MODE=targets (pre-deploy) — requests each origin file directly on ontologies.semanticarts.com (gistCore.{rdf,ttl,jsonld}, the versioned control, and the WIDOCO docs) and asserts a 200 that parses. Answers "do the destinations the new rules will point at exist yet?" before deploying.
  • MODE=deref (default, post-deploy) — hits the real w3id.org IRIs, follows every redirect to a final 200, and validates the body per negotiated format.

Both pair the unversioned alias with the versioned file as a control and flag the exact SIGNATURE unversioned latest alias missing on ontologies.semanticarts.com when the alias is gone but the version resolves — distinct from a generic rule break. Body validation uses rdflib/jq when present (degrades to a warning, never a false fail; picks a Python that actually has rdflib, incl. the Windows py launcher, with a PYTHON override). Network-unreachable cases WARN rather than FAIL.

3. Docs

README restructured around the two tools with a pre-deploy → deploy → post-deploy workflow. Adds .markdownlint.json (MD024: siblings_only) so the intentional parallel sub-headings don't trip the linter.

Verification

All suites green on a Windows host:

  • run-tests.sh17/17
  • check-live-deref.sh MODE=targets7/7, 0 warnings
  • check-live-deref.sh (deref) — 9/9, 0 warnings

The alias-missing SIGNATURE path was verified against a local mock (versioned 200, unversioned 404 → flagged, exit 1). This also confirmed the original /gistCore.rdf incident is currently resolved (all aliases resolve and parse).

Generated with Claude Code (Semantic Arts)

MSYS path conversion rewrote the container-side bind-mount target
(/usr/local/apache2/htdocs/.htaccess) into a Windows path, so the file
mounted nowhere Apache looks and every request 404'd. Disable the
conversion (MSYS_NO_PATHCONV=1) and translate the host path with cygpath
for the docker calls on MSYS/MINGW/Cygwin shells. Also resolve HTACCESS
to an absolute path so a relative value works, and document the quirk
plus the correct ../w3id.org/semanticarts/.htaccess path.

Generated with Claude Code (Semantic Arts)
w3id.org commit "Fix ontology file rewrite rules" broadened the
whole-ontology conneg rules from ^ontology/([^/]+) to a greedy ^(.+),
so redirect targets now preserve the full request path (including the
leading ontology/ segment) and the old 302 catch-all pass-through was
disabled. Update the 7 affected expectations: whole-ontology targets
keep the ontology/ segment, and the catch-all now asserts a 303 to a
.ttl on the SA server (path preserved) instead of a 302 pass-through.

Generated with Claude Code (Semantic Arts)
check-live-deref.sh hits the real w3id.org IRIs, follows redirects to
completion, and asserts a final 200 whose body parses in the negotiated
format. Unlike run-tests.sh (first hop only, offline), this catches the
/gistCore.rdf incident: the redirect fired fine but the unversioned
"latest" alias 404'd on ontologies.semanticarts.com. Pairs each
unversioned case with the versioned pass-through as a control and flags
the exact alias-missing signature. Body validators (rdflib/jq) are
optional; network-unreachable cases WARN rather than FAIL.

Generated with Claude Code (Semantic Arts)
The detector picked the first `python`/`python3` on PATH even when it
lacked rdflib, silently skipping body validation. Now it probes python3,
python, and the Windows `py` launcher and keeps the first that can
`import rdflib`, and honors an explicit PYTHON override for when several
interpreters coexist (e.g. MSYS2 python vs a native C:\Python install).

Generated with Claude Code (Semantic Arts)
The live-deref section was wedged between run-tests.sh's own sections,
leaving the intro and "What it checks"/Requirements/Run implicitly about
run-tests.sh only. Reorganize into two peer sections — run-tests.sh
(offline routing, pre-deploy) and check-live-deref.sh (live resolution,
post-deploy) — with a shared intro and a pre-deploy -> deploy ->
post-deploy narrative. Add a .markdownlint.json with MD024 siblings_only
so the intentional parallel sub-headings don't trip the linter.

Generated with Claude Code (Semantic Arts)
Nothing verified that the whole-ontology files the new .htaccess will
redirect to actually exist on the origin BEFORE deploying — the exact gap
behind the /gistCore.rdf incident (run-tests.sh checks only the redirect
hop; its CHECK_TARGETS only checks per-term Pages files).

MODE=targets requests each origin file directly on
ontologies.semanticarts.com (unversioned gistCore.{rdf,ttl,jsonld} + the
versioned control + the WIDOCO docs) and asserts a 200 that parses,
reusing the existing body-validation and alias-missing signature logic.
The signature now prints pre-deploy guidance ("publish it BEFORE
deploying"). MODE=deref (default) is unchanged. The HTML case is bucketed
"none" so a docs 404 no longer trips the alias signature.

Generated with Claude Code (Semantic Arts)
@stevenchalem stevenchalem changed the title Fix htaccess test harness under Windows Git Bash htaccess test harness: Windows Git Bash fix + live/origin resolution checks Jul 15, 2026
@stevenchalem
stevenchalem requested a review from Jamie-SA July 15, 2026 21:10
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