Repository navigation
feat(007): D5a licence relabel tool, D8 strict filler filter, A7 - #110
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e870f8b083
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "wiktionary.org" in str(row.get("harvest_page") or "") | ||
| or "wiktionary" in str(row.get("provenance") or "").lower() | ||
| or bool(row.get("wiktionary_categories")) | ||
| or str(row.get("license") or "").startswith("CC BY-SA") |
There was a problem hiding this comment.
Restrict the licence fallback to Wiktionary rows
When a store contains content from another CC BY-SA source, this predicate classifies it as Wiktionary solely from the licence prefix. relabel() then assigns source_license=CC-BY-SA-4.0, propagates that attribution to text-matching harvest rows, and may leave a contradictory older-version license value because relabelled() preserves every CC BY-SA... string. Require actual Wiktionary provenance rather than treating all CC BY-SA content as Wiktionary.
Useful? React with 👍 / 👎.
| def _load(path: Path) -> list[dict]: | ||
| return [json.loads(l) for l in path.read_text(encoding="utf-8").splitlines() if l.strip()] if path.is_file() else [] |
There was a problem hiding this comment.
Fail when a required relabel input is missing
If --store is misspelled or points to a missing file, _load() silently returns an empty dataset and the command exits successfully with a zero-change summary, making an unapplied licence migration appear valid. A missing --harvest behaves inconsistently and later fails in copy2() only when store changes exist. Since both CLI inputs are required, reject missing files before producing a success summary.
Useful? React with 👍 / 👎.
Operator:
go D1 + relabel + filter + A7.scripts/shadow/hyperlexical/license_relabel.py: marks Wiktionary-sourced SoT rowsCC BY-SA 4.0 (Wiktionary); <label note>and addssource_license: CC-BY-SA-4.0(+source_url). Sidecar unbind rows derived from them get the same mark. Idempotent, with backups. Spark dry run: 709 SoT rows + 80 sidecar rows. The live relabel runs frommainafter merge (D1).scripts/shadow/hyperlexical/filler_filter.py:HYPERLEX_FILLER_FILTER(defaultstrict) drops unbind rows with handles, links, markup, wiki scraps or punctuation-stuck tokens, and fails closed if one reaches the vocab. Allows contractions ('em,honkin'). On the morph78 vocab it rejects 115 of 1,971. Receipts record the mode and drop counts.morph78-train-env.jsonpinsoff, so the 1b equivalence still reproduces morph78.amendments.md): the A1 ceiling counts trunk parameters; cards report trunk and total. milestones and the Hub card are updated.Validation: pytest 809 passed;
check/smokePASS; mkdocs strict PASS. The branch tree is byte-identical to the tested local commit.