Skip to content

MathType Artifact Browser Smoke

Scope

make test-mathtype-artifact-browser-local-postgres proves the non-default Teacher MathType to Word Equation candidate end to end. It creates disposable PostgreSQL databases for IAM, Document, and Import, starts fresh loopback instances of IAM, document-service, docx-import-service, API Gateway, and Teacher Web, then removes the whole runtime on exit.

The proof uses the read-only Go Formula runtime at http://127.0.0.1:8095 unless GO_FORMULA_DOCX_URL is supplied. It never changes the default Gateway route table, legacy source, or a shared database.

Run

bash
MATHTYPE_ARTIFACT_BROWSER_LOCAL_POSTGRES_CONFIRM=local-postgres \
  HOCTAPAZ_DOCX_CORPUS_DIR=/Users/velikho/Desktop/test-hoctapaz \
  make test-mathtype-artifact-browser-local-postgres

The harness selects the Math DOCX by normalized filename (MON TOAN) or uses HOCTAPAZ_MATHTYPE_BROWSER_FIXTURE when an explicit fixture is required. It copies those bytes to an ASCII filename only for browser download-header stability; conversion input remains the real corpus bytes.

Browser Assertions

The Playwright runner opens:

text
/teacher/exams/mathtype-word-equation?teacherExamUtilityGateway=native

It uses only visible Teacher UI controls and verifies Gateway headers for:

  1. POST /api/teacher/import-sources as teacher-import-source-upload and native_write, with the returned sourceAssetId and sourceKind=mathtype-equation.
  2. POST /api/exam-import/mathtype/jobs as exam-import-mathtype-create and native_write, carrying the opaque asset id and no raw storageKey.
  3. Timer-driven GET /api/exam-import/jobs/{id} as exam-import-job-detail and native_read. The UI accepts the native raw job detail as well as the usual { data } envelope so completion exposes the download control.
  4. GET /api/exam-import/mathtype/jobs/{id}/download as exam-import-mathtype-download and native_read, with DOCX attachment headers, a browser download event, and saved ZIP bytes.

The harness also registers a second Teacher in the same organization and requires 404 MATHTYPE_JOB_NOT_FOUND for that actor's download and reprocess. It posts a raw storageKey through the candidate Gateway and requires 400 MATHTYPE_SOURCE_REQUIRED.

Structural Result

The successful local recheck on 2026-07-15 wrote:

output/qa/mathtype-artifact-browser-local-postgres-20260715114359/

Its downloaded artifact was a 489,407-byte DOCX with these structural counts:

MetricSourceDownloaded Word Equation DOCX
word/document.xml w:object19881
word/document.xml m:oMath10127
Deterministic converted formulas-117
Unresolved formulas-0

unzip -t passed. The job detail held only opaque generated-artifact metadata and its scoped download API, never a storage key. The Teacher completion screen is captured at:

output/qa/mathtype-artifact-browser-local-postgres-20260715114359/browser/completed-before-download.png

This is candidate-route local evidence. It does not establish Microsoft Word visual equivalence, billing/usage settlement, public/default-route promotion, or a persistent deployment claim. Nineteen linear-OMML fallback warnings remain review-required in the job result.

Go-platform documentation is generated from repository Markdown.