You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Derive the PROTECTED CORE roster from the policy doc; gate the decrypt tool (#587)
* Derive the PROTECTED CORE roster from the policy doc; gate the decrypt tool
docs/upstreaming/license-provenance.md §2 declared
`decrypt-saved-deck-export/decrypt.mjs` and its test part of the
vote/federation trust anchor, and instructed that both be added to
check_protected_core_license.py's PROTECTED_CORE_FILES "in the PR that
merges #242 (or immediately after)". #242 merged (5ddf109), both files
landed on master, and the CI list was never updated. Two files the
policy calls a trust anchor have carried no gate at all since then.
The one-line fix is to add them to the list. That is not what this does,
because the defect is not the missing entry — it is that two
hand-maintained lists were kept in sync by a convention written in
prose. check_protected_core_license.py now holds NO list: it parses the
marker-bounded roster region in §2 and derives its file set from the
doc, which §2 already declared the source of truth. They cannot disagree
because there is only one list.
Adding the .mjs entries also exposed that neither existing rule could
have fired on them:
- the provenance-marker regex required a `#` comment leader, so a
`// PROVENANCE: ..., AGPL-3.0` line in a JS file was invisible. It
now accepts `#`, `//` and `*`.
- the import walk was ast.parse()-only, which raises SyntaxError on
.mjs and returned []. ES-module `import`/`export ... from` /
dynamic `import()` / `require()` specifiers are now extracted, with
only relative specifiers resolving (a bare specifier is a node:
builtin or an npm package — out of scope for the same reason the
Python side does not scan PyPI metadata).
A roster check's characteristic failure is to check nothing and pass, so
a missing/out-of-order marker, an empty region, a listed path that does
not exist, and a roster entry in an unwalkable language are each HARD
findings rather than silent skips.
§2 also spells out the two "(+ its test)" prose parentheticals as
explicit paths, since only backticked spans are machine-read, and
replaces the stale "not yet in the CI script" bullet with a dated record
of the gap it described.
Roster derived: 11 files (was 9 hardcoded).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013NhYmT1PxCcyemA16dFDxN
* docs-lint: trigger the protected-core job on decrypt-tool changes
The roster is derived from license-provenance.md (covered by `docs/**`),
but the FILES it gates were not all trigger paths.
`decrypt-saved-deck-export/**` had none: a PR pasting AGPL-marked code
into the decrypt tool touches no doc and no cardpicker module, so the
protected-core lint would not have run on it until the weekly cron.
`federation-hash-tool/**` was already listed; this is its counterpart.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013NhYmT1PxCcyemA16dFDxN
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments