Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specs/001-pathway-pdfs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Cases).
The release's folder of PDFs, one `BookPdf` per human top-level pathway (FR-001), named
as today's (the pathway's name and `.pdf`). A name a file system cannot hold (holding
`/` or NUL, or longer than 255 bytes with `.pdf`), or two names equal ignoring case, is a preflight fault `bad-file-name
<stId>`; none of today's does.
<stId>`. Whether any of today's names does is not yet measured; T024's preflight will say.

In the code (`src/model/types.ts`), a book's PDF and a single event's PDF are one
`Document` with `kind: 'book' | 'single'`; its `places` hold the pathway's tree in
Expand Down
4 changes: 2 additions & 2 deletions specs/001-pathway-pdfs/research.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ own source, and the answers agree with them.
`/token/{token}` gives `identifiersNotFound` (a count), `pathwaysFound`, `pathways` (a
page of them), `resourceSummary`, `speciesSummary`, `expression` and `warnings`. **None
of them is a count of identifiers found,** nor of identifiers submitted. These are this
analysis's fields: the service leaves out empty ones, and the summary may also hold
`species`, `fileName`, `server`, `gsaToken` and `gsaMethod`, with `type` one of six
analysis's fields: the service leaves out null ones, and the summary may also hold
`species`, `fileName`, `gsaToken` and `gsaMethod` (its `server` is never written), with `type` one of six
values (the ReactomeGSA ones among them), so the client's types stay open to them.
- **`pathwaysFound` follows `includeDisease`:** the answer is filtered by the stored
analysis's own setting unless the request names one, and the summary it returns then
Expand Down
10 changes: 7 additions & 3 deletions specs/001-pathway-pdfs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ for WebsiteAngular to ship it (T042).

- **Done (#119, replacing #112 to #118 after their reviews):** against a non-production instance on release 98, not a private one: nothing in its storage was touched, each case being a token the service reads by its own rules (analysis-core's `Tokenizer` and `TokenUtils`, read alongside), and one small analysis was submitted. The service reads a stored result first; its 7 days (a constant) only tell a missing result's 410 from its 404. How long a result is kept is not set by its token's age (the service's cleanup goes by the results folder's size and the files' last access, and results are also removed outside its code), so a result can outlive its 7 days and is then still answered. So the token's date is no longer judged here (T021) and there is no `--retention` setting. A malformed token is the service's catch-all 500, and a `/` in one is a 400 page or another route, so T021 accepts only the form the service issues. Neither `/token/{token}` nor `result.json` carries the found count; the found identifiers' CSV does, from the same map as today's book's count (over all the stored pathways, where the book's are filtered). `pathwaysFound` follows the analysis's `includeDisease`, so it is asked for with `includeDisease=true`, as today's book counts. Research R6 has the table. From #112's review: the includeDisease filter, the cleanup recorded as the retention, the wrong-padding and `/` cases, and R6's older text, which contradicted the measurement. From #113's review: Base64 of `_` alone passed the form rule and the service fails on it, so the rule now requires the decoded `{14 digits}_{digits}`; today's book counts after its own species and resource filter, not the stored list, recorded with the p-value edge; results are also removed outside the service's cleanup, and a resubmission can bring a token back; spec 002's "410 for one a release deleted" corrected, and whether its report checks the token's form left to its tasks. From #114's review: the counter is now bounded (a 7,000-digit one reached the servlet container's HTML 400); today's book counts over every species, and the p-value edge belongs to the identifiers count, not the pathways', as spec 002 already said; a `found/…` 404 may mean the result went mid-PDF; T010's 500 and non-JSON 400 cases; the instance's ASCII dates recorded. From #115's review: the bound is on the decoded token, so a token nested in `%25` layers still reached the HTML 400 when sent as given; the canonical token is what is sent. The p-value wording agrees with spec 002's (no pathway count differs in practice); the calendar named beside the digits; the CSV's file name a constant. From #116's review: T020 now carries the counts, the canonical token and each call's `Accept` (the CSV endpoint answers the framework's 406 to `application/json` alone); `/token/{token}` is paged to one pathway; spec 002's service contract's 410 row and its open item corrected. From #117's review: T010's stub answers a summary whose pathway count follows `includeDisease`, so T020's test catches a client leaving it out; a `found/entities` 404 and later 410s are stubbed and mapped; a missing `Accept` is answered, as the service answers it; the identifiers-found difference is among FR-012's expected ones. From #118's review: T010's CSV maps one identifier to two rows and T020 tests a row count fails; the stub's count changes with `species`; the CSV is fetched last; the summary's fields stay open to GSA's; why a resubmission reuses a token after the cleanup.

- [ ] T010 The analysis stub, `test/stubs/analysis.ts`. It is a small HTTP server on loopback that answers T009's recorded, scrubbed answers:
- [x] T010 The analysis stub, `test/stubs/analysis.ts`. It is a small HTTP server on loopback that answers T009's recorded, scrubbed answers:
- 404 (unknown);
- 410 (no result, dated within the service's 7 days);
- found entities and interactors on a reaction's first parent pathway;
Expand All @@ -164,6 +164,10 @@ for WebsiteAngular to ship it (T042).

It can be written before T009, answering contract-shaped placeholders; T009's recorded answers replace them, and the task is ticked only then.

- **Done (#124, replacing #123 after its review):** `test/stubs/analysis.ts` serves `/AnalysisService` on loopback and reads a token by the service's rules (URL-decoded until unchanged, Java's basic Base64, a stored result answered whatever its age, a missing one 410 within 7 days or in the future and 404 otherwise), so its 404s and 410s come from the tokens' dates, as the service's do. `TOKENS` holds a case per row of research R6's table; `forget(token, after)` removes a stored result after so many requests for it (a 410 or a 404 later in a PDF), and `refuse(times)` answers 503. The analysis is of made-up identifiers on the fixture's pathways, plus a disease pathway and a mouse pathway the graph does not hold: 6 pathways hit with disease pathways, 5 without (the analysis's own setting), 4 for human alone and 2 for mouse. The answers' shapes were read again from the non-production instance (GETs only): the found entities' and interactors' lists, the CSV and its 406. Like the render stub, it answers 400 to a parameter pdf-export never sends, which the service would ignore, and to a resource other than `TOTAL` or `importableOnly` other than `false` (in the summary, `found/…` and the CSV's path), which the service would filter by. Tests in `test/stubs/analysis.test.ts` (15). Each of these mutants made one fail: `includeDisease` ignored; `species` ignored; the CSV's rows one per submitted identifier; the date judged before the stored result is read; any `Accept` taken; a forgotten result kept; Base64 of `_` read as no date; 8 days taken as alive, or 7 days 12 hours as not; no 503; an encoded `/` passed to the service; another resource or importable-only taken; `q=0` read as accepting.
- **From #123's review:** the stub took any resource and either importable-only setting and answered as for FR-006's defaults, so a client sending others would pass (reproduced by a test, failing before the fix); the 7-day boundary is tested at 7 days 12 hours; human alone and the analysis's own setting no longer share a count; a `q=0` range refuses its type. Lows left: `species` as a database id, a raw `/` reaching another endpoint, and `forget()` given a non-canonical token are not modelled. T020 checks the canonical token on the stub's `requests`.
- **Carried from #119's and #122's reviews (lows):** research R6's summary fields no longer list `server` (the service never writes it) and say the service leaves out null ones, not empty ones; T048 notes that the cover's figure must be in the front part's figures, as a missing one is dropped without a word; data-model's "none of today's names" breaks the file-name rule is marked as not yet measured.

- [ ] T011 [P] Measure the join and stamping at the largest PDF's size (research R4; the book is one PDF per top-level pathway since 3 Nov 2026).
- Print synthetic parts totalling 3,760 pages (today's largest file), with figures in the real book's mix (T005's SVGs, so after T005), and join a few such PDFs at once, as `book` would.
- Join them with `@cantoo/pdf-lib`, or pdf-lib 1.17 if the fork fails the tests.
Expand Down Expand Up @@ -285,7 +289,7 @@ has the Background's parts in order, and bookmarks. Each error case gives its an
- [ ] T020 [US2] The analysis client, `src/analysis/` (research R6).
- It reads the summary, and the found entities and interactors by pathway. A `found/entities` or `found/interactors` 404 means none (research R6).
- The counts (research R6): the pathways hit are `pathwaysFound` from `/token/{token}?resource=TOTAL&importableOnly=false&includeDisease=true&pageSize=1&page=1`, with no species; the total adds its `identifiersNotFound`; the identifiers found are the distinct submitted identifiers in `/download/{token}/entities/found/TOTAL/{constant}.csv`, its header skipped. The analysis's own `includeDisease`, if shown, comes from an answer asked for without the parameter.
- The token sent is the canonical one (T021). Each call sends its `Accept` header as research R6 gives it (the CSV `text/csv, application/json`, the rest `application/json`); a test shows the stub's 406 to `application/json` alone. A test fails when `includeDisease=true` is left out, or `species` sent (the stub's pathway count then differs), and one when the CSV's rows are counted rather than its distinct submitted identifiers. The CSV is fetched after every `found/…` call, so a result gone mid-PDF ends it rather than reading as none found. A later 410, or a 404 from the CSV, ends the PDF as `gone-token` or `unknown-token` (research R6), each tested.
- The token sent is the canonical one (T021), checked on the stub's `requests`. Each call sends its `Accept` header as research R6 gives it (the CSV `text/csv, application/json`, the rest `application/json`); a test shows the stub's 406 to `application/json` alone. A test fails when `includeDisease=true` is left out, or `species` sent (the stub's pathway count then differs), and one when the CSV's rows are counted rather than its distinct submitted identifiers. The CSV is fetched after every `found/…` call, so a result gone mid-PDF ends it rather than reading as none found. A later 410, or a 404 from the CSV, ends the PDF as `gone-token` or `unknown-token` (research R6), each tested.
- A reaction's results are filtered to its own identifiers, from its first parent pathway's results.
- It uses FR-006's defaults: all resources together, no expression column, all identifiers.
- The overlay's species is the event's.
Expand Down Expand Up @@ -343,7 +347,7 @@ passes.

- [ ] T048 [US1] The book as one PDF per top-level pathway (user's decision, 3 Nov 2026; FR-001, FR-002, data-model BookPdf), changing what T014 and T018 built for one PDF.
- `src/model/build.ts`: the graph is read once, as now, and split, with what is computed over a document computed per document: the events it holds (`held`, so a reaction's events before and after in another PDF are dropped), each event's first place, and the cover's names: the book gives one document per top-level pathway, by name ignoring case (FR-002), each in full depth with its own cover (the pathway's name and diagram, the names across its own events, no excerpt note), introduction and contents. An event is in full at its first place in each document and a short entry at its later places there; one under two top-level pathways is in full in both.
- The layout needs no change: `layoutBookFront` already inlines a cover's figure (`src/layout/front.ts`), and the cover now has one, set by `build.ts`, so the front part falls under T024's label check before it is printed.
- The layout needs no change: `layoutBookFront` already inlines a cover's figure (`src/layout/front.ts`), and the cover now has one, set by `build.ts`, so the front part falls under T024's label check before it is printed. `build.ts` must also put the cover's figure among the front part's figures: one missing there is left out of the cover without a word, so a test checks the cover holds its diagram.
- Links (FR-003): to a section only within the same PDF; an event held only by another of the book's PDFs is as any event a PDF does not hold: plain text in a location, its page on the website for what an event was inferred from, and left out of a reaction's events before and after (`build.ts` already drops those). The excerpt note's "The Reactome Book" (`src/layout/text.ts`) names the book, which stays its name.
- **What changes in the code and tests built for one PDF:** `src/model/types.ts` (`Cover.release`, "a book's chapters"), `src/model/build.ts` (its header and the book's assembly); `test/model/build.test.ts` (chapters across the book; the shared reaction, now in full under both top-level pathways; the subtree beta reaches through "beta sub with diagram", whose "Alpha sub two", "Two-parent sub" and "Disease reaction" are now in full in beta's PDF as well, so the places asserted for them change; the book's cover and counts), `test/layout/layout.test.ts` (Reaction one's events before and after it in other top-level pathways' PDFs, Polymerisation four and Inferred reaction, are now left out; the book's front and its title), and `test/layout/fixture.ts`, `test/layout/print.test.ts` and `test/print/print.test.ts`, which build one `built.book`.

Expand Down
Loading
Loading