Skip to content

feat(adf): add source LOC budget enforcement to catch godobject drift #186

@stackbilt-admin

Description

@stackbilt-admin

Summary

Charter ADF checks can pass while very large source files continue growing, unless teams explicitly configure additional LOC sync entries.

In practice this let src/index.ts in opsbrain reach 1600+ LOC without the Charter gate failing, despite repo governance intent to avoid godobjects.

Why this matters

Teams can believe they are fully covered by Charter's default pre-commit gate, but still miss high-risk architecture drift (godobject growth) because only entry_loc is enforced by default.

Repro (from real repo usage)

  1. Repo has Charter wiring + pre-commit hook enabled.
  2. Add many routes to one entry file (src/index.ts) until it exceeds intended team threshold.
  3. Run:
    • npx charter doctor --adf-only --ci --format text
    • npx charter adf evidence --auto-measure --ci
  4. Output still reports PASS with entry_loc only, unless custom sync constraints were manually configured.

Observed output shape

  • Constraints: [ok] entry_loc: 0 / 500 [lines] -- PASS
  • No default warning/failure about oversized runtime source files.

Expected

At minimum, one of:

  • A built-in optional policy profile for source LOC ceilings (for common patterns like src/index.ts, route files, service classes), or
  • A clear warning during doctor/evidence when only entry_loc is enforced and no runtime LOC ceilings exist, or
  • A first-class Charter config block to define per-path LOC budgets with sane defaults + explicit fail/warn behavior.

Proposed acceptance criteria

  • Add a documented + supported way to enforce source-file LOC budgets without custom scripts.
  • charter doctor surfaces when LOC coverage is effectively absent for runtime source files.
  • Teams can select warn vs fail policy per path pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:adfADF parser/bundler/patcher packageenhancementNew feature or requestpriority:p1Should ship this cycletype:featureNew capability or extension point

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions