Commit graph

38 commits

Author SHA1 Message Date
Snider
8cb9f2df22 fix: update stale import paths and dependency versions from extraction
Some checks failed
CI / PHP 8.3 (push) Failing after 2m29s
CI / PHP 8.4 (push) Failing after 2m5s
Resolve stale forge.lthn.ai/core/cli v0.1.0 references (tag never existed,
earliest is v0.0.1) and regenerate go.sum via workspace-aware go mod tidy.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 13:39:00 +00:00
Snider
1594ea0586 fix(plugin): remove invalid commands/repository schema from plugin.json
Some checks failed
CI / PHP 8.3 (push) Failing after 2m14s
CI / PHP 8.4 (push) Failing after 2m15s
Commands auto-discovered from commands/ directory. Repository must be
a string, not an object.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 10:54:42 +00:00
Snider
78b728c6df feat(plugin): add npm package for Claude Code plugin distribution
Some checks failed
CI / PHP 8.4 (push) Failing after 2m5s
CI / PHP 8.3 (push) Failing after 2m14s
Published as @lthn/core-claude-php on npm.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 10:49:15 +00:00
Snider
e27f8b1088 fix(plugin): add commands/ auto-discover directory, fix plugin.json schema
Some checks failed
CI / PHP 8.4 (push) Failing after 2m3s
CI / PHP 8.3 (push) Failing after 2m11s
Commands must be in `.claude-plugin/commands/` for Claude Code auto-discovery.
Fixed plugin.json to use `{name, description, file}` array format.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 10:18:41 +00:00
Snider
b0074e5870 refactor: move config YAMLs into .core/ convention
Some checks failed
CI / PHP 8.4 (push) Failing after 2m8s
CI / PHP 8.3 (push) Failing after 2m16s
Moves php-commands.yaml, qa.yaml, security-checks.yaml into .core/
directory. Updates internal references to use .core/ paths.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 10:06:58 +00:00
Snider
74ef3ec5e4 refactor: move Go source files to pkg/php/
Some checks failed
CI / PHP 8.4 (push) Failing after 2m8s
CI / PHP 8.3 (push) Failing after 2m18s
Restructure for production embedding — all Go source now under pkg/php/
with locales embedded alongside. Entry point at cmd/core-php/ imports
forge.lthn.ai/core/php/pkg/php. Prepares for Gin router frontend and
native binary production deployment.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-12 19:14:14 +00:00
Snider
303186323a fix(scheduler): pre-filter files for #[Scheduled] before class_exists
Some checks failed
CI / PHP 8.3 (push) Failing after 2m3s
CI / PHP 8.4 (push) Failing after 2m21s
class_exists() can trigger uncatchable E_COMPILE_ERROR when autoloading
classes with method signature mismatches (e.g. Activity model vs updated
Spatie parent). Now checks file contents for '#[Scheduled' string before
attempting to load — avoids autoloading hundreds of unrelated classes.

Also fixes Activity::getChangesAttribute() return type to match the
updated Spatie parent (Collection instead of array).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-12 15:58:15 +00:00
Snider
d02f4361e3 fix(scheduler): skip test directories in ScheduledActionScanner
Some checks failed
CI / PHP 8.4 (push) Failing after 2m1s
CI / PHP 8.3 (push) Failing after 2m8s
Test files inside module Tests/ directories (e.g. app/Mod/Lem/Tests/)
extend Tests\TestCase which isn't available in production without dev
dependencies. The scanner now skips /Tests/ directories and *Test.php
files, and wraps class_exists() in try/catch for defence in depth.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-12 15:45:45 +00:00
Snider
7db3637985 feat(webhook): add CronTrigger scheduled action — replaces 4 Docker cron containers
Some checks failed
CI / PHP 8.3 (push) Failing after 2m9s
CI / PHP 8.4 (push) Failing after 2m14s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:26:58 +00:00
Snider
0e038ff350 feat(webhook): add config + Boot — route registration, cron trigger config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:25:17 +00:00
Snider
a1de171871 feat(webhook): add WebhookController — store, verify, fire event, return 200
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:23:32 +00:00
Snider
39ede84d0e feat(webhook): add WebhookCall model, migration, event, verifier interface
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:21:20 +00:00
Snider
a0a0727c88 fix(actions): harden scheduled actions — security allowlists, trait verification, scan safety
- Add ALLOWED_NAMESPACES prefix allowlist to ScheduleServiceProvider
- Add ALLOWED_FREQUENCIES method allowlist (prevents arbitrary method dispatch)
- Verify Action trait on scheduled classes before dispatch
- Move try/catch inside foreach for per-action isolation
- Add empty-scan guard to ScheduleSyncCommand (prevents disabling all rows)
- Consolidate ScheduledActionScanner to single tokenisation pass
- Cast numeric frequency args via ctype_digit() in ScheduledAction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:56:14 +00:00
Snider
3c4011bdcb test(actions): add integration tests for scheduled actions flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:43:51 +00:00
Snider
633fbeb559 feat(actions): add ScheduleServiceProvider — wires DB-backed actions into scheduler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:42:59 +00:00
Snider
d1598882bb feat(actions): add schedule:sync command — persists #[Scheduled] to database
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:41:17 +00:00
Snider
9ffb756969 feat(actions): add ScheduledActionScanner — discovers #[Scheduled] classes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:25:31 +00:00
Snider
ace48d57c2 feat(actions): add ScheduledAction model and migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:24:20 +00:00
Snider
8d0b2b64ec feat(actions): add #[Scheduled] attribute for Action classes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:23:33 +00:00
Snider
cb6d206c76 chore: add .worktrees/ to .gitignore 2026-03-12 12:21:31 +00:00
Snider
755c6b7134 docs: add human-friendly documentation
Some checks failed
CI / PHP 8.3 (push) Failing after 2m16s
CI / PHP 8.4 (push) Failing after 2m3s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:02:41 +00:00
Snider
7d7c489509 fix: add unsafe-eval to production CSP — Livewire uses eval()
Some checks failed
CI / PHP 8.3 (push) Failing after 1m52s
CI / PHP 8.4 (push) Failing after 1m58s
Alpine.js evaluates expressions via eval() at runtime.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-10 05:32:46 +00:00
Snider
87ae36ef22 fix: remove host_analytics from framework CSP config
Some checks failed
CI / PHP 8.3 (push) Failing after 1m53s
CI / PHP 8.4 (push) Failing after 1m49s
Website-specific CSP sources belong in app config, not framework.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-10 05:28:01 +00:00
Snider
95cd788bc9 fix: CSP defaults for Livewire — disable nonces, allow unsafe-inline
Some checks failed
CI / PHP 8.4 (push) Failing after 1m55s
CI / PHP 8.3 (push) Failing after 2m6s
Livewire and Alpine inject inline scripts/styles at runtime without
nonce attributes. Nonce-based CSP breaks all Livewire apps out of the
box. Change defaults:
- nonce_enabled: false (opt-in via SECURITY_CSP_NONCE_ENABLED=true)
- production env: add 'unsafe-inline' for script-src and style-src
- Add host_analytics external source (SECURITY_CSP_HOST_ANALYTICS)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-10 05:25:57 +00:00
Snider
affedb3d46 refactor: extract Service + Client to standalone packages
Some checks failed
CI / PHP 8.4 (push) Failing after 1m51s
CI / PHP 8.3 (push) Failing after 1m59s
Core\Service → core/php-service (lthn/service)
Core\Website\Service → core/php-service (lthn/service)
Core\Front\Client → core/php-client (lthn/client)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:56:43 +00:00
Snider
dc064cbb61 feat: promote PHP commands to root in core-php binary
Some checks failed
CI / PHP 8.4 (push) Failing after 1m51s
CI / PHP 8.3 (push) Failing after 1m58s
AddPHPRootCommands registers commands directly on root so
the standalone binary uses `core-php dev` not `core-php php dev`.
AddPHPCommands remains for use inside the `core` CLI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:47:55 +00:00
Snider
4b24a6d186 feat: add claude plugin for PHP/Laravel development
Some checks failed
CI / PHP 8.4 (push) Failing after 1m51s
CI / PHP 8.3 (push) Failing after 2m4s
Skills: php, php-agent, laravel
API: route generation (TS/JS/OpenAPI from Laravel routes)
Hooks: auto-format PHP with Pint, debug statement warnings
2026-03-09 18:15:42 +00:00
Snider
8baf48d4fc docs: update README badges and install command to lthn/php
Some checks failed
CI / PHP 8.3 (push) Failing after 1m56s
CI / PHP 8.4 (push) Failing after 2m0s
2026-03-09 18:00:12 +00:00
Snider
4b2b5d6350 feat: rename package to lthn/php for Packagist distribution
Some checks failed
CI / PHP 8.4 (push) Failing after 1m57s
CI / PHP 8.3 (push) Failing after 2m0s
- composer.json name: core/php → lthn/php
- replace directive keeps backward compat with core/php consumers
- .gitattributes excludes Go code, Docker, tests, build files from dist

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 17:56:14 +00:00
Snider
25df6996e6 feat(plug): add contract interfaces and Registry::register() method
Some checks failed
CI / PHP 8.3 (push) Failing after 1m55s
CI / PHP 8.4 (push) Failing after 1m55s
Move 8 plug contract interfaces (Authenticable, Commentable, Deletable,
Listable, MediaUploadable, Postable, Readable, Refreshable) from the
Laravel app into the framework under Core\Plug\Contract namespace. Add
register() method to Registry so extracted packages can self-register
their providers without filesystem scanning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:25:40 +00:00
Snider
a9c1afe492 refactor(php): remove QA CLI commands — moved to core/lint
Some checks failed
CI / PHP 8.3 (push) Failing after 1m55s
CI / PHP 8.4 (push) Failing after 1m55s
QA subcommands (fmt, stan, psalm, audit, security, rector, infection,
test, qa) now live in core/lint cmd/qa/. Library code (quality.go,
testing.go) retained for cmd_ci.go.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:27:08 +00:00
Snider
ad8af2fb83 feat: merge go-php Go CLI into core/php
Some checks failed
CI / PHP 8.4 (push) Failing after 2m5s
CI / PHP 8.3 (push) Failing after 2m10s
Merge all Go code from core/go-php into core/php, creating a dual-language
repo (Go CLI + PHP framework). Module path: forge.lthn.ai/core/php.

- PHP dev/build/deploy/QA commands (cmd_*.go)
- FrankenPHP handler + bridge (handler.go, bridge.go)
- Standalone binary entry point (cmd/core-php/)
- Build/release configs (.core/)
- Full test suite

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 17:50:01 +00:00
Snider
28d004ff61 feat: replace Go CLI with PHP framework
Some checks failed
CI / PHP 8.4 (push) Failing after 1m54s
CI / PHP 8.3 (push) Failing after 1m58s
Go CLI commands moved to core/go-php. This repo now contains
the Laravel modular monolith framework (previously php-framework).

- Remove all Go files (now in core/go-php)
- Add PHP framework: event-driven module loading, lifecycle events
- Composer package: core/php
- core/php-framework remains as-is for backward compat

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 08:49:51 +00:00
Claude
81fbbac1f6
feat(ci): use lthn/build:php container image
Replace setup-php action with pre-built lthn/build:php-* container
images. Eliminates ~50s PHP setup overhead per matrix job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:45:43 +00:00
Claude
b2692e27fe
fix: clone path dependencies using runner token on CI
Use GITHUB_TOKEN to clone sister packages (host-uk/core, etc.) that are
referenced as path repositories in composer.json. These packages aren't
on Packagist so CI needs to clone them alongside the main repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 04:56:56 +00:00
Claude
d231c72661
fix: make reusable workflow resilient to missing test runners
Detect whether pest, phpunit, or pint are installed before running them.
Repos without test runners will skip gracefully instead of failing with
"No such file or directory".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 04:55:04 +00:00
Claude
9604b08d61
ci: add reusable PHP test workflow for Forgejo Actions
Callable from any core/php-* repo:
  uses: core/php/.forgejo/workflows/php-test.yml@main

Inputs: php-version (JSON array), extensions, coverage, pint.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-23 01:20:35 +00:00
Claude
6cb5957ca6
feat: extract PHP/Laravel commands from core/cli
Port all PHP command files from core/cli internal/cmd/php/ into a
standalone module. Inlines workspace dependency to avoid cross-module
internal imports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:40:59 +00:00