Skip to content

37140 跟进:资料包正文目录设条数上限 #37178

Description

@objectstack-fleet

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Filing gate: ③ maintainer-directed (topic #36996 handed to this project), from the #37173 contract review delta, R10.
Grading: area:ai · Task · p2 (before row 9 serves the tool in-app) · evidence: read.

维护者速读

  • 背景:记录正文太长时,get_record_context 不给全文,而是给一份带锚点的目录。目录的条数没有上限,一篇几乎全是标题的长正文会让回答跟正文一样大,8000 字的正文上限就白设了。
  • 要做的:目录条数设上限,超出时在说明里讲一句被截断了,并用测试钉住这个常量。
  • 要你做的:无。

What

  1. In @objectstack/service-record-context, cap the outline's entries with a service constant beside the body bound and the related-row cap.
  2. When the cap cuts, add one note saying the outline was cut, and how many headings were left out.
  3. Pin the constant and the cut by test (a body of many short headings).

Acceptance

  • The size of an outline answer is bounded by the constant, whatever the body holds.

Parent: #36996. Related: #37140, #37173.

Activity

  1. added
    priority:p2
    pm:queue
    area:ai
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor
  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: blocked 2026-11-25T03:06Z (repo:objectstack#3's request 7151547806)

    Blocked-by: #37173

  4. added
    pm:blocked
    and removed
    pm:queue
    on Nov 25, 2026
  5. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor
  6. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK

    Claim: PM loop round 2 (area:ai zone ai-A, topic #36996 non-cloud rows) · 2026-11-25T03:53Z
    Session: session_01WGufzi13yZRqVcp2mGonWK
    Account: os-support-ai
    Branch: claude/issue-37178-outline-entry-cap
    Worktree: objectstack-issue-37178
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: ai-A
    File surface: packages/services/service-record-context/src/** (body-outline.ts: a RECORD_CONTEXT_OUTLINE_MAX_ENTRIES constant beside RECORD_CONTEXT_BODY_MAX_CHARS; record-context-tools.ts outline branch near :481; sentences.ts one fixed sentence; index.ts export; tests in a new card-named test file); packages/spec/src/ai/record-context-tools.zod.ts only if the cut needs a new RecordContextNoteKind value (:177) and its docblock (:165); generated spec references that follow from it; .changeset/. ⛔ No other package.
    Container & model: M, mode:subagent, model: default, effort: high
    Clause-②: yes (declared at the widest reading: the cut's note most likely adds a value to the published RecordContextNoteKind output enum, packages/spec/src/ai/record-context-tools.zod.ts:177, so the PR owes the L2 at CONTRACT_REVIEW_TIER in L1-w; if the dev measures that reusing the body's existing truncated mark and an existing note kind carries the cut, the claim is edited to no and the PR states why)
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 7152185727
    Premise: holds. Measured at a33691e: the outline branch (record-context-tools.ts:481) maps every heading headingsOf returns with no cap; the service's other bounds are RECORD_CONTEXT_BODY_MAX_CHARS = 8000 (body-outline.ts:26) and RECORD_CONTEXT_RELATED_MAX_ROWS = 20 (record-context-tools.ts:71); ADR-0160 D3 (:187) says every cut is stated in the notes and the bounds are service constants pinned by test, with no number set by the record.
    Serial constraints cleared: #37173 (#37140) merged 03:39Z; no open PR of this seat on the surface; the overlap check runs at the first push. #37176 (this zone, next) touches lint/metadata save, not this package.
    Pre-claim lane: domain:server (packages/services/**); a spec note-kind edit, if taken, stays here by the lane-keep rule and owes the L2.
    Pre-claim deps: #37140 merged (PR #37173, 03:39Z)
    Prior rulings read: check-prior-rulings.mjs --card 37178 at a33691e: unresolved (no hit); ADR-0160 D3/D4 read by hand (amended by #37196, merged); none conflicting

    Done when: the outline answer is bounded by the constant whatever the body holds; a cut adds one note naming how many headings were left out; the constant and the cut are pinned by a test with a body of many short headings.

  8. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  9. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK
    os-dev-report

    {
      "issue": 37178,
      "status": "done",
      "branch": "claude/issue-37178-outline-entry-cap",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37222",
      "session": "session_01WGufzi13yZRqVcp2mGonWK",
      "premise_still_valid": true,
      "summary": "The premise held at a33691e5: the outline branch mapped every heading with no cap. Added RECORD_CONTEXT_OUTLINE_MAX_ENTRIES = 80 (body-outline.ts, exported from the index) and boundedOutline. An outline lists at most 80 headings, and its listing, serialized, stays within RECORD_CONTEXT_BODY_MAX_CHARS. The character half is what makes the acceptance ('bounded whatever the body holds') true, because a heading and its anchor are as long as the author makes them. Headings are admitted shallowest level first and listed in body order. Anchors past the cap still read their section (decided and pinned). A heading too long to list falls back to truncated text. A cut adds ONE note of the new kind outline_truncated, with en and zh-Hans sentences giving the listed, total and omitted counts. Clause-②: yes (widening): the existing truncated mark is described as a cut of `text`, body_truncated as a character cut, and neither carries a count, so reusing them would change published meanings. The PR owes the L2 at CONTRACT_REVIEW_TIER. Metadata-protocol: none; changeset is patch for service-record-context and spec. The number 80 was measured on the 543 long Markdown docs of this repo that have headings: mean 95.4 chars per entry, so 80 entries is about 7,600 chars; 527 of 543 are listed uncut. Tests went into the two existing test files as top-level describes, per the AGENTS.md shared-harness rule, not into a new file. Worktree removed after CI went green.",
      "tests": "At head 2831c87e. Package test: `pnpm --filter @objectstack/service-record-context test`: Test Files 2 passed (2), Tests 71 passed (71). Typecheck: `typecheck` (tsc --noEmit + check:test-typecheck): OK, 0 errors, lock VERDICT command-exit 0. Spec: `pnpm --filter @objectstack/spec exec vitest run src/ai`: 16 files, 448 tests passed. Consumer: `pnpm --filter @objectstack/mcp exec vitest run src/mcp-record-context-tools.test.ts`: 10/10. Ablation 1 removed the entry-cap break via scripts/ablation-replace.mjs (anchor 1->0, blob f1e3b8c8->00d35ea8): 5 failed / 66 passed; restore proved by blob == HEAD and git diff HEAD empty. Ablation 2 removed the character-bound break: 3 failed / 68 passed, restored the same way. The tests resolve src through the vitest alias, so the ablations had no dist leg. test:repo was not run locally; CI Test Core 10/10 shards succeeded.",
      "gates": "Spec generated artifacts: after `pnpm --filter @objectstack/spec build` and `gen:docs`, `check:generated` reports 'All 14 generated artifacts are up to date'. Derived gates: `dispatch-gates --commands --repo objectstack-ai/objectstack` derived 110 commands at 2831c87e, all run with exit codes captured before any pipe. 103 exited 0 on the first pass. Five exited 3 (prerequisite not met): check:doc-formula-expressions, check:doc-security-posture, check:skill-examples, check:docs-transcript-drift, check:lean-entry-closure. After building the formula, lint, objectql and client-react closures, all five re-ran with exit 0. NOT MEASURED, reason exit 3: check-plugin-teardown-shape --self-test (needs a full clone; checker health only) and check:dual-build-cjs-loads (needs a full pnpm build). `--ran` with exits: '110 derived famil(ies) accounted for — 108 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)'. Local-only families: check:skill-frame-freshness exit 0. check:dev-prereqs exit 1 because 35 of 109 workspace dists are absent (the whole workspace is not built here); that is not a spec-dist staleness verdict. PR check-runs at 2831c87e: 60 success, 10 skipped, 0 failure, Ten required contexts are success: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate. Lint UI is skipped (path selector; no ui/ path in the diff). The Dogfood shard matrix is skipped on pull_request; its first run is the merge queue. Check Changeset success. mergeable_state clean.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, plus the issue-assignees leg for os-support-ai; read-back says 9830 bytes sent and stored, identical) via fleet-write run 45549169487; post-stamped os-dev-report comment on issue 37178. git push x3 to the work branch (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: the outline's .describe() and the new kind's docblock are spec prose in the claimed file, stating only what this PR implements"
      ]
    }
  10. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK

    Close-out · 2026-11-25T06:09Z · PR #37222 merged 2026-11-25T05:57Z as 6831e04; this card closed by Fixes. pm:dispatched removed. Follow-ups from the accepted review nits: #37233 (N2, an omitted section in a flat cut must stay reachable), N5 carried by the ADR-0160 amendment in PR #37240 (#37202). Nothing else open on this card.

  11. removed
    pm:dispatched
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions