···11+ISC License
22+33+Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>
44+55+Permission to use, copy, modify, and distribute this software for any
66+purpose with or without fee is hereby granted, provided that the above
77+copyright notice and this permission notice appear in all copies.
88+99+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1010+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1111+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1212+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1313+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1414+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1515+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+4
README.md
···164164## Project Status
165165166166Still very much just used by Anil Madhavapeddy. You're welcome to try it, but let me know...
167167+168168+## License
169169+170170+ISC License - see [LICENSE.md](LICENSE.md) for details.
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Sortal - Username to metadata mapping with XDG storage
2738 This library provides a system for mapping usernames to various metadata
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Cmdliner terms and commands for contact management.
2738 This module provides ready-to-use Cmdliner terms for building
+5
lib/core/sortal_git_store.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16module Contact = Sortal_schema.Contact
2738type t = {
+5
lib/core/sortal_git_store.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Git-backed contact store with automatic version control.
2738 This module wraps {!Sortal_store} to provide automatic git versioning
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Contact store with XDG-compliant storage.
2738 The contact store manages reading and writing contact metadata
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Sortal Schema - Versioned data types and serialization
2738 This library provides versioned schema definitions for contact metadata
+5
lib/schema/sortal_schema_contact_v1.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16let version = 1
2738type contact_kind = Person | Organization | Group | Role
+5
lib/schema/sortal_schema_contact_v1.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Contact schema V1 with temporal support.
2738 This module defines the V1 contact schema with support for time-bounded
+5
lib/schema/sortal_schema_feed.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type feed_type =
27 | Atom
38 | Rss
+5
lib/schema/sortal_schema_feed.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Feed subscription with type and URL.
2738 A feed represents a subscription to a content source (Atom, RSS, or JSONFeed). *)
+5
lib/schema/sortal_schema_temporal.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type date = Ptime.date
2738type range = {
+5
lib/schema/sortal_schema_temporal.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Temporal validity support for contact fields.
2738 This module provides types and functions for managing time-bounded
+47
sortal.opam
···11+# This file is generated by dune, edit dune-project instead
22+opam-version: "2.0"
33+synopsis:
44+ "Contact metadata management with XDG storage and versioned schemas"
55+description: """
66+Sortal provides contact metadata management with versioned schemas,
77+ XDG-compliant storage, git versioning, and CLI tools.
88+99+ The library is split into two components:
1010+ - sortal.schema: Versioned data types with minimal dependencies
1111+ - sortal: Core library with storage, git integration, and CLI support"""
1212+maintainer: ["Anil Madhavapeddy <anil@recoil.org>"]
1313+authors: ["Anil Madhavapeddy"]
1414+license: "ISC"
1515+homepage: "https://tangled.org/@anil.recoil.org/sortal"
1616+bug-reports: "https://tangled.org/@anil.recoil.org/sortal/issues"
1717+depends: [
1818+ "dune" {>= "3.20"}
1919+ "ocaml" {>= "5.1.0"}
2020+ "eio"
2121+ "eio_main"
2222+ "xdge"
2323+ "jsont"
2424+ "ptime"
2525+ "yamlt"
2626+ "bytesrw"
2727+ "fmt"
2828+ "cmdliner"
2929+ "logs"
3030+ "odoc" {with-doc}
3131+ "alcotest" {with-test & >= "1.7.0"}
3232+]
3333+build: [
3434+ ["dune" "subst"] {dev}
3535+ [
3636+ "dune"
3737+ "build"
3838+ "-p"
3939+ name
4040+ "-j"
4141+ jobs
4242+ "@install"
4343+ "@runtest" {with-test}
4444+ "@doc" {with-doc}
4545+ ]
4646+]
4747+x-maintenance-intent: ["(latest)"]
+5
test/test_schema.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Schema-only tests (no I/O dependencies) *)
2738let test_temporal () =
+5
test/test_sortal.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Tests for the Sortal library *)
2738open Eio.Std