JSON reports: ascribe templates

The JSON Schemas of what ascribe templates writes 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 templates and ascribe new write with --format json. Each document follows the rules of the JSON report contract.

ascribe templates list

The fields of schemas/templates-list.schema.json:

TemplatesListReport: What ascribe templates list --format json writes: the templates Ascribe carries, and where they’re from.

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.
repository string yes no The repository of The Good Docs Project’s templates.
tag string yes no The tag of theirs the templates were converted from.
commit string yes no The tag’s commit.
license string yes no Their license.
templates object[] yes no The templates, in the set’s order.
templates[].name string yes no Its name, which ascribe templates eject takes, and its type’s.
templates[].summary string yes no What it’s for.

ascribe templates eject

The fields of schemas/templates-eject.schema.json:

TemplatesEjectReport: What ascribe templates eject did: the files it wrote and the types it added, or, when it refused anything, what it refused, and then it wrote nothing.

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 string[] yes no The files written, from the folder ascribe.toml is in, /-separated, in the order they were written: each template, its guide, and Ascribe’s notes on its type, then templates.lock, then ascribe.toml, when it changed. Empty when anything was refused. With dry_run, the files it would write.
dry_run boolean yes no Whether it ran with --dry-run, and wrote nothing.
added object[] yes no The types added to ascribe.toml, in the order they were named. Empty when anything was refused.
added[].name string yes no The type’s name, [types.<name>], which is the template’s.
added[].summary string yes no Their index’s summary of it.
added[].template string yes no Its template, from the folder ascribe.toml is in.
added[].guide string[] yes no Its guide, from the folder ascribe.toml is in, in the order to read them: their guide, then Ascribe’s notes on the type.
added[].copied string[] yes no The fields of its frontmatter declared as another of the project’s types declares them, rather than as plain strings, in order.
kept object[] yes no The types ascribe.toml declared already and kept, with --keep-type, in the order they were named: each takes its template and guide from templates/templates.lock, or, written in another folder, was given its template and guide, and nothing else in it changed. Empty when anything was refused.
kept[].name string yes no The type’s name, [types.<name>], which is the template’s.
kept[].summary string yes no Their index’s summary of it.
kept[].template string yes no The template it was given, from the folder ascribe.toml is in.
kept[].guide string[] yes no The guide it was given, from the folder ascribe.toml is in, in the order to read them: their guide, then Ascribe’s notes on the type.
kept[].left string[] yes no The type’s keys left as they were, in the order ascribe.toml has them, such as purpose and frontmatter.
refused object[] yes no What was refused, in the order it was named. When it isn’t empty, nothing was written.
refused[].name string yes no The name given.
refused[].reason RefusalReason yes no Why it was refused.
refused[].path string yes yes The file in the way, from the folder ascribe.toml is in, when that’s the reason; otherwise null.
refused[].message string yes no Why, in a sentence.
page_declared boolean yes no Whether ascribe.toml declared no types, so that every page was of the implicit type page, and [types.page] was written out first, as it was, so the pages that aren’t of a type added can name it.
untyped string[] yes no The project’s pages that name no type, from the folder ascribe.toml is in, in order. With the types added the project declares types, so each needs type: in its frontmatter, naming its type.

RefusalReason: Why a template was refused. One of:

Value Description
"unknown" The set has no template of that name.
"declared" ascribe.toml declares a type of that name already.
"file_in_the_way" A file is where one of its files would be written.
"type_not_table" Asked to keep the type, ascribe.toml writes it as an inline or a dotted table, which eject doesn’t add to.
"type_has_template" Asked to keep the type, it names a template or a guide already, or templates/templates.lock gives it them.
"frontmatter_differs" Asked to keep the type, its frontmatter doesn’t declare a field the template’s has, or declares it as something other than a string.

ascribe templates status

The fields of schemas/templates-status.schema.json:

