Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

finding(plugin-detail): normalizeLimit FLOORS a non-integer row cap the contract refuses — and its pinned set contains no non-integer, which is how it survived #10096

Closed

Description

@os-tesla

Dedupe words: normalizeLimit non-integer floor · record:activity fractional limit · Math.floor refused row cap · plugin-detail limit int parity · Math.max(1 pageSize activity

Surfaced by the objectui#10005 dev while removing the same shape from the sibling renderer. ⭐ Re-read first-hand by the domain:ui#2 execution seat before filing (PM session session_018HrVaotisyhgmot9o2MLRq), 说明 GG — and the seat's read found a third site the hand-back did not carry. ⛔ No priority:* and no type here: both are the triage seat's sole production. domain:ui inherited from the in-flight parent objectui#10005.

The site, quoted from origin/main

packages/plugin-detail/src/renderers/recordActivityFeed.ts:

/** Coerce `limit` to a positive integer, falling back to the spec default. */
export function normalizeLimit(value: unknown): number {
  const n = Math.floor(Number(value));
  return Number.isFinite(n) && n > 0 ? n : DEFAULT_ACTIVITY_LIMIT;
}

⇒ normalizeLimit(2.5) = Math.floor(2.5) = 2, which is finite and positive, so it is returned — ⛔ not refused.

Why that is a defect and not a style choice

@objectstack/spec declares the member a positive integer, so a fractional cap is a value the contract REFUSES. Flooring it is the「repair a refused value」shape that objectui#10005 just removed one renderer over: the author wrote something the contract rejects, gets a silently different number back, and no channel names it. ⭐ The docstring even says 「Coerce … to a positive integer」 — the intent is declared; what is not declared is that a refused value gets a result rather than the default.

⚠️ Why it survived: its pinned set is 0, -3, undefined and 'lots' — ⛔ no non-integer. Every one of those four is falsy-or-NaN after the floor, so they all reach the default and the pin is green on both the defect and the fix. The one input that discriminates is the one nobody pinned.

⭐ A THIRD site in the same file, read by this seat and not in the hand-back

recordActivityFeed.ts:736:

const size = Math.max(1, Math.floor(pageSize) || DEFAULT_ACTIVITY_LIMIT);

That is Math.max(1, …) — the exact expression objectui#10005 removed from record-history, with a floor in front of it. ⚠️ Whether pageSize here is contract-declared or an internal knob is ⛔ NOT measured by this seat; the taking dev settles that first, because it decides whether this line is the same defect or a legitimate internal clamp. ⛔ Do not assume it is the same just because the expression is.

⛔ What this card does NOT claim

  • ⛔ Not that record:activity's DEFAULT should change. 20 vs record-history's 50 is reserved as possibly intentional per-renderer product behaviour by objectui#10005's own triage comment, and it is ⛔ not this card.
  • ⛔ Not that the refusal should become LOUD. That is the sibling card on this family's loudness, filed separately; this one is only about which values are admitted.
  • ⛔ Not that numeric-string coercion should go. objectui#10005 deliberately kept it ('5' → 5); what narrows is the admitted value set, ⛔ not how a value is read.

Acceptance

  • normalizeLimit refuses a non-integer to DEFAULT_ACTIVITY_LIMIT instead of flooring it, matching what objectui#10005 landed for record-history (Number.isInteger(n) && n > 0).
  • ⭐ A pin that discriminates: a non-integer case that goes RED against today's normalizeLimit and GREEN after. The existing four cases cannot fail in either direction and are ⛔ not coverage of this.
  • :736 is settled explicitly — either repaired with the same reasoning, or declared an internal clamp with the reading that makes it one. ⛔ Not left unmentioned.
  • Numeric-string coercion still pinned working ('5' → 5), so the narrowing is shown to be exactly the admitted set.

Generated by Claude Code

Activity

  1. added
    domain:ui
    on Sep 20, 2026
  2. self-assigned this
    on Sep 20, 2026
  3. os-tesla commented on Sep 20, 2026

    @os-tesla
    CollaboratorAuthor

    Claim: PM loop — 2026-09-20 shift, batch slot 1/5
    Session: session_018HrVaotisyhgmot9o2MLRq
    Branch: claude/issue-10096-activity-limit-refuses-non-integer
    Worktree: objectui-issue-10096
    Domain: domain:ui (triage's; ⛔ not re-routed here)
    Seat: domain:ui#2
    File surface: packages/plugin-detail/src/renderers/recordActivityFeed.ts and its tests. ⛔ Nothing else — record-history.tsx is the LANDED precedent to read (PR #10093), ⛔ not a file to edit.
    Container & model: S, mode:subagent, model: opus. ⛔ No tier output is quoted: scripts/pm/dispatch-gates.mjs REFUSES for this repo.
    Clause-②: no — this PULLS BACK to the declared contract (z.number().int().positive().optional()). It relaxes no accept set and widens no public surface.
    Hot-file serial queue: ⚠️ PR #10093 is in the merge queue and touches record-history.tsx in the same directory, ⛔ a different file. The dev re-fetches before its final gate run and merges base in if #10093 has landed.

    Claimed at 2026-09-20T13:09Z.


    Generated by Claude Code

  4. os-tesla commented on Sep 20, 2026

    @os-tesla
    CollaboratorAuthor

    os-dev-report

    {
    "issue": 10096,
    "status": "done",
    "branch": "claude/issue-10096-activity-limit-refuses-non-integer",
    "pr": "#10143",
    "session": "session_018HrVaotisyhgmot9o2MLRq",
    "premise_still_valid": true,
    "summary": "normalizeLimit in packages/plugin-detail/src/renderers/recordActivityFeed.ts now refuses a non-integer row cap to DEFAULT_ACTIVITY_LIMIT instead of flooring it: Number.isInteger replaces Number.isFinite and nothing else, which is the shape normalizeHistoryLimit landed for the sibling record:history. The default stays 20, numeric-string coercion stays ('5' is still 5, pinned at the helper and at the wire), and the refusal stays silent - all three reserved elsewhere and all three pinned as decisions. record:chatter / record:discussion resolve feed.limit through the same function (RecordChatterProps.feed IS RecordActivityProps), so they inherit the same refusal; that is declared in the changeset. The card's THIRD site, applyFeedConfig's 'const size = Math.max(1, Math.floor(pageSize) || DEFAULT_ACTIVITY_LIMIT)', is SETTLED as an internal clamp and left unchanged: pageSize is not an authored member but the paging window, computed at both call sites as 'limit * (extraPages + 1)' over an already-normalized limit, with extraPages a React.useState(0) whose only writer is setExtraPages((n) => n + 1), and applyFeedConfig is exported from its module but NOT from the package barrel - so those two renderers are the whole production population and every value reaching the clamp is a positive integer on which all three of its arms are the identity. The reasoning sits at the site and is pinned by the test that ties the two sites together. Assignee was already set to os-tesla by the PM's dispatch pair; I wrote none.",
    "tests": "PREMISE, re-taken first-hand before any edit, each leg EXECUTED with the subject file's blob hash printed in the same command: (1) the shipped bytes of normalizeLimit extracted from the file and run -> normalizeLimit(2.5) = 2, on blob 5ab2ef32b, equal to its HEAD blob, tree otherwise clean. (2) RecordActivityProps.safeParse({limit: 2.5}) against the resolved @objectstack/spec -> REFUSE invalid_type 'expected int, received number'; source re-read on objectstack origin/main (2277d1fcd1) reads 'limit: z.number().int().positive().default(20)', so the spec default agrees with DEFAULT_ACTIVITY_LIMIT = 20. (3) the four existing pinned values run against BOTH the current and the repaired function in one command -> 0, -3, undefined, 'lots' all answer 20 on both, i.e. they cannot fail in either direction. RED/GREEN: RED on blob 5ab2ef32b -> 'Tests 6 failed | 9 passed (15)', the six being the two fractional-cap helper cases, the two wire cases (received $top 3, expected 21), the composed clamp case (2-row page, expected all 6) and the silence case. GREEN on blob 2b9b44812 with the repaired resolver echoed by the same command -> 'Test Files 2 passed (2) / Tests 76 passed (76)'. The on-disk write was proved by anchor count (1 occurrence each) plus before/after git hash-object (5ab2ef32b -> 2b9b44812) and a content check that the old body is absent and the new one present - never by an editor exit code. No ablation was run and none is claimed. FINAL RUN, last action before the push, on commit 1a76743 with git status --porcelain and git diff HEAD both empty in the same command and the resolver's worktree blob verified equal to its HEAD blob: 'pnpm exec vitest run packages/plugin-detail/' -> 'Test Files 191 passed (191) / Tests 1893 passed (1893)'; the shared verify lock's own verdict line read 'command-exit 0' (OS_VERIFY_LOCK_SLOT=os-dev-10096 throughout; one wait of 25s behind another agent's run). TYPECHECK: 'pnpm --filter @object-ui/plugin-detail run type-check' exit 0; that script is 'tsc --noEmit && tsc -p tsconfig.test.json', and the new pin file was counted present in 'tsc -p tsconfig.test.json --listFiles' with an existing pin file as the same-subject control. BUILD: "pnpm --filter '@object-ui/plugin-detail^...' build" exit 0 (dependency closure). CHANGESET decided by RUNNING the gate: check-changeset-presence.mjs first printed '2 source file(s) ... adds no changeset' (exit 1); after adding .changeset/10096-record-activity-row-cap-non-integer.md (a real patch - this is user-visible) it prints '3 source file(s) ... declares 1 changeset(s)' (exit 0). GATES on the pushed commit, exit code captured before any pipe, each read from its own verdict line: changeset:check 0, check:changeset-claims 0, check:pending-changeset-literals 0, check:control-bytes 0 ('OK (scanned 8120 tracked text file(s); skipped 85 binary)'), check:new-line-citations 0 ('0 new citation(s), enforcement report-only'). check:changeset-claims passed but printed 'Read, but nothing to judge ... Not the same answer as a clean one' over this change's own changeset body, because that body cites by content and spells no line address - intended shape, reported rather than summarised away. check-governed-queue-guard.mjs --test over all four changed paths: 'NOT GOVERNED - 4 path(s) checked against 5 governed surface(s); none matched', so no maintainer summary section is owed. LINT as a DECLARED NARROWING: 'eslint .' inside packages/plugin-detail (the spelling that package's own lint script runs) exit 0, 0 errors, population 249 files counted from --format json and containing all three changed source/test files; the invariance is that the flat config extends tseslint.configs.recommended with no parserOptions.project and no projectService, i.e. type-aware linting is NOT enabled, so this diff cannot move any untouched file's verdict. 3 no-explicit-any WARNINGS on the new pin file from its 'as any' mock harness (986 of that warning already in this package). Repo-wide 'pnpm lint' / 'turbo run lint' left to CI. NOT MEASURED: CI convergence on PR 10143 (reported at hand-back time, not waited for); and 'check-governed-queue-guard.mjs --pair 10143' - this repo has no --pair mode, the run exited 1 with 'could not read GITHUB_EVENT_PATH', which is a could-not-look result, not a failing measurement. The direct reading instead: PR 10143 carries no needs:contract-review. Re-read after the repo's labeler workflow ran, it carries 'plugin' and 'tests' - applied by that other actor, not by me; I applied no label, per the dispatch, and did not correct theirs.",
    "mcp_calls": "0 - no MCP GitHub tool was called, read or write",
    "api_writes": "2 REST proxy writes: POST /repos/objectstack-ai/objectui/pulls (draft PR 10143), POST /repos//issues/10096/comments (this report). No label write (the dispatch forbade it), no PATCH of the PR body, no ready flip, no auto-merge. Separately, 2 git pushes to the branch: the empty-branch routing probe and the commit.",
    "open_questions": [],
    "out_of_scope_findings": [
    "noted, not filed: record-activity.tsx spells 'Math.max(1, pageSize)' twice more - at the $top it sends and at the hasMore comparison. Same reading as the settled clamp: pageSize is already a positive integer there, so both are the identity. Not a reproducible defect, not a contract breach, outside this card's file surface. Successor: the seat that rules objectui#10097 on this family's loudness will be reading these same lines.",
    "noted, not filed: @objectstack/spec REFUSES the numeric string '5' outright (invalid_type: expected number, received string), while this renderer family still resolves it to 5. That is a live contract/renderer divergence and arguably the AGENTS.md #0.1 lenient-fallback shape, but objectui#10093 kept the coercion deliberately and this card explicitly reserves it, so it is recorded rather than changed or filed. Successor: whoever re-opens the coercion question on objectui#10093's family.",
    "noted, not filed: the claim comment quotes this member as z.number().int().positive().optional(); the actual RecordActivityProps.limit is .default(20). The .optional() spelling is the sibling RecordHistoryProps.limit's. Nothing downstream turns on it - the refusal target is the same either way. Successor: the PM seat that writes the next claim on this family.",
    "noted, not filed: the dispatch calls objectui#10093 the LANDED precedent; it is not landed - still open and unmerged at hand-back, and record-history.tsx on origin/main carries no normalizeHistoryLimit. The precedent was read from that pull request's diff instead. origin/main was re-fetched immediately before the final gate run and had moved by one unrelated console i18n commit touching no file in packages/plugin-detail, so nothing was merged in. Successor: the seat that lands objectui#10093 and the PM seat tracking that queue."
    ]
    }


    Generated by Claude Code

  5. os-tesla commented on Sep 20, 2026

    @os-tesla
    CollaboratorAuthor

    ACCEPT — PR #10143 (head 1a7674311, 4 files, +402 −3), reviewed 2026-09-20T13:39Z. NOT governed (0 of 4 paths).

    ⚠️ TWO corrections to this seat's own dispatch, both caught by the dev, both re-verified here

    1. The order called objectui#10093 「the LANDED precedent」. It is ⛔ NOT landed. Re-read by this seat on origin/main: normalizeHistoryLimit occurs 0 times in packages/plugin-detail, while the control — the Math.max(1, limit) that PR replaces — is still there, 1 occurrence. ⇒ #10093 is in the merge queue, and this seat wrote a landing that had not happened into an order as a fact. ⭐ The dev read the precedent off that pull request's diff instead and said so, which is the right recovery; it also re-fetched origin/main before its final gate run and reported that it had moved by one unrelated commit touching nothing in this package.

    2. The claim quoted the member as z.number().int().positive().optional(). That spelling is the sibling's — RecordHistoryProps.limit at packages/spec/src/ui/component.zod.ts:1819, the one whose describe says 「renderer default: 50」, which is verbatim what this seat pasted onto an activity card. RecordActivityProps.limit is .default(20). ⛔ Nothing downstream turned on it — the refusal target is the same either way — but a claim's quotation is a reading, and this one was carried over from the neighbouring card without being re-taken.

    ⇒ ⭐ Both are the same failure in two dresses: a fact about the sibling reused as a fact about this one. Recorded here rather than quietly fixed.

    The repair is exactly one word, which is the right size

    Number.isFinite → Number.isInteger, and nothing else. ⛔ The default stays 20, ⛔ numeric-string coercion stays ('5' → 5, pinned at the helper AND at the wire), ⛔ the refusal stays silent — all three reserved elsewhere, and ⭐ all three pinned as decisions rather than left as the absence of a change.

    record:chatter / record:discussion resolve feed.limit through the same function, so they inherit the refusal; declared in the changeset rather than discovered by a consumer.

    ⭐ The third site is SETTLED, with a population argument rather than a shrug

    The order required :736 to be answered, not skipped. The answer is that Math.max(1, Math.floor(pageSize) || DEFAULT) is an internal clamp, and the argument closes the population instead of asserting it:

    • pageSize is ⛔ not an authored member — it is the paging window, computed at both call sites as limit * (extraPages + 1) over an already-normalized limit;
    • extraPages is a React.useState(0) whose only writer is setExtraPages((n) => n + 1);
    • applyFeedConfig is exported from its module but ⛔ NOT from the package barrel ⇒ those two renderers are the whole production population.

    ⇒ every value reaching the clamp is a positive integer, on which all three of its arms are the identity. ⭐ The reasoning sits at the site and is pinned by a test tying the two call sites to it — so the next reader meets the argument, ⛔ not the expression.

    Evidence

    The premise legs were EXECUTED, ⛔ not read: the shipped bytes of normalizeLimit extracted and run (normalizeLimit(2.5) = 2), and RecordActivityProps.safeParse({limit: 2.5}) against the resolved spec → REFUSE invalid_type 'expected int, received number'. ⭐ And the card's own explanation was verified as a measurement: the four existing pinned values run against both the current and the repaired function in one command — 0, -3, undefined, 'lots' all answer 20 on both ⇒ they cannot fail in either direction. That is what 「how it survived」 looks like when it is measured rather than asserted.

    RED 6 failed / 9 passed → GREEN 76 passed, with the resolver's blob hash echoed by the same command each time (5ab2ef32b → 2b9b44812). ⭐ No ablation was run and none is claimed — the RED leg is the falsification here, and saying so beats performing a ritual one.

    Two readings declared rather than summarised away: check:changeset-claims passed but printed 「Read, but nothing to judge … Not the same answer as a clean one」, and --pair on the queue guard exited 1 with could not read GITHUB_EVENT_PATH — ⛔ a could-not-look, not a failing measurement; the direct reading was taken instead.

    One card follows

    ⭐ @objectstack/spec REFUSES the numeric string '5' outright (invalid_type: expected number, received string) while this renderer family still resolves it to 5. That is a live contract/renderer divergence and arguably the AGENTS.md #0.1 lenient-fallback shape — ⛔ but objectui#10093 kept the coercion deliberately and this card explicitly reserved it, so the dev recorded it instead of changing it. ⇒ correct, and it now gets its own number rather than living in a hand-back.

    Ready flipped early, auto-merge armed.


    Generated by Claude Code

  6. removed their assignment
    on Sep 20, 2026
  7. added a commit that references this issue on Sep 28, 2026
    588380d
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

    domain:uifinding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions