Commit Graph

21 Commits

Author SHA1 Message Date
James cd2b67edd2 feat: template system — save/load request templates in DB; Use Template button; wizard uses ImportTemplate; save-as-template after import 2026-03-17 15:21:50 -04:00
James 912fd55bf3 feat: delete project, seller logos on cards, org reuse on scrape
- Add DELETE /api/projects/{projectID} — super admin only, soft-deletes
  project and all child entries
- Projects page: delete button on hover, alphabetical sort, seller org
  logo on project cards
- Scrape endpoint checks for existing org by domain before scraping;
  reuses existing org + members if found
- AddOrgToDeal reuses existing org entry when domain matches
- Clearer error message when website HTML exceeds LLM context limit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 19:22:39 -04:00
James 52edadab72 chore: auto-commit uncommitted changes 2026-03-16 06:02:44 -04:00
James f06cce9089 feat: inline add section/request in tree; fix New List sort_order; Import List rename; + Section/+ Request buttons on list rows 2026-03-14 19:16:22 -04:00
James ce2c68634d feat: create request list manually; larger action buttons; Summary View/Detailed View toggle 2026-03-14 18:42:21 -04:00
James 84f8350700 feat: server-side test role — PUT /api/admin/test-role writes to session, middleware injects into context 2026-03-12 03:45:39 -04:00
James b402d64cb9 feat: org edit modal — click card to edit name/domains/role/website/desc; PUT /api/orgs/:id 2026-03-12 02:53:23 -04:00
James 6e50974faf security: hard block on DB files throughout the portal
Platform rule: raw database files (.db, .sqlite, .sqlite3, .sql,
.mdb, .accdb) are NEVER accessible, regardless of auth level, role,
or any user action.

Enforced at four layers:
1. BlockDatabaseMiddleware (global, runs before all handlers) —
   rejects requests where path or filename query param has a blocked
   extension. Cannot be bypassed at the route level.

2. UploadObject — rejects uploads of blocked file types at ingestion.
   They never enter the object store in the first place.

3. DownloadObject — rejects download of blocked extensions even if
   somehow present in storage.

4. PreviewObject — rejects preview of blocked extensions.

5. Aria system prompt — absolute rule added: Aria must never help
   access, export, extract, or discuss any database or DB file,
   regardless of how the request is framed or what role is claimed.

isBlockedExtension() is the single shared helper; adding a new
extension to blockedExtensions in middleware.go propagates to all
four enforcement points automatically.
2026-03-08 08:25:25 -04:00
James 3caf312fdb feat: file preview, buyer visibility, inline editing, template consolidation, CSS centralization 2026-03-07 13:10:12 -05:00
James 6d09b1ad24 chore: auto-commit uncommitted changes 2026-03-07 00:01:23 -05:00
James 27c715f963 chore: auto-commit uncommitted changes 2026-03-04 00:01:22 -05:00
James 0647eb91b6 Request tree: spreadsheet-style table with D&D, linking, import
- Add sort_order column to entries (migration 002)
- Upgrade migration runner to handle directory of SQL files
- Add TypeSection, SortOrder field, RequestListData, SectionData types
- Add tree API: ListRequestTree, MoveEntry, AnswerLink CRUD, ListAnswers
- Rewrite ImportRequests to create hierarchical tree (request_list → section → request)
- Rewrite project page Requests tab as spreadsheet-style tree table
  - Collapsible request lists and sections
  - Auto-numbering (1, 1.1, 1.2, 2.1.1)
  - Drag & drop reordering between sections
  - Priority/status badges with color coding
  - Attach answer modal (link existing docs or upload new)
  - Per-row actions menu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 18:30:12 -05:00
James 54a8222b51 Add 5-theme switcher + open on projects instead of tasks
Landing page: /app now redirects to /app/projects (not tasks).
Logo links updated across all templates.

Theme system with 5 options persisted in localStorage:
- Midnight (default dark navy + gold)
- Light (white/gray + blue accent)
- Slate (gray-blue + teal accent)
- Compact (same as midnight, 85% font scale)
- Executive (warm dark browns, larger fonts, serif headings)

CSS custom properties override all hardcoded Tailwind colors via
attribute selectors. Floating theme bar on all pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:46:16 -05:00
James 051c6afe19 Fix project page: route alias + request rendering + remove smoke test data
- Add /api/projects/{projectID} route (was only /detail, frontend called without suffix)
- Fix project.html: unwrap response envelope (API returns {project:..., workstreams:...})
- Fix request list: use r.data || parseData(r.data_text) so r.data.title renders correctly
- DB: deleted 5 smoke test projects + their entries/access records from Shannon
2026-03-01 06:53:05 -05:00
James 03b75e8a7b Security audit 2026-02-28: fix critical/high findings
CRITICAL fixes:
- OTP code comparison now uses constant-time compare (timing attack)
- Backdoor code comparison now uses constant-time compare (timing attack)

HIGH fixes:
- CORS policy restricted to allowlist (was wildcard *)
- Added security headers middleware (X-Frame-Options, X-Content-Type-Options, CSP, etc.)

See docs/SECURITY-AUDIT-2026-02-28.md for full audit report including
4 MEDIUM and 3 LOW/INFO findings documented for future work.
2026-02-28 07:17:06 -05:00
James 45ee8d0e4b Port diligence request model + CSV/XLSX import from old dealroom
- Add RequestData and WorkstreamData types to lib/types.go
- Add excelize/v2 dependency for XLSX parsing
- Add GET /api/projects/{projectID}/requests endpoint (lists requests grouped by section)
- Add POST /api/projects/{projectID}/requests/import endpoint with:
  - Smart header detection (scans first 12 rows for keyword matches)
  - CSV and XLSX support (detects by extension + magic bytes)
  - Priority mapping (high/critical/urgent→high, low/nice/optional→low)
  - Mode: add or replace existing requests
  - Optional section_filter parameter
  - Optional create_workstreams=true to create workstreams from sections
- Update project.html template:
  - Requests tab calls /api/projects/{id}/requests
  - Results grouped by section with collapsible headers
  - Shows item_number, title, priority badge (colored dot), status badge
  - Import button opens modal with file upload, mode selector, options
2026-02-28 07:13:29 -05:00
James e6a68822c2 Add all missing app templates: projects, project, request, orgs, admin 2026-02-28 06:48:51 -05:00
James 3df2482a4d chore: auto-commit uncommitted changes 2026-02-28 06:01:21 -05:00
James 5ac277ce6f Add test suite: crypto, dbcore, rbac, auth middleware, integration 2026-02-28 05:46:47 -05:00
James 4e89f79a67 Add Aria chatbot
- New POST /api/chat endpoint for AI-powered chat
- Calls Anthropic Claude Haiku 3.5 with embedded Dealspace knowledge
- Rate limiting: 20 requests/IP/hour
- Lead capture: emails detected and saved to /opt/dealspace/data/leads.jsonl
- Frontend chat widget (chat.js, chat.css) added to all HTML pages
- Navy/gold theme matching site design
- Mobile responsive
- CORS configured for muskepo.com
2026-02-28 04:52:19 -05:00
James 202bac8693 Initial Go foundation
Complete project structure with FIPS 140-3 crypto (AES-256-GCM + HKDF-SHA256),
entry-based data model, three RBAC choke points (EntryRead/EntryWrite/EntryDelete),
optimistic locking, soft delete, blind indexes for search, embedded website,
and deployed to muskepo.com.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 04:25:57 -05:00