Skip to content

feat: add reconnectable Gloss executor service - #2

Merged
SunChJ merged 5 commits into
mainfrom
codex/gloss-service-boundary
Jul 22, 2026
Merged

feat: add reconnectable Gloss executor service#2
SunChJ merged 5 commits into
mainfrom
codex/gloss-service-boundary

Conversation

@SunChJ

@SunChJ SunChJ commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Why

Move the long-lived PDF execution boundary into the Gloss-maintained BabelDOC runtime so the macOS app can reconnect, inspect status, and cancel the intended task without depending on Python internals.

What

  • add an authenticated loopback service on an ephemeral port with a private ready handshake and runtime identity
  • retain reconnectable execution snapshots and sequenced NDJSON events with explicit cursor/replay handling
  • make task creation idempotent, enforce one active PDF worker, and add targeted cancellation plus controlled drain/shutdown
  • isolate workers in process groups, escalate cancellation with bounded cleanup, and clean descendants after parent loss
  • validate request limits, requested output modes, and generated PDF/glossary files inside each task output directory
  • canonicalize request paths behind a separator-bounded workroot guard, including traversal, prefix-confusion, symlink, and NUL rejection
  • replace request-derived watermark subprocess commands with a fixed, allowlisted spawned-process dispatcher
  • document the v1 contract and release the downstream runtime as 0.6.4+gloss.2
  • extend clean-wheel Linux/macOS CI to import the real adapter and start/probe/stop the packaged service

Scope

  • Gloss still owns the multi-file queue; this service deliberately admits one PDF execution at a time.
  • The existing babeldoc CLI remains available during client migration.
  • This PR does not include font caching, layout-IR caching, or PDF-save performance work.

Validation

  • uv run pytest -q — 110 passed
  • uv run ruff check .
  • Ruff format check for all changed Python files
  • git diff --check
  • uv lock --check
  • production runner smoke: forkserver warmup, authenticated health/runtime, controlled shutdown
  • isolated clean-wheel smoke: adapter imported from site-packages, fake service ready/health/shutdown
  • GitHub CI: quality/PDF smoke, Linux/macOS wheel smoke, CodeQL Python/actions analysis, and CodeQL code scanning all passed

Comment thread babeldoc/tools/executor/server.py Fixed
Comment thread babeldoc/tools/executor/server.py Fixed
@SunChJ
SunChJ marked this pull request as ready for review July 22, 2026 10:48
@SunChJ
SunChJ merged commit cee58be into main Jul 22, 2026
6 checks passed
@SunChJ
SunChJ deleted the codex/gloss-service-boundary branch July 22, 2026 11:43
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