linkedparticles-core 1.132.1__tar.gz
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.
- linkedparticles_core-1.132.1/LICENSE +201 -0
- linkedparticles_core-1.132.1/NOTICE +18 -0
- linkedparticles_core-1.132.1/PKG-INFO +94 -0
- linkedparticles_core-1.132.1/README.md +48 -0
- linkedparticles_core-1.132.1/artifacts/conformance/README.md +171 -0
- linkedparticles_core-1.132.1/artifacts/conformance/profile.yaml +468 -0
- linkedparticles_core-1.132.1/artifacts/conformance/similarity_vectors.json +272 -0
- linkedparticles_core-1.132.1/artifacts/schemas/context.jsonld +160 -0
- linkedparticles_core-1.132.1/artifacts/schemas/interchange.schema.json +258 -0
- linkedparticles_core-1.132.1/artifacts/schemas/particle.schema.json +394 -0
- linkedparticles_core-1.132.1/artifacts/schemas/shacl/CorpusSnapshotShape.ttl +46 -0
- linkedparticles_core-1.132.1/artifacts/schemas/shacl/ParticleShape.ttl +374 -0
- linkedparticles_core-1.132.1/artifacts/schemas/shacl/ProvenanceChainShape.ttl +30 -0
- linkedparticles_core-1.132.1/artifacts/schemas/shacl/SubjectShape.ttl +79 -0
- linkedparticles_core-1.132.1/artifacts/schemas/shacl/TrustStatementShape.ttl +71 -0
- linkedparticles_core-1.132.1/artifacts/schemas/trust_lens.schema.json +276 -0
- linkedparticles_core-1.132.1/constraints.txt +429 -0
- linkedparticles_core-1.132.1/particles/__init__.py +32 -0
- linkedparticles_core-1.132.1/particles/config.py +2899 -0
- linkedparticles_core-1.132.1/particles/conformance/__init__.py +1 -0
- linkedparticles_core-1.132.1/particles/conformance/_resources.py +14 -0
- linkedparticles_core-1.132.1/particles/conformance/contract.py +252 -0
- linkedparticles_core-1.132.1/particles/conformance/fixtures.py +202 -0
- linkedparticles_core-1.132.1/particles/conformance/jsonschema.py +68 -0
- linkedparticles_core-1.132.1/particles/conformance/profile.py +245 -0
- linkedparticles_core-1.132.1/particles/conformance/runner.py +269 -0
- linkedparticles_core-1.132.1/particles/conformance/shacl.py +260 -0
- linkedparticles_core-1.132.1/particles/conformance/types.py +190 -0
- linkedparticles_core-1.132.1/particles/conformance/validator.py +438 -0
- linkedparticles_core-1.132.1/particles/core/__init__.py +1 -0
- linkedparticles_core-1.132.1/particles/core/_resources.py +36 -0
- linkedparticles_core-1.132.1/particles/core/cascade_gate.py +62 -0
- linkedparticles_core-1.132.1/particles/core/claims.py +220 -0
- linkedparticles_core-1.132.1/particles/core/conflict_resolution.py +353 -0
- linkedparticles_core-1.132.1/particles/core/duplicate_key.py +90 -0
- linkedparticles_core-1.132.1/particles/core/equivalence.py +34 -0
- linkedparticles_core-1.132.1/particles/core/fingerprint.py +37 -0
- linkedparticles_core-1.132.1/particles/core/granularity.py +52 -0
- linkedparticles_core-1.132.1/particles/core/jsonld_context.py +73 -0
- linkedparticles_core-1.132.1/particles/core/schema.py +1977 -0
- linkedparticles_core-1.132.1/particles/core/scoring/__init__.py +41 -0
- linkedparticles_core-1.132.1/particles/core/scoring/confidence.py +154 -0
- linkedparticles_core-1.132.1/particles/core/scoring/decay.py +86 -0
- linkedparticles_core-1.132.1/particles/core/scoring/relevance.py +358 -0
- linkedparticles_core-1.132.1/particles/core/scoring/utility.py +421 -0
- linkedparticles_core-1.132.1/particles/core/stance.py +79 -0
- linkedparticles_core-1.132.1/particles/core/status.py +83 -0
- linkedparticles_core-1.132.1/particles/embeddings.py +266 -0
- linkedparticles_core-1.132.1/particles/extraction/__init__.py +1 -0
- linkedparticles_core-1.132.1/particles/extraction/calibration.py +451 -0
- linkedparticles_core-1.132.1/particles/extraction/docstrings.py +355 -0
- linkedparticles_core-1.132.1/particles/extraction/general.py +2232 -0
- linkedparticles_core-1.132.1/particles/extraction/github/__init__.py +80 -0
- linkedparticles_core-1.132.1/particles/extraction/github/_shared.py +238 -0
- linkedparticles_core-1.132.1/particles/extraction/github/gist.py +524 -0
- linkedparticles_core-1.132.1/particles/extraction/github/pages.py +104 -0
- linkedparticles_core-1.132.1/particles/extraction/github/repo.py +72 -0
- linkedparticles_core-1.132.1/particles/extraction/hackernews.py +590 -0
- linkedparticles_core-1.132.1/particles/extraction/incremental.py +363 -0
- linkedparticles_core-1.132.1/particles/extraction/journal.py +535 -0
- linkedparticles_core-1.132.1/particles/extraction/mastodon.py +880 -0
- linkedparticles_core-1.132.1/particles/extraction/nomisma.py +316 -0
- linkedparticles_core-1.132.1/particles/extraction/numista/__init__.py +53 -0
- linkedparticles_core-1.132.1/particles/extraction/numista/_shared.py +178 -0
- linkedparticles_core-1.132.1/particles/extraction/numista/coin.py +420 -0
- linkedparticles_core-1.132.1/particles/extraction/numista/issuer.py +200 -0
- linkedparticles_core-1.132.1/particles/extraction/numista/listing.py +204 -0
- linkedparticles_core-1.132.1/particles/extraction/polarity.py +76 -0
- linkedparticles_core-1.132.1/particles/extraction/property_keys.py +45 -0
- linkedparticles_core-1.132.1/particles/extraction/rdf.py +856 -0
- linkedparticles_core-1.132.1/particles/extraction/reddit.py +700 -0
- linkedparticles_core-1.132.1/particles/extraction/registry.py +206 -0
- linkedparticles_core-1.132.1/particles/extraction/scope.py +118 -0
- linkedparticles_core-1.132.1/particles/extraction/structure.py +288 -0
- linkedparticles_core-1.132.1/particles/extraction/subject_gate.py +142 -0
- linkedparticles_core-1.132.1/particles/extraction/subject_scope.py +82 -0
- linkedparticles_core-1.132.1/particles/extraction/taxonomy.py +109 -0
- linkedparticles_core-1.132.1/particles/extraction/trust_lens.py +113 -0
- linkedparticles_core-1.132.1/particles/extraction/wikidata.py +490 -0
- linkedparticles_core-1.132.1/particles/http.py +225 -0
- linkedparticles_core-1.132.1/particles/interchange/__init__.py +55 -0
- linkedparticles_core-1.132.1/particles/interchange/codec.py +478 -0
- linkedparticles_core-1.132.1/particles/interchange/jsonl.py +55 -0
- linkedparticles_core-1.132.1/particles/interchange/yaml_ld.py +88 -0
- linkedparticles_core-1.132.1/particles/llm/__init__.py +73 -0
- linkedparticles_core-1.132.1/particles/llm/adapters/__init__.py +12 -0
- linkedparticles_core-1.132.1/particles/llm/adapters/anthropic.py +474 -0
- linkedparticles_core-1.132.1/particles/llm/adapters/local.py +29 -0
- linkedparticles_core-1.132.1/particles/llm/adapters/openai_compat.py +495 -0
- linkedparticles_core-1.132.1/particles/llm/client.py +45 -0
- linkedparticles_core-1.132.1/particles/llm/errors.py +53 -0
- linkedparticles_core-1.132.1/particles/llm/fencing.py +91 -0
- linkedparticles_core-1.132.1/particles/llm/pool.py +242 -0
- linkedparticles_core-1.132.1/particles/llm/registry.py +477 -0
- linkedparticles_core-1.132.1/particles/py.typed +0 -0
- linkedparticles_core-1.132.1/particles/render/__init__.py +19 -0
- linkedparticles_core-1.132.1/particles/render/markdown.py +996 -0
- linkedparticles_core-1.132.1/particles/secrets.py +189 -0
- linkedparticles_core-1.132.1/particles/url_canonical.py +217 -0
- linkedparticles_core-1.132.1/particles/url_safety.py +242 -0
- linkedparticles_core-1.132.1/pyproject.toml +221 -0
- linkedparticles_core-1.132.1/tests/__init__.py +1 -0
- linkedparticles_core-1.132.1/tests/_client_fixtures.py +183 -0
- linkedparticles_core-1.132.1/tests/_upstream.py +38 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/MANIFEST.yaml +67 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/hackernews-thread-001/content.bin +42 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/hackernews-thread-001/manifest.yaml +19 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/hackernews-thread-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/journal-entry-001/content.bin +13 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/journal-entry-001/manifest.yaml +24 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/journal-entry-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/mastodon-thread-001/content.bin +1 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/mastodon-thread-001/manifest.yaml +30 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/mastodon-thread-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/nomisma-concept-001/content.bin +30 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/nomisma-concept-001/manifest.yaml +34 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/nomisma-concept-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-coin-001/content.bin +30 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-coin-001/manifest.yaml +16 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-coin-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-issuer-001/content.bin +33 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-issuer-001/manifest.yaml +30 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-issuer-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-listing-001/content.bin +22 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-listing-001/manifest.yaml +32 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/numista-listing-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/rdf-graph-001/content.bin +39 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/rdf-graph-001/manifest.yaml +35 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/rdf-graph-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/reddit-thread-001/content.bin +1 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/reddit-thread-001/manifest.yaml +20 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/reddit-thread-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/taxonomy-coins-001/content.bin +11 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/taxonomy-coins-001/manifest.yaml +18 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/taxonomy-coins-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/trust-lens-001/content.bin +15 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/trust-lens-001/manifest.yaml +18 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/trust-lens-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-001/content.bin +63 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-001/manifest.yaml +31 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-002/content.bin +57 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-002/manifest.yaml +29 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-article-002/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-essay-001/content.bin +60 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-essay-001/manifest.yaml +27 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-essay-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-interview-001/content.bin +60 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-interview-001/manifest.yaml +32 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/web-interview-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/wikidata-entity-001/content.bin +60 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/wikidata-entity-001/manifest.yaml +40 -0
- linkedparticles_core-1.132.1/tests/conformance/fixtures/wikidata-entity-001/snapshot.json +14 -0
- linkedparticles_core-1.132.1/tests/conftest.py +19 -0
- linkedparticles_core-1.132.1/tests/fixtures/scope/normative-rule-file.md +23 -0
- linkedparticles_core-1.132.1/tests/fixtures/scope/normative-rule-file.recorded.json +8 -0
- linkedparticles_core-1.132.1/tests/fixtures/scope/rule-file-agents-md.md +84 -0
- linkedparticles_core-1.132.1/tests/fixtures/scope/rule-file-agents-md.recorded.json +9 -0
- linkedparticles_core-1.132.1/tests/test_confidence.py +267 -0
- linkedparticles_core-1.132.1/tests/test_conformance_fixture_gen.py +97 -0
- linkedparticles_core-1.132.1/tests/test_conformance_similarity_vectors.py +86 -0
- linkedparticles_core-1.132.1/tests/test_conformance_validator.py +797 -0
- linkedparticles_core-1.132.1/tests/test_embeddings.py +209 -0
- linkedparticles_core-1.132.1/tests/test_extraction_vision.py +281 -0
- linkedparticles_core-1.132.1/tests/test_interchange_schema.py +143 -0
- linkedparticles_core-1.132.1/tests/test_llm_pool.py +219 -0
- linkedparticles_core-1.132.1/tests/test_schema.py +214 -0
- linkedparticles_core-1.132.1/tests/test_secrets.py +206 -0
- linkedparticles_core-1.132.1/tests/test_url_canonical.py +146 -0
- linkedparticles_core-1.132.1/tests/test_validity_extraction.py +254 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Particles
|
|
2
|
+
Copyright 2026 The Particles authors
|
|
3
|
+
|
|
4
|
+
This product includes software developed by the Particles project
|
|
5
|
+
(https://github.com/LinkedParticles/particles-core-py).
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0. See the LICENSE file.
|
|
8
|
+
|
|
9
|
+
"Particles" is the name of this project and standard. The name and any
|
|
10
|
+
conformance claims ("Particles-compatible", "conforms to the Particles
|
|
11
|
+
standard") are reserved by the project and are not granted by the code
|
|
12
|
+
license above. Use of the code is permitted under Apache-2.0; use of the
|
|
13
|
+
name to describe a derivative or competing product is not.
|
|
14
|
+
|
|
15
|
+
The standard's prose — the documents under docs/spec/ (whitepaper,
|
|
16
|
+
technical specification) — is licensed under Creative Commons
|
|
17
|
+
Attribution 4.0 International (CC-BY-4.0), not Apache-2.0. See
|
|
18
|
+
docs/spec/LICENSE.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: linkedparticles-core
|
|
3
|
+
Version: 1.132.1
|
|
4
|
+
Summary: Client layer of the Particles reference implementation — store-free schema, extraction, and interchange
|
|
5
|
+
Project-URL: Homepage, https://github.com/LinkedParticles/particles-core-py
|
|
6
|
+
Project-URL: Repository, https://github.com/LinkedParticles/particles-core-py
|
|
7
|
+
Project-URL: Issues, https://github.com/LinkedParticles/particles-core-py/issues
|
|
8
|
+
Author: The Particles authors
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
Keywords: agents,beliefs,citations,epistemic,knowledge-graph,knowledge-management,llm,provenance,psum,rag,uncertainty
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: anthropic>=0.28
|
|
27
|
+
Requires-Dist: html2text>=2024.2
|
|
28
|
+
Requires-Dist: httpx>=0.27
|
|
29
|
+
Requires-Dist: jsonschema>=4.22
|
|
30
|
+
Requires-Dist: lxml-stubs>=0.5.1
|
|
31
|
+
Requires-Dist: numpy>=1.26
|
|
32
|
+
Requires-Dist: opentelemetry-api>=1.27
|
|
33
|
+
Requires-Dist: pydantic>=2.7
|
|
34
|
+
Requires-Dist: pyld<4,>=2.0
|
|
35
|
+
Requires-Dist: pypdf>=6.15.0
|
|
36
|
+
Requires-Dist: pyshacl<0.32,>=0.26
|
|
37
|
+
Requires-Dist: pyyaml>=6.0
|
|
38
|
+
Requires-Dist: rdflib<8,>=7.0
|
|
39
|
+
Requires-Dist: scipy>=1.13
|
|
40
|
+
Requires-Dist: sentence-transformers>=2.7
|
|
41
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
42
|
+
Requires-Dist: torch
|
|
43
|
+
Provides-Extra: vision
|
|
44
|
+
Requires-Dist: pypdfium2>=4.30; extra == 'vision'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# linkedparticles-core
|
|
48
|
+
|
|
49
|
+
> **Particles is shared memory for humans and AI agents.** Each particle is one
|
|
50
|
+
> claim, plus what you need to judge it: who said it, where, when, and how
|
|
51
|
+
> confident they were. Facts, opinions, and memories are all claims, recorded
|
|
52
|
+
> the same way as particles. Particles are not edited or deleted. Particles are
|
|
53
|
+
> superseded, retracted, or disputed in the open. How much to trust it is a
|
|
54
|
+
> perspective applied at query time, never baked into the record.
|
|
55
|
+
|
|
56
|
+
The store-free **Client layer** of the Particles reference implementation — the
|
|
57
|
+
substrate for defining, validating, serializing, and producing candidate
|
|
58
|
+
particles without a graph or a store. This package holds the pieces that never
|
|
59
|
+
touch persistent state:
|
|
60
|
+
|
|
61
|
+
- the schema models and their invariants (immutable confidence, the status
|
|
62
|
+
machine, the Core/Extension split);
|
|
63
|
+
- the extraction layer that turns source bytes into candidate particles with
|
|
64
|
+
unresolved subject names;
|
|
65
|
+
- confidence math, the completion-provider port, embeddings, conformance
|
|
66
|
+
validation, and the pure interchange codec.
|
|
67
|
+
|
|
68
|
+
Holding or reasoning over accumulated state — reconciliation, subject
|
|
69
|
+
resolution, querying, linting — lives in the **engine** package
|
|
70
|
+
(`linkedparticles`), which depends on this one.
|
|
71
|
+
|
|
72
|
+
## Install
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install linkedparticles-core
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## The three repositories
|
|
79
|
+
|
|
80
|
+
| Repo | What it is |
|
|
81
|
+
|---|---|
|
|
82
|
+
| [`particles-standard`](https://github.com/LinkedParticles/particles-standard) | The standard: whitepaper, technical specification, normative schema + SHACL artifacts, conformance fixtures |
|
|
83
|
+
| [`particles-core-py`](https://github.com/LinkedParticles/particles-core-py) | **This repo** — the Python Client layer (`linkedparticles-core`) |
|
|
84
|
+
| [`particles-engine-py`](https://github.com/LinkedParticles/particles-engine-py) | The Python Engine layer + surfaces (`linkedparticles`) |
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) and [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
93
|
+
Contributions are accepted under a Developer Certificate of Origin sign-off —
|
|
94
|
+
there is no CLA.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# linkedparticles-core
|
|
2
|
+
|
|
3
|
+
> **Particles is shared memory for humans and AI agents.** Each particle is one
|
|
4
|
+
> claim, plus what you need to judge it: who said it, where, when, and how
|
|
5
|
+
> confident they were. Facts, opinions, and memories are all claims, recorded
|
|
6
|
+
> the same way as particles. Particles are not edited or deleted. Particles are
|
|
7
|
+
> superseded, retracted, or disputed in the open. How much to trust it is a
|
|
8
|
+
> perspective applied at query time, never baked into the record.
|
|
9
|
+
|
|
10
|
+
The store-free **Client layer** of the Particles reference implementation — the
|
|
11
|
+
substrate for defining, validating, serializing, and producing candidate
|
|
12
|
+
particles without a graph or a store. This package holds the pieces that never
|
|
13
|
+
touch persistent state:
|
|
14
|
+
|
|
15
|
+
- the schema models and their invariants (immutable confidence, the status
|
|
16
|
+
machine, the Core/Extension split);
|
|
17
|
+
- the extraction layer that turns source bytes into candidate particles with
|
|
18
|
+
unresolved subject names;
|
|
19
|
+
- confidence math, the completion-provider port, embeddings, conformance
|
|
20
|
+
validation, and the pure interchange codec.
|
|
21
|
+
|
|
22
|
+
Holding or reasoning over accumulated state — reconciliation, subject
|
|
23
|
+
resolution, querying, linting — lives in the **engine** package
|
|
24
|
+
(`linkedparticles`), which depends on this one.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install linkedparticles-core
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## The three repositories
|
|
33
|
+
|
|
34
|
+
| Repo | What it is |
|
|
35
|
+
|---|---|
|
|
36
|
+
| [`particles-standard`](https://github.com/LinkedParticles/particles-standard) | The standard: whitepaper, technical specification, normative schema + SHACL artifacts, conformance fixtures |
|
|
37
|
+
| [`particles-core-py`](https://github.com/LinkedParticles/particles-core-py) | **This repo** — the Python Client layer (`linkedparticles-core`) |
|
|
38
|
+
| [`particles-engine-py`](https://github.com/LinkedParticles/particles-engine-py) | The Python Engine layer + surfaces (`linkedparticles`) |
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
43
|
+
|
|
44
|
+
## Contributing
|
|
45
|
+
|
|
46
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) and [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
47
|
+
Contributions are accepted under a Developer Certificate of Origin sign-off —
|
|
48
|
+
there is no CLA.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Particles conformance artifacts
|
|
2
|
+
|
|
3
|
+
This directory holds the **behavioural / quantitative** conformance surface of
|
|
4
|
+
the Particles standard — the ground truth a second implementation must match to
|
|
5
|
+
reproduce our numbers and decisions, complementing the **structural** artifacts
|
|
6
|
+
under `artifacts/schemas/` (JSON Schema, JSON-LD `@context`, SHACL shapes).
|
|
7
|
+
|
|
8
|
+
| File | Role | Governing ADR |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| `profile.yaml` | The **Conformance Profile** companion: constants, formulas, decay table, float tolerance, embedding profile, and deterministic test vectors. The single machine-readable source of truth for `docs/spec/conformance-profile.md`. | Profile |
|
|
11
|
+
| `similarity_vectors.json` | The frozen **embedding-similarity** test-vector set (band + top-k membership cases) — the portability instrument for the similarity substrate. | Profile |
|
|
12
|
+
|
|
13
|
+
The reference SDK self-certifies against both with `particles conformance check`
|
|
14
|
+
(L2 over `profile.yaml`'s vectors; L3 over `similarity_vectors.json`).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## `profile.yaml` — the Conformance Profile companion
|
|
19
|
+
|
|
20
|
+
Mirrors `docs/spec/conformance-profile.md`:
|
|
21
|
+
|
|
22
|
+
- **Constants** (§2) mostly carry a `config_path` — the dotted attribute on the
|
|
23
|
+
SDK's `get_config()` they restate. A drift-guard test
|
|
24
|
+
(`tests/test_conformance_profile.py`) asserts every published `value` still
|
|
25
|
+
equals the live default at that path, so the artifact never silently lags
|
|
26
|
+
`particles/config.py`. A few are **code-level** (`config_path: null`) — module
|
|
27
|
+
constants rather than config knobs, notably the §2.6 / §13.3 benchmark
|
|
28
|
+
match-semantics constants; those are drift-checked against the live
|
|
29
|
+
code default directly rather than via `config_path`.
|
|
30
|
+
- **Formulas** (§4) — `effective_confidence`, `recency_factor`, the calibration
|
|
31
|
+
apply transform, and the §6.9 noisy-OR co-evidential merge.
|
|
32
|
+
- **`embedding_profile`** — the reference `{model, dim, normalization}`, and a
|
|
33
|
+
`similarity_vectors_ref` pointer to the file below.
|
|
34
|
+
- **`test_vectors`** — the canonical input → expected cases the L2 runner
|
|
35
|
+
recomputes, covering both the §4 formulas and the §5 deterministic algorithms.
|
|
36
|
+
|
|
37
|
+
`profile_version` carries the artifact's own stamp; bump it when a default is
|
|
38
|
+
re-tuned. The loader/validator is `particles/conformance/profile.py`; the runner
|
|
39
|
+
is `particles/conformance/runner.py`.
|
|
40
|
+
|
|
41
|
+
### The `test_vectors` block
|
|
42
|
+
|
|
43
|
+
Seven families, in two kinds. The **numeric** families are the §4 formulas and
|
|
44
|
+
conform within `float_tolerance` (`1e-9` absolute); the **categorical** families
|
|
45
|
+
are the §5 algorithms, whose outputs are a verdict, a digest, a boolean and a
|
|
46
|
+
count — those must match *exactly*, since there is nothing to round.
|
|
47
|
+
|
|
48
|
+
| Family | Pins | Comparison |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `effective_confidence` | §4 read-time product, incl. the `> 1.0` clamp | `float_tolerance` |
|
|
51
|
+
| `recency_factor` | §2.3 decay, incl. the floor and the `age ≤ 0` case | `float_tolerance` |
|
|
52
|
+
| `calibration_apply` | §4 `clamp(raw/T, 0, 1)`, incl. `T < 1` saturation | `float_tolerance` |
|
|
53
|
+
| `noisy_or_merge` | §6.9 co-evidential merge with the `1/k` within-source discount | `float_tolerance` |
|
|
54
|
+
| `conflict_ladder` | §6.4 **rung ordering** | exact |
|
|
55
|
+
| `context_fingerprint` | §16.1 procedure | exact |
|
|
56
|
+
| `cascade_gate` / `cascade_cap` | §15.1 policy gate (N ≥ 3) and per-run cap | exact |
|
|
57
|
+
|
|
58
|
+
**Every vector input is plain data** — scalars, strings, and flat records, never
|
|
59
|
+
a serialized SDK object. That is the portability contract: the ladder and
|
|
60
|
+
fingerprint families take *structured* inputs, so each one publishes only the
|
|
61
|
+
fields the algorithm actually reads, and a second implementation materialises
|
|
62
|
+
its own types from them.
|
|
63
|
+
|
|
64
|
+
- `conflict_ladder` carries two particle stubs of exactly two fields —
|
|
65
|
+
`assertion_modality` (the §1.7 truth-apt gate; truth-apt iff `FALSIFIABLE`)
|
|
66
|
+
and `uncertainty_nature` (the §1 `ALEATORY` exclusion) — plus the
|
|
67
|
+
caller-resolved inputs (the replacement signal, the two supersession
|
|
68
|
+
directions, both trust scores, the differential threshold, and whether the
|
|
69
|
+
store has a single trust order). Omitted keys take the documented defaults.
|
|
70
|
+
Because the family is about *ordering*, the vectors deliberately set up rungs
|
|
71
|
+
to compete: an `ALEATORY` pair with both a supersession edge and a decisive
|
|
72
|
+
trust gap must still come out `INCONSISTENT`.
|
|
73
|
+
- `context_fingerprint` carries `(id, status)` rows rather than a bare id list,
|
|
74
|
+
so all three steps are pinned: the ACTIVE-only filter (step 1), the
|
|
75
|
+
lexicographic sort (step 2 — one vector supplies its ids out of order), and
|
|
76
|
+
the delimiter-free SHA-256 (step 3). The ids are fixed literals; the expected
|
|
77
|
+
digest is a function of those exact strings, so they must be ported verbatim.
|
|
78
|
+
|
|
79
|
+
Boundary vectors state inclusive comparisons (`N ≥ 3`, `|Δ| ≥ threshold`, a
|
|
80
|
+
batch exactly at the cap). Where such a boundary would otherwise hinge on
|
|
81
|
+
decimal-to-binary rounding, the vector overrides the input to exactly
|
|
82
|
+
representable values and says so in a comment — the case is about the
|
|
83
|
+
comparison operator, not about float representation.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## `similarity_vectors.json` — embedding-similarity vectors
|
|
88
|
+
|
|
89
|
+
The frozen test-vector set that is the portability instrument for the standard's
|
|
90
|
+
similarity substrate. It is the concrete, language-agnostic answer to "does a
|
|
91
|
+
second implementation reproduce our similarity behaviour?" — the question
|
|
92
|
+
this Profile makes answerable.
|
|
93
|
+
|
|
94
|
+
### What is pinned
|
|
95
|
+
|
|
96
|
+
Per the technical specification (§8.5, *Embedding & Similarity Contract*):
|
|
97
|
+
|
|
98
|
+
- **Similarity** is **cosine over L2-normalized embedding vectors, clamped to
|
|
99
|
+
`[0, 1]`** (negatives → 0). Every similarity threshold in the standard is
|
|
100
|
+
expressed on this normalized scale.
|
|
101
|
+
- An implementation records a structured **`embedding_profile = {model, dim,
|
|
102
|
+
normalization}`** in store metadata. A profile change requires re-embedding.
|
|
103
|
+
- The **reference profile** is
|
|
104
|
+
`{model: all-MiniLM-L6-v2, dim: 384, normalization: l2}` — declared in the
|
|
105
|
+
`profile` block of `similarity_vectors.json`.
|
|
106
|
+
|
|
107
|
+
### File format
|
|
108
|
+
|
|
109
|
+
```jsonc
|
|
110
|
+
{
|
|
111
|
+
"profile": { "model": "...", "dim": 384, "normalization": "l2" },
|
|
112
|
+
"pairs": [
|
|
113
|
+
{ "id": "equiv-01", "category": "clear-equivalent",
|
|
114
|
+
"text_a": "...", "text_b": "...", "band": [lo, hi] }
|
|
115
|
+
],
|
|
116
|
+
"topk": [
|
|
117
|
+
{ "id": "topk-01", "query": "...",
|
|
118
|
+
"corpus": [ { "id": "c1", "text": "..." }, ... ],
|
|
119
|
+
"k": 2, "expected_topk": ["c1", "c3"] }
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Bands are the conformance semantics
|
|
125
|
+
|
|
126
|
+
Each `pairs` entry declares a closed band `[lo, hi]`. A backend is
|
|
127
|
+
**profile-conformant** on that vector when, embedding `text_a` and `text_b`
|
|
128
|
+
under the declared profile and applying the pinned metric, the resulting
|
|
129
|
+
similarity lands in `[lo, hi]` **inclusive**.
|
|
130
|
+
|
|
131
|
+
Bands — **not** an `|Δ| ≤ ε` tolerance against a recorded float — are the
|
|
132
|
+
contract (resolved open question 2). They are chosen to *comfortably
|
|
133
|
+
bracket* the reference model's score with margin on both sides, so the band is a
|
|
134
|
+
real cross-implementation contract rather than an overfit to one backend's
|
|
135
|
+
floating-point output. A different conformant encoder may legitimately score
|
|
136
|
+
anywhere inside the band.
|
|
137
|
+
|
|
138
|
+
The `category` field is descriptive only (it documents what each pair probes:
|
|
139
|
+
`clear-equivalent`, `clear-unrelated`, `near-threshold`, `cross-domain`); the
|
|
140
|
+
band is what is asserted.
|
|
141
|
+
|
|
142
|
+
### Top-k cases are membership, not ordering
|
|
143
|
+
|
|
144
|
+
Each `topk` entry asserts that, ranking `corpus` by similarity to `query`, the
|
|
145
|
+
top `k` results **contain** every id in `expected_topk` (set membership, ⊇).
|
|
146
|
+
This is the deliberately weaker guarantee that layer 4 establishes: exact
|
|
147
|
+
top-k *ordering* across profiles is implementation-defined and **non-normative**.
|
|
148
|
+
The cases pin the strong, reproducible part (the clearly-relevant documents make
|
|
149
|
+
the cut) without over-claiming a total order.
|
|
150
|
+
|
|
151
|
+
### Running the vectors as a conformance check
|
|
152
|
+
|
|
153
|
+
The reference SDK exercises this file in
|
|
154
|
+
`tests/test_conformance_similarity_vectors.py` (marked
|
|
155
|
+
`@pytest.mark.integration`, since it needs the real embedding model) and via the
|
|
156
|
+
L3 path of `particles conformance check`. Both load the JSON, encode every pair
|
|
157
|
+
with the reference encoder, and assert each score falls in its band and each
|
|
158
|
+
top-k membership holds. A second implementation runs the equivalent check in its
|
|
159
|
+
own language against this same frozen file.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Maintenance
|
|
164
|
+
|
|
165
|
+
Both files are **frozen** contracts. Changing a band, a constant, a formula, or
|
|
166
|
+
the reference profile alters the conformance contract — it rides an ADR or an
|
|
167
|
+
explicit spec revision, never a silent edit. When a config default is re-tuned,
|
|
168
|
+
update `profile.yaml`'s matching constant in the same change (the drift-guard
|
|
169
|
+
test enforces this). When the *reference embedding profile* changes, re-author
|
|
170
|
+
the `similarity_vectors.json` bands against the new model and update its
|
|
171
|
+
`profile` block in the same change.
|