Skip to content

Add owner-directed archive removal and durable exclusions - #217

Closed
hannesrudolph wants to merge 17 commits into
mainfrom
feat/owner-directed-thread-exclusions
Closed

hannesrudolph wants to merge 17 commits into
mainfrom
feat/owner-directed-thread-exclusions

Conversation

@hannesrudolph

@hannesrudolph hannesrudolph commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Local hiding leaves conversation bodies, revisions and retry work in an archive. Add an explicit purge-threads plan/apply command that atomically removes an exact owner-selected set and persists exclusions respected by normal collection. Owner removal is reported separately from provider deletion or successful recovery; core coverage remains independent.

The command preserves shared actors, rejects unsafe native ID reuse, and refuses blob-backed targets, retained workflow dependencies and shared cluster state, and supports an existing managed portable mirror through its current ownership lock and local-write preservation policy. Failed mirror applies retain the original bytes and refresh eligibility. Local exclusion metadata cannot be published through portable export.

The exclusion namespace follows the explicit collector target; changing that target requires carrying its policy. Repository rename/transfer migration is outside this command.

Stacked on #216. No merge requested; GitHub Actions are unchanged.

Validation:

  • Full make test-coverage: 85.2%, with the unchanged 85% gate.
  • make tidy-check fmt lint smoke test-release docs snapshot.
  • Repeated race checks covering exact removal, rollback, exclusion enforcement, shared evidence, native key reuse, case variants, mirror refresh preservation and cancellation receipt errors.

Exact pushed head 6c9c1bea7d094397dcdfecfb50e693460592a5aa passed Linux/macOS Go coverage, Windows portable filesystem, Docs, Docker and secret-scanning checks. Signed local activation and two advancing ordinary core checkpoints passed; owner exclusions remain distinct from review-provider completeness.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 29, 2026, 11:09 PM ET / September 30, 2026, 03:09 UTC (Revision 5).

ClawSweeper review

What this changes

Adds a purge-threads plan/apply command that removes selected GitHub conversations from a local archive, records durable exclusions, and prevents their recollection or portable publication.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this draft open. Current main contains the merged analytics base from #216, but not the owner-directed purge command. A source-proven archive-loss defect still blocks this branch.

