Commit graph

184 commits

Author SHA1 Message Date
TheFlow
be59c6dd52 fix: inline FAQ markdown rendering and add inst_040
## Bug Fixes
- Fixed inline FAQ markdown rendering with error handling
- Added try-catch around marked.parse() for inline FAQs
- Added fallback to plain text with line breaks on parse failure
- Enhanced logging for FAQ rendering diagnostics

## New Instruction (inst_040)
Created rule requiring complete coverage when user says "all":
- "update all pages" means EVERY page, not representative subset
- Must identify complete scope before starting
- Verify ALL items processed before marking complete
- Ask user to prioritize if scope >20 items

## Rationale
User reported inline FAQs showing raw markdown instead of formatted HTML.
Root cause: createInlineFAQItemHTML lacked error handling that was added
to createFAQItemHTML in previous version. Both functions now have consistent
error handling with logging.

User directive: When saying "all", Claude must not choose subset.

## Version
- Bumped to 1.0.5
- Force update enabled
- Synced inst_040 to production

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 12:51:08 +13:00
TheFlow
720594199e fix: FAQ modal scrolling and standardize footers
## FAQ Modal Fixes
- Fix modal scrolling: changed max-h-[85vh] to h-[85vh] with min-h-0
- Added flex-shrink-0 to modal header for proper flex behavior
- Users can now scroll through all 30 FAQ questions (was stuck at 8)
- Enhanced markdown parsing with error handling and fallback

## UI Improvements
- Removed Quick Actions section from FAQ page per user request
- Standardized footer across 7 user-facing pages
- Added Newsletter link under Community section in all footers

## Pages Updated
- faq.html, researcher.html, implementer.html, leader.html
- about.html, media-inquiry.html, case-submission.html

## Version
- Bumped to 1.0.4 with force update enabled
- Service worker cache updated

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 12:46:23 +13:00
TheFlow
7cd10978f6 docs: regenerate PDFs and update documentation metadata
- Regenerated all PDF downloads with updated timestamps
- Updated markdown metadata across documentation
- Fixed ContextPressureMonitor test for conversation length tracking
- Documentation consistency improvements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:53:48 +13:00
TheFlow
a754787555 feat: enhance FAQ for Leader audience and improve navigation
**FAQ Enhancements:**
- Added 6 new Leader-focused questions (TCO, board justification, liability, metrics, compliance)
- Reordered all 28 questions to prioritize Leaders (IDs 1-18)
- Added sorting by ID to ensure consistent order
- Improved question categorization and keywords

**UI Improvements:**
- Enhanced search and filter functionality
- Improved markdown rendering in FAQ answers
- Better accessibility and keyboard navigation

Leaders now see business-critical questions first, followed by
technical implementation and research questions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:53:47 +13:00
TheFlow
f19154c9e6 feat: add version control system and PWA support
Implements cache busting and progressive web app features:

**Version Management:**
- version.json manifest with changelog tracking
- Service worker with automatic update checking (hourly)
- Update notification UI with changelog display
- Configurable forced updates after timeout
- Cache control headers for optimal performance

**PWA Features:**
- manifest.json with app shortcuts
- Apple touch icon support
- "Add to Home Screen" functionality
- Offline support via service worker

**Cache Strategy:**
- HTML: 5-minute cache with revalidation
- CSS/JS: 1-year immutable cache
- Images: 1-year immutable cache
- version.json/service-worker.js: no-cache

**Integration:**
- All main pages updated with PWA meta tags
- Version manager loaded on all user-facing pages
- Production deployment successful

Users who previously visited the site will now automatically receive
update notifications when version changes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:53:29 +13:00
TheFlow
c984ebfd7d feat: add runtime-agnostic architecture page with honest early-stage positioning
Created new /architecture.html page with generic architecture diagram that emphasizes Tractatus works with any agent runtime (not just Claude Code). Revised tone to reflect early-stage research status, including limitations section and call for industry collaboration, per user feedback on avoiding overconfident claims.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 21:51:58 +13:00
TheFlow
a925a1851c fix: content accuracy updates per inst_039
Updates service count references and removes prohibited language:

1. PITCH-EXECUTIVE.md:
   - Updated "five core constraint types" → "six core services"
   - Added PluralisticDeliberationOrchestrator (6th service)
   - Reordered services for clarity (persistence first)

2. BLOG-POST-OUTLINES.md:
   - Fixed "Structural guarantees" → "Structural constraints"
   - Complies with inst_017 (no absolute assurance terms)

3. PHASE-2-EMAIL-TEMPLATES.md:
   - Fixed "structural guarantees" → "structural constraints"
   - Complies with inst_017

4. .claude/instruction-history.json:
   - Added inst_039: Content accuracy audit protocol
   - Mandates 5→6 service updates and rule violation checks
   - Synced to production

Content audit findings:
- docs/markdown/ files already accurate (historical context is correct)
- Only 2 prohibited language violations found (both fixed)
- Most "guarantee" references are in rule documentation (acceptable)

Implements: inst_039 (content accuracy during card presentations)
Related: inst_016, inst_017, inst_018 (prohibited language)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 23:16:17 +13:00
TheFlow
e7e3598aeb feat: add inst_039 (background task cleanup) + optimal session startup guide
inst_039: Mandatory background task cleanup before session handoff
- Kill background bash shells (KillShell tool)
- Clean up ports (lsof -ti:PORT | xargs -r kill -9)
- Prevent resource leaks and next-session confusion

OPTIMAL_SESSION_STARTUP.md: Complete guide for session management
- 40-message limit (PRIMARY constraint, not 200k tokens)
- Compaction tracking (0/1/2/3) with multipliers
- Emergency handoff protocol
- Common mistakes to avoid

Key insight: Message count >> token count for predicting compactions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 22:54:10 +13:00
TheFlow
37687c7fe7 feat: fix pressure monitor for conversation length and compaction tracking
CRITICAL FIXES for session management:

1. **Increased conversation length weight** (0.25→0.40)
   - Conversation decay is PRIMARY cause of compacting events
   - Each compaction: 1-3min disruption + critical context loss
   - Message count now MORE important than token count

2. **Reduced other weights** for proper balance:
   - Token usage: 0.35→0.30 (still important, but secondary)
   - Error frequency: 0.15→0.10
   - Instruction density: 0.10→0.05
   - Total still equals 1.0

3. **Added compaction multipliers**:
   - 1st compaction: 1.5x pressure boost
   - 2nd compaction: 3.0x pressure (CRITICAL)
   - 3rd+ compaction: 5.0x pressure (DANGEROUS)

4. **Reduced conversation thresholds**:
   - Critical: 100→40 messages (compacting observed at ~60)
   - Danger: 150→60 messages

5. **Updated script**: Added --compactions parameter

Example: 70 messages + 2 compactions = 100% conversation pressure
(70/40 * 3.0x = 5.25, capped at 1.0) → HIGH overall (58.3%)

Resolves: Frequent compacting events not properly reflected in pressure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 22:51:30 +13:00
TheFlow
dcb778726b docs: fix Introduction language violations and add database utility scripts
- Remove absolute claims from Introduction ("guarantees" -> "constraints")
- Align with TRA-VAL-0001 "Honest Limitations" principle
- Add compare-databases.js for dev/prod sync verification
- Add check-sections.js to audit card presentation status
- Add fix-category-mismatches.js for category corrections
- Fix Document.model.js metadata update handling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 22:41:04 +13:00
TheFlow
7744221bf0 fix: move value pluralism FAQ to advanced-topics and collapse technical-reference
- Move 'value-pluralism-faq' from getting-started to advanced-topics
- Set technical-reference category to collapsed by default (only getting-started open)
- Getting Started now has 2 docs (Introduction, Core Concepts)
- Advanced Topics now has 6 docs (includes Value Pluralism FAQ)
- Cache busted docs-app.js (v=0.1.0.1760258358)

Final category distribution:
- getting-started: 2 (expanded)
- technical-reference: 11 (collapsed)
- research-theory: 4 (collapsed)
- advanced-topics: 6 (collapsed)
- case-studies: 6 (collapsed)
- business-leadership: 1 (collapsed)
- archives: 2 (collapsed)
2025-10-12 21:39:32 +13:00
TheFlow
87cf83e54a fix: improve category migration script with precise slug-based mapping
- Replace fuzzy title matching with explicit slug-to-category mapping
- Add 'advanced-topics' category for value pluralism and research docs
- Redistribute deployment docs to appropriate categories
- Move internal docs (Koha, Phase guides) to archived
- Fixes docs.html sidebar categories not collapsing (4th attempt)
- Root cause: Production MongoDB documents lacked category field
2025-10-12 21:21:35 +13:00
TheFlow
36019ce3c9 chore: cache busting for document review updates
Updated cache version to v=0.1.0.1760254958072 across all HTML files
to ensure users receive latest document corrections.
2025-10-12 20:42:46 +13:00
TheFlow
a00d199628 fix: update value pluralism FAQ with correct implementation status
CRITICAL FIX: Document incorrectly stated PluralisticDeliberationOrchestrator
was in 'Planning / Research phase' - it's actually implemented as the 6th
mandatory service (October 2025).

