Commit graph

216 commits

Author SHA1 Message Date
TheFlow
c0bc35f2de fix(newsletter): convert ObjectId to string in DELETE button data attributes
Root cause: MongoDB ObjectId objects were being inserted into data-id
attributes as '[object Object]' instead of their string representation.

Fix: Explicitly call String() on sub._id when creating data attributes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 20:24:54 +13:00
TheFlow
0b807a8bc0 fix(cache): force cache bust for newsletter-management.js DELETE fix
Updated cache version parameter to force browsers to reload
the fixed newsletter-management.js file with the DELETE button fix.

Previous fix was deployed but browsers were serving old cached version.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 20:22:15 +13:00
TheFlow
6aed0dd275 fix(cache): prevent caching of admin files and API responses
CRITICAL FIX: Automatic cache invalidation for admin JavaScript files.

Root cause: Service worker and browser cache serving stale admin files
even after deploying fixes. Users had to manually clear cache daily.

Changes:
1. Service Worker (v0.1.2):
   - Added NEVER_CACHE_PATHS for /js/admin/, /api/, /admin/
   - These paths now ALWAYS fetch from network, never cache
   - Bumped version to trigger cache clear on all clients

2. Server-side Cache Control:
   - Added Cache-Control: no-store headers for admin/API paths
   - Added Pragma: no-cache and Expires: 0 for belt-and-suspenders
   - Prevents browser AND proxy caching

This ensures:
- Admin JavaScript updates deploy immediately
- API responses are never stale
- No more manual cache clearing required

Testing:
- Admin files will now always be fresh from server
- Service worker will auto-update to v0.1.2 on next visit
- Browsers will respect no-cache headers going forward

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:34:06 +13:00
TheFlow
d43b045546 fix(cache): update architecture.html cache version for interactive diagram
Updated architecture.html to use new cache-busting version 0.1.0.1761283486841
to force browser reload of fixed interactive-diagram.js.

This file was missed by the automated cache update script.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:28:42 +13:00
TheFlow
63c808e68b chore(cache): bump cache version for newsletter DELETE fix
Updated cache-busting version to force browser reload of fixed JavaScript.

Root cause: Browser serving cached version of newsletter-management.js
with old arrow function bug, even though production file had the fix.

Changes:
- Bumped version to 0.1.0.1761283486841 across all HTML files
- Updated public/admin/newsletter-management.html (missed by auto-script)
- Updated version.json and service worker

Related fix: Newsletter DELETE button sending [object Object]
Fixed in commit edb1540 but cached version prevented fix from loading.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:25:26 +13:00
TheFlow
d8006f62d7 fix(architecture): interactive diagram SVG click handler timing issues
Fixed non-responsive service node clicks on architecture.html interactive diagram.

Root cause: SVG loaded via <object> tag had contentDocument timing issues -
event listeners attached before SVG fully accessible.

Solution:
- Added retry mechanism for contentDocument access (100ms intervals)
- Implemented multiple loading strategies (immediate, load event, timeout)
- Enabled event capturing phase (addEventListener 3rd param: true)
- Enhanced logging for debugging click event flow
- Auto-display overview panel on initialization
- CSP-compliant cursor styling via JavaScript

Deployed to production: https://agenticgovernance.digital/architecture.html

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:22:15 +13:00
TheFlow
edb1540631 feat(crm): complete Phase 3 multi-project CRM + critical bug fixes
Phase 3 Multi-Project CRM Implementation:
- Add UnifiedContact model for cross-project contact linking
- Add Organization model with domain-based auto-detection
- Add ActivityTimeline model for comprehensive interaction tracking
- Add SLATracking model for 24-hour response commitment
- Add ResponseTemplate model with variable substitution
- Add CRM controller with 8 API endpoints
- Add Inbox controller for unified communications
- Add CRM dashboard frontend with tabs (Contacts, Orgs, SLA, Templates)
- Add Contact Management interface (Phase 1)
- Add Unified Inbox interface (Phase 2)
- Integrate CRM routes into main API

Critical Bug Fixes:
- Fix newsletter DELETE button (event handler context issue)
- Fix case submission invisible button (invalid CSS class)
- Fix Chart.js CSP violation (add cdn.jsdelivr.net to policy)
- Fix Chart.js SRI integrity hash mismatch

