feat(workflow): formal test suite for intent-attribution-agent-governance spec (P1–P11 + safety invariant)#49171
Conversation
…P1-P11 + safety invariant) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. ✅ Contribution AlignedThanks for formalizing the intent-attribution governance spec into an executable test suite! This is exactly what Phase 1 needs — a crystal-clear set of predicates (P1–P11) plus the safety invariant encoding the spec semantics. What looks great:
The PR is focused, documented, and ready for merge. Looking forward to Phase 2+ when the real resolver ships and these stubs get replaced with live implementations! 🎯
|
PR TriageCategory: test - Risk: low - Score: 40/100
Recommended action: batch_review (batch: spec-docs-20260730) New self-contained Go test file (+476/-0) encoding governance spec predicates with explicit stub types marked for future replacement. No production code touched, draft, CI pending. Batch with #49177 and #49174 for combined review. Confirm stubs are clearly marked for Phase 2+ replacement before merge.
|
Formalizes
specs/intent-attribution-agent-governance.mdas an executable Go test suite, encoding 11 core predicates and a cross-cutting safety invariant. Since the real attribution resolver doesn't exist yet (Phase 2+), the file ships self-contained stubs that directly encode the spec semantics and are marked for replacement.New file:
pkg/workflow/intent_attribution_governance_formal_test.goStub types (replace with real impl when Phase 2+ lands):
pullRequestData— resolver inputs (explicit intent, closing issues, labels)formalIntentRecord— normalized output withStatus,Source,Key,Risk,Priority,DomainsformalExecutionPolicy— governance output with autonomy, write scope, approval/merge/attempt constraintsStub functions encoding the spec directly:
formalResolve— attribution-resolution order: explicit metadata → single closing issue → multi-issue ambiguous → label fallback → unlinkedformalSafestPolicy— fail-closed floor:propose_only / none / human_approval_required: true / auto_merge_allowed: false / max_attempts: 1formalDerivePolicy— indeterminate statuses (unlinked,ambiguous,suggested,unmapped) always returnformalSafestPolicy()formalResolveRisk— explicit risk wins; else derived from domain+priority (security+critical→high, production→high, infrastructure→medium, documentation→low, unknown→unknown)formalPolicyPrecedenceLevel—agent_request(0) < workflow(1) < intent(2) < repository(3) < organization(4)Predicates tested:
mapped / closing_issueambiguous, order-independent (3 orderings)artifact_labelfallbackunlinkedambiguous ≠ mappedfor authorization purposes