agent-doc-system 1.3.0 → 1.5.0
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.
- package/CHANGELOG.md +77 -1
- package/INSTALL_FOR_AGENTS.md +1 -1
- package/README.md +5 -1
- package/adapters/database.mjs +153 -5
- package/bin/agentdoc.mjs +16 -1
- package/bin/commands.mjs +15 -0
- package/bin/usage.txt +4 -0
- package/core/cache/compiled.mjs +34 -0
- package/core/cache/parses.mjs +33 -0
- package/core/codes.mjs +13 -0
- package/core/compile.mjs +30 -2
- package/core/context/index.mjs +173 -0
- package/core/context/symbols.mjs +81 -0
- package/core/descriptors.mjs +49 -0
- package/core/fsx.mjs +50 -3
- package/core/graph.mjs +1 -1
- package/core/impact.mjs +74 -11
- package/core/query.mjs +58 -7
- package/core/session/results.mjs +138 -0
- package/core/snapshot.mjs +123 -0
- package/docs/ADAPTERS.md +48 -4
- package/docs/CI.md +3 -1
- package/docs/CONTEXT.md +136 -0
- package/docs/EVALS.md +124 -0
- package/docs/IMPLEMENTATION-PLAN.md +310 -0
- package/docs/QUERY.md +48 -9
- package/docs/SPEC.md +42 -0
- package/docs/ci/github-actions.yml +1 -1
- package/evals/agent/codex-driver.mjs +32 -0
- package/evals/agent/optimize.mjs +48 -0
- package/evals/agent/results/smoke-gpt-6.1-sol.json +81 -0
- package/evals/agent/run.mjs +163 -0
- package/evals/agent/tasks/corpus.mjs +53 -0
- package/evals/agent/tasks/pins.json +32 -0
- package/package.json +9 -5
- package/schemas/context.schema.json +222 -0
- package/schemas/resource.schema.json +9 -1
- package/skills/agent-doc-system/SKILL.md +6 -0
- package/templates/ci.yml +1 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"properties": {
|
|
5
|
+
"schemaVersion": {
|
|
6
|
+
"const": "agentdoc.dev/context/v1"
|
|
7
|
+
},
|
|
8
|
+
"packet": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"snapshot": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"inputHash": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"compiler": {
|
|
19
|
+
"type": "object"
|
|
20
|
+
},
|
|
21
|
+
"graphHash": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": [
|
|
26
|
+
"inputHash",
|
|
27
|
+
"compiler",
|
|
28
|
+
"graphHash"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"task": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"intent": {
|
|
35
|
+
"enum": [
|
|
36
|
+
"implement",
|
|
37
|
+
"change-contract",
|
|
38
|
+
"debug-runtime",
|
|
39
|
+
"review"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"scope": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"coverage": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"properties": {
|
|
52
|
+
"unmatched": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"limitations": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"staleObservations": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"required": [
|
|
72
|
+
"unmatched",
|
|
73
|
+
"limitations",
|
|
74
|
+
"staleObservations"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"records": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"properties": {
|
|
83
|
+
"id": {
|
|
84
|
+
"type": "string"
|
|
85
|
+
},
|
|
86
|
+
"version": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
"kind": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"subject": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"key": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"value": {},
|
|
99
|
+
"evidence": {
|
|
100
|
+
"type": "array",
|
|
101
|
+
"items": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"critical": {
|
|
106
|
+
"type": "boolean"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": [
|
|
110
|
+
"id",
|
|
111
|
+
"version",
|
|
112
|
+
"kind",
|
|
113
|
+
"subject",
|
|
114
|
+
"key",
|
|
115
|
+
"value",
|
|
116
|
+
"evidence",
|
|
117
|
+
"critical"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"delivery": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"properties": {
|
|
125
|
+
"offset": {
|
|
126
|
+
"type": "integer",
|
|
127
|
+
"minimum": 0
|
|
128
|
+
},
|
|
129
|
+
"total": {
|
|
130
|
+
"type": "integer",
|
|
131
|
+
"minimum": 0
|
|
132
|
+
},
|
|
133
|
+
"omitted": {
|
|
134
|
+
"type": "integer",
|
|
135
|
+
"minimum": 0
|
|
136
|
+
},
|
|
137
|
+
"criticalOmitted": {
|
|
138
|
+
"type": "integer",
|
|
139
|
+
"minimum": 0
|
|
140
|
+
},
|
|
141
|
+
"partial": {
|
|
142
|
+
"type": "boolean"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": [
|
|
146
|
+
"offset",
|
|
147
|
+
"total",
|
|
148
|
+
"omitted",
|
|
149
|
+
"criticalOmitted",
|
|
150
|
+
"partial"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"continuation": {
|
|
154
|
+
"anyOf": [
|
|
155
|
+
{
|
|
156
|
+
"type": "null"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"properties": {
|
|
162
|
+
"packet": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
},
|
|
165
|
+
"offset": {
|
|
166
|
+
"type": "integer",
|
|
167
|
+
"minimum": 0
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"required": [
|
|
171
|
+
"packet",
|
|
172
|
+
"offset"
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"budget": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"properties": {
|
|
181
|
+
"limit": {
|
|
182
|
+
"type": "integer",
|
|
183
|
+
"minimum": 0
|
|
184
|
+
},
|
|
185
|
+
"used": {
|
|
186
|
+
"type": "integer",
|
|
187
|
+
"minimum": 0
|
|
188
|
+
},
|
|
189
|
+
"encoding": {
|
|
190
|
+
"enum": [
|
|
191
|
+
"o200k_base",
|
|
192
|
+
"cl100k_base"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"tokenizerVersion": {
|
|
196
|
+
"const": "js-tiktoken@1.0.21"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"required": [
|
|
200
|
+
"limit",
|
|
201
|
+
"used",
|
|
202
|
+
"encoding",
|
|
203
|
+
"tokenizerVersion"
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"required": [
|
|
208
|
+
"schemaVersion",
|
|
209
|
+
"packet",
|
|
210
|
+
"snapshot",
|
|
211
|
+
"task",
|
|
212
|
+
"intent",
|
|
213
|
+
"scope",
|
|
214
|
+
"coverage",
|
|
215
|
+
"records",
|
|
216
|
+
"delivery",
|
|
217
|
+
"continuation",
|
|
218
|
+
"budget"
|
|
219
|
+
],
|
|
220
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
221
|
+
"$id": "agentdoc.dev/schema/context.schema.json"
|
|
222
|
+
}
|
|
@@ -16,7 +16,15 @@
|
|
|
16
16
|
"type": { "enum": ["logical-database", "logical-dataset", "event-bus", "queue", "cache", "object-store", "search-index", "secret-store", "other"] },
|
|
17
17
|
"placementRationale": { "$ref": "common.json#/$defs/rationale" },
|
|
18
18
|
"system": { "$ref": "common.json#/$defs/name" },
|
|
19
|
-
"context": { "$ref": "common.json#/$defs/context" }
|
|
19
|
+
"context": { "$ref": "common.json#/$defs/context" },
|
|
20
|
+
"migrationPaths": {
|
|
21
|
+
"description": "Repository directories (or files) holding this logical database's schema migrations, matched as whole-segment path prefixes. Authoritative for change impact: a change under one of them is a change to this Resource, whichever component owns the file. Never a binding: which components use the database is still derived. Only a logical-database may declare them.",
|
|
22
|
+
"type": "array",
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"maxItems": 32,
|
|
25
|
+
"uniqueItems": true,
|
|
26
|
+
"items": { "$ref": "common.json#/$defs/repoPath" }
|
|
27
|
+
}
|
|
20
28
|
},
|
|
21
29
|
"oneOf": [
|
|
22
30
|
{ "required": ["system"] },
|
|
@@ -116,3 +116,9 @@ The normative specification (`docs/SPEC.md`, `docs/AUTHORITY.md`,
|
|
|
116
116
|
`docs/PROVENANCE.md`, `docs/QUERY.md`, `docs/MIGRATION.md`, `docs/CI.md`) lives
|
|
117
117
|
in the agent-doc-system repository — read it when a rule here needs the full
|
|
118
118
|
contract behind it.
|
|
119
|
+
|
|
120
|
+
## Task context protocol (1.5+)
|
|
121
|
+
|
|
122
|
+
For an onboarded repository, use `agentdoc prepare` with a JSON request on stdin: `{"task":"Describe the intended change","paths":["relative/path"],"budget":{"tokens":4096,"encoding":"o200k_base"}}`. The response describes the current working tree, with no requirement to compile a committed graph first. Select the encoding your model uses; do not assume all models share one tokenizer.
|
|
123
|
+
|
|
124
|
+
A partial packet is incomplete: follow its continuation through `agentdoc expand`, increasing the budget if a record does not fit. After edits, use `agentdoc refresh` with the previous packet reference and only record IDs still retained in active context. Apply retractions and changed versions. Reset after losing context. Stale observations and unknown execution directories require resolution before treating facts as current or running checks. The complete protocol is in `docs/CONTEXT.md`. Existing query/impact/check workflows remain available.
|
package/templates/ci.yml
CHANGED
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
with: { node-version: '24' }
|
|
18
18
|
- name: Install the agentdoc CLI
|
|
19
19
|
# Unpinned tracks main. For CI reproducibility pin a tag or commit:
|
|
20
|
-
# github:lbframe/agent-doc-system#v1.
|
|
20
|
+
# github:lbframe/agent-doc-system#v1.5.0
|
|
21
21
|
# A compiler upgrade intentionally invalidates committed graphs.
|
|
22
22
|
run: npm install -g github:lbframe/agent-doc-system
|
|
23
23
|
- name: Validate and compile
|