Skip to content

docs(spec): ChatToolCalls records its shipped contract as current - #9339

Merged
cixzhang merged 3 commits into
mainfrom
spec-backfill/ChatToolCalls
Nov 1, 2026
Merged

cixzhang merged 3 commits into
mainfrom
spec-backfill/ChatToolCalls

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Promote component:ChatToolCalls from draft to current. No behavior, prop, default, target, or export changes.

Existing authority searched

Decision

component:ChatToolCalls, authority: current, approved by cixzhang. Draft and audit wording is removed, basis cells read from current source and tests, and the verification map credits tests for what they catch, with a "Read from source, with no focused test yet" list for the rest. One implementation gap: signed +N/-N statistics can miss WCAG 2.2 SC 1.4.3 text contrast (Current-state impact, OQ2). OQ1 stays open.

Rejected alternatives

None.

Claim scope and non-goals

Claims are scoped to what main's source and tests show.

Evidence and implementation relationship

The component's colocated tests, as listed in the verification map.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none; open questions are unruled.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract: none.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; no ownership collision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: aligned
  • Prettier: clean
  • git diff --check: clean

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 1, 2026 3:08pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 1, 2026, 3:22 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 1, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 1, 2026 14:36

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec promotion needs an engineering owner's decision before it can be approved: on main the ChatToolCalls record is still a draft, so its claims, including FR5 recording the signed +N/-N colours as a known contrast gap while OQ2 stays open, are not yet current spec. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Because a new commit resets that approval, please fix these first:

  • The verification map: no test covers FR2's translated-count fallback, the FR6 test already checks className, style and the target, the FR1 "latest-call surface" test cannot catch a wrong surface, and the axe scan and two story play guards that AR4 relies on are missing.
  • The Public contract line leaves out the shipped data call field.

[Automated review]

| Governing rules | `architecture:public-component-api/INV5–INV6, INV8–INV9`; `architecture:interaction-modality`; `spec:AST-009/FR7`; `spec:AST-029/FR3–FR7`; WCAG 2.2 SC 1.4.3 and 2.4.7. |
| Area | Contract |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Public contract | `ChatToolCalls` with required `calls` (each with `name`, optional `status`, `target`, `node`, `duration`, `additions`, `deletions`, `stats`, `errorMessage`, `resultDetail`, and `key`), optional `label`, `isExpanded`, `defaultIsExpanded`, `onExpandedChange`, and root div props and ref. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChatToolCallItem also ships data?: unknown (ChatToolCalls.tsx:75-76, packages/core/api-report.md, and the calls prop docs). Add it so the current contract lists every released call field.

- **AR2 — Collapsed ownership.** Collapsed group content is inert; hidden detail content is unmounted.
- **AR3 — Status meaning.** Every status exposes translated visually hidden text. Complete and error also use distinct semantic marks; pending and running currently share the same subtle spinner (OQ1). Error messages are exposed to assistive technology and echoed in the status icon's hover tooltip.
- **AR4 — Static evidence.** Focus appearance, keyboard behavior, inertness, color contrast, and DOM relationships use unit, axe, and real-browser evidence under `spec:AST-009/FR7`; this audit makes no AT-announcement claim.
- **AR3 — Status meaning.** Every status exposes translated visually hidden text. Complete and error also use distinct semantic marks; pending and running share the same subtle spinner (OQ1). Error messages are exposed to assistive technology and echoed in the status icon's hover tooltip.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only call rows set the tooltip (ChatToolCalls.tsx:448-450); the status icon on the collapsed group header has no title (:648-649). Limit the tooltip clause to call rows.

| Docs / surface | docs, declarations, exports, knowledge check, docs typecheck | public props, Chat subpath, draft record | Missing or stale docs, export, target, or knowledge shape fails. | `audit:ChatToolCalls/docs` |
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| ------------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------- | ----------------------------------- |
| FR1 | `ChatToolCalls.test.tsx` empty, single, latest-call surface, collapsed default, and toggle tests | empty; single; grouped | A rendered empty root, group chrome on one call, or a wrong surface fails. | `audit:ChatToolCalls/behavior` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"renders latest call as surface" still passes when the collapsed surface shows the first call, because getAllByText('editFile') also matches the inert full list. The test that fails on a wrong surface is "includes the latest status in a collapsed group accessible name"; credit that one here.

| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| ------------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------- | ----------------------------------- |
| FR1 | `ChatToolCalls.test.tsx` empty, single, latest-call surface, collapsed default, and toggle tests | empty; single; grouped | A rendered empty root, group chrome on one call, or a wrong surface fails. | `audit:ChatToolCalls/behavior` |
| FR2 | `ChatToolCalls.test.tsx` "renders the public custom group label when expanded" | supplied label | An ignored label fails. | `audit:ChatToolCalls/behavior` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test covers only a supplied label. Replacing the translated-count fallback with an empty string passes all 27 tests, so FR2's omission half belongs on the untested list below (or needs a test).

- FR1: caller order in the expanded list.
- FR4: Enter and Space activation.
- FR5: the secondary foreground on supporting text.
- FR6: `className`, `style`, and `xstyle` composition, and the target.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"forwards the root ref and supported DOM props" already checks className, style and the astryx-chat-tool-calls target: dropping either input or renaming the target fails it. Only xstyle is untested.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec promotion is ready for an engineering owner's decision: on main the ChatToolCalls record is still a draft, so making its claims current, including FR5 recording the signed +N/-N colours as a known contrast gap while OQ2 stays open, needs owner approval. The earlier corrections are in: the public contract lists data, the tooltip clause is scoped to call rows, and the verification map's credits and untested list hold up when each behaviour is broken in turn. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; a new commit resets that approval, so optionally fix the draft path in the description (docs/specs/components/Chat/ChatToolCalls.spec.md) first.

[Automated review]

@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 6d367f3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang
cixzhang merged commit 974c3c8 into main Nov 1, 2026
53 checks passed
@cixzhang
cixzhang deleted the spec-backfill/ChatToolCalls branch November 1, 2026 17:33

This branch was successfully deployed

1 active deployment
Preview — 6d367f3a Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant