271 Commits

Author SHA1 Message Date
8777ae33c8 style(ui): clean Delegate Session button text (remove + and key emoji) 2026-08-26 19:39:04 -07:00
debe95c89b style(ui): polish event deck section title to Event Passes and button to End Event 2026-08-26 19:05:14 -07:00
a53e69d9fb
Merge pull request #52 from mrteye/feat-event-attendee-controls-13863970798268504771
feat: implement live attendee management drawer and session pause

Implemented Phase 4 of the Event & Session Overhaul:

- **Database:** Added `is_paused` flag to `sessions` and `event_passes` tables safely via soft-fail migrations.
- **API (Sessions):** Added `POST /api/sessions/:id/pause` endpoint; updated `session_resolver` to serialize `is_paused` into Valkey caches and the edge middleware (`auth_forward.ts`) to return 403 when paused.
- **API (Events):** Added endpoints to fetch `attendees` (resolving via `guest_<slug>_<seat>` deterministic lookup), `rotate-pin`, and `expand` seats. Secured all event modification endpoints to enforce `created_by` or global admin scope.
- **UI & Scripts:** Built `EventAttendeesDrawer` to visualize live connections, injected the `<EventAttendeesDrawer />` container in `SessionsPage`, added quick controls to the `EventCockpitDeck`, and backed the DOM manipulation seamlessly with vanilla JS in `SessionsScript.tsx`.
2026-08-26 18:55:49 -07:00
google-labs-jules[bot]
0a4f6a8344 feat(event-controls): implement live attendee management drawer and session pause
This commit finalizes Phase 4 of the Event & Session Overhaul:
1. Implements session pause logic across PostgreSQL schema, Valkey cache, and `auth_forward.ts` edge check (`is_paused`).
2. Implements non-destructive operational endpoints (`/api/events/:id/rotate-pin`, `/api/events/:id/expand`, `/api/events/:id/attendees`) with Zero-Trust Ownership verification.
3. Upgrades existing `end` and `extend` endpoints in `events.ts` to utilize robust Zero-Trust Ownership queries (created_by OR isGlobalAdmin).
4. Creates `EventAttendeesDrawer.tsx` to handle live participant inspection and individual session controls (Pause, Revoke).
5. Updates `EventCockpitDeck.tsx` and `SessionsScript.tsx` to mount and drive the new controls via vanilla JavaScript, respecting zero-framework guidelines.
6. Ensures `deno fmt`, `deno task lint`, `deno task check` and `deno test` execute successfully against the new schema and API guards.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 01:53:52 +00:00
f6b5f4704c docs(tasks): add and format phase 4 task specification for live event controls 2026-08-26 17:53:26 -07:00
efbf5b9f9a
Merge pull request #51 from mrteye/feat-phase-4-event-controls-plan-6385071723789224813
feat: add Phase 4 event controls task plan
2026-08-26 17:49:12 -07:00
google-labs-jules[bot]
a942a18e82 docs: add Phase 4 event attendee drawer and live controls task plan
Created a detailed Markdown task specification in `tasks/new/` for Phase 4 of the event system overhaul, outlining the database updates for session pausing, API endpoints for live controls, and UI enhancements for the attendee slide-out drawer based on provided architectural guidance.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 00:45:21 +00:00
57f5fc7700
Merge pull request #50 from mrteye/feat-sessions-drawer-machine-11417224878052948069
feat(ui): implement 2-state workshop drawer machine and refine session page hierarchy

Reorganized the Sessions page hierarchy to place the Event Cockpit below the main header. Refactored the Workshop Drawer to utilize a strict 2-state container machine for clean transitions between the creation form and the success handoff modal. Implemented UI accessibility enhancements and fixed mobile text wrapping constraints.
2026-08-26 17:14:32 -07:00
google-labs-jules[bot]
d057e080d3 feat(ui): implement 2-state workshop drawer machine and refine session page hierarchy
- Moved `EventCockpitDeck` below main header in `SessionsPage.tsx`
- Refactored `WorkshopDrawer.tsx` to strictly use a 2-state display toggle (`#eventCreateState` and `#eventHandoffState`)
- Added `aria-label`s to copy buttons for accessibility
- Configured `#status-banner` with `role="status"` and `aria-live="polite"`
- Fixed mobile title text wrapping on `#createdEventTitle`
- Fixed script emoji injection logic to prevent double emojis
- Added JS reset logic in `closeDelegateDrawer` to restore drawer states and clear form data

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 00:12:50 +00:00
49c071945d test(events): stub isRateLimited at top level for quiet hermetic test execution 2026-08-26 17:00:07 -07:00
f0c10a313d
Merge pull request #49 from mrteye/feat-events-join-reentry-limits-8447618209468736166
feat(events): implement bifurcated join inputs and NAT-safe idempotency

