Demo codebase for the Sourcegraph Code Monitoring video. Each file maps to a section of the video script.
db/config.yaml— the critical config file your monitor targets withfile:db/config.yaml type:diffdemo-changes/clean/config.yaml— the canonical clean config thatdemo:runanddemo:resetuse as their source of truthdemo-changes/01-config-change.patch— shows what to change (swap host to staging, bump pool size) to trigger the monitor
src/services/userService.ts— clean service code (before the bad change)demo-changes/clean/userService.ts— the canonical clean service file that the demo runner restores before applying the logging changedemo-changes/02-debug-util.ts— the dangerouslogSensitiveData()function to commit, triggering thelogSensitiveData() type:diffmonitordemo-changes/02-sensitive-logging.patch— shows the import + call to add touserService.ts
These make the codebase feel like a real project:
src/services/paymentService.ts— payment processing servicesrc/utils/database.ts— loadsdb/config.yamland provides a query interfacesrc/utils/logger.ts— structured logging utilityscripts/debug-users.ts— debug script
- Commit the "clean" codebase first
- Make the changes from
demo-changes/to produce the diffs that Sourcegraph's Code Monitors would catch
npm run demo:run— rewrites the tracked demo files from canonical clean fixtures, then applies the config change, sensitive logging change, and debug util filenpm run demo:reset— restores the tracked demo files back to the canonical clean state and removes the debug utilnpm run demo:status— reports whether the workspace is in the clean, demo, or invalid mixed statenpm test— verifiesrun,reset, and repeated demo cycles stay deterministic
- Run
npm run demo:statusand confirm the overall state isclean - Run
npm run demo:runto apply the monitor-triggering changes - Run
npm run demo:statusagain and confirm the overall state isdemo - Run
npm run demo:resetwhenever you want to get back to the clean production-style baseline
The demo runner no longer uses a hidden local snapshot, so repeated run -> reset -> run cycles stay deterministic on the same machine.