Work in contract-first mode.
Do not recommend temporary fixes unless explicitly requested. Do not introduce "for now" architecture. Do not simplify in ways that create later reversal across repositories. Build always with the end in mind.
Before recommending a change, identify:
- the owner of the responsibility,
- the public contract surface,
- the dependency direction,
- the release target,
- whether the change scales across SE repositories,
- whether the change creates future churn.
se-codeowners is a standalone projection tool.
It loads accountable-surface metadata from .accountability/surfaces.toml,
resolves oversight_role values through [codeowners.role_handles], translates
surface path patterns into GitHub CODEOWNERS patterns, renders
.github/CODEOWNERS, and checks committed output for drift.
The package owns the projection machinery. It does not own the accountable surface vocabulary, the repository-specific surface contract, or legal / organizational compliance claims.
This repository targets the current SE release train.
The canonical Python version is defined in .python-version.
Do not downgrade the Python target because current tooling lags.
If an API, command, dependency, or entry point fails, first determine the intended durable surface. Then update the implementation to match that surface.
Changes must preserve:
- determinism,
- cross-platform compatibility,
- typed load boundaries,
- explicit and inspectable structure,
- fail-loud behavior for unsupported CODEOWNERS patterns,
- drift-checkable generated artifacts.
Do not introduce hidden logic where declarative structure is possible.
se-codeowners may:
- parse
.accountability/surfaces.toml, - narrow TOML values into typed Python models,
- validate fields needed for CODEOWNERS projection,
- resolve
oversight_rolethrough[codeowners.role_handles], - translate supported path patterns into CODEOWNERS syntax,
- reject unsupported path patterns,
- render
.github/CODEOWNERS, - check generated output for drift.
se-codeowners must not:
- define the full accountable-surface vocabulary,
- infer owners from
surface.role.kind, - infer legal compliance,
- decide whether CODEOWNERS is branch-protection-gated,
- validate whether human review or evidence was substantively meaningful,
- silently approximate unsupported CODEOWNERS patterns.
CODEOWNERS applies the last matching pattern for a path.
Projected surfaces therefore use codeowners_order to make output order
explicit. Lower values emit earlier; later matching patterns take precedence.
Ties are emitted alphabetically by surface id.
Do not encode projection order into surface ids. Surface ids must remain semantic and stable.
Owner resolution keys on role identity, not role kind.
Use:
surface.oversight_role -> [codeowners.role_handles] -> GitHub handle/team
Do not derive CODEOWNERS owners from surface.role.kind.
surface.role.kind is a semantic classification axis for accountable-surface
reasoning, validation, and reporting. It is not an ownership identity.
Maintain one-way internal layering:
_narrow.pyandmodel.pydepend on nothing else in the package.load.pydepends on_narrow.pyandmodel.py.translate.pyis standalone and handles only path-pattern translation.generate.pydepends onmodel.pyandtranslate.py.cli.pydepends onload.pyandgenerate.py.
No raw Any from tomllib may escape the load boundary.
Use uv for all Python environment and tooling commands.
Do not recommend or use pip install ... as the primary workflow.
Commands must work on Windows, macOS, and Linux.
Use Python-native or cross-platform tooling in scripts.
Avoid shell syntax that only works on one operating system.
uv self update
uv python pin 3.15
uv sync --extra dev --extra docs --upgradeuv run python -m ruff format .
uv run python -m ruff check . --fixuv run se-codeowners generate
uv run se-codeowners generate --strict --output .github/CODEOWNERS
uv run se-codeowners check --strictuv run python -m zensical buildpre-commit runs only on tracked or staged files.
Use git add -A before expecting hooks to run on newly created files.
uvx pre-commit run --all-filesUse the repository release script when available.
For individual checks:
uv lock --upgrade
uv sync --extra dev --extra docs --upgrade
uvx pre-commit run --all-files
uv run python -m pyright
uv run python -m pytest
uv run python -m zensical build
uvx --with-editable . --from import-linter lint-imports --config .github/.importlinter
uvx radon cc src/se_codeowners -s -a -n C
uv build
uvx twine check dist/*se-codeowners does not define:
- the accountable-surface specification,
- the complete accountable-service model,
- EU AI Act compliance,
- branch protection policy,
- human review quality,
- evidence truthfulness,
- incident response semantics,
- runtime AI governance behavior.
Those responsibilities belong to upstream specifications, repository policy, platform configuration, or downstream accountable-service tooling.