Skip to content

Commit 2b64c55

Browse files
committed
fix(procs): merge legacy logs into an existing procs/logs directory
The one-shot `~/.sase/tasks` -> `~/.sase/procs` migration only relocated the legacy logs directory when `procs/logs` did not exist yet. A home that had already written canonical proc logs kept its legacy files at the old path even though every migrated row's `log_path` was rewritten to point under `procs/logs`, so those logs read as missing. `_relocate_legacy_logs` now merges entry by entry when the destination already exists, letting an already-canonical log win a name collision so a live writer's open file is never overwritten. The legacy directory is symlinked to the canonical one only once it is empty; when collisions remain, the migration warns and leaves the real directory reachable instead of hiding the leftovers behind a symlink to their canonical namesakes. This fixes future migrations only. The migration marker is one-shot, so homes already migrated by the shipped version still need a repair pass, which is recorded as a follow-up on sase-lh.8. Also finishes the terminology sweep from the proc rename: ACE handlers, actions, modals, artifact widgets, the session registry and display helpers, the quit-confirm and procs-pane stylesheet comments, and the affected tests now say "proc" rather than "background task" in docstrings, comments, and rendered text. SASE_BEAD=[sase-lh.8][1] SASE_TYPE=stitch SASE_AGENT=[bbugyi200.athena.sase-lh.land][2] [1]: https://github.com/sase-org/sase--beads/blob/main/pages/sase-lh/sase-lh.8.md [2]: https://github.com/sase-org/sase--agents/blob/main/families/bbugyi200.athena.sase-lh.land.md
1 parent 800033d commit 2b64c55

30 files changed

Lines changed: 150 additions & 61 deletions

src/sase/ace/handlers/mail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def mail_execute_task(
5454
workspace_dir: str,
5555
workspace_num: int,
5656
) -> tuple[bool, str]:
57-
"""Non-interactive: execute_mail + status transition. Runs as background task.
57+
"""Non-interactive: execute_mail + status transition. Runs as a proc.
5858
5959
Releases workspace in finally block.
6060

src/sase/ace/handlers/reword.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _sync_description_bg(workspace_dir: str, file_path: str, name: str) -> None:
2828
2929
Runs ``get_description`` to get the clean description from the commit
3030
message and writes it back to the ``.gp`` file. Uses ``print()`` instead
31-
of Rich console since this runs in a background task with captured stdout.
31+
of Rich console since this runs in a proc with captured stdout.
3232
3333
Args:
3434
workspace_dir: Path to the workspace directory.
@@ -190,7 +190,7 @@ def add_tag_task(
190190
tag_name: str,
191191
tag_value: str,
192192
) -> tuple[bool, str]:
193-
"""Execute add-tag as a background task.
193+
"""Execute add-tag as a proc.
194194
195195
Claims a workspace, checks out the Patch, runs sase_hg_reword --add-tag,
196196
and releases the workspace in a finally block.
@@ -319,7 +319,7 @@ def reword_execute_task(
319319
project_basename: str,
320320
edited_description: str,
321321
) -> tuple[bool, str]:
322-
"""Non-interactive: claim workspace, checkout Patch branch, apply reword. Background task.
322+
"""Non-interactive: claim workspace, checkout Patch branch, apply reword. Runs as a proc.
323323
324324
Claims a workspace, checks out the Patch, runs the reword with the edited
325325
description, syncs the description back to the project file, and releases

src/sase/ace/tui/actions/agents/_dismissing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _submit_bulk_dismiss_persistence_task(
199199
added: set[AgentIdentity] | None = None,
200200
recent_group: SavedAgentGroupWire | None = None,
201201
) -> None:
202-
"""Submit a batch dismissal's persistence as a tracked background task."""
202+
"""Submit a batch dismissal's persistence as a tracked proc."""
203203
identities = {a.identity for a in agents}
204204
if identities & self._dismiss_persistence_inflight:
205205
return
@@ -329,7 +329,7 @@ def _submit_dismiss_persistence_task(
329329
added: set[AgentIdentity] | None = None,
330330
recent_group: SavedAgentGroupWire | None = None,
331331
) -> None:
332-
"""Submit single-agent dismiss persistence as a tracked background task."""
332+
"""Submit single-agent dismiss persistence as a tracked proc."""
333333
identity = agent.identity
334334
if identity in self._dismiss_persistence_inflight:
335335
return

src/sase/ace/tui/actions/agents/_marking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _submit_marked_group_save_persistence_task(
187187
group: SavedAgentGroupWire,
188188
group_name: str | None = None,
189189
) -> None:
190-
"""Submit marked-group save persistence as a tracked background task."""
190+
"""Submit marked-group save persistence as a tracked proc."""
191191
identities = {agent.identity for agent in agents}
192192
if identities & self._dismiss_persistence_inflight:
193193
return

src/sase/ace/tui/actions/agents/_monitor_stop_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def on_dismiss(confirmed: bool | None) -> None:
4040
)
4141

4242
def _do_stop_monitor(self, agent: Agent) -> None:
43-
"""Submit the blocking monitor stop as a tracked background task."""
43+
"""Submit the blocking monitor stop as a tracked proc."""
4444
artifacts_dir = agent.get_artifacts_dir()
4545
monitor_label = agent.monitor_label or agent.monitor_command or "monitor"
4646
if artifacts_dir is None or not agent.project_file:

src/sase/ace/tui/actions/agents/_notification_gate_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def submit_gate_execution_task(
4949
notification: Notification,
5050
submission: GateSubmission,
5151
) -> bool:
52-
"""Execute a neutral gate through ACE's tracked background task queue."""
52+
"""Execute a neutral gate through ACE's tracked proc queue."""
5353
bundle_value = notification.action_data.get("bundle_path")
5454
if not bundle_value:
5555
app.notify("No neutral gate bundle in notification", severity="error") # type: ignore[attr-defined]

src/sase/ace/tui/actions/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def action_reword(self) -> None:
213213
if edited_description is None:
214214
return
215215

216-
# Non-interactive phase: submit reword as background task
216+
# Non-interactive phase: submit reword as a proc
217217
cl_name = patch.name
218218
display_cl_name = humanize_cl_name(cl_name)
219219
project_file = patch.file_path
@@ -244,7 +244,7 @@ def action_add_tag(self) -> None:
244244
This action:
245245
1. Validates PR is set and STATUS is editable
246246
2. Shows TagInputModal for tag name/value input
247-
3. Submits background task that claims workspace, checks out Patch branch, adds tag
247+
3. Submits a proc that claims workspace, checks out Patch branch, adds tag
248248
4. Shows toast notifications for start/completion/failure
249249
"""
250250
# On agents tab, dispatch to wait-for action
@@ -322,7 +322,7 @@ def action_mail(self) -> None:
322322
1. Validates STATUS is "Ready"
323323
2. Claims workspace and gets workspace directory
324324
3. Runs interactive prepare_mail in suspend() (y/n prompt)
325-
4. If confirmed, submits execute_mail + status transition as background task
325+
4. If confirmed, submits execute_mail + status transition as a proc
326326
5. Shows toast notifications for start/completion/failure
327327
"""
328328
import os
@@ -385,8 +385,8 @@ def action_mail(self) -> None:
385385
release_workspace(project_file, workspace_num, "mail", cl_name)
386386
return
387387

388-
# Non-interactive phase: submit execute_mail as background task
389-
# The background task owns the workspace from here and releases in finally
388+
# Non-interactive phase: submit execute_mail as a proc
389+
# The proc owns the workspace from here and releases in finally
390390
def proc_callable() -> tuple[bool, str]:
391391
return mail_execute_task(patch, workspace_dir, workspace_num)
392392

src/sase/ace/tui/actions/hints/_accept.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _process_accept_input(self, user_input: str) -> None:
9595

9696
# Run the accept workflow (with mark_ready_to_mail flag if @ suffix was used).
9797
# When should_mail is True, _run_accept_workflow sets up an on_success
98-
# callback that triggers action_mail() after the background task completes.
98+
# callback that triggers action_mail() after the proc completes.
9999
self._run_accept_workflow( # type: ignore[attr-defined]
100100
patch,
101101
entries,

src/sase/ace/tui/actions/hints/_rewind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _rewind_task(
1717
selected_entry_num: int,
1818
skip_vcs: bool = False,
1919
) -> tuple[bool, str]:
20-
"""Execute rewind workflow as a background task.
20+
"""Execute rewind workflow as a proc.
2121
2222
Returns:
2323
Tuple of (success, message).

src/sase/ace/tui/actions/lifecycle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ def _restore_last_selection(self, last_name: str | None = None) -> None:
192192
return
193193

194194
def _count_running_tasks(self) -> int:
195-
"""Return the count of running background tasks."""
195+
"""Return the count of running procs."""
196196
return self._proc_queue.running_count # type: ignore[attr-defined]
197197

198198
def _kill_all_running_tasks(self) -> None:
199-
"""Kill all running background tasks."""
199+
"""Kill all running procs."""
200200
for task in self._proc_queue.get_all(): # type: ignore[attr-defined]
201201
if task.status == "running":
202202
self._kill_proc(task.proc_id) # type: ignore[attr-defined]

0 commit comments

Comments
 (0)