diff --git a/lexicons/space.notjack.thunderstorm.catalogBaseline.json b/lexicons/space.notjack.thunderstorm.catalogBaseline.json new file mode 100644 index 0000000..f0df3f1 --- /dev/null +++ b/lexicons/space.notjack.thunderstorm.catalogBaseline.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "space.notjack.thunderstorm.catalogBaseline", + "defs": { + "main": { + "type": "record", + "description": "A marker that a particular package catalog snapshot was chosen to be a baseline snapshot, where Thunderstorm recomputes the package catalog index from scratch.", + "key": "tid", + "record": { + "type": "object", + "required": ["snapshot", "packageCount"], + "properties": { + "snapshot": { + "type": "string", + "format": "at-uri", + "description": "The snapshot this baseline is for." + }, + "packageCount": { + "type": "integer", + "description": "The total number of packages in this baseline's catalog snapshot." + } + } + } + } + } +} diff --git a/lexicons/space.notjack.thunderstorm.catalogDelta.json b/lexicons/space.notjack.thunderstorm.catalogDelta.json index 2430961..417b9e6 100644 --- a/lexicons/space.notjack.thunderstorm.catalogDelta.json +++ b/lexicons/space.notjack.thunderstorm.catalogDelta.json @@ -8,7 +8,7 @@ "key": "tid", "record": { "type": "object", - "required": ["preceding", "result", "packageChanges"], + "required": ["preceding", "result", "packageChanges", "packageCountDelta"], "properties": { "preceding": { "type": "string", @@ -20,6 +20,10 @@ "format": "at-uri", "description": "A reference to the space.notjack.thunderstorm.catalogSnapshot record representing the state of the package catalog after this delta's changes occurred. The result snapshot's `.previous` field MUST point to the same record as `preceding` for this delta record to be considered valid." }, + "packageCountDelta": { + "type": "integer", + "description": "The change in the number of packages in the catalog as a result of this delta's changes. This should be equal to the number of packages in .packageChanges that have a null contentsBefore field (newly-created packages) minus the number that have a null contentsAfter field (deleted packages)." + }, "packageChanges": { "type": "array", "items": { diff --git a/lexicons/space.notjack.thunderstorm.catalogSnapshot.json b/lexicons/space.notjack.thunderstorm.catalogSnapshot.json index e750c14..c892a3c 100644 --- a/lexicons/space.notjack.thunderstorm.catalogSnapshot.json +++ b/lexicons/space.notjack.thunderstorm.catalogSnapshot.json @@ -25,10 +25,6 @@ "format": "at-uri", "description": "Must reference another space.notjack.thunderstorm.catalogSnapshot record: the one for the snapshot immediately following this one, under the same strict adjacency rule as previous, and likewise a plain at-uri. Absent for the newest snapshot, and on either side of a gap." }, - "packageCount": { - "type": "integer", - "description": "Packages listed in the upstream catalog, which may exceed the number Thunderstorm has ingested. Optional because whatever creates this record need not have fetched the package list; a later service fills it in." - }, "publishedAt": { "type": "string", "format": "datetime", diff --git a/services/racksnaps-baseliner/README.md b/services/racksnaps-baseliner/README.md new file mode 100644 index 0000000..d347d42 --- /dev/null +++ b/services/racksnaps-baseliner/README.md @@ -0,0 +1,17 @@ +# Racksnaps Baseliner + +This service is responsible for nominating certain catalog snapshots as "baselines" and creating individual package snapshot records for every package in every catalog baseline. + +## Manifest + +This service is allowed to interact with the following data sources: + +- https://racksnaps.defn.io/ (read-only) +- at://{THUNDERSTORM_DID}/space.notjack.thunderstorm.catalogSnapshot (read-only) +- at://{THUNDERSTORM_DID}/space.notjack.thunderstorm.catalogBaseline (read, create) +- at://{THUNDERSTORM_DID}/space.notjack.thunderstorm.packageSnapshot (read, create) + +It can be configured via the following environment variables: + +- `THUNDERSTORM_DID`: the DID of the central Thunderstorm account +- `THUNDERSTORM_DID_APP_PASSWORD_FILE_PATH`: an absolute path to a file containing an app password that the service can use to publish writes under the Thunderstorm account