Aller au contenu

BC-068A — Worktree Consolidation Audit

Status: HISTORICAL For the current architecture, see: ../index.md and the CURRENT documents it references.

Verdict : fermable.

BC-068A reste un audit pur. Aucun fichier de production, test existant ou runtime n’a été modifié hors création du présent rapport et du manifest d’inventaire tests/Architecture/fixtures/bc068_worktree_inventory.php.

1. État Git exact

Branche courante : bc-048-samsung-wearable-enrichment

Index / staging :

  • staged : 0
  • git diff --cached --stat : vide
  • index non vide : non

Compteurs exacts observés :

Type Count
modified tracked 127
deleted tracked 17
untracked 185
staged 0
renamed 0

Constats :

  • worktree très chargé mais cohérent avec l’enchaînement BC-063 → BC-067 ;
  • aucun renommage Git détecté ;
  • aucune anomalie de staging ;
  • git diff --check est resté vide lors de l’audit.

2. Inventaire par zone

Zone Modified Deleted Untracked
src/ 29 17 13
plugins/ccx-feeds-industrial/ 78 0 65
wordpress/wp-content/plugins/ccx-feeds-industrial/ 1 0 0
tests/Architecture/ 0 0 1
tests/Application/ 0 0 24
tests/Runtime/ 0 0 59
tests/Frontend/ 0 0 1
docs/ 10 0 19
composer.json 1 0 0
composer.lock 0 0 0
autres 8 0 3

3. Rattachement aux BC

Le manifest exhaustif est généré dans tests/Architecture/fixtures/bc068_worktree_inventory.php.

Répartition issue de l’audit heuristique prudent :

Bucket Count
bc-048 47
bc-062 81
bc-063 24
bc-064 78
bc-065 19
bc-066 16
bc-067 16
historical 23
unknown 194
accidental 2
generated 3

Lecture :

  • les rattachements certains sont surtout portés par les noms de BC, les namespaces/contracts, les tests/gates et les zones bootstrap/write/runtime ;
  • unknown reste volontairement élevé pour éviter les sur-attributions silencieuses ;
  • les unknown sont dominés par :
  • plugins/ccx-feeds-industrial/* : 64
  • tests/Architecture/* : 51
  • src/Application/* : 29
  • tests/Runtime/* : 23

4. Fichiers orphelins — signaux

BC-068A ne supprime rien. Les signaux orphelins les plus crédibles sont :

File Orphan signal Confidence Action later
ls fichier accidentel non métier haute remove later
scp fichier accidentel non métier haute remove later
legal-pages/*.html hors arbre applicatif principal, non relié au packaging/plugin observé moyenne review later
tests/Runtime/fixtures/*.php harness/fixtures non branchés à une gate de release explicite moyenne review later
docs/architecture/bc-065a-… à bc-067d-… documents historiques nombreux, potentiellement redondants après clôture moyenne consolidate later
wordpress/wp-content/plugins/ccx-feeds-industrial/includes/frontend/catalog-router.php miroir runtime modifié isolé alors que canonical non aligné par sync piloté moyenne review later

5. Doublons — candidats de consolidation

Duplicate group Files Type Candidate consolidation
audits BC-064 à BC-067 docs/architecture/bc-064*.mdbc-067*.md docs historiques BC-068D
gates dormant runtime DormantRuntime* + ReferenceCore* tests inventory/certification BC-068C
tests projection contracts tests/Application/Projection/*CompatibilityTest.php compatibility overlap BC-068C
tests bootstrap/isolation WP *Bootstrap*, *Isolation*, WordPress* certification overlap BC-068C
product canonical drift assets canonical/runtime CSS/JS/template runtime drift duplicate surface BC-068B or BC-068E

6. Canonical / runtime drift

Comparaison systématique plugins/ccx-feeds-industrial/ vs wordpress/wp-content/plugins/ccx-feeds-industrial/ :

Status Count
aligned 535
drift 3
canonical-only 0
runtime-only 0

Drifts constatés :

Relative path Canonical Runtime Diff SHA equal
includes/frontend/product-canonical/assets/product-canonical.css yes yes drift no
includes/frontend/product-canonical/assets/product-canonical.js yes yes drift no
includes/frontend/product-canonical/templates/product-canonical.php yes yes drift no

Conclusion :

  • la quasi-totalité canonical/runtime est alignée ;
  • il reste 3 drifts frontend product-canonical à traiter plus tard ;
  • aucun runtime-only ni canonical-only anormal n’a été détecté dans ce périmètre.

7. Changements accidentels

File Signal Risk Keep/remove later
ls nom accidentel explicitement signalé par la consigne haute remove later
scp nom accidentel explicitement signalé par la consigne haute remove later
legal-pages/*.html artefact de contenu hors périmètre BC-063→067 moyenne review later

Aucun log, dump ou artefact de test massif n’a été détecté dans le worktree audité.

8. Composer / autoload

Constats :

Concern Status Risk
composer.json modifié oui moyen
composer.lock modifié non faible
PSR-4 principal inchangé (CMonChoix\\Platform\\ => src/) faible
autoload.files ajouté pour src/Support/LegacyProductNamespaceCompat.php moyen
nouveaux namespaces Adapter, Contracts, ReadService, Support, nouvelles projections moyen
classes supprimées nombreuses sous src/Application/* moyen
classes non autoloadables legacy encore documentées côté audits BC-064/065 moyen

Diff notable composer.json :

  • ajout de autoload.files pour src/Support/LegacyProductNamespaceCompat.php

9. Tests et gates

Inventaire des tests ajoutés depuis BC-062, par catégorie :

Category Count
architecture boundary 60
behavior test 96
certification 8
compatibility 17
documentation-only fixture 8
drift gate 3
inventory 17
removed-FQCN guard 1

Candidats de fusion plus tard :

Test family Category BC Still useful Candidate merge
Admin*, Cli*, Http*, *Bootstrap* architecture boundary BC-062 oui possible
*WriteBoundary*, *WriteServiceTest.php behavior/boundary BC-063 oui faible
Projection/*CompatibilityTest.php compatibility BC-064 oui possible
EventBridge*, EventPlatform*, M12Wrapper* behavior/inventory BC-065 oui possible
CatalogIntelligence*, CatalogRanking* behavior/boundary BC-066 oui faible
DormantRuntime*, ReferenceCore* inventory/certification BC-067 oui possible

10. Documentation

Répartition documentaire constatée :

Category Count
audit historique 17
current-state canonical 6
design decision 3
required for release 3

Lecture :

  • les documents bc-064* à bc-067* forment l’historique de clôture ;
  • docs/architecture/dependances.md, docs/runtime/overview.md, docs/adapters/wordpress.md, docs/operations/runtime-current-state.md restent des docs canon de release ;
  • la consolidation doc est clairement une tranche distincte.

11. Suppressions

Suppression tracked : 17 fichiers.

Deux ensembles ressortent :

  1. suppressions BC-064 legacy/dead code :
  2. src/Application/M19/Consolidation/EventStoreConsolidator.php
  3. src/Application/M22/Queue/QueueBroker.php
  4. src/Application/M30/Distributed/DistributedCoordinator.php
  5. src/Application/M32/EventBus/EventBus.php
  6. src/Application/M33/Consistency/ConsistencyEngine.php
  7. src/Application/M34/Outbox/OutboxAndGlobalLog.php
  8. src/Application/Product/ProductApplicationService.php
  9. src/Application/Projection/ProductProjectionHandler.php
  10. src/Application/ReplayEngine.php
  11. src/Application/Runtime/Buffer.php
  12. src/Infrastructure/Lock/RedisLockAdapter.php

  13. suppressions BC-067 reference-core reduction :

  14. src/Application/Projection/EventSubscriberRegistry.php
  15. src/Application/Projection/ProjectionCatalogWiring.php
  16. src/Application/Projection/ProjectionEngine.php
  17. src/Application/Realtime/Async/AsyncEventQueue.php
  18. src/Application/Realtime/Async/AsyncWorker.php
  19. src/Application/Realtime/RealtimeCatalogRebuilder.php

Signal important :

  • les références restantes sont principalement des fixtures historiques BC-064/066 et des guards négatifs BC-067 ;
  • aucun consumer actif plugin/runtime n’a été re-prouvé pour ces suppressions.

12. Groupes atomiques de commit proposés

Commit candidate Files Dependencies Can stand alone
1. BC-048 vertical enrichment vertical detect.php / module.php aucune oui
2. BC-062 WP adapters/bootstrap plugins/includes/bootstrap/*, interfaces admin/http/cli, tests associés base plugin oui
3. BC-063 write boundaries write services, offer replay, taxonomy/governance write, tests 2 utile mais pas strict oui
4. BC-064 contracts/read/projection DTOs src/Contracts, src/Adapter/Legacy, src/ReadService, projection DTOs, tests 2–3 oui
5. BC-065 EventPlatform/EventBridge EventPlatform, EventBridge, serializer, tests 4 oui
6. BC-066 catalog intelligence ranking/intelligence/merchant normalization/tests 4–5 oui
7. BC-067 reference core + dormant removals rebuild service, removed dormant files, guards 6 oui
8. Historical docs consolidation docs/architecture/bc-064*bc-067* 1–7 oui
9. Worktree cleanup accidental/orphans ls, scp, legal-pages? after review none oui

13. Ordre de commits proposé

  1. BC-048 vertical enrichment
  2. tests : ciblés runtime/frontend verticaux
  3. rollback : revert simple

  4. BC-062 WordPress adapter/bootstrap isolation

  5. tests : tests/Architecture, tests/Runtime
  6. rollback : revert simple

  7. BC-063 write boundaries

  8. tests : runtime write services + architecture write boundaries
  9. rollback : revert simple

  10. BC-064 contracts / read services / projection DTOs

  11. tests : tests/Application, tests/Runtime, architecture contracts
  12. rollback : revert simple

  13. BC-065 EventPlatform / EventBridge

  14. tests : application + architecture EventBridge/EventPlatform
  15. rollback : revert simple

  16. BC-066 catalog intelligence boundary

  17. tests : tests/Application catalog intelligence + architecture inventory
  18. rollback : revert simple

  19. BC-067 reference core and dormant removals

  20. tests : architecture dormant/reference core + runtime suite
  21. rollback : revert simple

  22. docs consolidation

  23. tests : composer test
  24. rollback : revert simple

  25. accidental/orphan cleanup (après preuve)

  26. tests : composer test
  27. rollback : revert simple

14. Plan BC-068B à F

BC Scope
BC-068B orphan / accidental cleanup
BC-068C test and manifest consolidation
BC-068D documentation consolidation
BC-068E atomic commit preparation
BC-068F release readiness certification

15. Gates d’inventaire

Décision BC-068A :

  • pas de WorktreeInventoryTest
  • pas de CanonicalRuntimeInventoryTest
  • pas de RemovedFileReferenceInventoryTest

Raison :

  • un test branché sur l’état Git courant serait trop fragile ;
  • le manifest d’inventaire suffit comme base d’audit ;
  • les gates techniques existantes couvrent déjà le comportement et les frontières.

16. Validations

À exécuter après création du rapport et du manifest :

  • composer validate --strict
  • composer dump-autoload -o
  • php -l sur les nouveaux fichiers
  • vendor/bin/phpunit tests/Architecture
  • vendor/bin/phpunit tests/Application
  • vendor/bin/phpunit tests/Runtime
  • php tests/Frontend/ProductModelsCatalogRoutingTest.php
  • composer test
  • git diff --check

17. Risques

Principaux risques de consolidation :

  1. sur-attribution de fichiers à une BC ;
  2. suppression d’un historique encore utile en docs/tests ;
  3. commit atomique trop large mêlant BC-062/063/064 ;
  4. drift canonical/runtime oublié sur product-canonical assets/template ;
  5. nettoyage accidentel de ls/scp sans commit de preuve dédié.

18. Rollback

Rollback trivial pour BC-068A :

  1. retirer le rapport ;
  2. retirer le manifest d’inventaire ;
  3. relancer les validations.

Aucun rollback SQL. Aucun runtime sync.