Skip to content

refactor: eliminate the 200-line and 15-entry baseline exceptions #150

Description

@Castrozan
Check Required limit Existing exceptions
Code-file length At most 200 physical lines per scoped code file 58 files in the line-count baseline
Directory size At most 15 immediate files and folders combined per scoped repository directory 40 directories in the directory baseline

The hooks and CI enforce these defaults, but recorded ceilings still allow existing violations. Refactor the affected code and directory structure until neither check needs an existing-violation exception. The directory smell is excessive directory fan-out; agent-harness/harnesses/claude-code is one concrete case, with a recorded ceiling of 20 immediate entries.

Counts were verified at 3be17836. Use the linked baselines as the live work inventory.

Split large files into units with single responsibilities and group related modules by responsibility. Update imports, Nix module references, packaged script paths, harness discovery, and tests as code moves. Preserve the current code-file scope and Git counting semantics; Markdown remains outside the file-length rule but participates in directory counts.

Work in cohesive batches, lowering or removing baseline entries as each batch lands. Raising limits, widening exclusions, adding replacement exceptions, or introducing meaningless grouping directories does not satisfy this issue.

Acceptance criteria:

  • Every scoped code file is at most 200 physical lines; the 58 recorded file exceptions are eliminated.
  • Every scoped directory has at most 15 immediate files/folders combined; the 40 recorded directory exceptions are eliminated.
  • Both baseline inventories are empty, and hooks and CI continue enforcing the original limits.
  • Imports, packaging, discovery, and behavior remain correct across Darwin, NixOS, and the supported agent harnesses.
  • Focused regression tests, live hook checks, rebuild, CI, and the Sonar quality gate pass for the completed refactor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions