Commit graph

33 commits

Author SHA1 Message Date
TheFlow
4f889b073c fix(audit): fix timeline chart rendering with pixel heights and count labels
Fixed broken "Decisions Over Time" chart that wasn't displaying bars.

Root cause: Empty divs with percentage heights collapsed in flex containers.

Fixes applied:
1. **Pixel heights instead of percentages**
   - Calculate absolute pixel heights from h-48 container (192px)
   - Percentage heights don't work in flex containers with items-end

2. **Non-breaking space inside bars**
   - Added   to prevent empty div collapse
   - Even with height set, empty divs can collapse in some layouts

3. **Decision count labels**
   - Display count above each bar for exact numbers
   - Shows both visual proportion (bar height) and exact value (label)

4. **Minimum 10px height**
   - Ensures small values are always visible
   - Prevents bars from disappearing for low counts

5. **Wider bars**
   - Changed from max-w-16 (64px) to w-3/4 (75% width)
   - More visible and easier to interact with

Timeline modes working:
-  6-Hourly (24h) - 4 bars showing last 24 hours in 6-hour buckets
-  Daily (7d) - 7 bars showing last 7 days
-  Weekly (4w) - 4 bars showing last 4 weeks

All modes show current snapshot updated on refresh.

Files changed:
- public/js/admin/audit-analytics.js: Timeline rendering logic
- public/admin/audit-analytics.html: Updated cache version
- public/*.html: Cache version bump for consistency

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 12:22:55 +13:00
TheFlow
bb3d74006d chore: bump cache version for audit analytics fix 2025-10-25 11:51:21 +13:00
TheFlow
38687f4d27 chore: bump cache version for audit analytics improvements 2025-10-25 11:47:22 +13:00
TheFlow
79e873a1fb chore: bump cache version for deployment 2025-10-25 09:37:46 +13:00
TheFlow
fecc868797 chore: bump cache version again 2025-10-25 08:48:14 +13:00
TheFlow
649eda71e1 chore: bump cache version to 0.1.1 for JS changes 2025-10-25 08:47:54 +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
c96441560b chore: bump cache version for CSRF fix deployment 2025-10-24 16:44:40 +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
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
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
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
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
9d390da76b style(ui): update theme, branding, and GitHub repository links
Update UI across all pages with:
- New favicon and brand icons (favicon-new.svg, tractatus-icon-new.svg)
- Theme CSS integration (tractatus-theme.min.css)
- Correct GitHub repository links (AgenticGovernance/tractatus)
- PWA manifest updates
- Consistent branding colors and gradients

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 12:48:29 +13:00
TheFlow
1ef31c076e fix: update copyright attribution to John G Stroh across all website pages
Changed copyright from "Tractatus AI Safety Framework" (not a legal entity)
to "John G Stroh" (actual copyright holder) for legal clarity.

Files updated:
- 13 HTML files (all website pages)
- Consistent with LICENSE file (Copyright 2025 John G Stroh)
- Deployed to production

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 08:16:09 +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
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
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
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
7fa693e9ba feat: change license from MIT to Apache License 2.0
- Created Apache License 2.0 LICENSE file
- Removed all MIT License references from HTML pages
- Updated all footers with Apache 2.0 license links
- Updated about.html with comprehensive license section explaining why Apache 2.0
- Added patent protection, contributor clarity, and community standard benefits
- Updated package.json license field to "Apache-2.0"
- Updated README.md with Apache 2.0 license information
- Deployed LICENSE file to production server (accessible at /LICENSE)

Why Apache 2.0 over MIT:
- Patent protection for users
- Clear contribution terms
- Permissive use (commercial, modification, distribution)
- Community standard in AI/ML projects (TensorFlow, PyTorch, Apache Spark)

All pages cache-busted and deployed with v1759833751

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 23:43:20 +13:00
TheFlow
3eab4c3cec feat: add navigation menus and fix broken links
- Added navigation bar to index.html with links to all main sections
- Added "About" link to all page navigation menus
- Fixed "View Live API Status" button - changed from /api/governance (Phase 2) to 27027 demo
- Removed "Framework Status" footer link (Phase 2 backend work)
- Updated footer resources section with complete site navigation
- Cache-busted all pages for deployment

Navigation now consistent across all pages: Researcher, Implementer, Advocate, Documentation, About, Home

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 23:22:59 +13:00
TheFlow
dd6b3b345e feat: add About and Values pages with Te Tiriti acknowledgment
- Created /about.html with mission, values, framework overview
- Created /about/values.html with comprehensive values statement
- Included respectful Te Tiriti o Waitangi acknowledgment
- Added CARE Principles for Indigenous Data Governance
- Documented digital sovereignty and Māori data sovereignty
- Updated all page footers with Te Tiriti acknowledgment
- Added links to Te Mana Raraunga and indigenous data resources
- Cache-busted all HTML files for deployment

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 23:14:32 +13:00
TheFlow
09f706c51b feat: fix documentation system - cards, PDFs, TOC, and navigation
- Fixed download icon size (1.25rem instead of huge black icons)
- Uploaded all 12 PDFs to production server
- Restored table of contents rendering for all documents
- Fixed modal cards with proper CSS and event handlers
- Replaced all docs-viewer.html links with docs.html
- Added nginx redirect from /docs/* to /docs.html
- Fixed duplicate headers in modal sections
- Improved cache-busting with timestamp versioning

All documentation features now working correctly:
 Card-based document viewer with modals
 PDF downloads with proper icons
 Table of contents navigation
 Consistent URL structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 22:51:55 +13:00
TheFlow
3eff8a8650 feat: improve accessibility (WCAG AA) and mobile responsiveness
Accessibility improvements:
- Add skip links for keyboard navigation on all pages
- Add semantic HTML5 landmarks (header, main, footer) with ARIA roles
- Add aria-hidden="true" to 21+ decorative SVG icons
- Ensure proper form labels on admin login page
- Verify viewport meta tags and lang attributes on all pages
- Maintain proper heading hierarchy (h1 -> h2 -> h3)

Mobile responsiveness improvements:
- Optimize navigation spacing for mobile (space-x-4 sm:space-x-6)
- Add responsive text sizing (text-sm sm:text-base)
- Ensure table overflow handling (overflow-x-auto)
- Verify touch target sizes (px-8 py-3 on buttons)
- Confirm mobile-first grid layouts (grid-cols-1 md:grid-cols-3)

Testing:
- All 118 integration tests passing (85.3%+ coverage)
- All pages verified loading (HTTP 200 OK)
- CSP compliance maintained (script-src 'self')

WCAG AA compliance achieved across all user-facing pages.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 12:34:53 +13:00
TheFlow
3292148f31 feat: add admin dashboard & API reference documentation
Admin Dashboard (complete):
- Created /admin/login.html with JWT authentication
- Created /admin/dashboard.html with full management UI
- Moderation queue with approve/reject workflows
- User management interface
- Document management interface
- Real-time statistics dashboard
- Activity feed monitoring
- All CSP-compliant (external JS files)

API Reference Documentation (complete):
- Created /api-reference.html with complete API docs
- Authentication endpoints (login, verify)
- Document endpoints (list, get, search)
- Governance status endpoint
- Admin endpoints (stats, moderation, users)
- Error codes reference table
- Request/response examples for all endpoints
- Query parameters documentation

Files Created (5):
- public/admin/login.html (auth interface)
- public/admin/dashboard.html (admin UI)
- public/js/admin/login.js (auth logic)
- public/js/admin/dashboard.js (dashboard logic)
- public/api-reference.html (complete API docs)

All pages tested and accessible (200 OK)
Zero CSP violations - all resources from same origin

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 12:27:38 +13:00