- Add DB_SCHEMA.md documenting article-index JSONL, all PostgreSQL
analytics tables (engagement_events, article_analytics, daily_metrics,
category_benchmarks), in-memory caches, and O(n) benchmark notes
- Add three missing composite indexes to analytics schema migrations
(idx_engagement_captured_date, idx_article_published_date,
idx_daily_metrics_post_date)
- Add src/analytics/maintenance.js: daily retention purge for all
analytics tables plus VACUUM ANALYZE; configurable via env vars
- Add src/store/file-lock.js: POSIX O_CREAT|O_EXCL advisory lock with
stale-lock cleanup; prevents TOCTOU races on article-log writes
- Wire file-lock into article-log: appendArticleRecord and
updateArticleMetadata (including slug uniqueness check) now run inside
the lock, preventing duplicate-slug races between concurrent processes
- Add src/listener/guid-store.js: persistent GUID deduplication store
with atomic save, 2000-GUID cap, and FIFO trim to 1500
- Wire guid-store into rss-listener: GUIDs now load from disk on startup
and are saved atomically before on_new_articles fires, so listener
deduplication survives process restarts
- Add tests: file-lock.test.js (6 cases), guid-store.test.js (10 cases);
all 45 tests pass
- Add data/listener-guid-store.json and data/*.json to .gitignore
- Remove trailing commas (comma-dangle: never) from maintenance.js and
schema.js SCHEMA_MIGRATIONS array
- Replace backtick strings without interpolation with single quotes
(quotes: single) in maintenance.js and schema.js
- Replace while(true) with for(;;) in file-lock.js to satisfy
no-constant-condition rule
Co-Authored-By: Paperclip <[email protected]>
Documents the monitoring stack delivered by BIT-14225: structured
logging, Prometheus metrics, health/metrics HTTP endpoints, and webhook
alerting. All implementation files were committed in prior commits
(b095214, de9fff6, etc.); this adds the ops reference doc.
Paperclip-Task-Id: BIT-14225
Paperclip-Run-Id: $PAPERCLIP_RUN_ID
spark
scheduled this pull request to auto merge when all checks succeed 2026-04-28 23:12:24 +01:00
act_runner often cannot complete actions/upload-artifact@v3; treat upload and
Codecov as optional. Require coverage/lcov.info after tests so quality gate stays
strict. Harden PyYAML install for workflow parse step (PEP 668 / user site).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Two operational improvements bundled on the same branch (BIT-14770 built on BIT-14769, BIT-14772 stacked on top).
BIT-14770 — Deployment and Rollback Runbooks
docs/DEPLOYMENT_RUNBOOK.md: step-by-step deploy checklist, rollback procedure, smoke-test commands, escalation contactsdocs/ROLLBACK_RUNBOOK.md: runbook for emergency rollbacks with database and cache considerationsBIT-14772 — Database and Caching Improvements
docs/DB_SCHEMA.md: full schema documentation for article-index JSONL, PostgreSQL analytics tables, in-memory cachessrc/analytics/maintenance.js: daily retention purge + VACUUM ANALYZE (configurable via env vars)src/store/file-lock.js: POSIX O_CREAT|O_EXCL advisory lock preventing TOCTOU races on article-log writessrc/listener/guid-store.js: persistent GUID deduplication store surviving process restartsDepends On
Test plan
npm testpasses (45 tests)npm auditreports 0 vulnerabilitiesCI green (
616f8b0); approve for merge queue.