httk.workflow.hygiene¶
Describe and repair a project, its remotes, and its workspace.
Everything here answers an operator question about state that already exists:
what is this project, what is this remote configured to do, what is wrong
with this project and can it be fixed. Nothing here is on the execution path of
a job, and every repair is explicit — project_doctor() reports by default
and only changes something when it is asked to.
Attributes¶
Classes¶
Describe one thing the doctor looked at and what it found. |
Functions¶
|
Describe one project: its metadata, its keys, its workspace, its manifest. |
|
Describe one remote: where it lives, what it is, how it is configured. |
|
Remove one remote bundle, refusing while a transfer still needs it. |
|
Check one project for the conditions that quietly break it later. |
Module Contents¶
- httk.workflow.hygiene.describe_project(project_root=None, *, verify=True)[source]¶
Describe one project: its metadata, its keys, its workspace, its manifest.
verify walks the tree to classify the manifest, which is what makes the description say whether the project is currently described by what it signed; by design, pass
Falsefor a cheap answer when verification is not required, because that skips the tree walk.
- httk.workflow.hygiene.describe_remote(name, *, project=None)[source]¶
Describe one remote: where it lives, what it is, how it is configured.
Credential values never appear. A remote’s settings are reported with the file each one came from, and for a setting stored in the manifest-excluded
credentials.jsononly its name is reported: a description an operator can paste into a bug report must never carry a password.- Parameters:
name (str) – Remote bundle name.
project (str | os.PathLike[str] | None) – Project directory used for project-local lookup.
- Returns:
JSON-compatible remote description.
- Raises:
ValueError – If the remote name is invalid or unknown.
- Return type:
- httk.workflow.hygiene.remove_remote(name, *, project=None)[source]¶
Remove one remote bundle, refusing while a transfer still needs it.
A sealed bundle that has not been acknowledged is work this remote still owes an answer about, and the adapter is how that answer is fetched. Removing the remote would leave the transfer with no way home, so it is refused by name — retire or fetch the transfer first.
- Parameters:
name (str) – Remote bundle name.
project (str | os.PathLike[str] | None) – Project directory used for project-local lookup.
- Returns:
JSON-compatible removal result.
- Raises:
ValueError – If the remote is invalid, unknown, or still has transfers.
- Return type:
- class httk.workflow.hygiene.Finding[source]¶
Describe one thing the doctor looked at and what it found.
- Parameters:
check – Check name.
status – Check result status.
message – Human-readable result.
repairable – Whether the finding can be repaired automatically.
repaired – Whether this run repaired the finding.
action – Repair action, when one was taken.
details – Structured result details.
- httk.workflow.hygiene.project_doctor(project_root=None, *, repair=False)[source]¶
Check one project for the conditions that quietly break it later.
Every check reports; a check that can be fixed automatically is fixed only when repair is asked for, and a run that repaired anything says exactly what it did — in the log and, when the project has a workspace, in that workspace’s journal, so the repair is part of its durable history.