Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The remote Core process runs on the server, so project work already lands in the

### Smaller gaps

- **Swallowed save errors.** Workflow code catches some Session-save errors and continues (`workflow-context-session.js`,
- **Swallowed save errors.** Workflow code catches some Session-save errors and continues (`workflow-context-session.ts`,
`hosted-session.js`, `plan-written.ts`, `runtime/workflows.ts`). In remote mode, a save fault is sticky and stops the
Agent. Git, worktree, CI, and Plan-file work can still start until something touches the manager again.
- **Background task logs.** `background-tasks.ts` writes logs to `~/.wld/sessions/<projectId>/<sessionId>/` on the
Expand Down
1 change: 0 additions & 1 deletion scripts/language-policy-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"src/shared/session/session-transcript-projection.js",
"src/shared/session/session.js",
"src/shared/session/types.js",
"src/shared/session/workflow-context-session.js",
"src/shared/settings.js",
"src/shared/types.js",
"src/shared/work-records/auto-generation.js",
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/re-anchor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { ContextEvent, ExtensionAPI, SessionCompactEvent } from "@earendil-
import { buildReAnchorMessage, type ReAnchorContext } from "../../shared/workflow/workflow-prompts.ts";
import { projectEngineerPlanBody } from "../../shared/workflow/engineer-plan-projection.ts";
import { getStoredPlanPath } from "../../plan-store.js";
import { normalizeWorkflowPlanName } from "../../shared/session/workflow-context-session.js";
import { normalizeWorkflowPlanName } from "../../shared/session/workflow-context-session.ts";
import { normalizeLedger, renderOpenItems } from "../../shared/workflow/review-ledger.ts";
import type { HostedSession } from "../../shared/session/hosted-session.js";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/owner-coordination/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
normalizeSegmentLineageEvidence,
PENDING_SEGMENT_CONTINUATION_CUSTOM_TYPE,
SEGMENT_LINEAGE_CUSTOM_TYPE,
} from "../session/workflow-context-session.js";
} from "../session/workflow-context-session.ts";
import { getProjectById, listProjectRootEvidence } from "./projects.ts";

/**
Expand Down
4 changes: 2 additions & 2 deletions src/shared/remote/remote-runtime-test-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { SessionManager, type ToolDefinition } from "@earendil-works/pi-coding-a
import { buildAgentSession } from "../session/session.js";
import { createRemoteRootSessionManager, getRemoteSessionSaveBridge } from "../session/root-session.js";
import { readImageRef } from "../session/image-attachments.ts";
import { recordNormalizedWorkflowContext } from "../session/workflow-context-session.js";
import { recordNormalizedWorkflowContext } from "../session/workflow-context-session.ts";
import { recordTutorialContext } from "../session/tutorial-context-session.ts";
import { appendExecutionWorkflowSnapshot } from "../session/execution-workflow-session.ts";
import { runResumeCommand } from "../../cmd/resume/index.ts";
Expand Down Expand Up @@ -134,7 +134,7 @@ export interface RuntimeClientReport {
reviewKind?: string;
canReopen?: boolean;
rollover?: import("../session/segment-rollover.ts").SegmentRolloverResult;
workflowContext?: import("../session/workflow-context-session.js").WorkflowContext | null;
workflowContext?: import("../session/workflow-context-session.ts").WorkflowContext | null;
tutorialContext?: import("../session/tutorial-context-session.ts").TutorialContext | null;
activeWorkflow?: import("../types.js").ActiveExecutionWorkflow | null;
piSessionId?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
readPersistedPendingSegmentContinuationEntry,
recordPendingSegmentContinuation,
recordNormalizedWorkflowContext,
} from "../session/workflow-context-session.js";
} from "../session/workflow-context-session.ts";
import { recordTutorialContext } from "../session/tutorial-context-session.ts";
import { appendExecutionWorkflowSnapshot } from "../session/execution-workflow-session.ts";
import { parseRemoteSessionTranscript } from "./session-protocol.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/execution-segment-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RuntimeEventTypes } from "./session-runtime-events.js";
import {
readPersistedPendingSegmentContinuation,
readPersistedSegmentLineageEvidence,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";
import { buildExecutionSegmentContinuation } from "../workflow/execution-segment-handoff.ts";
import { loadPlanActionEvidence } from "../workflow/plan-actions.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/execution-workflow-recovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { SessionManager } from "@earendil-works/pi-coding-agent";
import type { ActiveExecutionWorkflow } from "../types.js";
import { readExecutionWorkflowSnapshot } from "./execution-workflow-session.ts";
import { readPersistedActiveAgentName } from "./active-agent-session.ts";
import { readPersistedWorkflowContext } from "./workflow-context-session.js";
import { readPersistedWorkflowContext } from "./workflow-context-session.ts";
import { readPlanAssociations } from "./plan-association.ts";
import { listEntries } from "../worktree-registry.js";
import { loadPlan } from "../../plan-store.js";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/file-session-lineage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
normalizeSegmentLineageEvidence,
PENDING_SEGMENT_CONTINUATION_CUSTOM_TYPE,
SEGMENT_LINEAGE_CUSTOM_TYPE,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";
import { readPlanAssociations } from "./plan-association.ts";
import { FILE_SESSION_STORE_VERSION, isoNow } from "./file-session-storage.ts";
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/file-session-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
import type { RemoteArtifactOptions, RemotePlanReview } from "../remote/session-protocol.ts";
import { readExecutionWorkflowSnapshot } from "./execution-workflow-session.ts";
import { readPersistedTutorialContext } from "./tutorial-context-session.ts";
import { readPersistedWorkflowContext } from "./workflow-context-session.js";
import { readPersistedWorkflowContext } from "./workflow-context-session.ts";
import { findProject, sessionDirForProject } from "./file-session-storage.ts";
import type { ManagedSessionMetadata } from "./hosted-session.js";
import type { RemoteRolloverOptions, RemoteRolloverReceipt } from "../remote/session-protocol.ts";
Expand Down
10 changes: 5 additions & 5 deletions src/shared/session/hosted-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
recordWorkflowPlanName,
recordWorkflowTriageContext,
workflowContextsEqual,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";
import { emitHostedSessionRuntimeEvent, RuntimeEventTypes } from "./session-runtime-events.js";
import { clearPairCheckpoint } from "./pair-checkpoint-session.ts";
import { recordExecutionWorkflowSnapshot } from "./execution-workflow-session.ts";
Expand Down Expand Up @@ -137,7 +137,7 @@ import { PlanReviewConversationOwner } from "./plan-review-conversation.ts";
* @property {string | null} [model]
* @property {string | null} [provider]
* @property {string | null} [thinkingLevel]
* @property {import('./workflow-context-session.js').WorkflowContext | null} workflowContext
* @property {import('./workflow-context-session.ts').WorkflowContext | null} workflowContext
* @property {import('./tutorial-context-session.ts').TutorialContext | null} [tutorialContext]
*/

Expand Down Expand Up @@ -271,7 +271,7 @@ export class HostedSession {
this.delegatedReaderCount = 0;
this.delegatedWriterActive = false;
this.projectStateContext = "";
/** @type {import('./workflow-context-session.js').WorkflowContext | null} */
/** @type {import('./workflow-context-session.ts').WorkflowContext | null} */
this.workflowContext = readPersistedWorkflowContext(
/** @type {import('@earendil-works/pi-coding-agent').SessionManager | null} */ (this.rootSessionManager),
);
Expand Down Expand Up @@ -1032,7 +1032,7 @@ export class HostedSession {
}

/**
* @param {import('./workflow-context-session.js').WorkflowContext | null} nextContext
* @param {import('./workflow-context-session.ts').WorkflowContext | null} nextContext
* @param {{ persist?: boolean }} options
*/
replaceWorkflowContext(nextContext, options = {}) {
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export class HostedSession {
}
}

/** @param {import('./workflow-context-session.js').WorkflowContextInput} details */
/** @param {import('./workflow-context-session.ts').WorkflowContextInput} details */
setWorkflowExecutionContext(details) {
if (this.disposed) return;
const nextContext = deriveWorkflowContextFromExecutionWorkflow(details);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/hosted-session.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test } from "node:test";
import { ok as assert, strictEqual as assertStrictEquals } from "node:assert/strict";
import { assertEquals, assertThrows } from "../../testing/assertions.ts";
import { HostedSession } from "./hosted-session.js";
import { WORKFLOW_CONTEXT_CUSTOM_TYPE } from "./workflow-context-session.js";
import { WORKFLOW_CONTEXT_CUSTOM_TYPE } from "./workflow-context-session.ts";
import { TUTORIAL_CONTEXT_CUSTOM_TYPE } from "./tutorial-context-session.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/lifecycle-loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createSessionRuntimeEvent, RuntimeEventTypes } from ".././session-runti
import { createReplayEvents as createProjectedReplayEvents } from ".././session-transcript-projection.js";
import { requestHostedSessionInteraction } from ".././session-runtime-interactions.ts";
import { sessionDirForRoot } from ".././file-session-storage.ts";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.js";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.ts";
import { isAbsolute } from "node:path";

import { enterGitProjectRuntime, isRuntimeRootSessionManager } from "./support.ts";
Expand Down
4 changes: 2 additions & 2 deletions src/shared/session/runtime/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from ".././root-session.js";
import { RuntimeEventTypes } from ".././session-runtime-events.js";
import { captureTranscriptEvidence, syncTranscriptFileAndParent } from ".././session-transcript-projection.js";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.js";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.ts";
import { isAbsolute } from "node:path";
import type { PromptReadySessionOptions } from "./types.ts";

Expand Down Expand Up @@ -290,7 +290,7 @@ export class RuntimeLifecycle {
model?: string | null;
provider?: string | null;
thinkingLevel?: string | null;
workflowContext?: import(".././workflow-context-session.js").WorkflowContext | null;
workflowContext?: import(".././workflow-context-session.ts").WorkflowContext | null;
tutorialContext?: import("../tutorial-context-session.ts").TutorialContext | null;
}) {
const cataloged = options?.session;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/managed-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isPathInside, openPersistedRootSession } from ".././root-session.js";
import { RuntimeEventTypes } from ".././session-runtime-events.js";
import { captureTranscriptEvidence, syncTranscriptFileAndParent } from ".././session-transcript-projection.js";
import { openLiveSessionConnection } from ".././live-session-connection.ts";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.js";
import { recordSegmentLineageEvidence } from ".././workflow-context-session.ts";
import { parseProviderModel } from "../../models/model-validation.ts";
import { sessionDirForRoot } from ".././file-session-storage.ts";
import { AsyncLocalStorage } from "node:async_hooks";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/managed-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { captureTranscriptEvidence, toProjectionFailure } from ".././session-tra
import { projectAggregateTranscript } from ".././session-transcript-manifest.ts";
import { dirname } from "node:path";
import { normalizeTutorialContext } from "../tutorial-context-session.ts";
import { normalizeWorkflowContext } from "../workflow-context-session.js";
import { normalizeWorkflowContext } from "../workflow-context-session.ts";
import { reconcileLegacyCompletion } from "../workflow-context-recovery.ts";

import { isSameManagedSyncState, restorePublishedSessionProjectRoot } from "./support.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/reads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
} from "../session-export.ts";
import { listRecentResumableSessions } from ".././session-resume-list.ts";
import { buildSessionContextReport } from ".././session-context-report.ts";
import { deriveWorkflowContextFromExecutionWorkflow } from ".././workflow-context-session.js";
import { deriveWorkflowContextFromExecutionWorkflow } from ".././workflow-context-session.ts";
import { dirname, isAbsolute } from "node:path";

import {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/remote-persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { reasonForCandidate } from "../plan-session-lookup.ts";
import { restoreExecutionWorkflow } from "../execution-workflow-recovery.ts";
import { SessionManager } from "@earendil-works/pi-coding-agent";
import { readPersistedTutorialContext } from "../tutorial-context-session.ts";
import { readPersistedWorkflowContext } from "../workflow-context-session.js";
import { readPersistedWorkflowContext } from "../workflow-context-session.ts";
import type {
RemotePlanSessionQuery,
RemoteRolloverOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { parseProviderModel } from "../../models/model-validation.ts";
import { getSettingsManager } from "../../settings.js";
import { isGitRepository } from "../../git.ts";
import { preparePlanController } from "../../workflow/plan-preparation.ts";
import { readPersistedWorkflowContext } from ".././workflow-context-session.js";
import { readPersistedWorkflowContext } from ".././workflow-context-session.ts";
import { createPairCheckpointTool } from "../../../tools/pair-checkpoint.ts";
import { formatPairCheckpointContext, restorePairExecutionState } from ".././pair-checkpoint-session.ts";
import { loadPlan } from "../../../plan-store.js";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/runtime/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AGENTS, SUBAGENTS } from "../../../constants.js";
import { resolvePlanExecutionRuntimeAgent } from "../../workflow/execution-agent.ts";
import { runActiveAgentTurn } from ".././agent-switching.ts";
import { emitSystemStatus, RuntimeEventTypes } from ".././session-runtime-events.js";
import { readPersistedPendingSegmentContinuationEntry } from ".././workflow-context-session.js";
import { readPersistedPendingSegmentContinuationEntry } from ".././workflow-context-session.ts";
import { prepareSessionPlanningWorktree } from "../../workflow/session-planning-worktree.ts";
import { executePlanAction } from "../../workflow/plan-actions.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/segment-rollover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
readPersistedPendingSegmentContinuation,
recordPendingSegmentContinuation,
recordSegmentLineageEvidence,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";
import { readExecutionWorkflowSnapshot } from "./execution-workflow-session.ts";
import type { ActiveExecutionWorkflow } from "../types.js";
import { type TutorialContext, readPersistedTutorialContext } from "./tutorial-context-session.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/segment-rollover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
recordNormalizedWorkflowContext,
recordPendingSegmentContinuation,
recordSegmentLineageEvidence,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";
import { appendExecutionWorkflowSnapshot } from "./execution-workflow-session.ts";
import { recordTutorialContext } from "./tutorial-context-session.ts";
import type { SegmentHandoffPayload } from "../workflow/execution-segment-handoff.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/session-runtime-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const RuntimeEventTypes = Object.freeze({
*/

/**
* @typedef {RuntimeEventBase & { type: "workflow_context_changed", workflowContext: import('./workflow-context-session.js').WorkflowContext }} RuntimeWorkflowContextChangedEvent
* @typedef {RuntimeEventBase & { type: "workflow_context_changed", workflowContext: import('./workflow-context-session.ts').WorkflowContext }} RuntimeWorkflowContextChangedEvent
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/session-transcript-projection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { stat as fsStat } from "node:fs/promises";

import { dirname, resolve } from "node:path";
import { ACTIVE_AGENT_CUSTOM_TYPE, readActiveAgentFromEntry } from "./active-agent-session.ts";
import { readPersistedWorkflowContext } from "./workflow-context-session.js";
import { readPersistedWorkflowContext } from "./workflow-context-session.ts";
import { readPersistedTutorialContext } from "./tutorial-context-session.ts";
import { readPlanAssociations } from "./plan-association.ts";
import { normalizeRuntimeToolResult, normalizeRuntimeUsage, RuntimeEventTypes } from "./session-runtime-events.js";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/session/workflow-context-recovery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WorkflowContext } from "./workflow-context-session.js";
import type { WorkflowContext } from "./workflow-context-session.ts";
import { loadPlanActionEvidence } from "../workflow/plan-actions.ts";

// Legacy transcripts lack accepted progress. Reconcile only confirmed same-Plan delivery,
Expand Down
4 changes: 2 additions & 2 deletions src/shared/session/workflow-context-session.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals } from "../../testing/assertions.ts";
import { test } from "node:test";
import { SessionManager } from "@earendil-works/pi-coding-agent";
import type { WorkflowContext } from "./workflow-context-session.js";
import type { WorkflowContext } from "./workflow-context-session.ts";
import type { WorkflowProgressFact } from "../workflow/workflow-presentation.ts";
import {
deriveWorkflowContextFromExecutionWorkflow,
Expand All @@ -12,7 +12,7 @@ import {
recordWorkflowPlanName,
recordWorkflowTriageContext,
WORKFLOW_CONTEXT_CUSTOM_TYPE,
} from "./workflow-context-session.js";
} from "./workflow-context-session.ts";

interface FixtureWorkflowEntry {
type: "custom";
Expand Down
Loading
Loading