Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions --others --exclude-standard
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/agents/acw.py b/agents/acw.py
index 9a3617c..109c9be 100644
--- a/agents/acw.py
+++ b/agents/acw.py
@@ -3,6 +3,8 @@ from __future__ import annotations

from typing import Any, Dict, List, Optional, Tuple
from textwrap import indent
+from pathlib import Path
+
import hashlib
import re

@@ -145,6 +147,42 @@ def _hash_payload(s: str) -> str:
return hashlib.sha256(s.encode("utf-8")).hexdigest()[:12]


+
+def _sanitize_marker(marker: str) -> str:
+ """
+ Normalise un marker fourni par l'ACWP/runner.
+ - vide -> ""
+ - supprime espaces superflus et nouvelles lignes
+ - s'assure que le marker commence par un commentaire Python '#' pour sécurité
+ - retourne la chaîne sur une seule ligne (sans \n final)
+ """
+ if not marker:
+ return ""
+ s = str(marker).strip()
+ # Retirer nouvelles lignes internes
+ s = " ".join(s.splitlines())
+ # Préfixer par '# ' si l'utilisateur n'a fourni qu'un identifiant nu
+ if not s.startswith("#"):
+ s = "# " + s
+ return s
+
+
+def _default_markers(plan_line_id: str, file_path: str) -> tuple[str, str]:
+ """
+ Génère des marqueurs begin/end sûrs et uniques pour une plan_line.
+ Format lisible et stable, évite collisions courantes.
+ """
+ # rendre le plan_line_id sûr (chars non-alphanum -> underscore)
+ safe_id = re.sub(r"[^\w]", "_", (plan_line_id or "pl").strip())
+ # incorporer un fragment de nom de fichier (utile pour debug)
+ fname = Path(file_path).stem if file_path else "file"
+ fname_safe = re.sub(r"[^\w]", "_", fname)[:24]
+ begin = f"# === ARCHCODE BEGIN {safe_id} {fname_safe} ==="
+ end = f"# === ARCHCODE END {safe_id} {fname_safe} ==="
+ return begin, end
+
+
+
def _render_meta_inline(meta: Dict[str, Any]) -> str:
"""Rend le dict `meta` en ligne juste après #{begin_meta: ...} avec tri des clés (diff stable)."""
items = []
16 changes: 16 additions & 0 deletions .archcode/execution_context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bus_message_id: BM-0001
spec_version: v0.0.1
title: Test projet minimal
loop_iteration: 0
user_stories:
- id: US-1
title: Authentification
description: Login / token
input_sources: []
output_targets: []
functional_objectives:
- Authentifier utilisateur
non_functional_constraints: []
modules:
- auth
plan_validated_id: PV-f4facffe
56 changes: 56 additions & 0 deletions .archcode/execution_plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
execution_plan:
project_name: project
bus_message_id: BM-0001
plan_validated_id: PV-f4facffe
spec_version_ref: v0.0.1
loop_iteration: 0
folder_root: archcode_app/
generated_at: '2025-08-15T08:35:52'
total_lines: 3
lines:
- plan_line_id: pl-0001-auth-c61e8a96
module_name: auth
user_story_id: US-1
responsibilities: &id001
- Gérer l'authentification (login, token)
depends_on: []
priority: haute
file_target: archcode_app/auth/__init__.py
file_kind: code
action: create_or_update
role_hint: null
meta:
bus_message_id: BM-0001
plan_validated_id: PV-f4facffe
plan_line_ref: pl-0001-auth-c61e8a96
loop_iteration: 0
- plan_line_id: pl-0002-auth-4100de5c
module_name: auth
user_story_id: US-1
responsibilities: *id001
depends_on: []
priority: haute
file_target: archcode_app/auth/handlers.py
file_kind: code
action: create_or_update
role_hint: handler
meta:
bus_message_id: BM-0001
plan_validated_id: PV-f4facffe
plan_line_ref: pl-0002-auth-4100de5c
loop_iteration: 0
- plan_line_id: pl-0003-auth-a94c0c0e
module_name: auth
user_story_id: US-1
responsibilities: *id001
depends_on: []
priority: haute
file_target: archcode_app/auth/models.py
file_kind: code
action: create_or_update
role_hint: model
meta:
bus_message_id: BM-0001
plan_validated_id: PV-f4facffe
plan_line_ref: pl-0003-auth-a94c0c0e
loop_iteration: 0
14 changes: 14 additions & 0 deletions .archcode/patches/pl-0001-auth-c61e8a96.patch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#{begin_meta: { content_hash: 9d283c7d8641, file: archcode_app/auth/__init__.py, marker_begin: # === ARCHCODE BEGIN pl_0001_auth_c61e8a96 __init__ ===, marker_end: # === ARCHCODE END pl_0001_auth_c61e8a96 __init__ ===, markers_auto: true, module: archcode_app, plan_line_id: pl-0001-auth-c61e8a96, role: function, status_agent_file_checker: pending, status_agent_module_checker: pending, timestamp: 2025-08-15T09:20:55 }}
# === ARCHCODE BEGIN pl_0001_auth_c61e8a96 __init__ ===
def init() -> None:
"""mARCHCode/ACW
Rôle: function
Acceptance (rappel):
- Gérer l'authentification (login, token)
NOTE: Implémentation minimale générée automatiquement.
Compléter la logique lors des itérations suivantes.
"""
# TODO: implémenter la logique métier
raise NotImplementedError("À implémenter par itération suivante")
# === ARCHCODE END pl_0001_auth_c61e8a96 __init__ ===
#{end_meta}
14 changes: 14 additions & 0 deletions .archcode/patches/pl-0002-auth-4100de5c.patch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#{begin_meta: { content_hash: 9084de6f7771, file: archcode_app/auth/handlers.py, marker_begin: # === ARCHCODE BEGIN pl_0002_auth_4100de5c handlers ===, marker_end: # === ARCHCODE END pl_0002_auth_4100de5c handlers ===, markers_auto: true, module: archcode_app, plan_line_id: pl-0002-auth-4100de5c, role: function, status_agent_file_checker: pending, status_agent_module_checker: pending, timestamp: 2025-08-15T09:20:55 }}
# === ARCHCODE BEGIN pl_0002_auth_4100de5c handlers ===
def handlers() -> None:
"""mARCHCode/ACW
Rôle: function
Acceptance (rappel):
- Gérer l'authentification (login, token)
NOTE: Implémentation minimale générée automatiquement.
Compléter la logique lors des itérations suivantes.
"""
# TODO: implémenter la logique métier
raise NotImplementedError("À implémenter par itération suivante")
# === ARCHCODE END pl_0002_auth_4100de5c handlers ===
#{end_meta}
14 changes: 14 additions & 0 deletions .archcode/patches/pl-0003-auth-a94c0c0e.patch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#{begin_meta: { content_hash: 81f51aca1b11, file: archcode_app/auth/models.py, marker_begin: # === ARCHCODE BEGIN pl_0003_auth_a94c0c0e models ===, marker_end: # === ARCHCODE END pl_0003_auth_a94c0c0e models ===, markers_auto: true, module: archcode_app, plan_line_id: pl-0003-auth-a94c0c0e, role: function, status_agent_file_checker: pending, status_agent_module_checker: pending, timestamp: 2025-08-15T09:20:55 }}
# === ARCHCODE BEGIN pl_0003_auth_a94c0c0e models ===
def models() -> None:
"""mARCHCode/ACW
Rôle: function
Acceptance (rappel):
- Gérer l'authentification (login, token)
NOTE: Implémentation minimale générée automatiquement.
Compléter la logique lors des itérations suivantes.
"""
# TODO: implémenter la logique métier
raise NotImplementedError("À implémenter par itération suivante")
# === ARCHCODE END pl_0003_auth_a94c0c0e models ===
#{end_meta}
36 changes: 36 additions & 0 deletions .archcode/plan_draft_aggregated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plan_draft_aggregated:
project_name: project
bus_message_id: BM-0001
spec_version_ref: v0.0.1
loop_iteration: 0
modules:
- auth
dependencies: []
folder_structure: {}
items:
- status: ok
source_path: C:\Users\Utilisateur\Documents\mARCHCode\modules\auth\module_draft.yaml
ingested_at: '2025-08-15T08:31:23'
module_draft:
module_name: auth
user_story_id: US-1
responsibilities:
- Gérer l'authentification (login, token)
files_expected:
- auth/__init__.py
- auth/handlers.py
- auth/models.py
depends_on: []
inputs: []
outputs: []
validator_status: ok
meta:
priority: haute
warnings: []
stats:
total_items: 1
validated: 1
pending: 0
rejected: 0
issued_at: '2025-08-15T08:31:23'
aggregated_at: '2025-08-15T08:31:23'
26 changes: 26 additions & 0 deletions .archcode/plan_validated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plan_validated:
plan_validated_id: PV-f4facffe
bus_message_id: BM-0001
spec_version_ref: v0.0.1
loop_iteration: 0
project_name: project
modules:
- module_name: auth
user_story_id: US-1
responsibilities:
- Gérer l'authentification (login, token)
inputs: []
outputs: []
files_expected:
- auth/__init__.py
- auth/handlers.py
- auth/models.py
depends_on: []
technical_constraints: []
meta:
priority: haute
meta:
comment_agent_plan_validator: ''
created_at: '2025-08-15T08:33:36'
validated_at: '2025-08-15T08:33:36'
plan_diffs: []
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ build/
*.tar.gz

!.archcode/context_snapshots/

cat >> .gitignore <<'EOF'
# Bytecode python
__pycache__/
*.py[cod]
*$py.class
EOF__pycache__/
*.py[cod]
*$py.class
Loading
Loading