Commit Graph

1918 Commits

Author SHA1 Message Date
Дмитрий cbb70b3985 chore(imitation): remove DB password from tracked phpunit.xml (B4)
DB_USERNAME/DB_PASSWORD now come from the untracked local .env (dev creds postgres/liderra_dev_pass that already match liderra_testing on the same local Postgres). phpunit.xml keeps only the non-secret DB_DATABASE/DB_CONNECTION override. Verified: tests still connect (FakeDaDataClientTest 3/3 GREEN) without the env vars in phpunit.xml. .env.testing remains gitignored.
2026-06-04 05:21:39 +03:00
Дмитрий 5a80a93e06 docs(imitation): phase 1 runbook + results report
Manual UI walkthrough, imitation:seed usage, natural-cycle observation, report template, and the filled Phase 1 results: imitation suite 54/54 GREEN; findings (F1 seedPhoneRange fixed, F2/F3 plan-vs-resolver tag/unknown, money bcmath kopeck-clean, step-3 substitution, orphan-lead resting place); regression note (22 single-process failures are pre-existing pollution, confirmed green in isolation; imitation prod changes verified).
2026-06-04 05:20:22 +03:00
Дмитрий f3e214e22a feat(imitation): imitation:seed command to populate local portal
Self-contained app-namespace artisan command (NEVER on production) that funds local imitation clients on a shared B2 supplier, disables DaData (region from tag), rebuilds the routing snapshot, then injects synthetic leads through the real RouteSupplierLeadJob so deals/charges/notifications appear for hands-on UI review. The lead payload encodes the supplier unique_key as a domain so RouteSupplierLeadJob re-resolves the real supplier (parseProjectField then resolveOrStub). Test asserts exit 0 + new deals.
2026-06-04 05:09:29 +03:00
Дмитрий efee04b5d4 test(imitation): topologies + money + intake checks 2026-06-04 04:58:20 +03:00
Дмитрий 852be5eae0 test(imitation): X1 step-3 substitution + X3 source breakdown 2026-06-04 04:45:37 +03:00
Дмитрий aadfcafc96 test(imitation): scenarios G5/G6 special leads + dedup 2026-06-04 04:38:12 +03:00
Дмитрий c3ee3e77c6 test(imitation): scenario G3 orphan lead 2026-06-04 04:29:35 +03:00
Дмитрий cafc161b17 test(imitation): scenarios E1/E2/F freezes + limit 2026-06-04 04:25:00 +03:00
Дмитрий 0a0efe05bf test(imitation): scenario D delivery days 2026-06-04 04:19:30 +03:00
Дмитрий 631e3cc4f4 test(imitation): scenarios B/C region cascade 2026-06-04 04:14:57 +03:00
Дмитрий 8d724055eb fix(imitation): correct seedPhoneRange columns + import_id FK (F1)
ImitationTestCase::seedPhoneRange used non-existent columns (range_from/range_to/region_name) and omitted the required import_id FK, so every Россвязь-branch test that called it failed. Now seeds a phone_ranges_imports anchor row and inserts phone_ranges with the real columns (def_code/from_num/to_num/operator/region/subject_code/imported_at/import_id), mirroring the verified RossvyazPrefixLookup parsing. Found during Task 5.
2026-06-04 03:54:22 +03:00
Дмитрий 8df2bdaa35 test(imitation): scenario A weighted lottery + distribution stats 2026-06-03 20:21:22 +03:00
Дмитрий ad458bc535 test(imitation): region resolution cascade coverage 2026-06-03 20:08:49 +03:00
Дмитрий b7a2f66cb9 fix(migrations): clean migrate:fresh resilience (partition parent guard + delta idempotency)
Restores a working migrate:fresh without the reverted blanket catch-all. (1) MonthlyPartitionManager::ensureMonth skips a partitioned table whose parent does not exist yet (targeted pg_class relkind='p' guard) instead of crashing — the initial schema-load runs partitions:create-months before later delta-migrations create their own partitioned tables. (2) migration 0001 runs with $withinTransaction=false so the schema.sql DDL is committed before partitions:create-months opens its second pgsql_supplier connection. (3) re-applies the clean idempotency guards on add_balance_freeze (DROP POLICY IF EXISTS) and add_paused_at (column/index existence checks) since schema.sql already contains those objects. migrate:fresh now rebuilds liderra_testing cleanly; MonthlyPartitionManagerTest 15/15 incl. new resilience guard test.
2026-06-03 20:01:55 +03:00
Дмитрий a21554152d feat(imitation): test clients + single-project matrix seeder 2026-06-03 19:37:49 +03:00
Дмитрий ceb7637876 feat(imitation): snapshot forge + condition levers 2026-06-03 19:09:12 +03:00
Дмитрий 78c2e1bde3 revert(imitation): drop out-of-scope migration edits from 6f81d136 + dead webhook_log test
Reverts 6f81d136 production-migration edits (load_initial_schema withinTransaction=false + try/catch, idempotency guards) and coupled migrate:fresh guard tests to baseline; imitation suite uses DatabaseTransactions on a pre-migrated DB so the reverted migrate:fresh resilience is not needed for Phase 1. Also drops the orphaned ensureMonth webhook_log test (webhook_log removed from PARTITIONED_TABLES in 2026_05_24_140000_drop_legacy_webhook_artefacts).
2026-06-03 18:58:13 +03:00
Дмитрий 45e5454d0e fix(hooks): parse Pest JSON reporter in verify-record + escape dot in tdd-real-test regex
enforce-verify-record extractTestMetrics now recognises the project Pest JSON reporter ({"result":"passed/failed",...}); previously every Pest run was recorded as a failed sentinel, blocking all Pest-verified commits (mirrors enforce-tdd-gate fix 5dbd6dfe). enforce-tdd-real-test-verifier TEST_FILE_RE second dot escaped so .env.testing is no longer false-matched as a test file.
2026-06-03 18:51:02 +03:00
Дмитрий 6ec60891f7 docs(imitation): session handoff for phase 1 resume (worktree, state, 2 open decisions, subagent rules) 2026-06-03 16:57:18 +03:00
Дмитрий 6f81d13612 chore(imitation): Task 0.5 — test env, reference-seed base, migrate:fresh resilience 2026-06-03 16:49:23 +03:00
Дмитрий 29ec68d3cc docs(imitation): plan — execution status + corrections (namespace, subject codes, Task 0.5 env provision) 2026-06-03 16:25:52 +03:00
Дмитрий 0cd6063af6 feat(imitation): deterministic fake DaData phone client 2026-06-03 15:35:46 +03:00
Дмитрий 39d9b0b51b docs(imitation): Task 0 — pin verified signatures + plan corrections 2026-06-03 14:57:48 +03:00
Дмитрий 08924e3920 docs(imitation): phase 1 client-imitation spec + implementation plan 2026-06-03 14:52:08 +03:00
CoralMinister 045f781d5c Merge pull request #43 from CoralMinister/feat/deals-city-region
Feat/deals city region
2026-06-02 13:48:18 +03:00
CoralMinister 627f415ef0 Merge pull request #42 from CoralMinister/feat/gate-allow-worktree-cd
Feat/gate allow worktree cd
2026-06-02 13:47:47 +03:00
Дмитрий 1a746087f0 feat(deals): backfill command for «Город» on existing deals
deals:backfill-region-city fills deals.city from the lead resolved_subject_code (deals -> supplier_lead_deliveries -> supplier_leads) for deals where city is still empty, idempotently and across all tenants (BYPASSRLS). --dry-run reports the count without writing. Whitelisted in artisan-run.yml (dry-run read-only; real run requires confirm_apply). TDD: +4 tests GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:38:10 +03:00
Дмитрий 5dbd6dfe08 fix(tdd-gate): recognize pest JSON reporter failures as RED
composer test / php artisan test emit machine JSON ({"result":"failed",...}); command-not-found and error REDs lack the English Failed keyword the gate looked for, so legit RED runs went unseen and prod-code edits were wrongly blocked. hasFailingTestRun now also matches the structured failure markers. TDD: +1 test; full tools suite 2004 GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:35:05 +03:00
Дмитрий e62edb5b69 feat(deals): fill «Город» (deals.city) with resolved region name
The UI «Город» column binds to deals.city but nothing ever populated it — the region was only stored as a numeric code on supplier_leads + the resolution log. RouteSupplierLeadJob now writes the resolved subject name (RussianRegions::CODE_TO_NAME) into deals.city on deal creation (the lead's real region, even if subject_code is substituted on routing step 3), and updates it in the CSV-merge branch when the webhook resolution outranks the tag. New deals now display the region. TDD: +2 tests in RouteSupplierLeadJobTest; 24 job tests GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:16:31 +03:00
Дмитрий 9f6bd2bd46 feat(router-gate): support git -C path for worktree dev
Shell resets cwd each call so a worktree cd does not persist; pointing git at the worktree dir is the cwd-independent way to commit there. classifyGitCommand now strips the leading working-dir flag before all checks, so the real subcommand is classified and all hard-patterns (hook-bypass, force-push, force-add, config-injection) plus the push-main-guard still apply. TDD: plus 6 tests; full tools suite 2003 GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:14:35 +03:00
Дмитрий 22e7ac278b feat(router-gate): allow cd into project worktree dirs for worktree dev
PR #41 re-scope enabled 'git worktree' creation but not working inside worktrees: only 'cd app' was whitelisted, so pest/git could not run in a worktree. Add a SAFE_EXACT rule allowing cd into a path with a worktree-/v4-stream- segment, excluding .. and protected segments (.claude/.ssh/.env/runtime/.git) so the cwd-shift read-bypass stays contained. TDD: +6 tests; full tools suite 1997 GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:04:15 +03:00
CoralMinister 2cb427b589 Merge pull request #41 from CoralMinister/feat/gate-dev-prod-rescope
Feat/gate dev prod rescope
2026-06-02 09:41:03 +03:00
Дмитрий e5df19b0e6 feat(gate): re-scope router-gate — allow local dev, keep prod+discipline blocks
composer/npm moved from hard-blacklist to whitelist; git dev-allow (commit/add/branch/switch/checkout/stash/worktree) + push main-guard in shared shell-content-rules; read-only GitHub (get_*/actions_get/actions_list) in mcp-classifier. Prod-safety (deploy/prod-DB/secrets/workflow-triggers/MCP-write), discipline hooks, and main push/merge stay blocked. Spec+plan in docs/superpowers. tools regression 1991 GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 09:32:39 +03:00
CoralMinister 4470c6c224 Add files via upload 2026-06-02 08:11:37 +03:00
CoralMinister 115f310dcf Add files via upload 2026-06-01 19:07:51 +03:00
CoralMinister 658afb4f1e Add files via upload 2026-06-01 18:48:18 +03:00
CoralMinister 3859b361f0 Add files via upload 2026-06-01 18:11:59 +03:00
CoralMinister 1930932f33 Add files via upload 2026-06-01 18:10:26 +03:00
CoralMinister b60ce844ff Add files via upload 2026-06-01 18:05:01 +03:00
CoralMinister 5736afb11d Add files via upload 2026-06-01 18:01:02 +03:00
CoralMinister 7d44960302 Add files via upload 2026-06-01 16:26:02 +03:00
CoralMinister a5e7775580 Add files via upload 2026-06-01 16:10:59 +03:00
CoralMinister 2518700665 Add files via upload 2026-06-01 14:15:34 +03:00
CoralMinister 7f7c76cf5c Add files via upload 2026-06-01 13:49:51 +03:00
CoralMinister 22a85c59aa Add files via upload 2026-06-01 11:10:06 +03:00
CoralMinister 44e697cdb0 Merge pull request #30 from CoralMinister/worktree-feat+lead-region-resolution
Worktree feat+lead region resolution
2026-06-01 10:51:31 +03:00
Дмитрий 7b496cc489 docs(claude-md): v2.45 — lead region resolution feature note (§6/§9) 2026-06-01 07:55:57 +03:00
Дмитрий b9692c7e13 chore(region): add cspell dictionary terms (DaData/Rossvyaz) 2026-06-01 07:39:43 +03:00
Дмитрий bfe95a24d1 fix(region): wrap phone_ranges swap in a transaction + drop stray comment (code-review) 2026-06-01 07:32:15 +03:00
Дмитрий c740f0bf6d docs(region): rollout runbook + session progress 2026-06-01 07:21:24 +03:00