Skip to content

docs: nothing pins measuredNullableAggregate(), and neither doc that names it says where it lives #622

Description

@cevheri

Follow-up to #601. This is the optional item I raised there and merged without, written down so it does not evaporate.

#601 gave both docs a sentence naming the new shared boundary:

  • docs/providers/mssql.md: "The shared measuredNullableAggregate() boundary preserves those states without a falsy test that would erase a genuine zero."
  • docs/providers/oracle.md: the same sentence.

Neither says where the function lives, and nothing pins the name.

Measured 2026-09-07. Renaming the export in src/lib/db/utils/measured-aggregate.ts and both of its call sites to readMeasuredAggregate, docs untouched:

result
tests/integration/db/mssql-provider.test.ts 117 pass, 0 fail
tests/integration/db/oracle-provider.test.ts 146 pass, 0 fail
tests/unit/provider-docs-monitoring-citations.test.ts all pass
tsc --noEmit clean

281 tests and a typecheck, all green, with both docs naming a function that no longer exists. This is the same failure mode the named-citation policy was written for: a name in prose with nothing measuring it rots exactly like a line number, just more slowly.

The existing guard cannot reach it as-is. declarationLine() in that test matches ^\s*(public|protected|private).*\bname\(, a visibility-prefixed class method, and the helper is a bare export function in a file that is not either doc's source.

Fix

  1. Pair the name with its file in both docs, the pairing this repo prefers:

    `measuredNullableAggregate()` ([`measured-aggregate.ts`](../../src/lib/db/utils/measured-aggregate.ts))
    

    The ${doc} cites no line number anywhere test already covers both files, so a link with no coordinate is all it takes.

  2. Pin the name in tests/unit/provider-docs-monitoring-citations.test.ts with the idiom already used there for createDatabaseProvider() and NO_COLUMN_MODIFICATION, both of which are module-level rather than class members:

    expect(read(MEASURED_AGGREGATE)).toMatch(/^export function measuredNullableAggregate\(/m);

    Assert the docs contain the name as well, or the pin proves the function exists while saying nothing about the prose.

Done when

  • both docs name the file alongside the function, with no line number
  • the rename probe above is red rather than green
  • bun run test green

Two sentences and a few lines of test, no product code.


Curated for Hacktoberfest 2026. Comment to claim it before you start so two people do not work on the same issue. A PR must reference this issue and land with its tests in the same change; see CONTRIBUTING.md. Repo rules that apply: run bun run test (never bare bun test), and the 100% line-coverage gate must stay green. Local bun run test also needs the helm binary on PATH for unrelated chart tests, see #570 if it bites.

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

    documentationImprovements or additions to documentationgood first issueGood for newcomershacktoberfestCurated for Hacktoberfest; pick up cold, tests required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions