Engineering governance
Prerequisite: node-domain-boundaries-and-maintainability. Objective: Review compatibility and ownership policy. 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
For additive response fields, existing tolerant consumers may continue working, but strict consumers can still reject them. Removing or changing a required field is generally breaking. Define the actual contract, track consumers and version policies, and check compatibility with recorded fixtures. Assign owners for migrations and retention decisions; legal retention requirements must be verified independently. Keep changes traceable with review, test evidence and a rollback or forward-fix plan.
Check required fields in a response
function compatible(body){return typeof body.id==='string'&&Number.isInteger(body.quantity);}console.log(compatible({id:'o1',quantity:2,status:'ready'}),compatible({id:'o1',quantity:'2'}));Expected output:
true falseThe tolerant consumer accepts an extra field but rejects a type change.
Check migration sign-off
const plan={owner:'orders team',consumerTests:true,restoreTest:false};console.log(Boolean(plan.owner)&&plan.consumerTests&&plan.restoreTest);Expected output:
falseThe fictional policy requires both consumer and recovery evidence.
Common mistake
Do not assume semantic versioning or a passing schema check alone proves compatibility for all consumers.
Practice
Draft a deprecation policy for renaming quantity to count; include a compatibility window and consumer tests.
Reference candidate: node-engineering-governance-lookup (route unverified). Original instructional model; independent source review pending.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Engineering governance — knowledge check
Apply the lesson to a fresh scenario and explain the evidence boundary.
What can break a strict consumer?
Who owns a migration?
What should accompany a breaking change?