@akagilnc/pi-workflow-roles 0.1.5679 → 0.1.5698

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ import { readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:
21
21
  import { basename, join } from "node:path";
22
22
 
23
23
  import { sessionFileOf } from "./role-run-placement.ts";
24
+ import { projectRenderedPagePaths } from "./role-run-path-rewrite.ts";
24
25
  import { RUN_CURRENT_FILE, RUN_HISTORY_FILE, RUN_LOG_FILE, RUN_STATE_FILE, OFFICER_POINTER_RECORD_KIND } from "./run-dossier-files.ts";
25
26
  import { appendSitianRecord } from "./sitian-appender.ts";
26
27
  import { parseSitianRecordText } from "./sitian-reader.ts";
@@ -176,7 +177,16 @@ function render(
176
177
  const whole: Record<string, unknown> = {};
177
178
  for (const section of ["invocation", "admitted", "runState", "terminal"] as const) {
178
179
  const page = lastPayloadOfKind(state, PAGE_ROW_KIND[section]);
179
- if (page !== undefined) whole[section] = page;
180
+ if (page === undefined) continue;
181
+ // #1183: location fields track the directory being rendered; fact rows stay put.
182
+ if (
183
+ (section === "invocation" || section === "admitted" || section === "runState")
184
+ && isRecord(page)
185
+ ) {
186
+ whole[section] = projectRenderedPagePaths(page, runDirectory);
187
+ } else {
188
+ whole[section] = page;
189
+ }
180
190
  }
181
191
  let latest: Record<string, unknown> | undefined;
182
192
  for (const row of history) {
@@ -29,6 +29,7 @@ export function createSessionIdentityAuthority(
29
29
  const runDirectoryOf = (principal: DurablePrincipal): string =>
30
30
  dirname(authority.decode(principal).sessionDirectory);
31
31
  return {
32
+ principalAuthority: authority,
32
33
  resolveSessionFile(principal) {
33
34
  return authority.decode(principal).sessionFile;
34
35
  },
@@ -19,7 +19,9 @@ import { findRunDirectoryById } from "./public-cli/run-lifecycle.ts";
19
19
  import type { TerminalRoleName } from "./public-cli/terminal.ts";
20
20
  import { isCorrectableExecuteError } from "./submission-correctable-error.ts";
21
21
  import { failOnInfrastructureFailureDeclaration, infrastructureFailureDiagnostic } from "./package-contracts/terminating-infrastructure.ts";
22
+ import { reportTicketFromHostContext } from "./report-ticket-tool.ts";
22
23
  import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "./review-submission.ts";
24
+ import { readDeclaredTicketNumber } from "./run-ticket-number.ts";
23
25
 
24
26
  import { isRecord, errorText } from "./unknown-value.ts";
25
27
 
@@ -554,6 +556,15 @@ export function createSubmissionLedgerHost(
554
556
  host.registerTool({
555
557
  ...tool,
556
558
  async execute(toolCallId, params, signal, update, context): Promise<HostToolResult<unknown>> {
559
+ // #1183: valid typed ticket on the submission is identity acquisition —
560
+ // bind/relocate once here, before reask / ledger restore / seal outcomes.
561
+ // Host return must not be the first placement (dossier-topology).
562
+ const typedTicket = isRecord(params)
563
+ ? readDeclaredTicketNumber(params.ticketNumber)
564
+ : undefined;
565
+ if (typedTicket !== undefined) {
566
+ await reportTicketFromHostContext(context, typedTicket);
567
+ }
557
568
  const runId = runIdentity(context);
558
569
  const attemptId = attemptIdentity(context, runId);
559
570
  const state = await stateFor(context, runId);