From cbf6f1d82fa7d5813e6f0dcdd5c7f6a9d3c7dc5d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 17 Jul 2026 17:14:44 +0100 Subject: [PATCH] docs: sync implementation spec citations --- src/git/sync.rs | 4 ++-- src/grasp06/fetch.rs | 2 +- src/grasp06/mod.rs | 2 +- src/grasp06/policy.rs | 2 +- src/grasp06/receive.rs | 2 +- src/http/mod.rs | 6 +++--- src/http/nip11.rs | 8 ++++---- src/nostr/builder.rs | 2 +- src/nostr/policy/pr_event.rs | 2 +- src/purgatory/mod.rs | 2 +- src/purgatory/types.rs | 2 +- tests/grasp06_pr_hosting.rs | 14 +++++++------- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/git/sync.rs b/src/git/sync.rs index 1733a6a..2e0d796 100644 --- a/src/git/sync.rs +++ b/src/git/sync.rs @@ -738,7 +738,7 @@ pub fn align_repository_with_state(repo_path: &Path, state: &RepositoryState) -> /// - Standard endpoint: `{git_data_path}/{npub}/{identifier}.git` — two /// components after `git_data_path`. The identifier is the last /// component minus the `.git` suffix. -/// - GRASP-06 `/prs/` endpoint (06.md line 14): the `/prs/` +/// - GRASP-06 `/prs/` endpoint (06.md line 12): the `/prs/` /// contributor-submission subtree at /// `{git_data_path}/prs/{submitter-hex}/{identifier}.git` — three /// components, where the leading `prs` is the namespace marker (see @@ -947,7 +947,7 @@ pub async fn process_newly_available_git_data( // Cross-service mirror (design doc: // docs/explanation/grasp-06-contributor-pr-submission.md, "Cross-service // mirror" section). When the source repo lives under the `/prs/` - // subtree (06.md line 14), refs released from purgatory by this push + // subtree (06.md line 12), refs released from purgatory by this push // must be copied into any matching announced repo on this relay so the // PR is fetchable at the maintainer's canonical URL. The reverse // direction is NOT supported — a push to `/.git` must never diff --git a/src/grasp06/fetch.rs b/src/grasp06/fetch.rs index fb3a55d..e487b40 100644 --- a/src/grasp06/fetch.rs +++ b/src/grasp06/fetch.rs @@ -1,6 +1,6 @@ //! GRASP-06 `/prs/` fetch handlers. //! -//! Spec 06.md line 13: +//! Spec 06.md line 11: //! //! > MUST respond to upload-pack requests for any well-formed path as if //! > serving an empty bare repository. diff --git a/src/grasp06/mod.rs b/src/grasp06/mod.rs index 68094bd..cb4c87c 100644 --- a/src/grasp06/mod.rs +++ b/src/grasp06/mod.rs @@ -16,7 +16,7 @@ //! post-push validation against the database / purgatory. //! - PR / PR-Update event acceptance relaxation for un-announced coords //! whose `clone` tag names this relay's `/prs//.git` -//! endpoint (06.md lines 21–24). +//! endpoint (06.md lines 19–22). //! //! Cross-service mirroring into matching announced repos is not yet //! implemented. diff --git a/src/grasp06/policy.rs b/src/grasp06/policy.rs index 131aa47..c5fc2d9 100644 --- a/src/grasp06/policy.rs +++ b/src/grasp06/policy.rs @@ -1,6 +1,6 @@ //! Acceptance helpers for GRASP-06 PR / PR-Update events. //! -//! Spec: (lines 21–24). +//! Spec: (lines 19–22). //! //! Under GRASP-06 a relay MUST accept a kind 1618 (PR) or 1619 (PR Update) //! event for a repository coordinate it has no accepted announcement for, diff --git a/src/grasp06/receive.rs b/src/grasp06/receive.rs index b634957..735a953 100644 --- a/src/grasp06/receive.rs +++ b/src/grasp06/receive.rs @@ -1,6 +1,6 @@ //! GRASP-06 `/prs/` `git-receive-pack` handler. //! -//! Spec 06.md line 15: +//! Spec 06.md line 13: //! //! > MUST accept pushes to `refs/nostr/`. MUST reject pushes to any //! > other ref namespace. diff --git a/src/http/mod.rs b/src/http/mod.rs index bbd7e03..7e7cd1d 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -37,7 +37,7 @@ use crate::sync::rejected_index::RejectedEventsIndex; type HttpBody = GitResponseBody; -/// CORS headers required by GRASP-01 specification (lines 40-47) +/// CORS headers required by GRASP-01 specification (lines 48-51) const CORS_ALLOW_ORIGIN: &str = "*"; const CORS_ALLOW_METHODS: &str = "GET, POST"; const CORS_ALLOW_HEADERS: &str = "Content-Type"; @@ -180,7 +180,7 @@ impl Service> for HttpService { let repo_init_locks = self.repo_init_locks.clone(); // Handle OPTIONS preflight requests (CORS) - // GRASP-01 spec line 47: Respond to OPTIONS with 204 No Content + // GRASP-01 spec line 51: Respond to OPTIONS with 204 No Content if method == Method::OPTIONS { return Box::pin(async move { Ok( @@ -320,7 +320,7 @@ impl Service> for HttpService { // POST /git-receive-pack — accept pushes to // refs/nostr/, reject anything else, - // per GRASP-06 06.md line 15. + // per GRASP-06 06.md line 13. (m, "git-receive-pack") if m == Method::POST => { // Metrics are recorded inside the `/prs/` // handler and its detached streaming task. For diff --git a/src/http/nip11.rs b/src/http/nip11.rs index 68cb71f..d3d8277 100644 --- a/src/http/nip11.rs +++ b/src/http/nip11.rs @@ -38,17 +38,17 @@ pub struct RelayInformationDocument { #[serde(skip_serializing_if = "Option::is_none")] pub icon: Option, - // GRASP-01 Extensions (lines 11-14 of GRASP-01 spec) + // GRASP-01 Extensions (lines 24-28 of GRASP-01 spec) /// List of supported GRASPs (e.g., ["GRASP-01"]) - /// Required by GRASP-01 specification line 12 + /// Required by GRASP-01 specification line 26 pub supported_grasps: Vec, /// Repository acceptance criteria description - /// Required by GRASP-01 specification line 13 + /// Required by GRASP-01 specification line 27 pub repo_acceptance_criteria: String, /// Curation policy (present if curated, absent otherwise) - /// Optional per GRASP-01 specification line 14 + /// Required by GRASP-01 specification line 28 when events are curated #[serde(skip_serializing_if = "Option::is_none")] pub curation: Option, } diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index 04f6ff0..5625580 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs @@ -482,7 +482,7 @@ impl Nip34WritePolicy { // Reject PRs unrelated to stored repositories / events. // - // GRASP-06 (06.md lines 21–24) relaxes this: a PR / PR-Update event + // GRASP-06 (06.md lines 19–22) relaxes this: a PR / PR-Update event // whose `clone` tag names this relay's // `/prs//.git` endpoint (and which carries a // matching `a` tag of the form `30617::`) MUST be accepted diff --git a/src/nostr/policy/pr_event.rs b/src/nostr/policy/pr_event.rs index 1834e3f..fcf5f1d 100644 --- a/src/nostr/policy/pr_event.rs +++ b/src/nostr/policy/pr_event.rs @@ -75,7 +75,7 @@ impl PrEventPolicy { if let Some(scope) = prs_scope { // The placeholder was created by a /prs//.git - // push (06.md line 14). The arriving event MUST be signed by + // push (06.md line 12). The arriving event MUST be signed by // the URL submitter AND carry an `a` tag with d-tag equal to // the URL identifier — otherwise this event was published by // someone else and merely shares an id with a ref the diff --git a/src/purgatory/mod.rs b/src/purgatory/mod.rs index 0601657..fe6b628 100644 --- a/src/purgatory/mod.rs +++ b/src/purgatory/mod.rs @@ -498,7 +498,7 @@ impl Purgatory { } /// Add a PR placeholder created by a push to the GRASP-06 `/prs/` - /// endpoint (06.md line 14). + /// endpoint (06.md line 12). /// /// Behaves like [`Self::add_pr_placeholder`] but additionally records /// the URL's submitter and identifier on the entry. When the diff --git a/src/purgatory/types.rs b/src/purgatory/types.rs index 08a18c7..dd19d59 100644 --- a/src/purgatory/types.rs +++ b/src/purgatory/types.rs @@ -146,7 +146,7 @@ pub struct PrPurgatoryEntry { pub source: EventSource, /// If set, this placeholder was created by a push to the GRASP-06 - /// `/prs//.git` endpoint (06.md line 14). When + /// `/prs//.git` endpoint (06.md line 12). When /// the corresponding PR event arrives, its signer MUST equal /// `submitter` and it MUST carry an `a` tag with d-tag equal to /// `identifier`. Mismatches cause the pushed ref + placeholder to be diff --git a/tests/grasp06_pr_hosting.rs b/tests/grasp06_pr_hosting.rs index fbe8e12..d641047 100644 --- a/tests/grasp06_pr_hosting.rs +++ b/tests/grasp06_pr_hosting.rs @@ -126,7 +126,7 @@ isolated_test_with_grasp_06!( // Test 3: Empty-bare-repo fetch for any well-formed /prs//.git // ============================================================================= // -// Spec: GRASP-06 06.md line 13 +// Spec: GRASP-06 06.md line 11 // // Contract: when GRASP-06 is enabled on the relay, a fetch against any // well-formed /prs//.git path that has no accepted @@ -149,7 +149,7 @@ isolated_test_with_grasp_06!( // Test 4: /prs/ MUST accept pushes to refs/nostr/ // ============================================================================= // -// Spec: GRASP-06 06.md line 15 +// Spec: GRASP-06 06.md line 13 // // Contract: a `git push` of refs/nostr/ to /prs//.git // MUST succeed, even when there is no prior state on the path and no matching @@ -170,7 +170,7 @@ isolated_test_with_grasp_06!( // Test 5: /prs/ MUST reject pushes to anything else // ============================================================================= // -// Spec: GRASP-06 06.md line 15 +// Spec: GRASP-06 06.md line 13 // // Contract: pushes to ref names that don't match refs/nostr/<64-hex-event-id> // MUST be rejected. Two sub-assertions inside one test: @@ -191,7 +191,7 @@ isolated_test_with_grasp_06!( // Test 6: PR for un-announced coord MUST be accepted when clone tag names /prs/ // ============================================================================= // -// Spec: GRASP-06 06.md lines 21–24 +// Spec: GRASP-06 06.md lines 19–22 // // Contract: a PR event (kind 1618) for a coord this relay has NO accepted // announcement for MUST be accepted (purgatory or served) when the event @@ -215,7 +215,7 @@ isolated_test_with_grasp_06!( // Test 6b: Relaxation-accepted PR MUST stay in purgatory until git data arrives // ============================================================================= // -// Spec: GRASP-06 06.md lines 21–24, in combination with GRASP-01 line 22 +// Spec: GRASP-06 06.md lines 19–22, in combination with GRASP-01 line 20 // (the purgatory rule). // // Contract: a PR event accepted under the GRASP-06 relaxation (un-announced @@ -242,7 +242,7 @@ isolated_test_with_grasp_06!( // Test 7: Relaxation MUST NOT apply when clone tag does not name this relay // ============================================================================= // -// Spec: GRASP-06 06.md lines 23–24 +// Spec: GRASP-06 06.md line 22 // // Contract: the same un-announced-coord PR event, but with a `clone` tag // pointing at a foreign host, MUST remain rejected. The relaxation is gated @@ -332,7 +332,7 @@ isolated_test_with_grasp_06!( // // Wired only as `with_grasp_06`. Pre-implementation this can't make its // assertion (the /prs/ endpoint 404s) and reports a setup failure with a -// pointer to the 06.md line 13 endpoint-reachability requirement. Once +// pointer to the 06.md line 11 endpoint-reachability requirement. Once // /prs/ becomes reachable, the test goes green and stays green as long as // no one adds a reverse-mirror branch.