Commit fc7b789
committed
feat: version post content, add Wikipedia support, and ship Firefox pipeline
Introduce a versioned content model across the API/database:
- Add PostVersion, ContentBlob, ImageOccurrenceSet/ImageOccurrence, and PostVersionViewCredit.
- Move Investigation linkage from (postId, contentHash) to postVersionId.
- Extend Platform metadata with WikipediaMeta and add WIKIPEDIA platform support.
Add and align migrations for the new model:
- Add 0011 post image occurrences, 0012 wikipedia platform/meta, 0014 wikipedia title index drop, and 0015 post versions backfill.
- Backfill uses deterministic occurrence payload hashing and version hashing (sha256(contentHash + '\n' + occurrencesHash)).
- Add collision guards and restore DB invariants/lineage enforcement via constraints + triggers.
- Enforce PostVersion provenance consistency (SERVER_VERIFIED vs CLIENT_FALLBACK fields).
Refactor extension-facing API contracts:
- Introduce post.registerObservedVersion and keep post.recordViewAndGetStatus as a postVersionId-based view-credit/status call.
- Update investigateNow to accept postVersionId.
- Extend batchStatus lookup with versionHash-aware inputs.
Expand canonicalization and investigation internals:
- Add canonical-resolution service and dependency-injected request-identity/openai-key-validation-core helpers.
- Extend canonical content fetching with Wikipedia revision-based fetch/normalization.
- Move investigation orchestration to postVersion-backed content/image context.
- Add image-occurrence-aware multimodal prompt assembly with resolved/missing/omitted image states and validation context notes.
Upgrade extension architecture and platform coverage:
- Add Wikipedia URL parsing + adapter extraction (content/image occurrences/metadata).
- Split background logic into reusable modules (api-client-core, browser-compat, investigation/page-content state helpers).
- Switch background view flow to registerObservedVersion -> recordViewAndGetStatus and use postVersionId for investigateNow.
- Keep popup/options/content plumbing aligned with new protocol and schema changes.
Ship cross-browser build/release flow:
- Build Chrome + Firefox artifacts (dist + dist/firefox) with manifest transformation and Firefox background/content bundling.
- Strengthen artifact assertions for both browser targets.
- Update release workflow to run full checks, package/sign/publish Chrome and Firefox zips, and report bundle sizes.
- Update PR checks to include formatting and coverage gates.
Improve tooling, tests, and documentation:
- Add Prettier config/ignore, format scripts, and c8 coverage configs for shared/api/extension.
- Tighten ESLint strict-boolean-expressions and clean type-safe conditionals across code.
- Expand unit/integration/e2e coverage across shared/api/extension for new protocol/platform behavior.
- Update README, SPEC, and AGENTS docs for post-version flow, Wikipedia support, and Chrome+Firefox usage.1 parent 51576d6 commit fc7b789
167 files changed
Lines changed: 10597 additions & 3976 deletions
File tree
- .github/workflows
- src/typescript
- api
- prisma
- migrations
- 0011_post_image_occurrences
- 0012_wikipedia_platform_and_meta
- 0014_drop_wikipedia_language_title_unique
- 0015_post_versions_backfill
- src
- lib
- config
- db
- graphql
- investigators
- network
- openai
- services
- trpc
- routes
- routes/graphql
- test
- integration
- unit
- extension
- scripts
- src
- background
- content
- adapters
- lib
- options
- popup
- test
- e2e
- helpers
- unit
- pulumi
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| |||
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
213 | 248 | | |
214 | 249 | | |
215 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
20 | 34 | | |
21 | 35 | | |
22 | 36 | | |
| |||
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
44 | 61 | | |
45 | 62 | | |
46 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
47 | 67 | | |
48 | | - | |
49 | | - | |
| 68 | + | |
| 69 | + | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
| |||
61 | 81 | | |
62 | 82 | | |
63 | 83 | | |
64 | | - | |
| 84 | + | |
65 | 85 | | |
66 | 86 | | |
67 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
68 | 140 | | |
69 | 141 | | |
70 | | - | |
71 | 142 | | |
72 | 143 | | |
73 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
74 | 147 | | |
75 | 148 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
79 | 157 | | |
80 | | - | |
81 | | - | |
| 158 | + | |
| 159 | + | |
82 | 160 | | |
83 | 161 | | |
84 | 162 | | |
85 | | - | |
86 | 163 | | |
87 | 164 | | |
88 | 165 | | |
| |||
94 | 171 | | |
95 | 172 | | |
96 | 173 | | |
97 | | - | |
| 174 | + | |
98 | 175 | | |
99 | 176 | | |
100 | 177 | | |
101 | 178 | | |
102 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
94 | | - | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
160 | 173 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 174 | + | |
| 175 | + | |
164 | 176 | | |
165 | 177 | | |
166 | 178 | | |
| |||
0 commit comments