fix: add dotenv loading to migration scripts + create inst_036 anti-quick-fix rule

MongoDB authentication fixes:
- load-inst-035.js: Add dotenv.config() to load .env file
- migrate-value-pluralism-docs.js: Add dotenv.config() to load .env file
- Scripts now properly authenticate with production MongoDB

Governance enhancement:
- inst_036: NEVER attempt quick fixes when working with human PM
- Prohibits shortcuts, workarounds, partial implementations
- Requires proper root cause analysis and thorough solutions
- Exception only for critical production outages
- Enforces inst_004 (world-class quality) in all development

Root cause: Scripts weren't loading .env, couldn't access MongoDB credentials
Impact: Production migrations will now work correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TheFlow 2025-10-12 16:47:22 +13:00
parent ae6bef384a
commit 0da6cf7d45
3 changed files with 43 additions and 4 deletions

View file

@ -767,20 +767,53 @@
},
"active": true,
"notes": "CORE VALUE PLURALISM IMPLEMENTATION 2025-10-12 - Precedent database design prevents rigid hierarchy while enabling learning from past deliberations. Precedents are PROVISIONAL (Gutmann & Thompson) - decisions aren't final, they're revisable. Key distinction: precedent = 'in similar past case we did X' NOT 'therefore you must do X'. Context matters: scale changes (1000 users → 87 million users = re-deliberate), new evidence (theoretical harm now documented = re-deliberate), changed circumstances = review. Git-like versioning tracks how thinking evolved over time."
},
{
"id": "inst_036",
"text": "NEVER attempt quick fixes, shortcuts, or workarounds when working with human project managers on development tasks. Quick fixes violate inst_004 (world-class quality) and undermine proper implementation. When facing a problem: (1) Analyze root cause thoroughly, (2) Implement proper solution even if it takes longer, (3) Document the fix comprehensively, (4) Test the implementation. ONLY exception: Critical production outages where immediate mitigation prevents severe harm AND proper fix follows immediately after. Quick fix patterns include: adding content directly to HTML instead of proper data integration, hardcoding instead of configuration, bypassing authentication/validation, skipping error handling, placeholder implementations marked TODO. When tempted to take shortcut, STOP and ask: 'Is this how I'd build it if quality and maintainability were the only constraints?' If no, implement properly.",
"timestamp": "2025-10-12T16:42:00Z",
"quadrant": "STRATEGIC",
"persistence": "HIGH",
"temporal_scope": "PERMANENT",
"verification_required": "MANDATORY",
"explicitness": 1.0,
"source": "user",
"session_id": "2025-10-12-deployment-and-governance",
"parameters": {
"prohibited_quick_fixes": [
"direct_html_content_instead_of_mongodb_integration",
"hardcoded_values_instead_of_configuration",
"bypassing_authentication_or_validation",
"skipping_error_handling",
"placeholder_todos_in_production",
"copying_code_without_understanding",
"partial_implementation_marked_complete"
],
"exception_criteria": {
"production_outage": "Critical failure affecting users",
"immediate_mitigation": "Quick fix prevents severe harm",
"proper_fix_follows": "Full solution implemented within same session or next"
},
"quality_test": "Would you build it this way if quality/maintainability were only constraints?",
"trigger_conditions": ["development_with_human_pm", "implementation_tasks", "bug_fixes", "feature_additions"],
"related_instructions": ["inst_004"]
},
"active": true,
"notes": "CRITICAL REQUIREMENT 2025-10-12 - During value pluralism deployment, I attempted to add documents to docs.html Resources section as quick fix instead of properly integrating via MongoDB. User immediately rejected: 'no quick fixes please do this properly'. This violated inst_004 (world-class quality) and user's explicit intent for proper implementation. Quick fixes create technical debt, reduce maintainability, and undermine quality standards. Root cause: Optimization for speed over quality when working with project stakeholders. User feedback made clear: when PM requests implementation, they expect proper engineering, not shortcuts. Quick fixes are disrespectful to the project and future maintainers. Exception only for critical production outages where harm prevention requires immediate mitigation before proper fix."
}
],
"stats": {
"total_instructions": 35,
"active_instructions": 35,
"total_instructions": 36,
"active_instructions": 36,
"by_quadrant": {
"STRATEGIC": 8,
"STRATEGIC": 9,
"OPERATIONAL": 16,
"TACTICAL": 2,
"SYSTEM": 10,
"STOCHASTIC": 0
},
"by_persistence": {
"HIGH": 32,
"HIGH": 33,
"MEDIUM": 2,
"LOW": 0,
"VARIABLE": 0

View file

@ -5,6 +5,9 @@
* This resolves the startup warning about missing inst_035
*/
// Load environment variables from .env file
require('dotenv').config();
const mongoose = require('mongoose');
const config = require('../src/config/app.config');

View file

@ -3,6 +3,9 @@
* Adds three new value pluralism documents to the documents collection
*/
// Load environment variables from .env file
require('dotenv').config();
const mongoose = require('mongoose');
const marked = require('marked');
const fs = require('fs').promises;