attention-manifest-protocol 0.4.3 → 0.4.4

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.
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://amp.dev/schema/0.1/collaboration.schema.json",
4
+ "title": "AMP collaboration objects (delegation | lease | result-contract)",
5
+ "type": "object",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "required": ["amp", "kind", "id", "granter", "delegatee", "goal_digest", "scope", "budget", "deadline", "may_redelegate", "depth"],
10
+ "properties": {
11
+ "amp": { "const": "0.1" },
12
+ "kind": { "const": "delegation" },
13
+ "id": { "$ref": "common.schema.json#/$defs/id" },
14
+ "parent": { "$ref": "common.schema.json#/$defs/id" },
15
+ "granter": { "$ref": "common.schema.json#/$defs/id" },
16
+ "delegatee": { "$ref": "common.schema.json#/$defs/id" },
17
+ "goal_digest": { "$ref": "common.schema.json#/$defs/digest" },
18
+ "scope": { "type": "array", "items": { "type": "string" } },
19
+ "budget": { "$ref": "common.schema.json#/$defs/budget" },
20
+ "deadline": { "$ref": "common.schema.json#/$defs/ts" },
21
+ "may_redelegate": { "type": "boolean" },
22
+ "depth": { "type": "integer", "minimum": 0, "maximum": 2 }
23
+ },
24
+ "additionalProperties": false
25
+ },
26
+ {
27
+ "type": "object",
28
+ "required": ["amp", "kind", "id", "delegation", "task_id", "holder", "fence", "goal_digest", "budget", "deadline", "status"],
29
+ "properties": {
30
+ "amp": { "const": "0.1" },
31
+ "kind": { "const": "lease" },
32
+ "id": { "$ref": "common.schema.json#/$defs/id" },
33
+ "delegation": { "$ref": "common.schema.json#/$defs/id" },
34
+ "task_id": { "$ref": "common.schema.json#/$defs/id" },
35
+ "holder": { "$ref": "common.schema.json#/$defs/id" },
36
+ "fence": { "type": "integer", "minimum": 1 },
37
+ "goal_digest": { "$ref": "common.schema.json#/$defs/digest" },
38
+ "budget": { "$ref": "common.schema.json#/$defs/budget" },
39
+ "deadline": { "$ref": "common.schema.json#/$defs/ts" },
40
+ "status": { "type": "string", "enum": ["active", "done", "cancelled"] }
41
+ },
42
+ "additionalProperties": false
43
+ },
44
+ {
45
+ "type": "object",
46
+ "required": ["amp", "kind", "id", "lease", "goal_digest", "claims", "evidence", "unknowns", "artifacts", "status"],
47
+ "properties": {
48
+ "amp": { "const": "0.1" },
49
+ "kind": { "const": "result-contract" },
50
+ "id": { "$ref": "common.schema.json#/$defs/id" },
51
+ "lease": { "$ref": "common.schema.json#/$defs/id" },
52
+ "goal_digest": { "$ref": "common.schema.json#/$defs/digest" },
53
+ "claims": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
54
+ "evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
55
+ "unknowns": { "type": "array", "items": { "type": "string" } },
56
+ "artifacts": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "required": ["id", "digest"],
61
+ "properties": {
62
+ "id": { "$ref": "common.schema.json#/$defs/id" },
63
+ "digest": { "$ref": "common.schema.json#/$defs/digest" }
64
+ },
65
+ "additionalProperties": false
66
+ }
67
+ },
68
+ "status": { "type": "string", "enum": ["ok", "partial", "failed"] }
69
+ },
70
+ "additionalProperties": false
71
+ }
72
+ ]
73
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://amp.dev/schema/0.1/common.schema.json",
4
+ "title": "AMP common definitions",
5
+ "$defs": {
6
+ "id": {
7
+ "type": "string",
8
+ "pattern": "^[a-z][a-z0-9._:-]{0,63}$"
9
+ },
10
+ "digest": {
11
+ "type": "string",
12
+ "pattern": "^sha256:[a-f0-9]{64}$"
13
+ },
14
+ "ts": {
15
+ "type": "string",
16
+ "format": "date-time"
17
+ },
18
+ "confidence": {
19
+ "type": "number",
20
+ "minimum": 0,
21
+ "maximum": 1
22
+ },
23
+ "trust": {
24
+ "type": "string",
25
+ "enum": ["self", "verified", "trusted", "asserted", "inferred", "external"]
26
+ },
27
+ "tier": {
28
+ "type": "string",
29
+ "enum": ["T0", "T1", "T2", "T3", "T4"]
30
+ },
31
+ "refKind": {
32
+ "type": "string",
33
+ "enum": [
34
+ "entity", "concept", "process", "thread", "question", "hypothesis", "claim",
35
+ "evidence", "goal", "plan", "task", "tool", "memory", "other",
36
+ "human", "event", "handle", "frame", "self", "unknown", "common-ground",
37
+ "capability", "agent", "receipt", "org"
38
+ ]
39
+ },
40
+ "ref": {
41
+ "type": "object",
42
+ "required": ["kind", "id"],
43
+ "properties": {
44
+ "kind": { "$ref": "#/$defs/refKind" },
45
+ "id": { "$ref": "#/$defs/id" },
46
+ "label": { "type": "string" }
47
+ },
48
+ "additionalProperties": false
49
+ },
50
+ "provenance": {
51
+ "type": "object",
52
+ "required": ["source"],
53
+ "properties": {
54
+ "source": { "type": "string" },
55
+ "kind": {
56
+ "type": "string",
57
+ "enum": ["observation", "testimony", "inference", "tool", "memory", "document", "simulation"]
58
+ },
59
+ "trust": { "$ref": "#/$defs/trust" },
60
+ "at": { "$ref": "#/$defs/ts" },
61
+ "digest": { "$ref": "#/$defs/digest" },
62
+ "note": { "type": "string" }
63
+ },
64
+ "additionalProperties": false
65
+ },
66
+ "budget": {
67
+ "type": "object",
68
+ "properties": {
69
+ "tokens": { "type": "integer", "minimum": 0 },
70
+ "ms": { "type": "integer", "minimum": 0 },
71
+ "calls": { "type": "integer", "minimum": 0 },
72
+ "interrupts": { "type": "integer", "minimum": 0 },
73
+ "money": { "type": "number", "minimum": 0 }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "usage": {
78
+ "type": "object",
79
+ "properties": {
80
+ "tokens": { "type": "integer", "minimum": 0 },
81
+ "ms": { "type": "integer", "minimum": 0 },
82
+ "calls": { "type": "integer", "minimum": 0 },
83
+ "interrupts": { "type": "integer", "minimum": 0 },
84
+ "money": { "type": "number", "minimum": 0 }
85
+ },
86
+ "additionalProperties": false
87
+ },
88
+ "signature": {
89
+ "type": "object",
90
+ "required": ["role", "alg", "kid", "sig"],
91
+ "properties": {
92
+ "role": { "type": "string", "enum": ["self", "host", "registry", "org", "tenant"] },
93
+ "alg": { "type": "string", "const": "ed25519" },
94
+ "kid": { "type": "string" },
95
+ "sig": { "type": "string" }
96
+ },
97
+ "additionalProperties": false
98
+ },
99
+ "criterion": {
100
+ "type": "object",
101
+ "required": ["id", "statement", "check"],
102
+ "properties": {
103
+ "id": { "$ref": "#/$defs/id" },
104
+ "statement": { "type": "string" },
105
+ "check": { "type": "string" },
106
+ "kind": { "type": "string", "enum": ["observe", "query", "assert"] }
107
+ },
108
+ "additionalProperties": false
109
+ },
110
+ "handle": {
111
+ "type": "object",
112
+ "required": ["id", "kind", "scope"],
113
+ "properties": {
114
+ "id": { "type": "string" },
115
+ "kind": { "type": "string", "enum": ["table", "text", "tree", "blob", "graph"] },
116
+ "tokens": { "type": "integer", "minimum": 0 },
117
+ "bytes": { "type": "integer", "minimum": 0 },
118
+ "preview": { "type": "string" },
119
+ "scope": { "type": "string", "enum": ["turn", "session", "task"] },
120
+ "ttl_ms": { "type": "integer", "minimum": 0 }
121
+ },
122
+ "additionalProperties": false
123
+ }
124
+ }
125
+ }
@@ -0,0 +1,121 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://amp.dev/schema/0.1/compaction.schema.json",
4
+ "title": "AMP checkpoint | prune plan",
5
+ "type": "object",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "required": [
10
+ "amp",
11
+ "kind",
12
+ "id",
13
+ "agent",
14
+ "from",
15
+ "to",
16
+ "count",
17
+ "tip",
18
+ "root",
19
+ "created",
20
+ "policy"
21
+ ],
22
+ "properties": {
23
+ "amp": { "const": "0.1" },
24
+ "kind": { "const": "checkpoint" },
25
+ "id": { "$ref": "common.schema.json#/$defs/id" },
26
+ "agent": { "$ref": "common.schema.json#/$defs/id" },
27
+ "from": { "type": "integer", "minimum": 0 },
28
+ "to": { "type": "integer", "minimum": 0 },
29
+ "count": { "type": "integer", "minimum": 1 },
30
+ "tip": { "$ref": "common.schema.json#/$defs/digest" },
31
+ "root": { "$ref": "common.schema.json#/$defs/digest" },
32
+ "created": { "$ref": "common.schema.json#/$defs/ts" },
33
+ "policy": {
34
+ "type": "object",
35
+ "required": ["keepRecent"],
36
+ "properties": {
37
+ "keepRecent": { "type": "integer", "minimum": 0 }
38
+ },
39
+ "additionalProperties": false
40
+ }
41
+ },
42
+ "additionalProperties": false
43
+ },
44
+ {
45
+ "type": "object",
46
+ "required": [
47
+ "amp",
48
+ "kind",
49
+ "agent",
50
+ "sourceTip",
51
+ "sourceCount",
52
+ "kept",
53
+ "dropped",
54
+ "reclaimedBytes",
55
+ "estimatedTokens",
56
+ "policy"
57
+ ],
58
+ "properties": {
59
+ "amp": { "const": "0.1" },
60
+ "kind": { "const": "prune-plan" },
61
+ "agent": { "$ref": "common.schema.json#/$defs/id" },
62
+ "sourceTip": { "$ref": "common.schema.json#/$defs/digest" },
63
+ "sourceCount": { "type": "integer", "minimum": 0 },
64
+ "kept": {
65
+ "type": "array",
66
+ "items": { "type": "integer", "minimum": 0 }
67
+ },
68
+ "dropped": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "object",
72
+ "required": ["seq", "kind", "id", "reason", "revisit_if", "bytes"],
73
+ "properties": {
74
+ "seq": { "type": "integer", "minimum": 0 },
75
+ "kind": {
76
+ "enum": [
77
+ "event",
78
+ "frame",
79
+ "receipt",
80
+ "claim",
81
+ "hypothesis",
82
+ "unknown",
83
+ "goal",
84
+ "plan"
85
+ ]
86
+ },
87
+ "id": { "$ref": "common.schema.json#/$defs/id" },
88
+ "reason": { "enum": ["superseded", "closed", "resolved"] },
89
+ "revisit_if": { "type": "string", "minLength": 1 },
90
+ "bytes": { "type": "integer", "minimum": 0 }
91
+ },
92
+ "additionalProperties": false
93
+ }
94
+ },
95
+ "reclaimedBytes": { "type": "integer", "minimum": 0 },
96
+ "estimatedTokens": { "type": "integer", "minimum": 0 },
97
+ "policy": {
98
+ "type": "object",
99
+ "required": [
100
+ "amp",
101
+ "kind",
102
+ "keepRecent",
103
+ "dropSupersededClaims",
104
+ "dropClosedHypotheses",
105
+ "dropResolvedUnknowns"
106
+ ],
107
+ "properties": {
108
+ "amp": { "const": "0.1" },
109
+ "kind": { "const": "prune-policy" },
110
+ "keepRecent": { "type": "integer", "minimum": 0 },
111
+ "dropSupersededClaims": { "type": "boolean" },
112
+ "dropClosedHypotheses": { "type": "boolean" },
113
+ "dropResolvedUnknowns": { "type": "boolean" }
114
+ },
115
+ "additionalProperties": false
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ }
120
+ ]
121
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://amp.dev/schema/0.1/concept-compaction.schema.json",
4
+ "title": "AMP concept prune plan | concept checkpoint",
5
+ "type": "object",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "required": ["amp", "kind", "concept", "version", "dropped", "reclaimedBytes", "budget"],
10
+ "properties": {
11
+ "amp": { "const": "0.1" },
12
+ "kind": { "const": "concept-prune-plan" },
13
+ "concept": { "$ref": "common.schema.json#/$defs/id" },
14
+ "version": { "type": "integer", "minimum": 1 },
15
+ "dropped": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "required": ["slot", "index", "summary", "reason", "revisit_if"],
20
+ "properties": {
21
+ "slot": { "enum": ["example", "relation", "extension"] },
22
+ "index": { "type": "integer", "minimum": 0 },
23
+ "summary": { "type": "string", "minLength": 1 },
24
+ "reason": { "enum": ["duplicate", "over-budget", "dangling"] },
25
+ "revisit_if": { "type": "string", "minLength": 1 }
26
+ },
27
+ "additionalProperties": false
28
+ }
29
+ },
30
+ "reclaimedBytes": { "type": "integer", "minimum": 0 },
31
+ "budget": {
32
+ "type": "object",
33
+ "required": ["amp", "kind", "maxExamples", "minExamples", "maxRelations", "keepVersions"],
34
+ "properties": {
35
+ "amp": { "const": "0.1" },
36
+ "kind": { "const": "concept-budget" },
37
+ "maxExamples": { "type": "integer", "minimum": 0 },
38
+ "minExamples": { "type": "integer", "minimum": 0 },
39
+ "maxRelations": { "type": "integer", "minimum": 0 },
40
+ "keepVersions": { "type": "integer", "minimum": 1 }
41
+ },
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "additionalProperties": false
46
+ },
47
+ {
48
+ "type": "object",
49
+ "required": ["amp", "kind", "id", "concept", "from", "to", "count", "tip", "root", "created", "budget"],
50
+ "properties": {
51
+ "amp": { "const": "0.1" },
52
+ "kind": { "const": "concept-checkpoint" },
53
+ "id": { "$ref": "common.schema.json#/$defs/id" },
54
+ "concept": { "$ref": "common.schema.json#/$defs/id" },
55
+ "from": { "type": "integer", "minimum": 1 },
56
+ "to": { "type": "integer", "minimum": 1 },
57
+ "count": { "type": "integer", "minimum": 1 },
58
+ "tip": { "$ref": "common.schema.json#/$defs/digest" },
59
+ "root": { "$ref": "common.schema.json#/$defs/digest" },
60
+ "created": { "$ref": "common.schema.json#/$defs/ts" },
61
+ "budget": {
62
+ "type": "object",
63
+ "required": ["keepVersions"],
64
+ "properties": {
65
+ "keepVersions": { "type": "integer", "minimum": 1 }
66
+ },
67
+ "additionalProperties": false
68
+ }
69
+ },
70
+ "additionalProperties": false
71
+ }
72
+ ]
73
+ }
@@ -0,0 +1,97 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://amp.dev/schema/0.1/concept.schema.json",
4
+ "title": "AMP Concept",
5
+ "type": "object",
6
+ "required": ["amp", "kind", "id", "label", "definition", "intension", "status", "confidence", "provenance", "version", "created"],
7
+ "properties": {
8
+ "amp": { "const": "0.1" },
9
+ "kind": { "const": "concept" },
10
+ "id": { "$ref": "common.schema.json#/$defs/id" },
11
+ "label": { "type": "string", "minLength": 1 },
12
+ "definition": { "type": "string", "minLength": 1 },
13
+ "intension": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "required": ["feature"],
18
+ "properties": {
19
+ "feature": { "type": "string" },
20
+ "weight": { "$ref": "common.schema.json#/$defs/confidence" }
21
+ },
22
+ "additionalProperties": false
23
+ }
24
+ },
25
+ "dimensions": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "required": ["name"],
30
+ "properties": {
31
+ "name": { "type": "string" },
32
+ "scale": { "type": "string", "enum": ["nominal", "ordinal", "interval", "ratio"] }
33
+ },
34
+ "additionalProperties": false
35
+ }
36
+ },
37
+ "theory_refs": { "type": "array", "items": { "type": "string" } },
38
+ "extension": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
39
+ "prototype": { "type": "string" },
40
+ "examples": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "required": ["description"],
45
+ "properties": {
46
+ "ref": { "$ref": "common.schema.json#/$defs/ref" },
47
+ "description": { "type": "string" },
48
+ "typicality": { "$ref": "common.schema.json#/$defs/confidence" }
49
+ },
50
+ "additionalProperties": false
51
+ }
52
+ },
53
+ "counterexamples": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "required": ["description"],
58
+ "properties": {
59
+ "ref": { "$ref": "common.schema.json#/$defs/ref" },
60
+ "description": { "type": "string" },
61
+ "typicality": { "$ref": "common.schema.json#/$defs/confidence" }
62
+ },
63
+ "additionalProperties": false
64
+ }
65
+ },
66
+ "relations": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "required": ["type", "target"],
71
+ "properties": {
72
+ "type": { "type": "string", "enum": ["is-a", "part-of", "causes", "enables", "contrasts-with", "derived-from", "precedes"] },
73
+ "target": { "$ref": "common.schema.json#/$defs/ref" }
74
+ },
75
+ "additionalProperties": false
76
+ }
77
+ },
78
+ "grounded_in": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
79
+ "status": { "type": "string", "enum": ["proposed", "active", "deprecated", "merged", "split"] },
80
+ "confidence": { "$ref": "common.schema.json#/$defs/confidence" },
81
+ "provenance": { "$ref": "common.schema.json#/$defs/provenance" },
82
+ "version": { "type": "integer", "minimum": 1 },
83
+ "created": { "$ref": "common.schema.json#/$defs/ts" },
84
+ "revision": {
85
+ "type": "object",
86
+ "required": ["op", "at"],
87
+ "properties": {
88
+ "op": { "type": "string", "enum": ["merge", "split", "refine", "retire"] },
89
+ "at": { "$ref": "common.schema.json#/$defs/ts" },
90
+ "from": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
91
+ "reason": { "type": "string" }
92
+ },
93
+ "additionalProperties": false
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ }