@agentproto/corpus-cli 0.10.2 → 0.11.1

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.
Files changed (25) hide show
  1. package/dist/cli.mjs +164 -93
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/ports/index.d.ts +37 -1
  4. package/dist/ports/index.mjs +141 -74
  5. package/dist/ports/index.mjs.map +1 -1
  6. package/dist/specs/resources/aip-10/draft/KNOWLEDGE.schema.json +2 -2
  7. package/dist/specs/resources/aip-18/draft/COLLECTION.schema.json +9 -2
  8. package/dist/specs/resources/aip-19/draft/SECRETS.schema.json +8 -2
  9. package/dist/specs/resources/aip-20/draft/WORK.schema.json +232 -206
  10. package/dist/specs/resources/aip-34/draft/EXPORT.schema.json +29 -0
  11. package/dist/specs/resources/aip-34/draft/LOCK.schema.json +76 -0
  12. package/dist/specs/resources/aip-34/draft/TYPES.schema.json +78 -0
  13. package/dist/specs/resources/aip-34/draft/WORKSPACE.schema.json +236 -105
  14. package/dist/specs/resources/aip-42/draft/AGENT.schema.json +5 -0
  15. package/dist/specs/resources/aip-49/draft/ASSET.schema.json +10 -0
  16. package/dist/specs/resources/aip-53/draft/APP.schema.json +862 -43
  17. package/dist/specs/resources/aip-58/draft/event.schema.json +3 -2
  18. package/dist/specs/resources/aip-62/draft/ATTESTATION.schema.json +368 -62
  19. package/dist/specs/resources/aip-62/draft/REVIEW.schema.json +201 -43
  20. package/dist/specs/resources/aip-63/draft/BROWSER.schema.json +427 -0
  21. package/dist/specs/resources/aip-63/draft/RECORDING.schema.json +292 -0
  22. package/dist/specs/resources/aip-7/draft/GOVERNANCE.schema.json +2 -2
  23. package/dist/specs/resources/pending/memory/draft/MEMORY.schema.json +321 -0
  24. package/dist/specs/resources/pending/services/SERVICES.schema.json +35 -0
  25. package/package.json +7 -7
