Diff two spec revisions
Code Mode: praxis.workforce.specs.retrieveDiff
HTTP: GET /workforce/v1/specs/{kind}/{id}/diff
Compares two revisions of one subject’s spec and lists the changes between them, each with its path and, for a change, the value before and after; revision 0 is the empty spec, so diffing 0 against 1 shows the first write. Read-only. Errors: 400 INVALID_PARAMS when from or to is missing or not an integer; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist, or SPEC_REVISION_NOT_FOUND when from or to was never written. Example: GET /workforce/v1/specs/job/jpr_123/diff?from=1&to=2.
Signature
praxis.workforce.specs.retrieveDiff(args:{path:{kind:"organization"|"department"|"level"|"job"|"position"|"assignment";id:string};query:{from:number;to:number}}):Promise<{kind:"organization"|"department"|"level"|"job"|"position"|"assignment";/** The subject's own id (org_..., dept_..., lvl_..., jpr_..., pos_... */ id:string;/** The earlier revision that was compared from; 0 is the empty spec before the first write. */ from:number;/** The later revision that was compared to. */ to:number;/** The differences found, in path order. */ changes:Array<{/** Full path of the changed value inside the envelope, such as spec.document, spec.provision.agent.model or spec.provision.repositories[github:org/repo]. */ path:string;/** What happened at this path between the two revisions. */ op:"added"|"removed"|"changed";/** The value at this path in the earlier revision, verbatim; absent when the value was added. */ before?:unknown;/** The value at this path in the later revision, verbatim; absent when the value was removed. */ after?:unknown}>}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kind | path | “organization” | “department” | “level” | “job” | “position” | “assignment” | yes | Kind of the subject whose revisions to compare. |
| id | path | string | yes | The subject’s own id (org_…, dept_…, lvl_…, jpr_…, pos_… or asg_…). |
| from | query | number | yes | The earlier revision to compare from; 0 is the empty spec before the first write. |
| to | query | number | yes | The later revision to compare to. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | The changes between the two revisions, in path order. |
| 400 | application/problem+json | INVALID_PARAMS; from or to is missing or not an integer. Send both as whole numbers. |
| 401 | Missing or invalid credential; provide a valid organization API key or sign in to the Console. | |
| 403 | application/problem+json | PERMISSION_DENIED; a run or computer token, or a session token that names no agent, is refused. Call with an organization API key, a Console session, or the agent’s own session token. |
| 404 | application/problem+json | The subject is not in your organization, or from or to has no stored revision (SPEC_REVISION_NOT_FOUND). List the revision history and copy a revision it returns. |