You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by ku...@apache.org on 2026/09/14 09:49:46 UTC

(maka) branch chore/4071-close-legacy-archive created (now 82770785b4)

This is an automated email from the ASF dual-hosted git repository.

likun666661 pushed a change to branch chore/4071-close-legacy-archive
in repository https://gitbox.apache.org/repos/asf/maka.git


      at 82770785b4 chore(runtime-host): close legacy archive read path

This branch includes the following new commits:

     new 82770785b4 chore(runtime-host): close legacy archive read path

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


(maka) 01/01: chore(runtime-host): close legacy archive read path

Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

likun666661 pushed a commit to branch chore/4071-close-legacy-archive
in repository https://gitbox.apache.org/repos/asf/maka.git

commit 82770785b4bceb70c14ee35f83b2357f8ad49f06
Author: likun666661 <90...@users.noreply.github.com>
AuthorDate: Mon Sep 14 17:49:39 2026 +0800

    chore(runtime-host): close legacy archive read path
    
    New ledger-backed pruning no longer exposes ArtifactStore archive payloads. Keep historical records and decoders available only for safe degraded reads, without migration or deletion.
    
    Generated-by: Codex
---
 .../src/__tests__/execution-artifacts.test.ts      |  6 ++--
 .../runtime-host/src/server/execution-artifacts.ts | 35 +++-------------------
 2 files changed, 7 insertions(+), 34 deletions(-)

diff --git a/packages/runtime-host/src/__tests__/execution-artifacts.test.ts b/packages/runtime-host/src/__tests__/execution-artifacts.test.ts
index eb81329b52..3970c465a4 100644
--- a/packages/runtime-host/src/__tests__/execution-artifacts.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-artifacts.test.ts
@@ -302,7 +302,7 @@ for (const scenario of ['text', 'large raw MCP image', 'executor-sized Bash'] as
             sessionId: 'session',
             maxBytes: input.originalBytes,
           }),
-          { ok: true, serializedResult },
+          { ok: false, reason: 'read_failed' },
         );
     } finally {
       db.close();
@@ -499,7 +499,7 @@ test('Hosted execution publishes contained Tool Artifacts and durable result arc
         maxBytes: archiveInput.originalBytes,
         artifactId: archived.artifactId,
       }),
-      { ok: true, serializedResult },
+      { ok: false, reason: 'read_failed' },
     );
     await store.close();
     restoreArtifactV1Shape(join(base, 'root'));
@@ -517,7 +517,7 @@ test('Hosted execution publishes contained Tool Artifacts and durable result arc
           maxBytes: archiveInput.originalBytes,
           artifactId: archived.artifactId,
         }),
-        { ok: true, serializedResult },
+        { ok: false, reason: 'read_failed' },
       );
     } finally {
       upgraded.close();
diff --git a/packages/runtime-host/src/server/execution-artifacts.ts b/packages/runtime-host/src/server/execution-artifacts.ts
index e7ed035644..9e63f59e94 100644
--- a/packages/runtime-host/src/server/execution-artifacts.ts
+++ b/packages/runtime-host/src/server/execution-artifacts.ts
@@ -33,10 +33,7 @@ import {
 } from '@maka/runtime/ledger-tool-result-archive-reader';
 import type { ToolResultArchiveEvidenceReader } from '@maka/core/tool-result-archive-evidence';
 import { type ToolArtifactRecorderInput } from '@maka/runtime/tool-artifacts';
-import {
-  type ToolResultArchiveReaderInput,
-  type ToolResultArchiveReadResult,
-} from '@maka/runtime/context-budget';
+import type { ToolResultArchiveReaderInput } from '@maka/runtime/context-budget';
 import { type ToolResultArchiveResourceReadInput } from '@maka/runtime/tool-result-archive-resource';
 import type { InteractiveArtifactStoreWriter } from '@maka/storage/artifact-stores';
 import type { SessionManagerDeps } from '@maka/runtime/session-manager';
@@ -47,8 +44,8 @@ export interface HostExecutionArtifactServices {
   recordToolArtifacts(event: ToolArtifactRecorderInput): Promise<void>;
   publishChildWorkspacePatch: NonNullable<SessionManagerDeps['publishChildWorkspacePatch']>;
   /**
-   * New archives use the Session ledger. Legacy Artifact refs retain their
-   * scoped reader; the writer never falls back to publishing Artifact bytes.
+   * New archives use the Session ledger. Legacy Artifact refs are retained as
+   * historical data but are deliberately unavailable through this capability.
    */
   toolResultArchive: ToolResultArchiveCapability;
 }
@@ -142,7 +139,7 @@ export function createHostExecutionArtifactServices(input: {
       readArchivedToolResultResource: (event: ToolResultArchiveResourceReadInput) =>
         event.storage === 'ledger' || event.storage === 'event'
           ? (readLedgerResource?.(event) ?? { ok: false, reason: 'read_failed' })
-          : readArchive(input.artifacts, event),
+          : { ok: false, reason: 'read_failed' },
     }),
   };
   return Object.freeze(services);
@@ -196,27 +193,3 @@ async function readBoundedSourceFile(cwd: string, sourcePath: string): Promise<B
 function contentBytes(content: string | Uint8Array): number {
   return typeof content === 'string' ? Buffer.byteLength(content, 'utf8') : content.byteLength;
 }
-
-async function readArchive(
-  artifacts: InteractiveArtifactStoreWriter,
-  event: Pick<
-    Extract<ToolResultArchiveReaderInput, { rewriteVersion: 1 }>,
-    'artifactId' | 'sessionId' | 'bodySha256' | 'originalBytes' | 'maxBytes'
-  >,
-): Promise<ToolResultArchiveReadResult> {
-  const entry = await artifacts.getInSession(event.sessionId, event.artifactId);
-  const record = entry.record;
-  if (!record) return { ok: false, reason: 'not_found' };
-  if (record.source !== 'tool_result_archive') return { ok: false, reason: 'source_mismatch' };
-  if (record.sizeBytes !== event.originalBytes) return { ok: false, reason: 'size_mismatch' };
-  const read = await artifacts.readTextInSession(event.sessionId, event.artifactId, {
-    maxBytes: event.maxBytes ?? event.originalBytes,
-  });
-  if (!read.ok) return read;
-  if (sha256(read.text) !== event.bodySha256) return { ok: false, reason: 'corrupt' };
-  return { ok: true, serializedResult: read.text };
-}
-
-function sha256(text: string): string {
-  return createHash('sha256').update(text).digest('hex');
-}


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