feat(06-task-title-ai): complete OpenAI task title suggestions

Phase 6 complete:

- add AI title generator service using gpt-5-nano

- add task popup button for biuro@project-pro.pl

- add AJAX endpoint returning title suggestions without auto-save
This commit is contained in:
Codex
2026-05-04 23:45:54 +02:00
parent 254cf70d35
commit 3b1ba1b5ed
10 changed files with 692 additions and 12 deletions

View File

@@ -9,14 +9,14 @@ See: .paul/PROJECT.md (updated 2026-05-04)
## Current Position
Milestone: v0.1 Stabilizacja i jakosc kodu
Phase: 2 of 5 (Naprawa bledow krytycznych) - Ready to plan
Milestone: v0.1 Stabilizacja i jakosc kodu + import finansow
Phase: 2 of 6 (Naprawa bledow krytycznych) - Ready to plan
Plan: Not started
Status: Phase 5 complete, ready for next PLAN
Last activity: 2026-05-04 22:54 - Phase 5 complete; 05-06 UNIFY closed
Status: Phase 6 complete, ready for next PLAN
Last activity: 2026-05-04 23:45 - Phase 6 complete; 06-01 UNIFY closed
Progress:
- Milestone: [####------] 40% (2 of 5 phases complete: Phase 1 and Phase 5)
- Milestone: [#####-----] 50% (3 of 6 phases complete: Phase 1, Phase 5 and Phase 6)
- Phase 2: [----------] 0%
## Loop Position
@@ -30,6 +30,11 @@ PLAN --> APPLY --> UNIFY
## Accumulated Context
### Recent Decisions
- Phase 6: AI title generation is visible only for logged-in `biuro@project-pro.pl`.
- Phase 6: Generated title is inserted into the inline title input only; existing save action persists it.
- Phase 6: Use `gpt-5-nano` as the cheap/fast OpenAI model for task title suggestions.
- Phase 6: GPT-5 title generation uses `reasoning_effort = minimal` and higher `max_completion_tokens` to avoid empty content.
- Phase 6: Prompt requires short bezosobowy noun-style titles, e.g. `Usuniecie bloku o firmie`.
- Phase 5: Fakturownia client mappings use tax-based keys with legacy id fallback.
- Phase 5: Proforma documents are skipped by kind and FP prefix.
- Phase 5: Selected invoice positions can be skipped without creating finance operations.
@@ -38,16 +43,17 @@ PLAN --> APPLY --> UNIFY
### Concerns
- Existing Fakturownia operations identify item mapping from operation description plus mapping fallback. Future importer work should store explicit operation_id -> item_key metadata.
- OpenAI API key remains configured directly in `config.php`; this was pre-existing and should be considered for future secret management cleanup.
### Git State
Last commit: 7acf22c
Last commit: pending phase transition commit
Branch: main
Feature branches merged: none
## Session Continuity
Last session: 2026-05-04
Stopped at: Phase 5 complete, ready to plan Phase 2
Stopped at: Phase 6 complete, ready to plan Phase 2
Next action: $paul-plan for Phase 2
Resume file: .paul/ROADMAP.md