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 = "2"identifies the additive scan-quality appendix schema, including per-surface coverage and reconciliation fields.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.resolution_keyis the additive durable review join key for governable action paths, BOM items, and regress baselines. It is distinct from opaquepath_id, which remains the direct per-run identifier.resolution_selector,resolution_match_confidence, andresolution_mismatch_reasonsare additive selector-fallback trace fields used when a declaration or imported control can be correlated even though a priorpath_idno longer matches directly.- 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. review_lifecycle_stateis additive review-loop state metadata and may be one ofopen,confirmed,declared_controlled,covered_by_imported_control,accepted_risk,not_applicable,false_positive,needs_runtime_evidence,expired, orreopened_by_drift.review_audit_context,resolved_visibility,resolved_appendix_refs,previous_review_lifecycle_state,reopen_state,reopen_reasons, andreopen_evidence_refskeep resolved and reopened customer review decisions auditable in JSON, Markdown appendix handoff, and regress baselines.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 scoped containment evidence. Containment records may distinguish requests, denials, capability or descendant invalidation, external revocation attempts and acknowledgements, receipts, and unresolved or out-of-scope boundaries.schemas/v1/evidence/control-declarations.schema.jsonis the public v1 declaration contract for owner, target, control, and review-disposition inputs.wrkr-control-declarations.yamland.wrkr/control-declarations.yamlare versioned declaration inputs for owner mappings, target classes, non-production declarations, declared control links, and additive review dispositions.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.agent_action_bom.items[*].closure_actions[]is the additive action-level closure contract for the operator loop. It distinguishes import actions (for example PR review, branch protection, and environment approval) from declaration-capable actions (owner, target, and review-disposition exports).- 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, additiverisk_tier, additive conciserecommended_next_actions[], additivecoverage_status(complete,reduced,not_scanned, orunsupported_surface), and appendix refs without removing the fullagent_action_bom.items[*]detail surface.summary.repeat_usage_signalsandagent_action_bom.summary.repeat_usage_signalsare additive privacy-safe local-repeatability counters for baselines, assess reruns, regress artifacts, evidence exports, ticket exports, and action-contract exports.
Canonical references
mutable_endpoint_semantic_refs,credential_authority_ref, andauthority_binding_refsare the stable join contract for repeated risk, backlog, graph, and report projections.inventory.canonical_storesis the authoritative per-scan store for full mutable-endpoint, credential-authority, and authority-binding detail.Shareable/default report and BOM projections keep the canonical ref fields and omit embedded
mutable_endpoint_semantics,credential_authority, andauthority_bindingspayloads; explicit--share-profile internaloutput may resolve those fields from the canonical store for non-shareable detail views.Report-style workflows now default to a redacted share profile (
customer-redacted,public, ordesign-partnerdepending on template). Explicit internal output is markedartifact_metadata.shareability_status=internal_only.wrkr export declarationsis the deterministic local declaration-export contract. It emits validated YAML snippets or patch artifacts, prefersresolution_keyover transientpath_id, and must warn instead of leaking identifiers when shareable/pseudonymized inputs are not directly applicable.Root exit codes and flags:
docs/commands/root.mdCommand contract index:
docs/commands/index.mdManifest open specification:
docs/specs/wrkr-manifest.mdJSON 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.