Skip to content

EPILIBS-211: Task create contract — payload.target, failSafeTermination type, privilege docs#167

Open
mpqmpqm wants to merge 1 commit into
masterfrom
EPILIBS-211
Open

EPILIBS-211: Task create contract — payload.target, failSafeTermination type, privilege docs#167
mpqmpqm wants to merge 1 commit into
masterfrom
EPILIBS-211

Conversation

@mpqmpqm

@mpqmpqm mpqmpqm commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

Contract catch-ups in taskAdapter (EPILIBS-211):

  1. payload.target ('APPLICATION' | 'PROXY', EPICENTER-6729) typed on create and both HTTP payload views (read view echoes lowercase). Previously it only worked by sneaking through the payload spread; TypeScript callers had to pre-declare objects to dodge excess-property checking.
  2. failSafeTermination: numberstring (ISO-8601) — the wire format the server consumes and echoes, and what the docstring already claimed. Callers today carry toISOString() as unknown as number casts.
  3. Privilege docs: every method said "requires support level authentication"; the Task API resource is @Facilitator-gated end to end. The old wording pushes integrators toward unnecessary shared-secret proxy plumbing. Also documented that payload.url is relative and how the runner builds the fire URL ({host}{targetPath}/{account}/{project}{url}).

Verification

  • npm run test:run: 1001 passed, including new specs asserting target passes through to the request body (and is absent when omitted); optionals spec now sends an ISO-8601 failSafeTermination.
  • npm run type-check clean.
  • Live: built dist/cjs, created a task on epicenter-sandbox-1 with target: 'PROXY' and an ISO failSafeTermination using a facilitator session — server echoed target: 'proxy' and the ISO timestamp; probe task destroyed afterward.

Notes

failSafeTermination: number → string is a type-level break for TS callers who passed epoch millis; the ISO string is the only wire format we have verified working against the live API.

🤖 Generated with Claude Code

- payload.target ('APPLICATION' | 'PROXY', EPICENTER-6729) is now typed on
  create and on the read view (lowercase echo); previously it only passed
  through the payload spread, forcing TS callers to dodge excess-property
  checks.
- failSafeTermination typed string (ISO-8601) to match the wire format the
  server consumes and echoes; it was typed number while the docs already
  said ISO-8601.
- Docstrings said 'requires support level authentication'; the Task API is
  facilitator-gated. Also documented how the runner constructs the fire URL
  from the relative payload.url and target.

Verified against epicenter-sandbox-1: created a task with target 'PROXY'
and an ISO failSafeTermination via the built lib, both echoed correctly.

EPILIBS-211

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an optional target field to HTTP task payloads, allowing tasks to target either the application or a proxy server. It also updates the documentation to reflect that task operations require facilitator privileges, changes the failSafeTermination option type from a number to an ISO string, and adds corresponding unit tests. The review feedback recommends allowing both uppercase and lowercase values for the input target types to prevent TypeScript compilation errors when developers attempt to reuse or round-trip retrieved payloads.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/adapters/task.ts
objectType: 'http';
method: string;
url: string;
target?: 'APPLICATION' | 'PROXY';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the read view (HttpTaskPayloadReadOutView) returns lowercase values ('application' | 'proxy'), typing the input strictly as uppercase ('APPLICATION' | 'PROXY') will cause TypeScript compilation errors when developers attempt to round-trip or reuse a retrieved payload. To improve developer experience and allow flexibility, consider allowing both uppercase and lowercase values in the input types.

Suggested change
target?: 'APPLICATION' | 'PROXY';
target?: 'APPLICATION' | 'PROXY' | 'application' | 'proxy';

Comment thread src/adapters/task.ts
payload: {
method: string;
url: string;
target?: 'APPLICATION' | 'PROXY';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the read view (HttpTaskPayloadReadOutView) returns lowercase values ('application' | 'proxy'), typing the input strictly as uppercase ('APPLICATION' | 'PROXY') will cause TypeScript compilation errors when developers attempt to round-trip or reuse a retrieved payload. To improve developer experience and allow flexibility, consider allowing both uppercase and lowercase values in the input types.

Suggested change
target?: 'APPLICATION' | 'PROXY';
target?: 'APPLICATION' | 'PROXY' | 'application' | 'proxy';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant