You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/08/30 04:46:28 UTC

[PR] feat(tui): render durable task mutation history [maka]

me2seeks opened a new pull request, #4241:
URL: https://github.com/apache/maka/pull/4241

   ## Summary
   
   - hydrate `task_create` and `task_update` cards from the Runtime Host durable Task mutation projection
   - render up to 20 created tasks inline; summarize larger creates in the live TUI and show every item in `/transcript`
   - keep pagination, history restarts, exact Session/revision validation, stale-request fencing, and immutable-scrollback notices inside the CLI adapter/controller
   
   ## Authority and scope
   
   The TUI does not parse tool-result prose or reconstruct Task history from the current Task snapshot. It consumes the Host-owned immutable presentation keyed by `(turnId, toolCallId)` and fails closed on Session, revision, correlation, or operation mismatches. `task_list` and `task_get` remain unchanged.
   
   This PR depends on #4239. Until #4239 merges, the GitHub diff also contains its Runtime Host protocol commits; the TUI change itself is the final commit `e0e5e4246`.
   
   ## UX
   
   - 1-20 created tasks: show the complete list at the original tool-call position
   - 21+ created tasks: `Added N tasks · /transcript to view full list`
   - updates: show the Task key, prior and next status, subject, and durable reason/evidence
   - entries already frozen in terminal scrollback keep their rendered lines and receive one tail notice pointing to `/transcript`
   
   ## Verification
   
   - `npm --workspace maka-agent test` (647 passed)
   - `npm run lint`
   - `npm run format:check`
   - `npm run check:asf-headers`
   - `npm --workspace maka-agent run typecheck`
   - two independent exact-head reviews: 0 blockers
   
   Part of #4179


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(tui): render durable task mutation history [maka]

Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks closed pull request #4241: feat(tui): render durable task mutation history
URL: https://github.com/apache/maka/pull/4241


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(tui): render durable task mutation history [maka]

Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on code in PR #4241:
URL: https://github.com/apache/maka/pull/4241#discussion_r3889401488


##########
packages/cli/src/pi-transcript-tools.ts:
##########
@@ -49,10 +49,66 @@ export function renderToolBlock(
   entry: MakaPiToolEntry,
   width: number,
   expanded: boolean,
+  surface: 'live' | 'document' = 'live',
 ): string[] {
+  const taskMutation = renderTaskMutationBlock(entry, width, surface);
+  if (taskMutation) return taskMutation;
   return expanded ? renderExpandedToolBlock(entry, width) : renderCompactToolBlock(entry, width);
 }
 
+const TASK_MUTATION_LIVE_INLINE_MAX_CHANGES = 20;
+
+function renderTaskMutationBlock(
+  entry: MakaPiToolEntry,
+  width: number,
+  surface: 'live' | 'document',
+): string[] | undefined {
+  const mutation = entry.taskMutation;
+  if (!mutation) return undefined;
+  const title = entry.title ?? (entry.toolName === 'task_create' ? 'Task Create' : 'Task Update');
+  if (mutation.kind === 'unresolved') {
+    if (!mutation.observedSettled || makaPiToolPresentationStatus(entry) === 'running') {
+      return undefined;
+    }
+    return [fitLine(`${toolDisc(entry)} ${title}  ${ansi.dim('Task details unavailable')}`, width)];
+  }
+
+  const { presentation } = mutation;
+  if (
+    presentation.operation === 'create' &&
+    surface === 'live' &&
+    presentation.changes.length > TASK_MUTATION_LIVE_INLINE_MAX_CHANGES
+  ) {
+    return [
+      fitLine(
+        `${toolDisc(entry)} ${title}  Added ${presentation.changes.length} tasks · /transcript to view full list`,
+        width,
+      ),
+    ];
+  }
+
+  const summary =
+    presentation.operation === 'create'
+      ? `Added ${presentation.changes.length} ${presentation.changes.length === 1 ? 'task' : 'tasks'}`
+      : 'Updated task';
+  const lines = [fitLine(`${toolDisc(entry)} ${title}  ${summary}`, width)];
+  for (const change of presentation.changes) {
+    const transition =
+      change.previousStatus === undefined
+        ? change.nextStatus
+        : `${change.previousStatus} → ${change.nextStatus}`;
+    const detail = change.reason ?? change.evidence;
+    lines.push(
+      ...renderIndented(
+        `${change.key}  ${transition}  ${change.subject}${detail ? ` — ${detail}` : ''}`,

Review Comment:
   Fixed in 6888356bc. subject, reason, and evidence are sanitized at the shared live/document renderer seam with the Task field bounds and a non-empty fallback. CSI, OSC 52, OSC 8, BEL, ST, and C1 regressions cover both surfaces.



##########
packages/cli/src/pi-task-mutation-hydration.ts:
##########
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { createHash } from 'node:crypto';
+import type { TaskMutationCorrelation, TaskMutationLookup } from '@maka/runtime-host/protocol';
+import type { MakaSessionDriver } from './session-driver.js';
+import type {
+  MakaPiTaskMutationState,
+  MakaPiToolEntry,
+  MakaPiTranscriptState,
+} from './pi-transcript.js';
+
+interface TaskMutationTarget {
+  readonly entry: MakaPiToolEntry;
+  readonly correlation: TaskMutationCorrelation;
+  readonly operation: 'create' | 'update';
+  readonly observedSettled: boolean;
+}
+
+export interface TaskMutationHydrationController {
+  /** Invalidates old requests before the transcript entry identities are replaced. */
+  replace(sessionId: string | null): void;
+  /** Hydrates every current Task mutation entry through one atomic UI commit. */
+  schedule(sessionId: string | null): void;
+  dispose(): void;
+}
+
+export function createTaskMutationHydrationController(input: {
+  readonly state: MakaPiTranscriptState;
+  readonly driver: Pick<MakaSessionDriver, 'queryTaskMutations'>;
+  readonly onChanged: () => void;
+}): TaskMutationHydrationController {
+  let sessionId: string | null = null;
+  let transcriptGeneration = 0;
+  let requestGeneration = 0;
+  let disposed = false;
+  const announced = new Set<string>();
+
+  const replace = (nextSessionId: string | null): void => {
+    transcriptGeneration += 1;
+    requestGeneration += 1;
+    if (nextSessionId !== sessionId) announced.clear();
+    sessionId = nextSessionId;
+  };
+
+  const schedule = (requestedSessionId: string | null): void => {
+    if (disposed || !requestedSessionId || requestedSessionId !== sessionId) return;
+    if (!input.driver.queryTaskMutations) return;
+    const targets = taskMutationTargets(input.state);

Review Comment:
   Fixed in 6888356bc. Entries already resolved as immutable found results are excluded from later queries; new and unresolved entries remain eligible. A successive-settlement regression verifies the prior found correlation is not resubmitted.



##########
packages/cli/src/pi-task-mutation-hydration.ts:
##########
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { createHash } from 'node:crypto';
+import type { TaskMutationCorrelation, TaskMutationLookup } from '@maka/runtime-host/protocol';
+import type { MakaSessionDriver } from './session-driver.js';
+import type {
+  MakaPiTaskMutationState,
+  MakaPiToolEntry,
+  MakaPiTranscriptState,
+} from './pi-transcript.js';
+
+interface TaskMutationTarget {
+  readonly entry: MakaPiToolEntry;
+  readonly correlation: TaskMutationCorrelation;
+  readonly operation: 'create' | 'update';
+  readonly observedSettled: boolean;
+}
+
+export interface TaskMutationHydrationController {
+  /** Invalidates old requests before the transcript entry identities are replaced. */
+  replace(sessionId: string | null): void;
+  /** Hydrates every current Task mutation entry through one atomic UI commit. */
+  schedule(sessionId: string | null): void;
+  dispose(): void;
+}
+
+export function createTaskMutationHydrationController(input: {
+  readonly state: MakaPiTranscriptState;
+  readonly driver: Pick<MakaSessionDriver, 'queryTaskMutations'>;
+  readonly onChanged: () => void;
+}): TaskMutationHydrationController {
+  let sessionId: string | null = null;
+  let transcriptGeneration = 0;
+  let requestGeneration = 0;
+  let disposed = false;
+  const announced = new Set<string>();
+
+  const replace = (nextSessionId: string | null): void => {
+    transcriptGeneration += 1;
+    requestGeneration += 1;
+    if (nextSessionId !== sessionId) announced.clear();
+    sessionId = nextSessionId;
+  };
+
+  const schedule = (requestedSessionId: string | null): void => {
+    if (disposed || !requestedSessionId || requestedSessionId !== sessionId) return;
+    if (!input.driver.queryTaskMutations) return;
+    const targets = taskMutationTargets(input.state);
+    if (targets.length === 0) return;
+    const capturedTranscriptGeneration = transcriptGeneration;
+    const capturedRequestGeneration = ++requestGeneration;
+    void input.driver
+      .queryTaskMutations(
+        requestedSessionId,
+        targets.map(({ correlation }) => correlation),
+      )
+      .then((lookups) => {
+        if (
+          disposed ||
+          sessionId !== requestedSessionId ||
+          transcriptGeneration !== capturedTranscriptGeneration ||
+          requestGeneration !== capturedRequestGeneration ||
+          lookups.length !== targets.length
+        ) {
+          return;
+        }
+        const entries = new Set(input.state.entries);
+        for (let index = 0; index < targets.length; index += 1) {
+          const target = targets[index]!;
+          const lookup = lookups[index]!;
+          if (
+            !entries.has(target.entry) ||
+            correlationKey(target.correlation) !== correlationKey(lookup.correlation) ||
+            (lookup.kind === 'found' && lookup.presentation.operation !== target.operation)
+          ) {
+            return;
+          }
+        }
+
+        let changed = false;
+        let frozenChanged = false;
+        for (let index = 0; index < targets.length; index += 1) {
+          const target = targets[index]!;
+          const lookup = lookups[index]!;
+          const next = mutationState(lookup, target.observedSettled);
+          if (target.entry.taskMutation?.fingerprint === next.fingerprint) continue;
+          target.entry.taskMutation = next;
+          target.entry.taskMutationVersion = (target.entry.taskMutationVersion ?? 0) + 1;
+          changed = true;
+          if (!isFrozenRenderedEntry(input.state, target.entry)) continue;
+          const noticeKey = `${requestedSessionId}\0${correlationKey(target.correlation)}\0${next.fingerprint}`;
+          if (announced.has(noticeKey)) continue;
+          announced.add(noticeKey);
+          frozenChanged = true;
+        }
+        if (frozenChanged) {
+          input.state.entries.push({
+            kind: 'notice',
+            level: 'info',
+            text: 'Task details are ready · /transcript to view the full history.',

Review Comment:
   Fixed in 6888356bc. The readiness notice now requires an actual transition to found on a frozen rendered entry. Settled not_found and incompatible results update state without announcing that details are ready, with regressions for both cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(tui): render durable task mutation history [maka]

Posted by "M4n5ter (via GitHub)" <gi...@apache.org>.
M4n5ter commented on code in PR #4241:
URL: https://github.com/apache/maka/pull/4241#discussion_r3888638733


##########
packages/cli/src/pi-transcript-tools.ts:
##########
@@ -49,10 +49,66 @@ export function renderToolBlock(
   entry: MakaPiToolEntry,
   width: number,
   expanded: boolean,
+  surface: 'live' | 'document' = 'live',
 ): string[] {
+  const taskMutation = renderTaskMutationBlock(entry, width, surface);
+  if (taskMutation) return taskMutation;
   return expanded ? renderExpandedToolBlock(entry, width) : renderCompactToolBlock(entry, width);
 }
 
+const TASK_MUTATION_LIVE_INLINE_MAX_CHANGES = 20;
+
+function renderTaskMutationBlock(
+  entry: MakaPiToolEntry,
+  width: number,
+  surface: 'live' | 'document',
+): string[] | undefined {
+  const mutation = entry.taskMutation;
+  if (!mutation) return undefined;
+  const title = entry.title ?? (entry.toolName === 'task_create' ? 'Task Create' : 'Task Update');
+  if (mutation.kind === 'unresolved') {
+    if (!mutation.observedSettled || makaPiToolPresentationStatus(entry) === 'running') {
+      return undefined;
+    }
+    return [fitLine(`${toolDisc(entry)} ${title}  ${ansi.dim('Task details unavailable')}`, width)];
+  }
+
+  const { presentation } = mutation;
+  if (
+    presentation.operation === 'create' &&
+    surface === 'live' &&
+    presentation.changes.length > TASK_MUTATION_LIVE_INLINE_MAX_CHANGES
+  ) {
+    return [
+      fitLine(
+        `${toolDisc(entry)} ${title}  Added ${presentation.changes.length} tasks · /transcript to view full list`,
+        width,
+      ),
+    ];
+  }
+
+  const summary =
+    presentation.operation === 'create'
+      ? `Added ${presentation.changes.length} ${presentation.changes.length === 1 ? 'task' : 'tasks'}`
+      : 'Updated task';
+  const lines = [fitLine(`${toolDisc(entry)} ${title}  ${summary}`, width)];
+  for (const change of presentation.changes) {
+    const transition =
+      change.previousStatus === undefined
+        ? change.nextStatus
+        : `${change.previousStatus} → ${change.nextStatus}`;
+    const detail = change.reason ?? change.evidence;
+    lines.push(
+      ...renderIndented(
+        `${change.key}  ${transition}  ${change.subject}${detail ? ` — ${detail}` : ''}`,

Review Comment:
   **[P1] Neutralize terminal control sequences in durable task text**
   
   `subject`, `reason`, and `evidence` originate in model-controlled Task Ledger mutations. Their normalization collapses whitespace and redacts secrets but does not remove ESC/CSI/OSC/APC controls, while the TUI's ANSI-aware wrapping deliberately preserves controls. This new semantic renderer interpolates those fields directly into terminal output. A production-renderer probe placed an OSC-52 clipboard-write sequence in a durable task subject and found the exact control bytes in the final output. The old generic task-result path JSON-stringified these fields, so this is a newly reachable terminal-control path.
   
   Please escape or strip terminal control sequences at the renderer/plain-text boundary for all three fields while retaining visible text. Add CSI and OSC regressions for both live rendering and `/transcript`.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by M4n5ter. It is not an independent human review and does not replace one.



##########
packages/cli/src/pi-task-mutation-hydration.ts:
##########
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { createHash } from 'node:crypto';
+import type { TaskMutationCorrelation, TaskMutationLookup } from '@maka/runtime-host/protocol';
+import type { MakaSessionDriver } from './session-driver.js';
+import type {
+  MakaPiTaskMutationState,
+  MakaPiToolEntry,
+  MakaPiTranscriptState,
+} from './pi-transcript.js';
+
+interface TaskMutationTarget {
+  readonly entry: MakaPiToolEntry;
+  readonly correlation: TaskMutationCorrelation;
+  readonly operation: 'create' | 'update';
+  readonly observedSettled: boolean;
+}
+
+export interface TaskMutationHydrationController {
+  /** Invalidates old requests before the transcript entry identities are replaced. */
+  replace(sessionId: string | null): void;
+  /** Hydrates every current Task mutation entry through one atomic UI commit. */
+  schedule(sessionId: string | null): void;
+  dispose(): void;
+}
+
+export function createTaskMutationHydrationController(input: {
+  readonly state: MakaPiTranscriptState;
+  readonly driver: Pick<MakaSessionDriver, 'queryTaskMutations'>;
+  readonly onChanged: () => void;
+}): TaskMutationHydrationController {
+  let sessionId: string | null = null;
+  let transcriptGeneration = 0;
+  let requestGeneration = 0;
+  let disposed = false;
+  const announced = new Set<string>();
+
+  const replace = (nextSessionId: string | null): void => {
+    transcriptGeneration += 1;
+    requestGeneration += 1;
+    if (nextSessionId !== sessionId) announced.clear();
+    sessionId = nextSessionId;
+  };
+
+  const schedule = (requestedSessionId: string | null): void => {
+    if (disposed || !requestedSessionId || requestedSessionId !== sessionId) return;
+    if (!input.driver.queryTaskMutations) return;
+    const targets = taskMutationTargets(input.state);
+    if (targets.length === 0) return;
+    const capturedTranscriptGeneration = transcriptGeneration;
+    const capturedRequestGeneration = ++requestGeneration;
+    void input.driver
+      .queryTaskMutations(
+        requestedSessionId,
+        targets.map(({ correlation }) => correlation),
+      )
+      .then((lookups) => {
+        if (
+          disposed ||
+          sessionId !== requestedSessionId ||
+          transcriptGeneration !== capturedTranscriptGeneration ||
+          requestGeneration !== capturedRequestGeneration ||
+          lookups.length !== targets.length
+        ) {
+          return;
+        }
+        const entries = new Set(input.state.entries);
+        for (let index = 0; index < targets.length; index += 1) {
+          const target = targets[index]!;
+          const lookup = lookups[index]!;
+          if (
+            !entries.has(target.entry) ||
+            correlationKey(target.correlation) !== correlationKey(lookup.correlation) ||
+            (lookup.kind === 'found' && lookup.presentation.operation !== target.operation)
+          ) {
+            return;
+          }
+        }
+
+        let changed = false;
+        let frozenChanged = false;
+        for (let index = 0; index < targets.length; index += 1) {
+          const target = targets[index]!;
+          const lookup = lookups[index]!;
+          const next = mutationState(lookup, target.observedSettled);
+          if (target.entry.taskMutation?.fingerprint === next.fingerprint) continue;
+          target.entry.taskMutation = next;
+          target.entry.taskMutationVersion = (target.entry.taskMutationVersion ?? 0) + 1;
+          changed = true;
+          if (!isFrozenRenderedEntry(input.state, target.entry)) continue;
+          const noticeKey = `${requestedSessionId}\0${correlationKey(target.correlation)}\0${next.fingerprint}`;
+          if (announced.has(noticeKey)) continue;
+          announced.add(noticeKey);
+          frozenChanged = true;
+        }
+        if (frozenChanged) {
+          input.state.entries.push({
+            kind: 'notice',
+            level: 'info',
+            text: 'Task details are ready · /transcript to view the full history.',

Review Comment:
   **[P3] Do not announce readiness for unavailable details**
   
   `frozenChanged` is set for any changed fingerprint, including settled `not_found` and `incompatible` lookups. This notice then says the details are ready even though the corresponding row renders `Task details unavailable`. A production-controller probe returning settled `not_found` reproduced both messages in the same state.
   
   Please emit the readiness notice only when at least one frozen entry becomes `found`, or use an unavailable-specific notice for the unresolved cases. Cover settled `not_found` and `incompatible` transitions.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by M4n5ter. It is not an independent human review and does not replace one.



##########
packages/cli/src/pi-task-mutation-hydration.ts:
##########
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { createHash } from 'node:crypto';
+import type { TaskMutationCorrelation, TaskMutationLookup } from '@maka/runtime-host/protocol';
+import type { MakaSessionDriver } from './session-driver.js';
+import type {
+  MakaPiTaskMutationState,
+  MakaPiToolEntry,
+  MakaPiTranscriptState,
+} from './pi-transcript.js';
+
+interface TaskMutationTarget {
+  readonly entry: MakaPiToolEntry;
+  readonly correlation: TaskMutationCorrelation;
+  readonly operation: 'create' | 'update';
+  readonly observedSettled: boolean;
+}
+
+export interface TaskMutationHydrationController {
+  /** Invalidates old requests before the transcript entry identities are replaced. */
+  replace(sessionId: string | null): void;
+  /** Hydrates every current Task mutation entry through one atomic UI commit. */
+  schedule(sessionId: string | null): void;
+  dispose(): void;
+}
+
+export function createTaskMutationHydrationController(input: {
+  readonly state: MakaPiTranscriptState;
+  readonly driver: Pick<MakaSessionDriver, 'queryTaskMutations'>;
+  readonly onChanged: () => void;
+}): TaskMutationHydrationController {
+  let sessionId: string | null = null;
+  let transcriptGeneration = 0;
+  let requestGeneration = 0;
+  let disposed = false;
+  const announced = new Set<string>();
+
+  const replace = (nextSessionId: string | null): void => {
+    transcriptGeneration += 1;
+    requestGeneration += 1;
+    if (nextSessionId !== sessionId) announced.clear();
+    sessionId = nextSessionId;
+  };
+
+  const schedule = (requestedSessionId: string | null): void => {
+    if (disposed || !requestedSessionId || requestedSessionId !== sessionId) return;
+    if (!input.driver.queryTaskMutations) return;
+    const targets = taskMutationTargets(input.state);

Review Comment:
   **[P2] Stop re-querying already-found immutable mutations**
   
   Every settlement or reconnect calls `taskMutationTargets` over the full transcript, so this query includes every historical task mutation even after its immutable presentation has already been found. The Host performs a complete Task event-history read and replay for each page, and Session admission serializes that work. As a Session grows, repeated tool settlement therefore trends toward quadratic replay work and holds the per-Session gate while doing work whose answer cannot change under append.
   
   Transcript replacement already creates new entry identities and invalidates the controller generation. Please query only new entries and running/unresolved entries, and reuse the existing derived state for entries already resolved as `found`. Add a regression that settles successive tasks and verifies earlier found correlations are not submitted again.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by M4n5ter. It is not an independent human review and does not replace one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(tui): render durable task mutation history [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #4241:
URL: https://github.com/apache/maka/pull/4241#issuecomment-5470089463

   Thanks for rebasing and continuing to harden the Task mutation presentation.
   
   Before we spend more review time on the current 3,700-line direction, I think we need to reconcile it with #2290. That RFC has already converged on SessionTodo as a narrow current snapshot and tracks eventual removal of the model-facing `task_*` tools, mutation-event history, paginated query protocol, claim/settle paths, and the current Task panel.
   
   This PR moves in the opposite direction by adding a new durable Task mutation-history query, continuation contract, global validation, wire batching, and TUI hydration around the authority #2290 intends to retire.
   
   Could we pause this PR until the SessionTodo contract is settled? If a semantic mutation timeline is still needed afterward, it can be designed against the smaller surviving authority rather than extending the current Ledger first. Please push back if #2290’s accepted direction has changed or this history has an independent obligation that survives the migration.
   
   AI-assisted review disclosure: Codex assisted with comparing this exact head against #2290; Astro-Han verified the architectural conflict and owns this position.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(tui): render durable task mutation history [maka]

Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on PR #4241:
URL: https://github.com/apache/maka/pull/4241#issuecomment-5481524226

   Closing as superseded by #4338 and the merged SessionTodo cutover in #4351. This TUI projection depended on #4239 and the retired Task Ledger mutation-history contract; TUI now renders settled SessionTodo tool results from the Host-owned current snapshot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org