← Về thư mục
openai4s/storage/plans.py
- PlanRepository · class · L23-L266 — class PlanRepository
- init · method · L31-L40 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], ) -> None
- normalize_row · method · L43-L55 — def normalize_row(row: Any) -> dict
- create · method · L57-L104 — def create( self, *, frame_id: str, project_id: str = "default", title: str | None, rationale: str | None, confidence: str | None, steps: list[dict], artifact_id: str | None = None, status: str = "draft", ) -> dict: # The enum is enforced here too, not only in
update. It was not, # and the asymmetry mattered because of who calls this: session import # passes the status straight out of an uploaded package # (server/session_package.py), so any string in a user-supplied ZIP # landed in the column. A plan row reading "not-a-status" is not # cosmetic -- get_by_frame prefers the newest non-discarded plan, so # it shadows every new draft for that session forever, the UI's status # switch falls through to an empty card, and the orphan sweep does not # match it either.
- get · method · L106-L111 — def get(self, plan_id: str) -> dict | None
- get_by_frame · method · L113-L127 — def get_by_frame(self, frame_id: str) -> dict | None
- list_for_frame · method · L129-L136 — def list_for_frame(self, frame_id: str, *, limit: int = 50) -> list[dict]
- update · method · L138-L187 — def update( self, plan_id: str, *, title: str | None = None, rationale: str | None = None, confidence: str | None = None, steps: list[dict] | None = None, status: str | None = None, step_status: dict | None = None, artifact_id: str | None = None, ) -> None
- add · function · L153-L157 — def add(column: str, value: Any, *, as_json: bool = False) -> None
- compare_and_set_status · method · L189-L215 — def compare_and_set_status( self, plan_id: str, *, expected: str, new_status: str ) -> bool
- pause_orphaned_executing · method · L217-L238 — def pause_orphaned_executing(self) -> int
- set_step_status · method · L240-L258 — def set_step_status( self, plan_id: str, step_id: str, status: str, note: str | None = None, ) -> dict | None
- delete_for_frame · method · L260-L261 — def delete_for_frame(self, frame_id: str) -> None
- _execute · method · L263-L266 — def _execute(self, sql: str, params: tuple = ()) -> None