You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add complete CI validation pipeline, test entry, GitHub Pages site, and auto-approve workflow
- CI validation pipeline (ci/validate.py + ci/checks/) with modular checks:
stockholm parsing, annotation consistency, protein/DNA checks, provenance,
structures, and weighted scoring (diversity 40%, annotation 25%,
functionality 20%, size 15%)
- Test entry (entries/test-entry/) built from real Mos1 transposase data
(M14653.1) plus two synthetic variants
- GitHub Pages leaderboard site (docs/) with dark theme, expandable
detail panels, and submission instructions
- Auto-approve workflow for PRs scoped to entries/{username}/
- Branch protection requiring validation + 1 approval
- 39 pytest tests covering all check modules and integration
- POLICY.md, README.md, .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
├── docs/ # GitHub Pages site (auto-updated by CI)
31
+
│ ├── index.html # Main leaderboard page
32
+
│ ├── style.css # Styling
33
+
│ ├── leaderboard.js # Client-side rendering from JSON
34
+
│ ├── leaderboard.json # Copy of root leaderboard.json
35
+
│ └── scores/ # Copies of score files
30
36
├── ci/
31
37
│ ├── validate.py # Main validation + scoring script
32
38
│ ├── checks/ # Modular validation checks
@@ -209,6 +215,8 @@ All checks produce a pass/fail/warn status and a message. An entry with any hard
209
215
-`assembly` is a plausible accession format.
210
216
- Coordinates are internally consistent (`start` < `end`, `strand` is `+` or `-`).
211
217
218
+
If it is not beyond the scope of GitHub actions (e.g. if there is a REST service for a fast subsequence retrieval that we can query), provenance should be verified.
219
+
212
220
### Scoring
213
221
214
222
The score for an entry is a weighted combination of factors designed to reward phylogenetically diverse, well-annotated, high-confidence collections. The total score is normalized to 0–100.
@@ -241,7 +249,7 @@ Goal: span the phylogenetic space of the ITm superfamily, not pile up near-ident
241
249
242
250
- Logarithmic scaling: score = min(1, log2(N) / log2(target)), where `target` is a configurable parameter (e.g. 64 sequences).
243
251
- This rewards having enough sequences to be useful as a seed dataset, but saturates — 200 sequences is not much better than 64 for a seed. The point is to span space, not to be exhaustive.
244
-
- Hard penalty if N < 3 (entry is rejected).
252
+
- Hard penalty if N < 3 or N > 300 (entry is rejected).
245
253
246
254
#### Score normalization
247
255
@@ -304,10 +312,63 @@ The GitHub Actions workflow (`.github/workflows/validate.yml`) triggers on pushe
304
312
305
313
Entries that fail hard validation checks (format errors, missing required files, ID mismatches) receive a score of 0 and a descriptive error in their score file.
306
314
315
+
307
316
## Updating an entry
308
317
309
318
To update an entry, simply push a new commit modifying files in your `entries/{team}/` directory. The CI will re-run validation and overwrite the previous score. The leaderboard always reflects the latest commit for each team.
310
319
320
+
## GitHub Pages leaderboard site
321
+
322
+
The leaderboard is published as a static site via GitHub Pages, automatically updated by CI.
323
+
324
+
### Site structure
325
+
326
+
```
327
+
docs/
328
+
├── index.html # Main leaderboard page (auto-generated)
329
+
├── style.css # Minimal styling
330
+
└── leaderboard.js # Reads leaderboard.json and renders the table
331
+
```
332
+
333
+
### How it works
334
+
335
+
1. The validation CI workflow (`.github/workflows/validate.yml`) produces `leaderboard.json` at the repo root as before.
336
+
2. A second workflow step (or a dedicated workflow `.github/workflows/pages.yml`) runs after validation completes:
337
+
- Copies `leaderboard.json` and all `scores/*.json` into `docs/`.
338
+
- Commits any changes to `docs/`.
339
+
3. GitHub Pages is configured to serve from the `docs/` folder on the `main` branch (Settings → Pages → Source: `main` / `docs`).
340
+
4.`docs/index.html` is a single-page app that fetches `leaderboard.json` at load time and renders a ranked table with columns: rank, team, total score, sub-scores (diversity, annotation, functionality, size), number of sequences, number of families, and last commit.
341
+
5. Clicking a team name expands to show per-check status and per-sequence issues from `scores/{team}.json`.
342
+
343
+
### Design constraints
344
+
345
+
-**No build step.** The site is plain HTML + CSS + vanilla JS. No bundler, no framework, no Node.
346
+
-**Data-driven.** All content comes from the JSON files. The HTML/JS never hard-codes team names or scores.
347
+
-**Accessible.** Semantic HTML table, readable without JS (a `<noscript>` fallback links directly to `leaderboard.json`).
348
+
-**Mobile-friendly.** Responsive table layout via CSS.
349
+
-**Auto-refresh.** The CI keeps `docs/leaderboard.json` up to date; the page always shows the latest data because it fetches from the same repo's GitHub Pages URL.
350
+
351
+
### CI integration
352
+
353
+
The pages deployment step should be added to the end of the existing validation workflow:
The `[skip ci]` tag prevents infinite CI loops from the docs commit.
371
+
311
372
## Reuse plan
312
373
313
374
The validation logic in `ci/checks/` is designed as a library that can be imported and reused. The "big data" leaderboard (Stage 2) will validate entries stored in S3 using the same annotation format and similar checks, extended with:
@@ -349,4 +410,5 @@ When asked to work on this project, Claude should:
349
410
4. **Maintain a clear policy document POLICY.md at the top level, describing the scoring scheme and hard/soft constraints.** The scoring scheme and validation may change, but the current policy should always be transparent.
350
411
5. **Write tests.** The `ci/` directory should include test fixtures (minimal valid and invalid entries) and pytest-based tests for every check.
351
412
6. **Design for reuse.** The Stockholm parser, annotation validator, and protein/DNA consistency checks will be reused for the big data leaderboard. Keep them modular and dependency-light.
352
-
7.**Do not over-engineer.** This is a research tool, not a production service. Clarity and correctness over abstraction.
413
+
7. **Do not over-engineer.** This is a research tool, not a production service. Clarity and correctness over abstraction.
414
+
8. **Keep the GitHub Pages site working.** When changing the score output format or leaderboard.json schema, update `docs/leaderboard.js` to match. The site must always render correctly from the current JSON structure.
This document describes the current scoring scheme and validation rules. It is the authoritative reference for what the CI pipeline checks and how scores are computed.
4
+
5
+
## Hard-fail checks (score = 0 if any fail)
6
+
7
+
### Format checks
8
+
-`protein.sto` must be valid Stockholm 1.0 with a `#=GC catalytic_triad` line.
9
+
-`dna.sto` must be valid multi-Stockholm with exactly one sequence per block and a `#=GC element_structure` line per block.
10
+
-`provenance.tsv` must be valid TSV with all required columns: `id`, `family`, `host_species`, `host_taxid`, `assembly`, `chrom`, `start`, `end`, `strand`, `source`, `reference`.
11
+
- All IDs must be consistent across `protein.sto`, `dna.sto`, and `provenance.tsv`.
12
+
- Minimum 3 sequences, maximum 300.
13
+
14
+
### Annotation consistency checks
15
+
-`catalytic_triad` must mark exactly 2–3 positions with D, d, and E (or D for DDD families). Marked columns must contain the expected residue in the majority of sequences.
16
+
-`element_structure` must:
17
+
- Use only valid characters: `5 3 < > A B 0 1 2 n t .`
18
+
- Follow the pattern: `5+AA<+[interior]+>+BB3+`
19
+
- Have `A` and `B` positions (TSD) spelling `TA` in the sequence.
20
+
- Have TIRs (`<` and `>`) that are approximate reverse complements (>70% match).
21
+
- Have ORF annotation (`012`) with correct codon phasing and length divisible by 3.
22
+
- Have ORF translation matching the protein in `protein.sto` at >=90% identity.
23
+
24
+
## Scored checks (reduce score but do not reject)
25
+
26
+
### Protein-level
27
+
- Transposase length within expected range for declared family.
28
+
- Catalytic triad spacing matches declared family (e.g. DD34D = 34 residues between 2nd and 3rd).
29
+
30
+
### DNA-level
31
+
- Element length (excluding flanking) within expected range.
32
+
- TIR length within expected range.
33
+
- ORF GC content between 15% and 75%.
34
+
- No ambiguous bases (N) in the ORF.
35
+
36
+
### Provenance
37
+
-`host_taxid` is a valid positive integer.
38
+
-`assembly` matches GC[AF]_NNNNNNNNN.N format.
39
+
- Coordinates are consistent (`start` < `end`, `strand` is `+` or `-`).
0 commit comments