Skip to content

Progress event omits required current>=0 and current<=total validation (§8.2.1) #85

@nficano

Description

@nficano

Category: spec-conformance Severity: major
Location: src/Arcp.Runtime/JobContext.fs:66-69
Spec: ARCP v1.1 §8.2.1

What

Spec §8.2.1: 'current MUST be a non-negative number. If total is present, current SHOULD be ≤ total.' The runtime emits any value, including negative current or current > total, producing non-conformant events.

Evidence

member _.EmitProgressAsync
    (current: decimal, total: decimal option, units: string option, message: string option, _ct: CancellationToken)
    : Task =
    emit (JobEventBody.Progress(current, total, units, message))

Proposed fix

Reject (raise ArcpException InvalidRequest) when current < 0m. When total is Some t and current > t, either raise or clamp+log per a documented policy; the spec language is SHOULD, so a logged warning is acceptable but silent emission is not.

Acceptance criteria

  • EmitProgressAsync(-1m, ...) raises; EmitProgressAsync(10m, Some 5m, ...) either raises or logs and the wire envelope satisfies the spec invariant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit/spec-conformanceAudit finding — ARCP v1.1 spec conformancesev/majorSeverity — major

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions