overwrite_policy
tit.server.overwrite_policy ¶
Project overwrite permission at HTTP submission boundaries.
planned_outputs ¶
planned_outputs(kind: str, config: dict[str, Any], subject_ids: list[str], *, overwrite: bool = False) -> list[Any]
The run receipt's jobs (PlanJob) for one submission, or [] for a kind it skips.
Uses the same filesystem-backed output resolution as the run receipt
(:func:tit.server.routes.plan.plan), which refuses an output outside the project (422).
Source code in tit/server/overwrite_policy.py
refuse_unconfirmed_overwrite ¶
Without explicit confirmation, refuse (409) replacing an output that already exists.
Flags alone do not imply data loss: a first run remains valid even if its config permits replacement.
Source code in tit/server/overwrite_policy.py
refuse_outputs_of_active_jobs ¶
refuse_outputs_of_active_jobs(manager: Any, planned: list[tuple[str, dict[str, Any], list[Any]]]) -> None
HTTP 422 when a (kind, config, plan jobs) of planned writes a folder a queued or
running job will write.
The overwrite check reads the disk, where a queued job has written nothing yet, and only the simulator honours the overwrite flag, so a second job into one folder (a double-pressed Run, a re-pressed search) replaced the first's results. No overwrite answer makes that safe, so this is a 422, not the 409 question.
Source code in tit/server/overwrite_policy.py
check_overwrite_permission ¶
check_overwrite_permission(kind: str, config: dict[str, Any], subject_ids: list[str], *, overwrite: bool = False, manager: Any = None) -> None
Reject outputs outside the project or planned by one of manager's queued or running jobs (422) and, without explicit confirmation, the replacement of existing ones (409). Without a manager there is no queue to consult and only the disk is checked.