devflow-cli 10.2.3__py3-none-any.whl → 10.2.5__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 = "10.2.3"
3
+ VERSION = "10.2.5"
4
4
 
5
5
  ACTIVITY_LINEAR_MAPPING = {
6
6
  "assess": "Backlog",
@@ -949,8 +949,9 @@ def _verify_recovery(
949
949
  Approbation manquante : chaque approve-command puis verify. Executable introuvable
950
950
  (code 127) : corriger l'environnement puis verify. Echec d'un controle : trois voies,
951
951
  le code (reopen implement), la validation (reopen de l'activite qui l'a inscrite) ou
952
- un echec passager (relancer verify). Apres un verify --refresh refuse, toutes les
953
- commandes verify portent --refresh.
952
+ un echec passager (relancer verify). Lot commite avant done : decommiter puis
953
+ verify --refresh, ou bilan si le commit est pousse (KKS-724). Apres un verify
954
+ --refresh refuse, toutes les commandes verify portent --refresh.
954
955
  """
955
956
  issue = shlex.quote(issue_id)
956
957
  verify_command = {
@@ -987,6 +988,35 @@ def _verify_recovery(
987
988
  "command": f"devflow adaptive status {issue}",
988
989
  "purpose": "consulter l'etat du parcours",
989
990
  }
991
+ if outcome.reason == "diff-inspection-failed" and outcome.committedBase:
992
+ return {
993
+ "kind": "committed-lot",
994
+ "summary": (
995
+ "Lot commite avant done. Commit non pousse : revenir a un arbre non "
996
+ "commite puis relancer verify. Commit deja pousse : terminer hors "
997
+ "Devflow et cloturer par un bilan."
998
+ ),
999
+ "validations": [],
1000
+ "commands": [
1001
+ {
1002
+ "command": f"git reset --soft {shlex.quote(outcome.committedBase)}",
1003
+ "purpose": (
1004
+ "commit non pousse : decommiter sans perdre le contenu ; tous les "
1005
+ "commits faits depuis la base le sont, les controler par git log avant"
1006
+ ),
1007
+ },
1008
+ {
1009
+ "command": f"devflow adaptive verify {issue} --refresh",
1010
+ "purpose": "commit non pousse : relancer la verification",
1011
+ },
1012
+ {
1013
+ "command": (
1014
+ f"devflow feedback add --type bilan --issue {issue} --what MOTIF"
1015
+ ),
1016
+ "purpose": "commit deja pousse : cloturer le parcours hors Devflow",
1017
+ },
1018
+ ],
1019
+ }
990
1020
  if outcome.reason not in CHECK_FAILURE_REASONS:
991
1021
  return {
992
1022
  "kind": "status",
@@ -1205,7 +1235,10 @@ def _operational_status(
1205
1235
  result_file, result = _latest_activity_result(feature_dir, state.currentActivity)
1206
1236
  blockers = result.get("blockers", []) if isinstance(result, dict) else []
1207
1237
  risks = latest_remaining_risks(feature_dir, state)
1208
- if not isinstance(blockers, list):
1238
+ if not isinstance(blockers, list) or (
1239
+ result_file == activity_result_file(feature_dir, state.currentActivity)
1240
+ and _blocked_result_lifted(result, state)
1241
+ ):
1209
1242
  blockers = []
1210
1243
  stale: set[str] = set()
1211
1244
  if state.status != "completed": # aucune gate ne consulte la peremption apres done
@@ -1254,6 +1287,39 @@ def _operational_status(
1254
1287
  }
1255
1288
 
1256
1289
 
1290
+ def _parse_utc(value: object) -> datetime | None:
1291
+ try:
1292
+ return datetime.strptime(str(value), "%Y-%m-%dT%H:%M:%SZ")
1293
+ except ValueError:
1294
+ return None
1295
+
1296
+
1297
+ def _blocked_result_lifted(result: dict, state: AdaptiveWorkflowState) -> bool:
1298
+ """KKS-727 (D4) : un resultat bloque anterieur a un verify --refresh reussi est leve.
1299
+
1300
+ Le fichier n'est pas touche ; sans horodatage lisible, le blocage reste affiche.
1301
+ """
1302
+ if result.get("status") != "blocked":
1303
+ return False
1304
+ observation = result.get("observation")
1305
+ observed = (
1306
+ _parse_utc(observation.get("observedAt"))
1307
+ if isinstance(observation, dict) else None
1308
+ )
1309
+ if observed is None:
1310
+ return False
1311
+ for entry in state.evidence.values():
1312
+ recorded = _parse_utc(entry.get("recordedAt"))
1313
+ if (
1314
+ entry.get("source") == "devflow"
1315
+ and entry.get("outcome") == "passed"
1316
+ and recorded is not None
1317
+ and recorded > observed
1318
+ ):
1319
+ return True
1320
+ return False
1321
+
1322
+
1257
1323
  def _print_operational_status(payload: dict) -> None:
1258
1324
  console.rule(f"[bold]devflow — {payload['issueId']}[/bold]")
1259
1325
  console.print(f"Profil : [bold]{payload['profile']}[/bold]")
@@ -181,6 +181,16 @@ def run_current_activity(
181
181
  validate_preflight_evidence(
182
182
  feature_dir / "preflight-evidence.md", newer_than=upstream
183
183
  )
184
+ if contract.activity in {"review", "rollback-check"}:
185
+ # KKS-727 (D1) : des preuves de verify deja perimees donneraient le refus
186
+ # d'apres agent ; meme code et meme texte, sans lancer l'agent. Le
187
+ # controle a l'application du resultat reste (D2).
188
+ try:
189
+ ensure_fresh_devflow_evidence(feature_dir, state, contract.activity)
190
+ except ValueError as exc:
191
+ return AdaptiveRunOutcome(
192
+ "transition-refused", contract.activity, contract.activity, str(exc)
193
+ )
184
194
  except BaseObservationError as exc:
185
195
  return AdaptiveRunOutcome(
186
196
  exc.reason, state.currentActivity, state.currentActivity, str(exc)
@@ -87,6 +87,8 @@ class AutomaticVerificationOutcome:
87
87
  nextActivity: str = "verify"
88
88
  pendingApprovals: tuple[str, ...] = ()
89
89
  failures: tuple[VerificationFailure, ...] = ()
90
+ # Commit de la base d'implement quand le lot a ete commite avant done (KKS-724).
91
+ committedBase: str = ""
90
92
 
91
93
 
92
94
  def select_validation_commands(
@@ -712,10 +714,11 @@ def run_automatic_verification(
712
714
  and all(result.succeeded for result in security_results)
713
715
  and not security_findings
714
716
  )
717
+ diff_files = document_batch if document_batch is not None else changed_files
718
+ base_head = (state.implementBase or {}).get("head") or ""
715
719
  diff_payload = _inspect_diff(
716
- project_root,
717
- document_batch if document_batch is not None else changed_files,
718
- feature_dir,
720
+ project_root, diff_files, feature_dir,
721
+ base_head=base_head, issue_id=state.issueId,
719
722
  )
720
723
  final_snapshot = snapshot_worktree(project_root)
721
724
  try:
@@ -830,8 +833,14 @@ def run_automatic_verification(
830
833
  )
831
834
  if diff_payload["outcome"] != "passed":
832
835
  safe_refresh_worklog(feature_dir)
836
+ committed_base = (
837
+ _committed_lot_base(final_snapshot.head, base_head)
838
+ if _missing_from_diff(final_snapshot, diff_files, feature_dir, project_root)
839
+ else ""
840
+ )
833
841
  return AutomaticVerificationOutcome(
834
- False, "diff-inspection-failed", "; ".join(diff_payload["findings"])
842
+ False, "diff-inspection-failed", "; ".join(diff_payload["findings"]),
843
+ committedBase=committed_base,
835
844
  )
836
845
  if state.profile == "deep" and coverage_payload["outcome"] != "passed":
837
846
  safe_refresh_worklog(feature_dir)
@@ -1009,20 +1018,44 @@ def _test_execution_finding(command: list[str], output: str) -> str | None:
1009
1018
  return None
1010
1019
 
1011
1020
 
1012
- def _inspect_diff(project_root: Path, changed_files: list[str], feature_dir: Path) -> dict:
1013
- findings: list[str] = []
1014
- snapshot = snapshot_worktree(project_root)
1015
- dirty = set(snapshot.files)
1021
+ def _missing_from_diff(
1022
+ snapshot: WorktreeSnapshot, changed_files: list[str], feature_dir: Path,
1023
+ project_root: Path,
1024
+ ) -> list[str]:
1016
1025
  # Les fichiers du dossier de la feature peuvent etre ignores par git : ils ne sont pas
1017
1026
  # exiges dans le diff courant.
1018
1027
  feature_prefix = _feature_subtree(feature_dir, project_root) + "/"
1019
- missing = sorted(
1020
- path for path in set(changed_files) - dirty if not path.startswith(feature_prefix)
1028
+ return sorted(
1029
+ path for path in set(changed_files) - set(snapshot.files)
1030
+ if not path.startswith(feature_prefix)
1021
1031
  )
1022
- if missing:
1032
+
1033
+
1034
+ def _committed_lot_base(head: str, base_head: str) -> str:
1035
+ """Commit de la base quand HEAD l'a quitte, chaine vide sinon (KKS-724)."""
1036
+ return base_head if base_head and head and head != base_head else ""
1037
+
1038
+
1039
+ def _inspect_diff(
1040
+ project_root: Path, changed_files: list[str], feature_dir: Path,
1041
+ *, base_head: str = "", issue_id: str = "ISSUE_ID",
1042
+ ) -> dict:
1043
+ findings: list[str] = []
1044
+ snapshot = snapshot_worktree(project_root)
1045
+ missing = _missing_from_diff(snapshot, changed_files, feature_dir, project_root)
1046
+ committed_base = _committed_lot_base(snapshot.head, base_head)
1047
+ if missing and committed_base:
1048
+ findings.append(
1049
+ "fichiers implementes absents du diff courant : " + ", ".join(missing)
1050
+ + " ; le lot a ete commite avant done. Commit non pousse : "
1051
+ f"git reset --soft {committed_base} (decommite tout ce qui suit la base : "
1052
+ f"controler git log {committed_base}..HEAD avant), puis "
1053
+ f"devflow adaptive verify {shlex.quote(issue_id)} --refresh. Commit deja pousse : "
1054
+ "terminer hors Devflow et cloturer par devflow feedback add --type bilan"
1055
+ )
1056
+ elif missing:
1023
1057
  findings.append(
1024
1058
  "fichiers implementes absents du diff courant : " + ", ".join(missing)
1025
- + " ; cause possible : lot commite entre implement et verify"
1026
1059
  )
1027
1060
 
1028
1061
  diff_result = run_verifications(
@@ -44,6 +44,13 @@ Devflow : le dire, avec la cause, et traiter la demande hors Devflow.
44
44
  CLI plante (traceback, commande inconnue), sortir du parcours : terminer
45
45
  la feature hors Devflow, clôturer par un `bilan` dont `--what` indique
46
46
  l'abandon et sa cause, et indiquer cette cause dans le compte rendu.
47
+
48
+ Ne rien commiter avant la clôture de `done` : un commit rend toutes les
49
+ preuves périmées, et `verify --refresh` ne sait pas inspecter un lot
50
+ commité. Une retouche faite après `verify` (correctif de revue,
51
+ documentation) se valide par `devflow adaptive verify ISSUE_ID --refresh`
52
+ tant que rien n'est commité, puis par une réouverture de `review` si la
53
+ revue est périmée. Commit, push et PR viennent après `done`.
47
54
  8. Afficher ensuite `devflow adaptive status ISSUE_ID`.
48
55
 
49
56
  ## Retours d'usage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-cli
3
- Version: 10.2.3
3
+ Version: 10.2.5
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,10 +1,10 @@
1
- devflow_cli/__init__.py,sha256=NgbjejcRAc4t-0o25LN9aj6PfgdWhDCMiKix9eB9f5M,871
1
+ devflow_cli/__init__.py,sha256=qI2n_r6YMtaHylUEp0IK7p9sSfj_z-y4zGv2VQ8Huy0,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=-9zmNlFmQfP2pOGxA3_SSKij8ScR76J4-sgv4GMBWEI,18530
5
5
  devflow_cli/adapters/linear.py,sha256=xHKjMuL3fFJEDBF65pPJ-yWHpXom999UAU2A0C7_QeI,8362
6
6
  devflow_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- devflow_cli/commands/adaptive.py,sha256=PO_JW1KwNrb-Jozib-NPB21HCIeG5i0iPgYX5WBUuS4,64999
7
+ devflow_cli/commands/adaptive.py,sha256=1U9bY-Amxl3mD4Zho9eV0O6vOpAvd788bYDDfzW4TAc,67600
8
8
  devflow_cli/commands/assess.py,sha256=V-E3ft41ljCrqp2WLjR1Dqw-JtswcqsK2nD1-euNbNE,5655
9
9
  devflow_cli/commands/check.py,sha256=nJOHVFvgT3Nq70g-4QGrSDZVwCSetu6g7snZcfLFf9I,4421
10
10
  devflow_cli/commands/docs_sync.py,sha256=Xc0mulpNTjDyeUDumKL7VNG0eumAf3016wEM_dqXpSU,1021
@@ -17,12 +17,12 @@ devflow_cli/commands/upgrade_cmd.py,sha256=7GYe1T7SWzkDSYW9x1G-Dznw9qwKT2uI1gJUc
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
19
  devflow_cli/core/activity_contracts.py,sha256=wL0Y0OnyTptQtFZ1d4BpPiJA2eCK0-8h9cksYdnUAfU,40278
20
- devflow_cli/core/adaptive_runner.py,sha256=AkXtcE-lOjxDnabKdxvv5knx9giZXvvhzuv9LKLS7Mc,49727
20
+ devflow_cli/core/adaptive_runner.py,sha256=pBwcV6u1RaG1VWSvMFGkR4BMdrmu7mpMAynVoooG0Mo,50347
21
21
  devflow_cli/core/adaptive_workflow.py,sha256=DU8iciNOeEDco5uwQUeX9E9Kc2WwaVPoRfWxdpRJyJ4,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=MraC57_P_ZqPkmQJNoVyBi6oBj9lCr-WZdmWwOUZXGk,42875
25
+ devflow_cli/core/automatic_evidence.py,sha256=SkqG-K5fh9PGJvYbyoxMsTSptHLCFlDmeiCD6HfANw0,44421
26
26
  devflow_cli/core/contract_schemas.py,sha256=M0Twbt_SVVfuPa7udC-EJuR3pTl9pWrxQUCohIsg1h0,8477
27
27
  devflow_cli/core/decisions.py,sha256=tFYKNDaztMvnhLfVGJKIux5zaSjEPx2nwXs5nb2qv4U,6308
28
28
  devflow_cli/core/docgen.py,sha256=47JoVDWetkcctgHwJZC67AVebOKgl10VB9hZ3Xr63mo,3908
@@ -55,11 +55,11 @@ devflow_cli/utils/console.py,sha256=t7cpyeEluWj4v_O_KFSI59iqXK4GiSXPuxlsr8q5zoQ,
55
55
  devflow_cli/utils/logging.py,sha256=ZL7DYB7rQn_94KKG7A6_IqONddR-XubJ4MhG3bGPKRI,1840
56
56
  devflow_cli/utils/paths.py,sha256=CH81dZZTI2vjgl8mck6QcAChxoBpujmKZ0vVKhKmXEY,8176
57
57
  devflow_cli/utils/strings.py,sha256=bfFXCwBDnFxshgZOYfy6mtysnjiaWO1wFnqBf7HLg4o,351
58
- devflow_cli/resources/commands/devflow.md,sha256=5MjahTVYXAT_zrjEQmM25KH9s6DbRmyI1TdJCxYlrKk,3464
58
+ devflow_cli/resources/commands/devflow.md,sha256=XLSvVlp0qNicP-SwiDI89jOTmquXzYH5hz1lXF4DGqA,3905
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-10.2.3.dist-info/METADATA,sha256=ZR0PMgciE_gEiCSBria9YqjTqUmdI3n9_pniHbDO_K0,6674
62
- devflow_cli-10.2.3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
63
- devflow_cli-10.2.3.dist-info/entry_points.txt,sha256=GVJ6bMvFpqyO5589iC4nFKeGTpGIW8aKn_QPPpSZ6kU,48
64
- devflow_cli-10.2.3.dist-info/licenses/LICENSE,sha256=v79PvnmqOdKhQiOa_QcWxng4q8GuGscLOwi7ygUpwpo,1070
65
- devflow_cli-10.2.3.dist-info/RECORD,,
61
+ devflow_cli-10.2.5.dist-info/METADATA,sha256=8m9KC6B51YxFJIoeITDau83dwK7st5SPS-tNb3N3bug,6674
62
+ devflow_cli-10.2.5.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
63
+ devflow_cli-10.2.5.dist-info/entry_points.txt,sha256=GVJ6bMvFpqyO5589iC4nFKeGTpGIW8aKn_QPPpSZ6kU,48
64
+ devflow_cli-10.2.5.dist-info/licenses/LICENSE,sha256=v79PvnmqOdKhQiOa_QcWxng4q8GuGscLOwi7ygUpwpo,1070
65
+ devflow_cli-10.2.5.dist-info/RECORD,,