Skip to content

BrainDump — Development Report

Project: BrainDump v1.0.0 Type: Web Application (Node.js + React) Profile: Commercial Source: github.com/loskylp/BrainDump Production: braindump.nxlabs.cc Session transcript: BrainDump-TRANSCRIPT.md Retrospective: BrainDump-RETROSPECTIVE.md Dates: 2026-03-17 to 2026-03-22


BrainDump is a public, multi-user web application for technical documentation management. It provides a split-pane editing experience — Markdown source with syntax highlighting on the left, real-time CommonMark-rendered preview on the right — with a persistent note catalog, full-text search, folder organisation, version history, auto-save, and a global tagging system. The service runs on shared infrastructure at nxlabs.cc with CI/CD managed by GitHub Actions, Watchtower, Traefik, and Uptime Kuma.

The project was developed as the second production test of the Nexus SDLC framework — the first to exercise all major agents (Methodologist, Orchestrator, Analyst, Auditor, Architect, Scaffolder, Planner, Builder, Verifier, Sentinel, DevOps) at Commercial profile, across three full delivery cycles, culminating in a live Go-Live against production infrastructure.


“@nexus-methodologist I want to build BrainDump (a knowledge base): a web system for saving notes with Markdown support”


The development ran through three full delivery cycles and all Nexus SDLC gates. Every gate required explicit human (Nexus) approval before the swarm could proceed.

GateDateStatusNotes
Requirements Gate2026-03-19Approved17 requirements (4 iterations to incorporate expanded brief, persona, and Auditor fixes)
Architecture Gate2026-03-19Approved9 ADRs, 56 fitness functions, all 17 requirements covered
Plan Gate — Cycle 12026-03-19Approved14 tasks; walking skeleton (TASK-016) as first deliverable; TASK-019 cut below line
Cycle 1 Execution2026-03-21Complete14/14 tasks PASS; 1 context-limit interruption recovered cleanly
Demo Sign-off — Cycle 12026-03-21AcceptedESC-002 CI incident resolved; Playwright validation; 12 screenshots committed
Plan Gate — Cycle 22026-03-21Approved10 tasks; 2 untraced features flagged and formalised before Builder
Requirements Gate — v32026-03-21ApprovedREQ-018 and REQ-019 added at Plan Gate; mini Requirements Gate run first
Cycle 2 Execution2026-03-21Complete10/10 tasks PASS; staging live at braindump.staging.nxlabs.cc
Demo Sign-off — Cycle 22026-03-21ApprovedPlaywright validation; 2 inline bug fixes; screenshots committed
Requirements Gate — v42026-03-21ApprovedREQ-020 ZIP export, REQ-021 tagging, REQ-022 reading mode
Plan Gate — Cycle 32026-03-22Approved7 tasks including production deploy and monitoring
Cycle 3 Execution2026-03-22Complete7/7 tasks PASS; many tasks dispatched in parallel
Demo Sign-off — Cycle 32026-03-22Approved12/12 Playwright scenarios PASS; 0 unresolved Sentinel findings
Go-Live — v1.0.02026-03-22ApprovedProduction live at braindump.nxlabs.cc

The requirements set evolved across four versions through two formal Requirements Gates and one mid-cycle mini-gate. The initial prompt produced 14 requirements; three rounds of refinement added the split-pane editor specification, note catalog, full-text search, auto-save, version history, landing page, keyboard shortcuts, export, and three Cycle 3 features requested at demo.

IDRequirementPriorityOrigin
REQ-001User registration (username, email, password; duplicate email rejected)Must HaveInitial
REQ-002User login and logout (session-based; protected routes)Must HaveInitial
REQ-003Password reset via email (expiring link; no user enumeration)Must HaveExpanded brief
REQ-004Create a note (title required; opens split-pane editor immediately)Must HaveInitial
REQ-005Edit a note (title and body; persisted via auto-save)Must HaveInitial
REQ-006Delete a note (with confirmation; cascades to all versions)Must HaveInitial
REQ-007Split-pane Markdown editor with live CommonMark preview (syntax highlighting; real-time render; no manual render action)Must HaveExpanded brief
REQ-008Note catalog sidebar (persistent; chronological; always visible; primary navigation)Must HaveExpanded brief
REQ-009Organize notes in folders (single-level in v1; folder delete moves notes to root)Must HaveBrief v1
REQ-010Full-text search using PostgreSQL FTS (title + body; weighted; ranked results)Must HaveExpanded brief
REQ-011Per-user data isolation (application-level + PostgreSQL Row-Level Security)Must HaveArchitecture Gate
REQ-012Timestamps on all notes (created date, last modified date)Must HaveInitial
REQ-013Responsive web design (three-panel at ≥1024px; progressive collapse below)Must HaveBrief v1
REQ-014Account deletion (cascades all notes, versions, folders; permanent)Must HaveBrief v1
REQ-015Auto-save with debounce (2-second debounce; separate from version creation)Must HaveExpanded brief
REQ-016Note version history (30-second idle + any change = new version; all versions retained indefinitely; restore from history)Must HaveExpanded brief
REQ-017Public landing page (app description, feature highlights, registration CTA)Must HaveAudit finding AUDIT-001
REQ-018Keyboard shortcuts (Cmd/Ctrl+B bold, Cmd/Ctrl+I italic; others per plan)Should HavePlan Gate request
REQ-019Export note as Markdown (single-note download)Should HavePlan Gate request
REQ-020Full export to ZIP (complete collection; current content only; folder structure preserved)Should HaveCycle 2 demo request
REQ-021Global tagging system (Unicode letters/digits/hyphens; case-insensitive dedup; OR filter; search integration)Should HaveCycle 2 demo request
REQ-022Reading mode (distraction-free rendered view; keyboard toggle)Should HaveCycle 2 demo request

Non-functional requirements:

  • PostgreSQL as the database engine (Nexus-decided)
  • Monolithic server architecture (Nexus-decided)
  • Professional/technical design aesthetic throughout (ADR-008)
  • Rate limiting on authentication endpoints (security; SEC-001 → TASK-024)
  • CI pipeline passing before Builder tasks begin (DevOps exit criterion)

System metaphor: A personal library with a card catalog — each user has their own locked room containing their notes, organized in labeled drawers (folders), with a librarian’s index card system (full-text search) for fast retrieval. The librarian automatically stamps each card’s revision history as the writer pauses between sessions.

The system is a monolithic server-rendered web application backed by PostgreSQL. The frontend is a single-page React application shell served by the backend, providing a three-panel workspace: catalog sidebar, Markdown source editor, and live CommonMark preview.

Browser (React SPA)
├── Catalog sidebar ← note list, folder tree, tag filter, search
├── Editor panel ← CodeMirror 6 (syntax highlighting, shortcuts)
└── Preview panel ← markdown-it (live CommonMark rendering)
↕ REST API
Node.js + Express (monolith)
├── Auth routes ← session-based, express-session, bcrypt
├── Note / Folder / Tag routes ← ownership guard middleware
├── Version creation ← 30-second idle timer + diff check
└── FTS routes ← PostgreSQL tsvector + GIN index
↕ Sequelize ORM
PostgreSQL 16
├── users, notes, note_versions, folders, sessions
├── tags, note_tags
├── GIN tsvector index on notes
└── Row-Level Security policies (defense-in-depth)

Key decisions (ADRs):

ADRDecisionReason
ADR-001Node.js + Express, React, CodeMirror 6, markdown-it, SequelizeUnified JS stack; CodeMirror for production-grade editing; markdown-it is CommonMark-compliant
ADR-002Server-side sessions (express-session + connect-pg-simple), bcryptSession-based auth suits monolith; PostgreSQL-backed sessions survive restarts
ADR-003Five-table relational schema + WAL-mode PostgreSQLReferential integrity, CASCADE deletes, data durability
ADR-004Client-side 2s debounce for auto-save + 30s idle for versioningTwo distinct timers map directly to REQ-015/REQ-016; server-side diff authoritative
ADR-005PostgreSQL FTS: maintained tsvector + GIN index, weighted by title/bodyWeighted vectors match Carla’s search-by-keyword workflow; sub-linear at scale
ADR-006Application-level ownership guard + PostgreSQL RLSBelt and suspenders for per-user isolation
ADR-007Two Docker containers on nxlabs.cc (staging + production), shared Traefik + Watchtower + Uptime KumaIntegrates with existing shared infrastructure; Watchtower handles auto-deploy
ADR-008Tailwind CSS with constrained design token systemLocked config enforces professional/technical aesthetic without a Designer agent
ADR-009Progressive collapse responsive layout (CSS Grid, three breakpoints)Preserves information hierarchy at all viewport widths

Cycle 3 added two further ADRs: ADR-010 (tagging schema — UUID tags table, note_tags junction, tsvector trigger update) and ADR-011 (ZIP export via streaming archiver package).


The planner produced three task plans across the lifecycle. TASK-016 (workspace shell) was designated the first meaningful deliverable — all other UI and API tasks depend on it.

Cycle 1 — Walking Skeleton and Core (14 tasks)

Section titled “Cycle 1 — Walking Skeleton and Core (14 tasks)”
TaskDescriptionCoversIterations
TASK-001DevOps Phase 1 — CI pipeline, dev environment, DockerInfrastructure— (DevOps)
TASK-016Workspace layout shell and routingFoundation2
TASK-002Database schema, migrations, RLS role separationREQ-011, REQ-0121
TASK-003User registrationREQ-0012
TASK-004User login and logoutREQ-0022
TASK-005Ownership guard middleware and data isolationREQ-0112
TASK-006Create a note with persistenceREQ-0041
TASK-008Note catalog sidebarREQ-0082
TASK-011Public landing pageREQ-0171
TASK-007Split-pane Markdown editor with live previewREQ-0071
TASK-009Edit a note (API and editor integration)REQ-0051
TASK-010Delete a noteREQ-0061
TASK-012Auto-save with debounceREQ-0151
TASK-013Note version historyREQ-0161
TaskDescriptionCoversIterations
TASK-024Rate limiting on auth endpointsSEC-001 (deferred from Cycle 1)1
TASK-014Full-text searchREQ-0101
TASK-015Password reset flowREQ-0031
TASK-017Folder organisationREQ-0092
TASK-021DevOps Phase 2 — staging deploy, CI completionInfrastructure— (DevOps)
TASK-018Responsive designREQ-0131
TASK-025Keyboard shortcutsREQ-0182
TASK-026Export notes as MarkdownREQ-0191
TASK-019Account deletionREQ-0141
TASK-020Fitness function instrumentationNFR verification1

Cycle 3 — Stakeholder Features and Production (7 tasks)

Section titled “Cycle 3 — Stakeholder Features and Production (7 tasks)”
TaskDescriptionCoversNotes
TASK-027Tagging backend — schema, model, API, search integrationREQ-021ADR-010
TASK-028Tagging frontend — UI integrationREQ-021Depends on TASK-027
TASK-029Bulk export to ZIPREQ-020ADR-011
TASK-030Reading modeREQ-022
TASK-031DevOps Phase 3 — production environmentInfrastructure— (DevOps)
TASK-032Production monitoring — Uptime Kuma + AutoKumaInfrastructure— (DevOps)
TASK-033Sentinel security review — Cycle 3Security2 Medium findings fixed inline

Repository: github.com/loskylp/BrainDump Language: JavaScript (Node.js 20 backend, React 18 frontend) Backend dependencies: Express, Sequelize, express-session, connect-pg-simple, bcrypt, nodemailer, archiver, express-rate-limit Frontend dependencies: React, CodeMirror 6, markdown-it, Vite

backend/src/middleware/ownership.js Injects req.user.id into every authenticated request and enforces ownership on all note, folder, tag, and version operations. Combined with PostgreSQL RLS policies as a second enforcement layer (ADR-006).

backend/src/routes/notes.js Full CRUD for notes including auto-save endpoint (PUT /api/notes/:id), version creation trigger (POST /api/notes/:id/versions), and full-text search (GET /api/notes?q=). Ownership guard applied on every route.

backend/src/routes/auth.js Registration, login, logout, and password reset. Rate-limited at 10 requests per 15-minute window. Password reset tokens expire after 1 hour; response is identical for registered and unregistered emails (prevents user enumeration, REQ-003).

backend/src/routes/tags.js Tag CRUD, note-tag associations, and tag-filtered note listing. Tag names are normalized to lowercase; creates if not exists on inline creation. OR logic for multi-tag filter.

backend/migrations/ Seven migration files covering the full schema lifecycle: users → sessions → notes → note_versions → folders → tags + note_tags + tsvector trigger update. Each migration includes a down method.

frontend/src/components/Editor.jsx CodeMirror 6 integration with Markdown language support, key binding map (Cmd/Ctrl+B, Cmd/Ctrl+I), and 2-second debounce wired to the auto-save API. Reading mode toggle collapses the editor panel and expands the preview to full width.

frontend/src/components/Sidebar.jsx Note catalog with tag filter badges above the list, folder tree navigation, “New Note” button, and “Export All” button. Handles empty state, loading, and error states.

frontend/src/hooks/useVersionHistory.js Manages the 30-second client-side idle timer. On expiry, calls the version-check API endpoint; the server creates a version only if the content has changed since the last version. Timer resets on any keypress.

Five jobs run on every push to main and on every release tag (v*):

JobWhat it does
backend-lintESLint on backend source
backend-unitJest unit tests for all backend routes and models
backend-integrationAcceptance tests against a real PostgreSQL service container
frontend-lintESLint on frontend source
frontend-testVitest unit tests for React components and hooks

On v* tags, an additional job builds and pushes the Docker image to ghcr.io/loskylp/braindump:latest. Watchtower on nxlabs.cc polls the registry and performs a zero-downtime restart when a new digest lands.


Each task was verified by the Verifier agent running unit tests, acceptance tests, and (from Cycle 2 onward) CI regression confirmation against the live staging environment.

TaskACTestsCI
TASK-016 Workspace shell6/643
TASK-002 Schema + RLS10/10140
TASK-003 Registration6/6295
TASK-004 Login/logout6/6268
TASK-005 Ownership guard7/7335
TASK-006 Create note6/6419
TASK-008 Catalog sidebar5/5246
TASK-011 Landing page6/6549
TASK-007 Markdown editor8/8626
TASK-009 Edit note5/5480
TASK-010 Delete note6/6397
TASK-012 Auto-save7/7407
TASK-013 Version history10/10448

Sentinel — Cycle 1: SEC-001 (High: missing rate limiting on auth endpoints) deferred to Cycle 2 as TASK-024. SEC-003 (High: missing security headers) resolved inline by Sentinel before Demo Sign-off.

Demo Sign-off — Cycle 1: 12 Playwright scenarios validated against staging. Screenshots committed to tests/demo/. Two blocking issues required resolution before sign-off (see CI incident ESC-002 below).

Cycle 2 — CI green on all 5 jobs; staging confirmed per task

Section titled “Cycle 2 — CI green on all 5 jobs; staging confirmed per task”
TaskACResultCI Run
TASK-024 Rate limiting6/6PASS23376742012
TASK-014 Full-text search10/10PASS23383138143
TASK-015 Password reset8/8PASS23383805381
TASK-017 Folder organisation9/9PASS23385024748
TASK-021 DevOps Phase 28/8PASS23385582169
TASK-018 Responsive design6/6PASS23386191945
TASK-025 Keyboard shortcuts8/8PASS23388053947
TASK-026 Export as Markdown7/7PASS
TASK-019 Account deletion5/5PASS23386531154
TASK-020 Fitness instrumentationFF-D24/D04/D12/D16PASS23387142494

Demo Sign-off — Cycle 2: Playwright demo validation complete. Two inline bug fixes applied: TASK-025 keyboard shortcut styling, TASK-018 mobile sidebar. Screenshots committed.

TaskACResult
TASK-027 Tagging backend12/12PASS
TASK-028 Tagging frontendAC setPASS
TASK-029 Bulk ZIP export10/10PASS
TASK-030 Reading modeAC setPASS
TASK-031 DevOps Phase 37/10 PASS, 3 DEFERRED (operator actions)PASS
TASK-032 Production monitoringAutoKuma confirmedPASS
TASK-033 Sentinel security review0 Critical, 0 High unresolvedPASS

Demo Sign-off — Cycle 3: 12/12 Playwright scenarios PASS. Sentinel Medium findings resolved inline with Verifier confirmation. Screenshots committed.

Go-Live: v3.0.0 tag pushed, CI ran all 5 jobs green, Watchtower pulled :latest and started production container. First health check returned db: disconnected (transient warmup state); confirmed healthy within 60 seconds. Nexus confirmed: “Go live was a success.”


Between Cycle 1 completion and Demo Sign-off, the CI pipeline and staging environment were both unreachable. Four root causes were identified and fixed:

  1. No test:unit script in backend/package.json — CI job failed silently
  2. Missing ESLint config in backend/ — lint job failed on push
  3. Missing migration step before integration tests — tests ran against empty schema
  4. Frontend served only in NODE_ENV=production — staging used NODE_ENV=staging, so static files were never served

All four were fixed by the DevOps agent. Staging became reachable after an additional fix: Express session secure: true was set unconditionally, but nxlabs.cc terminates TLS at Traefik, so req.secure === false inside the container. Fix: trust proxy 1 added to Express config, enabling req.secure via the X-Forwarded-Proto header.


The Methodologist configured a full Commercial-profile swarm. Designer and Scribe were skipped; Builder handled UI directly from requirements, reviewed at Demo Sign-off.

AgentRoleContributed
MethodologistSet profile, configured active agents, managed retrospectives and manifest updatesMethodology Manifest (3 versions)
OrchestratorRouting, state management, gate transitions, escalation logproject-state.md, escalation-log.md, routing slips (20+)
AnalystRequirements discovery, brief writing, domain model, requirement iterationsbrief-v2.md, requirements-v4.md (4 versions)
AuditorRequirements consistency and testability review, architecture auditAudit reports for Requirements Gate and Architecture Gate
ArchitectSystem design, ADR production, fitness functionsarchitecture-overview-v1.md, 11 ADRs, 56 fitness functions
ScaffolderPer-cycle code structure scaffolding (3 cycles)Signatures, contracts, TODO-marked stubs for each cycle
PlannerTask decomposition (3 cycles, three-pass analysis)task-plan-v3.md (3 versions), dependency graphs
BuilderImplementation of all 31 tasksSource code, unit tests, migrations, CI configuration
VerifierAcceptance testing, CI monitoring, staging confirmation, commit protocolVerification reports, acceptance test files, demo scripts
SentinelSecurity review (3 cycles)SEC-001 through SEC-003 findings; Cycle 3 Medium findings resolved
DevOpsCI/CD pipeline, Docker setup, staging and production environmentsdocker-compose files, GitHub Actions workflows, deploy runbook

This run exposed 22 distinct framework improvement opportunities, documented in detail in BrainDump-RETROSPECTIVE.md. Summary of the most impactful:

Orchestrator role discipline:

  • The Orchestrator collapsed into a general-purpose agent in three patterns: direct task execution instead of dispatch (Pattern A), CI emergency self-service (Pattern B), and post-context-resume dispatch failures (Pattern C). Manifest v2 codified Rules 1 and 2 after Cycle 1; compliance improved significantly in Cycle 2.
  • Gate approval must authorise the full phase sequence — not just the first step. The Orchestrator asked for permission to call the Scaffolder after the Plan Gate was already approved.

DevOps and CI discipline:

  • TASK-001 was marked COMPLETE after file inspection — without a real push and green CI run. Four silent CI failures only surfaced during Cycle 1 execution. Rule added: DevOps Phase 1 is only COMPLETE after a push and a green CI run for all jobs.
  • The Verifier commit/push/CI protocol was not defined. Task is now only COMPLETE when the Verifier commits, pushes, and CI regression passes. Builder must not push.

Process artefact hygiene:

  • No commits were made for process/ artefacts during Cycle 1. If a context limit had hit before the final session commit, the routing slips, requirements, and architecture documents would have been unrecoverable from git history. Rule added: commit process artefacts after each agent produces output.

Demo validation:

  • Demo scripts were written as markdown documents with curl instructions — not executed. Cycle 3’s tagging feature had no demo script; TASK-029’s demo covered only the backend API. Rule added: demo scripts must be executed via Playwright with committed screenshots as evidence.

Framework infrastructure established:

  • The skills/ collection was created as a direct outcome of this project — starting with bash-execution.md, commit-discipline.md, demo-script-execution.md, and traceability-links.md.
  • The cd <dir> && <command> pattern triggered repeated permission prompts throughout. Rule added: all commands run from the working directory; no cd compound forms.

Terminal window
# Development
cd frontend && npm install && npm run dev # Vite dev server
cd backend && npm install && npm start # Express API
# Run full test suite
cd backend && npm test # Jest unit + acceptance
cd frontend && npm test # Vitest
# Docker (staging)
docker compose -f docker-compose.dev.yml up -d
# Acceptance tests only
cd backend && npx jest tests/acceptance/
# Demo scripts (Playwright)
cd tests/demo && npx playwright test

BrainDump v1.0.0 shipped with all 22 requirements satisfied across 31 tasks and 3 delivery cycles. The project ran from first prompt to production Go-Live in six days (2026-03-17 to 2026-03-22). The production service is live at braindump.nxlabs.cc.

As a framework validation, this run confirmed that the Commercial profile handles a real-world multi-cycle web project — managing scope growth, mid-cycle feature requests, a CI incident, security findings, and production deployment — while maintaining gate discipline and audit traceability. It also exposed 22 concrete framework improvement opportunities that were addressed before the next project begins, producing the skills/ collection and four new Manifest rules that address the most impactful failure modes observed.