Skip to content

Spec 001 T010: the analysis stub, from T009's answers - #123

Closed
adamjohnwright wants to merge 1 commit into
mainfrom
t010/analysis-stub
Closed

adamjohnwright wants to merge 1 commit into
mainfrom
t010/analysis-stub

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 001, task T010.

What: test/stubs/analysis.ts, a loopback stand-in for the analysis service that T020–T022 test against. It answers what T009 recorded (research R6):

  • tokens read by the service's own rules (URL-decoded until unchanged, Java's basic Base64, the stored result read first, then 410 within 7 days or in the future, 404 otherwise), with a token for each row of R6's table;
  • the summary, whose pathwaysFound follows includeDisease (the request's, else the analysis's own) and species;
  • found entities and interactors on Reaction one's first parent pathway, and a 404 for none;
  • the found identifiers' CSV, one submitted identifier on two rows, and the framework's 406 to Accept: application/json alone;
  • forget(token, after) for a result that goes while a PDF is made (a later 410 or 404), refuse(times) for 503;
  • the catch-all 500, the container's HTML 400 for an encoded /, the framework's 404 for a raw one.

Identifiers are made up. Like the render stub, it answers 400 to a parameter pdf-export never sends.

Tests: 14 in test/stubs/analysis.test.ts. Each of ten mutants made one fail (includeDisease or species ignored, CSV rows deduplicated, date judged before the stored result, any Accept taken, a forgotten result kept, _ read as undated, 8 days alive, no 503, an encoded / passed through).

Also: three lows carried from #119's and #122's reviews: R6's summary fields, the cover's figure in T048, and the file-name rule's unmeasured claim in data-model.

tasks.md ticks T010 with this PR.

🤖 Generated with Claude Code

test/stubs/analysis.ts serves the analysis service's answers on loopback,
reading a token by the service's own rules, so its 404s and 410s come from
the tokens' dates. A case per row of research R6's table; forget() for a
result that goes mid-PDF; refuse() for 503; the found lists, the CSV with
one identifier on two rows, and the 406 to JSON alone. 14 tests, each of
ten mutants caught.

Also the lows carried from #119's and #122's reviews: R6's summary fields,
the cover's figure in T048, and the file-name rule's unmeasured claim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright

Copy link
Copy Markdown
Contributor Author

Replaced by #124 after review.

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.

1 participant