Agent PCIS 2500 / 3990
CIS 3990 · Fall 2026

Lab 2

Read-only Lab specification

Sign in to Agent P
Instructions

Lab specification

Lab 2 — JavaScript and TypeScript for Java Programmers

Assigned: Tuesday, September 1 · Due: before Tuesday, September 8 Prerequisites: Lab 1 and a working pinned Spacebar checkout. Estimated time: 75–90 minutes. Grading: Pass/fail.

Goal

Build enough JavaScript/TypeScript reading fluency to inspect and verify the Spacebar codebase. You are not expected to memorize the language. The recurring habit is: ask a precise question, inspect the source, and record evidence.

Part A — Two prompt pairs

First, prompt your agent with the following vague question:

How does async work in JavaScript?

Consider the output. It's probably useful, but it might not be exactly what you're looking for: discursive, abstract, distracting ("here's why this matters:") or fixated on edge cases.

Try another prompt in a fresh conversation (use /clear in Claude Code):

Please describe how async works in JavaScript with reference to how two messages sent at the same time to the same channel get processed. Are there cases where two messages might appear out of order?

The output might be quite a bit longer, and it probably includes some information you didn't think you cared to know! On the other hand, you'll have an explanation of async that comes with an important tutorial about Spacebar's models.

Choose two of these axes: paradigm, typing, runtime model, or structure/composition. For each, ask Claude Code one vague and one precise question. Ground the precise question in a real Spacebar file or symbol. Record both prompts, a short response excerpt, and what the precise prompt added. Include these in your submission.

Fill in both Axis 1 and Axis 2 under Part A of lab2/submission.md — name the axis you chose in the heading, don't leave the placeholder text.

Part B — Grounded reading

Ask questions about the purposes of different unfamiliar language features. Choose two from the following list, record the response—including files inspected—and briefly summarize the explanation in your own words.

  • middleware registration order in src/api/Server.ts;
  • With reference to an actual entity, what does @Entity mean or do? @Column? @ManyToOne?
  • What is the difference between import and require(), and when do they need to both be present?
Record Claim 1 and Claim 2 under Part B of lab2/submission.md, each with the file/symbol you checked and a verdict.

Part C — End-to-end message trace

Trace POST /channels/{channelId}/messages through the route handler, permission check, database write, emitEvent(), and WebSocket dispatch. Don't transcribe the whole trace — pick two of those steps and verify each against the source, with file and symbol names (exact line numbers optional). Then draw a Mermaid sequence diagram with 4–6 participants covering the full trace, as evidence you traced the whole path and not just the two steps you wrote up.

Record your two verified steps under Part C of lab2/submission.md. Save the sequence diagram itself as lab2/message_sequence.mmd.

Submission

Copy [lab-02-submission.md](lab-02-submission.md) to lab2/submission.md and complete Parts A–C, and save your Part C sequence diagram as lab2/message_sequence.mmd. Do not include secrets, tokens, or personal paths in the submission. (The template is also downloadable from the bottom of the Lab 2 assignment page on Agent P.)

When ready, commit, push, and tag — a tag, not the current state of main, is what gets graded:

git add lab2/
git commit -m "Submit Lab 2"
git push origin main
git tag lab2-submission
git push origin lab2-submission

Off campus, connect to the Penn VPN first. To fix something before the deadline, commit the fix, push main, then move the tag:

git tag -d lab2-submission && git push origin :refs/tags/lab2-submission
git tag lab2-submission && git push origin lab2-submission

Grading

Pass/fail. A passing submission contains two prompt comparisons, two source verifications, and a readable end-to-end trace.