Skip to content

Add soft-delete for service variants#546

Open
jackfreem wants to merge 4 commits intocashapp:masterfrom
jackfreem:jackf/delete-service-variant-ui
Open

Add soft-delete for service variants#546
jackfreem wants to merge 4 commits intocashapp:masterfrom
jackfreem:jackf/delete-service-variant-ui

Conversation

@jackfreem
Copy link
Copy Markdown

@jackfreem jackfreem commented Mar 11, 2026

Problem

Backfila supports service variants (e.g. customermappings/playpen-jackf, customermappings/playpen-<ldap>) but there was no way to delete them once created. Stale playpen variants accumulate over time with no way to clean them up through the UI or API.
Screenshot 2026-03-12 at 10 13 50 AM

Solution

Adds soft-delete support for service variants. A deleted variant is hidden from all listings and detail views, and can be re-registered fresh if needed.

Changes

Database

  • Adds deleted_at TIMESTAMP(3) NULL column to the services table (v024__backfila.sql)
  • Adds softDelete(clock) method to DbService
  • Adds ServiceQuery.notDeleted() constraint using IS_NULL on deleted_at

Backend

  • New DeleteServiceVariantAction: POST /services/{service}/variants/{variant}/delete
    • Requires users capability
    • Guards against deleting a variant that has running backfills
    • Returns 400 if the variant doesn't exist or is already deleted
  • Filters deleted variants from GetServicesAction, GetServiceVariantsAction, and GetServiceDetailsAction
  • Updates ConfigureServiceAction to skip deleted variants in its lookup, so re-registering a deleted variant creates a fresh row

UI

  • Adds a "Danger Zone" section to the service info page (/services/{service}/{variant}/info) with a "Delete Variant" button and a confirmation dialog

Design decisions

  • Soft delete only — preserves historical backfill run data that references the service_id FK, consistent with how backfill run deletion works
  • Re-registration creates a fresh row — deleted variants are excluded from the ConfigureServiceAction upsert lookup, so calling configure_service after deletion starts clean
  • Block deletion if running backfills exist — prevents orphaning active work

Testing

Added DeleteServiceVariantActionTest covering:

  • Happy path deletion
  • Deleted variant not appearing in services/variants listings
  • 400 on non-existent or already-deleted variant
  • 400 when running backfills exist
  • Re-registration after deletion creates a fresh row

Once the migration is run, I'll be able to test the remaining parts of this.

- Add DeleteServiceVariantAction: POST /services/{service}/variants/{variant}/delete
  Guards against deleting variants with running backfills
- Register DeleteServiceVariantAction in BackfilaWebActionsModule
- Filter deleted variants from GetServicesAction, GetServiceVariantsAction,
  GetServiceDetailsAction, and ConfigureServiceAction (so re-registration
  of a deleted variant creates a fresh row)
- Add DeleteServiceVariantActionTest covering happy path, error cases,
  running backfill guard, and re-registration behavior
Adds a "Danger Zone" section to the ServiceInfoAction page with a delete
button that POSTs to DeleteServiceVariantAction with a confirmation dialog.
mpawliszyn added a commit to mpawliszyn/fowlcon that referenced this pull request Mar 15, 2026
- docs/versions.md: Public version roadmap (V1 through V1.1 + future ideas).
  V1.001 (agent optimization) and V1.002 (non-agent fixes) are parallel
  workstreams after the rough V1 ships.

- docs/v1/2026-03-15-v1-implementation-plan.md: Implementation plan for
  rough V1. Full pipeline (analysis + walkthrough) with complete prompt
  content for all 6 agent/command files. 9 tasks across 4 chunks.
  Test against cashapp/backfila#546.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>
mpawliszyn added a commit to mpawliszyn/fowlcon that referenced this pull request Mar 15, 2026
* docs: add V1 implementation plan and version roadmap

- docs/versions.md: Public version roadmap (V1 through V1.1 + future ideas).
  V1.001 (agent optimization) and V1.002 (non-agent fixes) are parallel
  workstreams after the rough V1 ships.

