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
6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
- [ ] **`providers/local_models.py:103-119`** — `_query_installed_models` is `lru_cache`d indefinitely with no TTL; a newly pulled/removed Ollama model isn't picked up until something explicitly calls `clear_model_cache()`
- [ ] **`model_fine_tuner.py:122-137`** — `_check_gpu_availability()` is defined but never called; despite the module docstring claiming "Requires a CUDA GPU," `initialize_model()` silently proceeds on CPU instead of failing fast
- [ ] **`model_fine_tuner.py:220,240`** — `example['instruction']`/`example['output']` direct dict access with no `.get()`; a malformed training example raises `KeyError` surfaced only as a generic error string instead of a clear validation message
- [ ] **`models/code_archive.py:127-149`** — `__init__` manually re-implements every default already provided by `Field(default_factory=...)`, a drift hazard (two sources of truth for the same defaults)
- [x] **`models/code_archive.py:127-149`** — `__init__` manually re-implements every default already provided by `Field(default_factory=...)`, a drift hazard (two sources of truth for the same defaults)
- [x] **`evoseal/agents/agentic_system_example.py:7`** — `from evoseal.agentic_system import ...` is the wrong module path (actual: `evoseal.agents.agentic_system`); the example fails immediately with `ModuleNotFoundError`

### Documentation Polish
Expand Down Expand Up @@ -306,8 +306,8 @@
| 🔴 P0 | 11 | 11 | Original 5 complete; all 6 critical bugs from 2026-07-22 whole-repo review fixed (PRs #74, #76-#79) |
| 🟠 P1 | 24 | 14 | Original safety/integration items done; +12 high-priority bugs from 2026-07-22 review; signal-handler init fix; safety.yaml created |
| 🟡 P2 | 30 | 16 | Co-evolution loop gaps (7 items, 7 done) + existing P2 + 13 medium bugs from 2026-07-22 review + 4 latent collect->train bugs found closing the loop (1 fixed, 1 new HF-format gap logged) |
| 🟢 P3 | 24 | 12 | Makefile, pre-commit, Docker, ADRs, ADR refresh, CHANGELOG complete; +10 hygiene items from 2026-07-22 review |
| **Total** | **89** | **53** |
| 🟢 P3 | 24 | 13 | Makefile, pre-commit, Docker, ADRs, ADR refresh, CHANGELOG complete; +11 hygiene items from 2026-07-22 review |
| **Total** | **89** | **54** | |

> Update this table as you complete items. Recommended flow: P0 → P1 → P2 → P3.
>
Expand Down
35 changes: 12 additions & 23 deletions evoseal/models/code_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,18 @@ class CodeArchive(BaseModel):
validate_assignment=True,
)

def __init__(self, **data: Any) -> None:
"""Initialize the code archive with default values."""
# Set default values
if "id" not in data:
data["id"] = str(uuid4())
if "created_at" not in data:
data["created_at"] = datetime.now(UTC)
if "updated_at" not in data:
data["updated_at"] = data["created_at"]
if "version" not in data:
data["version"] = "1.0.0"
if "tags" not in data:
data["tags"] = []
if "visibility" not in data:
data["visibility"] = CodeVisibility.PRIVATE
if "is_archived" not in data:
data["is_archived"] = False
if "dependencies" not in data:
data["dependencies"] = []
if "metadata" not in data:
data["metadata"] = {}

super().__init__(**data)
def model_post_init(self, __context: Any) -> None:
"""Ensure updated_at mirrors created_at on first construction.

The old custom __init__ set ``updated_at = created_at`` when not
explicitly provided. With plain field defaults each factory calls
``datetime.now(UTC)`` independently, introducing a microsecond
drift. This hook restores the original guarantee — but only when
``updated_at`` was not explicitly set (e.g. on fresh programmatic
construction, not deserialization, which supplies the value).
"""
if "updated_at" not in self.model_fields_set:
self.updated_at = self.created_at

@field_validator("content")
@classmethod
Expand Down
Loading