SUBMISSION-29: sword - #122
Open
bmaltzan wants to merge 47 commits into
Open
Conversation
bmaltzan
requested review from
DavidLFielding,
bdc34,
jweiskoff and
norbusan
as code owners
August 21, 2026 19:22
bmaltzan
force-pushed
the
SUBMISSION-29-sword
branch
from
September 2, 2026 20:27
727f5c1 to
50d87c1
Compare
Both were dropped when this branch was replayed onto the newer develop and the conflicts resolved in favour of the base: - factory.py: `backend` is not used here, and dropping it was part of the original "adjustments for sword and fastapi" commit. ruff F401. - local_ui.py: LOCAL_LOGIN was being set twice. develop already sets it, so keep that line and drop ours; both values are truthy, so no behaviour change.
Rebasing onto develop put this branch's family-of-versions work next to develop's cross-list and jref support for the first time, and the two disagree about what sharing a `doc_paper_id` means. 33 of develop's cross/jref tests failed as a result; the branch's own tests all passed, so nothing here was caught before the two met. Only `new` and `rep` rows are versions of one another. A `jref`, `wdr` or `cross` row carries the announced paper's id without joining its version chain -- each is its own domain identity with its own history -- so neither lookup that resolves "the paper's current state" may be pointed at one: - `_load` projected `family_head`, i.e. the announced `new` row, and stamped the requested id onto it. A cross-list came back as `SubmissionType.NEW` and `cross.py`'s type guard bounced every request to `/` with a 303. - `_original_submission_id` returned the lowest id sharing the paper id, which is the announced row. The first event of a save filed correctly under the jref, then the follow-on event went looking for a `jref` row under the announced id and raised `NoResultFound`. Both now consult the family only for a version-carrying row, and the `min(submission_id)` query is restricted to `new`/`rep` for the same reason. `family_head`'s docstring listed the excluded types but omitted `cross`, which is part of why this was easy to miss. The `_original_submission_id` tests passed `SimpleNamespace` stand-ins that predate the type distinction; they now carry `submission_type`, plus a case for a jref/wdr/cross keeping its own id. ./test.sh: 1541 passed, 59 skipped.
…guard
Rebasing onto develop put this branch's network guard next to develop's new
`qa` dependency. `qa`'s `IsEnglish` check detects language with ftlangdetect,
which downloads Facebook's 131MB `lid.176.bin` from dl.fbaipublicfiles.com on
first use and caches it under $FTLANG_CACHE. A fresh CI container has no cache,
so the guard failed every test that runs a metadata check -- 27 failures plus
setup errors across sword and ui.
Scoped to `download_model` rather than to the host. The guard hooks
`socket.connect`, which sees addresses after DNS -- ('13.33.67.42', 443) -- so
there is no hostname to match on, and that CDN's addresses rotate anyway. This
is the only code that reaches it, so exempting it and nothing else is what a
host allowlist would have achieved.
Costs one download per machine or CI container; every run after that is a cache
hit that makes no request. The new guard test asserts both halves -- the
download is permitted, and the guard is back afterwards, since an exemption
that stayed lifted would silently re-open the whole suite to the network.
Worth noting separately: develop's CI has been making this download on every
run for want of a cache step, and `IsEnglish` will make it in production too on
a cold Cloud Run container.
Verified with CI's own command against an empty $FTLANG_CACHE:
1539 passed, 59 skipped.
bmaltzan
force-pushed
the
SUBMISSION-29-sword
branch
2 times, most recently
from
September 3, 2026 15:00
b51f55b to
e3396e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.