@rune-kit/rune 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +395 -389
- package/compiler/__tests__/tier-override.test.js +158 -0
- package/compiler/adapters/antigravity.js +3 -8
- package/compiler/adapters/codex.js +3 -8
- package/compiler/adapters/cursor.js +3 -8
- package/compiler/adapters/generic.js +3 -8
- package/compiler/adapters/openclaw.js +4 -9
- package/compiler/adapters/opencode.js +3 -8
- package/compiler/adapters/windsurf.js +3 -8
- package/compiler/bin/rune.js +34 -1
- package/compiler/emitter.js +94 -5
- package/compiler/transforms/branding.js +10 -3
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/VISION.md +3 -3
- package/docs/guides/index.html +14 -14
- package/docs/index.html +7 -7
- package/docs/skills/index.html +832 -832
- package/extensions/ai-ml/PACK.md +7 -0
- package/extensions/content/PACK.md +7 -0
- package/extensions/mobile/PACK.md +9 -9
- package/extensions/zalo/PACK.md +9 -0
- package/package.json +2 -2
- package/skills/audit/SKILL.md +526 -529
- package/skills/ba/SKILL.md +349 -351
- package/skills/completion-gate/SKILL.md +260 -263
- package/skills/context-engine/SKILL.md +0 -6
- package/skills/cook/SKILL.md +2 -11
- package/skills/debug/SKILL.md +392 -394
- package/skills/deploy/references/post-deploy-integration.md +192 -0
- package/skills/fix/SKILL.md +281 -282
- package/skills/onboard/SKILL.md +0 -4
- package/skills/plan/references/completeness-scoring.md +0 -1
- package/skills/plan/references/outcome-block.md +0 -1
- package/skills/plan/references/workflow-registry.md +0 -1
- package/skills/preflight/SKILL.md +360 -365
- package/skills/rescue/SKILL.md +1 -0
- package/skills/research/SKILL.md +149 -150
- package/skills/review/SKILL.md +489 -495
- package/skills/sentinel/SKILL.md +0 -11
- package/skills/sentinel/references/destructive-commands.md +0 -1
- package/skills/sentinel/references/skill-content-guard.md +0 -1
- package/skills/session-bridge/SKILL.md +0 -4
- package/skills/skill-router/{SKILL.md → skill.md} +446 -397
- package/skills/team/SKILL.md +1 -2
- package/skills/test/SKILL.md +585 -593
- package/skills/watchdog/references/webhook-health-checks.md +243 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Post-Deploy Integration Verification
|
|
2
|
+
|
|
3
|
+
> After every deploy touching webhooks, payment providers, email services, or GitHub API — run this checklist. A Cloudflare Worker deployed cleanly does not mean integrations work. Polar's webhook defaults to zero events selected; zero events = zero orders = silent failure for days.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Post-Deploy Integration Verification Matrix
|
|
8
|
+
|
|
9
|
+
| Integration Type | Verify | Command / Check | Expected Result |
|
|
10
|
+
|-----------------|--------|-----------------|-----------------|
|
|
11
|
+
| Webhook endpoint | HTTP reachability | `curl -X POST https://your-worker.dev/webhook/provider` | 200 or 400 (not 404/502) |
|
|
12
|
+
| Webhook secret | Signature validation | Send test event from provider dashboard | 200, no signature error in logs |
|
|
13
|
+
| Webhook events | Events subscribed | Provider dashboard → Webhook → Events tab | At least one event type selected |
|
|
14
|
+
| Email delivery | Send + delivery | Trigger a flow that sends email, check inbox | Email arrives within 60s |
|
|
15
|
+
| Email DNS | SPF / DKIM / DMARC | `dig TXT yourdomain.com` + MXToolbox | All three records resolve correctly |
|
|
16
|
+
| GitHub API | PAT scope + expiry | `curl -H "Authorization: Bearer $PAT" https://api.github.com/user` | 200 with user object |
|
|
17
|
+
| GitHub invites | Repo invite flow | Trigger invite, check pending invitations | Invitation appears in GitHub UI |
|
|
18
|
+
| KV / Database | State after transaction | `wrangler kv key list --namespace-id=XXX` | Keys present, count matches expected |
|
|
19
|
+
| DNS / routing | Worker route binding | `curl -I https://yourdomain.com/webhook/provider` | Response from worker (check CF-Ray header) |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Smoke Test Script Pattern
|
|
24
|
+
|
|
25
|
+
Run immediately after every deploy that touches integrations.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
WORKER_URL="https://your-worker.dev"
|
|
29
|
+
ADMIN_SECRET="$WORKER_ADMIN_SECRET"
|
|
30
|
+
|
|
31
|
+
# 1. Endpoint reachability — expect 200 or 400 (not 404/502)
|
|
32
|
+
echo "=== Endpoint reachability ==="
|
|
33
|
+
curl -s -o /dev/null -w "HTTP %{http_code}\n" -X POST "$WORKER_URL/webhook/polar"
|
|
34
|
+
curl -s -o /dev/null -w "HTTP %{http_code}\n" -X POST "$WORKER_URL/webhook/stripe"
|
|
35
|
+
|
|
36
|
+
# 2. Health endpoint — expect { status: "ok" }
|
|
37
|
+
echo "=== Health check ==="
|
|
38
|
+
curl -s "$WORKER_URL/health" | jq .
|
|
39
|
+
|
|
40
|
+
# 3. Admin orders count — expect number (0 is OK on fresh deploy)
|
|
41
|
+
echo "=== Orders in KV ==="
|
|
42
|
+
curl -s -H "Authorization: Bearer $ADMIN_SECRET" \
|
|
43
|
+
"$WORKER_URL/admin/orders" | jq length
|
|
44
|
+
|
|
45
|
+
# 4. KV namespace populated
|
|
46
|
+
echo "=== KV key count ==="
|
|
47
|
+
npx wrangler kv key list --namespace-id="$KV_NAMESPACE_ID" | jq length
|
|
48
|
+
|
|
49
|
+
# 5. GitHub API access — expect login field
|
|
50
|
+
echo "=== GitHub PAT check ==="
|
|
51
|
+
curl -s -H "Authorization: Bearer $GITHUB_PAT" \
|
|
52
|
+
https://api.github.com/user | jq .login
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Expected output on healthy deploy:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
=== Endpoint reachability ===
|
|
59
|
+
HTTP 400
|
|
60
|
+
HTTP 400
|
|
61
|
+
=== Health check ===
|
|
62
|
+
{ "status": "ok", "version": "1.0.0" }
|
|
63
|
+
=== Orders in KV ===
|
|
64
|
+
0
|
|
65
|
+
=== KV key count ===
|
|
66
|
+
0
|
|
67
|
+
=== GitHub PAT check ===
|
|
68
|
+
"your-github-username"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Integration-Specific Checklists
|
|
74
|
+
|
|
75
|
+
### Payment Webhooks (Polar, Stripe, SePay)
|
|
76
|
+
|
|
77
|
+
- [ ] Webhook URL uses HTTPS, not HTTP
|
|
78
|
+
- [ ] Events selected in provider dashboard — **Polar defaults to NONE, must select manually**
|
|
79
|
+
- [ ] Secret copied exactly — no leading/trailing whitespace
|
|
80
|
+
- [ ] Secret format matches what code expects (raw string vs `whsec_` prefix for Stripe)
|
|
81
|
+
- [ ] `wrangler secret list` confirms secret is set in production environment
|
|
82
|
+
- [ ] Test delivery from provider dashboard returns 200
|
|
83
|
+
- [ ] After test delivery: order appears in KV or database
|
|
84
|
+
- [ ] After test delivery: confirmation email sent to test address
|
|
85
|
+
- [ ] Re-delivering the same event does not create a duplicate order (idempotency key check)
|
|
86
|
+
- [ ] Webhook signature verification rejects tampered payload (test with wrong secret)
|
|
87
|
+
|
|
88
|
+
**Polar-specific**: Settings → Webhooks → select your webhook → Events tab → check at least `order.created`, `subscription.created`, `subscription.updated`, `subscription.revoked` are checked.
|
|
89
|
+
|
|
90
|
+
**Stripe-specific**: Dashboard → Developers → Webhooks → endpoint → listen to events. Secret starts with `whsec_` — your code must pass the raw header value, not strip the prefix.
|
|
91
|
+
|
|
92
|
+
### Email Service (Resend, SES)
|
|
93
|
+
|
|
94
|
+
- [ ] API key is valid and not rotated since last deploy
|
|
95
|
+
- [ ] From address domain is verified in provider dashboard
|
|
96
|
+
- [ ] SPF record: `v=spf1 include:_spf.resend.com ~all` (or provider equivalent)
|
|
97
|
+
- [ ] DKIM record present and propagated (check with `dig TXT resend._domainkey.yourdomain.com`)
|
|
98
|
+
- [ ] DMARC record: `v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com`
|
|
99
|
+
- [ ] Send a real test email after deploy, verify it lands in inbox (not spam)
|
|
100
|
+
- [ ] Email template renders variable substitution correctly (no `{{name}}` literals in output)
|
|
101
|
+
- [ ] Unsubscribe link resolves and triggers unsubscribe flow
|
|
102
|
+
|
|
103
|
+
### GitHub API (Repo Invites)
|
|
104
|
+
|
|
105
|
+
- [ ] PAT (`GITHUB_PAT`) has scopes: `repo`, `admin:org` (for org repos)
|
|
106
|
+
- [ ] PAT expiry date is in the future — classic PATs can expire silently
|
|
107
|
+
- [ ] Target repos exist and PAT owner has admin access
|
|
108
|
+
- [ ] Invite flow creates a pending invitation (visible at `https://github.com/orgs/ORG/people`)
|
|
109
|
+
- [ ] Invited user receives GitHub notification email within 5 minutes
|
|
110
|
+
- [ ] Accepting invite grants correct permission level (read / write / admin per plan)
|
|
111
|
+
- [ ] Revoking access removes user from repo collaborators within expected SLA
|
|
112
|
+
|
|
113
|
+
**Check PAT expiry:**
|
|
114
|
+
```bash
|
|
115
|
+
curl -s -H "Authorization: Bearer $GITHUB_PAT" \
|
|
116
|
+
https://api.github.com/rate_limit | jq .rate
|
|
117
|
+
# If you get 401, the PAT is expired or revoked
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Common Failure Patterns
|
|
123
|
+
|
|
124
|
+
| Pattern | Symptom | Root Cause | Fix |
|
|
125
|
+
|---------|---------|------------|-----|
|
|
126
|
+
| Silent webhook failure | No errors in logs, no data in KV, zero orders | Events not selected in provider dashboard | Go to provider dashboard → webhook settings → select event types |
|
|
127
|
+
| All webhook requests 403 | `invalid signature` in logs, every delivery fails | Secret in worker env doesn't match secret shown in provider | Copy secret again, `wrangler secret put SECRET_NAME`, redeploy |
|
|
128
|
+
| Partial integration failure | Some repos invited, email never sends | `catch` block swallowing the email error, only repo invite logged | Add explicit error logging inside each catch; never swallow errors silently |
|
|
129
|
+
| Works in local dev, fails in production | 500s on webhook, env var undefined errors | Secret set in `.dev.vars` but not in production via `wrangler secret put` | Run `wrangler secret list`, add any missing secrets |
|
|
130
|
+
| First webhook succeeds, subsequent are rejected | Duplicate order prevented, but also valid re-deliveries blocked | Idempotency key stored permanently; provider retries are rejected | Use TTL on idempotency keys, or check event timestamp before rejecting |
|
|
131
|
+
| Email sends but lands in spam | Delivery confirmed by API, user never sees it | Missing or misconfigured SPF/DKIM/DMARC | Verify all three DNS records, wait propagation, retest |
|
|
132
|
+
| GitHub invite 422 | `already a collaborator` error | User was previously invited and accepted | Check existing collaborators before sending invite |
|
|
133
|
+
| KV reads return stale data | Data visible in `wrangler kv key get` but worker returns old value | Worker cached old KV binding; binding namespace-id mismatch in wrangler.toml | Verify `wrangler.toml` `kv_namespaces` points to production namespace ID |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Environment Variable Audit
|
|
138
|
+
|
|
139
|
+
Before every deploy, confirm all required secrets exist in the production environment:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# List all secrets currently set for the worker
|
|
143
|
+
npx wrangler secret list --name your-worker-name
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
| Environment Variable | Purpose | How to Verify It Works |
|
|
147
|
+
|---------------------|---------|------------------------|
|
|
148
|
+
| `POLAR_WEBHOOK_SECRET` | Validates Polar webhook signature | Send test event from Polar dashboard → expect 200 |
|
|
149
|
+
| `STRIPE_WEBHOOK_SECRET` | Validates Stripe webhook signature (`whsec_...`) | Stripe CLI `stripe trigger payment_intent.created` |
|
|
150
|
+
| `RESEND_API_KEY` | Sends transactional email | `curl -X POST api.resend.com/emails` with test recipient |
|
|
151
|
+
| `GITHUB_PAT` | Invites users to repos on purchase | `curl api.github.com/user` → expect 200 with login |
|
|
152
|
+
| `ADMIN_SECRET` | Protects `/admin/*` endpoints | `curl /admin/orders -H "Authorization: Bearer $SECRET"` → expect 200 |
|
|
153
|
+
| `KV_NAMESPACE_ID` | Bound KV namespace for order persistence | `wrangler kv key list --namespace-id=$ID` → no error |
|
|
154
|
+
|
|
155
|
+
If any secret is missing from `wrangler secret list` output, add it before considering the deploy complete:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npx wrangler secret put POLAR_WEBHOOK_SECRET --name your-worker-name
|
|
159
|
+
# Paste the secret value when prompted (no echo to terminal)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Rollback Triggers
|
|
165
|
+
|
|
166
|
+
| Situation | Decision | Reasoning |
|
|
167
|
+
|-----------|----------|-----------|
|
|
168
|
+
| Data corruption in KV (duplicate orders, wrong amounts) | Rollback immediately | Data integrity takes priority; forward-fix risks compounding the damage |
|
|
169
|
+
| Webhook returning 5xx consistently | Fix-forward (no rollback) | Provider retries automatically; rollback doesn't fix misconfiguration |
|
|
170
|
+
| Wrong webhook secret | Fix-forward: update secret + redeploy | Secret is env-level, rollback doesn't change env vars |
|
|
171
|
+
| Events not selected in Polar | Fix-forward: configure in provider dashboard | No code change needed; dashboard-only fix, deploy not required |
|
|
172
|
+
| Email API key invalid | Fix-forward: rotate key + `wrangler secret put` | Key lives in secrets, not code; redeploy takes 30s |
|
|
173
|
+
| GitHub PAT expired | Fix-forward: generate new PAT + update secret | Same as above |
|
|
174
|
+
| Health endpoint returning 500 on all routes | Rollback immediately | Worker itself is broken; users are hitting errors |
|
|
175
|
+
| Invite flow broken for subset of users | Fix-forward with hotfix | Partial breakage; rollback removes working functionality too |
|
|
176
|
+
|
|
177
|
+
**Rollback command (Cloudflare Workers):**
|
|
178
|
+
```bash
|
|
179
|
+
# List recent deployments
|
|
180
|
+
npx wrangler deployments list --name your-worker-name
|
|
181
|
+
|
|
182
|
+
# Rollback to a specific deployment
|
|
183
|
+
npx wrangler rollback --deployment-id <id> --name your-worker-name
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Fix-forward checklist before re-deploy:**
|
|
187
|
+
1. Identify root cause (check logs via `wrangler tail`)
|
|
188
|
+
2. Fix in code or secrets
|
|
189
|
+
3. Run smoke test locally against staging
|
|
190
|
+
4. Deploy to production
|
|
191
|
+
5. Re-run smoke test script above
|
|
192
|
+
6. Confirm provider dashboard shows successful test delivery
|