Repository navigation
Announce and keep display escapes through merges - #647
Merged
Merged
Conversation
- A control escaped where a provenance string is built (a model's file or key name) is now named by text-unsafe: the fields encoder and emit_provenance report it to the model's collector as `statement` and `comment`. - A licence whose text the display escape changed is indexed under what it now holds too, so a fragment's copy unifies with it and no second SimpleLicensingText is left. - A fragment merge compares text as shown (an escaped control equals the raw one): a fragment naming a model with the control raw is no rename and no conflict. Text only a fragment holds in a model or dataset package is escaped after the last fragment, with one `Merge: ELEMENT=...` text-unsafe line per package. Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
The merge now escapes a fragment's display text before the SBOM is written, so a URL field holds a format character as its percent-encoded bytes by the time the credential check reads it. The check reads each value as written and with those bytes written back, so a zero-width space in front of a PURL or inside a parameter name still hides no credential. Also write the test controls as escapes and fold two equal branches of _normalize_value. Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #647 +/- ##
========================================
Coverage 99.98% 99.98%
========================================
Files 543 544 +1
Lines 35472 35575 +103
Branches 4997 5012 +15
========================================
+ Hits 35465 35568 +103
Misses 4 4
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…isplay-escape-gaps
Review of #647. - The credential check reads every value with each display escape written back (text, percent-encoded, JSON), whatever field holds it: an identifier, DOI or page URL hiding a token behind a control is refused on the merge and the build routes. - A merge escapes each fragment's model-kind elements (model and dataset packages, agents, tools, relationships, licences) before it compares or folds anything, in place of comparing text "as shown": signatures and values are compared exactly, so an agent or a licence text stated raw and escaped is one, escaped, in either order, and a software_Package name is compared as it stands. The text-unsafe line names the fragment file and the id it gives the element. - The display escape covers every string and URI property of those elements; a drift test holds the tables against the bindings. - emit_provenance writes its comment through write_provenance_comment. - Known limits recorded: a software_File name and the element types a merge leaves raw. Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
A fragment restating a base element raw no longer disagreed with a base that kept its own text raw: one rule now escapes both sides. - The build escapes every Agent, Tool, Relationship and simpleLicensing licence element it creates, and the comment of every element's creation information, at the end of each builder, with one `text-unsafe` line per element (`ELEMENT=<spdx-id>: ...`). A fragment goes through the same pass as it is taken for a merge. - A licence is keyed by its text as read (display escapes written back), in the merge and in the exporter's index: a text ending in a form feed is the same licence raw or escaped, with or without it. - The merge line puts the file last and spells it as `fragment-invalid` does: `Merge: ELEMENT=<spdx-id> FILE=<file>: ...`. - The credential check reads every field as written, then with display escapes written back; `Reading.escaped` is gone. - Known bugs: the entry on unescaped element types is narrowed to `software_Package`, `software_File`, `Annotation` and expandedLicensing licences. Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
- A licence text (`simplelicensing_licenseText`, and the `name` taken from its first line) keeps U+000C: it is written as JSON `\f`, as before, with no `text-unsafe` line. Every other invisible or bidi control in it is still escaped and said. One escape table serves a project's, a model's and a fragment's licence text, so all three follow the rule; the licence key stays "as read". - A `--describe-relationship` description is escaped where it is built, so one quoting a file name left raw holds no control; said once per relationship. A quoted licence name keeps its form feed. - The `text-unsafe` advice and docs/metadata-reading-back.md say so. - CHANGELOG: one bullet for the PR. Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com> # Conflicts: # CHANGELOG.md # working-docs/design/known-bugs.md # working-docs/design/known-bugs/extraction-and-fragments.md
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.
Follow-up to #609/#630 (round-2 review, 0.25.2).
\uXXXX. Each element is named once (WARNING: ELEMENT=<id>: ... [text-unsafe]; a merge saysMerge: ELEMENT=<id> FILE=<file>).statement/comment).Output without control characters is byte-identical to main.
Generated by Claude Code