devflow-cli 11.1.0__py3-none-any.whl → 11.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
devflow_cli/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """devflow CLI — workflow de développement adaptatif."""
2
2
 
3
- VERSION = "11.1.0"
3
+ VERSION = "11.2.0"
4
4
 
5
5
  ACTIVITY_LINEAR_MAPPING = {
6
6
  "assess": "Backlog",
@@ -66,7 +66,11 @@ VALIDATION_PLAN_ROLE_CONSTRAINT = (
66
66
  "validationPlan est la liste que verify executera apres implement pour produire "
67
67
  "la preuve : y lancer les tests du lot (suite du projet et tests cibles), ne pas "
68
68
  "y controler le document produit par cette activite, et n'y mettre aucune "
69
- "commande vouee a echouer apres implement (par exemple git diff --exit-code)."
69
+ "commande vouee a echouer apres implement (par exemple git diff --exit-code). "
70
+ "verify lance deja, pour chaque module touche, la suite de regression de la CLI "
71
+ "(mvn verify, et le build ou la verification Node) : ne pas repeter ces commandes "
72
+ "dans validationPlan ; une commande repetee quand meme est couverte par la "
73
+ "commande equivalente gardee, sans refus."
70
74
  )
71
75
  # KKS-554 (D3) : verify refuse un diff que git diff --check signale.
72
76
  FILE_ENDING_CONSTRAINT = (
@@ -11,7 +11,7 @@ import shutil
11
11
  import tempfile
12
12
  from dataclasses import dataclass, replace
13
13
  from datetime import datetime, timezone
14
- from pathlib import Path
14
+ from pathlib import Path, PurePosixPath
15
15
 
16
16
  from devflow_cli.core.adaptive_workflow import (
17
17
  AdaptiveWorkflowState,
@@ -40,6 +40,7 @@ from devflow_cli.core.assessment import read_assessment
40
40
  from devflow_cli.core.verification import (
41
41
  ValidationCommand,
42
42
  VerificationResult,
43
+ redact_command,
43
44
  run_verifications,
44
45
  validate_command_policy,
45
46
  )
@@ -588,15 +589,7 @@ def run_automatic_verification(
588
589
  return AutomaticVerificationOutcome(
589
590
  False, "invalid-preparation-result", str(exc)
590
591
  )
591
- known_commands = {
592
- (tuple(command.args), command.working_directory)
593
- for command in regression_commands
594
- }
595
- regression_commands.extend(
596
- command
597
- for command in planned_commands
598
- if (tuple(command.args), command.working_directory) not in known_commands
599
- )
592
+ regression_commands.extend(planned_commands)
600
593
  if state.profile in {"standard", "deep"} and not regression_commands:
601
594
  return AutomaticVerificationOutcome(
602
595
  False,
@@ -694,6 +687,21 @@ def run_automatic_verification(
694
687
  False, "validation-policy-refused", "; ".join(refusals)
695
688
  )
696
689
 
690
+ # Les gates et la politique ont vu toutes les commandes : seules les gardees s'executent.
691
+ if reuse_targeted_as_regression:
692
+ (regression_commands, security_commands), (
693
+ covered_regression, covered_security
694
+ ) = deduplicate_commands(
695
+ [regression_commands, security_commands], planned_prefix
696
+ )
697
+ commands, covered_targeted = regression_commands, []
698
+ else:
699
+ (commands, regression_commands, security_commands), (
700
+ covered_targeted, covered_regression, covered_security
701
+ ) = deduplicate_commands(
702
+ [commands, regression_commands, security_commands], planned_prefix
703
+ )
704
+
697
705
  before = snapshot_worktree(project_root)
698
706
  started_at = _now_iso()
699
707
  try:
@@ -721,16 +729,27 @@ def run_automatic_verification(
721
729
  break
722
730
  return AutomaticVerificationOutcome(False, "validation-policy-refused", detail)
723
731
  completed_at = _now_iso()
724
- checks_passed = (bool(results) or document_batch is not None) and all(
725
- result.succeeded or not result.blocking for result in results
732
+ results_by_id = {
733
+ result.id: result
734
+ for result in [*results, *regression_results, *security_results]
735
+ }
736
+ targeted_keepers = _keeper_results(covered_targeted, results_by_id)
737
+ regression_keepers = _keeper_results(covered_regression, results_by_id)
738
+ security_keepers = _keeper_results(covered_security, results_by_id)
739
+ checks_passed = (
740
+ bool(results) or bool(covered_targeted) or document_batch is not None
741
+ ) and all(
742
+ result.succeeded or not result.blocking
743
+ for result in [*results, *targeted_keepers]
726
744
  )
727
745
  regression_passed = all(
728
- result.succeeded or not result.blocking for result in regression_results
746
+ result.succeeded or not result.blocking
747
+ for result in [*regression_results, *regression_keepers]
729
748
  )
730
749
  security_findings = _sensitive_execution_findings(security_results)
731
750
  security_passed = (
732
- bool(security_results)
733
- and all(result.succeeded for result in security_results)
751
+ (bool(security_results) or bool(covered_security))
752
+ and all(result.succeeded for result in [*security_results, *security_keepers])
734
753
  and not security_findings
735
754
  )
736
755
  try:
@@ -755,6 +774,12 @@ def run_automatic_verification(
755
774
  if reuse_targeted_as_regression or state.profile != "deep"
756
775
  else [*results, *regression_results]
757
776
  )
777
+ check_covered = (
778
+ covered_targeted
779
+ if reuse_targeted_as_regression or state.profile != "deep"
780
+ else [*covered_targeted, *covered_regression]
781
+ )
782
+ check_keepers = _keeper_results(check_covered, results_by_id)
758
783
  check_passed = (
759
784
  checks_passed and regression_passed
760
785
  if state.profile == "deep"
@@ -767,6 +792,7 @@ def run_automatic_verification(
767
792
  "startedAt": started_at,
768
793
  "completedAt": completed_at,
769
794
  "commands": [result.to_dict() for result in check_results],
795
+ "coveredCommands": [item.to_dict() for item in check_covered],
770
796
  "worktreeMutations": test_mutations,
771
797
  "waiversApplied": applied_waivers,
772
798
  }
@@ -784,6 +810,7 @@ def run_automatic_verification(
784
810
  "startedAt": started_at,
785
811
  "completedAt": completed_at,
786
812
  "commands": [result.to_dict() for result in regression_results],
813
+ "coveredCommands": [item.to_dict() for item in covered_regression],
787
814
  "worktreeMutations": test_mutations,
788
815
  "waiversApplied": applied_waivers,
789
816
  }
@@ -802,6 +829,7 @@ def run_automatic_verification(
802
829
  "startedAt": started_at,
803
830
  "completedAt": completed_at,
804
831
  "commands": [result.to_dict() for result in security_results],
832
+ "coveredCommands": [item.to_dict() for item in covered_security],
805
833
  "executionFindings": security_findings,
806
834
  "worktreeMutations": test_mutations,
807
835
  "waiversApplied": [],
@@ -833,22 +861,24 @@ def run_automatic_verification(
833
861
 
834
862
  if check_payload["outcome"] != "passed":
835
863
  safe_refresh_worklog(feature_dir)
864
+ reported = _with_keepers(check_results, check_keepers)
836
865
  failed = [
837
866
  result.id
838
- for result in check_results
867
+ for result in reported
839
868
  if result.blocking and not result.succeeded
840
869
  ]
841
870
  detail = ", ".join(failed) or "les tests ont modifie le working tree"
842
871
  return AutomaticVerificationOutcome(
843
872
  False, f"{targeted_id}-failed", detail,
844
- failures=_failures(check_results),
873
+ failures=_failures(reported),
845
874
  )
846
875
  if state.profile == "standard" and not regression_passed:
847
876
  safe_refresh_worklog(feature_dir)
848
- failed = [result.id for result in regression_results if not result.succeeded]
877
+ reported = _with_keepers(regression_results, regression_keepers)
878
+ failed = [result.id for result in reported if not result.succeeded]
849
879
  return AutomaticVerificationOutcome(
850
880
  False, "regression-check-failed", ", ".join(failed),
851
- failures=_failures(regression_results),
881
+ failures=_failures(reported),
852
882
  )
853
883
  if diff_payload["outcome"] != "passed":
854
884
  safe_refresh_worklog(feature_dir)
@@ -864,8 +894,9 @@ def run_automatic_verification(
864
894
  )
865
895
  if security_payload is not None and security_payload["outcome"] != "passed":
866
896
  safe_refresh_worklog(feature_dir)
897
+ reported = _with_keepers(security_results, security_keepers)
867
898
  failed = [
868
- result.id for result in security_results if not result.succeeded
899
+ result.id for result in reported if not result.succeeded
869
900
  ]
870
901
  failed.extend(
871
902
  f"{item['commandId']}: {item['finding']}"
@@ -874,7 +905,7 @@ def run_automatic_verification(
874
905
  return AutomaticVerificationOutcome(
875
906
  False, "security-or-data-check-failed", ", ".join(failed),
876
907
  failures=(
877
- *_failures(security_results),
908
+ *_failures(reported),
878
909
  *(
879
910
  VerificationFailure(item["commandId"], None)
880
911
  for item in security_findings
@@ -962,6 +993,145 @@ def run_automatic_verification(
962
993
  )
963
994
 
964
995
 
996
+ MAVEN_EXECUTABLES = frozenset({"mvn", "./mvnw"})
997
+
998
+
999
+ def normalized_command(command: ValidationCommand) -> tuple[str, tuple[str, ...], str]:
1000
+ """Forme normalisee (executable, arguments, dossier) qui decide de l'equivalence."""
1001
+ directory = PurePosixPath(command.working_directory or ".")
1002
+ executable, *args = command.args or [""]
1003
+ if executable in MAVEN_EXECUTABLES:
1004
+ kept: list[str] = []
1005
+ project_dir = directory
1006
+ index = 0
1007
+ while index < len(args):
1008
+ arg = args[index]
1009
+ if arg in {"-B", "--batch-mode"}:
1010
+ index += 1
1011
+ continue
1012
+ if arg in {"-f", "--file"} and index + 1 < len(args):
1013
+ pom = PurePosixPath(args[index + 1])
1014
+ if pom.name != "pom.xml":
1015
+ # Un -f vers un autre fichier laisse la commande telle quelle.
1016
+ kept, project_dir = list(args), directory
1017
+ break
1018
+ project_dir = directory / pom.parent
1019
+ index += 2
1020
+ continue
1021
+ kept.append(arg)
1022
+ index += 1
1023
+ args, directory = kept, project_dir
1024
+ elif executable == "npm":
1025
+ kept = []
1026
+ index = 0
1027
+ while index < len(args):
1028
+ if args[index] == "--prefix" and index + 1 < len(args):
1029
+ directory = directory / args[index + 1]
1030
+ index += 2
1031
+ continue
1032
+ kept.append(args[index])
1033
+ index += 1
1034
+ args = kept
1035
+ return executable, tuple(args), PurePosixPath(directory.as_posix()).as_posix()
1036
+
1037
+
1038
+ @dataclass(frozen=True)
1039
+ class CoveredCommand:
1040
+ """Commande ecartee parce qu'une commande equivalente gardee la couvre."""
1041
+
1042
+ command: ValidationCommand
1043
+ coveredBy: str
1044
+
1045
+ @property
1046
+ def blocking(self) -> bool:
1047
+ return self.command.blocking
1048
+
1049
+ def to_dict(self) -> dict:
1050
+ return {
1051
+ "id": self.command.id,
1052
+ "command": redact_command(self.command.args),
1053
+ "workingDirectory": self.command.working_directory,
1054
+ "coveredBy": self.coveredBy,
1055
+ }
1056
+
1057
+
1058
+ def deduplicate_commands(
1059
+ lists: list[list[ValidationCommand]], planned_prefix: str
1060
+ ) -> tuple[list[list[ValidationCommand]], list[list[CoveredCommand]]]:
1061
+ """Garde une commande par forme normalisee sur l'ensemble des listes.
1062
+
1063
+ La derniere liste est celle des controles proteges. Ordre de garde : controle
1064
+ protege, puis commande du plan, puis commande automatique ; a rang egal, la
1065
+ premiere rencontree. Une commande non bloquante ne couvre jamais une bloquante.
1066
+ La commande gardee recoit le delai le plus long des commandes qu'elle couvre.
1067
+ """
1068
+ protected = len(lists) - 1
1069
+ entries = [
1070
+ (list_index, position, command)
1071
+ for list_index, items in enumerate(lists)
1072
+ for position, command in enumerate(items)
1073
+ ]
1074
+
1075
+ def rank(entry: tuple[int, int, ValidationCommand]) -> int:
1076
+ if entry[0] == protected:
1077
+ return 0
1078
+ return 1 if entry[2].id.startswith(f"{planned_prefix}-") else 2
1079
+
1080
+ groups: dict[tuple[str, tuple[str, ...], str], list] = {}
1081
+ for entry in entries:
1082
+ groups.setdefault(normalized_command(entry[2]), []).append(entry)
1083
+ kept: dict[tuple[int, int], ValidationCommand] = {}
1084
+ covered: list[list[CoveredCommand]] = [[] for _ in lists]
1085
+ for members in groups.values():
1086
+ remaining = list(members)
1087
+ while remaining:
1088
+ keeper = min(remaining, key=rank)
1089
+ covers = [
1090
+ entry
1091
+ for entry in remaining
1092
+ if entry is not keeper and (keeper[2].blocking or not entry[2].blocking)
1093
+ ]
1094
+ timeout = max(entry[2].timeout for entry in [keeper, *covers])
1095
+ kept[keeper[:2]] = replace(keeper[2], timeout=timeout)
1096
+ for entry in covers:
1097
+ covered[entry[0]].append(CoveredCommand(entry[2], keeper[2].id))
1098
+ remaining = [
1099
+ entry for entry in remaining if entry is not keeper and entry not in covers
1100
+ ]
1101
+ kept_lists = [
1102
+ [
1103
+ kept[(list_index, position)]
1104
+ for position in range(len(items))
1105
+ if (list_index, position) in kept
1106
+ ]
1107
+ for list_index, items in enumerate(lists)
1108
+ ]
1109
+ return kept_lists, covered
1110
+
1111
+
1112
+ def _keeper_results(
1113
+ covered: list[CoveredCommand], results_by_id: dict[str, VerificationResult]
1114
+ ) -> list[VerificationResult]:
1115
+ """Resultat de la commande gardee, porte au caractere bloquant de la commande couverte."""
1116
+ return [
1117
+ replace(results_by_id[item.coveredBy], blocking=item.blocking)
1118
+ for item in covered
1119
+ ]
1120
+
1121
+
1122
+ def _with_keepers(
1123
+ results: list[VerificationResult], keepers: list[VerificationResult]
1124
+ ) -> list[VerificationResult]:
1125
+ """Resultats d'une liste completes des commandes gardees qui couvrent ses commandes."""
1126
+ seen = {result.id for result in results}
1127
+ merged = list(results)
1128
+ for result in keepers:
1129
+ if result.id not in seen:
1130
+ seen.add(result.id)
1131
+ merged.append(result)
1132
+ return merged
1133
+
1134
+
965
1135
  def _failures(results: list[VerificationResult]) -> tuple[VerificationFailure, ...]:
966
1136
  return tuple(
967
1137
  VerificationFailure(result.id, result.returncode, result.timed_out)
@@ -335,6 +335,16 @@ def _verification_lines(
335
335
  lines.append(
336
336
  f" - `{rendered}` → code `{command.get('returncode', 'inconnu')}`{qualifier}"
337
337
  )
338
+ covered = targeted.get("coveredCommands", []) if targeted else []
339
+ if isinstance(covered, list):
340
+ for item in covered:
341
+ if not isinstance(item, dict):
342
+ continue
343
+ args = item.get("command", [])
344
+ rendered = " ".join(args) if isinstance(args, list) else str(args)
345
+ lines.append(
346
+ f" - `{rendered}` → couverte par `{item.get('coveredBy', 'inconnu')}`"
347
+ )
338
348
  findings = inspection.get("findings", []) if inspection else []
339
349
  if isinstance(findings, list):
340
350
  lines.extend(f" - Constat : {item}" for item in findings if isinstance(item, str))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-cli
3
- Version: 11.1.0
3
+ Version: 11.2.0
4
4
  Summary: Workflow adaptatif pour Claude Code : profils, preuves et contrats d'activité
5
5
  Project-URL: Homepage, https://github.com/sopequenoteck/devflow
6
6
  Project-URL: Repository, https://github.com/sopequenoteck/devflow
@@ -1,4 +1,4 @@
1
- devflow_cli/__init__.py,sha256=qdh9L2SU2oDA50GTSrZfMdHW8GgmKGp9Y1IkUNHEas0,871
1
+ devflow_cli/__init__.py,sha256=vmkwJEwELUxVwxHeL3_1yFRXX8EvZRhDIH3e4hq60C0,871
2
2
  devflow_cli/cli.py,sha256=QQktLkHK1cEAj0ZlEuGKYumm3xJUHM-aeC-E2RgfcEY,2136
3
3
  devflow_cli/adapters/__init__.py,sha256=z1J7_YJHcgak2a6dTZpOUKKwf-K7UwRqGzS8XY9duC0,299
4
4
  devflow_cli/adapters/agents.py,sha256=gVvxZnYxPQqDq_BQi0WP-mlOZ3-_fjVa8UI7i-JkMIo,22153
@@ -16,13 +16,13 @@ devflow_cli/commands/status.py,sha256=Votdh_sZkRuC_iui1krrdXE9cZ5dpY2OO2au4PVa7I
16
16
  devflow_cli/commands/upgrade_cmd.py,sha256=7GYe1T7SWzkDSYW9x1G-Dznw9qwKT2uI1gJUcWr9_2M,6093
17
17
  devflow_cli/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  devflow_cli/core/activity_base.py,sha256=eEC_YIr5O7WhCglA7xAEPypVzhcdC6f2h9d-SDDecVA,20475
19
- devflow_cli/core/activity_contracts.py,sha256=wL0Y0OnyTptQtFZ1d4BpPiJA2eCK0-8h9cksYdnUAfU,40278
19
+ devflow_cli/core/activity_contracts.py,sha256=M1heF8J_oQl7e8zlws_lUEL-nIN0ub4GJQKWoN9XaTk,40581
20
20
  devflow_cli/core/adaptive_runner.py,sha256=PuixfWdqpdfIkfUAE10r4S2d1qUZqb5WpA_0P2psvrM,50355
21
21
  devflow_cli/core/adaptive_workflow.py,sha256=dCtzURfOSsk_DpdLMwVlGNO4hUXeLH0lUOz29kP64G8,14416
22
22
  devflow_cli/core/agent_failure.py,sha256=iX4q249lAHeVdD_ZF1aObmU-FX6sjfYP9dfLSnWGAD0,3771
23
23
  devflow_cli/core/agent_run_marker.py,sha256=QW3ScA2ZpqfQdUo5ANTbenDVyY2iHpB_wTaN6VUKlzc,3451
24
24
  devflow_cli/core/assessment.py,sha256=ACtJbXq1qZjVfeERjy8Qg6-ioLfSMUBVQm2l-mtGwgI,11522
25
- devflow_cli/core/automatic_evidence.py,sha256=wzR6TqPBosoO97bO0z5rqHwuG-dO2GyAWrMN6gum3So,44101
25
+ devflow_cli/core/automatic_evidence.py,sha256=u2vpRm072fIkWkSdrlcaz_3GAW7dfr0IXVkCUEHYnAs,50747
26
26
  devflow_cli/core/contract_schemas.py,sha256=CWzaDbJEbe9KjqJG2r-u3KNsAlHnI5NxdA0yf05FRyU,9670
27
27
  devflow_cli/core/decisions.py,sha256=tFYKNDaztMvnhLfVGJKIux5zaSjEPx2nwXs5nb2qv4U,6308
28
28
  devflow_cli/core/docgen.py,sha256=47JoVDWetkcctgHwJZC67AVebOKgl10VB9hZ3Xr63mo,3908
@@ -43,7 +43,7 @@ devflow_cli/core/validation_approvals.py,sha256=3AHOpnW3BtY3BQrRZr38K7VNYRvbxGNh
43
43
  devflow_cli/core/validators.py,sha256=HKGG1-td5T8cFx3rbE0iWPtddolk73qsqYreVWVT07g,7081
44
44
  devflow_cli/core/verification.py,sha256=3_iGhsXNFCs5cpBUyBCRTsmRsfuBAVa38lRgy-LXXww,20349
45
45
  devflow_cli/core/waivers.py,sha256=0w38Osjr69mDT6Lsn0ljkaq6bbggVejuhqiOnYHabs4,5586
46
- devflow_cli/core/worklog.py,sha256=7sNdvvzvEzO4MKAs3tBeGGCdl2K2kyLlu9y756j9SNo,17124
46
+ devflow_cli/core/worklog.py,sha256=WPvK0D8b0DBOmnjEoKVum8_EtYR3DjTz7e2p9bulFzk,17577
47
47
  devflow_cli/core/worktree_snapshot.py,sha256=ESNWFJN8fZ7NKeDdEKHZq9f9V_2wv-3Z6dlWusu9oH4,6034
48
48
  devflow_cli/schemas/activity-contract-v4.schema.json,sha256=IeduWDiJ5IV6EL7FDZWnHBjzyUt1uwig2rB-SMbcpOU,2006
49
49
  devflow_cli/schemas/activity-result-v2.schema.json,sha256=2yDf6S--mlNWMxE8h8ruwTsM3Tnaa96SJDjluc4ePbI,2772
@@ -58,8 +58,8 @@ devflow_cli/utils/strings.py,sha256=bfFXCwBDnFxshgZOYfy6mtysnjiaWO1wFnqBf7HLg4o,
58
58
  devflow_cli/resources/commands/devflow.md,sha256=__hcU7uy7CrKODk-Tsvd8XlTnGsrsgLkgP4OzEMZk3k,5541
59
59
  devflow_cli/resources/commands/devflow.status.md,sha256=tqjQ1IboU99ztG6C4nunBHGJCvMn3qDqx3AoF4SPjCk,338
60
60
  devflow_cli/resources/templates/constitution-template.md,sha256=uSzNuwF-xIRx8cHt9gloynRjNgDGmnN5z2Xck6fCOsI,2102
61
- devflow_cli-11.1.0.dist-info/METADATA,sha256=B3Yh4MqSuhNMmZDPhfEGC2RaXTuwGvYKl3FM_3Wcx9g,6674
62
- devflow_cli-11.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
63
- devflow_cli-11.1.0.dist-info/entry_points.txt,sha256=GVJ6bMvFpqyO5589iC4nFKeGTpGIW8aKn_QPPpSZ6kU,48
64
- devflow_cli-11.1.0.dist-info/licenses/LICENSE,sha256=v79PvnmqOdKhQiOa_QcWxng4q8GuGscLOwi7ygUpwpo,1070
65
- devflow_cli-11.1.0.dist-info/RECORD,,
61
+ devflow_cli-11.2.0.dist-info/METADATA,sha256=njgOU2tWroX-ADG5LZPjM-iEhS2TY5ON65aQJ0tfFLQ,6674
62
+ devflow_cli-11.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
63
+ devflow_cli-11.2.0.dist-info/entry_points.txt,sha256=GVJ6bMvFpqyO5589iC4nFKeGTpGIW8aKn_QPPpSZ6kU,48
64
+ devflow_cli-11.2.0.dist-info/licenses/LICENSE,sha256=v79PvnmqOdKhQiOa_QcWxng4q8GuGscLOwi7ygUpwpo,1070
65
+ devflow_cli-11.2.0.dist-info/RECORD,,