TemplatesStatusReport: What ascribe templates status found: for each template the project took, whether the set and the project have changed it since the copy, and each template of the set it doesn’t have.

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.
set object yes no The set this ascribe carries, which the copies are compared with.
set.repository string yes no Their repository.
set.tag string yes no Their release’s tag.
set.commit string yes no The tag’s commit.
upstream_changed boolean yes no Whether the set has changed a template the project took since the copy, as templates.lock remembers it, or no longer has one. What --exit-code exits with 1 for.
templates object[] yes no Each template the project took, in the set’s order, then any the set no longer has, by name.
templates[].name string yes no Its name, which is its type’s.
templates[].record Record yes no What templates.lock remembers of it.
templates[].lock string yes no The lock its entry is in, or the one looked in when there’s no entry, from the folder ascribe.toml is in.
templates[].lock_problem string yes yes Why the lock can’t be read, when record is invalid_lock; otherwise null.
templates[].copied_from string yes yes Their release the copy was made from, as the lock records it; null without an entry.
templates[].upstream UpstreamChange yes no Whether the set has changed it since the copy: changed when any of its files has.
templates[].project Change yes no Whether the project has changed its copy: changed when any of its files has, or is gone.
templates[].files object[] yes no Its files: the template, their guide, and Ascribe’s notes.
templates[].files[].path string yes no The file, from the folder ascribe.toml is in.
templates[].files[].kind FileKind yes no Which of the template’s files it is.
templates[].files[].upstream UpstreamChange yes no Whether the set’s text has changed since the copy.
templates[].files[].project Change yes no Whether the project has changed the file since the copy.
templates[].files[].matches_set boolean yes yes Whether the file is the set’s text now; null when it isn’t there, or the set doesn’t have it.
templates[].files[].sections object[] yes yes What’s different in the set by section, when the set changed it and the project didn’t, so the file is what was written; otherwise null.
templates[].files[].sections[].heading string yes yes The section’s heading, as written; null for what comes before the first heading, frontmatter included.
templates[].files[].sections[].change SectionChangeKind yes no How it’s different.
not_taken object[] yes no Each template of the set the project doesn’t have, in the set’s order.
not_taken[].name string yes no Its name.
not_taken[].summary string yes no Their index’s summary of it.

Record: What templates.lock remembers of a template. One of:

Value Description
"entry" An entry, with a hash of each file as written.
"no_lock" There’s no templates.lock where it was looked for.
"no_entry" The lock is there, and has no entry for it.
"invalid_lock" The lock is there, and isn’t one eject wrote.

UpstreamChange: Whether the set has changed a template, or a file of one, since the copy. One of:

Value Description
"unchanged" The set’s text is what was written.
"changed" The set’s text isn’t what was written.
"unknown" Nothing is remembered of what was written, so it can’t be told.
"removed" The set no longer has it.

Change: Whether the project has changed a template, or a file of one, since the copy. One of:

Value Description
"unchanged" The file is what was written.
"changed" The file isn’t what was written.
"deleted" The file isn’t there.
"unknown" Nothing is remembered of what was written, so it can’t be told.

FileKind: Which of a template’s files a file is. One of:

Value Description
"template" The template, which a page is copied from.
"guide" Their guide.
"notes" Ascribe’s notes on the type.

SectionChangeKind: How a section is different in the set. One of:

Value Description
"added" The set has it, and the copy doesn’t.
"removed" The copy has it, and the set doesn’t.
"changed" Both have it, with different text.

ascribe new

The fields of schemas/new.schema.json:

NewReport: What ascribe new wrote, or with --dry-run would write.

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.
path string yes no The page, from the folder ascribe.toml is in, /-separated.
type string yes no Its type.
title string yes yes The title given, or null when the page keeps the template’s.
template string yes yes The type’s template, from the folder ascribe.toml is in, or null when it has none and the page is its frontmatter alone.
guide string[] yes no The type’s guide, from the folder ascribe.toml is in, in the order to read it.
placeholders integer yes no How many places the page has that its template left to fill in, as template-placeholder-left finds them: its placeholders, and the frontmatter values still the template’s.
written boolean yes no Whether the page was written: false with --dry-run.
text string yes no The page’s text.