8000 fix(corpus): show a reviewed licence instead of UNKNOWN do-not-copy (#1893) by xerj-org · Pull Request #1910 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

fix(corpus): show a reviewed licence instead of UNKNOWN do-not-copy (#1893) - #1910

Merged
xerj-org merged 1 commit into
mainfrom
fix/reviewed-licence
Oct 20, 2026
Merged

xerj-org merged 1 commit into
mainfrom
fix/reviewed-licence

Conversation

@xerj-org
Copy link
Copy Markdown
Owner

Fixes #1893.

Bug: 18f-content-guide's registry manifest carries a completed review: "spdx": "CC0-1.0", "by": "xerj-org", LICENSE.md verified. The licence detector reads UNKNOWN, so:

  • xerj corpus add warned ^ UNKNOWN: adapt the APPROACH, do not copy the code;
  • it then printed ! manifest says licence=CC0-1.0, checkout reads UNKNOWN;
  • every xerj code passage was labelled UNKNOWN with !! do-not-copy.

Fix

  • read_hub_manifest keeps each row's review block.

  • corpus add records that review in the cloned corpus.json when the checkout lands at the reviewed sha. A review kept locally from a previous build still wins.

  • New licence::effective_licence(recorded, review) returns the detector's reading, unless it is UNKNOWN or NONE-FOUND and a completed review names the licence. Completed means:

    • by is set;
    • use is not UNREVIEWED;
    • the SPDX string is SPDX-shaped and at most 64 chars, so no terminal escapes.

    A licence the detector did identify (for example GPL) is never overridden. licence_map (the labels xerj code uses) and the clone-time lines go through it.

  • The recorded licence field stays the detector's reading.

Tests

  • New a_completed_review_names_an_unknown_licence, a_draft_or_odd_review_does_not_count, and licence_map_uses_a_completed_review_for_an_unknown_licence.
  • xerj-common xccode: 95 passed. xerj-autoindex lib: 1495 passed. clippy -D warnings and fmt are clean.
  • End to end with the built binary, in a fresh HOME against an isolated node:
    $ xerj corpus add --from ./18f-content-guide.json
              licence=UNKNOWN sha=1b1723d3d5b8 files=90
              licence CC0-1.0 per the manifest's review by xerj-org (the detector read UNKNOWN)
    $ xerj code 18f-content-guide "plain language"
    ─── content-guide/_pages/our-approach/plain-language.md (line unknown)  (score 7.09, CC0-1.0)
    
    There are no ^/!! do-not-copy lines any more. The (line unknown) is [bug]: xerj code prints "(line unknown)" on every passage while telling the agent to cite file:line #1892, which fix(xerj code): cite real file lines for prose/Markdown hits (#1892) #1908 addresses.

…tor reads UNKNOWN

A vetted hub manifest carries a human review of each repo's licence at the
pin (spdx, use, by, at, note). corpus add ignored it: a CC0-1.0 repo whose
LICENSE.md the detector cannot classify was recorded UNKNOWN, warned "do
not copy" at clone time and on every xerj code passage.

- read_hub_manifest keeps each row's review; corpus add records it in the
  cloned corpus.json when the checkout lands at the reviewed sha (a locally
  kept review still wins).
- licence::effective_licence: the detector's reading, unless it is
  UNKNOWN/NONE-FOUND and a completed review (by set, use not UNREVIEWED,
  SPDX-shaped) names the licence. A licence the detector did identify is
  never overridden. licence_map and the clone-time lines use it.

Fixes #1893
@xerj-org
Copy link
Copy Markdown
Owner Author

Xerj Merger made the fix: reviewed. When the detector reads UNKNOWN or NONE-FOUND, a completed hub review now supplies the licence label: by is set, use isn't UNREVIEWED, and the SPDX string has SPDX shape and is at most 64 chars. A licence the detector did identify is never overridden, and the recorded licence field stays the detector's reading. One thing to keep in mind: any manifest passed to --from with a filled-in by now counts as reviewed, so the review gate rests on manifest trust. Verified locally at a69cc89, merged with main 5585819 (in a combined tree with #1861, #1886, #1700 and #1746): fmt, clippy -D warnings and cargo test --profile ci-test --workspace are all green. That run was ahead of the CI backlog, on the owner's instruction. Fixes #1893 (closed by this merge).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: licence shown as UNKNOWN "do not copy" for a corpus whose manifest review verified CC0-1.0

1 participant

0