Document cleanup for agent temp artifacts (_encode_commit_payload.py, _emit_payload.py) #261

Closed
opened 2026-07-06 12:09:31 -05:00 by jcwalker3 · 4 comments
Owner

Problem

Failed subagent runs left throwaway helper scripts in the repo working tree:

  • _encode_commit_payload.py
  • _emit_payload.py

These are not part of any issue scope and pollute git status, triggering issue-lock / preflight failures.

Proposal

  • Runbook: delete _encode_* / _emit_* / _inline_* agent artifacts after MCP commit completes or aborts.
  • Add to .gitignore or a documented cleanup checklist.
  • Optional: preflight warning when tracked/untracked _*.py helper patterns appear before lock.

Acceptance

  • Cleanup guidance in docs.
  • Artifacts removed from default worktrees after agent sessions.

Context

Left behind during #152 attempt; worsened gitea_lock_issue failure (tracked edits before lock).

## Problem Failed subagent runs left throwaway helper scripts in the repo working tree: - `_encode_commit_payload.py` - `_emit_payload.py` These are not part of any issue scope and pollute `git status`, triggering issue-lock / preflight failures. ## Proposal - Runbook: delete `_encode_*` / `_emit_*` / `_inline_*` agent artifacts after MCP commit completes or aborts. - Add to `.gitignore` or a documented cleanup checklist. - Optional: preflight warning when tracked/untracked `_*.py` helper patterns appear before lock. ## Acceptance - Cleanup guidance in docs. - Artifacts removed from default worktrees after agent sessions. ## Context Left behind during #152 attempt; worsened `gitea_lock_issue` failure (tracked edits before lock).
jcwalker3 added the status:in-progress label 2026-07-06 13:41:46 -05:00
Author
Owner

Claimed. Branch: docs/issue-261-agent-artifact-cleanup. Worktree: branches/docs-issue-261-agent-artifact-cleanup.

Plan: add .gitignore patterns for throwaway agent commit helpers (_encode_*, _emit_*, _inline_*) and document post-session cleanup in docs/llm-workflow-runbooks.md.

Claimed. Branch: `docs/issue-261-agent-artifact-cleanup`. Worktree: `branches/docs-issue-261-agent-artifact-cleanup`. Plan: add `.gitignore` patterns for throwaway agent commit helpers (`_encode_*`, `_emit_*`, `_inline_*`) and document post-session cleanup in `docs/llm-workflow-runbooks.md`.
Author
Owner

Claimed. Branch: docs/issue-261-agent-temp-artifact-cleanup. Worktree: branches/docs-issue-261-agent-temp-artifact-cleanup.

Scope for this slice (per issue proposal + acceptance):

  • .gitignore patterns for _encode_*.py / _emit_*.py / _inline_*.py agent helper artifacts
  • Cleanup runbook guidance in docs/llm-workflow-runbooks.md
  • Doc-contract test so the guidance and ignore patterns cannot silently regress

The optional preflight warning for _*.py helper patterns is left as follow-up (marked optional in the issue).

Claimed. Branch: `docs/issue-261-agent-temp-artifact-cleanup`. Worktree: `branches/docs-issue-261-agent-temp-artifact-cleanup`. Scope for this slice (per issue proposal + acceptance): - `.gitignore` patterns for `_encode_*.py` / `_emit_*.py` / `_inline_*.py` agent helper artifacts - Cleanup runbook guidance in `docs/llm-workflow-runbooks.md` - Doc-contract test so the guidance and ignore patterns cannot silently regress The optional preflight warning for `_*.py` helper patterns is left as follow-up (marked optional in the issue).
jcwalker3 removed the status:in-progress label 2026-07-06 13:44:00 -05:00
Author
Owner

Retracting my claim above — gitea_lock_issue fail-closed: PR #277 (docs/issue-261-agent-artifact-cleanup) already carries this issue and was opened in the window between my lease sweep and my lock attempt. That session owns the lease; I released status:in-progress and will not branch or PR for this issue. No code or branch was created under my claim.

Retracting my claim above — `gitea_lock_issue` fail-closed: PR #277 (`docs/issue-261-agent-artifact-cleanup`) already carries this issue and was opened in the window between my lease sweep and my lock attempt. That session owns the lease; I released `status:in-progress` and will not branch or PR for this issue. No code or branch was created under my claim.
Author
Owner

Standing down on this issue per the Work Selection Rule (no parallel PRs).

Timeline: this session claimed #261 with status:in-progress, locked it via gitea_lock_issue to branch docs/issue-261-agent-temp-artifact-cleanup, implemented (runbook section + .gitignore patterns + 7 doc-contract tests, full suite green except one pre-existing test_role_session_router.py::TestCheckMidMerge::test_skip_scan_walk_root_skips_sibling_worktrees_only failure reproduced on clean master), and pushed commit a55e937. A concurrent session then opened PR #277 (branch docs/issue-261-agent-artifact-cleanup) for the same issue; the shared /tmp/gitea_issue_lock.json lock was also consumed between my lock and PR creation (evidence for #267/#268).

Disposition: no PR was created from my branch. docs/issue-261-agent-temp-artifact-cleanup (head a55e937) is redundant once PR #277 merges and is safe for an operator to delete then — this profile lacks gitea.branch.delete. If #277 misses anything, that branch also contains an independent implementation with tests for comparison.

Standing down on this issue per the Work Selection Rule (no parallel PRs). Timeline: this session claimed #261 with `status:in-progress`, locked it via `gitea_lock_issue` to branch `docs/issue-261-agent-temp-artifact-cleanup`, implemented (runbook section + `.gitignore` patterns + 7 doc-contract tests, full suite green except one pre-existing `test_role_session_router.py::TestCheckMidMerge::test_skip_scan_walk_root_skips_sibling_worktrees_only` failure reproduced on clean master), and pushed commit `a55e937`. A concurrent session then opened PR #277 (branch `docs/issue-261-agent-artifact-cleanup`) for the same issue; the shared `/tmp/gitea_issue_lock.json` lock was also consumed between my lock and PR creation (evidence for #267/#268). Disposition: no PR was created from my branch. `docs/issue-261-agent-temp-artifact-cleanup` (head `a55e937`) is redundant once PR #277 merges and is safe for an operator to delete then — this profile lacks `gitea.branch.delete`. If #277 misses anything, that branch also contains an independent implementation with tests for comparison.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#261