Discovery Links: Added Join with PIN links next to registration options on the login and register pages.
Bifurcated Input Normalization: Updated the Join endpoints to normalize event slugs to LOWER(slug) and PINs by stripping whitespace/hyphens via regex before checking the SQL layer. This allows event slugs to correctly keep hyphens while letting users type in 6-digit PINs without client-side format anxiety.
NAT-Safe Idempotent Cookies: Reworked POST /api/join to use a SELECT operation first to test input matching. If a match is found, the endpoint will check if the user is already authenticated as a valid guest for this specific event (username.startsWith("guest_" + slug)). If so, it successfully redirects with a renewed session TTL instead of claiming an additional seat or duplicating a user account.
Rate Limiting: Added a non-mutating isRateLimited function back to server/ratelimit.ts. The join API checks this limit upfront (5 attempts / 60 seconds). Only failed lookup branches trigger checkRateLimit which increments the counter. Successful attempts bypass the rate limiter, mitigating DoS via brute-forcing while remaining performant.
Testing: Updated events.test.ts to assert normalization paths, rate limit threshold locking, and NAT-safe reusable behaviors, achieving 100% test passing and preserving coverage.
2026-08-26 16:57:50 -07:00
google-labs-jules[bot]
edbceae0fb feat(events): implement bifurcated join inputs and NAT-safe idempotency
- Adds UI links for joining with PIN in Login and Register pages.
- Normalizes event slugs to lowercase (preserving hyphens) and event PINs to strip all hyphens/spaces to handle raw inputs.
- Implements a pre-check rate limit pattern (`isRateLimited`) to safely enforce a max of 5 failed attempts per IP window (60s) without rate-limiting successful authentications.
- Achieves NAT-safe idempotency in `POST /api/join` by extracting and reusing active event guest sessions instead of blindly incrementing claimed seats on every request.
- Integrates complete test suite coverage for these new constraints.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 23:57:13 +00:00
455d130f74
Merge pull request #48 from mrteye/jules-phase-1-events-12547370246717086401
feat: Phase 1 Event & Session Overhaul (Guest Ingress & Audits)

Allowed guest accounts to be evaluated in forward-auth
Validated guest account's customScopes and rejected ungranted access
Added Array parameterization and UNION query in getDashboardApps
Mapped customScopes to getDashboardApps in the UI route /dashboard
Wired web and CLI joins in events.ts to auditWrapper.auditLog using correct schema (event.id, {slug, method})
Added auditWrapper.auditLog unit test validations in events.test.ts
Added guest session scope unit tests in forward_auth.test.ts
Moved Markdown tasks logic from tasks/new/ to tasks/complete/
2026-08-26 16:34:23 -07:00
google-labs-jules[bot]
eed5c8a0fd feat: Implement Phase 1 Event & Session Overhaul (Guest Ingress & Audits)
- Allowed guest accounts to be evaluated in `forward-auth`
- Validated `guest` account's `customScopes` and rejected ungranted access
- Added Array parameterization and `UNION` query in `getDashboardApps`
- Mapped `customScopes` to `getDashboardApps` in the UI route `/dashboard`
- Wired web and CLI joins in `events.ts` to `auditWrapper.auditLog` using correct schema (`event.id`, `{slug, method}`)
- Added `auditWrapper.auditLog` unit test validations in `events.test.ts`
- Added guest session scope unit tests in `forward_auth.test.ts`
- Moved Markdown tasks logic from `tasks/new/` to `tasks/complete/`

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 23:34:00 +00:00
e88512edad docs(tasks): update phase 1, 2, and 3 tasks with forensic audit-1 hardening 2026-08-26 15:14:48 -07:00
1ef1125b4a docs(tasks): add and format phase 1, 2, and 3 task specifications from jules 2026-08-26 15:06:57 -07:00
cc38815867
Merge pull request #46 from mrteye/feat-event-join-planning-11918200632794003938
story(events): add phase 2 event overhaul planning document
2026-08-26 15:04:38 -07:00
e357a26abb
Merge pull request #45 from mrteye/feature-guest-ingress-task-plan-17304586254181847688
docs: add task plan for phase 1 of events guest ingress
2026-08-26 15:04:30 -07:00
b2ad719252
Merge pull request #47 from mrteye/feat-ui-sessions-layout-drawer-machine-plan-6316789782106551879
feat(ui): generate task plan for sessions layout and drawer machine
2026-08-26 15:04:05 -07:00
google-labs-jules[bot]
5c1be5657e feat(ui): generate task plan for sessions layout and drawer machine
Generates a planning task file in `tasks/new/` detailing the architecture, requirements, and steps for Phase 3 of the Event & Session Overhaul, specifically addressing the page hierarchy, the 2-state drawer machine, and layout bugs.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 22:01:09 +00:00
google-labs-jules[bot]
25451ff172 story(events): add phase 2 event overhaul planning document
Adds a new task specification in `tasks/new/` documenting the plan for Phase 2 Event Overhaul,
including PIN discovery, input normalization, rate limiting, and NAT-safe idempotent re-entry
for event joins.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 22:01:03 +00:00
google-labs-jules[bot]
4ec15fe35f docs: add task plan for phase 1 of events guest ingress
Adds the task definition markdown file `2026-0826.01.jul.story.events.phase-1-guest-ingress-1400.md` detailing the architectural scope and plan for enabling Traefik ForwardAuth guest ingress, bridging custom scopes to the Launchpad UI via UNION query, and wiring event claim audit logs using event.id.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 22:00:56 +00:00
e9060eee5a fix(test): mock auditWrapper across tests and add assertions for session events 2026-08-26 12:31:38 -07:00
695d44e16e chore(tasks): close out ui decomposition roadmap
- All three phases (Layout, Admin Drawers, WebAuthn deduplication) are now completed
2026-08-26 12:07:15 -07:00
09c2b5d7a7 docs(protocol): strip redundant pre-review summary gate from agent instructions 2026-08-26 12:04:49 -07:00
58d8e54ae5 fix(ui): wire AdminRolesScript and clean unused imports
- Replace inline script in AdminRolesPage with extracted AdminRolesScript component
- Remove unused JSX import aliases and format AdminUserDetailsPage
2026-08-26 11:43:52 -07:00
fa2778d4fe
Merge pull request #44 from mrteye/ui-admin-decomposition-10975413065274099261
feat(ui): decompose Admin UI with separate Drawers and Scripts

Completes the phase 2 of the UI decomposition roadmap for the Admin pages by extracting the drawer components and client-side SSR JSX scripts into modular files.

- Extracted forms (`AppDrawer`, `InviteDrawer`, `RoleEditorDrawer`, `GrantDrawer`) to `ui/components/admin/drawers/`.
- Extracted scripts (`AdminAppsScript`, `AdminInvitesScript`, `AdminRolesScript`, `AdminUserDetailsScript`) to `ui/components/admin/`.
- Updated `AdminAppsPage.tsx`, `AdminInvitesPage.tsx`, `AdminRolesPage.tsx`, and `AdminUserDetailsPage.tsx` to use the components.
2026-08-26 11:38:00 -07:00
google-labs-jules[bot]
65f59521c0 feat(ui): decompose Admin UI with separate Drawers and Scripts
Phase 2 Admin Drawers & Scripts execution:
- Extract `AppDrawer`, `InviteDrawer`, `RoleEditorDrawer`, and `GrantDrawer`.
- Extract `AdminAppsScript`, `AdminInvitesScript`, `AdminRolesScript`, and `AdminUserDetailsScript`.
- Hook extracted components into their respective pages.
- Format `AdminRolesPage.tsx` and all modified files using `deno fmt`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 18:37:15 +00:00
42b336173e docs(protocol): enshrine black-box delegation and pre-review summary gate
- Add Section 3.5 to AGENTS.md for agent orchestration and tool autonomy
- Add Section E to tasks/GUIDELINES.md with pre-review summary gate
- Update tasks/do.md dispatch template with DRY positive acceptance criteria
- Align task lifecycle state machine to keep in-flight work in tasks/new/
2026-08-26 10:37:22 -07:00
9e2cd81e4d
Merge pull request #43 from mrteye/ui-webauthn-refactor-8252947523855268978
Refactor WebAuthn UI Components & Deduplicate Bip39 Assets

Phase 3 of the UI decomposition task. I successfully decomposed the WebAuthn client scripts out of the main page components (`PasskeysPage.tsx` and `RegisterPage.tsx`), and I also deduplicated the wordlist asset by removing the duplicate copy under `ui/public/ui/utils/` and pointing all imports to the correct location.
2026-08-25 23:55:02 -07:00
google-labs-jules[bot]
afaecdaa26 Extract WebAuthn Components & Deduplicate Assets
- Extracted `PasskeyTable` and `WebAuthnScript` into `ui/components/auth/`.
- Refactored `PasskeysPage.tsx` and `RegisterPage.tsx` to use the new components instead of inline scripts and HTML.
- Deleted the duplicate `ui/public/ui/utils/bip39_wordlist.ts` and `ui/public/ui/utils/bip39.ts`.
- Updated all import references to use `ui/utils/bip39_wordlist.ts` and `/public/utils/bip39.ts`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 06:54:29 +00:00
f5935a49a7 docs(tasks): move ui decomposition ph1 to complete and format subcomponents 2026-08-25 23:39:39 -07:00
eb15c9003f
Merge pull request #42 from mrteye/feat-ui-decomposition-phase1-13025745089234711919
Refactor Phase 1: Sessions & Layout Extraction
2026-08-25 23:38:37 -07:00
google-labs-jules[bot]
c8cf9c7df7 refactor(ui): extract layout and sessions subcomponents
Extract Navbar, MobileNav, and UserMenu from AuthenticatedLayout.tsx.
Extract SessionTable, SessionDeck, and SessionsScript from SessionsPage.tsx.
Preserves existing pure Hono SSR JSX and logic.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 06:38:22 +00:00
dc2b5488c8 docs(tasks): establish discrete phase task files ph1 through ph3 for ui decomposition roadmap 2026-08-25 22:48:17 -07:00
f40a731ab4
Merge pull request #41 from mrteye/arch-ui-decomposition-roadmap-6487485348399467971
chore(arch): Add UI Decomposition Roadmap task file
2026-08-25 22:47:23 -07:00
google-labs-jules[bot]
0249938459 chore: Create UI Component Decomposition Roadmap task spec
Creates `tasks/new/2026-0825.01.jul.story.arch.ui-decomposition-roadmap-2300.md` containing the architectural analysis and phased execution plan for modularizing `ui/` monoliths into pure SSR JSX components while maintaining testability.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 05:46:56 +00:00
97edc7b89b docs(tasks): mark entire monolith decomposition roadmap epic complete 2026-08-25 22:33:00 -07:00
6f18b156ff
Merge pull request #40 from mrteye/monolith-decomposition-phase-6-6381472741741732772
Refactor: Decompose `server/auth-session.ts` and `ui/mod.ts` (Phase 6)

server/auth-session.ts: Kept as the clean barrel/middleware export for zero-trust scope guards and permission middlewares (requireAdmin, requireScope, hasScope, isSessionAdmin). Re-exported definitions from server/forward_auth.ts and server/session_resolver.ts.
server/forward_auth.ts (new): Extracted Traefik ForwardAuth header parsing, dynamic bypass evaluation (is_public, bypass_paths), and upstream identity injection.
server/session_resolver.ts (new): Extracted multi-cookie iteration, Valkey L1/L2 cache resolution, and PostgreSQL fallback queries.
ui/auth_checks.ts (new): Extracted admin authorization and session verification middleware.
ui/db_queries.ts (new): Extracted raw SQL queries for loading apps, roles, grants, invites, and audit logs.
ui/mod.ts: Refactored to import from ui/db_queries.ts and ui/auth_checks.ts, leaving it purely as the SSR page router mounting the UI view components.
All pre-commit checks (deno fmt, deno task lint, deno task check, deno test --allow-all) ran and passed successfully. No new failures were introduced.
2026-08-25 22:32:07 -07:00
google-labs-jules[bot]
99bb8d794f Refactor server/auth-session.ts and ui/mod.ts to decouple domain utilities, database queries, and admin authorization checks into separate files (server/forward_auth.ts, server/session_resolver.ts, ui/db_queries.ts, ui/auth_checks.ts).
Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 05:31:25 +00:00
f2310503f4
Merge pull request #39 from mrteye/jul-test-monolith-decomposition-4462541866791287539
refactor: Decompose main.test.ts into modular domain test files
2026-08-25 22:12:21 -07:00
google-labs-jules[bot]
0d59c2ac75 refactor(test): decompose main.test.ts into domain specific test files
Extracted the 1,577-line monolithic `server/main.test.ts` into five isolated, domain-specific files under `server/tests/`:
- `forward_auth.test.ts`: ForwardAuth bypass, cookie scoping, and sandbox.
- `rpc.test.ts`: ConnectRPC SPIFFE and RBAC tests.
- `auth.test.ts`: Audit ledger, WebAuthn PRF, passkey magic links.
- `events.test.ts`: Multi-claim join endpoints and killswitch.
- `scopes.test.ts`: Zero-trust guards and self-revocations.

Successfully maintained all tests cleanly isolated via standard mocking and deleted `main.test.ts` after migrating and executing `deno test --allow-all` with zero failures.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 05:12:08 +00:00
e0c12bdef6 docs(tasks): move ph3.1 task spec to complete 2026-08-25 21:39:32 -07:00
9c98e2f2fb
Merge pull request #38 from mrteye/ph41-cli-modularization-791781679227126134
Phase 4.1 CLI Setup Modularization
2026-08-25 21:38:14 -07:00
7f467f86d9
Merge pull request #37 from mrteye/feature-phase-3.1-route-decomposition-390275356595329142
feat(routes): domain route modularization (Phase 3.1)
2026-08-25 21:38:06 -07:00
google-labs-jules[bot]
752bfcf03e Refactor infra/setup/cli.ts into smaller command and prompt modules
Decomposes the monolith `infra/setup/cli.ts` into clean `infra/setup/prompts/` and `infra/setup/commands/` directories while adhering to Cliffy idiomatic modularity. Validated via `deno check`, tests, and format.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 04:37:41 +00:00
google-labs-jules[bot]
589e146ecc feat(routes): decompose admin and auth monolith routes
Extracted domain-specific sub-routers from monolithic `server/routes/admin.ts` and `server/routes/auth.ts` into isolated modules within `server/routes/admin/` and `server/routes/auth/` respectively. The original entry routers were updated to import and assemble these sub-routers without breaking their current HTTP interface or rate limiting/authorization middleware. Testing and linting were run ensuring perfect functionality and 100% test passing score.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 04:37:26 +00:00
e7a2aa8df3 docs(tasks): establish refined modularization specs ph3.1 and ph4.1 2026-08-25 20:31:09 -07:00
50da203512
Merge pull request #36 from mrteye/feat-arch-monolith-decomposition-ph3-15640425587075303208
feat(arch): Decompose server/main.ts monolith (Phase 3)
2026-08-25 20:23:35 -07:00
google-labs-jules[bot]
88821b80af feat: Phase 3 Monolith decomposition of server/main.ts
- Extracts Auth, Registration, and Passkey routes into `server/routes/auth.ts`.
- Extracts all Admin API endpoints into `server/routes/admin.ts`.
- Extracts RPC Connect setup and mTLS listener into `server/rpc.ts`.
- Extracts global rate limiters and IP helpers into `server/middleware.ts`.
- Reduces `server/main.ts` purely to an entrypoint mounting orchestrator.
- Ensures all existing tests and quality gates pass with zero regressions.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 03:23:20 +00:00