feat: add fast forge work-record reconciliation
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
parent
a65cef02cf
commit
34f5cb3fc3
22 changed files with 799 additions and 162 deletions
38
api/schemas/work_record_projection.py
Normal file
38
api/schemas/work_record_projection.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import uuid
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
from api.schemas.task import TaskRead
|
||||
from api.schemas.workplan import WorkplanRead
|
||||
from api.schemas.workplan_dependency import WorkplanDependencyRead
|
||||
|
||||
|
||||
class RepositoryProjectionReconcile(BaseModel):
|
||||
expected_commit: str
|
||||
acknowledge_retirements: bool = False
|
||||
|
||||
@field_validator("expected_commit")
|
||||
@classmethod
|
||||
def validate_commit(cls, value: str) -> str:
|
||||
value = value.strip().lower()
|
||||
if not re.fullmatch(r"[0-9a-f]{40}", value):
|
||||
raise ValueError("expected_commit must be a full 40-character Git SHA")
|
||||
return value
|
||||
|
||||
|
||||
class RepositoryProjectionSnapshot(BaseModel):
|
||||
"""One bounded read of a repository's complete work-record projection."""
|
||||
|
||||
schema_version: Literal["state-hub.repository-projection-snapshot.v1"] = Field(
|
||||
validation_alias="schema",
|
||||
serialization_alias="schema",
|
||||
)
|
||||
repo_slug: str
|
||||
repo_id: uuid.UUID
|
||||
workplans: list[WorkplanRead]
|
||||
tasks: list[TaskRead]
|
||||
dependencies: list[WorkplanDependencyRead]
|
||||
Loading…
Add table
Add a link
Reference in a new issue