Skip to content

Porch: preserve project status.yaml on cleanup — commit to main at pr-ready gate #532

Closed

Description

@waleedkadous

Problem

af cleanup calls cleanupPorchState() which deletes codev/projects/<id>-*/ entirely, including status.yaml. This destroys all project completion data (protocol, wall clock time, gate timestamps, phase history).

This means analytics can only see projects that haven't been cleaned up yet. All completed and cleaned-up projects lose their status.yaml forever.

Impact

  • Analytics "Projects by Protocol" breakdown shows incomplete data
  • Wall clock time (started_at → updated_at) is lost for completed projects
  • Gate timestamps (spec-approval, plan-approval, pr-ready) are lost
  • No historical record of completed projects

Expected Behavior

At the pr-ready gate (or on project completion), porch should commit the final status.yaml to the main branch so it persists after cleanup.

Options (pick one):

  1. Commit status.yaml at pr-ready gate: Builder commits codev/projects/<id>/status.yaml to its PR branch → gets merged to main → survives cleanup
  2. Copy to archive before cleanup: af cleanup copies status.yaml to codev/projects/.archive/<id>/status.yaml before deleting
  3. Don't delete on cleanup: Change cleanupPorchState to preserve the directory (only delete if --force)

Option 1 is preferred — the data lands on main via the normal PR merge flow.

Acceptance Criteria

  • Completed project status.yaml files survive af cleanup
  • Historical data available for analytics (protocol, timing, gates)
  • No regression in cleanup behavior for worktrees/branches

Activity

  1. added
    bug
    on Feb 23, 2026
  2. waleedkadous commented on Feb 23, 2026

    @waleedkadous
    ContributorAuthor

    Additional Requirement: Post completion stats as issue comment

    When a project completes (pr-ready gate or merge), porch should post a completion summary comment on the GitHub issue with stats from status.yaml:

    ## Project Completion Stats
    
    - **Protocol**: bugfix
    - **Wall clock time**: 26 minutes (started 2026-02-21T17:42 → completed 2026-02-21T18:09)
    - **Gates**: spec-approval (17:43), plan-approval (17:55), pr-ready (18:09)
    - **Iterations**: 1
    - **Plan phases**: 3/3 complete
    
    ---
    *Posted by porch on project completion*
    

    This ensures the data survives cleanup permanently — GitHub issues are the canonical record. The status.yaml should ALSO be committed to the PR (so analytics can scan it), but the issue comment is the human-readable summary.

  3. waleedkadous commented on Feb 23, 2026

    @waleedkadous
    ContributorAuthor

    Data Capture Convention

    Bugs → Post completion statistics as a comment on the GitHub Issue when the bug is resolved.

    Projects (SPIR/ASPIR/TICK) → Capture everything in status.yaml, which gets committed to main at the pr-ready gate.

    This convention should be documented in the relevant protocol docs so builders and porch follow it consistently.

  4. waleedkadous commented on Feb 23, 2026

    @waleedkadous
    ContributorAuthor

    On it! Working on a fix now.

  5. added 2 commits that reference this issue on Feb 23, 2026
  6. added a commit that references this issue on Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions