← knowledge.oriz.in

Repo code-size ceiling — WARN at 100K tokens for own repos, advisory only, forks exempt

rule repo-sizemonorepo-avoidanceatomic-packagesadvisorydagger

Repo code-size ceiling — advisory WARN at 100K

Rule

Own repos (repos/own/** and chirag127/* on GitHub):

Forks (repos/frk/**): exempt. Byte-identical to upstream per no-fork-divergence.

Applies to code only: .rs, .ts, .tsx, .js, .jsx, .mjs, .py, .go, .java, .swift, .cpp, .c, .rb, .php, .cs, .lua, .sh, .ps1, .vue, .svelte, .astro, .sql, .graphql, .proto, .css, .scss, .html. Excludes: .md, .mdx, .json, .jsonc, .yml, .yaml, .toml, lockfiles, .env*, images, binaries.

Rationale

Current state (2026-07-03 audit)

18 own repos audited:

Repo Tokens Status
bookmark-mind-bs-ext 363K WARN (3.6× threshold)
hermes-config 137K WARN
agent-skills 102K WARN
15 others <50K each pass

3 own repos above 100K. All warned, none blocked, none forced to split.

Enforcement

Dagger TS module at dagger/ (per pipeline-stack-2026-07-01):

# Locally
cd dagger && dagger call audit-repo-tokens --source ..

# Or the Node fallback (no Dagger daemon)
node scripts/audit-repo-code-tokens.mjs

GHA workflow .github/workflows/repo-size-audit.yml runs the Dagger call weekly + on every PR touching .gitmodules or dagger/**. Advisory only — never fails. The workflow surfaces WARN in job output. Reviewers decide if it matters.

How to split when a repo genuinely feels too big

Per atomic-packages-lazy:

  1. Identify a ≥3-5 export subset with independent lifecycle
  2. Extract into chirag127/<subset-name>
  3. Publish as npm/pypi/cargo package if third parties would use it, else as git submodule
  4. Delete extracted code from parent; update imports

When NOT to split:

Fork oversize policy

Anti-patterns

Cross-refs