Repository navigation
Commit bf762f3
authored
feat(worker): webhook-materialized read model replaces residual polling (#1167)
Quota campaign PR 5/5: webhook-materialized read model - the pollers stop re-asking GitHub for facts the App already delivered.
Typed ingress (extending the #1132 discriminated union) now covers full issue lifecycle, all issue-comment create/edit/delete including non-commands, PR reviews and review comments, workflow runs/jobs, and check runs/suites. The queue DO materializes bounded normalized snapshots: per-item metadata, ordered comment collections with tombstones, review-activity digests, and workflow state - GUID dedupe, monotonic watermarks (out-of-order deliveries cannot regress state), gap detection, and per-class TTLs (items 15m, comments/reviews 30m, workflows 5m, placeholder census 6h). Reads serve "snapshot as of watermark W" with staleness attached.
Migrated pollers (measured residual was item_metadata ~2.2k/h + comments ~750/h post PRs 1-4), counted on fixtures: planning 1->0, dashboard health 8->0, placeholder discovery 3->0, router hydration 1->0 GitHub requests on warm snapshots; each keeps a bounded repair poll for gap healing. Hard safety line proven: mutation guards and two-sided lease checks bypass the read model entirely (zero read-model guard hits observed; live hits confirmed).
Degradation contract: event classes the GitHub App does not deliver keep their poll paths and emit structured telemetry. REQUIRED APP SUBSCRIPTIONS for full effect: Issues, Pull requests, Issue comments, PR reviews, PR review comments, Workflow runs, Workflow jobs, Check runs, Check suites.
Proof: signed loopback deliveries (out-of-order + duplicate GUIDs), poller equivalence with counted formulas, safety fixtures; 59/59 focused, full gate 3455 passed; Crabbox local-container receipt at the final head, machine-verified provenance. Verdict clean (no actionable findings, proof sufficient). Merge note: the red "automerge quota-fixture" check fails identically on origin/main (inherited, tracked separately).1 parent 386730f commit bf762f3
29 files changed
Lines changed: 3756 additions & 78 deletions
File tree
- config
- dashboard
- docs
- proof/webhook-read-model
- scripts
- src
- repair
- test
- repair
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
668 | 669 | | |
669 | 670 | | |
670 | 671 | | |
| 672 | + | |
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
| |||
698 | 700 | | |
699 | 701 | | |
700 | 702 | | |
| 703 | + | |
701 | 704 | | |
702 | 705 | | |
703 | 706 | | |
| |||
3046 | 3049 | | |
3047 | 3050 | | |
3048 | 3051 | | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
3049 | 3192 | | |
3050 | 3193 | | |
3051 | 3194 | | |
| |||
7602 | 7745 | | |
7603 | 7746 | | |
7604 | 7747 | | |
| 7748 | + | |
7605 | 7749 | | |
7606 | 7750 | | |
7607 | 7751 | | |
| |||
0 commit comments