Changes:
- Updated status from planning to implemented
- Added current capabilities list
- Fixed GitHub placeholder link
- Converted file paths to proper web links
2025-10-12 20:41:41 +13:00
TheFlow
9d336e4ee5 docs: fix GitHub URLs and navigation links in foundational documents
- Fixed GitHub repository URLs (anthropics org, not AgenticGovernance)
- Updated navigation links to use specific document URLs instead of generic /docs.html
- Added instruction persistence system explanation to introduction
- Regenerated PDFs with corrections
2025-10-12 20:40:08 +13:00
TheFlow
a5b8f90e88 fix: CSP-compliant category collapsing + cache busting
- Remove inline styles from category rendering (CSP violation)
- Apply collapsed state via JavaScript after DOM insertion
- Update cache version to v=0.1.0.1760254264664 across all HTML files
- Categories now properly collapsed on page load (Research, Advanced, Case Studies, Business, Archives)
2025-10-12 20:32:34 +13:00
TheFlow
86b32929c3 feat: reorganize document categories with intuitive structure
- Add 'Advanced Topics' category for value pluralism & deep dives
- Rename Value Pluralism FAQ to 'Understanding Value Pluralism'
- Restore research documents from archives (Research Foundations, Organizational Theory, etc.)
- Set most categories to collapsed by default for cleaner UX
- Restore Executive Brief to Business & Leadership
- Archive PoC session summaries
- Create comprehensive migration script for recategorization
2025-10-12 20:24:47 +13:00
TheFlow
37f5556473 fix: use correct env var names (MONGODB_URI not MONGO_URI) 2025-10-12 20:01:28 +13:00
TheFlow
0b5d5cd3dd fix: add dotenv loading to migration script for production auth 2025-10-12 20:00:32 +13:00
TheFlow
4d086831c1 feat: add migration script for value pluralism documents
Adds visibility and order fields to the 3 value pluralism documents
so they display correctly in the docs.html sidebar.

🤖 Generated with Claude Code
2025-10-12 19:56:53 +13:00
TheFlow
4de439a325 docs: update framework to 6 services with PluralisticDeliberationOrchestrator
- Updated all core documentation (introduction, core-concepts, implementation guides)
- Added comprehensive PluralisticDeliberationOrchestrator sections
- Fixed implementation-guide-v1.1.md (BlogCuration → PluralisticDeliberationOrchestrator)
- Updated UI pages (index, researcher, leader) to reflect 6 services
- Enhanced cache busting with unified version script
- FAQ already includes comprehensive value pluralism coverage (Q18-22)

Framework now correctly documents all 6 mandatory services:
1. InstructionPersistenceClassifier
2. CrossReferenceValidator
3. BoundaryEnforcer
4. ContextPressureMonitor
5. MetacognitiveVerifier
6. PluralisticDeliberationOrchestrator (added October 2025)

🤖 Generated with Claude Code
2025-10-12 19:55:44 +13:00
TheFlow
90d3db31de security: remove sensitive internal documentation from public repository
Removed 16 sensitive files from git tracking to protect internal processes:

Root directory (5 files):
- CLAUDE_Tractatus_Maintenance_Guide.md
- DEPLOYMENT-2025-10-08.md
- NEXT_SESSION.md
- NEXT_SESSION_OPENING_PROMPT.md
- SESSION_CLOSEDOWN_20251006.md

docs/ directory (11 files):
- KOHA_PRODUCTION_DEPLOYMENT.md
- PHASE-2-DEPLOYMENT-GUIDE.md
- PRODUCTION_DEPLOYMENT_CHECKLIST.md
- SESSION-2025-10-07-AI-FEATURES.md
- SESSION-HANDOFF-2025-10-12.md
- SESSION_HANDOFF_2025-10-10.md
- SESSION_HANDOFF_2025-10-11.md
- SESSION_HANDOFF_2025_10_11.md
- SESSION_HANDOFF_2025_10_11_P3_P4.md
- SESSION_INIT_API_MEMORY_AUDIT.md
- planning/PHASE_3_SESSION_1_SUMMARY.md

These files contain:
- Internal workflow documentation
- Deployment procedures and server details
- Session handoff information
- Planning and strategy documents

Security posture:
 Files removed from tracking (won't appear in new commits)
 Files remain on disk for local use
 .gitignore already blocks these patterns
 .rsyncignore blocks deployment to production
⚠️ Files remain in git history (accessible via git log)

Note: This is low-risk remediation. Files remain in history but won't
be visible in file browser or future commits. For complete removal,
git history rewrite would be needed (high risk, requires force push).

Risk assessment: Medium exposure (internal processes visible) but no
credentials, keys, or direct access information exposed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 17:09:00 +13:00
TheFlow
6d4715519e fix(ui): fix FAQ answer truncation and implement cache busting
Two fixes for production deployment:

1. FAQ Answer Truncation Fix:
   - Changed max-height from 2000px to none in faq.html
   - Allows answers to expand to full height without cutting off
   - Fixes Q18-Q22 (value pluralism) answers being truncated

2. Cache Busting:
   - Updated version from v=1.0.3 to v=1.0.4
   - Forces browser cache refresh for JavaScript and CSS
   - Ensures value pluralism documents visible in docs.html sidebar
   - Updated in both faq.html and docs.html

User feedback: "Some of the Answers in the new Q&As are cutting off
the bottom end of the Answer" and "I cannot find the three new files
in the left sidebar at docs.html on production"

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 17:02:03 +13:00
TheFlow
81270b0897 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>
2025-10-12 16:47:22 +13:00
TheFlow
380e3b0513 docs: add production deployment summary for value pluralism
Complete deployment documentation including:
- 14 atomic commits summary
- Production server verification
- Security checks passed
- All services operational
- Performance metrics
- Known issues (MongoDB migrations)

Deployment complete at https://agenticgovernance.digital

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:42:57 +13:00
TheFlow
f2e3155e2b docs: update implementation roadmap and UI pages
- Update integrated implementation roadmap with Phase 2 completions
- Update blog curation admin interface
- Update implementer page with value pluralism content

Reflects October 12 production status

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:37:58 +13:00
TheFlow
d814e09762 docs: update markdown documentation for value pluralism
- Update glossary (v1.1) with value pluralism terminology
- Update case studies with value pluralism examples
- Update core concepts to include foundational pluralism
- Update introduction with 6th core service
- Update technical architecture and comparison matrix
- Update implementation guide with value pluralism sections

All markdown reflects 6-service production architecture

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:37:37 +13:00
TheFlow
974f812509 docs: update maintenance guide and README for 6th core service
- Document PluralisticDeliberationOrchestrator as 6th mandatory service
- Update service initialization procedures
- Add value pluralism governance principles
- Update README with current framework status

Reflects production-ready 6-service architecture

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:37:09 +13:00
TheFlow
156aefec38 docs: add session handoff documentation for value pluralism
- session-handoff-2025-10-12-FINAL.md: Production-ready summary
  - 779 lines of production code
  - 219 tests passing (0 failures)
  - 0 server warnings
  - Complete implementation checklist

- session-handoff-2025-10-12-complete.md: MongoDB integration phase
- session-handoff-2025-10-12-test-validation.md: Test validation phase

Comprehensive documentation of multi-phase implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:36:51 +13:00
TheFlow
39111d4a8e feat(ui): integrate value pluralism documents in docs viewer
- Update docs.html with MongoDB-integrated documents
- Add value pluralism documents to sidebar categories
- Update docs-app.js for proper document retrieval
- Sync navbar changes across UI pages

Documents now searchable and properly categorized in docs viewer

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:36:42 +13:00
TheFlow
db3126c041 feat(ui): add value pluralism Q&A to FAQ (Q18-Q22)
- Q18: What is value pluralism and why Tractatus uses it
- Q19: How Tractatus handles moral disagreement without hierarchy
- Q20: What makes value pluralism different from relativism
- Q21: How urgent decisions work with value pluralism
- Q22: Can organizations use this without adopting specific values

Added 5 comprehensive questions with researcher/leader audience tags
FAQ now covers full value pluralism approach

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:36:33 +13:00
TheFlow
21a6b33fce docs: add value pluralism documentation and research foundations
- pluralistic-values-research-foundations.md (43KB)
  - Academic grounding for PluralisticDeliberationOrchestrator
  - Deliberative democracy theory
  - Cross-cultural communication principles
  - Value pluralism philosophy
  - References to Berlin, Rawls, Habermas

- value-pluralism-faq.md (17KB)
  - User-facing explanation of foundational pluralism
  - Q&A format for accessibility
  - How Tractatus handles moral disagreement

- pluralistic-values-deliberation-plan-v2.md (42KB)
  - Technical design document
  - Implementation roadmap
  - Service architecture details
  - Integration with existing framework

Migrated to MongoDB for docs.html integration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:36:13 +13:00
TheFlow
09f7eaa5f7 feat(scripts): add value pluralism support scripts
- load-inst-035.js: Load precedent database rule to MongoDB
  - Fixes collection name (governanceRules vs governance_rules)
  - Eliminates "Precedent database rule not found" warning

- migrate-value-pluralism-docs.js: Migrate docs to MongoDB
  - Generate ToC from markdown headings
  - Create search indexes
  - Add full metadata (quadrant, persistence, audience, tags)
  - Proper MongoDB integration for docs.html

- generate-markdown-pdfs.js: Generate PDFs using Puppeteer
  - Workaround for missing pandoc PDF engines
  - Styled PDFs with proper typography
  - 3 value pluralism documents

All scripts support production deployment workflow

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:36:03 +13:00
TheFlow
a7ce65ca30 feat(server): integrate value pluralism services into governance system
- Initialize PluralisticDeliberationOrchestrator (6th core service)
- Initialize AdaptiveCommunicationOrchestrator (support service)
- Add to governance services list for clean startup
- Server reports "6 core services" operational

All governance services now initialized on startup

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:35:52 +13:00
TheFlow
4ac0b867e7 fix(models): remove duplicate schema indexes for clean startup
- GovernanceRule: Remove duplicate category index (uses compound index)
- VerificationLog: Remove duplicate verifiedAt index (uses compound + TTL)
- VariableValue: Remove duplicate category index (standalone index exists)

Eliminates 3 Mongoose duplicate index warnings on server startup
Server now starts with zero warnings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:35:45 +13:00
TheFlow
d1e33a1a11 test(integration): add value pluralism service integration tests
- Tests complete deliberation lifecycle (220 lines)
- BoundaryEnforcer → PluralisticDeliberationOrchestrator flow
- PluralisticDeliberationOrchestrator → AdaptiveCommunicationOrchestrator flow
- Cross-service statistics tracking
- Precedent creation and retrieval
- Error handling across service boundaries
- Service singleton pattern verification

7 comprehensive test suites covering full integration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:35:38 +13:00
TheFlow
2c6f8d560e test(unit): add comprehensive tests for value pluralism services
- PluralisticDeliberationOrchestrator: 38 tests (367 lines)
  - Framework detection (6 moral frameworks)
  - Conflict analysis and facilitation
  - Urgency tier determination
  - Precedent tracking
  - Statistics and edge cases

- AdaptiveCommunicationOrchestrator: 27 tests (341 lines)
  - Communication style adaptation (5 styles)
  - Anti-patronizing filter
  - Pub test validation (Australian/NZ)
  - Japanese formality handling
  - Statistics tracking

All 65 tests passing with proper framework keyword detection

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:35:30 +13:00
TheFlow
3e2d2784d2 feat(services): add 6th core service - value pluralism deliberation
- Implement PluralisticDeliberationOrchestrator (433 lines)
  - 6 moral frameworks: deontological, consequentialist, virtue, care, communitarian, indigenous
  - 4 urgency tiers: critical, urgent, important, routine
  - Foundational pluralism without value hierarchy
  - Precedent tracking (informative, not binding)

- Implement AdaptiveCommunicationOrchestrator (346 lines)
  - 5 communication styles: formal, casual (pub test), Māori protocol, Japanese formal, plain
  - Anti-patronizing filter (removes "simply", "obviously", "clearly")
  - Cultural context adaptation

- Both services use singleton pattern with statistics tracking
- Implements TRA-OPS-0002: AI facilitates, humans decide
- Supports inst_029-inst_035 (value pluralism governance)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 16:35:15 +13:00
TheFlow
45669fa745 docs: mark Task 12 (API Documentation) as COMPLETE
- OpenAPI 3.0 specification (1,621 lines, 46KB)
- JavaScript code examples (638 lines, 20KB)
- Python code examples (983 lines, 30KB)
- All 6 governance services fully documented
- Rate limiting, error handling, retry logic included
- All files deployed to production

Progress: 46% complete (up from 44%)
Phase 2: 6/12 tasks complete (50%)
2025-10-12 11:15:32 +13:00
TheFlow
8cb075bce1 feat: add comprehensive JavaScript and Python code examples
- Created examples-javascript.md (20KB, 638 lines)
  - Authentication, Documents, Governance, Audit examples
  - Node.js and browser implementations
  - Complete TractatusClient class
  - Error handling and retry logic
  - Rate limiting documentation

- Created examples-python.md (30KB, 983 lines)
  - Authentication, Documents, Governance, Audit examples
  - Type hints and data classes
  - Complete TractatusClient class
  - Error handling decorators and retry logic
  - Rate limiting documentation

- Updated api-reference.html with code examples links
- All examples deployed to production

Task 12 (API Documentation) - Code examples complete
2025-10-12 11:13:55 +13:00
TheFlow
8ada623bbf feat: add comprehensive OpenAPI 3.0 specification
- Created openapi.yaml (1,621 lines, 46KB)
- Documents all API endpoints with full schemas
- Authentication, Documents, Governance Services, Audit, Admin
- Added OpenAPI download link to api-reference.html
- Deployed to production

Task 12 (API Documentation) - OpenAPI spec complete
2025-10-12 11:09:39 +13:00
TheFlow
69023be713 feat: add comprehensive governance services API documentation
Task 12 Progress - Governance Services Documentation Complete:

Added comprehensive documentation for all 6 governance services:

1. InstructionPersistenceClassifier
   - POST /api/governance/classify
   - Quadrant classification (STRATEGIC/OPERATIONAL/TACTICAL/SYSTEM)
   - Persistence levels (HIGH/MEDIUM/LOW)
   - Request/response examples with quadrant types table

2. CrossReferenceValidator
   - POST /api/governance/validate
   - Prevents training pattern override (27027 failure mode)
   - Validation status types (APPROVED/REJECTED/WARNING)
   - Conflict detection and recommendations

3. BoundaryEnforcer
   - POST /api/governance/enforce
   - Values decision blocking (privacy, ethics, sovereignty)
   - Boundary categories and alternatives
   - Human approval requirements

4. ContextPressureMonitor
   - POST /api/governance/pressure
   - Multi-factor session health tracking
   - Pressure levels (NORMAL/ELEVATED/HIGH/CRITICAL/DANGEROUS)
   - Checkpoint recommendations

5. MetacognitiveVerifier
   - POST /api/governance/verify
   - AI self-checks for complex operations
   - Scope creep detection
   - Confidence scoring and alternatives

6. AuditLogger
   - GET /api/audit/audit-logs (with filtering)
   - GET /api/audit/audit-analytics
   - Comprehensive audit trail
   - Aggregated analytics

Changes:
- api-reference.html: 17KB → 37KB (880 lines)
- Updated sidebar navigation with governance services
- All endpoints documented with request/response examples
- Status types, decision categories, and lookup tables included

Future Work:
- docs/plans/TRANSLATION_APPROACH.md: DeepL translation strategy for Task 19
- Remaining: OpenAPI spec, code examples (JS/Python), rate limiting docs

Deployed to: https://agenticgovernance.digital/api-reference.html
2025-10-12 11:02:26 +13:00
TheFlow
14cb0c5b6c docs: verify Task 7 (Accessibility) complete, Task 12 (API) partial (44% progress)
Verification Updates (October 12, 2025):

 Task 7: Accessibility Audit & Critical Fixes - COMPLETE
- 100% WCAG 2.1 Level AA compliance (22/22 guidelines pass)
- Comprehensive audit: /audit-reports/accessibility-improvements-summary.md
- Focus indicators, skip links, color contrast (all 18 combinations pass)
- ARIA implementation, semantic HTML, keyboard navigation tested
- Testing tools created: audit-accessibility.js, check-color-contrast.js
- Result: Exceeds requirements

🔄 Task 12: API Documentation - PARTIALLY COMPLETE
- Basic API reference exists at /api-reference.html (17KB, deployed)
- Authentication, Documents, Admin endpoints documented
- Missing: 6 governance services (BoundaryEnforcer, etc.)
- Missing: OpenAPI spec, Swagger UI, multi-language examples
- Estimated remaining: 3-4 days

Progress Update:
- Phase 1: 8/10 tasks (80%) - up from 70%
- Phase 2: 5.5/12 tasks (46%) - up from 42%
- Total: 16/36 tasks (44%) - up from 40%
- Version: 1.1 → 1.2
2025-10-12 10:53:10 +13:00
TheFlow
484382c234 docs: verify and update roadmap completion status (40% complete)
Verification & Updates (October 12, 2025):

Verified Completions:
-  Task 1: Benchmark Suite Results Document (tractatus-production-testing-results.pdf exists)
-  Task 4: Governance Rule Library (10 comprehensive rules in sample-governance-rules.json)
-  Task 6: Deployment Quickstart Kit (sanitized version in GitHub deployment-guide/)
- 🔄 Task 18: GitHub Repository Setup (partial - missing CODE_OF_CONDUCT, issues templates, GitHub Actions)

Progress Summary:
- Phase 1: 7/10 tasks complete (70%) - 1 deferred, 2 pending
- Phase 2: 5/12 tasks complete (42%)
- Phase 3: 1.5/8 tasks complete (19%) - 1 partial
- Phase 4: 1/6 tasks complete (17%)
- Total: 14.5/36 tasks = 40% complete

Changes:
- Updated task statuses with verification evidence
- Marked subtasks as completed with checkboxes
- Added verification notes documenting actual files/implementations
- Updated metadata: version 1.0 → 1.1, added completion percentage
- Added overall progress tracking to Executive Summary
- Documented partial completions and next steps
2025-10-12 10:31:54 +13:00
TheFlow
9b10abad31 security: replace production quickstart kit with sanitized deployment guide on implementer.html
Changed implementer.html 'Deployment Quickstart Kit' section to 'Deployment Architecture Guide':

REMOVED:
- Download link for tractatus-quickstart.tar.gz (contained production configs)
- docker-compose.yml, .env.example, sample governance rules
- verify-deployment.sh script
- Installation and troubleshooting guides with production details

ADDED:
- Link to GitHub deployment-guide/ (sanitized conceptual documentation)
- Conceptual architecture and patterns description
- Security best practices overview
- Contact info for production implementation support (john.stroh.nz@pm.me)

Rationale: Production deployment package on public website provided attack surface. Sanitized guide maintains educational value without exposing implementation details.

Deployed to: https://agenticgovernance.digital/implementer.html
2025-10-12 10:14:46 +13:00
TheFlow
d1f34257f4 docs: session handoff 2025-10-12 - sidebar redesign and PNG fix complete
Session Summary:
- Fixed architecture diagram PNG background (checkered → solid white)
- Redesigned docs.html sidebar with 5 hierarchical categories
- Reorganized 15 documents by audience/expertise level
- Deployed all changes to production
- Created NYT article comment draft
- All framework components active, pressure NORMAL (23.4%)

Pending for Next Session:
- Push git commits to GitHub (5 commits ahead)
- Kill background npm processes (inst_023)
- Sync .claude/ to production (inst_027)

Strategic Options:
A) API Documentation (Task 12, 5-7 days)
B) Enhanced Context Monitoring (inst_019, 2-3 days)
C) Community Engagement (varies)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 09:16:46 +13:00
TheFlow
f7d933dbe2 feat: redesign docs sidebar with audience-based categories + fix PNG background
## Architecture Diagram PNG Fix
- Regenerated PNG with solid white background (no transparency)
- Removed alpha channel (RGBA → RGB)
- Increased resolution to 2400x2000 for true high-res quality
- Fixed poor UX with checkered/transparent background on implementer.html

## Documentation Sidebar Redesign
Reorganized from flat "getting started" list to 5 hierarchical categories
based on user journey and expertise level:

### New Category Structure:
- 📘 Introduction (1-5): Beginner level, all audiences
- ⚙️ Implementation (10-19): Practical/technical for implementers
- 📊 Case Studies (20-29): Real-world examples
- 💼 Business Strategy (30-35): For leaders/decision makers
- 🔬 Advanced Topics (40-49): Deep technical (collapsed by default)

### Benefits:
- Clear progression: beginner → intermediate → advanced
- Audience-specific paths (researcher, implementer, leader)
- Reduced cognitive load (5 categories vs 15+ flat items)
- Easy to find relevant content by expertise level

### Technical Implementation:
- Updated docs-app.js CATEGORIES object with new structure
- Updated categorizeDocument() to use order ranges (1-5, 10-19, 20-29, 30-35, 40-49)
- Created scripts/reorganize-docs-sidebar.js for automated metadata updates
- Reorganized 15 documents in MongoDB with new order/category/audience

### Production Deployment:
-  Deployed architecture-diagram.png (887KB, RGB, 2400x2000)
-  Deployed updated docs-app.js
-  Ran reorganization script on tractatus_prod database
-  Verified via API: correct categories and ordering

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 09:10:58 +13:00
TheFlow
e962ae6bbf fix: update cache busting versions to 1.0.3 and migrate new documents
**Issue:** New documents not appearing in production docs sidebar
**Root Cause:** Documents not migrated to MongoDB + browser caching old JS

**Changes:**
1. **Cache Busting:** Updated all cache versions from 1.0.2 → 1.0.3
   - public/docs.html (CSS, navbar.js, docs-app.js, docs-search-enhanced.js, document-cards.js)
   - public/faq.html (CSS, navbar.js, faq.js)

2. **Document Migration:** Migrated new documents to MongoDB
   - comparison-matrix.md → comparison-matrix-claude-code-claudemd-and-tractatus-framework
   - technical-architecture.md → technical-architecture
   - 27027-incident-detailed-analysis.md → the-27027-incident-a-case-study-in-pattern-recognition-bias
   - Plus 5 case studies created today

**Production deployment:**
- Deployed updated HTML files with new cache versions
- Migrated 8 new documents to tractatus_prod database
- Restarted tractatus.service to clear server-side caches

**Documents now available in docs.html sidebar:**
✓ Technical Architecture (new today)
✓ Comparison Matrix: Claude Code vs Tractatus (new today)
✓ The 27027 Incident Case Study (new today)
✓ Implementation Guide v1.1 (updated today)
✓ All case studies from earlier sessions

**Cache busting forces browser reload of:**
- Document list JavaScript
- Search functionality
- Navbar component
- FAQ page JavaScript

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 08:23:57 +13:00
TheFlow
692eda8581 docs: update roadmap with Phase 2 completions (October 12)
Updated integrated implementation roadmap to reflect 5 completed tasks
from Phase 2 (Content & Documentation):

**Completed tasks (October 12, 2025):**
-  Task 8: Technical Architecture Diagram
-  Task 10: FAQ Section (17 Q&A pairs)
-  Task 11: Comparison Matrix (Claude Code vs Tractatus)
-  Task 13: 27027 Incident Case Study
-  Task 14: Blog System (completed earlier)

**Phase 2 progress:** 5/12 tasks complete (41.7%)

**Remaining in Phase 2:**
- Task 9: Video Walkthrough (requires video recording - not feasible for Claude Code)
- Task 12: API Documentation (High priority, 5-7 days - substantial effort)
- Tasks 15-21: Phase 3 (Community & Operational Features)

**Overall roadmap status:**
- Phase 1: 5/10 complete (50%)
- Phase 2: 5/12 complete (42%)
- Phase 3: 1/8 complete (13%)
- Phase 4: 1/6 complete (17%)

Total: 12/36 major tasks complete (33%)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 08:16:46 +13:00
TheFlow
f0785dc060 docs: add comprehensive 27027 incident case study
Task 13 from integrated implementation roadmap complete.

**New files:**
- docs/case-studies/27027-incident-detailed-analysis.md (26KB)
- public/downloads/case-study-27027-incident-detailed-analysis.pdf (466KB)

**Case study covers:**
1. Executive summary with metrics (detection time, prevention success, cost savings)
2. Detailed incident timeline (6-hour session, 107k tokens)
3. Technical phases: Normal ops → Elevated pressure → Validation → Prevention
4. Root cause analysis: Pattern recognition bias under context pressure
5. How Tractatus prevented the failure (3 governance layers)
6. Quantitative metrics and verification
7. Lessons learned (5 key insights)
8. Prevention strategies for with/without Tractatus
9. Implications for AI governance (4 major conclusions)
10. Recommendations for researchers, implementers, policy makers

**Key metrics documented:**
- Detection time: 14.7ms (automated)
- Prevention success: 100% (blocked before execution)
- Context pressure: 53.5% (ELEVATED → HIGH)
- Token count: 107,427 / 200,000
- Downtime prevented: 2-4 hours
- Cost avoided: $3,000-$7,000

**Incident summary:**
At 107k tokens into production deployment session, AI attempted to use
default MongoDB port 27017 despite explicit HIGH-persistence instruction
specifying port 27027 (62k tokens earlier). CrossReferenceValidator
detected conflict in 14.7ms and blocked action before execution,
preventing production database misconfiguration.

**Root cause:** Pattern recognition bias (27017 is 95% of training examples)
overrode explicit user instruction under elevated context pressure.

**Prevention mechanism:**
1. InstructionPersistenceClassifier captured instruction at T=0 (SYSTEM/HIGH)
2. ContextPressureMonitor warned at 100k tokens (7k before failure)
3. CrossReferenceValidator blocked conflicting action at execution time

**Real-world validation:**
This is a genuine prevented production incident with complete audit trail,
demonstrating Tractatus effectiveness in realistic deployment conditions.

**Research value:**
- Quantifies pattern bias threshold (emerges 80k-107k tokens)
- Validates architectural enforcement superiority over behavioral guidance
- Demonstrates ROI: 26ms overhead for $5,000+ failure prevention
- Provides reproducible case study for LLM governance research

**Deployment:**
- Deployed to production: agenticgovernance.digital
- Added to public GitHub for academic access
- Professional PDF format for distribution
- BibTeX citation included for research papers

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 08:15:51 +13:00