- docs/v1/2026-03-15-v1-implementation-plan.md: Implementation plan for
  rough V1. Full pipeline (analysis + walkthrough) with complete prompt
  content for all 6 agent/command files. 9 tasks across 4 chunks.
  Test against cashapp/backfila#546.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* docs: use formal name in plugin manifest, add attribution review to V1.002

- plugin.json author: "Michael Pawliszyn" (not "Mike")
- V1.002 task: review whether attribution should be Block Inc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* docs: address plan review gaps and add V1.002 tasks

Plan fixes:
- Clarify Agent is the correct tool name (not Task from older docs)
- Note commands inherit all tools (no tools: field needed in orchestrator)
- Note analysis.md deferred from rough V1
- Add concrete plugin verification steps referencing superpowers pattern
- Specify README replacement text
- Clarify coverage-checker scope vs check-tree-quality.sh

V1.002 additions:
- Distribution polish and install docs
- README installation instructions
- analysis.md implementation
- Reconcile coverage-checker vs script scope

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

---------

Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
mpawliszyn added a commit to mpawliszyn/fowlcon that referenced this pull request Mar 15, 2026
…#3)

* docs: add V1 implementation plan and version roadmap

- docs/versions.md: Public version roadmap (V1 through V1.1 + future ideas).
  V1.001 (agent optimization) and V1.002 (non-agent fixes) are parallel
  workstreams after the rough V1 ships.

- docs/v1/2026-03-15-v1-implementation-plan.md: Implementation plan for
  rough V1. Full pipeline (analysis + walkthrough) with complete prompt
  content for all 6 agent/command files. 9 tasks across 4 chunks.
  Test against cashapp/backfila#546.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* docs: use formal name in plugin manifest, add attribution review to V1.002

- plugin.json author: "Michael Pawliszyn" (not "Mike")
- V1.002 task: review whether attribution should be Block Inc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* docs: address plan review gaps and add V1.002 tasks

Plan fixes:
- Clarify Agent is the correct tool name (not Task from older docs)
- Note commands inherit all tools (no tools: field needed in orchestrator)
- Note analysis.md deferred from rough V1
- Add concrete plugin verification steps referencing superpowers pattern
- Specify README replacement text
- Clarify coverage-checker scope vs check-tree-quality.sh

V1.002 additions:
- Distribution polish and install docs
- README installation instructions
- analysis.md implementation
- Reconcile coverage-checker vs script scope

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add codebase-locator agent prompt

Finds WHERE relevant files are. Tools restricted to Grep/Glob/LS —
cannot read file contents, enforcing 'find, don't analyze' role.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add codebase-analyzer agent prompt

Explains HOW code works. Has Read access for content analysis.
Reports connections (imports, callers, interfaces, tests) for
concept-researcher to synthesize into change boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add codebase-pattern-finder agent prompt

Shows EXAMPLES of repeated patterns. Reports 2-3 detailed examples,
total count, all instance locations, and variations. Key agent for
collapsing mechanical changes into variation nodes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add concept-researcher agent prompt

Coordinates worker agents (locator, analyzer, pattern-finder) and
synthesizes findings into structured concept descriptions. Targets
1,000-2,000 token output. Handles worker failures via supervisor mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add coverage-checker agent prompt

Verifies every changed file maps to a tree node. Haiku model for
cost efficiency. Reports gaps and structural issues without fixing them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add orchestrator command prompt

Full review pipeline: analysis (concept decomposition, researcher
dispatch, tree building, coverage check) and interactive walkthrough
(depth-first traversal, reviewer decisions, state management).

Best-effort V1 prompt. Q7 (tone) and Q8 (change boundary) are
starting points — will be revisited in V1.001 with eval data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* feat: add Claude Code plugin manifest

Packages Fowlcon as a Claude Code plugin. Agents and commands
auto-discovered from existing directory structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* docs: update README for V1 release

Status section reflects V1 rough beta availability with full
analysis and walkthrough pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

* chore: remove .gitkeep files from agents/ and commands/

Directories now contain real agent prompts and the orchestrator
command, so placeholder files are no longer needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>

---------

Signed-off-by: Michael Pawliszyn <mpawliszyn@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant