A note on building · Relay
Building Relay: Connecting Procedures to the Knowledge Behind Them
Designing a system that helps student organizations preserve institutional knowledge, manage changing information, and keep recurring procedures relevant.
Student organizations rely heavily on institutional knowledge. Every year, new officers inherit responsibilities from the people before them. They receive documents, instructions, spreadsheets, and collections of advice intended to help them continue where the previous leadership left off.
But there is a problem with this process: information does not always survive the transition, and even when it does, it does not necessarily remain correct.
A procedure might still instruct officers to follow a policy that changed two semesters ago. A decision made by previous leadership might never make it into the documentation. Sometimes, the instructions themselves are perfectly clear, but the assumptions behind them are no longer valid.
I wanted to build something that addressed more than simply storing and sharing documents.
That became Relay, a project I developed for MIT's 6.1040 Software Design course.
Relay helps student organizations preserve recurring procedures and the knowledge behind them. Officers can maintain reusable instructions, connect them to shared information, and identify which procedures might need reconsideration when that information changes.
The central idea was to make the relationships between information and the procedures that depend on it explicit.
Introducing Relay
Relay is built around three primary features.
Playbooks are reusable, ordered procedures for recurring tasks. Officers can create Playbooks, add Steps, reorder instructions, edit them, and archive procedures that are no longer active.
Shared Context stores information that multiple Playbooks may depend on. This includes policies, decisions, assumptions, and lessons learned. Rather than duplicating the same information across different procedures, officers can create a Context Note once and attach it to multiple Playbooks or individual Steps.
Reviews help officers reconsider procedures when their underlying information changes. When a Context Note changes meaningfully, Relay identifies the affected active Playbooks and creates Review work for them.
Members can also ask Questions about particular Steps or Context Notes, allowing uncertainty and its resolution to remain attached to the information being discussed.
Relay supports multiple club workspaces, with Owner, Officer, and Member roles.
The distinction between these features is intentional. Playbooks preserve what people do, Context preserves why certain instructions exist, and Reviews connect changes in that knowledge back to the procedures that depend on it.
Modeling the system through independent concepts
One of the first design decisions I made was to structure Relay around independent concepts rather than treating it as one large application model.
Each concept represents a distinct responsibility. It owns its state, the rules governing that state, and the operations that can modify it.
The final design contains five concepts.
ProcedureMaintaining — Preserving recurring procedures
ProcedureMaintaining owns Playbooks and their Steps.
A Procedure has a title, workspace, status, and version. Each Step has its own identity, text, position, and status.
An important decision was to separate a Step's identity from its position.
For example, moving the third Step to the first position should not create an entirely new Step. Other parts of Relay might already refer to that particular Step, including Questions or Context attachments.
Similarly, removing a Step does not erase its identity. Its position is removed, but its historical identity remains available.
This allows other parts of the system to preserve meaningful references even as procedures evolve.
ContextTracking — Preserving shared knowledge
ContextTracking owns Context Notes, their attachments, and their change history.
A single Note can be attached to multiple Playbooks or individual Steps. This avoids maintaining several independent copies of information that should remain consistent.
More importantly, ContextTracking distinguishes between two kinds of edits.
- Corrections: Changes to wording that do not alter the underlying information.
- Meaningful changes: Changes to the actual information that other procedures may depend on.
Corrections update the Note without generating Review work. Meaningful changes preserve the exact previous and updated text, creating a record of what changed.
This distinction becomes important when connecting ContextTracking to the rest of the system.
Reviewing — Managing reconsideration
Reviewing manages the process of reconsidering an item.
It intentionally does not know what a Playbook, Step, or Context Note is. Instead, it works with generic Items, Causes, and Review statuses.
The composition determines which Playbooks need Reviews when Context changes. Reviewing is responsible for maintaining the Review itself.
It also enforces an important invariant: there can be at most one unfinished Review for a particular Item.
If additional changes occur while a Review is already open, their distinct Causes are added to that existing Review rather than generating duplicate work.
Questioning — Preserving discussions
Questioning allows members to ask questions about particular subjects and preserves the original question alongside its answer.
I designed it as a reusable concept rather than creating separate implementations for Step Questions and Context Questions.
Relay instantiates the same concept twice, with different subject identities.
This means that the underlying question-and-answer behavior remains consistent regardless of what someone is asking about.
RoleBasedAccessing — Separating permissions from functionality
RoleBasedAccessing determines whether a user has permission to perform a particular operation on a resource.
Relay uses Owner, Officer, and Member roles within each workspace.
The concept handles role assignments and authorization, but it does not authenticate users. Establishing a trustworthy user identity is the responsibility of the application host.
This distinction keeps authentication, authorization, and domain behavior from becoming unnecessarily intertwined.
Connecting the concepts: How Relay handles change
The most important interaction in Relay happens between ContextTracking and Reviewing.
Consider a fictional example.
A club has two Playbooks:
- Plan the Annual Club Showcase
- Renew Club Room Access
Both depend on the same Context Note:
"Room access is renewed annually."
An officer discovers that the policy has changed and updates the Note to:
"Room access is renewed every semester."
What should happen next?
Relay already knows which Playbooks depend on the Note because their relationships are explicitly represented through attachments.
When the officer classifies the edit as a meaningful change, ContextTracking records the previous and updated information. The composition then identifies the affected active Playbooks and requests Reviews.
If a Playbook already has an unfinished Review, the new Change is added as another Cause rather than creating another Review.
The officer chooses how to classify the edit
The information stays the same. The correction is recorded; no Review is triggered.
The policy changes to semesterly renewal. Relay preserves before-and-after text and creates or updates a Review for each affected active Playbook.
The resulting workflow is:
- ContextTracking records the meaningful change.
- The composition identifies affected Playbooks.
- Reviewing creates or updates the corresponding Reviews.
- Officers inspect the previous and updated information.
- Officers decide whether the existing instructions still need modification.
An important part of this design is what Relay deliberately does not do.
It does not automatically rewrite affected Playbooks.
For example, the instruction "Check the current room-access policy before booking" might remain perfectly valid after the policy changes. Another instruction specifying annual renewal probably needs reconsideration.
Relay can identify the dependency, but it cannot necessarily determine whether the instruction is still appropriate.
I wanted the system to surface the consequences of changing information while leaving the final decision to the people who understand the organization's circumstances.
Why the composition matters
Although the five concepts are independent, Relay still needs them to work together.
I handled this through an application composition that coordinates their interactions using stable identities and reactions to successful actions.
The concepts do not directly call one another or access one another's storage.
For example, ContextTracking does not need to understand what a Playbook is, and Reviewing does not need to know what a Context Change represents.
Instead, the composition understands how these pieces relate within Relay.
This separation became particularly important when I encountered a concurrency issue.
Suppose four meaningful Context Changes happen concurrently and all affect the same Playbook.
Relay should produce one unfinished Review containing all four Changes as distinct Causes.
My initial implementation sometimes produced one Review with only three Causes. The individual Context Changes were preserved, and Reviewing correctly prevented duplicate unfinished Reviews, but one Cause could be lost when concurrent reaction flows interacted.
The issue was that multiple flows could observe that no unfinished Review existed and attempt to create one. One request would succeed, while another would be refused because the Review had already been created.
I addressed this by keeping the uniqueness invariant inside Reviewing and adding a recovery reaction in the composition. When a request is refused because an unfinished Review already exists, the composition finds that Review and adds the missing Cause.
The resulting regression tests verify that four concurrent Changes produce exactly one unfinished Review containing all four distinct Causes.
Allows at most one unfinished Review for an item.
If a concurrent request is refused, it attempts to add that Change to the existing Review.
This reinforced an important architectural principle: independent concepts can each preserve their own invariants while the composition still needs to handle failures that emerge between them.
Building the application
Relay is implemented using Vue 3, Bun, and MongoDB.
The architecture separates the frontend, application host, composition, and underlying concepts.
The Vue frontend handles navigation, workspace information, user interactions, and local editing state. The Bun host exposes the API, establishes authenticated identity, selects the active workspace, and enforces authorization before invoking domain operations.
MongoDB provides persistent storage for accounts, sessions, workspace information, and concept state.
A few engineering decisions were particularly important.
Concurrent editing: Relay uses version checks to prevent stale edits from silently overwriting newer information. If an officer attempts to save an outdated version, the server rejects the mutation. The interface preserves the unsaved draft and lets the officer compare it with the current saved version rather than discarding their work.
Stable identities: Steps retain their identities when reordered or removed. This allows Questions and other historical references to remain meaningful.
Data preservation: Detaching a Context Note from one Step does not delete the Note or its other attachments. Permanent deletion is a separate, explicit operation. Similarly, archiving a Playbook preserves its historical information.
Workspace isolation: The host derives the authenticated user and selected workspace from the server-side session rather than trusting caller-supplied identity or workspace information. Protected operations are authorized against the selected workspace.
Persistent sessions: Passwords use salted scrypt hashes, while opaque session tokens are stored as SHA-256 digests. Sessions use HttpOnly and SameSite=Strict cookies, with Origin and CSRF checks on protected requests.
These decisions were not simply implementation details. Each one supported a broader requirement: information should remain consistent, historical relationships should remain meaningful, and users should not accidentally overwrite or access information they do not own.
Designing the interface around actual workflows
The first versions of Relay focused heavily on exposing the functionality I had implemented.
But having every operation visible did not necessarily make the application easier to use.
The Reviews page was a particularly good example. It initially displayed the Context changes, affected Steps, editing forms, and several repair options simultaneously. Although everything was technically available, the page became overwhelming.
I gradually simplified it by prioritizing the information needed for the primary decision and moving less common actions behind expandable sections.
I also changed how officers navigate between Reviews and Playbooks. Rather than making someone locate an affected Step manually, clicking an affected-Step reference takes them directly to the relevant location in the Playbook.
The same principle influenced the rest of the interface. Playbooks should read like documents rather than administrative dashboards, and Context tools should appear alongside the instructions they support.
I evaluated Relay with two MIT student organization participants. Their sessions revealed some interesting usability issues.
One participant hesitated when deciding whether an edit was a wording correction or a meaningful information change. Another initially struggled to find the Step-reordering control.
Interestingly, both completed similar follow-up tasks without hesitation.
This reinforced the importance of distinguishing between something being difficult to discover and something being difficult to use once discovered.
It also reminded me that an interface that makes perfect sense to its designer is not necessarily intuitive to someone encountering it for the first time.
Where Relay ended up
By the final P4 submission, Relay had evolved from a single-workspace MVP into a multi-user application with five independent concepts, a coordinating composition, persistent authentication, workspace management, and a complete set of Playbook, Context, Review, and Question workflows.
The final local verification suite passed 184 tests across 23 files, alongside TypeScript and Vue typechecking, production builds, concept and design checks, and generated-artifact validation.
The application is deployed at relay.mit-sdg.dev, and the source code and technical specifications are available on GitHub.
Looking back, the most valuable part of building Relay was learning to think about an application as more than a collection of features.
The challenge was deciding what information the system needed to preserve, how different pieces of information related to one another, which responsibilities belonged in independent concepts, and how those concepts should interact without compromising their individual rules.
Relay started as an attempt to help student organizations preserve their knowledge. Along the way, it became an exercise in designing a system where information, dependencies, history, and human decisions all have an explicit place.