Priority: P0
Reviewed head: 6c9c1bea7d094397dcdfecfb50e693460592a5aa

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused purge coverage provides useful signal, but the source-proven archive-loss path makes the patch unready.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The member-authored PR is exempt from the contributor runtime-proof gate. Its body reports signed local activation and advancing core checkpoints, while the visible version 15 migration test does not establish upgrade compatibility from the version 13 archive in v0.13.0.
Patch quality 🧂 unranked krab (1/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from the contributor runtime-proof gate. Its body reports signed local activation and advancing core checkpoints, while the visible version 15 migration test does not establish upgrade compatibility from the version 13 archive in v0.13.0.
Evidence reviewed 9 items Introduced export guard: The PR adds a rejection when the archive contains any owner exclusion. This is the introduced trigger for the retained P1 finding.
Destructive handoff order: Portable export consumes the source at line 197, then calls the new rejection through PrunePortablePayloads at line 250.
Failure cleanup: An export error before artifact commit removes the staging directory that holds the consumed source.
Findings 1 actionable finding [P1] Preflight exclusions before consuming the archive
Security None None.

How this fits together

Gitcrawl collects GitHub conversations into a local SQLite archive. The new command changes that archive and its collection policy; portable export later reads the same database to create a publishable snapshot.

flowchart LR
A[Owner selects conversations] --> B[Purge plan and apply]
B --> C[Local archive and exclusions]
D[GitHub conversations] --> E[Collector checks exclusions]
E --> C
C --> F[Portable export checks policy]
F --> G[Snapshot or refusal]
Loading

Before merge

  • Preflight exclusions before consuming the archive (P1) - The new rejection runs during pruning, after --consume-source has renamed the active database into export staging. Export then deletes staging on this error, leaving neither the active archive nor an artifact. Check under the source ownership lock before the rename and add a regression that verifies source preservation. This remains unresolved from the prior review.
  • Resolve merge risk (P1) - With a local exclusion present, an existing --consume-source export can remove the active archive and then fail without producing an artifact.
  • Resolve merge risk (P1) - The new persisted schema has an additive version 15 test, but upgrade compatibility from the schema 13 archive shipped in v0.13.0 is not yet demonstrated.
  • Complete next step (P2) - Preflight exclusions under the consume-source lock before moving the archive, add source-preservation coverage and released-schema upgrade proof, then refresh the draft against the merged analytics base.
  • Improve patch quality - Add a consume-source regression that starts with an excluded archive and verifies refusal preserves its exact source bytes.
  • Improve patch quality - Demonstrate that a v0.13.0 schema 13 archive upgrades to the new schema without losing retained data.

Findings

  • [P1] Preflight exclusions before consuming the archive — internal/store/portable.go:104-105
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Pinned code growth production +3,450/−91, tests +3,702/−8, docs +279 These merge-base totals include the now-merged analytics stack; they describe review scope, not solely the remaining purge feature.
Unique tip scope 20 files changed The final purge commit is narrower than the 49-file stacked PR comparison.

Merge-risk options

Maintainer options:

  1. Guard the source before handoff (recommended)
    Check exclusions under the source ownership lock before the consuming rename, prove refusal preserves the database, and demonstrate upgrade from the released schema.

Technical review

Best possible solution:

Reject owner exclusions while the source is still protected by the consume-source ownership lock, preserve its bytes on refusal, and verify upgrade of a released-schema archive.

Do we have a high-confidence way to reproduce the issue?

Yes. Source order gives a high-confidence path: create an archive with an owner exclusion and export it with --consume-source; the guard fires after the source is moved, and failure cleanup removes staging. This review did not execute that path.

Is this the best way to solve the issue?

No. Refusing publication of local policy is reasonable, but the refusal must happen before the destructive handoff and be checked with a source-preservation regression.

Full review comments:

  • [P1] Preflight exclusions before consuming the archive — internal/store/portable.go:104-105
    The new rejection runs during pruning, after --consume-source has renamed the active database into export staging. Export then deletes staging on this error, leaving neither the active archive nor an artifact. Check under the source ownership lock before the rename and add a regression that verifies source preservation. This remains unresolved from the prior review.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning high; reviewed against 84ed753d157f.

Labels

Label changes:

No label changes.

Label justifications:

  • P0: The introduced guard can make an established export mode discard the active archive without an artifact.
  • merge-risk: 🚨 compatibility: Owner exclusions change existing portable export behavior, and the released archive schema needs upgrade proof.
  • merge-risk: 🚨 other: The consume-source interaction can lose an entire local archive, a merge risk outside the more specific label classes.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The member-authored PR is exempt from the contributor runtime-proof gate. Its body reports signed local activation and advancing core checkpoints, while the visible version 15 migration test does not establish upgrade compatibility from the version 13 archive in v0.13.0.

Evidence

Acceptance criteria:

  • [P1] go test ./internal/portable ./internal/store ./internal/cli.
  • [P1] go test ./...

What I checked:

Likely related people:

  • hannesrudolph: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-26T21:48:44.094Z sha 6c9c1be :: blocked before merge. :: [P1] Reject excluded archives before consuming the source
  • reviewed 2026-09-26T21:53:35.387Z sha 6c9c1be :: blocked before merge. :: [P1] Preflight exclusions before consuming the archive
  • reviewed 2026-09-29T13:03:02.185Z sha 6c9c1be :: blocked before merge. :: [P1] Preflight exclusions before consuming the archive
  • reviewed 2026-09-29T23:24:21.112Z sha 6c9c1be :: blocked before merge. :: [P1] Preflight exclusions before consuming the archive

Base automatically changed from feat/graphql-history-backfill to main September 30, 2026 03:04
steipete added a commit that referenced this pull request Oct 1, 2026
Add purge-threads preview/apply for an exact owner-selected local archive set. Bind apply to a stable hash of the selected stored rows, then atomically remove content, revisions, derived rows and retry work while recording durable collection exclusions. Preserve shared actors and unrelated threads; refuse ambiguous identities, unsafe native-ID reuse and unsupported shared/blob/portable/cloud targets.

Adapted and narrowed from #217 by Hannes Rudolph. Remove portable-mirror mutation and refresh ownership, arbitrary request labels, and idempotent reapply plumbing. Keep owner exclusions separate from provider deletion and successful recovery.

Validation: synthetic selection, stale-plan, multi-target rollback, collection and unsafe-target regression tests; full make check on one AWS Crabbox lease with 85.6% coverage and six-platform snapshots; isolated Codex review clean through P2; exact-head GitHub CI verified before merge.

Prepare 0.15.0 release notes with all changelog bullets and empty Unreleased. Release dispatch remains blocked on Apple's required agreement; no tag is created here.

Co-authored-by: Hannes Rudolph <49103247+hannesrudolph@users.noreply.github.com>
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks, Hannes, for the owner-removal and durable-exclusion design and the careful safety groundwork. We’ve landed the focused implementation in #227, with your co-author credit and changelog thanks preserved.

The landed command keeps atomic removal, collection exclusions, shared-actor preservation, and unsafe-target refusals, and adds a content-bound plan ID checked at apply time. We narrowed this first version to native local archives, leaving portable-mirror ownership/refresh out of scope. Synthetic rollback and normal-crawl regression tests, the full remote gate, and exact-head CI passed.

Closing this stacked draft in favor of the merged PR. The 0.15.0 notes are prepared; tagging is waiting for Apple’s notarization agreement to be accepted.

@steipete steipete closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants