-
Notifications
You must be signed in to change notification settings - Fork 579
Expand file tree
/
Copy pathalef.toml
More file actions
4683 lines (4093 loc) · 147 KB
/
Copy pathalef.toml
File metadata and controls
4683 lines (4093 loc) · 147 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[workspace]
# install-alef honours this key, so it decides which alef CI validates against. The pin
# sat at 0.81.0 while 0.82.0's `alef e2e generate` was nondeterministic (2/10 runs
# divergent upstream); 0.82.2 is adopted only after a same-tree fixed-point re-run of
# `alef all` produced an empty diff, which is the check that hold existed for. ~keep
alef_version = "0.82.2"
languages = [
"python",
"node",
"ruby",
"php",
"ffi",
"go",
"java",
"csharp",
"elixir",
"wasm",
"dart",
"jni",
"kotlin_android",
"swift",
"zig",
]
[workspace.tools]
python_package_manager = "uv"
node_package_manager = "pnpm"
[workspace.ownership]
user_owned = [
"e2e/csharp/Xberg.E2eTests.csproj",
"e2e/dart/pubspec.yaml",
"e2e/java/pom.xml",
"e2e/kotlin_android/build.gradle.kts",
"e2e/node/package.json",
"e2e/swift_e2e/Package.swift",
"e2e/wasm/package.json",
"e2e/zig/build.zig",
"packages/kotlin-android/gradle/wrapper/gradle-wrapper.properties",
"packages/kotlin-android/src/test/kotlin/io/xberg/XbergScaffoldTest.kt",
"test_apps/csharp/Xberg.E2eTests.csproj",
"test_apps/dart/pubspec.yaml",
"test_apps/homebrew/README.md",
"test_apps/java/pom.xml",
"test_apps/kotlin_android/build.gradle.kts",
"test_apps/kotlin_android/gradle/wrapper/gradle-wrapper.properties",
"test_apps/node/package.json",
"test_apps/swift_e2e/Package.swift",
"test_apps/wasm/package.json",
"test_apps/zig/build.zig",
]
[workspace.dto]
python = "dataclass"
python_output = "typed-dict"
node = "interface"
ruby = "struct"
php = "readonly-class"
elixir = "struct"
go = "struct"
java = "record"
csharp = "record"
[workspace.generate]
bindings = true
errors = true
configs = true
async_wrappers = true
type_conversions = true
package_metadata = true
public_api = true
[workspace.generate_overrides.wasm]
async_wrappers = false
[workspace.generate_overrides.java]
async_wrappers = false
[workspace.generate_overrides.kotlin_android]
async_wrappers = false
[workspace.docs]
reference_output = "docs-site/src/content/docs/reference"
reference_link_style = "extensionless"
# Include the command modules that define `#[command(flatten)]` structs (e.g.
[workspace.docs.cli]
sources = ["crates/xberg-cli/src/main.rs", "crates/xberg-cli/src/commands/overrides.rs"]
[workspace.docs.mcp]
sources = ["crates/xberg/src/mcp/server.rs"]
[[workspace.docs.mcp.declared]]
kind = "prompt"
name = "extract_document"
description = "Generate a Xberg extraction call for a document"
[[workspace.docs.mcp.declared]]
kind = "prompt"
name = "extract_with_ocr"
description = "Extract a document with explicit OCR language configuration"
[[workspace.docs.mcp.declared]]
kind = "prompt"
name = "semantic_search"
description = "Prepare a document for semantic search through unified extraction"
[[workspace.docs.mcp.declared]]
kind = "resource"
name = "xberg://formats"
title = "Supported Formats"
description = "All document formats and MIME types supported by Xberg"
[[workspace.docs.mcp.declared]]
kind = "resource"
name = "xberg://models"
title = "Model Manifest"
description = "Model files, sizes, and SHA256 checksums"
[[workspace.docs.mcp.declared]]
kind = "resource"
name = "xberg://languages/ocr"
title = "OCR Languages"
description = "Available OCR language codes"
[[workspace.docs.mcp.declared]]
kind = "resource"
name = "xberg://presets/embeddings"
title = "Embedding Presets"
description = "Available embedding model presets when the embeddings feature is enabled"
[workspace.docs.skills]
template_dir = "templates/docs/skills"
outputs = [".codex/skills", ".agents/skills", ".github/skills", ".claude/skills"]
[workspace.docs.snippets]
dirs = ["docs-site/src/snippets-generated"]
inline_dirs = ["docs-site/src/snippets"]
docs_dirs = ["docs-site/src/content/docs", "docs-site/src/components"]
content_collections = { apiExamples = "docs-site/src/snippets-generated" }
include_base_paths = ["docs-site/src"]
required_languages = [
"python",
"rust",
"typescript",
"go",
"ruby",
"elixir",
"java",
"csharp",
"php",
"dart",
"kotlin",
"swift",
"zig",
"c",
]
validation_level = "compile"
# 600s was sized for typecheck/compile-only validation of individual snippets.
# The Swift `before` hook below runs `cargo build -p xberg-swift`, which
# compiles xberg's heavy native dependency chain (onnxruntime, tesseract,
# PDF/office parsers) from a cold target dir; a from-scratch build of that
# graph routinely exceeds 10 minutes even before swift-bridge/staticlib
# linking. Raised to bound that cold build without starving it. ~keep
timeout_secs = 1800
before_timeout_secs = 1800
strict = true
report_output = ".alef/snippet-validation-report.json"
[workspace.docs.snippets.sessions.rust]
cwd = "."
manifest = "crates/xberg/Cargo.toml"
# Beyond `api`, these three are the features hand-authored snippets actually
# demonstrate. All are cheap: `keywords-yake` resolves to `stopwords`, which is
# an empty feature list (Cargo.toml:516,507), and `embedding-presets` is `[]`
# outright (:463) -- together they add ZERO crates. `pdf` (:61) pulls only
# pure-Rust parsers.
# Do NOT reach for `embeddings` (:466) to fix an embedding snippet: it enables
# `onnx-runtime` (:452) -> `dep:ort` + `ort-bundled`, which DOWNLOADS ONNX
# Runtime binaries at build time. `embedding-presets` clears the same
# unresolved-import error for free. ~keep
rust_features = ["api", "keywords-yake", "embedding-presets", "pdf"]
# `async-trait` is not optional garnish here: every plugin trait in the public
# surface (DocumentExtractor, OcrBackend, PostProcessor, Validator) is declared
# with `#[async_trait]`, so a snippet that implements one CANNOT be written
# without it. xberg itself depends on it (crates/xberg/Cargo.toml:1116); it was
# simply never mirrored into the snippet session, which is why eight
# hand-authored plugin snippets failed on `unresolved import async_trait`
# rather than on anything wrong with their own code. Kept at the workspace
# version (Cargo.toml:51). ~keep
rust_dependencies = { tokio = { version = "1.53.1", features = [
"macros",
"rt-multi-thread",
] }, serde_json = { version = "1.0.151" }, async-trait = { version = "0.1.92" }, tracing = { version = "0.1" }, reqwest = { version = "0.13.4", default_features = false, features = [
"json",
"multipart",
] } }
[workspace.docs.snippets.sessions.python]
cwd = "packages/python"
manifest = "packages/python/pyproject.toml"
[workspace.docs.snippets.sessions.node]
cwd = "crates/xberg-node"
manifest = "crates/xberg-node/package.json"
# Sessions are keyed by BINDING-PACKAGE name, but alef's session lookup falls
# back to the snippet's LANGUAGE name when a snippet carries no explicit
# `target` metadata. TypeScript is the one language where those two names never
# coincide: its packages are `node` and `wasm`, so `sessions.get("typescript")`
# missed and the 48 hand-authored snippets under docs-site/src/snippets/
# typescript/ were typechecked against a bare tsconfig with no path mapping to
# `@xberg-io/xberg` -- 64 of their 69 failures were a single TS2307
# "cannot find module". Generated snippets are unaffected either way: they
# carry `target: node`/`target: wasm`, which takes priority over this fallback.
# Aliased to the node package because every hand-authored snippet under
# docs-site/src/snippets/typescript/ imports `@xberg-io/xberg`. The handwritten
# Markdown snippets under docs-site/src/snippets/wasm/ declare `target: wasm`
# explicitly, so Alef validates them against the WASM session below. ~keep
[workspace.docs.snippets.sessions.typescript]
cwd = "crates/xberg-node"
manifest = "crates/xberg-node/package.json"
[workspace.docs.snippets.sessions.wasm]
cwd = "crates/xberg-wasm"
manifest = "crates/xberg-wasm/package.json"
[workspace.docs.snippets.sessions.go]
cwd = "packages/go"
manifest = "packages/go/go.mod"
[workspace.docs.snippets.sessions.ruby]
cwd = "packages/ruby"
manifest = "packages/ruby/xberg.gemspec"
[workspace.docs.snippets.sessions.php]
cwd = "packages/php"
manifest = "crates/xberg-php/src/composer.json"
[workspace.docs.snippets.sessions.elixir]
cwd = "packages/elixir"
manifest = "packages/elixir/mix.exs"
[workspace.docs.snippets.sessions.java]
cwd = "packages/java"
manifest = "packages/java/pom.xml"
before = [
"if [ -x /usr/libexec/java_home ]; then JAVA_HOME=$(/usr/libexec/java_home -v 25); else JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | sed -n 's/ *java.home = //p'); fi; export JAVA_HOME; if [ ! -d target/classes ]; then mvn -q -Dcheckstyle.skip -DskipTests compile; fi && mvn -q -DskipTests dependency:copy-dependencies",
]
[workspace.docs.snippets.sessions.csharp]
cwd = "packages/csharp/Xberg"
manifest = "packages/csharp/Xberg/Xberg.csproj"
[workspace.docs.snippets.sessions.dart]
cwd = "packages/dart"
manifest = "packages/dart/pubspec.yaml"
[workspace.docs.snippets.sessions.kotlin]
cwd = "packages/kotlin-android"
manifest = "packages/kotlin-android/build.gradle.kts"
# Guarded so a machine with no Android SDK SKIPS this build instead of failing it.
# The previous form derived ANDROID_HOME inline from `readlink $(command -v
# sdkmanager)`; with sdkmanager absent that passes no argument to readlink, the
# four nested dirnames each print "usage: dirname string [...]", ANDROID_HOME
# ends up empty, and Gradle aborts. Alef isolates preparation failures per target,
# but an absent Android toolchain should be unavailable, not a Kotlin source failure.
# The wrapper JAR is also gitignored, so staged-tree validation may lack it.
# Once an explicit, structurally valid SDK is present, Gradle failures propagate
# so stale build artifacts cannot make Kotlin snippets appear valid. ~keep
before = [
'ANDROID_HOME=${ANDROID_HOME:-${ANDROID_SDK_ROOT:-}}; export ANDROID_HOME; if [ -z "$ANDROID_HOME" ]; then echo "alef: no explicit Android SDK root; skipping gradle assembleDebug"; elif [ ! -d "$ANDROID_HOME/platforms" ] || [ ! -d "$ANDROID_HOME/build-tools" ]; then echo "alef: Android SDK root lacks platforms or build-tools; skipping gradle assembleDebug"; elif [ ! -f gradle/wrapper/gradle-wrapper.jar ]; then echo "alef: gradle/wrapper/gradle-wrapper.jar is absent; skipping gradle assembleDebug"; else ./gradlew assembleDebug; fi',
]
[workspace.docs.snippets.sessions.kotlin_android]
cwd = "packages/kotlin-android"
manifest = "packages/kotlin-android/build.gradle.kts"
# Guarded so a machine with no Android SDK SKIPS this build instead of failing it.
# The previous form derived ANDROID_HOME inline from `readlink $(command -v
# sdkmanager)`; with sdkmanager absent that passes no argument to readlink, the
# four nested dirnames each print "usage: dirname string [...]", ANDROID_HOME
# ends up empty, and Gradle aborts. Alef isolates preparation failures per target,
# but an absent Android toolchain should be unavailable, not a Kotlin source failure.
# The wrapper JAR is also gitignored, so staged-tree validation may lack it.
# Once an explicit, structurally valid SDK is present, Gradle failures propagate
# so stale build artifacts cannot make Kotlin snippets appear valid. ~keep
before = [
'ANDROID_HOME=${ANDROID_HOME:-${ANDROID_SDK_ROOT:-}}; export ANDROID_HOME; if [ -z "$ANDROID_HOME" ]; then echo "alef: no explicit Android SDK root; skipping gradle assembleDebug"; elif [ ! -d "$ANDROID_HOME/platforms" ] || [ ! -d "$ANDROID_HOME/build-tools" ]; then echo "alef: Android SDK root lacks platforms or build-tools; skipping gradle assembleDebug"; elif [ ! -f gradle/wrapper/gradle-wrapper.jar ]; then echo "alef: gradle/wrapper/gradle-wrapper.jar is absent; skipping gradle assembleDebug"; else ./gradlew assembleDebug; fi',
]
[workspace.docs.snippets.sessions.swift]
cwd = "packages/swift"
manifest = "packages/swift/Package.swift"
# Guarded so a machine with no Swift toolchain reports Swift unavailable instead
# of a source failure. The build step also fixes xberg task #521, where every
# Swift snippet failed because `import Xberg` could not resolve.
# packages/swift/Sources/RustBridge{,C} are already-generated, committed
# swift-bridge output (see Package.swift's own header comment) -- `alef
# generate` does not need to run here. What's missing is the Rust side:
# Package.swift's `resolvedStaticLib` links target/{release,debug}/lib
# xberg_swift.a and libxberg_ffi.a explicitly, and neither exists until
# `cargo build -p xberg-swift` has run at least once. Skip that build when
# it is already satisfied (release preferred, matching resolvedStaticLib's
# own preference) so repeat runs stay fast. Always run `swift build` after
# that check: SwiftPM incrementally refreshes Xberg.swiftmodule when the
# installed Swift compiler changes, preventing an older `.build` module
# from poisoning every snippet import. An installed toolchain's Cargo or Swift
# build failure propagates so stale modules cannot make snippets appear valid;
# only an absent Swift toolchain is an explicit skip. ~keep
before = [
'if ! command -v swift >/dev/null 2>&1; then echo "alef: swift not on PATH; skipping Swift session build (Swift snippets will fail typecheck)"; else if { [ -f ../../target/release/libxberg_swift.a ] || [ -f ../../target/debug/libxberg_swift.a ]; } && { [ -f ../../target/release/libxberg_ffi.a ] || [ -f ../../target/debug/libxberg_ffi.a ]; }; then echo "alef: required staticlibs already built; skipping cargo build"; else cargo build --manifest-path rust/Cargo.toml -p xberg-swift -p xberg-ffi || exit $?; fi; swift build; fi',
]
[workspace.docs.snippets.sessions.zig]
cwd = "packages/zig"
manifest = "packages/zig/build.zig"
# No ZIG_GLOBAL_CACHE_DIR override here on purpose. We used to set it to the
# RELATIVE path ".alef-cache/zig-global", which zig could not resolve from the
# session cwd -- every Zig snippet failed with "unable to resolve zig cache
# directory: AppDataDirUnavailable" before it ever reached the compiler, masking
# any real error underneath. alef already exports a per-fingerprint ABSOLUTE
# cache dir of its own, so overriding it bought nothing and additionally
# collapsed every Zig session onto one shared cache. ~keep
# packages/zig/src/xberg.zig:4 does `@cImport(@cInclude("xberg.h"))`, and alef
# compiles that module with a bare `zig build-exe` that never reads build.zig --
# so build.zig's addIncludePath does not apply and the header must be supplied
# here instead. ~keep
include_paths = ["crates/xberg-ffi/include"]
[workspace.docs.snippets.sessions.c]
cwd = "crates/xberg-ffi/include"
manifest = "crates/xberg-ffi/include/xberg.h"
[workspace.sync]
extra_paths = [
"packages/python/xberg/__init__.py",
"packages/ruby/lib/xberg/version.rb",
"packages/ruby/ext/xberg_rb/native/Cargo.toml",
"crates/xberg-node/package.json",
"crates/xberg-node/npm/*/package.json",
"packages/go/go.mod",
"cli-proxy/pypi/pyproject.toml",
"cli-proxy/npm/package.json",
"Cargo.toml",
]
[workspace.poly]
exclude = [
"docs-site/src/snippets/**",
"**/_generated/**",
"**/coverage/**",
"**/pkg/**",
"**/.next/**",
"**/*.min.js",
"**/vendored/**",
"**/stopwords/**",
"**/testdata/**",
"e2e/**",
"**/*.diff",
"**/*.patch",
"**/frb_generated.rs",
# The Dart half of the same flutter_rust_bridge output. Only the Rust half was
# excluded, so `poly fmt --check .` reports `would reformat` on all four Dart
# bridge files (frb_generated{,.io,.web}.dart and lib.dart) and fails the
# Validate (poly) job on every run. Reproduced against poly 0.20.1 locally and
# 0.19.7 in CI. Same reasoning as the sibling `**/*.freezed.dart` exclusion
# poly already applies: this is generator output nothing should reflow. ~keep
"packages/dart/lib/src/xberg_bridge_generated/**",
"charts/**",
# ai-rulez-generated coding-agent plugin outputs: owned by `ai-rulez generate
# --plugin`, never reformatted by poly (would break BLAKE3 provenance). Sources
# under plugin/.ai-rulez/ + plugin/scripts/ stay poly-managed. ~keep
"plugin/.claude-plugin/**",
"plugin/.codex-plugin/**",
"plugin/.cursor-plugin/**",
"plugin/.factory-plugin/**",
"plugin/.opencode/**",
"plugin/.hermes/**",
"plugin/skills/**",
"plugin/.mcp.json",
"plugin/gemini-extension.json",
"plugin/kimi.plugin.json",
"plugin/package.json",
"plugin/.ai-rulez-generated.json",
".claude-plugin/marketplace.json",
".agents/plugins/marketplace.json",
".ai-rulez-generated.json",
# Benchmark cohort manifests are BLAKE3-pinned by value in
# tools/benchmark-harness/src/bench_matrix.rs (*_MANIFEST_BLAKE3) and verified
# at runtime by validate_artifacts. Any reformat changes the digest and fails
# the contract, so these are data files poly must not rewrite -- same reasoning
# as the ai-rulez plugin outputs above. Without this, every regen that runs
# poly silently re-breaks the pin: it collapsed the `fixtures` array onto one
# line in 888023d75d, and 8a60458a7dd was an earlier re-pin for the same cause. ~keep
"tools/benchmark-harness/cohorts/**",
]
# Opt-in comment-removal sweep. Preserve doc comments (rustdoc is required on
# public items), TODO/FIXME (actionable), and SAFETY/license markers. Generated
# binding output is exempted via per-file-ignores below. ~keep
[workspace.poly.uncomment]
enabled = true
remove-todos = false
remove-fixme = false
remove-docs = false
use-default-ignores = true
# clang-format owns C++ namespace-closing comments and restores them after lint fixes. ~keep
preserve-patterns = ["SAFETY", "SPDX", "Copyright", "License", "licensed under", "namespace"]
[workspace.poly.typos.extend-words]
# These exact tokens are audited corpus/language terms, tokenizer or hyphenation fragments,
# standardized glyph/PDF names, and deliberately malformed regression inputs. They must remain
# verbatim for the tests and formats they represent; this is not a blanket typo suppression. ~keep
addresss = "addresss"
alikes = "alikes"
als = "als"
ative = "ative"
certi = "certi"
cient = "cient"
compre = "compre"
controler = "controler"
diffcult = "diffcult"
dokument = "dokument"
ect = "ect"
ede = "ede"
equivalen = "equivalen"
evn = "evn"
fied = "fied"
fpt = "fpt"
fre = "fre"
garanties = "garanties"
hel = "hel"
implemen = "implemen"
indien = "indien"
ine = "ine"
# Toronto Maple Leafs is the official team name used by the XLSX fixture. ~keep
Leafs = "Leafs"
markdwon = "markdwon"
multipl = "multipl"
normale = "normale"
paeth = "paeth"
parms = "parms"
proce = "proce"
proces = "proces"
rturned = "rturned"
stap = "stap"
teh = "teh"
thic = "thic"
versoin = "versoin"
wel = "wel"
# flate2 crate + PDF FlateDecode filter (THE ORIGINAL BUG: flate -> flat)
# Corpus fixture identifier preserves this source filename spelling. ~keep
Availabilty = "Availabilty"
# OpenType table names, not truncated English: `loca` (index-to-location),
# `trak` (tracking). ~keep
loca = "loca"
trak = "trak"
flate = "flate"
delocate = "delocate"
thw = "thw"
arange = "arange"
mmaped = "mmaped"
layrnorm = "layrnorm"
seperator = "seperator"
ser = "ser"
ake = "ake"
algoritmos = "algoritmos"
kreuzberg = "kreuzberg"
tesseract = "tesseract"
onnx = "onnx"
surrealdb = "surrealdb"
tbe = "tbe"
docling = "docling"
markitdown = "markitdown"
pymupdf = "pymupdf"
openwebui = "openwebui"
webui = "webui"
rumdl = "rumdl"
opf = "opf"
# "Tower"/"lower" substring in pdf/structure/lines.rs #1291 tests + CHANGELOG. ~keep
ower = "ower"
hocr = "hocr"
odf = "odf"
multline = "multline"
headerr = "headerr"
pard = "pard"
edn = "edn"
siz = "siz"
inh = "inh"
bre = "bre"
yor = "yor"
extention = "extention"
portait = "portait"
fith = "fith"
threed = "threed"
chlidren = "chlidren"
formated = "formated"
specifing = "specifing"
similarily = "similarily"
execpt = "execpt"
faiure = "faiure"
substract = "substract"
charater = "charater"
cliper = "cliper"
splitted = "splitted"
unparseable = "unparseable"
relatie = "relatie"
traineddata = "traineddata"
tha = "tha"
ist = "ist"
internacional = "internacional"
utiliza = "utiliza"
caf = "caf"
hom = "hom"
ths = "ths"
ment = "ment"
mis = "mis"
helo = "helo"
ove = "ove"
tre = "tre"
thr = "thr"
programa = "programa"
cursos = "cursos"
excepcional = "excepcional"
ein = "ein"
legt = "legt"
# libwpd upstream enum WPD_PASSWORD_MISSMATCH_ERROR (inc/libwpd/WPDocument.h) — upstream's own spelling, cannot rename. ~keep
missmatch = "missmatch"
# benchmark fixture id ft_ACN_2009_page_102_t0 in bench_matrix.rs. ~keep
acn = "acn"
[workspace.poly.typos.extend-identifiers]
PyMuPDF = "PyMuPDF"
MarkItDown = "MarkItDown"
SurrealDB = "SurrealDB"
PDFium = "PDFium"
WebUI = "WebUI"
traineddata = "traineddata"
[workspace.poly.per-file-ignores]
# Alef-generated binding output — never hand-clean comments; regeneration owns them. ~keep
".cargo/config.toml" = ["comment", "doc-comment"]
"Package.swift" = ["comment", "doc-comment"]
"packages/**" = ["comment", "doc-comment"]
"crates/xberg-node/**" = ["comment", "doc-comment"]
"crates/xberg-php/**" = ["comment", "doc-comment"]
"crates/xberg-jni/**" = ["comment", "doc-comment"]
# xberg-ffi/py/wasm are MIXED: only src/lib.rs (+ ffi build.rs/cbindgen.toml) is
# alef-generated; the other modules are hand-written and get the uncomment sweep. ~keep
"crates/xberg-ffi/src/lib.rs" = ["comment", "doc-comment"]
"crates/xberg-ffi/build.rs" = ["comment", "doc-comment"]
"crates/xberg-ffi/cbindgen.toml" = ["comment", "doc-comment"]
"crates/xberg-ffi/include/xberg.h" = ["comment", "doc-comment"]
"crates/xberg-py/src/lib.rs" = ["comment", "doc-comment"]
"crates/xberg-wasm/src/lib.rs" = ["comment", "doc-comment"]
"**/text_repair.rs" = ["typo"]
# Executable CI helper (git mode 100755); poly runs ruff via stdin and cannot
# see the exec bit, so EXE001 always false-fires on shebang'd scripts. ~keep
"scripts/ci/docker/test_docker.py" = ["EXE001"]
"crates/xberg-node/index.js" = ["no-unused-vars"]
"crates/xberg-node/format-metadata-wrapper.js" = ["no-unused-vars"]
"docker/**" = ["DL3006", "DL3059"]
"e2e/**/*.py" = ["A001", "N801"]
"scripts/**/*.py" = [
"B023",
"C901",
"D101",
"D102",
"D103",
"D415",
"E702",
"ERA001",
"PERF203",
"PERF401",
"PLC0415",
"PLR0912",
"PLR0915",
"PLW2901",
"PT018",
"PTH108",
"PTH123",
"S101",
"S108",
"S311",
"S607",
"SIM105",
"SIM115",
"T201",
]
"tools/benchmark-harness/python_baselines/*.py" = [
"ANN001",
"ANN201",
"ANN202",
"ARG001",
"BLE001",
"C901",
"D103",
"G004",
"INP001",
"PERF401",
"PLC0415",
"PLR0911",
"PLR0912",
"PLR0915",
"PLW2901",
"PTH123",
"S607",
"T201",
]
"tools/benchmark-harness/scripts/*.py" = [
"ANN001",
"ANN201",
"ANN202",
"ARG001",
"BLE001",
"C901",
"D103",
"E741",
"EXE001",
"EXE002",
"F841",
"INP001",
"N818",
"PERF203",
"PERF401",
"PIE810",
"PLC0206",
"PLC0415",
"PLR0911",
"PLR0912",
"PLR0915",
"PLR1714",
"PLW1510",
"PLW2901",
"PTH110",
"PTH112",
"PTH118",
"PTH119",
"PTH122",
"PTH123",
"RET504",
"S314",
"S607",
"SIM108",
"SIM115",
"T201",
]
"tools/perf/*.py" = ["D103", "T201"]
"cli-proxy/pypi/**/*.py" = ["ANN001", "ANN202", "S310", "T201"]
"packages/python/build.py" = ["INP001"]
"tools/generate_test_fixtures/**/*.py" = [
"D301",
"ERA001",
"PERF401",
"PLC0415",
"PT001",
"S101",
"SIM117",
"T201",
"TC003",
]
"tools/benchmark-harness/scripts/*.php" = ["no-unescaped-output"]
# alef-generated Python entrypoint; RET504 fires on the passthrough return alef
# emits. Do not hand-fix generated code — suppress instead. Uses a distinct
# glob from the builtin "**/api.py" default (same builtin key can't be
# re-declared here without producing a duplicate poly.toml key). ~keep
"packages/python/**/api.py" = ["RET504"]
# Test-code relaxations on top of the builtin "**/tests/**" defaults: tests
# access private members (SLF001), use lazy/local imports (PLC0415), and
# inject unused pytest fixtures (PT019). Scoped to *.py (a distinct glob from
# the builtin "**/tests/**" key) since these are ruff-only codes. ~keep
"**/tests/**/*.py" = ["PT019", "PLC0415", "SLF001"]
# Example scripts: legitimately print output, aren't packages, and skip full
# annotations/docstrings. Not a builtin default — declared here in full. ~keep
"**/examples/**" = ["ANN", "D100", "D103", "I001", "INP001", "PLR2004", "S101", "PLC0415", "SLF001", "T201", "typo"]
[[crates]]
name = "xberg"
core_import = "xberg"
error_type = "XbergError"
error_constructor = "xberg::XbergError::Other({msg})"
version_from = "Cargo.toml"
workspace_root = "."
sources = [
"crates/xberg/src/lib.rs",
"crates/xberg/src/error.rs",
"crates/xberg/src/types/extraction.rs",
"crates/xberg/src/types/metadata.rs",
"crates/xberg/src/types/page.rs",
"crates/xberg/src/types/tables.rs",
"crates/xberg/src/types/annotations.rs",
"crates/xberg/src/types/document_structure.rs",
"crates/xberg/src/types/ocr_elements.rs",
"crates/xberg/src/types/formats.rs",
"crates/xberg/src/types/uri.rs",
"crates/xberg/src/types/djot.rs",
"crates/xberg/src/types/internal.rs",
"crates/xberg/src/types/form_field.rs",
"crates/xberg/src/types/formula.rs",
"crates/xberg/src/core/config/mod.rs",
"crates/xberg/src/core/config/extraction/types.rs",
"crates/xberg/src/core/config/extraction/core.rs",
"crates/xberg/src/core/config/extraction/file_config.rs",
"crates/xberg/src/core/config/ocr.rs",
"crates/xberg/src/core/config/page.rs",
"crates/xberg/src/core/config/pdf.rs",
"crates/xberg/src/core/config/html_output.rs",
"crates/xberg/src/core/config/layout.rs",
"crates/xberg/src/core/config/acceleration.rs",
"crates/xberg/src/core/config/llm.rs",
"crates/xberg/src/core/config/content_filter.rs",
"crates/xberg/src/core/config/tree_sitter.rs",
"crates/xberg/src/core/config/email.rs",
"crates/xberg/src/core/config/formats.rs",
"crates/xberg/src/core/mime.rs",
"crates/xberg/src/core/formats.rs",
"crates/xberg/src/plugins/traits.rs",
"crates/xberg/src/plugins/embedding.rs",
"crates/xberg/src/plugins/reranker.rs",
"crates/xberg/src/plugins/tokenizer.rs",
"crates/xberg/src/plugins/registry/mod.rs",
"crates/xberg/src/plugins/registry/reranker.rs",
"crates/xberg/src/core/config/reranker.rs",
"crates/xberg/src/reranking/mod.rs",
"crates/xberg/src/rendering/mod.rs",
"crates/xberg/src/keywords/mod.rs",
"crates/xberg/src/chunking/mod.rs",
"crates/xberg/src/text/markdown_footnotes/mod.rs",
"crates/xberg/src/embeddings/mod.rs",
"crates/xberg/src/language_detection/mod.rs",
"crates/xberg/src/cache/core.rs",
"crates/xberg/src/presets/types.rs",
"crates/xberg/src/presets/resolve.rs",
"crates/xberg/src/heuristics/structured.rs",
"crates/xberg/src/core/extract/mod.rs",
"crates/xberg/src/pdf/render.rs",
"crates/xberg/src/pdf/metadata.rs",
"crates/xberg/src/extraction/office_metadata/mod.rs",
"crates/xberg/src/extraction/office_metadata/core_properties.rs",
"crates/xberg/src/extraction/office_metadata/app_properties.rs",
"crates/xberg/src/extraction/office_metadata/custom_properties.rs",
"crates/xberg/src/extraction/office_metadata/odt_properties.rs",
"crates/xberg/src/ocr/types.rs",
"crates/xberg/src/paddle_ocr/mod.rs",
"crates/xberg/src/plugins/ocr.rs",
"crates/xberg/src/plugins/extractor/trait.rs",
"crates/xberg/src/plugins/extractor/mod.rs",
"crates/xberg/src/plugins/renderer.rs",
"crates/xberg/src/plugins/validator/mod.rs",
"crates/xberg/src/plugins/processor/trait.rs",
"crates/xberg/src/plugins/processor/mod.rs",
]
features = [
"full",
"pdf",
"ocr",
"paddle-ocr",
"paddle-ocr-types",
"layout-detection",
"layout-types",
"embeddings",
"embedding-presets",
"reranker",
"reranker-presets",
"sparse-embeddings",
"sparse-embedding-presets",
"late-interaction",
"late-interaction-presets",
"chunking",
"keywords-yake",
"keywords-rake",
"language-detection",
"html",
"tree-sitter",
"office",
"email",
"archives",
"stopwords",
"auto-rotate",
"auto-rotate-types",
"tokio-runtime",
"api",
"api-types",
"mcp",
"liter-llm",
"quality",
# alef-emitted `#[cfg(feature = "X")]` arms in binding lib.rs don't trip
"svg",
"transcription",
"transcription-types",
"classification",
"captioning",
"ner-onnx",
"ner-llm",
"diff",
"markdown-footnotes",
"redaction",
"enrichment",
"heuristics",
"presets",
"structured",
"url-ingestion",
]
[[crates.source_crates]]
name = "crawlberg"
from_registry = true
sources = ["src/types/config.rs", "src/types/discovery.rs", "src/types/results.rs", "src/net/ssrf.rs"]
roots = ["crawlberg::CrawlConfig", "crawlberg::MapResult"]
[[crates.source_crates]]
name = "html-to-markdown-rs"
# Read from the vendored registry copy, not a sibling checkout. html-to-markdown-rs is a
# plain registry dependency, so `../html-to-markdown/...` only resolves in a developer
# checkout that happens to sit next to that repo — it is absent on CI and in any git
# worktree, where it aborts the run with "failed to compute sources hash". ~keep
from_registry = true
sources = ["src/options/conversion.rs", "src/options/preprocessing.rs", "src/options/validation.rs"]
roots = ["html_to_markdown_rs::ConversionOptions"]
[crates.extra_dependencies]
crawlberg = { workspace = true, default-features = false }
html-to-markdown-rs = { workspace = true, default-features = false }
[crates.python]
module_name = "_xberg"
exclude_types = ["PooledString"]
exclude_functions = [
"calculate_quality_score",
"count_tokens",
"embed_texts",
"extract_sync",
"extract_batch_sync",
"extract_bytes",
"extract_bytes_sync",
"extract_file",
"extract_file_sync",
"batch_extract_bytes",
"batch_extract_bytes_sync",
"batch_extract_files",
"batch_extract_files_sync",
"register_document_extractor",
"register_renderer",
"unregister_document_extractor",
"unregister_renderer",
"embed_sparse",
"embed_sparse_async",
"embed_multi_vector",
"embed_multi_vector_async",
]
reexported_types = ["ExtractionResult", "ExtractedDocument", "ExtractionDiff"]
[crates.python.stubs]
output = "packages/python/xberg/"
# Every `target_dep_overrides` block below sets `default_features = false`, which
# replaces the core crate's `default = ["tokio-runtime", "simd-utf8"]` rather than
# adding to it. Each `*-target` feature reaches `tokio-runtime` transitively, but
# none reaches `simd-utf8`, so it must be listed explicitly or SIMD UTF-8
# validation is silently compiled out of every Windows, macOS-Intel and Android
# binding build.
#
# This applies to `target_dep_overrides` ONLY, because those govern the dep on the
# core `xberg` crate. It must NOT be copied to `[[crates.swift.ffi_target_dep_overrides]]`,
# which governs the dep on `xberg-ffi` — a crate that has no `simd-utf8` feature at
# all, so listing it there makes the generated swift manifest fail to resolve. ~keep
[[crates.python.target_dep_overrides]]
cfg = 'target_os = "windows"'
features = ["windows-target", "simd-utf8"]
default_features = false
[[crates.python.target_dep_overrides]]
cfg = 'all(target_os = "macos", target_arch = "x86_64")'
features = ["macos-intel-target", "simd-utf8"]
default_features = false
[crates.node]
package_name = "@xberg-io/xberg"
# Intel macOS (darwin-x64) is dropped: Microsoft ships no x86_64-macOS ONNX
# Runtime prebuilt, so CI provisions ORT via Homebrew, whose bottle links a
# non-relocatable abseil closure that cannot be vendored into a portable .node.
# Intel Mac users run the arm64 binding under Rosetta or use the WASM package. ~keep
# Windows ARM64 (win32-arm64-msvc) is dropped for parity: no other xberg binding
# ships Windows on ARM64 (every native build targets x86_64-pc-windows-msvc only),
# so the target is excluded rather than leaving a declared-but-unbuilt sub-package. ~keep
exclude_platforms = ["darwin-x64", "win32-arm64-msvc"]
exclude_types = ["StreamReader", "PooledString"]
exclude_functions = [
"calculate_quality_score",
"count_tokens",
"embed_texts",
"extract_sync",
"extract_batch_sync",
"extract_bytes",
"extract_bytes_sync",
"extract_file",
"extract_file_sync",
"batch_extract_bytes",
"batch_extract_bytes_sync",
"batch_extract_files",
"batch_extract_files_sync",
"embed_sparse",
"embed_sparse_async",
"embed_multi_vector",
"embed_multi_vector_async",
]
[crates.node.extra_dependencies]
# Required by alef-emitted #[serde_with::serde_as] attribute on HashMap<_, Vec<u8>>
serde_with = "3"
[[crates.node.target_dep_overrides]]
cfg = 'target_os = "windows"'
features = ["windows-target", "simd-utf8"]
default_features = false
[[crates.node.target_dep_overrides]]
cfg = 'all(target_os = "macos", target_arch = "x86_64")'
features = ["macos-intel-target", "simd-utf8"]
default_features = false
[crates.ruby]
gem_name = "xberg"
# Keep HEIC out of generated wrapper defaults and the core dependency so the
# MinGW target override cannot be widened back to the unsupported full set.
excluded_default_features = ["heic"]
exclude_functions = [
"calculate_quality_score",
"count_tokens",
"embed_texts",
"extract_sync",
"extract_batch_sync",
"extract_bytes",
"extract_bytes_sync",
"extract_file",
"extract_file_sync",
"batch_extract_bytes",
"batch_extract_bytes_sync",
"batch_extract_files",
"batch_extract_files_sync",
"embed_sparse",
"embed_sparse_async",
"embed_multi_vector",
"embed_multi_vector_async",
]
[crates.ruby.stubs]
output = "packages/ruby/sig/"
# `windows-gnu-target`, NOT `windows-target`. RubyInstaller's Windows Ruby is a MinGW/UCRT
# build rather than MSVC, so ../actions/build-ruby-gem forces the GNU Rust toolchain and
# CARGO_BUILD_TARGET=x86_64-pc-windows-gnu. `windows-target` pulls `ort-bundled`, which has no
# prebuilt for x86_64-pc-windows-gnu, so the gem fails to link. `windows-gnu-target`
# (crates/xberg/Cargo.toml:893) mirrors `windows-target` 1:1 minus the ORT-dependent leaves.
# Ruby is the only binding that needs this — every other Windows target is MSVC. ~keep
[[crates.ruby.target_dep_overrides]]
cfg = 'target_os = "windows"'
features = ["windows-gnu-target", "simd-utf8"]
default_features = false
[[crates.ruby.target_dep_overrides]]
cfg = 'all(target_os = "macos", target_arch = "x86_64")'
features = ["macos-intel-target", "simd-utf8"]
default_features = false
[crates.php]
extension_name = "xberg"
exclude_types = [
"ChunkerType",
"OutputFormat",
"EmbeddingModelType",
"UriKind",
"ChunkType",
# that trigger E0716/E0596/E0507 in the #[php_impl] macro expansion.
"PooledString",
"ChunkSizing",
"NodeContent",
"OcrBoundingGeometry",
]
exclude_functions = [
"calculate_quality_score",
"count_tokens",
"embed_texts",
"extract_sync",
"extract_batch_sync",
"extract_bytes",
"extract_bytes_sync",
"extract_file",
"extract_file_sync",
"batch_extract_bytes",
"batch_extract_bytes_sync",
"batch_extract_files",
"batch_extract_files_sync",
# conditions to work around ext-php-rs's #[php_impl] macro unconditional
"embed_sparse",
"embed_sparse_async",