Commit graph

43 commits

Author SHA1 Message Date
Claude
d1afc5592a
test: add tests for admin modal components (Settings, PlatformUser, ActivityLog, ServiceManager)
Adds Pest test suites for the four critical admin modals using test double
components, following the existing LivewireModalTest.php pattern. Covers
tab navigation, form validation, CRUD flows, filter combinations, and
state management. Fixes #7.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:51:57 +00:00
f90cd2c3ec Merge pull request 'DX audit and fix (PHP)' (#29) from agent/dx-audit-and-fix--laravel-php-package into dev
Reviewed-on: #29
2026-03-24 11:36:48 +00:00
Snider
bcb40d4ebf fix(dx): add strict_types, composer scripts, and fix test discovery
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 3s
CI / PHP 8.4 (pull_request) Failing after 2s
- Add declare(strict_types=1) to 17 PHP files missing it (13 Livewire
  modals, 1 route file, 1 migration, 1 test use case, TestCase)
- Add composer test/lint scripts to composer.json for monorepo consistency
- Fix phpunit.xml to discover tests in src/Search/Tests and src/Mod/Hub/Tests
- Update CLAUDE.md commands section to document composer test/lint

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 09:04:27 +00:00
Snider
8ed30235fe chore: add .core/ and .idea/ to .gitignore
Some checks failed
Publish Composer Package / publish (push) Failing after 8s
CI / PHP 8.3 (push) Failing after 2s
CI / PHP 8.4 (push) Failing after 2s
2026-03-15 10:17:50 +00:00
Snider
f4fc6976de docs: add CLAUDE.md project instructions
Some checks failed
CI / PHP 8.3 (push) Failing after 3s
CI / PHP 8.4 (push) Failing after 2s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 13:38:02 +00:00
Snider
67b5eb2af9 feat: rename package to lthn/php-admin for Packagist
Some checks failed
CI / PHP 8.3 (push) Failing after 2s
CI / PHP 8.4 (push) Failing after 3s
2026-03-09 17:59:52 +00:00
Snider
72820e3c79 fix: rename core/php-framework dependency to core/php
Some checks failed
CI / PHP 8.3 (push) Failing after 2s
CI / PHP 8.4 (push) Failing after 2s
2026-03-09 17:38:38 +00:00
Snider
1644f47785 chore: rename package to core/php-admin
Some checks failed
CI / PHP 8.3 (push) Failing after 3s
CI / PHP 8.4 (push) Failing after 2s
Aligns composer package name with forge repo path
(forge.lthn.ai/core/php-admin). Part of host-uk/* → core/* migration.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-03 10:38:58 +00:00
Snider
ff37c7626e fix(ci): install zip in release workflow
Some checks failed
CI / PHP 8.3 (push) Failing after 2s
CI / PHP 8.4 (push) Failing after 2s
Forgejo Composer API requires zip format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:44:01 +00:00
Snider
e9a4d10852 fix(ci): simplify release workflow, use FORGEJO_REF_NAME
Some checks failed
CI / PHP 8.3 (push) Failing after 3s
CI / PHP 8.4 (push) Failing after 3s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:36:27 +00:00
Snider
25ada6110a fix(ci): use Forgejo-native variables in release workflow
Some checks failed
CI / PHP 8.3 (push) Failing after 3s
CI / PHP 8.4 (push) Failing after 3s
Replace github.server_url/GITHUB_REF_NAME with explicit forge URL
and GITEA_REF_NAME/GITEA_OUTPUT.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:13:21 +00:00
Snider
32e919ff2e feat: add Forgejo release workflow for Composer registry
Some checks failed
CI / PHP 8.3 (push) Failing after 3s
CI / PHP 8.4 (push) Failing after 2s
On tag push (v*), zips the package and publishes to the
forge.lthn.ai Composer package registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:00:19 +00:00
22f0e49b4b fix(ci): correct container image expression
Some checks failed
CI / PHP 8.3 (push) Failing after 1s
CI / PHP 8.4 (push) Failing after 1s
2026-02-23 13:47:07 +00:00
2dc7632ef5 feat(ci): use lthn/build:php container image
Some checks failed
CI / PHP 8.3 (push) Failing after 0s
CI / PHP 8.4 (push) Failing after 0s
Replace setup-php action with pre-built container.
Eliminates ~50s setup overhead per matrix job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:46:46 +00:00
Claude
739e84d84b ci: clean up workflow comment
All checks were successful
CI / PHP 8.3 (push) Successful in 1m11s
CI / PHP 8.4 (push) Successful in 54s
2026-02-23 05:56:02 +00:00
Claude
69897aedab ci: trigger v5 run
Some checks are pending
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
2026-02-23 05:53:59 +00:00
Claude
702717394a ci: retrigger workflow
Some checks are pending
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
2026-02-23 05:48:37 +00:00
Claude
a4626e8f41 ci: add composer config for path repositories (v5)
Some checks are pending
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
2026-02-23 05:45:47 +00:00
Claude
f57a3b21ba
fix(ci): hard-code sister package clone instead of PHP parsing
Some checks failed
CI / PHP 8.3 (push) Failing after 51s
CI / PHP 8.4 (push) Failing after 45s
Direct git clone of ../php-framework avoids shell escaping
issues with dynamic PHP-based path extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 05:31:39 +00:00
Claude
8f66284a52
fix(ci): use single-quoted PHP to avoid shell escaping issues
Some checks failed
CI / PHP 8.3 (push) Failing after 57s
CI / PHP 8.4 (push) Failing after 46s
Switch php -r argument to single quotes so PHP dollar signs
are not interpreted by bash. Pipe output to while-read loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 05:24:20 +00:00
Claude
a74e74c81b
fix(ci): correct bash escaping in dependency checkout step
Some checks failed
CI / PHP 8.3 (push) Failing after 58s
CI / PHP 8.4 (push) Failing after 45s
The PHP variables inside php -r need \$ escaping, but shell
variables outside need bare $ for command substitution and
variable expansion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 05:19:11 +00:00
Claude
812886dc33
ci: inline workflow to bypass reusable workflow cache
Some checks failed
CI / PHP 8.3 (push) Failing after 46s
CI / PHP 8.4 (push) Failing after 47s
The Forgejo act runner caches reusable workflow definitions,
preventing updates from being picked up. Inline the workflow
with dependency checkout step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 05:11:43 +00:00
Claude
912927fdd0
ci: use reusable PHP test workflow from core/php
Some checks failed
CI / tests (push) Failing after 1m16s
Co-Authored-By: Charon <charon@lethean.io>
2026-02-23 01:22:03 +00:00
63abc5f99a Merge pull request 'security: validate JSON metadata fields to prevent mass assignment' (#22) from security/validate-json-metadata into main
Some checks failed
CI / PHP 8.3 (push) Failing after 1s
CI / Assets (push) Failing after 1s
CI / PHP 8.2 (push) Failing after 1s
CI / PHP 8.4 (push) Failing after 1s
2026-02-21 01:26:03 +00:00
8922683bcf
security: validate JSON metadata fields to prevent mass assignment
Some checks failed
CI / PHP 8.2 (pull_request) Failing after 1s
CI / PHP 8.3 (pull_request) Failing after 1s
CI / PHP 8.4 (pull_request) Failing after 1s
CI / Assets (pull_request) Failing after 1s
Add mutators to Service and HoneypotHit models that enforce size and
structure limits on JSON fields (metadata, headers). Service.setMeta()
now validates key format. TeapotController pre-filters header count
before passing to the model.

Fixes #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:25:47 +00:00
ee383bbe3f Merge pull request 'fix(security): improve TeapotController header sanitization' (#21) from security/improve-teapot-sanitization into main
Some checks are pending
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
CI / Assets (push) Waiting to run
2026-02-20 12:10:58 +00:00
498bceab88 Merge pull request 'security: add rate limiting to admin action endpoints' (#20) from security/rate-limit-admin-actions into main
Some checks are pending
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
CI / Assets (push) Waiting to run
2026-02-20 12:10:47 +00:00
163d34aacf fix(security): improve TeapotController header sanitization (#13)
Some checks failed
CI / PHP 8.2 (pull_request) Failing after 1s
CI / PHP 8.4 (pull_request) Failing after 1s
CI / PHP 8.3 (pull_request) Failing after 1s
CI / Assets (pull_request) Failing after 1s
Switch header storage from blacklist to whitelist approach, add private
IP detection for auto-block bypass, and validate referer URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:50:04 +00:00
9ae0055f33 security: add rate limiting to admin action endpoints (#12)
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 27s
CI / PHP 8.2 (pull_request) Failing after 30s
CI / Assets (pull_request) Failing after 1s
CI / PHP 8.4 (pull_request) Failing after 1s
Add per-user rate limiting to sensitive Livewire component methods to
prevent abuse from compromised admin sessions. Introduces a reusable
HasRateLimiting trait and applies it to PlatformUser, Settings, and
WaitlistManager components.

Rate limits:
- Tier changes, verification, entitlements: 10/min per admin
- Profile updates, preferences: 20/min per user
- Password changes: 5/min per user
- Data exports: 5/min per admin
- Deletions/anonymisation: 3/min per admin

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:28:26 +00:00
6bdb6c0242 Merge pull request 'docs: add Phase 0 environment assessment and test baseline (#2)' (#4) from feat/phase-0-assessment into main
Some checks are pending
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
CI / Assets (push) Waiting to run
Reviewed-on: #4
2026-02-20 02:29:48 +00:00
82197da41e docs: add Phase 0 environment assessment and test baseline (#2)
Some checks failed
CI / PHP 8.2 (pull_request) Has been cancelled
CI / PHP 8.3 (pull_request) Has been cancelled
CI / PHP 8.4 (pull_request) Has been cancelled
CI / Assets (pull_request) Has been cancelled
Comprehensive assessment of core-admin package covering:
- Environment and dependency analysis
- Test baseline documentation (6 test files, 280+ tests)
- Architecture review (event-driven providers, 30 Livewire modals)
- Code quality status (strict typing, UK English conventions)
- Outstanding work prioritisation from TODO.md

Key findings:
- Package is healthy with excellent test coverage
- Cannot run standalone (requires parent Laravel app)
- Recent major testing push completed January 2026
- Recommended: Add PHPStan configuration for type safety

Co-Authored-By: Clotho <clotho@lthn.ai>
2026-02-20 02:25:01 +00:00
Snider
c8809d12ea docs: add January 2026 completed items to changelog
Some checks failed
CI / PHP 8.2 (push) Has been cancelled
CI / PHP 8.3 (push) Has been cancelled
CI / PHP 8.4 (push) Has been cancelled
CI / Assets (push) Has been cancelled
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:51:57 +00:00
Snider
5a2ce4bab8 test(layout): add comprehensive tests for HLCRF layout system
Add tests for the HLCRF (Header-Left-Content-Right-Footer) layout system
covering all required functionality:

- Layout variant parsing (C, HC, HCF, LC, CR, LCR, HLCRF, etc.)
- Self-documenting ID system (H-0, C-R-2, data-block, data-slot)
- Nested layout rendering with correct path propagation
- Slot rendering with multiple content types (string, Htmlable, closures)
- Alias methods (addHeader, addLeft, addContent, addRight, addFooter)
- Attributes and CSS class management
- Semantic HTML structure (header, aside, main, footer elements)
- Real-world layout patterns (admin dashboard, docs site, email client)
- Edge cases and boundary conditions

80+ tests covering the complete HLCRF layout system.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:27:30 +00:00
Snider
e5a71d2a2d test(modal): add comprehensive tests for Livewire modal system
Add tests for modal opening/closing, event handling, data passing,
validation, nested modals, and lifecycle management. Tests use
isolated test double components to verify modal behaviour patterns
used throughout core-admin.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:23:17 +00:00
Snider
a27abc6b63 test(search): add comprehensive tests for search provider registry
Tests cover:
- Provider registration (single and multiple)
- Provider availability filtering by user and workspace
- Search execution and result aggregation
- Result flattening for keyboard navigation
- Fuzzy matching (substring, case-insensitive, word-start, abbreviation)
- Relevance scoring hierarchy
- SearchResult creation, conversion, and immutability
- Integration tests with multiple providers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:18:33 +00:00
Snider
cecf4a9f7b test(honeypot): add comprehensive tests for teapot/honeypot anti-spam system
Add tests for the honeypot detection system that catches bots ignoring robots.txt:
- Bot detection patterns (SEO bots, AI crawlers, scripting tools, headless browsers)
- Severity classification (warning vs critical paths)
- TeapotController response (418 status, custom headers, hit logging)
- Rate limiting to prevent log flooding
- Header sanitization (removes sensitive headers before storage)
- Model scopes (recent, fromIp, bots, critical, warning)
- Statistics for dashboard (total, today, unique IPs, top bots)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:14:45 +00:00
Snider
0fd8185a99 test(forms): add authorization props tests for form components
Add comprehensive Pest tests for form component authorization props
(canGate/canResource/canHide). Tests cover Button, Input, Select,
Checkbox, Toggle, and Textarea components.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:33:14 +00:00
Snider
a91849fb53 docs: add package documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 10:47:50 +00:00
Snider
63f274f83a docs: update CLAUDE.md for core-admin package specifics
Replace generic framework template with package-specific guidance:
- Document the three Boot.php architecture pattern
- Add Form Components and Search System sections
- Update commands to match actual package scripts
- Simplify directory structure to focus on src/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:03:40 +00:00
Snider
b7f77480d3 refactor: update namespaces for L1 package convention
- Core\Mod\Tenant -> Core\Tenant

Part of namespace restructure to align with L1/L2 module conventions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:34:41 +00:00
Snider
17bb2c8dbf Add Hub service layer and admin navigation restructure
Introduce Core\Service\Admin\Boot as the service definition for the
Hub admin panel. Update changelog to document TASK-005 Hades admin
navigation audit including new menu structure and AdminMenuProvider
interface.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:12:01 +00:00
Snider
71c0805bfd monorepo sepration 2026-01-26 20:56:28 +00:00
Snider
8ee3a54482
Initial commit 2026-01-26 20:48:24 +00:00