{
  "capability_id": "math.prime_factorization",
  "tool_id": "prime-factorization",
  "engine": "prime-factorization",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-16T14:39:28.358Z",
  "engine_build": "2026-09-16",
  "test_count": 11,
  "passed": 11,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 3,
      "passed": 3
    },
    "boundary": {
      "total": 2,
      "passed": 2
    },
    "property": {
      "total": 6,
      "passed": 6
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": false,
  "review_kind": null,
  "source_checked": true,
  "reviewed_by": null,
  "reviewer_role": null,
  "last_reviewed": null,
  "expert_review": {
    "status": "optional_not_performed",
    "reviewer": null,
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "note": "Domain expert review is optional under CVP (CVP-EXP-01). Absence does not block CVP Verified. See Review policy for supplemental domain assurance."
  },
  "internal_review": {
    "status": "not_applicable",
    "reviewer": null
  },
  "page": "https://www.calculatorx.com/calc/math/prime-factorization",
  "api": "https://www.calculatorx.com/api/v1/calc/prime-factorization",
  "schema_input": "https://www.calculatorx.com/schemas/math.prime_factorization.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.prime_factorization.output.json",
  "assumptions": [
    "Unique factorization (fundamental theorem of arithmetic)",
    "Trial division",
    "n = 1 is neither prime nor composite"
  ],
  "limitations": [
    "Trial division only — not a primality-proving sieve for cryptographic sizes",
    "n = 1 is neither prime nor composite (empty factorization)",
    "Domain 1 ≤ n ≤ 10^12",
    "n < 1 → VALUE_MUST_BE_POSITIVE",
    "unknown mode → INVALID_MODE"
  ],
  "boundary_conditions": [
    "missing n → MISSING_REQUIRED_INPUT",
    "n < 1 → VALUE_MUST_BE_POSITIVE",
    "n > 10^12 → VALUE_ABOVE_MAX",
    "unknown mode → INVALID_MODE"
  ],
  "sources": [
    "ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)",
    "Fundamental theorem of arithmetic"
  ],
  "methods": [],
  "fingerprint": "sha256:b89c30b7ff14bba3f4754488b02426f6bed77fbe3e83717d726c89b4d580672e",
  "tests": [
    {
      "id": "golden-factor-12",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "n": 12
      },
      "expect": {
        "canonical": "2^2 × 3",
        "is_prime": false,
        "omega": 2,
        "big_omega": 3
      },
      "expectWarning": null,
      "actual": {
        "n": 12,
        "mode": "factorize",
        "is_prime": false,
        "factors": [
          {
            "p": 2,
            "e": 2
          },
          {
            "p": 3,
            "e": 1
          }
        ],
        "canonical": "2^2 × 3",
        "omega": 2,
        "big_omega": 3,
        "max_n": 1000000000000
      },
      "tol": null
    },
    {
      "id": "golden-prime-13",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "n": 13
      },
      "expect": {
        "is_prime": true,
        "canonical": "13"
      },
      "expectWarning": null,
      "actual": {
        "n": 13,
        "mode": "factorize",
        "is_prime": true,
        "factors": [
          {
            "p": 13,
            "e": 1
          }
        ],
        "canonical": "13",
        "omega": 1,
        "big_omega": 1,
        "max_n": 1000000000000
      },
      "tol": null
    },
    {
      "id": "golden-one",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "n": 1
      },
      "expect": {
        "canonical": "1",
        "is_prime": false,
        "omega": 0
      },
      "expectWarning": null,
      "actual": {
        "n": 1,
        "mode": "factorize",
        "is_prime": false,
        "factors": [],
        "canonical": "1",
        "omega": 0,
        "big_omega": 0,
        "max_n": 1000000000000
      },
      "tol": null
    },
    {
      "id": "boundary-prime-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "n": 0
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "n must be ≥ 1."
    },
    {
      "id": "boundary-prime-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "sieve",
        "n": 9
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be factorize or is_prime."
    },
    {
      "id": "property-factor-12",
      "ok": true,
      "kind": "property",
      "detail": "12=2^2×3",
      "expect": "2^2 × 3",
      "actual": "2^2 × 3"
    },
    {
      "id": "property-prime-13",
      "ok": true,
      "kind": "property",
      "detail": "13 prime",
      "expect": true,
      "actual": true
    },
    {
      "id": "property-one",
      "ok": true,
      "kind": "property",
      "detail": "1 not prime",
      "expect": "1",
      "actual": "1"
    },
    {
      "id": "property-product",
      "ok": true,
      "kind": "property",
      "detail": "∏ p^e = n",
      "expect": 12,
      "actual": 12
    },
    {
      "id": "property-square",
      "ok": true,
      "kind": "property",
      "detail": "49=7^2",
      "expect": "7^2",
      "actual": "7^2"
    },
    {
      "id": "property-composite-mode",
      "ok": true,
      "kind": "property",
      "detail": "9 not prime",
      "expect": false,
      "actual": false
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 11,
      "total": 11,
      "golden": 3,
      "boundary": 2,
      "property": 6
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-16T14:30:31.968Z",
  "rendered_at": "2026-09-16T14:39:28.358Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.0.0",
    "artifacts": {
      "engine": "1.0.0",
      "page": "1.0.0",
      "capability": "1.0.0",
      "evidence": "1.0.0",
      "input_schema": "1.0.0",
      "output_schema": "1.0.0",
      "mcp_contract": "1.0.0"
    },
    "digests": {
      "input_schema_sha256": "87cce1a3541796472731ab489ebec577a891fa572e053d23bc4123c56d289420",
      "output_schema_sha256": "03cb63458fd0dc6ded0829e175d96b9c62c227a6e33a5ffed917dde071a6145f",
      "evidence_sha256": "ecf6401ef9d230249e5fe197175a58c7836eabd0fe327b04160cbaa10b22bac6",
      "evidence_core_sha256": "ecf6401ef9d230249e5fe197175a58c7836eabd0fe327b04160cbaa10b22bac6",
      "capability_sha256": "5c6c644652b41cbcc4db8199d245bf720982d932e05b00f947ae69834a0ed29f",
      "engine_sha256": "e334f2538fa740d4d06695357567d1c4dc3aba80b21a914697847445f7e5bad8",
      "mcp_contract_sha256": "d43d6b749952694caf9257df4c7c5eb805cccdce3e3021e92420f04757702e4c"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.0.0"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
