Capstone operations and handoff
Prerequisite: node-capstone-implementation-and-tests. Objective: Present security tests recovery and evidence. Each example is independent. Use Node.js 22.16.0 in a disposable directory; save as main.mjs and run node main.mjs. No external service is contacted.
How it works
Document the runtime, schema version, artifact digest, health checks, alerts, threat model, backup and recovery objectives, known limitations and owners. Use least privilege, bounded queue processing and tenant-specific cache keys. The local project uses a persistent outbox; consumers must deduplicate by event identity if delivery is repeated. For production, select an actual supported database and backup mechanism, enforce real identity and TLS, test load and restore under the intended environment. Fictional cost rates are design assumptions.
Verify restore from a closed SQLite fixture
import {DatabaseSync} from 'node:sqlite';import {copyFileSync} from 'node:fs';let db=new DatabaseSync('orders.db');db.exec("CREATE TABLE orders(id TEXT PRIMARY KEY); INSERT INTO orders VALUES('o1')");db.close();copyFileSync('orders.db','restored.db');db=new DatabaseSync('restored.db');console.log(db.prepare('SELECT COUNT(*) AS n FROM orders').get().n);db.close();Expected output:
1A closed, default-journal lab database is copied and reopened. This is not a live WAL backup recipe.
Require independent release gates
const checks={tests:true,restore:true,realAuth:false,productionLoad:false};console.log(Object.values(checks).every(Boolean));Expected output:
falseLocal tests and restore do not establish production authentication or capacity.
Common mistake
Do not copy an active database file as a universal backup method, and do not label a local fixture as production-ready.
Practice
Write a recovery checklist that identifies the data loss window, restore test, credential dependencies and who authorizes switching traffic.
Reference candidate: node-capstone-operations-and-handoff-lookup (route unverified). Documentation anchor: https://nodejs.org/download/release/v22.21.0/docs/api/sqlite.html (related documentation, not exact-version validation).
Administrative lab: staged-capstone/README.md. Run only the supplied synthetic fixture; no production deployment authorized.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Capstone operations and handoff — knowledge check
Apply the lesson to a fresh scenario and explain the evidence boundary.
What establishes backup usefulness?
What does a local capstone not prove?
What is an outbox consumer expected to handle?