FK on attribute_values.attribute_definition_id now uses ON DELETE CASCADE
so deleting an AttributeDefinition also clears its values from all
articles. Admin delete action shows a confirmation warning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When Tavily search results reveal that the OCR'd model number has a
character error, the specs_research prompt asks the LLM to output a
CORRECTED_MODEL_NUMBER line. The agent parses it out, stores it in the
job output, and DraftArticleHandler applies it to the article in
preference to the raw vision value.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Model numbers from OCR often have character errors (G→6, O→0 etc).
Using both fields together lets the human-readable name anchor the
search even when the model number is slightly wrong.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures the current working vision prompt (MODEL_NAME/MODEL_NUMBER
split) as a versioned migration so fresh installs get the correct prompt
without manual intervention.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove all hardcoded defaults from PromptTemplateService — the DB record
is now mandatory and render() throws if a key is missing. Admin UI
disables new/delete and makes the key field read-only so system prompts
cannot be renamed or removed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parser now strips any embedded field labels (e.g. "SERIAL: x") that the
LLM mistakenly appends to a field value. Prompt updated with a concrete
example showing MODEL_NUMBER as blank to reinforce leaving it empty when
no separate part code is visible.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without a model name/number specs research is pointless. Stays at
needs_review so the user can enter the model manually, then re-run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Splitting MODEL into MODEL_NAME and MODEL_NUMBER confused the vision
model into returning empty for both. Now MODEL_NAME accepts any visible
model identifier; MODEL_NUMBER is only filled when a separate part/
product code is explicitly shown on the label.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously blocked on needs_review when model name/number were empty,
even if manufacturer or serial were detected. Now proceeds to specs
research whenever any useful field was extracted, only blocking when the
nameplate was completely unreadable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Vision prompt now distinguishes MODEL_NAME (human-readable product name,
e.g. "ThinkPad T490s") from MODEL_NUMBER (part/product code, e.g.
"20NXS0BA00"). Both fields flow through the pipeline and are written to
the article. Specs research uses model number as search subject when
available, falling back to model name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds model_name VARCHAR(255) column to app.articles, exposes it in the
admin CRUD form (optional, hidden on index), and adds translations for
both EN and DE.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DraftArticleHandler was calling markCompleted() before dispatching
EbayTextMessage, causing the SSE to fire "completed" while the article
title was still null. EbayTextHandler had no job tracking at all.
- DraftArticleHandler: recordStep('draft_article') instead of markCompleted()
- EbayTextHandler: call markCompleted() after setEbayTexts() so the job
is only marked done once the title and description are actually written
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use <label for="..."> with form.image.vars.id instead of .click() on
hidden input — display:none blocks programmatic click in some browsers
- Add drag-and-drop to the search photo drop zone (dragover/drop)
- Make extra photos input opacity:0/absolute so label trigger works too
- Camera fallback references correct searchInput variable via closure
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Ingest page redesigned: camera modal (getUserMedia + capture fallback
for mobile), mandatory search photo with client-side validation,
optional extra photos grid with per-photo remove button
- Camera modal: live video preview, capture → preview → confirm/retake
flow; stops stream on modal close; falls back to native file picker
if getUserMedia is unavailable
- ManualIngestController: uploads extra photos via PhotoService::uploadRaw(),
stores [{storagePathId, filename}] in job inputData as extraPhotos
- PhotoService::attachExtra(): attach already-stored file to an article
by StoragePath ID + filename
- DraftArticleHandler: after creating the article, attaches extra photos
in sort order; errors are best-effort (pipeline not aborted)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add secured GET /admin/photos/{filename} to serve files from var/uploads/
- Add POST /api/articles/{id}/photos/sort for drag-and-drop reordering
- Add PhotoService::reorder() to persist new sort positions
- Add photo gallery field (onlyOnDetail) using custom Twig template:
- Drag-and-drop reorder via SortableJS CDN
- Click or drop to upload new photos
- Set main (★) and delete per photo
- Main photo highlighted with blue border + badge
- Add field.photos translation key (EN/DE)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SSE connections hold a worker for up to 90 s each; the default of 5
children meant the admin UI became unresponsive under normal use.
Mount zzz-pool.conf (loaded after zz-docker.conf) to override only the
pm.* settings without touching daemonize/listen.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add WebSearchInterface + TavilyWebSearch (POST /search, max 5 results)
- SpecsResearchAgent now fetches search results first, injects them as
{{searchResults}} context into the prompt, then calls plain generate()
— no dependency on model-specific web_search tool support
- Update specs_research prompt template (PHP default + DB migration) to
use the new {{searchResults}} variable
- Wire TAVILY_API_KEY env var; register TavilyWebSearch in services.yaml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mistral-large-latest may not support the web_search tool type on all API
tiers; catch the exception and retry without web search so the pipeline
does not crash with needs_review.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add hasActiveJobForArticle() to check for queued/processing jobs.
The displayIf closure hides the action while a job is running.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Translation entity (locale/domain/key/value, unique on all three)
- Add TranslationRepositoryInterface + DoctrineTranslationRepository
- Add DatabaseTranslator decorator (#[AsDecorator]) that checks DB first
and falls back to YAML files; clears per-request cache on setLocale()
- Add TranslationCrudController with locale/domain filters and read-only
key/locale/domain on edit to prevent accidental renames
- Add "Übersetzungen / Translations" menu entry in DashboardController
- Migration 20260520000000: create app.translations table
- Migration 20260520010000: seed from admin.en.yaml + admin.de.yaml (204 rows)
- Flatten admin.de.yaml to dot-notation; add new keys for translation CRUD
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add LocaleSubscriber: detects browser language, honours session override (priority 20)
- Add LocaleSwitchController: stores locale in session, linked from user menu
- Add admin.en.yaml / admin.de.yaml translation files (95 keys each)
- Wire translation fallback to EN in config/packages/translation.yaml
- Replace all hard-coded strings in CRUD controllers with TranslatableMessage
- Inject TranslatorInterface into DashboardController, ArticleCrudController,
AIPipelineJobCrudController and PipelineStreamController; add locale switcher
links (English / Deutsch) to the user menu
- Add confirmation dialog to "Re-run AI" and "Retry" pipeline actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds real-time toast notifications to all admin pages for AI pipeline
job progress. The browser subscribes to an SSE endpoint
(GET /admin/pipeline/events) which polls the DB every 2 seconds and
emits events whenever a job's step or status changes.
- AIPipelineJob gains updatedAt (migration 20260519020000), bumped on
every state-change method, with an index for efficient polling
- AIPipelineJobRepositoryInterface/Doctrine get findUpdatedSince()
- PipelineStreamController streams SSE with per-connection dedup and
auto-reconnect (retry: 3000); streams for 90 s then signals reconnect
- pipeline-notifications.js handles EventSource, shows colour-coded
toasts (queued/processing/completed/failed/needs_review) and is loaded
globally via DashboardController::configureAssets()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The agent was calling generate() — pure model memory — which caused Mistral
to hallucinate specs for older devices (e.g. i5-1135G7 instead of i3-3120M).
generateWithWebSearch() is now used so Mistral queries live sources.
OllamaClientInterface gains generateWithWebSearch(); OllamaClient falls back
to generate() since Ollama has no built-in search tool.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inserts the five built-in prompts (specs_research, ebay_title,
ebay_description, vision_analyze, json_coding) so they appear in the
admin editor immediately. The service still falls back to hardcoded
defaults if a row is deleted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
opcache.validate_timestamps=0 caused stale bytecode after code changes —
containers needed a full restart to pick up edits. For dev, OPcache is now
disabled entirely. php.ini is mounted as a volume in all app services so
config changes take effect with a simple `docker compose up -d`, no rebuild.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All agent prompts are now stored in app.prompt_templates (migration 20260519000000)
and editable by admins via the new AI Prompts CRUD page. If no DB entry exists
for a key the hardcoded default is used automatically as fallback.
PromptTemplateService renders templates with {{variable}} substitution.
All four agents (SpecsResearch, JsonCoding, EbayText, OllamaVision) use the service.
SpecsResearchAgent now receives the articleType name (e.g. "Laptop") so the
specs prompt is scoped to the correct device category instead of being generic.
SpecsResearchHandler loads the ArticleType from the repository for this purpose.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AI_TEXT_MODEL and AI_VISION_MODEL now point to the Mistral vars by default.
SERP_API_KEY removed. All docker-compose services load .env.local as an
optional overlay so local credentials don't have to go into .env.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MistralClient gains generateWithWebSearch() which uses Mistral's built-in
web_search tool, handling the multi-turn tool-call loop server-side.
SerpApiWebSearch and WebSearchInterface are removed — no longer needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ManualIngestController: photo upload form that starts a new pipeline job
- AiStatusController: shows active backend config and runs live connectivity tests
- PipelineArchiveCrudController: read-only view of completed/failed jobs
- ManualIngestType / AttributeValueFormType: form types for ingest and attribute editing
- AiConfigService: encapsulates backend info and test methods for the status page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Retry button on index and detail pages for failed/needs-review/processing jobs
- Shows inventory number, current step, attempt count, created-at on index
- Detail page renders full AI step output (vision, specs, attributes)
- Filters active jobs by non-completed status via custom query builder
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- currentStep column (migration 20260517230000) written per pipeline stage
- recordStep() stores per-step output data and updates currentStep
- resetForRetry() requeues a failed/needs-review job
- getInventoryNumber() / getStatusLabel() helpers for admin display
- markCompleted() now merges rather than replacing outputData
- findByArticleId() added to repository for re-run lookups
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Article entity gets manufacturer and modelNumber columns (migration 20260517240000)
- Vision output (manufacturer/model) is written to the article in DraftArticleHandler
- manufacturer is forwarded through SpecsResearchMessage so the specs prompt can use it
- serialNumber is now threaded through JsonCodingMessage and ValidationMessage
- EbayTextHandler pulls specsText from the job's stored output data
- DraftArticleHandler supports re-run mode (existing article reuse) and sets Draft status
- ArticleType and AttributeValue get __toString() for form/display use
- ArticleService exposes reserveInventoryNumber() publicly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PHPUnit config (phpunit.dist.xml, bin/phpunit, bootstrap.php), PHP CS
Fixer config, .editorconfig. Separate .env.dev/.env.test templates.
Ollama tunnel setup script. Architecture and plan docs. Updated
application-layer unit tests to match current service signatures.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Console commands: CreateUser (interactive), BackupCommand, RotateLogsCommand.
Migrations 20260514: initial schema for app/logs schemas.
Config: register new bundles, Doctrine schema filter, Kernel micro-kernel
adjustments, deleted unused api.yaml route file and www.conf override.
Application service and API controller updates for the full article lifecycle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CRUD controllers for Article, ArticleType, AttributeDefinition,
ArticleTypeAttribute, AIPipelineJob, Order, Customer, Invoice, User
and LogEntry. SecurityController handles login/logout; TotpSetupController
manages 2FA enrollment. API controllers for pipeline and orders.
Admin dashboard template and Twig base layout included.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ApiKeyAuthenticator, PermissionVoter and UserProvider implement
Symfony Security for the API (Bearer token) and admin (session) flows.
Domain repository interfaces added for ApiKey, User, AIPipelineJob and
Invoice; Doctrine implementations provided.
Also adds DatabaseLogHandler for structured DB logging, SerpApiWebSearch,
and the LogEntry domain entity.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eBay adapter covers OAuth, inventory API, fulfillment API, taxonomy
service and webhook signature verification. Frappe ERP adapter wraps
the Frappe HTTP client for order/invoice sync.
Includes CustomerResolver, InvoiceMailer, and the EbayWebhookController
for inbound eBay marketplace notifications.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Messages and handlers for the full AI pipeline:
DraftArticle → Validation → SpecsResearch → PhotoUpload → EbayText →
JsonCoding → PublishToChannel / DeactivateListingMessage / TrackingPush /
UpdateStockOnChannels / OrderReceived.
OllamaClient and OllamaClientInterface provide the base LLM backend.
AI agents (EbayTextAgent, JsonCodingAgent, OllamaVisionAgent,
SpecsResearchAgent) wrap the client with task-specific prompts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Promote article_type_attributes join table to ArticleTypeAttribute entity
with a required boolean flag. ArticleType gains virtual form properties
(requiredAttributeDefs / optionalAttributeDefs) reconciled via
applyAttributeAssignments() on persist/update.
Admin form shows two Tom Select multi-selects; a small JS module
(article-type-attr-sync.js) listens for ea.autocomplete.connect events
and keeps the two lists mutually exclusive in real time.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Symfony FormLoginAuthenticator expects _username by default.
The field used name="email" which caused 400 Bad Request on submit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validates current password, enforces 8-char minimum, links from
EasyAdmin user menu. Also fixes route loader (attribute scan instead
of broken easyadmin.routes type).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unix socket volume was root-owned, FPM running as uid 1000 couldn't
create the socket. TCP app:9000 works without privilege changes and
has negligible performance difference in a local Docker network.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces TCP app:9000 with a shared Unix socket volume, adds domain
with automatic Let's Encrypt TLS, and exposes ports 80/443 on Caddy.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>