@disclosureos/records 1.0.0

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +121 -0
  4. package/dist/attachment-Hrg8uHuf.d.ts +23 -0
  5. package/dist/confidence-level-CV3P1W5_.d.ts +25 -0
  6. package/dist/constants/index.d.ts +28 -0
  7. package/dist/constants/index.js +885 -0
  8. package/dist/constants/index.js.map +1 -0
  9. package/dist/credibility-CcQ0MUfQ.d.ts +14 -0
  10. package/dist/digital-ADBJTqSi.d.ts +278 -0
  11. package/dist/domains-CjIFZGBh.d.ts +330 -0
  12. package/dist/enum-guard-DzPkp2oJ.d.ts +101 -0
  13. package/dist/extensions/document/index.d.ts +47 -0
  14. package/dist/extensions/document/index.js +31 -0
  15. package/dist/extensions/document/index.js.map +1 -0
  16. package/dist/extensions/identifiers/index.d.ts +139 -0
  17. package/dist/extensions/identifiers/index.js +47 -0
  18. package/dist/extensions/identifiers/index.js.map +1 -0
  19. package/dist/extensions/physical/index.d.ts +84 -0
  20. package/dist/extensions/physical/index.js +84 -0
  21. package/dist/extensions/physical/index.js.map +1 -0
  22. package/dist/extensions/provenance/index.d.ts +153 -0
  23. package/dist/extensions/provenance/index.js +120 -0
  24. package/dist/extensions/provenance/index.js.map +1 -0
  25. package/dist/extensions/testimony/index.d.ts +400 -0
  26. package/dist/extensions/testimony/index.js +203 -0
  27. package/dist/extensions/testimony/index.js.map +1 -0
  28. package/dist/factories/index.d.ts +31 -0
  29. package/dist/factories/index.js +905 -0
  30. package/dist/factories/index.js.map +1 -0
  31. package/dist/formatters/index.d.ts +18 -0
  32. package/dist/formatters/index.js +156 -0
  33. package/dist/formatters/index.js.map +1 -0
  34. package/dist/geo/index.d.ts +16 -0
  35. package/dist/geo/index.js +146 -0
  36. package/dist/geo/index.js.map +1 -0
  37. package/dist/guards/index.d.ts +74 -0
  38. package/dist/guards/index.js +892 -0
  39. package/dist/guards/index.js.map +1 -0
  40. package/dist/index.d.ts +42 -0
  41. package/dist/index.js +1350 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/labels/index.d.ts +33 -0
  44. package/dist/labels/index.js +181 -0
  45. package/dist/labels/index.js.map +1 -0
  46. package/dist/location-56xtMNtC.d.ts +408 -0
  47. package/dist/media/index.d.ts +3 -0
  48. package/dist/media/index.js +21 -0
  49. package/dist/media/index.js.map +1 -0
  50. package/dist/observation/index.d.ts +7 -0
  51. package/dist/observation/index.js +865 -0
  52. package/dist/observation/index.js.map +1 -0
  53. package/dist/shared/index.d.ts +29 -0
  54. package/dist/shared/index.js +87 -0
  55. package/dist/shared/index.js.map +1 -0
  56. package/dist/source/index.d.ts +51 -0
  57. package/dist/source/index.js +45 -0
  58. package/dist/source/index.js.map +1 -0
  59. package/dist/source/sensor/index.d.ts +170 -0
  60. package/dist/source/sensor/index.js +69 -0
  61. package/dist/source/sensor/index.js.map +1 -0
  62. package/dist/temporal/index.d.ts +20 -0
  63. package/dist/temporal/index.js +78 -0
  64. package/dist/temporal/index.js.map +1 -0
  65. package/dist/temporal-data-t8Mzu8Ui.d.ts +148 -0
  66. package/dist/time-of-day-DLDBwTrn.d.ts +165 -0
  67. package/dist/types-CzNfaip-.d.ts +1267 -0
  68. package/dist/types-DH_-SdHj.d.ts +11 -0
  69. package/dist/types-clxXEQOH.d.ts +27 -0
  70. package/dist/validation-C-_QLXXf.d.ts +34 -0
  71. package/dist/validators/index.d.ts +15 -0
  72. package/dist/validators/index.js +895 -0
  73. package/dist/validators/index.js.map +1 -0
  74. package/package.json +146 -0
  75. package/schema/records.schema.json +2538 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@disclosureos/records` are documented here. The format is
4
+ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 1.0.0
8
+
9
+ Initial public release — the core of the DisclosureOS standard.
10
+
11
+ ### Added
12
+ - `Observation` — the primary record type — with `ObservationSchema` (Zod 4) and the
13
+ non-stripping `validateObservation` validator.
14
+ - `@disclosureos/records/shared`: the cross-package substrate (`Confidence`,
15
+ `Attribution`, `Claim` + `evidenceRef` helpers, `validateWith`, `schemaId`,
16
+ `jsonSchemaEnvelope`, enum guards, branded ids).
17
+ - The `ObservationExtensions` extension point for satellite slots.
18
+ - The DX quintet (labels, constants, guards, factories, formatters, validators) and
19
+ temporal / geo / media / extension subpaths.
20
+ - Committed JSON Schema artifact (`schema/records.schema.json`, draft 2020-12).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Disclosure Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # @disclosureos/records
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
+
5
+ Structured vocabulary for describing UAP observations — the **data dictionary** of
6
+ the [DisclosureOS](https://github.com/disclosurefoundation) ecosystem. Its primary
7
+ type, `Observation`, is the core unit every other package builds on.
8
+
9
+ DisclosureOS is a **five-part standard**. Each part answers one question about an
10
+ observation; `@disclosureos/schema` binds the package-owned pieces into one portable
11
+ contract (a single TS type + JSON Schema + non-stripping parse).
12
+
13
+ | Part | Package surface | Question it answers |
14
+ |---|---|---|
15
+ | **Records** | `@disclosureos/records` | *What was observed?* |
16
+ | **Observables** | `@disclosureos/observables` | *What anomalous characteristics did it show?* |
17
+ | **Origins** | `@disclosureos/origins` | *What might explain it?* |
18
+ | **Claims** | `@disclosureos/records/shared` | *Who assessed it, why, and on what evidence?* |
19
+ | **Scoring** | `@disclosureos/scoring` | *How complete / compelling is the case?* |
20
+
21
+ Supporting packages: **`@disclosureos/schema`** (the portable contract that composes the
22
+ package-owned pieces), **`@disclosureos/cli`** (tooling), and
23
+ **`@disclosureos/examples`** (the runnable golden path). *(You are here: **Records**.)*
24
+
25
+ ## records is the shared vocabulary
26
+
27
+ `records` has no DisclosureOS dependencies — it depends only on [Zod](https://zod.dev).
28
+ The other layers depend on **it**: they import shared primitives (confidence scales,
29
+ attribution, claims, validation, JSON-Schema helpers) from `@disclosureos/records/shared`
30
+ instead of re-inventing them. Import a layer package and its slot is automatically
31
+ typed on `Observation` (see [The extension point](#the-extension-point)).
32
+
33
+ New to the vocabulary? The [glossary](../../docs/disclosureos-glossary.md) defines the
34
+ terms that are easy to conflate — Attribution vs Claim vs Assessment, `confidence` vs
35
+ `ConfidenceLevel` vs `SourceCredibility`, and `alternativeHypotheses` vs `contested`.
36
+
37
+ > **See it end to end.** [`examples/golden-path.ts`](../../examples/golden-path.ts)
38
+ > takes one observation through every part — records → observables → origins → claims → scoring,
39
+ > validated as a whole by `@disclosureos/schema` — in a single type-checked file. Run it
40
+ > with `pnpm --filter @disclosureos/examples golden-path`.
41
+ >
42
+ > **Migrating an existing dataset?** See [`examples/migration-path.ts`](../../examples/migration-path.ts)
43
+ > and the [onboarding workspace](https://os.disclosure.org/onboard).
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pnpm add @disclosureos/records zod
49
+ ```
50
+
51
+ ## Quick start
52
+
53
+ ```typescript
54
+ import { ObservationSchema, validateObservation, type Observation } from '@disclosureos/records';
55
+
56
+ const observation: Observation = {
57
+ id: 'nimitz-2004',
58
+ temporal: { date: '2004-11-14', dateCertainty: 'exact' },
59
+ location: { id: 'l', name: 'Pacific', country: 'US', longitude: -117, latitude: 32, siteType: 'ocean' },
60
+ status: 'published',
61
+ createdAt: '2004-11-14T00:00:00Z',
62
+ updatedAt: '2024-01-01T00:00:00Z',
63
+ };
64
+
65
+ const issues = validateObservation(observation); // [] when valid
66
+ ```
67
+
68
+ ## The extension point
69
+
70
+ The satellite slots (`observableAssessments`, `origin`) are **not** part of
71
+ `ObservationSchema` — `records` cannot import its own satellites. Instead each layer
72
+ package augments the `Observation` type via `declare module '@disclosureos/records'`,
73
+ so simply importing the package types its slot:
74
+
75
+ ```typescript
76
+ import '@disclosureos/observables'; // adds `observableAssessments` to Observation
77
+ import '@disclosureos/origins'; // adds `origin` to Observation
78
+ ```
79
+
80
+ > ⚠️ **Strip hazard.** Because those slots aren't in the `z.object`, a raw
81
+ > `ObservationSchema.parse(record)` **silently drops** `observableAssessments` and
82
+ > `origin` (Zod strips unknown keys). To validate an enriched record:
83
+ > - use **`validateObservation(record)`** here — it returns issues *without* stripping
84
+ > your object, or
85
+ > - use **`parseEnrichedObservation()`** from [`@disclosureos/schema`](../disclosureos-schema),
86
+ > the non-stripping composed parse that validates core + slots in one call.
87
+ >
88
+ > Do not use a raw `.parse()` round-trip to "clean" an enriched record.
89
+
90
+ ## Subpath exports
91
+
92
+ Each surface is independently importable (tree-shakeable):
93
+
94
+ | Subpath | Contents |
95
+ |---|---|
96
+ | `@disclosureos/records` | `Observation`, `ObservationSchema`, `validateObservation` |
97
+ | `@disclosureos/records/shared` | Shared primitives: `Confidence`, `Attribution`, `Claim`, `validateWith`, `schemaId`, … |
98
+ | `@disclosureos/records/temporal` · `/geo` · `/media` | Temporal, geographic, and media primitives |
99
+ | `@disclosureos/records/extensions/*` | Off-the-hot-path slots: `provenance`, `identifiers`, `testimony`, `physical`, `document` |
100
+ | `@disclosureos/records/{labels,constants,guards,factories,formatters,validators}` | The DX quintet |
101
+ | `@disclosureos/records/schema` | The committed JSON Schema (`records.schema.json`) |
102
+
103
+ ## JSON Schema
104
+
105
+ A committed, versioned JSON Schema (draft 2020-12) ships at
106
+ `@disclosureos/records/schema`, `$id` hosted at `os.disclosure.org`. The core
107
+ `Observation` root is intentionally **open** so satellite slots compose in at the
108
+ all-packages step ([`@disclosureos/schema`](../disclosureos-schema)). Regenerate with
109
+ `pnpm --filter @disclosureos/records emit:schema`; a drift test keeps it honest.
110
+
111
+ ## Standard Schema
112
+
113
+ The Zod schemas here (`ObservationSchema`, …) implement
114
+ [Standard Schema v1](https://standardschema.dev) via their `~standard` property —
115
+ a guarantee of Zod 4. Any Standard-Schema-compatible validator or framework
116
+ (`tRPC`, `TanStack Form`, …) can consume them directly, with no DisclosureOS-specific
117
+ adapter.
118
+
119
+ ## License
120
+
121
+ MIT © [Disclosure Foundation](https://disclosure.org)
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const MediaAttachmentSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ type: z.ZodEnum<{
6
+ image: "image";
7
+ video: "video";
8
+ document: "document";
9
+ audio: "audio";
10
+ }>;
11
+ url: z.ZodString;
12
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
13
+ caption: z.ZodOptional<z.ZodString>;
14
+ credit: z.ZodOptional<z.ZodString>;
15
+ mimeType: z.ZodOptional<z.ZodString>;
16
+ fileSize: z.ZodOptional<z.ZodNumber>;
17
+ duration: z.ZodOptional<z.ZodNumber>;
18
+ width: z.ZodOptional<z.ZodNumber>;
19
+ height: z.ZodOptional<z.ZodNumber>;
20
+ }, z.core.$strip>;
21
+ type MediaAttachment = z.infer<typeof MediaAttachmentSchema>;
22
+
23
+ export { type MediaAttachment as M, MediaAttachmentSchema as a };
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * The single qualitative confidence magnitude for the ecosystem.
5
+ * Merges the former `ConfidenceLevel` (investigation) and `CredibilityRating`
6
+ * (testimony) — which were byte-identical — plus the inline high/medium/low
7
+ * scales in `provenance/digital`.
8
+ *
9
+ * Distinct from `SourceCredibility` (trust tier), `TemporalCertainty` (time
10
+ * precision), and `AssessmentLevel` (evidentiary tier) — those are the other
11
+ * three orthogonal axes and are intentionally NOT merged here.
12
+ */
13
+ declare const ConfidenceLevelSchema: z.ZodEnum<{
14
+ high: "high";
15
+ moderate: "moderate";
16
+ low: "low";
17
+ unassessed: "unassessed";
18
+ very_high: "very_high";
19
+ very_low: "very_low";
20
+ }>;
21
+ type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;
22
+ declare const CONFIDENCE_LEVELS: ("high" | "moderate" | "low" | "unassessed" | "very_high" | "very_low")[];
23
+ declare function isConfidenceLevel(value: unknown): value is ConfidenceLevel;
24
+
25
+ export { type ConfidenceLevel as C, ConfidenceLevelSchema as a, CONFIDENCE_LEVELS as b, isConfidenceLevel as i };
@@ -0,0 +1,28 @@
1
+ declare const SOURCE_TYPES: ("other" | "foia" | "official_report" | "official_statement" | "congressional_testimony" | "congressional_report" | "military_document" | "intelligence_document" | "whistleblower" | "firsthand_witness" | "secondhand_account" | "news_article" | "documentary" | "interview" | "book" | "academic_paper" | "investigation_report" | "database_entry" | "social_media" | "website")[];
2
+ declare const SOURCE_CREDIBILITIES: ("unknown" | "verified" | "unverified" | "official" | "credible" | "questionable" | "disputed")[];
3
+ declare const TEMPORAL_CERTAINTIES: ("exact" | "approximate" | "estimated" | "unknown")[];
4
+ declare const DATE_GRANULARITIES: ("exact" | "unknown" | "month" | "quarter" | "year" | "decade" | "century")[];
5
+ declare const DATE_RANGE_TYPES: ("span" | "uncertainty" | "active_period" | "investigation_period" | "observation_window")[];
6
+ declare const TIMES_OF_DAY: ("unknown" | "astronomical_dawn" | "nautical_dawn" | "civil_dawn" | "sunrise" | "morning" | "noon" | "afternoon" | "sunset" | "civil_dusk" | "nautical_dusk" | "astronomical_dusk" | "night")[];
7
+ declare const MEDIA_TYPES: ("image" | "video" | "document" | "audio")[];
8
+ declare const SITE_TYPES: ("unknown" | "military_air_base" | "military_naval_base" | "military_army_base" | "military_missile_site" | "military_radar_station" | "military_research_facility" | "military_training_area" | "military_other" | "nuclear_power_plant" | "nuclear_weapons_storage" | "nuclear_research_facility" | "nuclear_waste_storage" | "nuclear_other" | "civilian_airport" | "private_airfield" | "heliport" | "seaport" | "offshore_platform" | "naval_vessel" | "government_facility" | "embassy" | "intelligence_facility" | "power_plant" | "dam" | "telecommunications" | "water_treatment" | "research_facility" | "test_range" | "space_station" | "archaeological_site" | "volcano" | "command_center" | "residential" | "commercial" | "industrial" | "agricultural" | "wilderness" | "ocean" | "lake" | "mountain" | "desert" | "forest" | "urban" | "suburban" | "rural" | "other")[];
9
+ declare const TERRAIN_TYPES: ("unknown" | "ocean" | "lake" | "desert" | "forest" | "urban" | "suburban" | "rural" | "coastal" | "river" | "wetland" | "plains" | "hills" | "mountains" | "jungle" | "tundra" | "arctic" | "underground" | "underwater" | "airborne" | "space")[];
10
+ declare const AIRSPACE_CLASSES: ("unknown" | "A" | "B" | "C" | "D" | "E" | "G" | "restricted" | "prohibited" | "warning" | "moa" | "alert" | "cfa" | "national_security" | "tfr" | "international")[];
11
+ declare const LOCATION_SENSITIVITIES: ("critical" | "high" | "moderate" | "standard" | "none")[];
12
+ declare const COORDINATE_PRECISIONS: ("exact" | "approximate" | "unknown" | "address" | "locality" | "region")[];
13
+ declare const OBJECT_SHAPES: ("unknown" | "other" | "sphere" | "orb" | "disc" | "saucer" | "oval" | "egg" | "cylinder" | "cigar" | "tic_tac" | "triangle" | "delta" | "boomerang" | "chevron" | "diamond" | "rectangle" | "square" | "cube" | "cross" | "star" | "amorphous" | "changing" | "light_only")[];
14
+ declare const MANEUVER_TYPES: ("other" | "hover" | "instant_acceleration" | "instant_stop" | "right_angle_turn" | "zigzag" | "pendulum" | "split" | "merge" | "disappear" | "appear" | "transmedium_entry" | "transmedium_exit" | "vertical_ascent" | "vertical_descent" | "rotation" | "wobble")[];
15
+ declare const RELATION_KINDS: ("corroborates" | "contradicts" | "duplicate_of" | "same_object" | "supersedes" | "superseded_by" | "re_analysis_of" | "part_of")[];
16
+ declare const CONFIDENCE_LEVELS: ("high" | "moderate" | "low" | "unassessed" | "very_high" | "very_low")[];
17
+ declare const WITNESS_CATEGORIES: ("unknown" | "military_other" | "military_pilot" | "military_aircrew" | "military_ground" | "military_naval" | "military_radar_operator" | "commercial_pilot" | "commercial_aircrew" | "private_pilot" | "air_traffic_controller" | "aviation_other" | "government_official" | "elected_official" | "intelligence_officer" | "law_enforcement" | "scientist" | "astronomer" | "meteorologist" | "engineer" | "medical_professional" | "maritime" | "civilian" | "civilian_group" | "anonymous")[];
18
+ declare const DETECTION_METHODS: ("unknown" | "other" | "radar_primary" | "radar_secondary" | "radar_doppler" | "radar_phased_array" | "infrared_flir" | "infrared_other" | "electro_optical" | "visual_camera" | "satellite_imagery" | "sonar_active" | "sonar_passive" | "electromagnetic" | "radiation_detector" | "magnetometer" | "gravimeter" | "acoustic" | "seismic" | "lidar" | "spectroscopic" | "radio_frequency" | "multiple")[];
19
+ declare const SENSOR_TYPES: ("other" | "military_radar" | "civilian_radar" | "airborne_radar" | "shipborne_radar" | "ground_radar" | "flir" | "eo_sensor" | "satellite" | "sonar" | "electromagnetic_sensor" | "radiation_sensor" | "civilian_camera" | "security_camera" | "dashcam" | "phone_camera")[];
20
+ declare const EVIDENCE_TYPES: ("other" | "video" | "material_sample" | "ground_trace" | "radiation_reading" | "electromagnetic_recording" | "photographic" | "audio_recording" | "biological_sample" | "implant" | "debris" | "soil_sample" | "water_sample" | "vegetation_sample" | "impression" | "burn_mark")[];
21
+ declare const EVIDENCE_QUALITIES: ("unknown" | "laboratory_grade" | "field_collected" | "uncontrolled" | "degraded" | "contaminated")[];
22
+ declare const CHAIN_OF_CUSTODY_STATUSES: ("unknown" | "destroyed" | "classified" | "verified" | "partial" | "unverified" | "government_held" | "private_held" | "lost")[];
23
+ declare const VERIFICATION_METHODS: ("other" | "metadata_analysis" | "forensic_analysis" | "hash_verification" | "chain_of_custody" | "source_confirmation" | "expert_review" | "ai_analysis")[];
24
+ declare const VERIFICATION_RESULTS: ("unknown" | "authentic" | "likely_authentic" | "inconclusive" | "likely_manipulated" | "manipulated" | "ai_generated" | "deepfake" | "composite")[];
25
+ declare const HASH_ALGORITHMS: ("sha256" | "sha512" | "sha1" | "md5")[];
26
+ declare const PUBLICATION_STATUSES: ("archived" | "draft" | "review" | "published" | "retracted")[];
27
+
28
+ export { AIRSPACE_CLASSES, CHAIN_OF_CUSTODY_STATUSES, CONFIDENCE_LEVELS, COORDINATE_PRECISIONS, DATE_GRANULARITIES, DATE_RANGE_TYPES, DETECTION_METHODS, EVIDENCE_QUALITIES, EVIDENCE_TYPES, HASH_ALGORITHMS, LOCATION_SENSITIVITIES, MANEUVER_TYPES, MEDIA_TYPES, OBJECT_SHAPES, PUBLICATION_STATUSES, RELATION_KINDS, SENSOR_TYPES, SITE_TYPES, SOURCE_CREDIBILITIES, SOURCE_TYPES, TEMPORAL_CERTAINTIES, TERRAIN_TYPES, TIMES_OF_DAY, VERIFICATION_METHODS, VERIFICATION_RESULTS, WITNESS_CATEGORIES };