Skip to content

feat: Adds span labeling pipeline with prompt references, exponential magnitude slider, and 10 jsPsych plugins#1

Merged
aaronstevenwhite merged 11 commits intomainfrom
feat/span-labeling
Feb 10, 2026
Merged

feat: Adds span labeling pipeline with prompt references, exponential magnitude slider, and 10 jsPsych plugins#1
aaronstevenwhite merged 11 commits intomainfrom
feat/span-labeling

Conversation

@aaronstevenwhite
Copy link
Collaborator

Description

Adds a complete span labeling pipeline from data model through deployment, 10 new jsPsych plugins, prompt span references ([[label]] syntax), an exponential magnitude estimation slider, and an interactive gallery with 17+ demos.

Motivation

The experiment framework needed token-level annotation (span labeling), additional task types beyond the initial rating/forced-choice plugins, and a way for prompts to reference highlighted spans with matching colors. Magnitude estimation also needed a better input method than a plain number field.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Tests (adding or updating tests)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have run uv run ruff check . and uv run ruff format .
  • I have run uv run pyright with no errors
  • I have added tests that prove my fix/feature works
  • All tests pass (uv run pytest tests/)
  • I have updated documentation as needed

Testing

Python (79 span + 13 prompt reference tests):

  • uv run pytest tests/deployment/jspsych/test_trials.py -- prompt span reference parsing, color assignment, resolver, integration
  • uv run pytest tests/items/test_spans.py -- span data model, composability, validation
  • uv run pytest tests/tokenization/ -- tokenizer backends

TypeScript (83 tests, 0 type errors, 0 Biome errors):

  • pnpm run test -- plugin info/instantiation (rating, forced-choice, span-label, cloze, magnitude), exponential slider math (8 tests), span-renderer (22 tests), randomizer, list-distributor
  • pnpm run typecheck -- strict mode with exactOptionalPropertyTypes, noUncheckedIndexedAccess
  • pnpm run check -- Biome lint + format clean

Key features to verify manually:

  • Exponential magnitude slider: drag, click, arrow keys, value display, reference tick at 1/3
  • Prompt span references: [[label]] resolves to highlighted HTML with matching stimulus colors
  • Multi-select demo: 3 options (no redundant "Both")
  • Gallery demos: all 17+ demos render correctly with tabbed Demo/Python/Trial JSON views

Screenshots (if applicable)

N/A -- interactive demos viewable via uv run mkdocs serve

@aaronstevenwhite aaronstevenwhite merged commit 99774c2 into main Feb 10, 2026
8 checks passed
@aaronstevenwhite aaronstevenwhite deleted the feat/span-labeling branch February 10, 2026 19:35
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