Anthropic CCA-F Practice Test 45
Question 440
A document contains multiple invoices, each with line items and tax, but the output schema is a flat string. What should change?
- Represent all invoice rows, taxes and identifiers as a single untyped text field
- Model the nested invoice and line-item relationships explicitly in JSON Schema
- Run a domain-level evaluation of the underlying classification criteria
- Represent refusal or failure status explicitly and validate the extraction schema only for successful outputs
Explanation
Correct Answer
B:The output structure should match the data relationships. Flattening complex documents loses associations between quantities, prices and invoices. Use nested invoice objects with arrays of line items and appropriately typed tax and amount fields. A flat string loses the relationships needed to reconcile individual invoices.
Incorrect Answers
A:Flattening nested transactions into one opaque string removes the relationships that consumers must validate. A nested item schema preserves per-invoice identity, line items and calculations.
C:Syntactic validity is not factual or semantic validity. That addresses a different part of the system, not the requirement to preserve nested record relationships in structured output.
D:Failure-status variants handle refusals or exceptions; they do not represent two invoices with separate line items and taxes in one document. Define nested invoice objects and arrays in JSON Schema so amounts and records retain their parent-child relationships.
Question 441
A client expects currency_code but a new schema emits money_unit without a migration plan. What protects integrations?
- Rename the output field immediately and assume every existing client will recognize the new key
- Represent refusal or failure status explicitly and validate the extraction schema only for successful outputs
- Run a domain-level evaluation of the underlying classification criteria
- Version the output schema and coordinate compatibility updates with clients
Explanation
Correct Answer
D:Schema changes are interface changes. A parseable new payload can still break dependent systems if field names shift unexpectedly. Coordinate schema versions and client compatibility rather than silently renaming currency_code to money_unit. The consumer must know exactly which field and currency semantics a given version uses.
Incorrect Answers
A:Renaming currency_code to money_unit without compatibility planning will break clients that still look for the original key. Coordinate a schema version or transitional alias with consumers; a valid new field name is not evidence that deployed clients understand it.
B:A refusal/success envelope distinguishes operation outcomes, but the failure here is an unannounced renamed field in otherwise successful results. Version the schema and provide compatibility or migration guidance so existing currency_code consumers do not fail.
C:Syntactic validity is not factual or semantic validity. This capability does not directly manage typed-output schema migrations safely. A classification evaluation does not repair clients expecting the previous currency_code field. Versioned compatibility and migration are required for the changed output contract.
Question 442
A tool defines invoice_total as a free-form sentence rather than a numeric amount. What schema choice improves reliability?
- Continue accepting arbitrary prose for invoice_total when downstream systems expect a numeric amount
- Constrain severity to an enumerated set and verify the selected value
- Use a numeric field with explicit currency semantics and input validation
- Disallow unexpected object properties where the interface requires an exact shape
Explanation
Correct Answer
C:An invoice total must be represented as a value the consumer can calculate with and validate, not as a free-form explanation. Declare a numeric amount in the supported tool or output schema, specify the currency representation and apply business checks for range and reconciliation. A valid JSON string containing a sentence is still the wrong data type for downstream financial arithmetic, and schema validation should reject it.
Incorrect Answers
A:An arbitrary prose value for invoice_total cannot be reliably summed, validated or compared with line items. Use a numeric amount with explicit currency and units and reject nonnumeric strings before loading financial records.
B:Severity enums standardize qualitative classifications, not monetary totals. invoice_total must be numeric with currency and unit semantics so arithmetic and business rules can run; an enum would turn an amount into an unsupported categorical label.
D:Disallowing unexpected JSON object keys tightens an interface, but leaves invoice_total defined as free-form prose. Specify the field's numeric type, currency and allowed units so downstream calculations can validate it instead of merely rejecting unrelated properties.
Question 443
An extractor invents extra undocumented fields that downstream parsers ignore silently. How can the schema be tightened?
- Run a domain-level evaluation of the underlying classification criteria
- Constrain severity to an enumerated set and verify the selected value
- Define findings as an array of typed objects with required fields
- Disallow unexpected object properties where the interface requires an exact shape
Explanation
Correct Answer
D:Strict schemas prevent unreviewed expansion and accidental drift. They do not solve missing source evidence, so semantic checks remain separate. Set additionalProperties constraints where the interface truly requires a closed object shape. Otherwise undocumented fields may be ignored without alerting the publisher or downstream consumer to a contract change.
Incorrect Answers
A:A domain-level classification check can detect semantically incorrect labels, but the reported issue is extra output keys silently ignored by consumers. Tighten the JSON Schema to prohibit unexpected properties where exact shape is required, then reject nonconforming results.
B:Enums prevent arbitrary category vocabulary. That addresses a different part of the system, not the requirement to keep machine output within the approved field contract.
C:Explicit nested item structure lets a downstream consumer check every extracted line item for required fields, types and allowable values. The required action is “Disallow unexpected object properties where the interface requires an exact shape”; the other measure addresses a separate concern. Otherwise undocumented fields may be ignored without alerting the publisher or downstream consumer to a contract change.
Question 444
A downstream service requires a defined JSON object rather than descriptive prose. Which structured-output constraint should be added?
- Allow a documented nullable date while retaining required record identity
- Use schema-constrained structured output and validate the returned object
- Define an enum containing the allowed business statuses
- Declare an integer parameter in the tool schema and validate the call
Explanation
Correct Answer
B:A typed output contract helps reject invalid fields and missing required properties. For this situation, the system should use schema-constrained structured output and validate the returned object. The factual trigger is a downstream service requires a defined JSON object rather than descriptive prose. Validate schema shape and business meaning separately at the consuming boundary.
Incorrect Answers
A:Nullable fields distinguish genuine absence from failed extraction or invented dates. Here, a downstream service requires a defined JSON object rather than descriptive prose. Use schema-constrained structured output and validate the returned object. A typed output contract helps reject invalid fields and missing required properties.
C:Finite state values prevent consumer failures caused by arbitrary label variants. The direct remedy is “Use schema-constrained structured output and validate the returned object”, which the alternative does not itself accomplish. A typed output contract helps reject invalid fields and missing required properties.
D:Type validation catches incompatible values before a side effect or calculation. Here, a downstream service requires a defined JSON object rather than descriptive prose. Use schema-constrained structured output and validate the returned object. A typed output contract helps reject invalid fields and missing required properties.
Question 445
A record has a legitimately unknown date but schema requires a nonempty date string. What schema requirement should the consumer enforce?
- Define an enum containing the allowed business statuses
- Declare an integer parameter in the tool schema and validate the call
- Allow a documented nullable date while retaining required record identity
- Apply domain validation in addition to syntactic schema checking
Explanation
Correct Answer
C:When a record has a legitimately unknown date but schema requires a nonempty date string, the system should allow a documented nullable date while retaining required record identity. Nullable fields distinguish genuine absence from failed extraction or invented dates. A syntactically valid object can still contain the wrong account, date or enum value.
Incorrect Answers
A:Finite state values prevent consumer failures caused by arbitrary label variants. This is not a substitute for “Allow a documented nullable date while retaining required record identity”; that control is necessary in the stated circumstances. Nullable fields distinguish genuine absence from failed extraction or invented dates.
B:Type validation catches incompatible values before a side effect or calculation. Here, a record has a legitimately unknown date but schema requires a nonempty date string. Allow a documented nullable date while retaining required record identity. Nullable fields distinguish genuine absence from failed extraction or invented dates.
D:JSON correctness alone cannot certify that business references actually exist. The direct remedy is “Allow a documented nullable date while retaining required record identity”, which the alternative does not itself accomplish. Nullable fields distinguish genuine absence from failed extraction or invented dates.
Question 446
An output includes a status field with unrestricted free text. How should the output contract be restricted?
- Declare an integer parameter in the tool schema and validate the call
- Apply domain validation in addition to syntactic schema checking
- Model missing data explicitly using null or a documented exception state
- Define an enum containing the allowed business statuses
Explanation
Correct Answer
D:Declare a schema enum listing the allowed business status values instead of an unrestricted text field. Validate the returned value and business meaning at the consuming boundary; schema compliance does not establish that the chosen status is factually correct. Anthropic documents a narrow enum-capitalization caveat, so avoid statuses distinguished only by lettercase and normalize or reject unrecognized variants explicitly.
Incorrect Answers
A:An integer-typed tool parameter may be valid for quantities, but it does not restrict a string status to the supported business states. For this output contract, define an enum of named statuses, then validate what the response actually contains. Replacing free text with an unrelated integer merely changes the type of an uncontrolled field.
B:Business-domain validation is still needed to decide whether a status is justified by the underlying record, but that post-processing alone does not tell Claude which status words the output contract permits. First restrict the field using a schema enum, then verify the returned status against evidence and the consumer’s allowed transitions.
C:A null value or documented exception state can represent missing information; neither approach by itself stops arbitrary non-null strings such as maybe_done. The stated problem is uncontrolled status vocabulary, so enumerate the allowed business statuses in the schema. Handle missing values separately only when the domain genuinely permits them.
Question 447
A tool invocation requires an integer quantity but the model emits 'three'. Which structured-output constraint should be added?
- Declare an integer parameter in the tool schema and validate the call
- Apply domain validation in addition to syntactic schema checking
- Model missing data explicitly using null or a documented exception state
- Constrain item structure and required evidence fields with JSON Schema
Explanation
Correct Answer
A:The relevant control is to declare an integer parameter in the tool schema and validate the call. Type validation catches incompatible values before a side effect or calculation. This matters when a tool invocation requires an integer quantity but the model emits 'three'. A syntactically valid object can still contain the wrong account, date or enum value.
Incorrect Answers
B:JSON correctness alone cannot certify that business references actually exist. The required action is “Declare an integer parameter in the tool schema and validate the call”; the other measure addresses a separate concern. Type validation catches incompatible values before a side effect or calculation.
C:A schema should represent reality rather than forcing fabricated required values. This is not a substitute for “Declare an integer parameter in the tool schema and validate the call”; that control is necessary in the stated circumstances. Type validation catches incompatible values before a side effect or calculation.
D:Nested validation prevents malformed provenance elements from reaching downstream systems. Here, a tool invocation requires an integer quantity but the model emits 'three'. Declare an integer parameter in the tool schema and validate the call. Type validation catches incompatible values before a side effect or calculation.
Question 448
A structured response has valid JSON syntax but references an invalid account ID. What schema requirement should the consumer enforce?
- Model missing data explicitly using null or a documented exception state
- Apply domain validation in addition to syntactic schema checking
- Constrain item structure and required evidence fields with JSON Schema
- Use schema-constrained structured output and validate the returned object
Explanation
Correct Answer
B:JSON correctness alone cannot certify that business references actually exist. For this situation, the system should apply domain validation in addition to syntactic schema checking. The factual trigger is a structured response has valid JSON syntax but references an invalid account ID. Validate schema shape and business meaning separately at the consuming boundary.
Incorrect Answers
A:A schema should represent reality rather than forcing fabricated required values. The proposed option cannot provide the specific “Apply domain validation in addition to syntactic schema checking” behavior that the case requires. JSON correctness alone cannot certify that business references actually exist.
C:Nested validation prevents malformed provenance elements from reaching downstream systems. Here, a structured response has valid JSON syntax but references an invalid account ID. Apply domain validation in addition to syntactic schema checking. JSON correctness alone cannot certify that business references actually exist.
D:A typed output contract helps reject invalid fields and missing required properties. This is not a substitute for “Apply domain validation in addition to syntactic schema checking”; that control is necessary in the stated circumstances. JSON correctness alone cannot certify that business references actually exist.
Question 449
A strict output schema requires an impossible value when evidence is missing. How should the output contract be restricted?
- Constrain item structure and required evidence fields with JSON Schema
- Use schema-constrained structured output and validate the returned object
- Model missing data explicitly using null or a documented exception state
- Insert the current date whenever the source lacks a required date field, without marking it unknown
Explanation
Correct Answer
C:When a strict output schema requires an impossible value when evidence is missing, the system should model missing data explicitly using null or a documented exception state. A schema should represent reality rather than forcing fabricated required values. A syntactically valid object can still contain the wrong account, date or enum value.
Incorrect Answers
A:Nested validation prevents malformed provenance elements from reaching downstream systems. Here, a strict output schema requires an impossible value when evidence is missing. Model missing data explicitly using null or a documented exception state. A schema should represent reality rather than forcing fabricated required values.
B:A typed output contract helps reject invalid fields and missing required properties. Here, a strict output schema requires an impossible value when evidence is missing. Model missing data explicitly using null or a documented exception state. A schema should represent reality rather than forcing fabricated required values.
D:A system-generated date is not evidence that the source document contains that date. Filling an absent field with today’s value would fabricate data simply to satisfy a strict schema. Allow an explicit null or exception state where the business contract permits missing evidence, while retaining other required identifiers.
Question 450
A nested list must contain one or more properly typed evidence entries. Which structured-output constraint should be added?
- Use schema-constrained structured output and validate the returned object
- Allow a documented nullable date while retaining required record identity
- Define an enum containing the allowed business statuses
- Constrain item structure and required evidence fields with JSON Schema
Explanation
Correct Answer
D:A nested list must contain one or more properly typed evidence entries. The relevant control is to constrain item structure and required evidence fields with JSON Schema. Nested validation prevents malformed provenance elements from reaching downstream systems. Validate schema shape and business meaning separately at the consuming boundary.
Incorrect Answers
A:A typed output contract helps reject invalid fields and missing required properties. Here, a nested list must contain one or more properly typed evidence entries. Constrain item structure and required evidence fields with JSON Schema. Nested validation prevents malformed provenance elements from reaching downstream systems.
B:Allowing null for a legitimately unknown date prevents fabrication, but does not constrain the structure of nested evidence items. This list requires array item schemas, required provenance fields and a minimum length so a consumer can validate each cited item.
C:Finite state values prevent consumer failures caused by arbitrary label variants. The proposed option cannot provide the specific “Constrain item structure and required evidence fields with JSON Schema” behavior that the case requires. Nested validation prevents malformed provenance elements from reaching downstream systems.