OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

jobs.cancel

Cancel a pending job.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.jobs
  • Tags: jobs, cancel
  • File: packages/libs/jobs/src/contracts/index.ts
  • field.key.label
    jobs.cancel
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    jobs.cancel
    field.description.label

    Cancel a pending job.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.jobs
  • Tags: jobs, cancel
  • File: packages/libs/jobs/src/contracts/index.ts
  • field.tags.label
    jobs,cancel
    field.owners.label
    platform.jobs
    field.stability.label
    stable

    Cancel a pending job.

    Goal

    Allow cancellation of jobs that are no longer needed.

    Context

    Only pending jobs can be cancelled.

    Emitted Events

    `job.cancelled` (v1.0.0)

    Source Definition

    import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    
    export const CancelJobContract = defineCommand({
    	meta: {
    		key: 'jobs.cancel',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['platform.jobs'],
    		tags: ['jobs', 'cancel'],
    		description: 'Cancel a pending job.',
    		goal: 'Allow cancellation of jobs that are no longer needed.',
    		context: 'Only pending jobs can be cancelled.',
    	},
    	io: {
    		input: CancelJobInput,
    		output: CancelJobOutput,
    		errors: {
    			JOB_NOT_FOUND: {
    				description: 'Job does not exist',
    				http: 404,
    				gqlCode: 'JOB_NOT_FOUND',
    				when: 'Job ID is invalid',
    			},
    			JOB_NOT_PENDING: {
    				description: 'Job is not in pending state',
    				http: 409,
    				gqlCode: 'JOB_NOT_PENDING',
    				when: 'Job has already started or completed',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    	sideEffects: {
    		emits: [
    			{
    				key: 'job.cancelled',
    				version: '1.0.0',
    				when: 'Job is cancelled',
    				payload: JobCancelledPayload,
    			},
    		],
    	},
    });