Skip to content

DProvenanceKit 0.11.0 — Xcode 27 support and OTel gate verdicts

Latest

Choose a tag to compare

@Therealdk8890 Therealdk8890 released this 22 Nov 22:18
e29670e

Fixed

  • DProvenanceFoundationModels builds against the shipping OS 27 SDK (Xcode 27). The
    transcript bridge matched Transcript.Segment.custom, a case from an early 27.0 beta
    that Apple removed before release, so every Xcode 27 consumer build failed with
    Type 'Transcript.Segment' has no member 'custom' (seen in CaseClarity's Xcode Cloud
    builds since 0.9.0). Attachment segments are still skipped and counted. CI now builds
    the Foundation Models targets on the xcode-27 runner image, so the
    canImport(FoundationModels, _version: 2.0) branches are compiled somewhere.

Added

  • DPKGateVerdict (DProvenanceOTel): a gate verdict as OpenTelemetry attributes. It is the
    Swift twin of Python dprovenancekit.exporters.GateVerdict, emitting dpk.gate.*
    attributes and the standard gen_ai.evaluation.result event
    (evaluationResultEvent(timeUnixNano:)). Build it from dpk gate --json output
    (init(gateJSON:)) or from the shared JSON form. The contract is pinned by the shared
    otel_verdict_attributes.json vector, which the conformance harness (category 7) and
    DPKGateVerdictTests reproduce.
  • OTLPAnyValue.array and OTLPKeyValue.stringArray(_:_:): OTLP arrayValue
    attributes. Empty arrayValue objects decode as empty arrays.

Security

  • Proof packs: a pack whose signed trace records the artifact digest beside a different
    role now fails with the new ProofPackVerificationFailure.artifactRoleMismatch(index:)
    under v1 (v2 already failed it as artifactNotBound). Previously a v2 pack rewritten as proofPackVersion: 1 with a new role
    verified (exit 0). requireRoleBinding still defaults to false; genuine v1 packs whose
    traces record no role keep verifying as value-presence-only, and their certificates now
    say VERIFIED (ROLE NOT SIGNER-VOUCHED) in the headline. Source note: exhaustive
    switches over ProofPackVerificationFailure need the new case.
  • Proof-pack role and digest matching is byte-exact UTF-8 instead of Swift String ==
    (Unicode canonical equivalence), matching the Python verifier.
  • Default change: CloudTraceStore, CloudWriter and OTLPHTTPExporter refuse to
    send credentials (the cloud API key; OTLP headers such as Authorization or
    x-api-key) over plain http to a non-loopback host. Cloud reads throw
    CloudTraceStoreError.insecureEndpoint; refused ingest batches are quarantined
    immediately instead of retried; OTLP exports throw OTelExportError.insecureEndpoint.
    https and loopback (localhost, *.localhost, 127.x.x.x, ::1) are unaffected.
    Opt out per instance with allowInsecureTransport: true /
    Configuration.allowInsecureTransport = true. Policy is exposed as
    DPKTransportSecurity.allowsCredentials(to:).
  • RFC3161TimestampVerifier.verify and verifyExternalTimestamp accept
    trustedKeyIDs: to pin the DPK signer in the same call; results now report
    attestationTrust (.embeddedKeyOnly unless pinned) and attestationFailure.
    Previously a valid timestamp result said nothing about who signed the attestation.
  • dpk verify escapes terminal control, C1 and bidi-control characters in
    producer-supplied labels (artifact roles, event type identifiers, failure and
    decoding-error text, and text certificates) as \u{XXXX}, so a crafted pack cannot
    rewrite or reorder what the terminal shows.

Fixed

  • README "Gate your own agent in an afternoon": the walkthrough said to delete the
    verify_account_status(...) call in agent_stub.py, which leaves is_active undefined and
    crashes the agent with NameError before the gate runs. It now says to change the line to
    is_active = True.

  • OTLPHTTPExporter preserves an endpoint's query string instead of appending
    /v1/traces after it.

  • Corrected the externalTimestamp documentation: the token's imprint covers the
    attestation's canonical signing payload (all fields except the signature bytes).

  • Behavior change: SQLiteTraceStore.lineageEdges(of:) / impactEdges(of:) throw
    TraceError.corruptEdgeRow for a persisted edge row that does not decode. An unknown
    edge type was previously rewritten to .informed and a malformed UUID row skipped,
    silently changing or truncating lineage.

  • A payload whose type does not match the active run (DProvenanceKit<U>.record inside a
    DProvenanceKit<T> run) is still dropped, but is now counted in
    ActiveTraceRun.payloadTypeMismatchCount and logged once per run in DEBUG builds. The
    FoundationModels recorders probe the run type first, so they never trip it.

  • TraceWriteBuffer bounds pending lineage edges (BufferCapacity.maxPendingEdges,
    default 100,000). An edge refused at the cap is counted as a structural drop, so
    dropStats.preservedIntegrity reports it; previously the edge queue grew without limit
    while the writer was stalled.

  • Attestation edge anchoring is a single linear BFS instead of a quadratic fixpoint;
    results, including which dangling edge is reported, are unchanged.

  • RawTraceStore no longer substitutes "{}" for a payload that is not valid UTF-8 (it
    returns a lossy decoding and payloadIsValidUTF8 == false) and no longer traps on a
    negative stored sequence. Event sequences are stored and read by bit pattern.

  • Behavior change: SQLiteTraceStore refuses to open a file whose user_version is
    newer than it understands (SQLiteError.unsupportedSchemaVersion), and schema
    migrations use the new throwing SQLiteConnection.readUserVersion() /
    setUserVersion(_:) instead of a setter that swallowed write errors.

  • Behavior change: dpk verify --out=<path> without --certificate now exits 2
    (--out only ever wrote a certificate; it previously printed to stdout and left the
    requested file unwritten). --help documents --certificate=text|html and what
    --out does per mode.

Compatibility

  • New enum case OTLPAnyValue.array affects exhaustive switch statements over
    OTLPAnyValue without a default. Existing wire output is unchanged: no current
    attribute switches to arrays (dpk.derived_from stays a comma-joined string).
  • New enum cases (CloudTraceStoreError.insecureEndpoint,
    OTelExportError.insecureEndpoint) affect exhaustive switch statements without a
    default. All new parameters and properties are defaulted, so existing call sites
    compile unchanged.
  • New enum cases (TraceError.corruptEdgeRow, SQLiteError.unsupportedSchemaVersion)
    affect exhaustive switch statements without a default. New parameters and
    properties are defaulted; the non-throwing userVersion property remains.

Repository

  • CI hygiene: Dependabot now tracks GitHub Actions and the WebVisualizer's npm
    dependencies; the unreferenced
    scripts/check_version_surface.sh (superseded by
    .github/scripts/check-release-surfaces.sh) is removed.
  • swift run --package-path ConformanceHarness works from a clone whose directory is
    not named DProvenanceKit.
  • The test target excludes its on-disk interop fixtures, silencing SwiftPM's
    "unhandled files" warning.
  • .gitleaks.toml extends the default ruleset with a narrow allowlist for public signer
    key IDs, so golden vectors cannot turn the secret scan red.
  • WebVisualizer dev dependencies updated (npm audit fix): vite 8.3.8 and its
    transitive nanoid/source-map-js; npm audit reports 0 vulnerabilities.
  • Vendored conformance vectors re-synced from DProvenanceKitPython main (f71ca8a):
    event_chain_v1_candidate.json and otel_verdict_attributes.json added to
    ConformanceHarness/vectors/, so the vector-sync check passes again. Byte-identical
    copies; the harness loads vectors by name, so no Swift behavior changes.