Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
# Must exceed ReplyOnMattermost / KitAgent timeout (200) so a 170s BlenderRun is not re-dispatched.
DB_QUEUE_RETRY_AFTER=240

CACHE_STORE=database
# CACHE_PREFIX=
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

# Convention-only on GitHub Free — this repo cannot require checks.
# No Blender. No Playwright. Factory hands stay on Loki.

on:
pull_request:
push:
branches: [main]

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: sqlite3
coverage: none

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
restore-keys: composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Create bootstrap and storage dirs
run: mkdir -p bootstrap/cache storage/framework/{cache,sessions,testing,views} storage/logs

- name: Run tests
run: php artisan test --no-coverage
env:
APP_ENV: testing
APP_KEY: base64:NKGyM6eANyqn2+iiyggbXf6FNzgU98n3L/Sw1ze3v4U=
DB_CONNECTION: sqlite
DB_DATABASE: ':memory:'
QUEUE_CONNECTION: sync
CACHE_STORE: array
LOG_CHANNEL: 'null'

pint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
restore-keys: composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Check code style
run: ./vendor/bin/pint --test
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Loki-native factory agent. Sibling to Lexi, not a citizen in her process.
- Catalog ids only. Never invent a gameplay GLB URL.
- Files under ~300 lines.

Ship gate: `php artisan test`.
Ship gate: `php artisan test` + `vendor/bin/pint --test`. GitHub Actions (PHP 8.4) runs both. Required checks are convention-only on GitHub Free. No Blender / Playwright in CI.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,14 @@ php artisan serve --host=0.0.0.0 --port=8788
```

Needs an xAI or OpenRouter key in `.env` before `kit:ask` talks. Tools and prompt dump work without one.

## Ship gate

```bash
php artisan test
vendor/bin/pint --test
```

GitHub Actions (`.github/workflows/ci.yml`) runs the same pair on PHP 8.4. No Blender, no Playwright — factory hands stay on Loki. Required-status merge-block is convention-only on GitHub Free.

Queue knobs: `DB_QUEUE_RETRY_AFTER=240` (default in `config/queue.php`). Job / `KitAgent` / `kit-queue.service` timeout is **200s** so a 170s `BlenderRun` is not killed or re-dispatched.
2 changes: 1 addition & 1 deletion app/Agent/KitAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Laravel\Ai\Attributes\Timeout;
use Stringable;

#[Timeout(180)]
#[Timeout(200)]
class KitAgent extends BaseAgent
{
public function __construct(private readonly PromptBuilder $prompts) {}
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/ReplyOnMattermost.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ReplyOnMattermost implements ShouldQueue
{
use Queueable;

public int $timeout = 180;
public int $timeout = 200;

public int $tries = 2;

Expand Down
1 change: 1 addition & 0 deletions app/Tools/YouTubeTranscript.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private function vttToText(string $vtt): string
$line = trim($line);
if (preg_match('/^(\d{2}:\d{2}:\d{2})\.\d+\s+-->/', $line, $m)) {
$time = $m[1];

continue;
}
if ($line === '' || str_starts_with($line, 'WEBVTT') || str_starts_with($line, 'NOTE') || preg_match('/^\d+$/', $line)) {
Expand Down
2 changes: 1 addition & 1 deletion config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 240),
'after_commit' => false,
],

Expand Down
5 changes: 5 additions & 0 deletions tests/Feature/QueueTimeoutTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

test('database queue retry_after exceeds the 200s job timeout', function () {
expect((int) config('queue.connections.database.retry_after'))->toBeGreaterThanOrEqual(240);
});
Empty file added tests/Unit/.gitkeep
Empty file.
Loading