fuzzy find my records ken.waow.tech
embeddings pds search
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add minimal justfile + zig fmt baseline

just deploy (fly deploy from backend/), just fmt / just fmt-check
(zig fmt). fmt baseline picks up pre-existing drift in display.zig
and oauth.zig so fmt-check passes clean on main going forward.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+79 -19
+4 -3
backend/src/display.zig
··· 13 13 }; 14 14 15 15 const BODY_FIELDS = [_][]const u8{ 16 - "text", "content", "body", "description", "plaintext", "code", 17 - "bio", "about", "message", 16 + "text", "content", "body", "description", "plaintext", "code", 17 + "bio", "about", "message", 18 18 }; 19 19 20 20 const DATE_FIELDS = [_][]const u8{ 21 21 "createdAt", "publishedAt", "indexedAt", "updatedAt", 22 - "endedAt", "endDate", "startedAt", "startDate", "issuedAt", 22 + "endedAt", "endDate", "startedAt", "startDate", 23 + "issuedAt", 23 24 }; 24 25 25 26 pub const Display = struct {
+6 -3
backend/src/indexer.zig
··· 1032 1032 try record.print(alloc, "\"count\":{d},", .{n}); 1033 1033 1034 1034 // positions is a single blob ref 1035 - try record.print(alloc, 1035 + try record.print( 1036 + alloc, 1036 1037 "\"positions\":{{\"$type\":\"blob\",\"ref\":{{\"$link\":\"{s}\"}},\"mimeType\":\"{s}\",\"size\":{d}}},", 1037 1038 .{ positions_ref.cid, positions_ref.mime_type, positions_ref.size }, 1038 1039 ); ··· 1041 1042 try record.appendSlice(alloc, "\"vectors\":["); 1042 1043 for (vector_refs.items, 0..) |r, i| { 1043 1044 if (i > 0) try record.appendSlice(alloc, ","); 1044 - try record.print(alloc, 1045 + try record.print( 1046 + alloc, 1045 1047 "{{\"$type\":\"blob\",\"ref\":{{\"$link\":\"{s}\"}},\"mimeType\":\"{s}\",\"size\":{d}}}", 1046 1048 .{ r.cid, r.mime_type, r.size }, 1047 1049 ); ··· 1061 1063 const day = epoch_secs.getDaySeconds(); 1062 1064 const year_day = epoch_secs.getEpochDay().calculateYearDay(); 1063 1065 const md = year_day.calculateMonthDay(); 1064 - try record.print(alloc, 1066 + try record.print( 1067 + alloc, 1065 1068 "\"createdAt\":\"{d:0>4}-{d:0>2}-{d:0>2}T{d:0>2}:{d:0>2}:{d:0>2}.000Z\"", 1066 1069 .{ 1067 1070 year_day.year,
+55 -12
backend/src/oauth.zig
··· 203 203 204 204 pub fn sendParRequest(alloc: Allocator, params: ParParams) !ParResult { 205 205 const client_assertion = try zat_oauth.createClientAssertion( 206 - alloc, cfg.io, params.client_keypair, params.client_id, params.authserver_url, 206 + alloc, 207 + cfg.io, 208 + params.client_keypair, 209 + params.client_id, 210 + params.authserver_url, 207 211 ); 208 212 defer alloc.free(client_assertion); 209 213 210 214 const dpop_proof = try zat_oauth.createDpopProof( 211 - alloc, cfg.io, params.dpop_keypair, "POST", params.par_url, null, null, 215 + alloc, 216 + cfg.io, 217 + params.dpop_keypair, 218 + "POST", 219 + params.par_url, 220 + null, 221 + null, 212 222 ); 213 223 defer alloc.free(dpop_proof); 214 224 ··· 235 245 const nonce = result.dpop_nonce orelse return error.MissingDpopNonce; 236 246 alloc.free(result.body); 237 247 const proof2 = try zat_oauth.createDpopProof( 238 - alloc, cfg.io, params.dpop_keypair, "POST", params.par_url, nonce, null, 248 + alloc, 249 + cfg.io, 250 + params.dpop_keypair, 251 + "POST", 252 + params.par_url, 253 + nonce, 254 + null, 239 255 ); 240 256 defer alloc.free(proof2); 241 257 result = try doPost(alloc, params.par_url, form_body, &.{ ··· 280 296 281 297 pub fn sendTokenRequest(alloc: Allocator, params: TokenParams) !TokenResult { 282 298 const client_assertion = try zat_oauth.createClientAssertion( 283 - alloc, cfg.io, params.client_keypair, params.client_id, params.authserver_url, 299 + alloc, 300 + cfg.io, 301 + params.client_keypair, 302 + params.client_id, 303 + params.authserver_url, 284 304 ); 285 305 defer alloc.free(client_assertion); 286 306 287 307 const dpop_proof = try zat_oauth.createDpopProof( 288 - alloc, cfg.io, params.dpop_keypair, "POST", params.token_url, 289 - if (params.dpop_nonce.len > 0) params.dpop_nonce else null, null, 308 + alloc, 309 + cfg.io, 310 + params.dpop_keypair, 311 + "POST", 312 + params.token_url, 313 + if (params.dpop_nonce.len > 0) params.dpop_nonce else null, 314 + null, 290 315 ); 291 316 defer alloc.free(dpop_proof); 292 317 ··· 310 335 const nonce = result.dpop_nonce orelse return error.MissingDpopNonce; 311 336 alloc.free(result.body); 312 337 const proof2 = try zat_oauth.createDpopProof( 313 - alloc, cfg.io, params.dpop_keypair, "POST", params.token_url, nonce, null, 338 + alloc, 339 + cfg.io, 340 + params.dpop_keypair, 341 + "POST", 342 + params.token_url, 343 + nonce, 344 + null, 314 345 ); 315 346 defer alloc.free(proof2); 316 347 result = try doPost(alloc, params.token_url, form_body, &.{ ··· 700 731 701 732 const dpop_hex = std.fmt.bytesToHex(dpop_key_bytes, .lower); 702 733 store.insertAuthRequest( 703 - state, authserver_iss, did, handle_str, pds_url, 704 - pkce_verifier, SCOPE, par_result.dpop_nonce, &dpop_hex, 734 + state, 735 + authserver_iss, 736 + did, 737 + handle_str, 738 + pds_url, 739 + pkce_verifier, 740 + SCOPE, 741 + par_result.dpop_nonce, 742 + &dpop_hex, 705 743 ) catch { 706 744 try sendError(request, .internal_server_error, "could not store auth request"); 707 745 return; ··· 788 826 } 789 827 790 828 store.upsertSession( 791 - auth_req.did, auth_req.handle, auth_req.pds_url, auth_req.authserver_iss, 792 - token_result.access_token, token_result.refresh_token, 793 - token_result.dpop_nonce, "", 829 + auth_req.did, 830 + auth_req.handle, 831 + auth_req.pds_url, 832 + auth_req.authserver_iss, 833 + token_result.access_token, 834 + token_result.refresh_token, 835 + token_result.dpop_nonce, 836 + "", 794 837 auth_req.dpop_private_key, 795 838 ) catch { 796 839 try sendError(request, .internal_server_error, "could not store session");
-1
backend/src/repo_walk.zig
··· 271 271 return walkOpened(arena, &opened, did, filter); 272 272 } 273 273 274 - 275 274 /// owns a temp file + its mmap. deletes the temp file on destroy. 276 275 const FetchedCar = struct { 277 276 /// absolute path in /tmp, so we can unlink on destroy
+14
justfile
··· 1 + default: 2 + @just --list 3 + 4 + # ship to fly. run from repo root. 5 + deploy: 6 + cd backend && fly deploy 7 + 8 + # check that all zig sources are formatted. exits non-zero on any diff. 9 + fmt-check: 10 + cd backend && zig fmt --check src/ 11 + 12 + # apply zig fmt in place. 13 + fmt: 14 + cd backend && zig fmt src/