Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.43 KB

File metadata and controls

53 lines (38 loc) · 2.43 KB

Local Caliper Generator and Session Packaging

Flow

  1. Generator seeds a local dataset of 20 realistic users and 5 realistic courses.
  2. On startup, generator posts a Caliper v1.2 entities envelope to POST /ingest/caliper.
  3. Ingest handler validates and enqueues.
  4. Persist handler stores Caliper entities and events.
  5. Persist handler groups events by actor (learner) and session, then upserts a projected Caliper credential per learner session.
  6. Persist handler also writes a graph projection snapshot per learner/session for timeline stacking.
  7. Learner context endpoint reads projected credentials and optional timeline layers (view=timeline) and supports VP creation.

Run the generator

Required:

  • CALIPER_INGEST_URL

These are read from the repo root .env file when running npm run generate:caliper.

Optional:

  • CALIPER_INGEST_TOKEN
  • CALIPER_OAUTH_TOKEN_URL
  • CALIPER_OAUTH_CLIENT_ID
  • CALIPER_OAUTH_CLIENT_SECRET
  • CALIPER_OAUTH_SCOPE (optional, space-delimited)
  • CALIPER_SENSOR_ID
  • GENERATOR_WARMUP_SECONDS (default: 3)
  • GENERATOR_PUSH_INTERVAL_SECONDS (default: 20)

Story Mix

The generator now always emits a mixed rotation of stories per run:

  • quick: compact learner session flow (login, navigation, view, assignment start/complete, logout)
  • assessment-heavy: richer assessment story (item start/complete, submission, grade, logout)
  • instructor-review: assessment-heavy plus an instructor review event before learner logout
  • discussion: a learner views course material then posts to a discussion forum
  • practice: a shorter assessment flow with submission and grading

Run:

npm run generate:caliper

Notes:

  • Generator no longer depends on external SIS/gRPC sync.
  • Startup sends all Person and CourseSection entities first, then loop payloads contain random event sets.
  • Membership entities are intentionally omitted; events still relate learners and courses through actor/group/session references.
  • Generator includes user-friendly Caliper name values at event time (for actors, course group refs, and content objects) so downstream APIs and UI can render human-readable learners, courses, and activity items.
  • Timeline projection keys are LEARNER#{learnerId} + SNAP#{snapshotAt}#SESSION#{sessionId} and are optimized for learner timeline reads.
  • For demo convenience, you can set OAuth client credentials in .env and the generator will mint/refresh bearer tokens automatically.