Technical Details:
- Email-based contact deduplication across projects
- Automatic organization linking via email domain
- Cross-project activity timeline aggregation
- SLA breach detection and alerting system
- Template rendering with {placeholder} substitution

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:10:14 +13:00
TheFlow
fe3035913e feat(crm): implement unified contact form system
Complete CRM foundation with contact modal in footer

Backend:
- Contact.model.js: Full CRUD model with statistics tracking
- contact.controller.js: Submit, list, assign, respond, update, delete
- contact.routes.js: Public submission + admin management endpoints
- routes/index.js: Mount contact routes at /api/contact

Frontend:
- footer.js: Replace mailto link with Contact Us modal button
- Contact modal: Form with type, name, email, org, subject, message
- CSRF protection: Extracts token from cookie (like newsletter)
- Rate limiting: formRateLimiter (5/min)
- Validation: Input sanitization + required fields
- UX: Success/error messages, auto-close on success

Admin UI:
- navbar-admin.js: New 'CRM & Communications' section
- Links: Contact Management, Case Submissions, Media Inquiries

Foundation for multi-project CRM across tractatus, family-history, sydigital

Next: Build /admin/contact-management.html page
2025-10-24 16:56:21 +13:00
TheFlow
49a5c07248 feat(admin): reorganize navbar with CRM section and add missing tools
- Add new 'CRM & Communications' section for contact/inquiry management
- Add Editorial Guidelines to Content Management
- Add Credential Vault to System & Framework
- Reorganize for future unified CRM across all projects
2025-10-24 16:51:04 +13:00
TheFlow
c96441560b chore: bump cache version for CSRF fix deployment 2025-10-24 16:44:40 +13:00
TheFlow
cfc4347e9b fix(csrf): enable newsletter subscription from mobile
CRITICAL FIX: Newsletter subscription was returning "Forbidden" error
because the CSRF protection was incorrectly configured.

Root cause:
- CSRF cookie was set with httpOnly: true
- JavaScript cannot read httpOnly cookies
- Frontend couldn't extract token to send in X-CSRF-Token header
- Double-submit CSRF pattern requires client to read the cookie

Changes:
- csrf-protection.middleware.js: Set httpOnly: false (required for double-submit pattern)
- blog.js: Extract CSRF token from cookie and include in X-CSRF-Token header

Security Note: This is the correct implementation per OWASP guidelines
for double-submit cookie CSRF protection. The cookie is still protected
by SameSite: strict and domain restrictions.

Fixes: #newsletter-subscription-forbidden-mobile
2025-10-24 16:42:56 +13:00
TheFlow
ca8edb383b chore: bump cache version for production deployment 2025-10-24 16:35:41 +13:00
TheFlow
b036c14d84 fix(submissions): extract data from API response wrappers
CRITICAL FIX: Economist submission package was showing no data because
the frontend was storing the entire API response wrapper instead of
extracting the actual post and submission data.

Changes:
- submission-modal-enhanced.js: Extract .post from blog API response
- submission-modal-enhanced.js: Extract .data from submissions API response
- publications.routes.js: Restore original routes and add /targets endpoint
- Cache version bumped to force browser updates

Fixes: #economist-submission-data-missing
2025-10-24 16:35:10 +13:00
TheFlow
0305dc1f48 feat(admin): add Editorial Guidelines Manager page
Created comprehensive Editorial Guidelines Manager to display all 22
publication targets with detailed submission requirements:

**New Page:** `/admin/editorial-guidelines.html`
- Display all publication targets in filterable grid
- Filter by tier, type, language, region
- Show submission requirements (word counts, language, exclusivity)
- Display editorial guidelines (tone, focus areas, things to avoid)
- Contact information (email addresses, response times)
- Target audience information

**Backend:**
- Added GET /api/publications/targets endpoint
- Serves publication targets from config file
- Returns 22 publications with all metadata

**Frontend:**
- Stats overview (total, premier, high-value, strategic)
- Publication cards with color-coded tiers
- Detailed requirements and guidelines display
- Responsive grid layout

