Implements architectural enforcement of governance rules (inst_016/017/018/079) for all external communications. Publication blocked at API level if violations detected. New Features: - Framework content checker script with pattern matching for prohibited terms - Admin UI displays framework violations with severity indicators - Manual "Check Framework" button for pre-publication validation - API endpoint /api/blog/check-framework for real-time content analysis Governance Rules Added: - inst_078: "ff" trigger for manual framework invocation in conversations - inst_079: Dark patterns prohibition (sovereignty principle) - inst_080: Open source commitment enforcement (community principle) - inst_081: Pluralism principle with indigenous framework recognition Session Management: - Fix session-init.js infinite loop (removed early return after tests) - Add session-closedown.js for comprehensive session handoff - Refactor check-csp-violations.js to prevent parent process exit Framework Services: - Enhanced PluralisticDeliberationOrchestrator with audit logging - Updated all 6 services with consistent initialization patterns - Added framework invocation scripts for blog content validation Files: blog.controller.js:1211-1305, blog.routes.js:77-82, blog-curation.html:61-72, blog-curation.js:320-446 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
2.7 KiB
JavaScript
Executable file
64 lines
2.7 KiB
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Add inst_078: "ff" Framework Trigger
|
|
* Adds instruction about the "ff" codeword for manual framework invocation
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const INSTRUCTION_FILE = path.join(__dirname, '../.claude/instruction-history.json');
|
|
|
|
// Load current instruction history
|
|
const history = JSON.parse(fs.readFileSync(INSTRUCTION_FILE, 'utf8'));
|
|
|
|
// New instruction
|
|
const newInstruction = {
|
|
"id": "inst_078",
|
|
"text": "When user prefixes prompt with 'ff' (Framework Full), invoke framework-audit-response.js script BEFORE responding. This triggers ALL 6 framework services (BoundaryEnforcer, PluralisticDeliberationOrchestrator, MetacognitiveVerifier, CrossReferenceValidator, ContextPressureMonitor, InstructionPersistenceClassifier) for conversational responses that don't use Edit/Write/Bash tools. Usage: node scripts/framework-audit-response.js --prompt \"user question\" --type \"boundary_question\". Include audit IDs in response.",
|
|
"timestamp": new Date().toISOString(),
|
|
"quadrant": "SYSTEM",
|
|
"persistence": "HIGH",
|
|
"temporal_scope": "PROJECT",
|
|
"verification_required": "MANDATORY",
|
|
"explicitness": 0.95,
|
|
"source": "user",
|
|
"session_id": "2025-10-25-ff-trigger-implementation",
|
|
"parameters": {
|
|
"trigger": "ff",
|
|
"script": "scripts/framework-audit-response.js",
|
|
"purpose": "manual_framework_invocation",
|
|
"services": ["BoundaryEnforcer", "PluralisticDeliberationOrchestrator", "MetacognitiveVerifier", "CrossReferenceValidator", "ContextPressureMonitor", "InstructionPersistenceClassifier"]
|
|
},
|
|
"active": true,
|
|
"notes": "Extends PreToolUse hook architecture to conversational responses. Provides audit trail for VALUES/WISDOM/INNOVATION boundary decisions."
|
|
};
|
|
|
|
// Check if inst_078 already exists
|
|
const existingIndex = history.instructions.findIndex(i => i.id === 'inst_078');
|
|
|
|
if (existingIndex >= 0) {
|
|
console.log('⚠️ inst_078 already exists - updating...');
|
|
history.instructions[existingIndex] = newInstruction;
|
|
} else {
|
|
console.log('✅ Adding new instruction: inst_078');
|
|
history.instructions.push(newInstruction);
|
|
}
|
|
|
|
// Update metadata
|
|
history.version = "3.9";
|
|
history.last_updated = new Date().toISOString();
|
|
|
|
// Write back
|
|
fs.writeFileSync(INSTRUCTION_FILE, JSON.stringify(history, null, 2));
|
|
|
|
console.log('✅ inst_078 added successfully');
|
|
console.log('📄 File:', INSTRUCTION_FILE);
|
|
console.log('📊 Total instructions:', history.instructions.length);
|
|
console.log('\nInstruction content:');
|
|
console.log(' ID:', newInstruction.id);
|
|
console.log(' Trigger:', newInstruction.parameters.trigger);
|
|
console.log(' Script:', newInstruction.parameters.script);
|
|
console.log(' Persistence:', newInstruction.persistence);
|
|
console.log(' Quadrant:', newInstruction.quadrant);
|