mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 19:56:53 +00:00
The project licence governs this repository's code and says nothing about the application a role installs, which is where a restriction on commercial use usually sits: a deployment cleared to use Infinito.Nexus commercially is still barred from NLLB-200's CC BY-NC weights. Each invokable role names its licence in meta/<role>/license.yml with the url it was read from. The rights of a named licence live once in meta/licenses.yml, fifteen fields following the taxonomy choosealicense publishes. AND folds to the strictest combination, OR keeps the most favourable whole licence, and the seven contexts are derived from the rights rather than declared, so a heading cannot contradict the matrix under it. The generated page renders one matrix per context, a lint refuses a role that declares nothing, and a Playwright spec asserts the page against the deployed docs. 21 of 22 deprecated SPDX ids were resolved against the upstream text; EPSON's remains unread because its AUR page blocks automated access. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
94 lines
2.6 KiB
Python
94 lines
2.6 KiB
Python
"""In which context a role's deployed software may be used.
|
|
|
|
The project licence governs this repository's own code. It does not reach the
|
|
software a role deploys, and that software is where the restriction usually
|
|
sits: a deployment holding written permission for commercial use of
|
|
Infinito.Nexus is still barred from NLLB-200's weights, which are CC BY-NC.
|
|
|
|
A boolean would be wrong for most of the catalogue, because the common answer
|
|
is neither yes nor no but "yes, and offering it as a service obliges you to
|
|
publish your changes". The classes below keep that distinction.
|
|
|
|
``unknown`` is a legitimate value and the default for anything unread. A gap
|
|
has to be visible; a role silently absent from the index would read as safe.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import NamedTuple
|
|
|
|
|
|
class Context(NamedTuple):
|
|
"""One licence class and what it permits.
|
|
|
|
Args:
|
|
key: the value written in ``meta/info.yml``.
|
|
title: heading for the generated page.
|
|
commercial: short verdict on commercial use.
|
|
duties: what the deployer owes beyond using it.
|
|
"""
|
|
|
|
key: str
|
|
title: str
|
|
commercial: str
|
|
duties: str
|
|
|
|
|
|
PERMISSIVE = Context(
|
|
"permissive",
|
|
"Permissive",
|
|
"allowed",
|
|
"keep the copyright notice and the licence text",
|
|
)
|
|
COPYLEFT = Context(
|
|
"copyleft",
|
|
"Copyleft",
|
|
"allowed",
|
|
"publish the source of changes you distribute",
|
|
)
|
|
COPYLEFT_NETWORK = Context(
|
|
"copyleft-network",
|
|
"Network copyleft",
|
|
"allowed",
|
|
"publish the source of changes once you offer it over a network, "
|
|
"which a hosted deployment does",
|
|
)
|
|
SOURCE_AVAILABLE = Context(
|
|
"source-available",
|
|
"Source available, not open source",
|
|
"restricted by the vendor's terms",
|
|
"read the licence before offering it as a service; several forbid exactly that",
|
|
)
|
|
NON_COMMERCIAL = Context(
|
|
"non-commercial",
|
|
"Non-commercial only",
|
|
"prohibited",
|
|
"use privately or for education; a commercial deployment needs a separate grant",
|
|
)
|
|
PROPRIETARY = Context(
|
|
"proprietary",
|
|
"Proprietary",
|
|
"decided by the vendor's agreement",
|
|
"accept the vendor's terms; redistribution is usually forbidden",
|
|
)
|
|
UNKNOWN = Context(
|
|
"unknown",
|
|
"Not yet determined",
|
|
"unknown, assume the strictest",
|
|
"establish the licence before relying on this role commercially",
|
|
)
|
|
|
|
CONTEXTS: tuple[Context, ...] = (
|
|
PERMISSIVE,
|
|
COPYLEFT,
|
|
COPYLEFT_NETWORK,
|
|
SOURCE_AVAILABLE,
|
|
NON_COMMERCIAL,
|
|
PROPRIETARY,
|
|
UNKNOWN,
|
|
)
|
|
|
|
BY_KEY: dict[str, Context] = {context.key: context for context in CONTEXTS}
|
|
|
|
ORDER: tuple[str, ...] = tuple(context.key for context in CONTEXTS)
|