{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vectelos-com/json-schema/vectelos-com-line-feedback-schema.json",
  "title": "LineFeedback",
  "description": "One signal from the person reading a report.\n\nZERO DOC STORE. This is the only route by which anything derived from a\ncustomer's document reaches durable storage, and it exists because the\nengine cannot grade itself: a stored HTSUS code is what we decided, not\nwhether we were right. Feedback is the grade.\n\nThree rules hold it to the claim on the site:\n\n  1. Nothing is written unless the reader submits it. We do not sample\n     reports, and no background process reads a stored report.\n  2. No `user_id`, no `job_id`, no tenant identifier is recorded. The\n     request is authenticated so only signed-in users can post, and then\n     who they are is deliberately dropped.\n  3. Money and quantities never travel. Not the entered value, not the duty\n     assessed, not the line total.\n\nWHY THERE IS NO \"THIS IS CORRECT\" SIGNAL. A thumbs-up cannot distinguish\n\"I checked this against my broker's last entry\" from \"I clicked the green\none because the red one asked me questions\" -- but it looks like data, and\nat low volume it would manufacture an accuracy denominator we have not\nearned. Silence is allowed to mean silence. The one exception is\n`description_confirmed`, which answers a specific question about a specific\nline (\"is this roughly what it is?\") and so carries actual information.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vectelos-com-openapi.json#/components/schemas/LineFeedback",
  "properties": {
    "signal": {
      "type": "string",
      "enum": [
        "flagged",
        "extraction_error",
        "description_confirmed",
        "description_wrong"
      ],
      "title": "Signal",
      "description": "What the reader is telling us"
    },
    "hts_code": {
      "type": "string",
      "title": "Hts Code",
      "description": "The code the engine selected",
      "default": ""
    },
    "confidence": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Confidence",
      "description": "Engine confidence, 0-1"
    },
    "duty_rate_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Duty Rate Pct",
      "description": "Effective rate applied"
    },
    "chapter99_codes": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Chapter99 Codes",
      "description": "Remedy headings applied, e.g. 9903.82.02"
    },
    "caveats_fired": {
      "type": "integer",
      "title": "Caveats Fired",
      "description": "How many determinations the engine declined to make",
      "default": 0
    },
    "engine_reasoning": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Engine Reasoning",
      "description": "The engine's own stated reasoning for this classification"
    },
    "origin_country": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2
        },
        {
          "type": "null"
        }
      ],
      "title": "Origin Country"
    },
    "port_city": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Port City"
    },
    "port_state": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 32
        },
        {
          "type": "null"
        }
      ],
      "title": "Port State"
    },
    "what_is_wrong": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "What Is Wrong",
      "description": "Which part looks wrong, from a fixed list the UI offers"
    },
    "suggested_hts_code": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 13
        },
        {
          "type": "null"
        }
      ],
      "title": "Suggested Hts Code"
    },
    "comment": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Comment"
    },
    "include_description": {
      "type": "boolean",
      "title": "Include Description",
      "description": "True only when the reader chose to send the item description",
      "default": false
    },
    "item_description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Item Description",
      "description": "Sent only when include_description is true; dropped otherwise"
    }
  },
  "type": "object",
  "required": [
    "signal"
  ]
}