Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
/plans/
/build/
/dist/
/publish/local.mk
23 changes: 5 additions & 18 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# xdfkit developer notes

The history of this repo is rewritten often: expect to `git reset --hard origin/master`. Nothing is a contract yet: the CLI, the `api` package, the model and its schema, file formats and the corpus layout can all change.
The history of this repo is rewritten often: expect to `git reset --hard origin/master`. Nothing is a contract yet: the CLI, the `api` package, the model and its schema, and file formats can all change.

## Build and test

Expand Down Expand Up @@ -54,29 +54,16 @@ Core packages work on bytes, without file or console I/O, and use no cgo; the CL

me7-logger imports `model`, `xdf` and `canon` (`docs/integrations.md`): after changing them, run `make check-pinned` in me7-logger before pushing it.

## Published definitions

The corpus definitions are model JSON in ecu-corpus `defs/`. `publish/` writes one `IMAGE-DATE.zip` from each and imports corrections made in WinOLS or TunerPro, and me7info's models (`publish/README.md`).

```mermaid
flowchart LR
corpus[("ecu-corpus")] --> publish["make -C publish upload"]
publish --> users["WinOLS / TunerPro users"]
users -- "corrected KP or XDF" --> incoming["make -C publish incoming"]
me7info["me7-logger me7info"] -- "located model JSON" --> incoming
incoming --> corpus
```

## Rules

- Commit messages start with a prefix that `cliff.toml` groups: `feat`/`add`, `fix`, `docs`, `refactor`, `chore`, `ci`, `build`, `test`, `style`, `chore(deps)`.
- Never edit or regenerate `testdata/archive/ecuxplot/` (see its README). `images.tsv` names each archived pack's corpus image for tests; it is not the publish list.
- Never edit or regenerate `testdata/archive/ecuxplot/` (see its README). `images.tsv` names each archived pack's corpus image for tests.
- Private definition files (DAMOS, A2L, OLS) go only in the gitignored `testdata/local/`; never commit them.
- `docs/` describes how things are, including spec not implemented yet; plans are kept outside the repo.

## Releases

`make package` writes `dist/`. A tag `vX.Y.Z` publishes those archives as a GitHub release, with notes generated by git-cliff (`cliff.toml`); `vX.Y.Z-rcN` is a prerelease. Archives are `.tar.gz` for macOS and Linux and `.zip` for Windows, each with `xdfkit`, its aliases (`ALIASES` in the Makefile: symlinks, or `.cmd` shims on Windows), `README.md`, `COPYING` and `COPYING.LESSER`. `xdfkit version` prints the tag (`git describe`).
`make package` writes `dist/`. A tag `vX.Y.Z` is a GitHub release of those archives, with notes generated by git-cliff (`cliff.toml`); `vX.Y.Z-rcN` is a prerelease. Archives are `.tar.gz` for macOS and Linux and `.zip` for Windows, each with `xdfkit`, its aliases (`ALIASES` in the Makefile: symlinks, or `.cmd` shims on Windows), `README.md`, `COPYING` and `COPYING.LESSER`. `xdfkit version` prints the tag (`git describe`).

## Documentation

Expand All @@ -89,6 +76,6 @@ flowchart LR
| `docs/autocorrect.md` | `lint` and `fix` |
| `docs/stamp-and-metadata.md` | Edit stamp and XDF metadata file |
| `docs/winols-script.md` | WinOLS script import format |
| `docs/corpus.md` | The shared image and definition corpus |
| `docs/naming.md` | File naming |
| `docs/corpus.md` | Test images from ecu-corpus |
| `docs/naming.md` | Output file names |
| `docs/integrations.md` | ecuxplot, ME7Sum, me7-logger |
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ test:
schema:
go test ./model -run "TestSchemaFile|TestKPDefaultsFile" -update

# build replaces build/xdfkit only when it changed, so publish/ rebuilds
# outputs only after a real change.
# build replaces build/xdfkit only when it changed, so a caller that
# checks the binary's mtime rebuilds only after a real change.
build:
mkdir -p build
go build $(LDFLAGS) -o build/xdfkit.new ./cmd/xdfkit
Expand Down
9 changes: 4 additions & 5 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const (
// (docs/stamp-and-metadata.md). Origin, for KP or XDF input, is where its
// definitions came from (model.Origins), recorded in the provenance; it
// defaults to hand, or for an XDF to its metadata file's. Tuner is a category
// table (the corpus categories.json): only its maps and the objects their
// axes point at are kept, filed under its categories.
// table: only its maps and the objects their axes point at are kept, filed
// under its categories.
type ConvertRequest struct {
To string `json:"to"`
Name string `json:"name,omitempty"`
Expand Down Expand Up @@ -332,11 +332,10 @@ func loadModel(in []byte, name string, meta []byte) (*model.Model, []string, err
return m, subsetWarning(m, warnings), m.Check()
}

// subsetWarning adds a warning when m is a subset (provenance.subset), which
// must not replace the full definition in the corpus.
// subsetWarning adds a warning when m is a subset (provenance.subset).
func subsetWarning(m *model.Model, warnings []string) []string {
if m.Provenance != nil && m.Provenance.Subset != nil {
warnings = append(warnings, m.Provenance.Subset.Kind+" subset of the original definition, not a corpus source")
warnings = append(warnings, m.Provenance.Subset.Kind+" subset of the original definition")
}
return warnings
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/xdfkit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ since it was written converts back to the definition exactly, and edits made
to it are reported. --origin records where a KP or XDF input's definitions
came from in the model's provenance: damos or a2l (exported from Bosch
data), hand (made by hand; the default, unless an XDF's metadata file has
another) or located (found in the image by a program such as me7info; never
a corpus source). --tuner keeps only the maps named in a category table (the
corpus categories.json) and the objects their axes point at, filed under the
table's categories.
another) or located (found in the image by a program such as me7info).
--tuner keeps only the maps named in a category table and the objects their
axes point at, filed under the table's categories.

xdf2kp, kp2xdf and kp2json convert each FILE to the same name with the .kp,
.xdf or .json extension, next to it, and reject input of another format. They
Expand Down
2 changes: 1 addition & 1 deletion docs/autocorrect.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Fixing KP files mechanically, instead of hand-editing each axis in WinOLS. Evide
- Family: from the Bosch identification string in the image (`40/1/ME7.1/5/...` is ME7, `5655/1/M3.82/...` and `9655/1/M5.92/...` are delta). Images without one need `--family`.
- R7 is the merge report (`xdfkit merge --update` of the definition with the located model). It is not a `lint` rule. A caller that must reject a moved name does that before merge; merge does not decide that gate.
- R1 changes what WinOLS displays: WinOLS shows a "subtract" axis as 256 minus the sum of the remaining raw values (confirmed in WinOLS 2.24; see the axis datasource section of `kp-format.md`), so a mislabelled absolute axis shows wrong values until fixed.
- R2 fixes display as intended in WinOLS 2.24 (confirmed on KFFA X in 8D0907558E: 1.0, 1.6, 2.2, ..., 10.5, 11.0 ms/rev). The corpus JSON of 8D0907558E and 8D0907558M has every R2 fix applied, so their published KPs have no R2 findings.
- R2 fixes display as intended in WinOLS 2.24 (confirmed on KFFA X in 8D0907558E: 1.0, 1.6, 2.2, ..., 10.5, 11.0 ms/rev).
Loading
Loading