Skip to main content

Module rule_artifacts

Module rule_artifacts 

Source
Expand description

The committed LEAN-CTX.md rule artifacts as (relative_path, content) pairs — the single source shared by the regenerator (gen_rules example) and the drift gate (tests/rules_drift.rs) so the project copy and the rust/ copy can never disagree.

Content is forced to the default profile (non-shadow, compression Off) so the committed bytes are independent of the developer’s local lean-ctx config and stay deterministic (#498). The live writer (hooks::ensure_project_agents_integration) renders with the user’s config instead — that is each user’s own copy, not this repo’s checked-in artifact.

Constants§

ARTIFACT_PATHS
Project-relative paths of every committed dedicated-rules artifact. Add new real rule artifacts here — not docs examples or templates.
CLAUDE_MOD_COPIES
The Claude Code mod’s development workspace (claude plugin test, tsc, --plugin-dir) mirrors the sources the binary embeds and installs (templates/claude_mod/), so what is tested is exactly what ships.
SKILL_COPY_PATH
The repo-root skill (installed by skills/lean-ctx/scripts/install.sh and skill marketplaces) is a verbatim copy of the template lean-ctx setup installs, so the two can never drift apart again.

Functions§

artifacts
(relative_path, content) for every artifact the generator writes: the versioned rule artifacts (one canonical body), the skill copy, and the Claude Code mod workspace copies.
canonical_body
Canonical body of a project LEAN-CTX.md: the owner banner, the long-form rules block (non-shadow, compression Off), and a trailing newline. Inverse of what the drift gate reads back. Longform because LEAN-CTX.md is opened on demand (AGENTS.md pointer), never auto-loaded — it can afford the verbose teaching sections the injected profiles fold away (#578).