JSON reports: ascribe sources and ascribe observe
The JSON Schemas of what ascribe sources and ascribe observe write with --format json.
For AI agents: the documentation index is at llms.txt, and this page is available as Markdown.
The JSON Schemas of what ascribe sources and ascribe observe write with --format json. Each document follows the rules of the JSON report contract.
ascribe sources fetch
The fields of schemas/sources-fetch.schema.json:
SourcesFetchReport: What ascribe sources fetch --format json writes: what was copied and removed for each source, and the files that couldn’t be copied.
| Field | Type | Required | Nullable | Description |
|---|---|---|---|---|
schema_version |
integer |
yes | no | The version of this schema. It changes only when a field is removed or changes meaning. |
ascribe_version |
string |
yes | no | The release of Ascribe that wrote it, as 0.4.5. |
written |
boolean |
yes | no | Whether the copies and the lock were written: false with --dry-run, which says what it would copy, remove, and write. |
sources |
object[] |
yes | no | Each source looked at, in declaration order. |
sources[].name |
string |
yes | no | The source. |
sources[].commit |
string |
yes | yes | Its pin, when it has one. |
sources[].pinned |
boolean |
yes | no | Whether this run pinned it, to the head of its branch. |
sources[].copied |
string[] |
yes | no | The copies written. |
sources[].removed |
string[] |
yes | no | The copies removed. |
sources[].failed |
object[] |
yes | no | The files snippets name that couldn’t be copied. |
sources[].failed[].path |
string |
yes | no | Its path in the source. |
sources[].failed[].reason |
string |
yes | no | Why. |
sources[].first_copy |
boolean |
yes | no | Whether these are the first files copied from the source, which publishes them to everyone who can read the project. |
unpinned |
string[] |
yes | no | The pins removed, of sources ascribe.toml no longer declares in another repository. |
lock_written |
boolean |
yes | no | Whether ascribe.lock was written. |
ascribe sources status
The fields of schemas/sources-status.schema.json:
SourcesStatusReport: What ascribe sources status --format json writes: each source’s pin and the state of its copies, read from the files alone.
| Field | Type | Required | Nullable | Description |
|---|---|---|---|---|
schema_version |
integer |
yes | no | The version of this schema. It changes only when a field is removed or changes meaning. |
ascribe_version |
string |
yes | no | The release of Ascribe that wrote it, as 0.4.5. |
sources |
object[] |
yes | no | Each source in another repository, in declaration order. |
sources[].name |
string |
yes | no | The source. |
sources[].git |
string |
yes | no | Its repository. |
sources[].branch |
string |
yes | yes | The branch an update follows; None for the repository’s default. |
sources[].commit |
string |
yes | yes | Its pin, when it has one to this repository. |
sources[].files |
object[] |
yes | no | Each copy, and each file snippets name with none, by path. |
sources[].files[].path |
string |
yes | no | Its path in the source. |
sources[].files[].state |
CopyState |
yes | no | Its state. |
CopyState: The state of a copy. One of:
| Value | Description |
|---|---|
"current" |
It’s the file the lock pins, and a snippet uses it, or it’s the source’s tested examples’ config or one of their observations. |
"changed" |
It isn’t the file the lock pins. |
"missing" |
The lock lists it, and it isn’t there. |
"unlocked" |
It’s there, and the lock doesn’t list it. |
"unused" |
No snippet names it. |
"not_copied" |
A snippet names it, and it hasn’t been copied. |
"not_at_pin" |
A snippet names it, and it isn’t in the repository at the pin. |
ascribe sources update
The fields of schemas/sources-update.schema.json:
SourcesUpdateReport: What ascribe sources update --format json writes: how each source’s pin moved, and the pages whose examples the new copies change.
| Field | Type | Required | Nullable | Description |
|---|---|---|---|---|
schema_version |
integer |
yes | no | The version of this schema. It changes only when a field is removed or changes meaning. |
ascribe_version |
string |
yes | no | The release of Ascribe that wrote it, as 0.4.5. |
changed |
boolean |
yes | no | Whether any file changed: a copy, or the lock. With --dry-run, whether any would. |
written |
boolean |
yes | no | Whether the copies and the lock were written: false with --dry-run, which lists no pages, since it wrote no copies. |
sources |
object[] |
yes | no | What the update did for each source, in declaration order. |
sources[].name |
string |
yes | no | The source. |
sources[].git |
string |
yes | no | Its repository. |
sources[].followed |
string |
yes | no | The revision followed: --to’s, the branch, or HEAD. |
sources[].from |
string |
yes | yes | The pin before, if it had one. |
sources[].to |
string |
yes | no | The pin now. |
sources[].moved |
boolean |
yes | no | Whether the pin moved. |
sources[].back |
boolean |
yes | no | Whether the new pin isn’t after the old one: it moved back, or to another line of history. No commits are counted then. |
sources[].commits |
object |
yes | yes | The commits after the old pin up to the new one, when it moved forward from one and the repository could say. |
sources[].commits.count |
integer |
yes | no | How many. |
sources[].commits.newest |
object[] |
yes | no | The newest, newest first, at most 20. |
sources[].commits.newest[].commit |
string |
yes | no | Its full hash. |
sources[].commits.newest[].subject |
string |
yes | no | The first line of its message. |
sources[].files |
object[] |
yes | no | The copies that changed. |
sources[].files[].path |
string |
yes | no | Its path in the source. |
sources[].files[].change |
FileChange |
yes | no | What happened to it. |
sources[].examples |
object[] |
yes | no | The tested examples snippets use whose status the new pin changed: each one that went stale, lost its observation, or became current, by path. |
sources[].examples[].path |
string |
yes | no | Its path in the source. |
sources[].examples[].status |
ExampleState |
yes | no | Its status at the new pin. |
sources[].examples[].was |
ExampleState |
yes | yes | Its status before; null when it wasn’t an example, or had no copy. |
sources[].failed |
object[] |
yes | no | The files snippets name that couldn’t be copied. |
sources[].failed[].path |
string |
yes | no | Its path in the source. |
sources[].failed[].reason |
string |
yes | no | Why. |
sources[].first_copy |
boolean |
yes | no | Whether these are the first files copied from the source. |
pages |
object[] |
yes | yes | The pages whose examples the new copies change, as ascribe drift --format json lists them; null when nothing changed, or when that can’t be told. |
pages[].path |
string |
yes | no | The page’s content path. |
pages[].route |
string |
yes | no | Its route, in the first of the builds it’s in. |
pages[].builds |
string[] |
yes | no | The builds that show it with a changed example, in the order asked for. |
pages[].page_changed |
boolean |
yes | no | Whether the page changed apart from its examples: its own file, or its resolved content through anything else it uses (a fragment, the content model), in any of those builds. When it didn’t, the example changed and the words around it didn’t. |
pages[].examples |
object[] |
yes | no | The examples that changed, by address. Empty when only broken isn’t. |
pages[].examples[].address |
string |
yes | no | Its address, as the page writes it. |
pages[].examples[].source |
string |
yes | no | The source the address names. |
pages[].examples[].file |
string |
yes | no | The code file now, from the repository’s root. |
pages[].examples[].was_file |
string |
yes | yes | The code file at the base, when it was renamed since. |
pages[].examples[].added |
integer |
yes | no | Lines only in the code now. |
pages[].examples[].removed |
integer |
yes | no | Lines only in the code at the base. |
pages[].broken |
object[] |
yes | no | The examples that resolved at the base and don’t now, by address. |
pages[].broken[].address |
string |
yes | no | Its address, as the page writes it. |
pages[].broken[].source |
string |
yes | no | The source the address names. |
pages[].broken[].problem |
string |
yes | no | The slug of the diagnostic ascribe check reports for it (snippet-region-missing). |
pages[].broken[].reason |
string |
yes | no | Why it doesn’t resolve, in a few words. |
pages_unavailable |
string |
yes | yes | Why there are no pages, when there aren’t. |
FileChange: What happened to a copy. One of:
| Value | Description |
|---|---|
"added" |
It’s new. |
"changed" |
Its contents changed. |
"removed" |
It’s gone. |
ExampleState: Where a tested example stands against the observation copied with it. One of:
| Value | Description |
|---|---|
"current" |
The observation lists the file as it is: the page says what it was tested with. |
"stale" |
The file changed, and the observation didn’t follow. |
"unobserved" |
No observation lists the file. |
ascribe observe
The fields of schemas/observe.schema.json:
ObserveReport: What ascribe observe --format json writes: the commands it ran, how the test ended, the observation it wrote, and what changed since the one it replaced. With --check, nothing ran: the observation it compared, and whether it’s current.
| Field | Type | Required | Nullable | Description |
|---|---|---|---|---|
schema_version |
integer |
yes | no | The version of this schema. It changes only when a field is removed or changes meaning. |
ascribe_version |
string |
yes | no | The release of Ascribe that wrote it, as 0.4.5. |
config |
string |
yes | no | The config it ran, ascribe.examples.toml, in the current folder. |
check |
boolean |
yes | no | Whether it was run with --check, which runs nothing. |
environment |
object[] |
yes | no | The [environment] commands, in the order the config has them, each with the line it kept. Empty with --check. |
environment[].key |
string |
yes | no | The entry’s key. |
environment[].command |
string |
yes | no | The line of shell. |
environment[].kept |
string |
yes | no | The first line it printed, as the observation records it. |
test |
object |
yes | yes | The test command, and how it ended. Absent with --check. |
test.command |
string |
yes | no | The line of shell. |
test.passed |
boolean |
yes | no | Whether it exited with 0. |
test.exit_code |
integer |
yes | yes | Its exit code; absent when a signal stopped it. |
observation |
string |
yes | yes | The observation it wrote, from the current folder: none when the test failed. With --check, the one it compared; with --dry-run, the one it would write. |
written |
boolean |
yes | no | Whether it wrote the observation: false with --check or --dry-run, or when the test failed. |
current |
boolean |
yes | yes | With --check, whether the observation is current: it lists every example in the folder, with the hash it has now, and nothing else. Absent without --check. |
changes |
object |
yes | yes | What changed since the observation it replaced: absent when there was none, or the test failed. With --check, what differs between the observation and the folder. |
changes.added |
string[] |
yes | no | Examples it lists that the earlier one didn’t, by path. |
changes.removed |
string[] |
yes | no | Examples the earlier one listed that it doesn’t. |
changes.changed |
string[] |
yes | no | Examples both list, with different hashes. |
changes.environment |
object[] |
yes | no | Environment values that differ, in the newer one’s order, then those only the earlier one had. |
changes.environment[].key |
string |
yes | no | The entry’s key: os, arch, or the config’s. |
changes.environment[].was |
string |
yes | yes | What the earlier observation had; absent when it had none. |
changes.environment[].now |
string |
yes | yes | What the newer one has; absent when it has none. |
recorded |
{ [name]: string } |
yes | no | The environment the observation records, by name: os, arch, and each entry’s kept line. Empty when the test failed. |
files |
{ [name]: string } |
yes | no | The hash of each example, by path from the current folder. Empty when the test failed. |
tested |
string |
yes | yes | What a page says it was tested with: Node 24.9.0 on Linux. Absent when the test failed. |