Compute suspect links - a pure function of (link set, current heads) (Q2)
curl --request POST \
--url https://api.eddy.engineer/v1/link.suspects \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"link_set": {
"created_at": "<string>",
"id": "<string>",
"links": [
{
"source": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
},
"target": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
}
}
],
"name": "<string>",
"schema_version": "ss.pdm.link/1"
},
"anchors": {},
"exists": true,
"heads": {}
}
'import requests
url = "https://api.eddy.engineer/v1/link.suspects"
payload = {
"link_set": {
"created_at": "<string>",
"id": "<string>",
"links": [
{
"source": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
},
"target": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
}
}
],
"name": "<string>",
"schema_version": "ss.pdm.link/1"
},
"anchors": {},
"exists": True,
"heads": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
link_set: {
created_at: '<string>',
id: '<string>',
links: [
{
source: {at: '<string>', doc: '<string>', anchor: '<string>', oid: '<string>'},
target: {at: '<string>', doc: '<string>', anchor: '<string>', oid: '<string>'}
}
],
name: '<string>',
schema_version: 'ss.pdm.link/1'
},
anchors: {},
exists: true,
heads: {}
})
};
fetch('https://api.eddy.engineer/v1/link.suspects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/link.suspects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'link_set' => [
'created_at' => '<string>',
'id' => '<string>',
'links' => [
[
'source' => [
'at' => '<string>',
'doc' => '<string>',
'anchor' => '<string>',
'oid' => '<string>'
],
'target' => [
'at' => '<string>',
'doc' => '<string>',
'anchor' => '<string>',
'oid' => '<string>'
]
]
],
'name' => '<string>',
'schema_version' => 'ss.pdm.link/1'
],
'anchors' => [
],
'exists' => true,
'heads' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/link.suspects"
payload := strings.NewReader("{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/link.suspects")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/link.suspects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}"
response = http.request(request)
puts response.read_body{
"heads_used": {},
"suspect_count": 123,
"suspects": [
{
"problem": "<string>",
"source_recorded": {
"at": "<string>",
"doc": "<string>",
"kind": "req",
"anchor": "<string>",
"oid": "<string>"
},
"target_recorded": {
"at": "<string>",
"doc": "<string>",
"kind": "req",
"anchor": "<string>",
"oid": "<string>"
},
"ty": "<string>"
}
]
}Requirements
Compute suspect links - a pure function of (link set, current heads) (Q2)
A link is suspect iff an endpoint’s CURRENT content address differs from the address recorded at link time. No clock, no timestamp heuristics, no false positives from no-op saves (canonical encoding collides identical content to identical keys). heads maps endpoint tags (“kind:doc” or “kind:doc/oid”) to current keys; endpoints missing from the map are treated per exists (default true - reported as “no current state”, never silently clean). E.3 anchors: an anchored endpoint is evaluated at the element its anchor grounds to now (anchors, else the store), its oid the fallback; a lost or unresolvable anchor is a typed suspect.
POST
/
v1
/
link.suspects
Compute suspect links - a pure function of (link set, current heads) (Q2)
curl --request POST \
--url https://api.eddy.engineer/v1/link.suspects \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"link_set": {
"created_at": "<string>",
"id": "<string>",
"links": [
{
"source": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
},
"target": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
}
}
],
"name": "<string>",
"schema_version": "ss.pdm.link/1"
},
"anchors": {},
"exists": true,
"heads": {}
}
'import requests
url = "https://api.eddy.engineer/v1/link.suspects"
payload = {
"link_set": {
"created_at": "<string>",
"id": "<string>",
"links": [
{
"source": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
},
"target": {
"at": "<string>",
"doc": "<string>",
"anchor": "<string>",
"oid": "<string>"
}
}
],
"name": "<string>",
"schema_version": "ss.pdm.link/1"
},
"anchors": {},
"exists": True,
"heads": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
link_set: {
created_at: '<string>',
id: '<string>',
links: [
{
source: {at: '<string>', doc: '<string>', anchor: '<string>', oid: '<string>'},
target: {at: '<string>', doc: '<string>', anchor: '<string>', oid: '<string>'}
}
],
name: '<string>',
schema_version: 'ss.pdm.link/1'
},
anchors: {},
exists: true,
heads: {}
})
};
fetch('https://api.eddy.engineer/v1/link.suspects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/link.suspects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'link_set' => [
'created_at' => '<string>',
'id' => '<string>',
'links' => [
[
'source' => [
'at' => '<string>',
'doc' => '<string>',
'anchor' => '<string>',
'oid' => '<string>'
],
'target' => [
'at' => '<string>',
'doc' => '<string>',
'anchor' => '<string>',
'oid' => '<string>'
]
]
],
'name' => '<string>',
'schema_version' => 'ss.pdm.link/1'
],
'anchors' => [
],
'exists' => true,
'heads' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/link.suspects"
payload := strings.NewReader("{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/link.suspects")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/link.suspects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"link_set\": {\n \"created_at\": \"<string>\",\n \"id\": \"<string>\",\n \"links\": [\n {\n \"source\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n },\n \"target\": {\n \"at\": \"<string>\",\n \"doc\": \"<string>\",\n \"anchor\": \"<string>\",\n \"oid\": \"<string>\"\n }\n }\n ],\n \"name\": \"<string>\",\n \"schema_version\": \"ss.pdm.link/1\"\n },\n \"anchors\": {},\n \"exists\": true,\n \"heads\": {}\n}"
response = http.request(request)
puts response.read_body{
"heads_used": {},
"suspect_count": 123,
"suspects": [
{
"problem": "<string>",
"source_recorded": {
"at": "<string>",
"doc": "<string>",
"kind": "req",
"anchor": "<string>",
"oid": "<string>"
},
"target_recorded": {
"at": "<string>",
"doc": "<string>",
"kind": "req",
"anchor": "<string>",
"oid": "<string>"
},
"ty": "<string>"
}
]
}Body
application/json