Skip to content

#521: Draft: JSON-based exchange format for OFT items and reports - #580

Open
redcatbear wants to merge 9 commits into
mainfrom
documentation/521_draft-json-based-exchange-format
Open

#521: Draft: JSON-based exchange format for OFT items and reports#580
redcatbear wants to merge 9 commits into
mainfrom
documentation/521_draft-json-based-exchange-format

Conversation

@redcatbear

Copy link
Copy Markdown
Collaborator

Discussion draft for the OFT's own native document interchange and report format.

Closes#521.

@redcatbearredcatbear self-assigned this Aug 23, 2026
@redcatbearredcatbear added the documentation User guides, turorials, specifications label Aug 23, 2026
@github-project-automationgithub-project-automationBot moved this to 📫 Backlog in OpenFastTraceAug 23, 2026

@kaklakariadakaklakariada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General: looks very good!

Some more comments in the schema could help with understanding the proposal.

"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/itsallcode/openfasttrace/blob/main/doc/schemas/openfasttrace.schema.json",
"title": "OpenFastTrace JSON formats",
"description": "Schema for OpenFastTrace exchange (OFTX) and report (OFTR) documents. Properties whose value equals the declared default are omitted from serialized documents.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea: this mixes exchange and reports. Would it be clearer to have separate schemas?

I guess it's less duplication to leave it like this.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, duplication avoidance is the main theme here. What ASPEC proved is that a machine-readable report is a list of items plus links plus verdict. That's a concept that I like and would like to keep.

Comment on lines +76 to +80
"reproducible": {
"type": "boolean",
"default": false,
"description": "Whether running OFT again with the recorded parameters can reproduce the document bit-identically."
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? When is a report not reproducible? Only when the order in which files are read is different. But then OFT should sort the report reproducibly.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Order, timestamps. Some people like to have timestamps in the reports as record. Good as historical document. Less so if you need it reproducible.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the optional timestamp to the header. It can only be used when reproducible is set to false.

Comment on lines +184 to +189
"reference": {
"default": "relative",
"enum": [
"absolute",
"relative"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that when the user specifies a relative path, the report contains only relative paths starting from that path, and when they specify an absolute path, all files under this path will be absolute in this report?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolute paths seldom are useful in exchange. More so in a record (e.g., as proof of a tracing run). I understand "relative" as relative to the project root. Typically a repo checkout.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to relativeToWorkingDirectory for better clarity.

Comment on lines +203 to +204
"oftx",
"oftr"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants are a bit cryptic. Could we write this out, e.g. "oft-exchange" or similar?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do. I just thought we align that with the extension .oftx.json. But writing it out inside the document is OK.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to oftExchange and oftReport in alignement with the other enum values. Google JSON guide.

Comment threaddoc/schemas/openfasttrace.schema.json Outdated
Comment on lines +496 to +516
"locatedId": {
"type": "object",
"required": [
"range"
],
"properties": {
"range": {
"$ref": "#/$defs/range"
},
"artifactType": {
"$ref": "#/$defs/range"
},
"name": {
"$ref": "#/$defs/range"
},
"revision": {
"$ref": "#/$defs/range"
}
},
"additionalProperties": false
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need located IDs in the report. I would only add this if someone needs it.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of it this way: a JSON based report fits nicely into a JavaScript report as Poldi did. Then you want location for jump URLs.

@github-project-automationgithub-project-automationBot moved this from 📫 Backlog to 🔨 In Progress in OpenFastTraceAug 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUser guides, turorials, specifications

Projects

Status: 🔨 In Progress

Development

Successfully merging this pull request may close these issues.

Draft: JSON-based exchange format for OFT items and reports

2 participants

@redcatbear@kaklakariada