Skip to content

audit — hotcrm ships 69,419 lines of hand-written test against a 39,734-line metadata app: split them three ways and measure how many lines os verify should have derived #15418

Description

@hotlong

Maintainer-requested, 2026-09-04. The deliverable is a number and its derivation, not a code change.

Why this card exists

This project's central claim is on its own repository description: "a complete CRM in under 150k tokens, one context window. Agents read it whole, reason it whole, refactor it whole."

Measured on objectstack-ai/hotcrm at 71a3452 (the 17.3.0 upgrade merge):

lines files
src/ — the metadata app itself 39,734 172
test/ — hand-written tests 69,419 169
content/ 26,996 243
docs/ 13,476 30
scripts/ 3,765 13

160 .test.ts files against 44 object files.

And the app's own shrink-only ratchet, whose scope is src/**/*.ts minus src/translations/ and src/data/, comment- and blank-stripped:

layer scope reading ceiling used
business semantics objects flows actions hooks 84,060 85,000 98.9%
interaction layer views pages dashboards apps 37,429 40,000 93.6%
authored total the above plus the rest of src/ 135,830 140,000 97.0%

⚠️ test/ is not in that ratchet at all. Nothing watches it.

So the honest reading of "怎么越改越复杂" is: the metadata app is disciplined and nearly at its ceiling; the growth is in the half nobody measures — and that half is where the app's actual behaviour is pinned. An agent that "holds the app whole" holds 135,830 tokens of metadata and none of the 69,419 lines that say what it must do.

What to produce

A three-way split of all 69,419 lines, by file, with the line count of each bucket.

① Should be derived by the platform, is hand-written today. A test that asserts only that the metadata is self-consistent — it needs no knowledge of the business. Candidates spotted by name and size (⛔ starting set, not the scope, and not verified by reading):

metadata-references.test.ts   1,288    reference integrity
sharing-coverage.test.ts      1,309    sharing-rule coverage
docs-view-rosters.test.ts     1,095    view rosters
i18n-references.test.ts         866    translation coverage
                             ─────
                             4,558    at a glance

② Genuinely the app's own — business judgement. The platform cannot know these and should not try:

quote-discount-ceiling.test.ts  898    a discount ceiling is company policy
case-assignment.test.ts         897    who a case goes to
win-loss-capture.test.ts        857    how won/lost is booked

③ Grey zone — testing PLATFORM behaviour, but the app carries the cost.

hooks-runtime-service.test.ts 1,503
action-sandbox.test.ts          976

These assert what a hook does inside the platform's own sandbox. Related: #15325.

How to do it, and the traps

⛔ What this card must NOT do

  • Delete or rewrite a single test. They are green today and pinning real behaviour; removing one before the platform derives its replacement trades a loud protection for a silent gap. This card produces a measurement, full stop.
  • ⛔ Do not build the derivation. The roadmap this produces gets costed and dispatched separately, ordered by the measured demand.
  • ⛔ Do not change hotcrm at all. This is read-only against that repository.

Deliverable

A record comment on this card (and, if it is long, a file under docs/ in a docs-only PR) carrying:

  1. the per-file three-way table with line counts and a one-line reason per file;
  2. the three bucket totals, and the ① minus already-derived remainder;
  3. a ranked list of the derivation capabilities bucket ① implies, heaviest first — this is os verify's roadmap, ordered by real measured demand rather than by guess;
  4. the honest reading of the size claim: src + the tests a metadata app cannot avoid writing (② and any of ③ the platform will never absorb) is what a truthful "how small can a metadata app be" number looks like. State it.

⚠️ Where the classification is genuinely ambiguous, say so and put the lines in a fourth "undecided" bucket rather than forcing a verdict. An undecided count I can see is worth more than a confident split I cannot check.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions