Implement one-way Paperclip to Forgejo issue sync

This commit is contained in:
Paperclip Bot 2026-06-02 07:00:21 +00:00
parent 471520e6b3
commit b0c38705ce
12 changed files with 746 additions and 248 deletions

View file

@ -1,8 +1,8 @@
# Forgejo Issue Sync Plugin
Scaffold for a Paperclip plugin that will sync Forgejo issues/comments while enforcing the v1 policy from `PRIA-13`:
Paperclip plugin for one-way Paperclip issue -> Forgejo issue creation while enforcing the v1 attachment policy:
- webhook intake stays inside the plugin worker
- selected Paperclip issues are detected inside the plugin worker
- scheduled reconciliation stays in plugin `jobs`
- mappings, dedupe, and review state stay in the plugin database/state
- attachment handling is metadata-only
@ -12,15 +12,16 @@ Scaffold for a Paperclip plugin that will sync Forgejo issues/comments while enf
- `src/manifest.ts`: manifest, capabilities, jobs, webhook declaration, instance config schema
- `src/worker.ts`: plugin bootstrap, health, config validation, data/action registration
- `src/webhook-intake.ts`: webhook verification, normalization, dedupe recording, manual-review queueing
- `src/paperclip-issue-sync.ts`: issue selection, payload shaping, and outbound sync flow
- `src/forgejo-client.ts`: outbound Forgejo API client
- `src/reconciliation.ts`: scheduled reconciliation job and instance-level last-run state
- `src/persistence.ts`: namespace-local persistence helpers for mappings, deliveries, reviews, and run snapshots
- `src/persistence.ts`: namespace-local persistence helpers for mappings, reviews, and run snapshots
- `src/attachment-policy.ts`: metadata-only attachment policy and synced markdown formatter
- `migrations/001_initial.sql`: plugin-owned tables for mappings, dedupe, review queue, and reconciliation history
## Attachment Policy
This scaffold deliberately does not fetch attachment bytes and does not add any path that calls `/api/attachments/{id}/content`.
This plugin deliberately does not fetch attachment bytes and does not add any path that calls `/api/attachments/{id}/content`.
Instead it:
@ -31,7 +32,7 @@ Instead it:
## Follow-Up Needed
The plugin now emits `attachments_context_required` as a durable review signal, but the human-review destination is still a follow-up decision:
The plugin emits `attachments_context_required` as a durable review signal, but the human-review destination is still a follow-up decision:
- create Paperclip-visible review issues/comments
- expose a plugin UI or scoped API route for triage