From f78d7fc3ac445455534ab1454eb695449dd1f91e Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 18 Aug 2026 03:09:41 -0700 Subject: [PATCH] fix(agent-status): keep agent-status-types under its line cap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main already sits exactly at the 300-line max-lines cap for this file, so the single `acceptedStatusSeq` field this branch adds pushed it to 301 once main's observation facet merged in. Declared the field as a mixin beside the observation facet instead. Both are per-write facets mixed into `AgentStatusEntry` rather than fields a reporter supplies, so they belong together — and the capped file loses a line rather than gaining one, since it already imports from that module. No lint suppression. --- src/shared/agent-status-observation.ts | 11 +++++++++++ src/shared/agent-status-types.ts | 12 +++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/shared/agent-status-observation.ts b/src/shared/agent-status-observation.ts index 0eeb60e4bb3..521f2de1cc4 100644 --- a/src/shared/agent-status-observation.ts +++ b/src/shared/agent-status-observation.ts @@ -62,6 +62,17 @@ export type AgentStatusObservation = { * body, so a hook or OSC writer cannot declare its own provenance. */ export type WithAgentStatusObservation = { observation?: AgentStatusObservation } +/** Renderer-local count of ACCEPTED status writes this pane's row has taken. Incremented only by + * the store's accept branch, off the row it replaces, and carried through by every field-level + * rewrite — so it answers "did the pane report again?", which `updatedAt` cannot, because the + * accept rule admits equal timestamps. Lives on the row rather than in a side table so no + * teardown path can reset it out from under a reader (STA-4612). Never sent over IPC or + * persisted to last-status.json. + * + * Declared here beside the observation facet because both are per-write facets mixed into + * `AgentStatusEntry` rather than fields a reporter supplies. */ +export type WithAcceptedStatusSeq = { acceptedStatusSeq?: number } + // ─── THE ORDERING RULE ────────────────────────────────────────────────────── // `(authorityId, incarnation, revision)` is a total order ONLY within one authorityId. // A different authorityId means "incomparable", not "older" — the id is regenerated per diff --git a/src/shared/agent-status-types.ts b/src/shared/agent-status-types.ts index 33b01821d48..21cf4c931b5 100644 --- a/src/shared/agent-status-types.ts +++ b/src/shared/agent-status-types.ts @@ -3,7 +3,7 @@ // a narrow interrupt fallback synthesizes a final `done` when an agent misses its cancellation hook. import type { AgentProviderSessionMetadata } from './agent-session-resume' -import type { WithAgentStatusObservation } from './agent-status-observation' +import type { WithAcceptedStatusSeq, WithAgentStatusObservation } from './agent-status-observation' import { normalizeInteractivePromptField, normalizeOptionalField, @@ -152,14 +152,8 @@ export type AgentStatusEntry = { * the transition may have been missed while no receiver was up, so freshness gates * treat the row as stale immediately. Cleared by any accepted live event. */ restoredUnconfirmed?: boolean - /** Renderer-local count of ACCEPTED status writes this pane's row has taken. Incremented only by - * the store's accept branch, off the row it replaces, and carried through by every field-level - * rewrite — so it answers "did the pane report again?", which `updatedAt` cannot, because the - * accept rule admits equal timestamps. Lives on the row rather than in a side table so no - * teardown path can reset it out from under a reader (STA-4612). Never sent over IPC or - * persisted to last-status.json. */ - acceptedStatusSeq?: number -} & WithAgentStatusObservation +} & WithAgentStatusObservation & + WithAcceptedStatusSeq export type MigrationUnsupportedPtyEntry = { ptyId: string