@disclosureos/schema 2.0.0-beta.2 → 2.0.0-beta.3
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.
- package/CHANGELOG.md +14 -0
- package/README.md +17 -3
- package/dist/experimental/v2/index.d.ts +7 -1
- package/dist/experimental/v2/index.js +75 -5
- package/dist/experimental/v2/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4f80b20: Add research-entities 0.2.0 and claim-history 0.4.0 with exact document editions, digital artifact custody, scoped identifiers and attributable artifact reviews. Validate supplied snapshot references and edition-specific citations without inferring source authenticity or complete custody. Keep existing contract schemas and explicit entry points unchanged.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4f80b20]
|
|
12
|
+
- @disclosureos/records@2.0.0-beta.3
|
|
13
|
+
- @disclosureos/instruments@2.0.0-beta.3
|
|
14
|
+
- @disclosureos/observables@2.0.0-beta.3
|
|
15
|
+
- @disclosureos/origins@2.0.0-beta.3
|
|
16
|
+
|
|
3
17
|
## 2.0.0-beta.2
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -189,10 +189,24 @@ exit handling, profile differences and non-destructive local rollback. This is a
|
|
|
189
189
|
experimental checkout workflow; merging package changes does not deploy the Index.
|
|
190
190
|
|
|
191
191
|
|
|
192
|
-
## Witnesses and accounts: C2a
|
|
192
|
+
## Witnesses and accounts: C2a
|
|
193
193
|
|
|
194
194
|
The source tree adds public witness/account/procedure declarations, entity-addressed
|
|
195
|
-
claim history 0.3.0 and supplied-snapshot review
|
|
196
|
-
|
|
195
|
+
claim history 0.3.0 and supplied-snapshot review, published in 2.0.0-beta.2.
|
|
196
|
+
See the [contract, worked example and
|
|
197
197
|
verification boundaries](../../docs/c2/README.md). Qualifications and reviewer
|
|
198
198
|
judgments remain separate; no credibility score is calculated.
|
|
199
|
+
|
|
200
|
+
## Document editions and digital custody: C2b candidate
|
|
201
|
+
|
|
202
|
+
The source tree adds research-entities 0.2.0 and claim-history 0.4.0 with exact
|
|
203
|
+
edition citations, digital custody actions, scoped identifiers and attributable
|
|
204
|
+
artifact reviews. These additions are not in published 2.0.0-beta.2. Existing
|
|
205
|
+
contract schemas and versioned entry points remain unchanged.
|
|
206
|
+
|
|
207
|
+
Use `parseArchivalEntities` / `parseArchivalClaimHistory` from records and
|
|
208
|
+
`evaluateArchivalClaimHistory` from schema through their `/experimental/v2`
|
|
209
|
+
entries. A successful supplied-document check does not authenticate source
|
|
210
|
+
artifacts, complete custody or certify a scientific profile.
|
|
211
|
+
See the [contract guide](../../docs/c2/archival.md) and
|
|
212
|
+
[worked example](../../examples/v2/archival-editions-demo/README.md).
|
|
@@ -1725,6 +1725,12 @@ interface ResearchReviewResult {
|
|
|
1725
1725
|
scientificInterpretation: "not_checked";
|
|
1726
1726
|
multiSensorFusion: "not_checked";
|
|
1727
1727
|
}
|
|
1728
|
+
|
|
1728
1729
|
declare function evaluateResearchClaimHistory(input: unknown, options: ResearchReviewOptions): Promise<ResearchReviewResult>;
|
|
1729
1730
|
|
|
1730
|
-
|
|
1731
|
+
type ArchivalReviewOptions = ResearchReviewOptions;
|
|
1732
|
+
type ArchivalReviewResult = ResearchReviewResult;
|
|
1733
|
+
/** Checks 0.4 histories and exact 0.2 entity snapshots; never fetches source files or authenticates them. */
|
|
1734
|
+
declare function evaluateArchivalClaimHistory(input: unknown, options: ArchivalReviewOptions): Promise<ArchivalReviewResult>;
|
|
1735
|
+
|
|
1736
|
+
export { ACQUISITION_BINDINGS_PROFILE, ACQUISITION_BINDINGS_SCHEMA_ID, ASSESSMENT_DOCUMENTATION_PROFILE, type AcquisitionBindingOptions, type AcquisitionBindingResult, type AcquisitionBindings, AcquisitionBindingsSchema, type ArchivalReviewOptions, type ArchivalReviewResult, type AssessmentDocumentation, type AssessmentDocumentationCompletion, type AssetCheck, type BindingAssetCheck, type BindingIssue, type BindingIssueCode, CONTEXT_MEASUREMENT_ROLES, type CompletionStatus, type ContextReviewOptions, type ContextReviewResult, DATASET_RELEASE_PROFILE, DATASET_RELEASE_SCHEMA_ID, DOCUMENTATION_COMPLETION_POLICY, DOCUMENTATION_REQUIREMENTS, type DatasetIssue, type DatasetPacketInput, type DatasetRelease, type DatasetReleaseResult, DatasetReleaseSchema, type DocumentationAction, type DocumentationCompletionResult, type DocumentationIssue, type DocumentationIssueCode, type DocumentationOptions, type DocumentationRequirement, type DocumentationRequirementId, type DocumentationResult, HISTORICAL_TESTIMONY_PROFILE, HISTORICAL_TESTIMONY_REQUIREMENTS, HISTORICAL_TESTIMONY_SELECTION_SCHEMA_ID, type HistoricalTestimonyCompletionStatus, type HistoricalTestimonyIssue, type HistoricalTestimonyReport, type HistoricalTestimonyRequirement, type HistoricalTestimonyRequirementId, type HistoricalTestimonyResult, type HistoricalTestimonySelection, HistoricalTestimonySelectionSchema, INSTRUMENT_RESEARCH_COMPLETION_POLICY, INSTRUMENT_RESEARCH_PREREQUISITES_PROFILE, INSTRUMENT_RESEARCH_REQUIREMENTS, INSTRUMENT_RESEARCH_REVIEW_SCHEMA_ID, type InstrumentResearchCompletionResult, type InstrumentResearchOptions, type InstrumentResearchResult, type InstrumentResearchReview, InstrumentResearchReviewSchema, MEASUREMENT_BINDINGS_PROFILE, MEASUREMENT_BINDINGS_SCHEMA_ID, MIGRATION_COMPATIBILITY_SCHEMA_ID, MIGRATION_LEGACY_SCORES_SCHEMA_ID, MIGRATION_RESOLUTION_SCHEMA_ID, MIGRATION_REVIEW_SCHEMA_ID, type MeasurementBindingIssue, type MeasurementBindingResult, type MeasurementBindings, MeasurementBindingsSchema, type MigrationCompatibility, MigrationCompatibilitySchema, type MigrationLegacyScores, MigrationLegacyScoresSchema, type MigrationResolution, MigrationResolutionSchema, type MigrationReview, MigrationReviewSchema, PHYSICAL_SAMPLE_PROFILE, PHYSICAL_SAMPLE_REQUIREMENTS, PHYSICAL_SAMPLE_SELECTION_SCHEMA_ID, PROFILE_EVALUATION_POLICY, PROFILE_EVALUATION_SCHEMA_ID, PROFILE_PREPARATION_SCHEMA_ID, type PhysicalSampleIssue, type PhysicalSampleRecordCheck, type PhysicalSampleReport, type PhysicalSampleRequirement, type PhysicalSampleRequirementId, type PhysicalSampleResult, type PhysicalSampleSelection, PhysicalSampleSelectionSchema, type ProductBindingCheck, type ProfileEvaluation, type ProfileEvaluationOptions, type ProfileEvaluationReceipt, type ProfileEvaluationResult, ProfileEvaluationSchema, type ProfilePreparation, ProfilePreparationSchema, RELEASED_DOCUMENT_PROFILE, RELEASED_DOCUMENT_REQUIREMENTS, RELEASED_DOCUMENT_SELECTION_SCHEMA_ID, REPRODUCTION_PACKET_PROFILE, REPRODUCTION_PACKET_SCHEMA_ID, RESEARCH_EVALUATION_POLICY, RESEARCH_EVALUATION_SCHEMA_ID, type ReleasedDocumentCompletionStatus, type ReleasedDocumentIssue, type ReleasedDocumentReport, type ReleasedDocumentRequirement, type ReleasedDocumentRequirementId, type ReleasedDocumentResult, type ReleasedDocumentSelection, ReleasedDocumentSelectionSchema, type ReproductionFileCheck, type ReproductionPacket, type ReproductionPacketResult, ReproductionPacketSchema, type ResearchCompletionAction, type ResearchCompletionRequirement, type ResearchCompletionStatus, type ResearchEvaluation, type ResearchEvaluationOptions, type ResearchEvaluationOutput, type ResearchEvaluationReceipt, type ResearchEvaluationResult, ResearchEvaluationSchema, type ResearchRequirementId, type ResearchReviewAssetCheck, type ResearchReviewOptions, type ResearchReviewResult, SOURCE_INTAKE_PROFILE, SOURCE_INTAKE_SCHEMA_ID, type SourceIntake, type SourceIntakeResult, SourceIntakeSchema, acquisitionBindingsJsonSchema, datasetReleaseJsonSchema, evaluateAcquisitionBindings, evaluateArchivalClaimHistory, evaluateAssessmentDocumentation, evaluateContextClaimHistory, evaluateDatasetRelease, evaluateDocumentationCompletion, evaluateHistoricalTestimony, evaluateInstrumentResearchCompletion, evaluateInstrumentResearchPrerequisites, evaluateMeasurementBindings, evaluatePhysicalSamples, evaluateProfileEvaluation, evaluateReleasedDocuments, evaluateReproductionPacket, evaluateResearchClaimHistory, evaluateResearchEvaluation, evaluateSourceIntake, historicalTestimonySelectionJsonSchema, instrumentResearchReviewJsonSchema, measurementBindingsJsonSchema, migrationCompatibilityJsonSchema, migrationLegacyScoresJsonSchema, migrationResolutionJsonSchema, migrationReviewJsonSchema, physicalSampleSelectionJsonSchema, profileEvaluationJsonSchema, profilePreparationJsonSchema, releasedDocumentSelectionJsonSchema, reproductionPacketJsonSchema, researchEvaluationJsonSchema, sourceIntakeJsonSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseExperimentalClaimHistory, compareUtcInstants, parseContextClaimHistory, parseObservationContext, parseExperimentalObservation, parseResearchClaimHistory, parseResearchEntities, researchEntityAssertions,
|
|
1
|
+
import { parseExperimentalClaimHistory, compareUtcInstants, parseContextClaimHistory, parseObservationContext, parseExperimentalObservation, contextAssertions, parseArchivalClaimHistory, parseResearchClaimHistory, parseArchivalEntities, parseResearchEntities, researchEntityAssertions, archivalArtifactReferences, researchEntityContextReferences } from '@disclosureos/records/experimental/v2';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { parseAcquisitionContext } from '@disclosureos/instruments/experimental/v2';
|
|
4
4
|
|
|
@@ -4939,8 +4939,8 @@ function equal2(a, b) {
|
|
|
4939
4939
|
(k) => Object.prototype.hasOwnProperty.call(y, k) && equal2(x[k], y[k])
|
|
4940
4940
|
);
|
|
4941
4941
|
}
|
|
4942
|
-
async function
|
|
4943
|
-
const history = parseResearchClaimHistory(input);
|
|
4942
|
+
async function evaluateEntityHistory(input, options, archival) {
|
|
4943
|
+
const history = archival ? parseArchivalClaimHistory(input) : parseResearchClaimHistory(input);
|
|
4944
4944
|
const issues = history.issues.map((i) => ({
|
|
4945
4945
|
code: i.code,
|
|
4946
4946
|
stage: i.stage,
|
|
@@ -5235,6 +5235,33 @@ async function evaluateResearchClaimHistory(input, options) {
|
|
|
5235
5235
|
pointer6,
|
|
5236
5236
|
"Assessment input must select an existing assertion on its named field."
|
|
5237
5237
|
);
|
|
5238
|
+
}, resolveCitation2 = function(citation, pointer6) {
|
|
5239
|
+
const document = entityDocuments.get(citation.document.sha256);
|
|
5240
|
+
if (!document) return;
|
|
5241
|
+
const edition = document.entities.find(
|
|
5242
|
+
(e) => e.kind === "source_edition" && e.id === citation.editionId
|
|
5243
|
+
);
|
|
5244
|
+
if (!edition || edition.kind !== "source_edition") {
|
|
5245
|
+
problem(
|
|
5246
|
+
"REF.ENTITY",
|
|
5247
|
+
pointer6,
|
|
5248
|
+
"Citation edition is absent from the selected entity snapshot."
|
|
5249
|
+
);
|
|
5250
|
+
return;
|
|
5251
|
+
}
|
|
5252
|
+
if (edition.artifact.sourceRef !== citation.artifact.sourceRef || edition.artifact.digest.value !== citation.artifact.digest.value)
|
|
5253
|
+
problem(
|
|
5254
|
+
"ARCHIVE.CITATION_SCOPE",
|
|
5255
|
+
pointer6,
|
|
5256
|
+
"Citation artifact differs from the selected edition, even if titles or page numbers match."
|
|
5257
|
+
);
|
|
5258
|
+
const pages = edition.fields.pageCount;
|
|
5259
|
+
if (citation.locator.kind === "page" && pages?.length === 1 && pages[0].content.state === "known" && citation.locator.page > pages[0].content.value)
|
|
5260
|
+
problem(
|
|
5261
|
+
"ARCHIVE.PAGE_BOUNDS",
|
|
5262
|
+
pointer6,
|
|
5263
|
+
"Citation exceeds the edition's explicitly declared page count."
|
|
5264
|
+
);
|
|
5238
5265
|
};
|
|
5239
5266
|
for (const [i, ref5] of history.data.contextRefs.entries()) {
|
|
5240
5267
|
const p = `/contextRefs/${i}`;
|
|
@@ -5270,7 +5297,7 @@ async function evaluateResearchClaimHistory(input, options) {
|
|
|
5270
5297
|
const p = `/entityRefs/${i}`;
|
|
5271
5298
|
const value = await load(ref5, p);
|
|
5272
5299
|
if (value === void 0) continue;
|
|
5273
|
-
const parsed = parseResearchEntities(value);
|
|
5300
|
+
const parsed = archival ? parseArchivalEntities(value) : parseResearchEntities(value);
|
|
5274
5301
|
if (!parsed.success) {
|
|
5275
5302
|
issues.push(
|
|
5276
5303
|
...parsed.issues.map((i2) => ({ ...i2, pointer: p + i2.pointer }))
|
|
@@ -5334,12 +5361,45 @@ async function evaluateResearchClaimHistory(input, options) {
|
|
|
5334
5361
|
"Account or procedure artifact is not declared in the observation."
|
|
5335
5362
|
);
|
|
5336
5363
|
}
|
|
5364
|
+
if (archival) {
|
|
5365
|
+
for (const ref6 of archivalArtifactReferences(entity)) {
|
|
5366
|
+
const source = sources.get(ref6.sourceRef);
|
|
5367
|
+
if (!source?.digest || source.digest.value !== ref6.digest.value)
|
|
5368
|
+
problem(
|
|
5369
|
+
"ARCHIVE.ARTIFACT_IDENTITY",
|
|
5370
|
+
ep,
|
|
5371
|
+
"Archival artifact must name the same SHA-256 declaration as the scoped observation inventory."
|
|
5372
|
+
);
|
|
5373
|
+
}
|
|
5374
|
+
if (entity.kind === "digital_artifact") {
|
|
5375
|
+
for (const assertion of entity.fields.declaredHashes ?? [])
|
|
5376
|
+
if ("value" in assertion.content) {
|
|
5377
|
+
for (const declaration2 of assertion.content.value)
|
|
5378
|
+
if (declaration2.hash.algorithm === "sha256" && declaration2.appliesTo.kind === "artifact" && declaration2.hash.value.toLowerCase() !== declaration2.appliesTo.reference.digest.value)
|
|
5379
|
+
problem(
|
|
5380
|
+
"ARCHIVE.HASH_DECLARATION",
|
|
5381
|
+
ep,
|
|
5382
|
+
"Declared SHA-256 differs from the selected artifact identity. No original-file or legacy hash verification is implied."
|
|
5383
|
+
);
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5337
5387
|
for (const reference of researchEntityContextReferences(entity))
|
|
5338
5388
|
resolve2(reference, ep);
|
|
5339
5389
|
}
|
|
5340
5390
|
entityDocuments.set(ref5.sha256, entities);
|
|
5341
5391
|
}
|
|
5342
5392
|
for (const [i, claim] of history.data.claims.entries()) {
|
|
5393
|
+
if (archival) {
|
|
5394
|
+
if ("editionCitation" in claim && claim.editionCitation)
|
|
5395
|
+
resolveCitation2(
|
|
5396
|
+
claim.editionCitation,
|
|
5397
|
+
`/claims/${i}/editionCitation`
|
|
5398
|
+
);
|
|
5399
|
+
if ("editionInputRefs" in claim)
|
|
5400
|
+
for (const [j, citation] of (claim.editionInputRefs ?? []).entries())
|
|
5401
|
+
resolveCitation2(citation, `/claims/${i}/editionInputRefs/${j}`);
|
|
5402
|
+
}
|
|
5343
5403
|
if (claim.subject.kind === "entity")
|
|
5344
5404
|
resolveEntity2(claim.subject.reference, `/claims/${i}/subject`);
|
|
5345
5405
|
if (claim.kind === "assessment")
|
|
@@ -5376,6 +5436,16 @@ async function evaluateResearchClaimHistory(input, options) {
|
|
|
5376
5436
|
};
|
|
5377
5437
|
}
|
|
5378
5438
|
|
|
5379
|
-
|
|
5439
|
+
// src/experimental/v2/research-entities-review.ts
|
|
5440
|
+
async function evaluateResearchClaimHistory(input, options) {
|
|
5441
|
+
return evaluateEntityHistory(input, options, false);
|
|
5442
|
+
}
|
|
5443
|
+
|
|
5444
|
+
// src/experimental/v2/archival-review.ts
|
|
5445
|
+
async function evaluateArchivalClaimHistory(input, options) {
|
|
5446
|
+
return evaluateEntityHistory(input, options, true);
|
|
5447
|
+
}
|
|
5448
|
+
|
|
5449
|
+
export { ACQUISITION_BINDINGS_PROFILE, ACQUISITION_BINDINGS_SCHEMA_ID, ASSESSMENT_DOCUMENTATION_PROFILE, AcquisitionBindingsSchema, CONTEXT_MEASUREMENT_ROLES, DATASET_RELEASE_PROFILE, DATASET_RELEASE_SCHEMA_ID, DOCUMENTATION_COMPLETION_POLICY, DOCUMENTATION_REQUIREMENTS, DatasetReleaseSchema, HISTORICAL_TESTIMONY_PROFILE, HISTORICAL_TESTIMONY_REQUIREMENTS, HISTORICAL_TESTIMONY_SELECTION_SCHEMA_ID, HistoricalTestimonySelectionSchema, INSTRUMENT_RESEARCH_COMPLETION_POLICY, INSTRUMENT_RESEARCH_PREREQUISITES_PROFILE, INSTRUMENT_RESEARCH_REQUIREMENTS, INSTRUMENT_RESEARCH_REVIEW_SCHEMA_ID, InstrumentResearchReviewSchema, MEASUREMENT_BINDINGS_PROFILE, MEASUREMENT_BINDINGS_SCHEMA_ID, MIGRATION_COMPATIBILITY_SCHEMA_ID, MIGRATION_LEGACY_SCORES_SCHEMA_ID, MIGRATION_RESOLUTION_SCHEMA_ID, MIGRATION_REVIEW_SCHEMA_ID, MeasurementBindingsSchema, MigrationCompatibilitySchema, MigrationLegacyScoresSchema, MigrationResolutionSchema, MigrationReviewSchema, PHYSICAL_SAMPLE_PROFILE, PHYSICAL_SAMPLE_REQUIREMENTS, PHYSICAL_SAMPLE_SELECTION_SCHEMA_ID, PROFILE_EVALUATION_POLICY, PROFILE_EVALUATION_SCHEMA_ID, PROFILE_PREPARATION_SCHEMA_ID, PhysicalSampleSelectionSchema, ProfileEvaluationSchema, ProfilePreparationSchema, RELEASED_DOCUMENT_PROFILE, RELEASED_DOCUMENT_REQUIREMENTS, RELEASED_DOCUMENT_SELECTION_SCHEMA_ID, REPRODUCTION_PACKET_PROFILE, REPRODUCTION_PACKET_SCHEMA_ID, RESEARCH_EVALUATION_POLICY, RESEARCH_EVALUATION_SCHEMA_ID, ReleasedDocumentSelectionSchema, ReproductionPacketSchema, ResearchEvaluationSchema, SOURCE_INTAKE_PROFILE, SOURCE_INTAKE_SCHEMA_ID, SourceIntakeSchema, acquisitionBindingsJsonSchema, datasetReleaseJsonSchema, evaluateAcquisitionBindings, evaluateArchivalClaimHistory, evaluateAssessmentDocumentation, evaluateContextClaimHistory, evaluateDatasetRelease, evaluateDocumentationCompletion, evaluateHistoricalTestimony, evaluateInstrumentResearchCompletion, evaluateInstrumentResearchPrerequisites, evaluateMeasurementBindings, evaluatePhysicalSamples, evaluateProfileEvaluation, evaluateReleasedDocuments, evaluateReproductionPacket, evaluateResearchClaimHistory, evaluateResearchEvaluation, evaluateSourceIntake, historicalTestimonySelectionJsonSchema, instrumentResearchReviewJsonSchema, measurementBindingsJsonSchema, migrationCompatibilityJsonSchema, migrationLegacyScoresJsonSchema, migrationResolutionJsonSchema, migrationReviewJsonSchema, physicalSampleSelectionJsonSchema, profileEvaluationJsonSchema, profilePreparationJsonSchema, releasedDocumentSelectionJsonSchema, reproductionPacketJsonSchema, researchEvaluationJsonSchema, sourceIntakeJsonSchema };
|
|
5380
5450
|
//# sourceMappingURL=index.js.map
|
|
5381
5451
|
//# sourceMappingURL=index.js.map
|