Repository navigation
refactor(census): commit the derived census and round-trip ratchets as one record per line - #2124
Merged
Merged
Conversation
The RDF and API-JSON round-trip expectations restated every root's file count in a "# files:" header, so two branches each adding a committed example conflicted on the header while their records merged cleanly. Every file has a record, so the reader counts the records under each root instead; the corpus-size check is unchanged. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…header go test ./tests/corpus -run 'TestCorpusRoundTrip|TestCorpusAPIJSONRoundTrip' -update-corpus-roundtrip -update-api-json-roundtrip Co-Authored-By: jason.han <hanhuijun@gmail.com>
…d per rule and root The committed baseline keeps the provenance and each root's figures; the records file beside it holds one sorted line per served rule and root, so two branches that moved different rules merge without a conflict. The totals, the summary and the silent list are derived when the files are read; -update writes both files and -check names the records that moved. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Regenerated with go run -C tools ./cmd/derived-census -update over every corpus root; no figure moved, only the layout. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…aths Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
…file-baselines Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/semantic/metamodel/derived_census_baseline.json
…members Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Two pull requests that re-record the same committed ratchet conflict as soon as the first merges, even when they moved different files or rules, because the file carries aggregate lines (a per-root file count, a totals block) that both re-recordings rewrite. This PR removes the shared lines from the layouts where they caused the conflicts, so git's line-based merge resolves two re-recordings that moved different records.
internal/semantic/metamodel/derived_census_baseline.json): the committed baseline is now a header (provenance, structure, policy, each root's figures) andderived_census_records.tsvbeside it, one sorted line per served rule and corpus root. The totals, the summary and the silent list are derived when the files are read, so a re-recording touches only the lines whose figures moved.go run -C tools ./cmd/derived-census -updatewrites both files;-checknames the records that moved.TestDerivedCensusBaselinereads both files and pins the sort order.tests/corpus/testdata/{corpus,api_json}_roundtrip_expected.txt): the# files: <root> <count>header lines are gone;TestCorpusRoundTripandTestCorpusAPIJSONRoundTripderive each root's size from its records. Two branches that added or moved files under different roots no longer collide on the header.-update,-update-corpus-roundtrip -update-api-json-roundtrip) with every corpus present; no verdict or figure moved — only the layout.Left as they are, with the measurement:
structure_differential_expected.txtis already one line per root and property, and itsroot …: models, skipped, matched, unmatchedline carries per-root figures that are not derivable from the property lines;library-and-prefix-sweep-outcomes.txtis already one line per probe; the pilot corpora, specification example, PSSM and training expectations are one line per file with no count header. The API-JSON baseline is #2084's.Measured
Last 10
developmerges that touched each file; every pair of their pre-merge heads was merged withgit merge-fileon the committed layout (before) and on the same blobs rewritten into the new layout (after).tests/corpus/testdata/corpus_roundtrip_expected.txttests/corpus/testdata/api_json_roundtrip_expected.txtinternal/semantic/metamodel/derived_census_baseline.json(+ records)internal/translate/export/testdata/structure_differential_expected.txt(unchanged)docs/project/library-and-prefix-sweep-outcomes.txt(unchanged)The census file was absent at the oldest heads, hence 36 pairs.
Follow-up
Once this lands, the
ci:rebaselineworkflow (#2122) needsderived_census_records.tsvin its generated-path list and its movement script needs the records layout; that goes into whichever of the two lands second.How it was verified
go test ./internal/semantic/metamodel(TestDerivedCensusBaseline…reads the header and the records, checks every record names a served rule and a header root, and pins the sort order) andgo test -C tools ./census/derived(newTestRecordsRoundTripThroughTheCommittedLayout,TestRecordsReproduceNamesTheRecordsThatMoved).go test ./tests/corpus -run 'TestCorpusRoundTrip|TestCorpusAPIJSONRoundTrip'with the training, pilot and specification-example corpora present and required, against the re-recorded expectations.provenance.recordedchanged.go build ./...,go vet ./...,gofmt -l .empty,make lint,go test ./tests/hygiene,go test -C tools ./....git merge-fileover the pre-merge heads of the last 10developmerges that touched each file.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/db2463db486544eb9f5b9e5a8389e7c3
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/db2463db486544eb9f5b9e5a8389e7c3?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work