Skip to content

emit-sarif: document that emit-finalize strips the AI1012-mandated ruleId sub-id (and relocates it nowhere) #3061

Description

Summary

The emit-sarif skill / AI-generated-findings profile enforces AI1012 at emit-results receipt: result.ruleId MUST be CWE-<n>/<sub-id> (or the flat NOVEL-<sub-id>); a bare CWE-<n> is rejected. But emit-finalize then rewrites result.ruleId from CWE-<n>/<sub-id> back to bare CWE-<n> (and points ruleIndex at the bare descriptor), relocating the sub-id nowhere — no result.rule.id, no slugged reportingDescriptor, no property.

The producer is forced to author a sub-classifier at the door and it is silently confiscated at the exit. get-skill emit-sarif Step 5 lists finalize's actions (replay, snippets, CWE descriptor enrichment, permalink rebase, embed, validate) but never mentions this strip, and never tells producers that a sub-classifier they want to keep must be parked in a property bag.

Evidence (Sarif.Multitool 5.2.0)

emit-results with a bare id:
`
{ "appended": 0, "rejected": [ { "index": 0, "errorCode": "AI1012",
"message": "error AI1012: ... Every AI-emitted result.ruleId MUST take one of two shapes:

  1. Taxonomy sub-id CWE-/ ...
  2. NOVEL escape hatch NOVEL- ..." } ] }
    emit-resultswithCWE-306/anon-endpoint->{ "appended": 1, "rejected": [] }`.

After emit-finalize (real two-run Argus log), runs[1].results[0]:

  • ruleId = "CWE-306" (sub-id gone), ruleIndex -> bare CWE-306 descriptor
  • rule = null; no tool-driver descriptor whose id contains /
  • the only durable carrier of the sub-classification is the producer's own argus/antipatternId property.

Ask

  1. Document in emit-sarif Step 5 (and docs/ai/generating-sarif.md) that emit-finalize canonicalizes result.ruleId to the base CWE and does not retain the AI1012 sub-id on the result.
  2. Add explicit guidance: if you need the sub-classifier to survive finalize, store it in a tool-namespaced property (e.g. myscanner/subId); result.ruleId is not a durable place for it.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions