@apilift/cli 1.6.1 → 1.6.2-dev.1793265339.9b9f07579a603faa9531ce2cda53609123c7f248
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.
package/dist/apilift.js
CHANGED
|
@@ -30673,7 +30673,7 @@ function draftTemplate(kind) {
|
|
|
30673
30673
|
""
|
|
30674
30674
|
].join("\n") : "";
|
|
30675
30675
|
const tabGuidance = ["action", "transport"].includes(kind) ? "// capture.tab is a selector returned by browser tabs; it selects the same signed-in Chrome tab for capture and discover run, including connection probes. Leave other sessions' tabs untouched.\n" : "";
|
|
30676
|
-
const captureGuidance = kind === "action" ? '// Public descriptions explain behavior, consequences and limits; do not instruct consumers to repeat runtime proof or browser checks. Author verification is separate from consumer judgment.\n// HTML: response.format="html" requires html.marker and html.fields with observed CSS selectors; extraction is inert and produces JSON before schema validation. Form requests use request.form, excluding body; request.prepare performs one GET and supplies internal {"$prepared":"/path"} values for CSRF and preservation.\n// Declared response.continue rules follow at most five same-origin GET destinations from JSON path or HTML selector/attribute; rejected writes never navigate. Repair with proof-only, never repeat the write.\n// Request JSON/query uses typed {"$input":"name"} bindings; URL segments use {input.name}. Resolve every {unresolved.N} marker from retained evidence before running.\n// App-owned input source annotation: {"x-source":{"action":"ticket.list","path":"/*/id"}}. Run the source explicitly; it never runs implicitly.\n// Keep only invariant protocol values constant; selected app values are inputs, even when public. Generalize one action across its supported choices.\n//
|
|
30676
|
+
const captureGuidance = kind === "action" ? '// effect is read, create, update or delete. Before the first run, build verification.inputs as the smallest advertised call from published sources: omit optional inputs together and exercise caller defaults. A configured author target does not prove an optional prerequisite: require its input or validate stored configuration with request.prepare. Every authored top-level default must match the test; revise unsupported defaults before dispatch. Missing sources are not arbitrary JSON.\n// Public descriptions explain behavior, consequences and limits; do not instruct consumers to repeat runtime proof or browser checks. Author verification is separate from consumer judgment.\n// HTML: response.format="html" requires html.marker and html.fields with observed CSS selectors; extraction is inert and produces JSON before schema validation. Form requests use request.form, excluding body; request.prepare performs one GET and supplies internal {"$prepared":"/path"} values for CSRF and preservation.\n// Declared response.continue rules follow at most five same-origin GET destinations from JSON path or HTML selector/attribute; rejected writes never navigate. Repair with proof-only, never repeat the write.\n// Request JSON/query uses typed {"$input":"name"} bindings; URL segments use {input.name}. Resolve every {unresolved.N} marker from retained evidence before running.\n// App-owned input source annotation: {"x-source":{"action":"ticket.list","path":"/*/id"}}. Run the source explicitly; it never runs implicitly.\n// Keep only invariant protocol values constant; selected app values are inputs, even when public. Generalize one action across its supported choices.\n// Materially different request shapes, conditional prerequisites, closed protocol enum choices and declared format variants need successful evidence or a constrained input schema. Broad date-time includes UTC and offset forms. Optional x-source inputs need presence and omission evidence, or declare them required. Keep app-owned catalog choices dynamic through sources; do not enumerate catalog IDs, all combinations or a second mutation. Constraints appear in consumer help. Use the existing test for the most consequential unresolved choice.\n// Trace the requested consumer path through existing-target lookup, configuration and the result needed next; publish verified prerequisites independently and require the complete path at task completion. Compare related actions by effect and choices, not endpoint.\n// For updates, choose populated non-default unrelated settings before the existing test; compare their before/after values. Already-empty settings cannot prove preservation. If the app resets them, document that observed behavior when authorized; do not claim preservation.\n// Require essential identity/result members in response.schema; leave incidental inferred types provisional and preserve extra observed keys. discover check and publish recheck compatible saved cases locally, including after edits and schema narrowing; do not write a duplicate schema-check script or repeat an app call. Preserve valid empty collections, optional fields, bodyless results and original value types.\n// Declare verification.outcome: {kind,path?,fields?,identity?,states?}. kind is record, collection, lookup, execution or usage. path defaults to the projected output root; fields are relative JSON Pointers. Record reads compare all required result fields and declared fields. Collection requires nonempty entire-collection equality and local empty-result schema acceptance. Use a naturally empty search/filter boundary when reachable; never mutate or enumerate to manufacture one. Local acceptance is not an observed app boundary. Lookup requires a whole positive record or all essentials, plus null/empty object/HTTP 404 absence. Arrays cannot use record.\n// Read verification.expect compares each path with exactly one input, value or independent file/from source; from selects the file subtree. Example entire-collection expectation: [{"path":"","file":"/absolute/independent-tickets.json"}]. Derive expectations from intended inputs, docs/UI or independent saved evidence, never copy actual output as expectation. A mutation record reuses proof.equals without duplicate verification.expect.\n// Execution outcome identity and distinct state/output fields refer to the saved selected proof record. Compare both with proof.equals; states lists allowed observed lifecycle states. A request acknowledgement does not establish actual started/completed execution. Usage fields require independent file-backed expectations; literals, input echoes and the same output do not reconcile actual usage/cost. A raw counter may use record only with honest limits and an explicit actual-cost gap.\n// Reuse saved primary and boundary cases first. Only for a missing read boundary, verification.boundary: {inputs:{query:"no matching ticket"},expect:[{path:"",value:[]}]} permits one automatic read-only probe through this action; status:404 with expect:[] declares an observed missing lookup. Never add a mutation boundary or repeat its write.\n// Local checks never accept semantic review. Accept verification.review only after comparing the promised result, configuration and preservation; review affected descriptions and source/result paths together. Complete the requested consumer path or state its real unresolved gap; never freeze one provider or account scope to conceal missing coverage.\n// A readback through POST requires proof.effect: "read" alongside proof.request; HTTP method alone does not determine semantic effect.\n// JSON object keys may use {input.name}, e.g. {"{input.attribute_id}":{"$input":"value"}}.\n// Discovery-only mutation proof compares a readback path with exactly one input, primary result path or internal JSON value: equals: [{"path":"/ready","value":true}]. Create/update must compare a meaningful body/form value or explicit changed state; URL/selection inputs and returned identity alone do not prove the change. Preserve false, 0, null and objects. Public literals require semantic review; fixed proof expectations are not caller flags.\n// Proof URLs bind returned identifiers with {result./id}; JSON bodies/query use {"$result":"/id"}. Readback pointers may use a complete {input.name} or {result./id} segment for a dynamic key; slashes and tildes in its value are escaped.\n// For one member of a nested array or object map: select: {"path":"/ticket/fields","where":[{"path":"/id","result":"/id"}]}; equals paths then refer to the single matching member. Compare identity and meaningful changed fields, not entire objects.\n// Select an object-map member by its key when values do not contain IDs: select: {path:"/items",key:{result:"/id"}} or key:{input:"item_id"}. Choose key or where, not both.\n// For deletion from an exhaustive array or map: proof.absent: true with select: {path:"/items",where:[{path:"/id",input:"item_id"}],complete:true}. complete:true declares the read exhaustive; never use a partial page. A targeted absence proof without select still requires HTTP 404.\n// For valid readback variants, keep identity equals and add proof.response: {path:"/state",schema:{enum:["ready","empty"]}}, relative to the selected member. Exclude pending states; use proof-only reads after completion.\n// Repair a failed response/proof with discover run --proof-only; it reuses the saved primary response and sends only context checks, remaining navigation reads and readback. Publication still needs a successful test and accepted semantic review.\n// For large collections, investigate native search/filter/detail routes before enumeration. Search saved results locally and inspect only matching records; preserve structured dynamic fields.\n// After selecting a captured request, discover capture auth runs a bounded default search without authField or authScope. Set either only to narrow an observed field or location; browser-managed cookies need no locator.\n' : "";
|
|
30677
30677
|
return `${head}${visibilityGuidance}${probeGuidance}${tabGuidance}${captureGuidance}${JSON.stringify(templates[kind], null, 2)}
|
|
30678
30678
|
`;
|
|
30679
30679
|
}
|
|
@@ -39911,7 +39911,7 @@ function effectiveInputs(schema, explicit, context, noContext) {
|
|
|
39911
39911
|
if (resolvedIssues.length) throw new Error(resolvedIssues.map((issue2) => `${issue2.path.replace("/verification/inputs", "") || "/"} ${issue2.message}`).join("; "));
|
|
39912
39912
|
return { values, sources };
|
|
39913
39913
|
}
|
|
39914
|
-
function bind(value, inputs, generated, output2,
|
|
39914
|
+
function bind(value, inputs, generated, output2, preserveEmptyObject = false, preparedValues) {
|
|
39915
39915
|
if (Array.isArray(value)) return value.map((item) => {
|
|
39916
39916
|
const resolved = bind(item, inputs, generated, output2, true, preparedValues);
|
|
39917
39917
|
if (resolved === omit2) throw new Error("An optional input in an array is missing");
|
|
@@ -39938,7 +39938,7 @@ function bind(value, inputs, generated, output2, insideArray = false, preparedVa
|
|
|
39938
39938
|
target[key] = resolved;
|
|
39939
39939
|
}
|
|
39940
39940
|
}
|
|
39941
|
-
if (!Object.keys(target).length && Object.keys(object7).length && !
|
|
39941
|
+
if (!Object.keys(target).length && Object.keys(object7).length && !preserveEmptyObject) return omit2;
|
|
39942
39942
|
return target;
|
|
39943
39943
|
}
|
|
39944
39944
|
return value;
|
|
@@ -39977,7 +39977,7 @@ function prepareRequest(request2, transport, inputs, generated, output2, prepare
|
|
|
39977
39977
|
if (Array.isArray(value)) for (const item of value) append3(item);
|
|
39978
39978
|
else append3(value);
|
|
39979
39979
|
}
|
|
39980
|
-
const body = request2.body === void 0 ? omit2 : bind(request2.body, inputs, generated, output2,
|
|
39980
|
+
const body = request2.body === void 0 ? omit2 : bind(request2.body, inputs, generated, output2, true, preparedValues);
|
|
39981
39981
|
if (body !== omit2 && request2.form !== void 0) throw new Error("form and JSON body are mutually exclusive");
|
|
39982
39982
|
const contentType = headers.get("content-type");
|
|
39983
39983
|
if (contentType && (request2.body !== void 0 || request2.form !== void 0) && contentType !== (request2.form !== void 0 ? "application/x-www-form-urlencoded" : "application/json")) throw new Error("Content-Type conflicts with declared body encoding");
|
|
@@ -43259,7 +43259,7 @@ ${repairGuidance(reviewed, pending.issues, invocation)}
|
|
|
43259
43259
|
`, stderr: `${proofOnly ? "Checked the saved primary response and executed only its readback" : reusedRead ? "Rechecked the saved primary response locally and checked any missing read boundary" : `Executed the configured ${draft.kind === "transport" ? "probe" : "action"} ${draft.name} and checked its response contract`}.${write ? " Discovery readback passed its declared comparisons; review whether they cover the promised effect and preservation." : ""}
|
|
43260
43260
|
Saved output: ${resultPath}
|
|
43261
43261
|
|
|
43262
|
-
Compare
|
|
43262
|
+
Compare saved output and readback with the promised result and independent evidence. A queued acknowledgement does not prove usable execution; use read-only proof recovery for the promised terminal result. Reuse saved cases with discover check for local repairs.
|
|
43263
43263
|
Edit ${draft.filePath}: set verification.review to accepted only if ${draft.kind === "action" ? "this result confirms the selected behavior, configuration and any promised preservation, and supports its step in the requested consumer path using published sources and usable results" : "this result has the intended meaning"}; otherwise rejected with verification.notes.
|
|
43264
43264
|
${draft.kind === "transport" && draft.baseVersion ? `If this task requires publishing connection changes or renewed verification, publish: ${command4(invocation, "discover publish")}. If you only checked the existing connection, discard this local draft: ${command4(invocation, "discover discard")}.` : `Then publish: ${command4(invocation, "discover publish")}`}
|
|
43265
43265
|
Publication does not repeat the action; browser identity checks may send a read.
|
|
@@ -23,13 +23,13 @@ For every requested action, assess current first-party operation and access docu
|
|
|
23
23
|
|
|
24
24
|
Use `apilift discover draft <kind> [name]` for `app`, `entity`, `transport`, `browser-page`, or `action`. Edit only the private JSONC path returned by a successful selection. Stop dependent steps on every nonzero exit; print the CLI diagnostic without a traceback. In a batch, handle failure at the resource boundary: preserve any selected draft with `discover defer` before continuing only unrelated resources whose dependencies are already published. Report blocked resources together and exit nonzero while any remain unresolved. A failed selection leaves the previous draft selected: do not edit a guessed path or continue with run, review or publication. The file contains the published `definition` and local `dependencies`, `verification`, and `capture` settings. App origin is its primary UI location, not every request destination. Publish missing entity and connection resources before an action that depends on them; a browser connection also needs a published browser page. Keep credential values and recurring local context values out of every definition. Read [operation-contract.md](references/operation-contract.md) before defining an action.
|
|
25
25
|
|
|
26
|
-
`apilift discover run` checks the definition before
|
|
26
|
+
`apilift discover run` checks the definition before dispatch and reports evidence gaps. Use `apilift discover check` to repair response projections or schemas against saved evidence without app requests. Otherwise follow the returned recovery command; do not insert check routinely between a successful run, result review and publication. Configure missing read-boundary inputs before execution; sufficient evidence needs semantic review, not another test. Before the first verification, construct `verification.inputs` from the smallest advertised consumer contract: required inputs and defaults, with optional inputs omitted together. Use published value sources without silently supplied prerequisites. If saved configuration cannot establish a prerequisite, require its input or validate it through the existing `request.prepare`; optional inputs must not permit inert dispatch. Every published top-level caller default must match the existing successful verification value: use that default in the existing test, choose a supported default matching the intended test, or omit the default; documentation alone does not exempt it. Resolve missing configuration sources before accepting review; unexplained JSON is not coverage. For updates, use populated non-default unrelated state and compare before/after evidence for promised preservation. Complete the requested consumer path from target lookup through configuration to usable result; publish verified prerequisites independently.
|
|
27
27
|
|
|
28
|
-
Declare `verification.outcome` before testing an action: `kind` is `record`, `collection`, `lookup`, `execution` or `usage`; `path` selects the result, and `fields` names meaningful fields relative to it. Records compare every required result field and declared outcome field. Collections compare complete typed contents; the CLI checks empty-result schema acceptance locally. For search/filter reads, use one naturally empty query when reachable. Do not mutate data, enumerate targets or block a fixed catalogue merely to obtain an empty case; an unobserved app boundary stays unverified. Lookups need a positive record and an explicit absent result. Execution needs
|
|
28
|
+
Declare `verification.outcome` before testing an action: `kind` is `record`, `collection`, `lookup`, `execution` or `usage`; `path` selects the result, and `fields` names meaningful fields relative to it. Records compare every required result field and declared outcome field. Collections compare complete typed contents; the CLI checks empty-result schema acceptance locally. For search/filter reads, use one naturally empty query when reachable. Do not mutate data, enumerate targets or block a fixed catalogue merely to obtain an empty case; an unobserved app boundary stays unverified. Lookups need a positive record and an explicit absent result. Execution needs read-only proof of the promised usable terminal result: `identity` plus distinct observed state or output `fields`; `states`, when supplied, lists allowed observed lifecycle states. Usage compares each declared field with independent saved JSON evidence. Read [operation-contract.md](references/operation-contract.md) for exact comparison and boundary rules. Mutation record outcomes reuse `proof.equals`; do not duplicate those comparisons in `verification.expect`.
|
|
29
29
|
|
|
30
|
-
Before the first mutation, choose
|
|
30
|
+
Before the first mutation, choose that existing case for the most consequential uncertainty; restrict unsupported branches its evidence will not cover. Materially different request shapes or prerequisites, closed protocol enum choices and declared format variants need successful evidence or a constrained input schema. Optional app-owned source inputs need presence and omission evidence, or a required-input recipe. One successful expression may witness reusable constructor choices at different nested positions; do not repeat each choice at each depth. Root structural alternatives still need a root witness or schema constraint. Do not test every scalar value or catalog entry, all combinations, or a second mutation. Keep app-owned choices dynamic through published sources; never freeze scope identifiers or one provider into a supposedly general action. Reuse compatible saved cases across edits and schema narrowing. For a missing read boundary only, `verification.boundary: {inputs:{...},expect:[...]}` permits one automatic probe through the same action; add `status:404` for an observed missing-record response. Boundary probes are read-only. A constrained schema changes consumer help automatically; complete the requested scope or state the real unresolved gap.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Do not try undocumented update fields to rescue preservation; investigate docs or UI first and declare observed replacement behavior only if scope permits. Keep essential result fields required and strict, and incidental inferred types provisional; preserve the extra observed keys and documented or observed legitimate variants. Local checks reuse saved evidence without app requests and never accept semantic review. Accept `verification.review` only after an explicit expected-versus-actual comparison of saved output and mutation readback against the selected behavior and configuration, using official documentation or independently observed app state. HTTP acceptance and validation against the action’s own schema do not establish semantic success. For a mutation, assess its separate readback proof and never repeat the write merely to improve evidence. Use documented state values and observed readback paths in proof comparisons. A queued acknowledgement is insufficient; use read-only proof recovery without changing the expectation merely to pass. After repairing a failed response or proof, `apilift discover run --proof-only` checks saved evidence and sends only context checks, remaining declared navigation reads and readback. A connection instead selects `verification.probeOrigin`; metadata resources need no app execution. `apilift discover publish` publishes the exact selected version after its gates; a configured browser identity check revalidates the account through a read.
|
|
33
33
|
|
|
34
34
|
## Recover and finish
|
|
35
35
|
|
|
@@ -6,33 +6,35 @@ An action's published `definition` describes its effect, JSON Schema `inputs`, r
|
|
|
6
6
|
|
|
7
7
|
Public action names and descriptions state actual behavior, consequences and limits. Review the affected actions and dependencies together: source and result instructions must match consumer-visible paths, app/entity prose must distinguish domain capabilities from available coverage, and transport instructions must describe supported access requirements. Author verification establishes publication evidence; published execution validates the response without automatic readback. Consumers decide whether their task needs state confirmation through a published read; do not prescribe routine browser inspection.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Inputs and response fields need semantic descriptions; caller inputs need synthetic examples. App-owned values need published source actions with compatible selected result paths. Consumers explicitly run sources and supply values. Prose-only dependencies, context-variable resources and verification values are not sources. Per-app scalar `context` defaults are a consumer convenience with exact input-name matching, not an action contract or account model. Ambiguous generic names are passed explicitly.
|
|
10
10
|
|
|
11
11
|
Select the useful response subtree with `response.path` when needed and validate it with `response.schema`; projected fields use paths relative to the selected subtree or array member. Mark every essential identity, result container and meaningful result field as `required`, and keep relationship fields needed downstream. Incidental types inferred from one capture are provisional. Preserve extra observed keys and documented or observed legitimate variants, empty collections, optional fields, nullable values, dynamic maps and bodyless responses; do not require every observed field. Repair mismatches from documentation or saved evidence, keeping essential fields strict; do not drop structure or replace the contract with a broad weak schema merely to pass. Reuse intact saved evidence for local checks without another app request. Local schema checks do not establish semantic success.
|
|
12
12
|
|
|
13
|
-
Before the
|
|
13
|
+
Before the first verification, construct `verification.inputs` from the smallest advertised consumer contract: required inputs and defaults, with optional inputs omitted together. Use published sources without silently supplied prerequisites. If saved configuration cannot establish a prerequisite, require its input or validate it through the existing `request.prepare`; optional inputs must not permit inert dispatch. For updates, save populated non-default unrelated state and before/after evidence for promised preservation.
|
|
14
|
+
|
|
15
|
+
Before the action test, declare `verification.outcome: {kind,path?,fields?,identity?,states?}` for the promised result. `path` defaults to the projected output root; `fields` are JSON Pointers relative to that path. For `execution`, those pointers select the saved proof record after readback projection and selection. Publication checks this declaration against compatible saved cases; it supplies no evidence.
|
|
14
16
|
|
|
15
17
|
- `record`: compare every required result field and every declared outcome field. An identity-only comparison cannot verify a richer required record. Arrays require collection semantics. A mutation record reuses `proof.equals` without duplicate `verification.expect` comparisons.
|
|
16
18
|
- `collection`: save a nonempty case with explicit entire-collection equality. The CLI checks empty-result schema acceptance locally; this does not claim an observed upstream empty response. Use one naturally empty query for search/filter reads when reachable. Do not mutate data, enumerate targets or block a fixed catalogue to manufacture empty evidence. Compare stable keys and typed data, not only returned identifiers or a count. Arrays and object maps are supported.
|
|
17
19
|
- `lookup`: save a positive record, comparing the whole record or every essential field, and an explicit missing result: `null`, an empty object or observed HTTP 404. Identity-only positive evidence is insufficient when other essential fields are required.
|
|
18
|
-
- `execution`: declare `identity` and at least one distinct actual state or output field in `fields`; require saved readback and `proof.equals` comparisons for both. Use `states` for allowed observed lifecycle states. Verify
|
|
20
|
+
- `execution`: declare `identity` and at least one distinct actual state or output field in `fields`; require saved readback and `proof.equals` comparisons for both. Use `states` for allowed observed lifecycle states. Verify the promised usable terminal result through read-only proof; a request acknowledgement does not establish execution success. Do not infer state semantics from a field name.
|
|
19
21
|
- `usage`: declare the fields to reconcile and compare each with independent saved JSON evidence. Literals, input echoes and the same saved output do not reconcile actual usage or cost. If reconciliation is unavailable, publish a raw counter only as a `record` with clear limits, and report the actual-cost gap.
|
|
20
22
|
|
|
21
23
|
For read cases, `verification.expect` compares saved output with exactly one expected source: input, literal value or independent saved JSON file. Each `path` selects saved output; `from` selects a file subtree and defaults to its root. For example, a complete ticket collection can use `[{path:"",file:"/absolute/independent-tickets.json"}]`; a record can compare both `[{path:"/id",input:"ticket_id"},{path:"/active",value:false}]`. Derive expectations from the intended outcome, documentation, UI or independent evidence, never by copying the actual response. Mutation record `proof.equals` comparisons supply their existing proof; do not duplicate them. Run, local check and publication use the same applicable definition and saved-evidence checks. Local check and publication check expectations locally without app calls; their success does not accept semantic review. Use `discover check` after local response projection or schema repairs; it rechecks the retained raw response and current expectations without another app request. Otherwise follow the returned recovery command, not a routine check step. Stop dependent commands after failure; apply the skill’s resource-level batch recovery without tracebacks or false success.
|
|
22
24
|
|
|
23
25
|
Reuse the existing primary case and compatible saved evidence before adding a read. If only the collection-empty or lookup-missing boundary is absent, `verification.boundary: {inputs:{query:"no matching ticket"},expect:[{path:"",value:[]}]}` permits one automatic read-only probe through the same action. For an observed missing-record response, declare `status:404` with its boundary inputs and `expect:[]`; the saved HTTP status supplies absence evidence. Do not add boundary probes to mutations. Boundary evidence supplements the primary result; it does not replace nonempty collection or positive lookup evidence. Successful cases remain available across edits and schema narrowing when their request and effective inputs remain compatible; local gates recheck the current contract without repeating app calls.
|
|
24
26
|
|
|
25
|
-
During discovery, a mutation needs a separate read-only proof request and meaningful comparisons to the intended state. A create must compare a meaningful created value, and an update must compare a requested body or form value or an explicit changed state. Selector inputs used in the URL or proof selection and returned-identity checks alone do not prove the change; preserve `false`, `0`, `null` and structured values in comparisons. An update changes only requested settings: omitted values preserve existing state unless the contract explicitly describes replacement or reset semantics.
|
|
27
|
+
During discovery, a mutation needs a separate read-only proof request and meaningful comparisons to the intended state. A create must compare a meaningful created value, and an update must compare a requested body or form value or an explicit changed state. Selector inputs used in the URL or proof selection and returned-identity checks alone do not prove the change; preserve `false`, `0`, `null` and structured values in comparisons. An update changes only requested settings: omitted values preserve existing state unless the contract explicitly describes replacement or reset semantics. Compare the readback for the intended change and preservation of settings the request could overwrite; preservation claims must match the saved before/after evidence. Full replacement requires a consumer-accessible complete state; do not copy create defaults or unrelated empty objects into a narrow update. Do not try undocumented update fields to rescue preservation; investigate docs or UI first and declare observed replacement behavior only if scope permits. A proof failure leaves the write possibly applied. Repair the proof and use `apilift discover run --proof-only` against the saved primary response; this sends only context checks, remaining declared navigation reads and readback. Never repeat a possibly sent write just to get stronger proof. For a delete, an explicit absence proof may establish success. A readback or probe using POST may declare semantic `effect: "read"`; method alone is not the effect.
|
|
26
28
|
|
|
27
29
|
Bind a returned identifier in the proof URL with `{result./id}`, or in its JSON body/query with `{"$result":"/id"}`; result pointers refer to the projected primary result. For a nested array or object map, use `proof.select: {"path":"/ticket/fields","where":[{"path":"/id","result":"/id"}]}` and compare `equals` paths relative to its single matching member. The selector must match exactly one item. If a map stores identity only in its keys, use `select: {"path":"/items","key":{"result":"/id"}}` or `key: {"input":"item_id"}` instead of `where`; select by exactly one of key or member-field conditions. Check identity and the fields that establish the intended effect, not an entire server-maintained object or a fixed array position. For a dynamic object key, use `{"attributes":{"{input.attribute_id}":{"$input":"value"}}}` in the request body. A proof path such as `/attributes/{input.attribute_id}` or `/attributes/{result./id}` substitutes one complete pointer segment and escapes `/` and `~` in its value; other pointer segments remain literal. For deletion from an exhaustive array or map, use `absent: true` with `select: {"path":"/items","where":[{"path":"/id","input":"item_id"}],"complete":true}`. The selector may use `key` instead of `where` when only map keys carry identity. This requires zero matches in a successful read; missing collections or member identity fields fail. `complete: true` is the author’s declaration that the read is exhaustive, never a partial page. A targeted absence proof without a selector still requires HTTP 404. Prefer a targeted detail or search read; absence from a partial list does not prove deletion.
|
|
28
30
|
|
|
29
31
|
When the task needs a few records from a large collection, look for native search, filters or a detail endpoint in documentation or observed UI requests before enumerating the list. Expose observed parameters and verify that they narrow the results. If only a full response is available, search its saved file and extract matching records or fields; do not load the entire catalog into context. Keep stable identity and summary fields in list results; inspect variable configuration only for the selected item. Preserve dynamic configuration as structured JSON with an appropriate schema, rather than enumerating catalog entries or removing validation to pass.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
Trace the requested consumer path: locate the target, obtain its configuration, perform the operation and obtain its usable result. Publish each prerequisite when its own contract is usable and verified; require the complete path at task completion, not before publishing every source action. Resolve missing dependencies before claiming coverage; a successful isolated action is insufficient. Every published top-level caller default must match the existing successful verification value. Before running, use that default in the existing test, choose a supported default matching the intended test, or omit the default; documentation alone does not exempt it.
|
|
32
34
|
|
|
33
35
|
Materially different request shapes or prerequisites need successful saved evidence or a constrained input schema. Documentation can explain a branch, but does not substitute for its successful evidence. Before the first mutation, choose the existing verification for the most consequential uncertainty and constrain branches without compatible evidence; changing only a label does not test generalization. Each closed protocol enum choice needs a successful witness or removal from the supported enum. App-owned catalog choices stay dynamic through their published `x-source`; do not enumerate those values or freeze observed identifiers. Optional source inputs and conditional prerequisites need presence and omission evidence, or a required-input recipe matching the verified behavior. Declared format variants need evidence or an explicit constraint, including UTC and offset forms for broad `date-time` inputs. Do not test every scalar value or catalog entry, all combinations, or a second mutation. Constrain unsupported branches using the input schema, so consumer help exposes the restriction automatically. Do not hard-code one provider or a scope identifier to conceal an incomplete requested path; complete required scope or state the real unresolved gap.
|
|
34
36
|
|
|
35
|
-
Before accepting `verification.review`, explicitly compare expected behavior and configuration with actual saved output, mutation readback or an independent documented or observed source; otherwise reject it with notes. HTTP acceptance, an echoed input and validation against the action’s own schema do not establish semantic success. The
|
|
37
|
+
Before accepting `verification.review`, explicitly compare expected behavior and configuration with actual saved output, mutation readback or an independent documented or observed source; otherwise reject it with notes. HTTP acceptance, an echoed input and validation against the action’s own schema do not establish semantic success. The contract defines supported choices; another successful example alone does not prove them all. After publication, inspect `actions show` as a fresh consumer and finish the originally authorized outcome. Do not send a second mutation merely to test publication.
|
|
36
38
|
|
|
37
39
|
A genuinely terminal, command-scoped unavailable boundary may be documented only with evidence. Authentication, account tier, local transport, missing permission and ambiguous UI are retryable or user-specific blockers, not proof of app-wide absence. Keep existing working actions intact and defer unresolved work.
|
|
38
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apilift/cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2-dev.1793265339.9b9f07579a603faa9531ce2cda53609123c7f248",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=24.16.0 <27"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "9b9f07579a603faa9531ce2cda53609123c7f248",
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
43
|
"url": "git+https://github.com/egor-sergeev/apilift.git",
|