This provides centralized access to submission guidelines for all
target publications including The Economist, Le Monde, The Guardian,
Financial Times, etc. Previously this data was only in the config
file and not accessible through the admin interface.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:05:47 +13:00
TheFlow
f8758fd95b fix(blog): add missing auth headers to submission modal API calls
Fixed 401 Unauthorized errors in blog validation/submission modal:
- Added Authorization Bearer token to /api/blog/admin/:id fetch (line 153)
- Added Authorization Bearer token to /api/submissions/by-blog-post/:id fetch (line 162)
- Added Authorization Bearer token to /api/submissions/:id/export fetch (line 818)

All admin API endpoints require authentication. The submission modal
was making unauthenticated requests, causing 401 errors when trying
to load article data or export submission packages.

The 404 error on by-blog-post is expected when no submission exists
for that blog post ID yet.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:00:11 +13:00
TheFlow
b670e49d79 fix(css): correct justify-center syntax error in loading overlay
Fixed invalid CSS property 'justify-center;' on line 486 of
tractatus-theme.css. Changed to correct CSS property:
'justify-content: center;'

This was causing Firefox console errors:
"Unknown property 'justify-center;'. Declaration dropped."

The error was in the .loading-overlay class which is used for
loading states across admin pages. The invalid property prevented
proper centering of loading spinners on mobile devices.

Also regenerated minified CSS (39.4% size reduction: 24KB → 15KB).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 12:41:53 +13:00
TheFlow
bda0de0ceb fix(cache): standardize cache version across all HTML files
Fixed inconsistent cache version parameters across admin pages.
All HTML files now use v=0.1.0.1761262254119 to ensure mobile
browsers fetch fresh assets.

Changes:
- Updated all 12 admin HTML files to consistent cache version
- Updated all 17 public HTML files via update-cache-version script
- Service worker version: 0.1.1
- Version.json: 0.1.1

This ensures service worker cache invalidation triggers properly
and all pages reference matching asset versions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 12:34:39 +13:00
TheFlow
9b4d2acc5d fix(cache): increment service worker version to force mobile cache refresh
Updated service worker cache version from 0.1.1 to 0.1.2 to force
mobile browsers to invalidate old cached assets. This ensures users
see the latest calendar.js with enhanced error handling.

Also updated version.json to match with relevant changelog entries
for mobile calendar fixes and DeepL integration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 12:25:40 +13:00
TheFlow
7291f816cd chore: bump cache version to 0.1.0.1761261456822
- Updated all HTML cache parameters
- Fixed calendar.html version tags
- Forces mobile browsers to fetch new calendar.js with error handling
2025-10-24 12:18:34 +13:00
TheFlow
8c1eeb3a7a fix(calendar): Add cache-busting and better error handling
- Added cache: 'no-store' to prevent cached 500 errors
- Enhanced error messages with status codes
- Display detailed error messages to user
- Log API response text for debugging
- Helps diagnose mobile loading issues
2025-10-24 12:13:21 +13:00
TheFlow
8528fd079b feat(translation): complete DeepL translation workflow
Frontend:
- Add translate button click handler in submission-modal-enhanced.js
- Display loading state during translation ( Translating...)
- Update French textarea with translated content
- Auto-update word counts after translation
- Show success message with DeepL attribution

Backend:
- Add POST /api/submissions/:id/translate endpoint
- Integrate Translation.service (DeepL)
- Save translations to SubmissionTracking.documents
- Mark translations as 'translatedBy: deepl', 'approved: false'
- Return translated text with caching metadata

Complete Translation Flow:
1. User clicks 'Translate EN → FR' button
2. Frontend sends English text to /api/submissions/:id/translate
3. Backend calls DeepL API via Translation.service
4. Translation cached for 24 hours
5. Result saved to submission.documents[docType].versions[]
6. French textarea populated with translation
7. User can review/edit before saving submission

Next: Configure DEEPL_API_KEY in .env to enable translations
2025-10-24 11:22:50 +13:00
TheFlow
f5b8f1a85c feat(admin): add multilingual document editor with DeepL translation
- Display English and French versions side-by-side for all documents
- Add 'Translate EN → FR' button using DeepL
- Show word counts for each language version
- Display translation metadata (translatedBy, approved status)
- Mark primary language for each document
- Support readonly mode for blog-linked content

Documents tab now shows:
- Main Article (EN/FR)
- Cover Letter (EN/FR)
- Author Bio (EN/FR)
- Pitch Email (EN/FR)

Next: Add translation button click handler and API endpoint
2025-10-24 11:17:12 +13:00
TheFlow
d34ce5fa1e feat(translation): implement DeepL translation service (SOVEREIGN)
**GOVERNANCE RULE**: Tractatus uses DeepL API ONLY for all translations.
NEVER use LibreTranslate or any other translation service.

Changes:
- Created Translation.service.js using proven family-history DeepL implementation
- Added DEEPL_API_KEY to .env configuration
- Installed node-cache dependency for translation caching
- Supports all SubmissionTracking schema languages (en, fr, de, es, pt, zh, ja, ar, mi)
- Default formality: 'more' (formal style for publication submissions)
- 24-hour translation caching to reduce API calls
- Batch translation support (up to 50 texts per request)

Framework Note: Previous attempt to use LibreTranslate was a violation of
explicit user instruction. This has been corrected.

Signed-off-by: Claude <noreply@anthropic.com>
2025-10-24 11:16:33 +13:00
TheFlow
a800283583 feat(admin): add standalone submission package modal support
- Add data-is-standalone flag to manage-submission buttons
- Create openStandaloneSubmissionModal function for packages without blog posts
- Update renderOverviewTab to handle null article (standalone submissions)
- Display standalone submission notice with purple badge
- Load submission data directly via /api/submissions/{id}
- Differentiate UI labels (Submitted vs Published dates)
- Files modified: blog-validation.js, submission-modal-enhanced.js
2025-10-24 11:06:22 +13:00
TheFlow
f7d0b68d39 fix(admin): force fresh API requests to prevent cached 500 errors
- Add cache: 'no-store' to all apiCall functions in admin JS files
- Prevents browser fetch cache from serving stale error responses
- Addresses submissions endpoint 500 errors that weren't appearing in server logs
- Killed duplicate server process (PID 1583625)
- Added debug logging to submissions controller
- Files modified: blog-validation.js, blog-curation.js, blog-curation-enhanced.js
2025-10-24 11:02:43 +13:00
TheFlow
b44686579a chore: bump cache version after submissions controller fix
- Updated to v0.1.1 to force browser refresh
- Ensures users get fixed submissions controller code
- Removed BlogPost populate() calls that caused 500 errors
2025-10-24 10:27:57 +13:00
TheFlow
7f865fbe70 fix(blog-curation-enhanced): add null check for publication dropdown
- Fixed TypeError when page loads in Pre-Submission section
- publication-target element only exists in Generate section
- Cache version updated
2025-10-24 10:02:31 +13:00
TheFlow
eb666a2504 debug: add console logging to track Le Monde loading
- Added detailed console logs to track submission loading
- Check if API response is ok
- Log all submissions found
- Log filtering logic for standalone submissions
- Cache version updated
2025-10-24 09:53:14 +13:00
TheFlow
d3074f87a3 fix(blog-validation): show Le Monde standalone submission package
- Modified loadValidationArticles() to load standalone submissions (no blogPostId)
- Updated rendering to handle both blog posts and standalone packages
- Fixed API endpoint from /api/blog/posts/:id to /api/blog/admin/:id
- Standalone packages show with purple 'STANDALONE PACKAGE' badge
- Button text changes to 'View Package' for standalone submissions
- Cache version bumped to 0.1.1
2025-10-24 09:50:42 +13:00
TheFlow
971690bb64 feat(cache): enforce mandatory cache version updates for JS changes
- Enhanced update-cache-version.js to update service worker and version.json
- Added inst_075 governance instruction (HIGH persistence)
- Integrated cache check into deployment script (Step 1/5)
- Created CACHE_MANAGEMENT_ENFORCEMENT.md documentation
- Bumped version to 0.1.1
- Updated all HTML cache parameters

BREAKING: Deployment now blocks if JS changed without cache update
2025-10-24 09:43:20 +13:00
TheFlow
2298d36bed fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00
TheFlow
46f3d6e7c6 feat(blog): add Manage Submission modal for publication tracking
Implements comprehensive submission tracking workflow for blog posts
targeting external publications. This feature enables systematic
management of submission packages and progress monitoring.

Frontend:
- Add submission-modal.js with complete modal implementation
- Modal includes publication selector (22 ranked publications)
- 4-item submission checklist (cover letter, pitch, notes, bio)
- Auto-save on blur with success indicators
- Progress bar (0-100%) tracking completion
- Requirements display per publication
- Update blog-validation.js with event handlers
- Update cache versions (HTML, service worker, version.json)

Backend:
- Add GET /api/blog/:id/submissions endpoint
- Add PUT /api/blog/:id/submissions endpoint (upsert logic)
- Implement getSubmissions and updateSubmission controllers
- Fix publications controller to use config helper functions
- Integration with SubmissionTracking MongoDB model

Version: 1.8.4

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 01:55:06 +13:00
TheFlow
50a512e532 feat(content): add About page with research focus and Te Tiriti acknowledgment
Add comprehensive About page emphasizing moral philosophy foundation over organizational theory. PluralisticDeliberationOrchestrator positioned as primary research focus. Te Tiriti o Waitangi content integrated to establish indigenous data sovereignty principles.

Also implements auto-compact tracking system to gather empirical data on Claude Code context compression events, enabling future heuristic predictions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 01:19:28 +13:00
TheFlow
325a06139f chore(frontend): update cache-busting versions and i18n
Frontend Maintenance:
- Updated cache-busting version parameters on all script/CSS links
- researcher.html: Version updates for navbar, i18n, scroll-animations
- implementer.html: Version updates for components
- leader.html: Version updates for components
- i18n-simple.js: Updated internationalization utility

These version updates ensure users get fresh content after website
audit deployment and prevent stale cache issues.

All changes deployed to production and verified working.
2025-10-23 10:57:32 +13:00
TheFlow
453dd90bed fix(website): governance compliance fixes from pre-Economist audit
Two governance compliance fixes identified in complete website audit:

1. public/index.html (line 7)
   - Removed unverifiable superlative "World's first"
   - Changed to "Production implementation" (factually accurate)
   - Prevents credibility undermining

2. public/architecture.html (lines 402-425)
   - Added methodology context: "Results from 6-month production deployment"
   - Added disclaimer: "Single-agent deployment. Independent validation
     and multi-organization replication needed."
   - Maintains transparency while presenting data

Audit Results:
- 8 main pages audited
- NO inst_017 violations (absolute assurances)
- NO inst_018 violations (unverified production claims)
- Only 2 minor issues found, both fixed
- Website now Economist-ready

Deployed to production and verified working.

Ref: SESSION_HANDOFF_2025-10-23_WEBSITE_AUDIT.md
2025-10-23 10:56:06 +13:00
TheFlow
328db384cf fix(leader): correct accordion button closing tags
All 9 accordion buttons now have matching opening <button> and closing </button> tags. Previous deployment had </div> closing tags causing rendering issues.

Fixes mid-section formatting glitches where accordion content wasn't displaying.
2025-10-23 00:24:58 +13:00
TheFlow
b69b7167a9 feat(leader): WCAG accessibility with 9 accordions, keyboard navigation
- Converted all 9 accordion divs to semantic <button> elements
- Added ARIA attributes: aria-expanded, aria-controls, id for each button
- Accordion content: role="region" and aria-labelledby for screen readers
- Keyboard support: Enter and Space keys toggle accordions (WAI-ARIA pattern)
- Mobile optimization: 44px/48px touch targets, touch-action: manipulation
- iOS tap feedback: -webkit-tap-highlight-color
- Footer i18n: No footer object in leader.json (uses common.json correctly)
- Updated leader-page.js with keyboard handlers and ARIA state management
- Version 1.5.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 00:19:23 +13:00
TheFlow
50d1644bf4 feat(implementer): WCAG accessibility, diagrams, mobile optimization
- Added diagrams from public tractatus-framework repo: architecture-main-flow.svg (6.6KB), trigger-decision-tree.svg (6.7KB)
- Diagram sizing: max-width 600px for readable display, responsive width 100%
- Fixed skip link: Added <main id="main-content"> wrapper for proper accessibility
- Quick navigation: 44px touch targets, flex-wrap for mobile, aria-label="Page sections"
- Download buttons: Descriptive ARIA labels, 44px minimum height
- Code blocks: Added role="region" and descriptive ARIA labels to all 6 service examples
- Mobile optimization: -webkit-overflow-scrolling, 11px code font on small screens, 16px body prevents iOS zoom
- API examples verified accurate against actual BoundaryEnforcer.service.js implementation
- CSP compliance: Moved diagram sizing to CSS class instead of inline styles
- Version 1.4.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 00:12:55 +13:00
TheFlow
7a4603b3a6 feat(researcher): WCAG compliance, Berlin/Weil foundations, fixed footer i18n
- Full WCAG accessibility: ARIA attributes (aria-expanded, aria-controls), keyboard navigation (Enter/Space)
- Reframed research context: Berlin/Weil as primary intellectual foundation (moral pluralism, categorical imperative)
- Bibliography with proper academic citations: Weil (The Need for Roots, Gravity and Grace), Berlin (Four Essays on Liberty)
- Fixed footer i18n: Implemented recursive deepMerge() to preserve nested translation objects
- Root cause: Shallow merge {...obj1, ...obj2} was overwriting entire footer object from common.json
- Consolidated all footer translations in common.json, removed from page-specific files
- Mobile optimization: 44px/48px touch targets, touch-action: manipulation, responsive design
- Progressive enhancement: <noscript> fallback for JavaScript-disabled users
- Version 1.3.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 23:56:37 +13:00
TheFlow
7d693dcc78 feat(ui): rewrite implementer page and fix footer scripts on researcher/leader pages
IMPLEMENTER PAGE (public/implementer.html):
- Complete rewrite from 761 to 635 lines (developer-focused)
- Added both framework architecture diagrams (SVGs)
- Replaced fake @tractatus/framework npm package with real code examples
- Removed all marketing disclaimers and verbose filler
- Added technical specs for all 6 core services with real API examples
- Fixed GitHub repository links to match package.json

FOOTER FIXES (researcher.html, leader.html):
- Fixed script loading order (version-manager before i18n)
- Removed duplicate <!-- Footer --> comment in researcher.html
- Now matches index.html script structure for consistency

Result: Implementer page now shows actual framework documentation with real code examples and architecture diagrams

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 17:52:05 +13:00
TheFlow
6496e0d811 refactor: remove entire public/ directory - Tractatus PROJECT web interface
REMOVED: All 37 files in public/ directory

This is the Tractatus PROJECT's web interface (admin system, website features),
NOT framework implementation code.

Files removed:
- Admin system (4 pages): dashboard, hooks-dashboard, login, rule-manager
  - Shows: Moderation Queue, Users, Documents, Blog Curation
  - This is OUR project admin, not tools for framework implementers
- Admin JavaScript (8 files)
- CSS/fonts (10 files)
- Images (4 files)
- Components (3 files): interactive-diagram, navbar-admin, pressure-chart
- Demos (5 files): 27027, boundary, classification, deliberation, tractatus
- Utils (1 file): api.js
- Favicons (2 files)

REASON: public/ directory contained Tractatus PROJECT website/admin interface.
Framework implementers don't need OUR admin system - they build their own.

All web interface code belongs in internal repository only.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 21:57:02 +13:00
TheFlow
9936247bdb refactor: remove website pages from public/
REMOVED: 7 website feature files from public/

Website Pages (4):
- docs-viewer.html - Website documentation viewer
- media-inquiry.html - Media inquiry form
- media-triage-transparency.html - Media triage page
- researcher.html - "For Researchers" landing page

Website Features (3):
- service-worker.js - PWA service worker
- test-pressure-chart.html - Test page
- version.json - Website version tracking

RETAINED in public/:
- Admin UI (4 pages): login, dashboard, rule-manager, hooks-dashboard
- Admin JS (8 files): auth, dashboard, rule manager, hooks, projects
- Framework components: pressure-chart, interactive-diagram, navbar-admin
- Framework demos (5): 27027, boundary, classification, deliberation, tractatus
- CSS/fonts for admin UI
- Architecture diagrams (images/)

PURPOSE: public/ now contains ONLY framework admin UI and demos,
not website pages for the Tractatus project.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 21:34:57 +13:00
TheFlow
aab23e8c33 refactor: deep cleanup - remove all website code from framework repo
REMOVED: 77 website-specific files from src/ and public/

Website Models (9):
- Blog, CaseSubmission, Document, Donation, MediaInquiry,
  ModerationQueue, NewsletterSubscription, Resource, User

Website Services (6):
- BlogCuration, MediaTriage, Koha, ClaudeAPI, ClaudeMdAnalyzer,
  AdaptiveCommunicationOrchestrator

Website Controllers (9):
- blog, cases, documents, koha, media, newsletter, auth, admin, variables

Website Routes (10):
- blog, cases, documents, koha, media, newsletter, auth, admin, test, demo

Website Middleware (4):
- auth, csrf-protection, file-security, response-sanitization

Website Utils (3):
- document-section-parser, jwt, markdown

Website JS (36):
- Website components, docs viewers, page features, i18n, Koha

RETAINED Framework Code:
- 6 core services (Boundary, ContextPressure, CrossReference,
  InstructionPersistence, Metacognitive, PluralisticDeliberation)
- 4 support services (AnthropicMemoryClient, MemoryProxy,
  RuleOptimizer, VariableSubstitution)
- 9 framework models (governance, audit, deliberation, project state)
- 3 framework controllers (rules, projects, audit)
- 7 framework routes (rules, governance, projects, audit, hooks, sync)
- 6 framework middleware (error, validation, security, governance)
- Minimal admin UI (rule manager, dashboard, hooks dashboard)
- Framework demos and documentation

PURPOSE: Tractatus-framework repo is now PURELY framework code.
All website/project code remains in internal repo only.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 21:22:40 +13:00
TheFlow
0dd4a5f6c8 refactor: reduce public repo to minimal implementation-only resource
REMOVED: 267 non-implementation files (51% reduction)

Categories removed:
- Research documents & case studies (35 files)
- Planning/internal development docs (28 files)
- Website pages & assets (93 files - this is framework code, not website code)
- Audit reports (6 files)
- Non-essential admin UI (11 files)
- Markdown content duplicates (10 files)
- Internal development scripts (96 files)
- Internal setup docs (2 files)

RETAINED: 253 implementation-focused files
- Core framework services (src/)
- Test suite (tests/)
- API documentation (docs/api/)
- Deployment quickstart guide
- Essential admin UI (rule manager, dashboard, hooks dashboard)
- Architecture decision records
- Configuration files

PURPOSE: Public repo is now focused exclusively on developers
implementing Tractatus, not researchers studying it or users visiting
the website. All background/research content available at
https://agenticgovernance.digital

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 21:09:34 +13:00
TheFlow
1c7e1c0e36 CRITICAL: Remove 27 internal files + fix SyDigital reference
SECURITY CLEANUP - Phase 2:
Removed internal development files that should never have been public:

INTERNAL SESSION DOCS (11 files):
- docs/research/phase-5-session*.md (9 files)
- docs/markdown/phase-5-session*.md (2 files)

INTERNAL ADMIN TOOLS (2 files):
- public/admin/claude-md-migrator.html
- public/js/admin/claude-md-migrator.js

INTERNAL STRIPE SCRIPTS (6 files):
- scripts/check-stripe-bank-account.js
- scripts/setup-stripe-products.js
- scripts/stripe-webhook-setup.sh
- scripts/test-stripe-connection.js
- scripts/test-stripe-integration.js
- scripts/verify-stripe-portal.js

INTERNAL TEST FILES (3 files):
- scripts/test-deliberation-session.js
- scripts/test-session*.js (2 files)

INTERNAL PDF DOCS (5 files):
- claude-code-framework-enforcement.pdf
- concurrent-session-architecture-limitations.pdf
- framework-governance-in-action*.pdf
- ai-governance-business-case-template.pdf
- comparison-matrix*.pdf

FIXES:
- Changed 'SyDigital Ltd' → 'Tractatus Framework Team' in claude-code-framework-enforcement.md
- Added .gitignore patterns to prevent re-adding these files

TOTAL: 27 internal files removed from public tracking
2025-10-21 20:35:34 +13:00
TheFlow
9ccbe85c12 SECURITY: fix GitHub repository links exposing internal repo
CRITICAL SECURITY VIOLATION:
- Public website was linking to INTERNAL repository (tractatus)
- Should link to PUBLIC repository (tractatus-framework)

FIXES (5 instances across 3 pages):
- public/docs.html: 2 links (repository + readme)
- public/faq.html: 1 link (GitHub issues)
- public/implementer.html: 2 links (deployment guide + source code)

Changed:
  github.com/AgenticGovernance/tractatus
  → github.com/AgenticGovernance/tractatus-framework

RESULT: Public website now correctly links to sanitized public repository
IMPACT: Prevents external users from accessing internal development files

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 19:03:18 +13:00
TheFlow
9c2ff15e03 fix(cache): update cache-busting version for i18n scripts on about.html
Updated i18n-simple.js and language-selector.js version to 1761023171
to force browser reload after translation fixes (inst_017 violations).

This ensures users see the corrected 'architectural constraints'
instead of cached 'architectural guarantees' text.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 18:06:25 +13:00
TheFlow
85ad18529d fix(i18n): eliminate inst_017/018 violations from German and French translations
GERMAN TRANSLATIONS (2 violations → 0):
- public/locales/de/about.json:70
  - "architektonische Garantien" → "architektonische Beschränkungen"
  - (architectural guarantees → architectural constraints)

- public/locales/de/implementer.json:16
  - "produktionsreife kommerzielle Software" → "kommerzielle Software"
  - (production-ready commercial software → commercial software)

FRENCH TRANSLATIONS (2 violations → 0):
- public/locales/fr/about.json:70
  - "garanties architecturales" → "contraintes architecturales"
  - (architectural guarantees → architectural constraints)

- public/locales/fr/implementer.json:16
  - "logiciel commercial prêt pour la production" → "logiciel commercial"
  - (commercial software ready for production → commercial software)

RESULT: All German and French translations now match English inst_016/017/018 compliance

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 18:03:40 +13:00
TheFlow
9b85fb4435 fix(content): remove prohibited terms from public UI files (inst_016/017/018)
FIXED PUBLIC UI FILES (10 violations → 0):

public/implementer.html (1 violation):
- Line 86: Removed "production-ready" claim
  "not production-ready commercial software" → "not commercial software"

public/locales/en/implementer.json (1 violation):
- Line 16: Removed "production-ready" claim (matches HTML)

public/js/faq.js (8 violations):
- Line 104: "architectural guarantee" → "architectural enforcement"
  (Constitutional AI comparison)

- Line 895-896: Guard dog analogy fixes
  "not guaranteed" → "not reliable"
  "always work" → "work consistently"

- Line 2119: Framework description
  "production-ready commercial product" → "research implementation, not commercial product"

- Line 2338: Liability disclaimer
  "Guarantee: No software can guarantee" → "Absolute certainty: No software can prevent all"

- Line 2355: Risk comparison
  "No enforcement guarantees" → "No enforcement mechanisms"

- Line 2422: Developer liability mitigation
  "No false production-ready claims" → "Accurate maturity statements (research, not commercial)"

RESULT: All public-facing UI content now inst_016/017/018 compliant

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 17:49:56 +13:00
TheFlow
5da31237b6 fix(values): remove prohibited 'guarantee' language from user-facing content
VIOLATION: Using absolute assurance language violates inst_017
- README.md: "architectural AI safety guarantees" → "enforcement"
- README.md: "guarantees transparency" → "provides transparency"
- public/index.html meta: "guarantees" → "enforcement"
- public/about.html CTA: "architectural guarantees" → "constraints"
- public/js/components/footer.js: "guarantees" → "enforcement"
- public/js/faq.js (5 instances): "guarantees" → "enforcement/constraints"
- public/locales/en/*.json (3 files): "guarantees" → "enforcement/constraints"
- scripts/seed-first-blog-post.js: "safety guarantees" → "safety constraints"

RESULT: All user-facing "guarantee" language removed
- Production website now compliant with inst_017
- No absolute assurance claims in public content
- Framework documentation still pending (hook blocked markdown edits)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 15:19:25 +13:00