@@ -0,0 +1,292 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-63/RECORDING.schema.json",
4
+ "title": "browser-recording/v1",
5
+ "description": "Schemas for the files of a browser recording directory (AIP-63 section 6). manifest.json validates against $defs/manifest. Each line of frames.jsonl validates against $defs/frame and each line of actions.jsonl against $defs/action. The property sets are closed on purpose: there is no field in which a typed value of a masked input could be placed (R8, R9).",
6
+ "$ref": "#/$defs/manifest",
7
+ "$defs": {
8
+ "recordingId": {
9
+ "type": "string",
10
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{7,63}$",
11
+ "description": "Also the name of the recording directory. No dot and no slash, so it cannot traverse (R1)."
12
+ },
13
+ "isoDateTime": {
14
+ "type": "string",
15
+ "format": "date-time"
16
+ },
17
+ "sha256Hex": {
18
+ "type": "string",
19
+ "pattern": "^[0-9a-f]{64}$"
20
+ },
21
+ "viewport": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": ["width", "height"],
25
+ "properties": {
26
+ "width": { "type": "integer", "minimum": 1 },
27
+ "height": { "type": "integer", "minimum": 1 },
28
+ "deviceScaleFactor": { "type": "number", "exclusiveMinimum": 0 }
29
+ }
30
+ },
31
+ "manifest": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": [
35
+ "schema",
36
+ "id",
37
+ "sessionId",
38
+ "provider",
39
+ "mode",
40
+ "startedAt",
41
+ "endedAt",
42
+ "status",
43
+ "viewport",
44
+ "frameCount",
45
+ "actionCount",
46
+ "redaction",
47
+ "retentionDays"
48
+ ],
49
+ "properties": {
50
+ "schema": { "const": "browser-recording/v1" },
51
+ "id": { "$ref": "#/$defs/recordingId" },
52
+ "sessionId": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "description": "The agent or browser session that was recorded."
56
+ },
57
+ "provider": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "description": "The id of the BROWSER.md provider that drove the browser (for example chrome-live, chromium, bureau)."
61
+ },
62
+ "adapter": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "description": "The adapter package or host component that captured the frames, when different from the provider."
66
+ },
67
+ "instanceId": { "type": "string", "minLength": 1 },
68
+ "deviceId": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "description": "AIP-59 device that owns the recording. When present, any other paired device MUST NOT read it (R11)."
72
+ },
73
+ "grantIds": {
74
+ "type": "array",
75
+ "uniqueItems": true,
76
+ "items": { "type": "string", "minLength": 1 },
77
+ "description": "Ids of the profile grants (AIP-63 section 4) that seeded the recorded session. Ids only, never material (R13)."
78
+ },
79
+ "mode": {
80
+ "type": "string",
81
+ "enum": ["per-action", "screencast"],
82
+ "description": "How frames were produced. The file format is identical in both modes (R6)."
83
+ },
84
+ "screencast": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "description": "Capture parameters, for mode screencast. Informational.",
88
+ "properties": {
89
+ "format": { "const": "jpeg" },
90
+ "quality": { "type": "integer", "minimum": 1, "maximum": 100 },
91
+ "everyNthFrame": { "type": "integer", "minimum": 1 },
92
+ "maxFps": { "type": "number", "exclusiveMinimum": 0 }
93
+ }
94
+ },
95
+ "startedAt": { "$ref": "#/$defs/isoDateTime" },
96
+ "endedAt": {
97
+ "oneOf": [{ "$ref": "#/$defs/isoDateTime" }, { "type": "null" }],
98
+ "description": "Null while status is recording."
99
+ },
100
+ "status": {
101
+ "type": "string",
102
+ "enum": ["recording", "complete", "failed", "interrupted"],
103
+ "description": "recording: the writer is live. complete: closed normally. failed: the writer hit an error it could not recover from (see statusReason). interrupted: the host stopped or crashed while recording (R14)."
104
+ },
105
+ "statusReason": { "type": "string", "maxLength": 500 },
106
+ "viewport": { "$ref": "#/$defs/viewport" },
107
+ "frameCount": { "type": "integer", "minimum": 0 },
108
+ "actionCount": { "type": "integer", "minimum": 0 },
109
+ "durationMs": { "type": "integer", "minimum": 0 },
110
+ "redaction": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["passwordFields"],
114
+ "properties": {
115
+ "passwordFields": {
116
+ "type": "string",
117
+ "enum": ["masked", "none"],
118
+ "description": "masked is the default. none is an explicit operator opt-out and MUST be recorded here (R8)."
119
+ },
120
+ "maskedFrames": { "type": "integer", "minimum": 0 },
121
+ "droppedFrames": {
122
+ "type": "integer",
123
+ "minimum": 0,
124
+ "description": "Frames that could not be masked with certainty and were not written (R9)."
125
+ }
126
+ }
127
+ },
128
+ "retentionDays": {
129
+ "type": "integer",
130
+ "minimum": 1,
131
+ "description": "Days after endedAt (or after startedAt, if the recording never ended) at which the host MUST delete the whole directory (R10)."
132
+ },
133
+ "expiresAt": { "$ref": "#/$defs/isoDateTime" },
134
+ "exports": {
135
+ "type": "array",
136
+ "description": "Derived files under exports/. Not part of the format proper: a reader MUST be able to regenerate them from frames and actions (R15).",
137
+ "items": {
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "required": ["kind", "file", "createdAt"],
141
+ "properties": {
142
+ "kind": { "const": "video" },
143
+ "file": { "type": "string", "pattern": "^exports/[A-Za-z0-9._-]+\\.(mp4|webm)$" },
144
+ "container": { "type": "string", "enum": ["mp4", "webm"] },
145
+ "durationMs": { "type": "integer", "minimum": 0 },
146
+ "createdAt": { "$ref": "#/$defs/isoDateTime" }
147
+ }
148
+ }
149
+ }
150
+ },
151
+ "allOf": [
152
+ {
153
+ "description": "R3, R14: a live recording has no end; any other status has one.",
154
+ "if": { "properties": { "status": { "const": "recording" } }, "required": ["status"] },
155
+ "then": { "properties": { "endedAt": { "type": "null" } } },
156
+ "else": { "properties": { "endedAt": { "$ref": "#/$defs/isoDateTime" } } }
157
+ },
158
+ {
159
+ "description": "R6: capture parameters only make sense for the screencast mode.",
160
+ "if": { "properties": { "mode": { "const": "per-action" } }, "required": ["mode"] },
161
+ "then": { "properties": { "screencast": false } }
162
+ }
163
+ ]
164
+ },
165
+ "frame": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "description": "One line of frames.jsonl.",
169
+ "required": ["i", "tMs", "file", "url", "tabId", "w", "h"],
170
+ "properties": {
171
+ "i": {
172
+ "type": "integer",
173
+ "minimum": 1,
174
+ "description": "Frame index, 1-based and contiguous (R4)."
175
+ },
176
+ "tMs": {
177
+ "type": "integer",
178
+ "minimum": 0,
179
+ "description": "Milliseconds since manifest.startedAt, non-decreasing (R4)."
180
+ },
181
+ "file": {
182
+ "type": "string",
183
+ "pattern": "^frames/[0-9]{6,}\\.jpg$",
184
+ "description": "Path relative to the recording directory. The number is i, zero-padded to at least six digits (R5)."
185
+ },
186
+ "url": {
187
+ "type": "string",
188
+ "description": "Page URL at capture time, with fragment and any userinfo removed (R7)."
189
+ },
190
+ "tabId": { "type": "string", "minLength": 1 },
191
+ "w": { "type": "integer", "minimum": 1, "description": "Pixel width of the stored JPEG. It MAY be smaller than the viewport (R5)." },
192
+ "h": { "type": "integer", "minimum": 1 },
193
+ "actionSeq": {
194
+ "type": "integer",
195
+ "minimum": 1,
196
+ "description": "seq of the action this frame follows. Required in per-action mode, optional in screencast mode (R6)."
197
+ },
198
+ "masked": {
199
+ "type": "string",
200
+ "enum": ["none", "fields", "full"],
201
+ "description": "none: no sensitive field visible. fields: the regions of sensitive fields were masked. full: the whole frame was blurred because masking could not be scoped (R8, R9). Absent means none."
202
+ },
203
+ "bytes": { "type": "integer", "minimum": 1 },
204
+ "prev": {
205
+ "$ref": "#/$defs/sha256Hex",
206
+ "description": "SHA-256 of the previous line of this file (SHOULD, R3)."
207
+ }
208
+ }
209
+ },
210
+ "action": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "description": "One line of actions.jsonl. There is no field that holds a typed or evaluated value in clear (R7).",
214
+ "required": ["seq", "tMs", "tool", "url", "summary", "status", "durationMs"],
215
+ "properties": {
216
+ "seq": {
217
+ "type": "integer",
218
+ "minimum": 1,
219
+ "description": "Action sequence number, 1-based and contiguous (R4)."
220
+ },
221
+ "tMs": { "type": "integer", "minimum": 0, "description": "Start of the action, in milliseconds since manifest.startedAt." },
222
+ "tool": {
223
+ "type": "string",
224
+ "pattern": "^[a-z][a-z0-9_.-]{0,63}$",
225
+ "description": "The browser tool without the browser. prefix: navigate, click, fill, evaluate, screenshot, scroll, get_dom, extract_text, act, tabs, or a vendor tool."
226
+ },
227
+ "url": {
228
+ "type": "string",
229
+ "description": "Page URL when the action started, with fragment and any userinfo removed."
230
+ },
231
+ "tabId": { "type": "string", "minLength": 1 },
232
+ "target": {
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "description": "What the action was aimed at. A locator, never a value (R7).",
236
+ "properties": {
237
+ "selector": { "type": "string", "maxLength": 500 },
238
+ "role": { "type": "string", "maxLength": 100 },
239
+ "name": { "type": "string", "maxLength": 200, "description": "Accessible name of the element, not its value." },
240
+ "sensitive": {
241
+ "const": true,
242
+ "description": "The element is a password-like field (R8). Present means the value was redacted from the summary."
243
+ }
244
+ }
245
+ },
246
+ "summary": {
247
+ "type": "string",
248
+ "maxLength": 500,
249
+ "description": "One human-readable line. For a fill on a sensitive field it MUST NOT contain the value, not even its length (R7)."
250
+ },
251
+ "status": { "type": "string", "enum": ["ok", "error"] },
252
+ "durationMs": { "type": "integer", "minimum": 0 },
253
+ "error": {
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": ["code"],
257
+ "properties": {
258
+ "code": { "type": "string", "description": "A browser:* code from AIP-63 T4 or a vendor code." },
259
+ "message": { "type": "string", "maxLength": 500 }
260
+ }
261
+ },
262
+ "redacted": {
263
+ "const": true,
264
+ "description": "Some part of this action was removed by the writer (R7)."
265
+ },
266
+ "prev": {
267
+ "$ref": "#/$defs/sha256Hex",
268
+ "description": "SHA-256 of the previous line of this file (SHOULD, R3)."
269
+ }
270
+ },
271
+ "allOf": [
272
+ {
273
+ "description": "R7: an error status carries an error, an ok status does not.",
274
+ "if": { "properties": { "status": { "const": "error" } }, "required": ["status"] },
275
+ "then": { "required": ["error"] },
276
+ "else": { "not": { "required": ["error"] } }
277
+ },
278
+ {
279
+ "description": "R7: a fill that targets a sensitive field is marked redacted.",
280
+ "if": {
281
+ "properties": {
282
+ "tool": { "const": "fill" },
283
+ "target": { "required": ["sensitive"], "properties": { "sensitive": { "const": true } } }
284
+ },
285
+ "required": ["tool", "target"]
286
+ },
287
+ "then": { "required": ["redacted"] }
288
+ }
289
+ ]
290
+ }
291
+ }
292
+ }
@@ -272,8 +272,8 @@
272
272
  ]
273
273
  },
274
274
  "approvalChannel": {
275
- "enum": ["web_click", "ui_card"],
276
- "description": "A declared human channel. web_click: bearer credential plus an Origin on a configured allowlist. ui_card: one-time ticket minted per card render, app-only decide action, served on a surface agent sessions cannot reach. Further channels MAY be registered; each MUST satisfy the AIP-7 human channel rule."
275
+ "enum": ["web_click", "ui_card", "telegram"],
276
+ "description": "A declared human channel. web_click: bearer credential plus an Origin on a configured allowlist. ui_card: one-time ticket minted per card render, app-only decide action, served on a surface agent sessions cannot reach. telegram: a shared bot-bridge bearer secret, in place of an Origin (a Telegram webhook callback has none). Further channels MAY be registered; each MUST satisfy the AIP-7 human channel rule."
277
277
  },
278
278
  "auditEvent": {
279
279
  "type": "object",
@@ -0,0 +1,321 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/pending/memory/MEMORY.schema.json",
4
+ "title": "MEMORY.md frontmatter — memory/v1",
5
+ "description": "Validates the YAML frontmatter of a memory/v1 MEMORY.md file — the individual agent's own memory. This is a THIRD doctype: it neither absorbs nor replaces AIP-10 agentknowledge/v1 (curated, shareable wiki entries) nor AIP-11 learning/v1 (lessons). A memory/v1 document carries the AIP-10 base fields (schema, slug, kind, title, updated_at); the remaining fields codify the item shape Pygmalion already writes, and are OPTIONAL so an AIP-10-aligned writer and the current Pygmalion writer both round-trip through the same schema. The markdown body (the `body` property) is unrestricted text.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "anyOf": [
9
+ { "required": ["schema", "slug", "kind", "title", "updated_at"] },
10
+ { "required": ["id", "name", "type"] }
11
+ ],
12
+ "properties": {
13
+ "schema": {
14
+ "const": "memory/v1",
15
+ "description": "Discriminator for a memory/v1 document. Optional only to tolerate legacy Pygmalion items written before this doctype existed; a canonical memory/v1 document MUST set it, and when present it MUST equal 'memory/v1'."
16
+ },
17
+ "slug": {
18
+ "type": "string",
19
+ "minLength": 2,
20
+ "maxLength": 96,
21
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
22
+ "description": "Stable kebab-case identifier (AIP-10 convention). Used as the item's path stem and cross-reference target."
23
+ },
24
+ "kind": {
25
+ "type": "string",
26
+ "minLength": 2,
27
+ "maxLength": 32,
28
+ "pattern": "^[a-z][a-z0-9-]*$",
29
+ "description": "Item kind (AIP-10 convention). Common values mirror Pygmalion's memory types: 'user', 'feedback', 'project', 'reference'."
30
+ },
31
+ "title": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 200,
35
+ "description": "Human-readable title (AIP-10 convention)."
36
+ },
37
+ "updated_at": {
38
+ "type": "string",
39
+ "format": "date-time",
40
+ "description": "ISO 8601 timestamp of the last write (AIP-10 convention). MUST be set on every write."
41
+ },
42
+ "id": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "description": "Pygmalion item identifier (e.g. 'mem_qc8f407g'). Legacy alias for the AIP-10 path stem; when the base fields are omitted it takes part in identifying the item."
46
+ },
47
+ "name": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 1000,
51
+ "description": "Pygmalion slugified name, distinct from `title`. Kept as a separate field so a Pygmalion write round-trips without loss."
52
+ },
53
+ "type": {
54
+ "enum": ["user", "feedback", "project", "reference"],
55
+ "description": "Pygmalion memory type. The closed type set from the memory contract; `kind` is the AIP-10-aligned spelling of the same notion."
56
+ },
57
+ "description": {
58
+ "type": "string",
59
+ "maxLength": 4000,
60
+ "description": "Pygmalion one-line human-readable summary, independent of the body."
61
+ },
62
+ "tags": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "default": [],
69
+ "description": "Free-form labels. Pygmalion writes formatted anchor labels here (e.g. 'global', 'project:fhcm', 'pr:agentproto/ts#1858')."
70
+ },
71
+ "polarity": {
72
+ "enum": ["do", "dont"],
73
+ "description": "Pygmalion feedback polarity. Present only on items of type 'feedback'."
74
+ },
75
+ "lifetime": {
76
+ "$ref": "#/$defs/lifetime",
77
+ "description": "How long the item stays valid. Pygmalion writes { kind: 'durable' } or { kind: 'while', anchor: { … } }."
78
+ },
79
+ "status": {
80
+ "enum": [
81
+ "active",
82
+ "proposed",
83
+ "confirmed",
84
+ "rejected",
85
+ "expired",
86
+ "stale",
87
+ "superseded"
88
+ ],
89
+ "description": "Lifecycle status. Pygmalion currently writes 'active'; the other values come from the memory-proposal contract."
90
+ },
91
+ "created": {
92
+ "type": "string",
93
+ "format": "date-time",
94
+ "description": "Pygmalion creation timestamp."
95
+ },
96
+ "written": {
97
+ "type": "string",
98
+ "format": "date-time",
99
+ "description": "Pygmalion last-write timestamp. Mirrors the AIP-10 `updated_at`."
100
+ },
101
+ "decidedBy": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "properties": {
105
+ "rule": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "description": "Classifier rule that produced the item (e.g. 'lens-confident', 'brain-memory-file')."
109
+ },
110
+ "source": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "description": "Where the deciding rule came from (e.g. 'builtin')."
114
+ }
115
+ },
116
+ "description": "Which classifier/rule decided the item's shape and status."
117
+ },
118
+ "provenance": {
119
+ "$ref": "#/$defs/provenance",
120
+ "description": "Origin of the item's claims."
121
+ },
122
+ "evidence": {
123
+ "$ref": "#/$defs/evidence",
124
+ "description": "Trust/impact accounting captured at write time."
125
+ },
126
+ "capture": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "source": {
131
+ "type": "string",
132
+ "minLength": 1,
133
+ "description": "Capture source label (e.g. a transcript or memory-file source)."
134
+ },
135
+ "ts": {
136
+ "type": "string",
137
+ "format": "date-time",
138
+ "description": "ISO 8601 timestamp of the capture."
139
+ },
140
+ "hash": {
141
+ "type": "string",
142
+ "minLength": 1,
143
+ "description": "Content hash of the captured/normalized body, used for dedup and evidence."
144
+ }
145
+ },
146
+ "description": "Capture source/ts/hash trio for the item's source material."
147
+ },
148
+ "anchors": {
149
+ "type": "array",
150
+ "items": {
151
+ "$ref": "#/$defs/anchor"
152
+ },
153
+ "default": [],
154
+ "description": "Structured anchors scoping the item. Per-agent anchoring uses kind 'agent' with slug '<agent-slug>' (the 'agent:<slug>' form); other kinds are 'project', 'task', 'session', 'pr', 'contact', and the unscoped 'global'."
155
+ },
156
+ "body": {
157
+ "type": "string",
158
+ "description": "Unrestricted markdown body of the MEMORY.md file. Not constrained by this schema."
159
+ }
160
+ },
161
+ "$defs": {
162
+ "anchor": {
163
+ "type": "object",
164
+ "required": ["kind"],
165
+ "additionalProperties": false,
166
+ "properties": {
167
+ "kind": {
168
+ "enum": [
169
+ "global",
170
+ "project",
171
+ "task",
172
+ "session",
173
+ "pr",
174
+ "contact",
175
+ "agent"
176
+ ],
177
+ "description": "Anchor kind. 'agent' extends the conversation-contract set for per-agent anchoring."
178
+ },
179
+ "slug": {
180
+ "type": "string",
181
+ "minLength": 1,
182
+ "description": "Anchor target slug (project, contact, agent)."
183
+ },
184
+ "id": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "description": "Anchor target id (task, session)."
188
+ },
189
+ "repo": {
190
+ "type": "string",
191
+ "minLength": 1,
192
+ "description": "Repository 'owner/name' for a pr anchor."
193
+ },
194
+ "number": {
195
+ "type": "integer",
196
+ "minimum": 1,
197
+ "description": "Pull-request number for a pr anchor."
198
+ }
199
+ },
200
+ "description": "A scope anchor. Loose-but-typed: enough keys to carry the conversation contract's forms — { kind: 'project'|'contact'|'agent', slug }, { kind: 'task'|'session', id }, { kind: 'pr', repo, number }, { kind: 'global' } — while accepting the uniform { kind, slug } shape for the slug-bearing kinds."
201
+ },
202
+ "lifetime": {
203
+ "type": "object",
204
+ "required": ["kind"],
205
+ "additionalProperties": false,
206
+ "properties": {
207
+ "kind": {
208
+ "enum": ["durable", "until", "while", "session"],
209
+ "description": "Lifetime kind. 'durable' never expires; 'until' expires at `at`; 'while' lasts as long as `anchor` holds; 'session' lasts for the session."
210
+ },
211
+ "at": {
212
+ "type": "string",
213
+ "format": "date-time",
214
+ "description": "Expiry timestamp for kind 'until'."
215
+ },
216
+ "anchor": {
217
+ "$ref": "#/$defs/anchor",
218
+ "description": "Governing anchor for kind 'while'."
219
+ }
220
+ }
221
+ },
222
+ "provenance": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "properties": {
226
+ "source": {
227
+ "type": "string",
228
+ "minLength": 1,
229
+ "description": "Provenance source class (e.g. 'brain-transcript', 'brain-memory-file', 'converse', 'task-close', 'recall-gap')."
230
+ },
231
+ "sessionId": {
232
+ "type": "string",
233
+ "minLength": 1,
234
+ "description": "Session the claim was observed in."
235
+ },
236
+ "ref": {
237
+ "type": "string",
238
+ "minLength": 1,
239
+ "description": "Opaque reference into the source (message uuid, file path, …)."
240
+ },
241
+ "quote": {
242
+ "type": "string",
243
+ "description": "Verbatim quote backing the claim."
244
+ },
245
+ "at": {
246
+ "type": "string",
247
+ "format": "date-time",
248
+ "description": "When the claim was observed."
249
+ },
250
+ "origin": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "description": "Origin-style provenance label, matching the runtime's SessionDescriptor.origin (e.g. 'cron:<id>', 'gate', 'chat-starter', 'vscode')."
254
+ }
255
+ },
256
+ "description": "Provenance record for a claim (Pygmalion names, plus the runtime origin label)."
257
+ },
258
+ "evidence": {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "properties": {
262
+ "sourceKind": {
263
+ "type": "string",
264
+ "minLength": 1,
265
+ "description": "Kind of source the evidence came from (e.g. 'brain-transcript', 'brain-memory-file')."
266
+ },
267
+ "trust": {
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "description": "Trust class of the source (e.g. 'jeremy', 'internal')."
271
+ },
272
+ "explicitness": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "description": "Whether the claim was stated outright or inferred (e.g. 'implicit', 'explicit')."
276
+ },
277
+ "corroborations": {
278
+ "type": "integer",
279
+ "minimum": 0,
280
+ "description": "Number of independent corroborating observations."
281
+ },
282
+ "contradictsActive": {
283
+ "type": "boolean",
284
+ "description": "True when this item contradicts an active item."
285
+ },
286
+ "impact": {
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "description": "Impact class of the item (e.g. 'low', 'high')."
290
+ },
291
+ "lifetime": {
292
+ "$ref": "#/$defs/lifetime",
293
+ "description": "Lifetime as computed for the evidence pass."
294
+ },
295
+ "anchorsResolved": {
296
+ "type": "array",
297
+ "items": {
298
+ "type": "string",
299
+ "minLength": 1
300
+ },
301
+ "default": [],
302
+ "description": "Resolved anchor labels in Pygmalion's formatted form (e.g. 'global', 'project:fhcm', 'pr:agentproto/ts#1858', 'session:sess_…')."
303
+ },
304
+ "ageHours": {
305
+ "type": "number",
306
+ "description": "Age of the evidence in hours (may be fractional or negative relative to the write clock)."
307
+ },
308
+ "flags": {
309
+ "type": "array",
310
+ "items": {
311
+ "type": "string",
312
+ "minLength": 1
313
+ },
314
+ "default": [],
315
+ "description": "Machine-stable flags raised during the evidence pass."
316
+ }
317
+ },
318
+ "description": "Evidence/trust accounting captured when the item was written."
319
+ }
320
+ }
321
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/pending/services/SERVICES.schema.json",
4
+ "title": "AppService list — app/v1 APP.md `services`",
5
+ "description": "Validates the `services` frontmatter array of an AIP-53 APP.md — the app's production hosting surface. One entry = one supervised service process the host runs for the app; there is NO dependency graph, NO scaling and NO scheduler behind it. Names MUST be unique across the array (the loader rejects a duplicate `name` as a load error; JSON Schema 2020-12 cannot express per-key uniqueness, hence the additional `uniqueItems` guard against exact duplicates). This is NOT `dev.launch`: `dev.launch` stays dev-only and is never executed by the loader.",
6
+ "type": "array",
7
+ "minItems": 1,
8
+ "uniqueItems": true,
9
+ "items": { "$ref": "#/$defs/service" },
10
+ "$defs": {
11
+ "service": {
12
+ "type": "object",
13
+ "required": ["name", "entry"],
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "name": {
17
+ "type": "string",
18
+ "pattern": "^[a-z][a-z0-9-]*$",
19
+ "description": "Service identifier — kebab-case slug, unique across the `services` array."
20
+ },
21
+ "entry": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "description": "Non-empty shell command line that starts the service, e.g. `pnpm --filter x start` or `node dist/server.js`. Carried verbatim; a launcher command, never executed by the loader/`defineApp`."
25
+ },
26
+ "port": {
27
+ "type": "integer",
28
+ "minimum": 1,
29
+ "maximum": 65535,
30
+ "description": "Optional TCP port the service listens on. Omitted = a service that does not listen (no port). One process per entry, one port."
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }