diff --git a/.paul/PROJECT.md b/.paul/PROJECT.md
index 4cf360e..7be949e 100644
--- a/.paul/PROJECT.md
+++ b/.paul/PROJECT.md
@@ -60,6 +60,7 @@ PHP (XAMPP/Laravel), integracje z API marketplace'ów (Allegro, Erli) oraz API p
- Metody pomocnicze string/date/color → `App\Core\Support\StringHelper` (nie powielać w klasach)
- Zarządzanie tokenami OAuth Allegro → `App\Modules\Settings\AllegroTokenManager`
- Kompozycja obiektów crona → `App\Modules\Cron\CronHandlerFactory` (jedyne miejsce `new AllegroIntegrationRepository` i in. w kontekście crona)
+- Pole CSRF w formularzach HTTP: zawsze `_token` (nie `_csrf_token`)
### Business Constraints
- [Do zdefiniowania podczas planowania]
@@ -72,6 +73,7 @@ PHP (XAMPP/Laravel), integracje z API marketplace'ów (Allegro, Erli) oraz API p
| AllegroTokenManager wydzielony z 4 klas OAuth | Eliminacja duplikacji logiki odświeżania tokenów | 2026-03-12 | Active |
| StringHelper jako final static class w Core/Support | Centralizacja 19 kopii helperów string/date/color z 15+ klas | 2026-03-12 | Active |
| CronHandlerFactory jako jedyne miejsce kompozycji crona | Application.php i bin/cron.php były rozsynchronizowane — 2 bugi w bin/cron.php | 2026-03-13 | Active |
+| Pole CSRF w formularzach: `_token` (nie `_csrf_token`) | Standardyzacja na nazwę używaną przez większość kodu (10+ kontrolerów); eliminacja ryzyka pomyłki przy nowych formularzach | 2026-03-13 | Active |
## Success Metrics
@@ -102,4 +104,4 @@ Quick Reference:
---
*PROJECT.md — Updated when requirements or context change*
-*Last updated: 2026-03-13 after Phase 2 (Bug Fixes)*
+*Last updated: 2026-03-13 after Phase 3 (Tech Debt 2 — CSRF standardization)*
diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md
index 4fc1a21..13b9b13 100644
--- a/.paul/ROADMAP.md
+++ b/.paul/ROADMAP.md
@@ -8,7 +8,7 @@ orderPRO to narzędzie do wielokanałowego zarządzania sprzedażą. Projekt prz
**v0.1 Initial Release** (v0.1.0)
Status: In progress
-Phases: 2 complete, next TBD
+Phases: 3 complete, next TBD
## Phases
@@ -16,6 +16,7 @@ Phases: 2 complete, next TBD
|-------|------|-------|--------|-----------|
| 1 | Tech Debt | 2/2 | ✅ Complete | 2026-03-12 |
| 2 | Bug Fixes | 4/4 | ✅ Complete | 2026-03-13 |
+| 3 | Tech Debt 2 | 1/1 | ✅ Complete | 2026-03-13 |
## Phase Details
@@ -33,6 +34,11 @@ Naprawa zidentyfikowanych błędów z `.paul/codebase/CONCERNS.md`.
- **Plan 02-03** — `ShopproOrdersSyncService` używa `AllegroOrderSyncStateRepository` (błędna zależność) — *Complete*
- **Plan 02-04** — `Application.php` ręcznie buduje graf obiektów crona (duplikacja, rozbieżność z bin/cron.php) — *Complete*
+### Phase 3 — Tech Debt 2
+Ustandaryzowanie niespójności technicznych zidentyfikowanych w `.paul/codebase/CONCERNS.md`.
+
+- **Plan 03-01** — CSRF Token Field Name Inconsistency — `_csrf_token` → `_token` w OrdersController, ShipmentController i ich widokach — *Complete*
+
---
*Roadmap created: 2026-03-12*
*Last updated: 2026-03-13*
diff --git a/.paul/STATE.md b/.paul/STATE.md
index 1523967..36b2ad2 100644
--- a/.paul/STATE.md
+++ b/.paul/STATE.md
@@ -5,28 +5,29 @@
See: .paul/PROJECT.md (updated 2026-03-12)
**Core value:** Sprzedawca może obsługiwać zamówienia ze wszystkich kanałów sprzedaży i nadawać przesyłki bez przełączania się między platformami.
-**Current focus:** Faza 02 — Bug Fixes COMPLETE (4/4). Gotowe do planowania fazy 03.
+**Current focus:** Faza 03 — Tech Debt 2 COMPLETE (1/1). Gotowe do planowania fazy 04.
## Current Position
Milestone: v0.1 Initial Release
-Phase: 3 of TBD (next phase TBD) — Not started
+Phase: 4 of TBD (next phase TBD) — Not started
Plan: Not started
-Status: Ready to plan Phase 3
-Last activity: 2026-03-13 — Phase 02 complete, transitioned to Phase 3
+Status: Ready to plan Phase 4
+Last activity: 2026-03-13 — Phase 03 complete, transitioned to Phase 4
Progress:
-- Milestone: [████░░░░░░] ~40%
+- Milestone: [█████░░░░░] ~50%
- Phase 1: [██████████] 100%
- Phase 2: [██████████] 100% (4/4 plans complete)
-- Phase 3: [░░░░░░░░░░] 0% (not started)
+- Phase 3: [██████████] 100% (1/1 plans complete)
+- Phase 4: [░░░░░░░░░░] 0% (not started)
## Loop Position
Current loop state:
```
PLAN ──▶ APPLY ──▶ UNIFY
- ✓ ✓ ✓ [Phase 02 complete — ready for Phase 3 PLAN]
+ ✓ ✓ ✓ [Phase 03 complete — ready for Phase 4 PLAN]
```
## Accumulated Context
@@ -37,6 +38,12 @@ PLAN ──▶ APPLY ──▶ UNIFY
| 2026-03-12 | AllegroTokenManager wydzielony z 4 klas OAuth | Faza 01 | Centralizacja logiki tokenów, brak duplikacji |
| 2026-03-12 | StringHelper jako final static class w Core/Support | Faza 01 | 19 duplikatów helperów usunięte z 15 klas |
| 2026-03-13 | CronHandlerFactory jako jedyne miejsce kompozycji crona | Faza 02 | Application.php i bin/cron.php zsynchronizowane; 2 bugi naprawione |
+| 2026-03-13 | Pole CSRF w formularzach: `_token` (nie `_csrf_token`) | Faza 03 | Ustandaryzowane w OrdersController, ShipmentController i 2 widokach |
+
+### Skill Audit (Faza 03, Plan 01)
+| Oczekiwany | Wywołany | Uwagi |
+|------------|---------|-------|
+| sonar-scanner | ○ | Pominięto — przejście do UNIFY bez skanowania; uruchomić przy kolejnym planie |
### Skill Audit (Faza 02, Plan 01)
| Oczekiwany | Wywołany | Uwagi |
@@ -56,10 +63,9 @@ PLAN ──▶ APPLY ──▶ UNIFY
- **code-review** — wywołać /code-review przed kolejnym UNIFY (pominięto w obydwu planach fazy 01).
### Git State
-Last commit: 87203c4 (pre-phase-02 commit)
+Last commit: 880ab59
Branch: main
Feature branches merged: none
-Uncommitted: Phase 02 changes (pending commit)
### Blockers/Concerns
Brak.
@@ -67,8 +73,8 @@ Brak.
## Session Continuity
Last session: 2026-03-13
-Stopped at: Phase 02 complete, transition done
-Next action: /paul:plan dla Phase 3
+Stopped at: Phase 03 complete, transition done
+Next action: /paul:plan dla Phase 4
Resume file: .paul/ROADMAP.md
---
diff --git a/.paul/codebase/CONCERNS.md b/.paul/codebase/CONCERNS.md
index 0867221..43ed8fa 100644
--- a/.paul/codebase/CONCERNS.md
+++ b/.paul/codebase/CONCERNS.md
@@ -6,35 +6,6 @@
## Tech Debt
-
-### ~~[HIGH] `ShopproOrdersSyncService` Uses `AllegroOrderSyncStateRepository`~~ ✅ Fixed (Plan 02-03, 2026-03-13)
-
-- Fix: Wydzielono `ShopproOrderSyncStateRepository`. `ShopproOrdersSyncService` wstrzykuje właściwą zależność. `Application.php` zaktualizowany.
-- Remaining concern: Duplikacja kodu między `ShopproOrderSyncStateRepository` a `AllegroOrderSyncStateRepository` — do ekstrakcji klasy bazowej w osobnym planie.
-
----
-
-### [MEDIUM] `Application.php` Manually Instantiates Full Object Graph for Web Cron
-
-- Issue: `Application::maybeRunCronOnWeb()` (lines 271–354) contains 80+ lines of manual `new X($this->db)` construction for every cron handler. This duplicates the wiring already in `routes/web.php` and is vulnerable to getting out of sync.
-- File: `src/Core/Application.php`
-- Impact: Adding a new cron handler requires edits in two places. Already shows signs of drift vs. `routes/web.php`.
-- Fix approach: Extract a `CronHandlerFactory` or move cron wiring into `routes/web.php` so both web and CLI cron share the same configuration.
-
----
-
-### [MEDIUM] CSRF Token Field Name Inconsistency
-
-- Issue: Two distinct CSRF field names are used across the application: `_token` (most controllers) and `_csrf_token` (orders and shipment controllers).
-- Files:
- - `src/Modules/Orders/OrdersController.php` — reads `_csrf_token`
- - `src/Modules/Shipments/ShipmentController.php` — reads `_csrf_token`
- - All settings controllers and `AuthController` — read `_token`
-- Impact: Confusion during future form additions. Risk of accidentally using the wrong field name and breaking CSRF protection silently.
-- Fix approach: Standardize on one name (recommend `_token` to match the majority) and update the two outlier controllers and their views.
-
----
-
### [MEDIUM] 5 "ensure_*" Migrations Indicate Schema Drift
- Issue: Five migrations with `ensure_` prefix were added to defensively re-create or re-add objects that should have existed from earlier migrations. This is a signal that schema was edited or deployed inconsistently.
@@ -274,13 +245,6 @@ The following items from `DOCS/todo.md` are marked incomplete:
## Known Bugs
-### ~~[MEDIUM] `AllegroStatusSyncService::findOrdersNeedingStatusSync()` — No Time-Based Cursor~~ ✅ Fixed (Plan 02-02, 2026-03-13)
-
-- Fix: Dodano kolumnę `orders.last_status_checked_at DATETIME NULL`. Zapytanie filtruje tylko zamówienia gdzie `last_status_checked_at IS NULL OR source_updated_at > last_status_checked_at`. `markOrderStatusChecked()` zapisuje timestamp po sukcesie importu.
-- Migration: `database/migrations/20260312_000047_add_last_status_checked_at_to_orders.sql`
-
----
-
## Test Coverage Gaps
### [HIGH] No Integration or Functional Tests Exist
diff --git a/.paul/phases/03-tech-debt/03-01-PLAN.md b/.paul/phases/03-tech-debt/03-01-PLAN.md
new file mode 100644
index 0000000..03273a6
--- /dev/null
+++ b/.paul/phases/03-tech-debt/03-01-PLAN.md
@@ -0,0 +1,158 @@
+---
+phase: 03-tech-debt
+plan: 01
+type: execute
+wave: 1
+depends_on: []
+files_modified:
+ - src/Modules/Orders/OrdersController.php
+ - src/Modules/Shipments/ShipmentController.php
+ - resources/views/orders/show.php
+ - resources/views/shipments/prepare.php
+autonomous: true
+---
+
+