Contracts and Schemas
Contracts and Schemas
Scan Governance Additions
wrkr scan --json includes additive governance-first artifacts while preserving existing raw finding and inventory surfaces.
control_backlog.control_backlog_version = "1"identifies the backlog schema.control_backlog.items[*].signal_classis one ofunique_wrkr_signalorsupporting_security_signal.control_backlog.items[*].recommended_actionis one ofattach_evidence,approve,remediate,downgrade,deprecate,exclude,monitor,inventory_review,suppress, ordebug_only.control_backlog.items[*].confidenceis one ofhigh,medium, orlow.control_backlog.items[*].linked_control_path_node_ids/linked_control_path_edge_idsare additive graph join keys tied to the versionedcontrol_path_graph.agent_privilege_map[*].credential_provenanceandaction_paths[*].credential_provenanceuse stable enums:static_secret,workload_identity,inherited_human,oauth_delegation,jit, andunknown.control_path_graph.version = "1"identifies the additive governance graph schema in saved state, report JSON, and evidence bundles.control_backlog.items[*].write_path_classesmay includeread,write,pr_write,repo_write,release_write,package_publish,deploy_write,infra_write,secret_bearing_execution, andproduction_adjacent_write.control_backlog.items[*].governance_controls[*].controlis one ofowner_assigned,approval_recorded,least_privilege_verified,rotation_evidence_attached,deployment_gate_present,production_access_classified,proof_artifact_generated, orreview_cadence_set;statusissatisfied,gap, ornot_applicable.- Governance backlog visibility may use
known_approved,known_unapproved,unknown_to_security,accepted_risk,deprecated,revoked, orneeds_review. Legacy inventory surfaces still accept the historicapprovedcompatibility value. scan_quality.scan_quality_version = "1"identifies the scan-quality appendix schema.scan_quality.modeis one ofquick,governance, ordeep.scan_quality.parse_errors[*].recommended_actionissuppressfor generated/package-manager noise anddebug_onlyfor parser diagnostics that should stay outside the active governance backlog.
These fields are additive. Consumers that depend on findings, ranked_findings, top_findings, inventory, profile, posture_score, and compliance_summary can continue to read those fields unchanged.
Secret-bearing workflow semantics are also additive. Workflow references such as ${{ secrets.NAME }} are classified as secret_reference_detected and may combine with secret_used_by_write_capable_workflow; they must not be treated as secret_value_detected unless a detector explicitly proves a value was exposed.
Evidence-state contract model
Wrkr's public report, backlog, risk, and evidence contracts now lead with evidence-scoped control posture.
control_resolution_stateis one ofdetected_control,declared_control,external_control_reference,no_visible_control,not_applicable, orcontradictory_control.- Canonical
approval_evidence_state,owner_evidence_state,proof_evidence_state,runtime_evidence_state,target_evidence_state, andcredential_evidence_stateare one ofverified,declared,inferred,unknown, orcontradictory. target_classis one ofproduction_impacting,release_adjacent,customer_data_adjacent,internal_tooling,developer_productivity,test_demo_sandbox, orunknown.action_path_typeis one ofai_assisted_workflow,agent_framework,automation_bot,ci_cd_workflow,legacy_script,plain_source_code, orunknown_executable_path.- Coverage-qualified absence surfaces use
not_found_with_complete_coverage,not_found_with_reduced_coverage,not_scanned,unsupported_surface, orcandidate_parse_failed. - Runtime absence surfaces use
not_collected,not_applicable,missing_required, ormissing_for_control_claim.
Compatibility aliases such as missing_approval_paths, missing_policy_paths, missing_proof_paths, and older approval_gap surfaces remain additive compatibility shims in v1, but they are derived from the canonical evidence-state projection rather than serving as independent truth.
Enterprise Evidence Contracts
Wrkr's Sprint 2 enterprise-evidence surface stays local-file based and deterministic.
schemas/v1/evidence/external-control-evidence.schema.jsonis the public v1 sidecar contract for imported ownership, approval, branch protection, deployment approvals, required checks, freeze windows, kill switches, and other external control evidence.wrkr-control-declarations.yamland.wrkr/control-declarations.yamlare versioned declaration inputs for owner mappings, target classes, non-production declarations, and declared control links.action_paths[*].evidence_decisions[]andagent_action_bom.items[*].evidence_decisions[]preserve source precedence, freshness, selected evidence, and rejected lower-precedence candidates instead of flattening imported evidence to one opaque winner.action_paths[*].contradictions[],closure_requirements,lifecycle_queue, andevidence_completenesskeep enterprise conflicts, required closure evidence, lifecycle ownership gaps, and sufficiency scoring explicit across report, BOM, and risk surfaces.- Accepted governance dispositions stay auditable:
accepted_riskand suppression metadata remain visible in JSON/report artifacts instead of deleting evidence. - Evidence completeness is not risk scoring. Low
evidence_completenessmeans Wrkr needs more evidence for the current conclusion, not that the path is safe. - Canonical source precedence is documented and deterministic: provider export, signed declaration, repo-local policy/config, app catalog ownership, git/review inference, then naming-convention or repo fallback.
agent_action_bom.summary.primary_viewis the focused workflow-BOM contract for Sprint 3 buyer output. It carries the selectedpath_id, selection reason, path map, evidence/control posture, governed-path before/after view, and appendix refs without removing the fullagent_action_bom.items[*]detail surface.
Canonical references
- Root exit codes and flags:
docs/commands/root.md - Command contract index:
docs/commands/index.md - Manifest open specification:
docs/specs/wrkr-manifest.md - JSON schemas:
schemas/v1/schemas/v1/control-path-graph.schema.json
Command anchors
wrkr manifest generate --json
wrkr export --format inventory --json
wrkr verify --chain --jsonCompatibility posture
Within the same major contract line, additive fields are expected to remain backward compatible for consumers that ignore unknown optional fields.
Command-specific validators may still reject inputs that never matched the documented contract, for example non-scan JSON passed to wrkr campaign aggregate.
Drift-review contract model
Wrkr's recurring drift-review surface is baseline-backed and fail-closed by design.
schemas/v1/regress/regress-baseline.schema.jsonnow carries additiveaction_paths_capturedand normalizedaction_paths[]state sowrkr regresscan compare stable workflow/action-path posture across reruns.schemas/v1/regress/regress-result.schema.jsonnow carries additivecomparison_status,comparison_issues[],drift_category_count, anddrift_categories[]with stable categories such asnew_write_paths,new_deploy_paths,new_credentials,new_unknown_approval_evidence,resolved_gaps,worsened_paths,new_contradictions,paths_ready_for_control,removed_paths,changed_authority,changed_evidence, andchanged_target_class.summary.regress_driftmirrors the same additive drift-category model insidewrkr report --jsonand report evidence artifacts.agent_action_bom.summary.drift_reviewmirrors the same additive drift-category model inside buyer-facing workflow-first report output.assessment-manifest.jsonstage metadata now carries additivecomparison_statusanddrift_category_countonstages.regressso repeatable assessment workflows can distinguish clean drift review from unavailable baseline comparison data.
Q&A
Where are Wrkr JSON schemas and contracts defined?
Schemas live in schemas/v1/, while command and flag contracts are documented under docs/commands/.
Which spec defines the Wrkr manifest contract?
docs/specs/wrkr-manifest.md is the canonical manifest specification reference.
How should I design consumers to remain compatible over time?
Treat additive optional fields as non-breaking, validate required fields strictly, and pin expected schema/manifest versions in CI checks.
Which JSON artifacts are valid inputs to wrkr campaign aggregate?
Only complete wrkr scan --json artifacts. Other status=ok envelopes from commands such as wrkr version or wrkr report are not valid campaign inputs.