Skip to content

Compile the opened source file instead of a project main file - #18

Merged
DebelToni merged 2 commits into
mainfrom
fix/compile-open-file
Oct 22, 2026
Merged

DebelToni merged 2 commits into
mainfrom
fix/compile-open-file

Conversation

@SookX

@SookX SookX commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Compile the chosen open .tex file for any project editor, rather than using an owner-managed main file.
  • Remove MAIN UI and project main-file controls; retain the stored entry path only as a compatibility default for existing API clients and manuscript initialization.
  • Permit deletion of the former entry file and update the fallback automatically.
  • Add API and workspace coverage and document the optional compile filePath parameter.

Verification

  • Local lint, typecheck, frontend/backend unit tests and both builds passed (Node 24).
  • Docker compiler regression not run locally: Docker Desktop Linux engine is not running on the Desktop. CI should run it.

Draft to allow CI without triggering automatic owner review/production deployment until ready.

@SookX
SookX marked this pull request as ready for review October 22, 2026 12:09

@DebelToni DebelToni left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed all 16 changed files at 03489ed against current main 66f6c6a. Needs attention before merge.

  1. [P2] Keep the advertised legacy compile default valid (apps/server/src/project-store.ts, deleteFile fallback). The new query chooses the first text file, while Compiler.request now rejects every non-.tex root. For example, with main.tex, references.bib and standalone.tex, deleting main.tex selects references.bib; POST /compile without a body now returns 400 although a valid standalone.tex remains. This contradicts the newly documented omit-body compatibility. Choose an eligible .tex fallback and add coverage for mixed .bib/.md/.tex files. Also cover deleting the last source and subsequently creating a new .tex: the default is currently left empty, with no remaining setter to repair it.

  2. [P2] Reject the retired entryFile PATCH instead of acknowledging a no-op (apps/server/src/routes/project-routes.ts, PATCH input schema). z.object({name: optional}) strips the former entryFile key, so an existing owner client sending {entryFile: "other.tex"} receives 200/project.updated while nothing changes. Keep explicit compatibility or return a clear 400 for the retired field; add a regression test. The UI can remain per-open-file in either case.

The explicit compile path is normalized, checked against this project, included in the cache key and persisted on the job used by the worker/output lookup. Existing project write checks and snapshot admission remain in place; no dependency/workflow/security-policy or host-automation changes were found. Hosted checks passed, but these cases are not covered by the new happy-path tests. No contributor code, tests, installers or builds were executed on DGX.

@SookX

SookX commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed both review findings in 7e2d834: the legacy default now selects only text .tex files and repairs itself on add/rename/delete (including the last-source/recreate case); retired project entryFile PATCH returns explicit HTTP 400 entry_file_retired instead of a silent 200. Added API regression coverage for .bib/.md/.tex fallback, recreation, rename, and PATCH rejection. Local lint, typecheck, 157 server tests, 127 web tests, and builds passed; hosted checks are rerunning on the new head.

@DebelToni DebelToni left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-reviewed all 16 changed files at 7e2d834 against current main 66f6c6a. Thirteen files are byte-identical to the previously reviewed revision; the three additional changes were inspected in full. Both previous findings are addressed.

Legacy defaults now remain on an existing text .tex source across create/rename/delete, become empty when none exists and recover when a new .tex is added. Tests cover mixed bibliography/Markdown/TeX files, last-source deletion, recreation and renaming away from .tex. Retired entryFile PATCH requests fail clearly before name/default mutation, with a regression test.

Reviewed per-open-file UI selection/flush, explicit path normalization/project membership/write gates, entry-aware cache/coalescing keys, frozen job entry passed through fake/real worker output and PDF handling, deletion behavior, API documentation and preservation of content/agent authorization. No dependency, workflow, review/security-policy or host-automation changes. Exact-head hosted test/analyze and CodeQL passed. No contributor code, tests, installers or builds executed on DGX. No remaining blocking findings.

@DebelToni
DebelToni merged commit e6b0484 into main Oct 22, 2026
3 checks passed
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.

2 participants