Skip to content

Add formal AWF config source conformance test suite (P1–P10)#37868

Merged
pelikhan merged 6 commits into
mainfrom
copilot/formal-spec-awf-config-sources-spec
Jun 8, 2026
Merged

Add formal AWF config source conformance test suite (P1–P10)#37868
pelikhan merged 6 commits into
mainfrom
copilot/formal-spec-awf-config-sources-spec

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This change codifies the specs/awf-config-sources-spec.md conformance model into executable tests so AWF config canonicalization behavior is checked against the formal requirements (dual-source consultation, drift semantics, SLA/escalation, and degraded-mode safeguards). It adds the expected P1–P10 coverage as a dedicated formal suite under pkg/workflow.

  • Formal conformance suite (pkg/workflow/awf_config_drift_formal_test.go)

    • Adds 10 testify tests mapped 1:1 to the spec predicates:
      • DualSourceConsultation (CR-01)
      • NoUndocumentedFieldGeneration (CR-03)
      • DriftRecordStructuralValidity (§4.5.1)
      • DriftCategoryExhaustiveness (§4.5.1)
      • SchemaOnlyPropertyFlaggedAsDrift (CR-02)
      • CorrectionPRForActionableDrift (CR-05)
      • SLARemediationWindow (CR-06)
      • EscalationIssueStructure (CR-06a)
      • SafeguardDegradedModeOnUnavailability (§5)
      • DriftReportEmittedOnDetection (§4.2)
  • Spec-aligned formal helpers (test-local)

    • Introduces small test-only model helpers for:
      • drift record structural validation and category enum enforcement
      • schema-vs-coverage drift emission
      • corrective-PR obligation checks for actionable categories
      • business-day deadline arithmetic for 5-day SLA windows
      • escalation issue minimal-structure checks
      • degraded-mode state expectations when canonical sources are unavailable
  • Example (predicate mapping and intent)

    func TestFormal_P7_SLARemediationWindow(t *testing.T) {
    	detected := time.Date(2026, 6, 8, 9, 0, 0, 0, time.UTC) // Monday
    	deadline := formalAddBusinessDays(detected, 5)
    
    	assert.Equal(t, time.Date(2026, 6, 15, 9, 0, 0, 0, time.UTC), deadline)
    	assert.True(t, formalSLARemediationWindow(detected, deadline))
    	assert.False(t, formalSLARemediationWindow(detected, deadline.Add(time.Second)))
    }

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add formal model and test suite for AWF config sources Add formal AWF config source conformance test suite (P1–P10) Jun 8, 2026
Copilot AI requested a review from gh-aw-bot June 8, 2026 17:11
@pelikhan pelikhan marked this pull request as ready for review June 8, 2026 17:37
Copilot AI review requested due to automatic review settings June 8, 2026 17:37
@pelikhan

pelikhan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new “formal” Go test suite intended to codify the conformance predicates described in specs/awf-config-sources-spec.md (P1–P10) so AWF config drift/canonicalization expectations are validated in CI.

Changes:

  • Adds pkg/workflow/awf_config_drift_formal_test.go with 10 tests named TestFormal_P1TestFormal_P10.
  • Introduces test-local helper predicates (dual-source consultation, drift record structure/category, SLA business-day arithmetic, escalation issue structure, degraded-mode safeguards, drift report emission).
Show a summary per file
File Description
pkg/workflow/awf_config_drift_formal_test.go Adds a new formal conformance test suite and helper predicates for AWF config drift requirements.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 4

Comment on lines +33 to +35
func formalDualSourceConsulted(normativeSpecConsulted, publishedSchemaConsulted bool) bool {
return normativeSpecConsulted && publishedSchemaConsulted
}
Comment on lines +46 to +51
func formalDriftRecordStructuralValidity(record FormalDriftRecord) bool {
return record.PropertyPath != "" &&
record.DriftCategory != "" &&
record.SuggestedAction != "" &&
record.DetectedAt != ""
}
Comment on lines +53 to +55
func formalDriftCategoryExhaustiveness(category string) bool {
return slices.Contains([]string{"missing_in_ghaw", "missing_in_schema", "spec_mismatch"}, category)
}
Comment on lines +117 to +121
func formalDriftReportEmittedOnDetection(schemaProperties, implementationCoverage []string) []FormalDriftRecord {
drift := formalSchemaOnlyPropertyFlaggedAsDrift(schemaProperties, implementationCoverage)
if drift == nil {
return []FormalDriftRecord{}
}
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran the pr-finisher workflow and pushed 5c05807, which fixes the PR-owned lint failure in pkg/workflow/awf_config_drift_formal_test.go (assert.Len(..., 0)assert.Empty(...)). I also ran fmt/lint/test-unit/test and inspected failing CI logs; remaining failures are unrelated baseline issues outside this PR’s changed file.

Copilot AI requested a review from pelikhan June 8, 2026 17:55
@pelikhan pelikhan merged commit e9bcb25 into main Jun 8, 2026
28 checks passed
@pelikhan pelikhan deleted the copilot/formal-spec-awf-config-sources-spec branch June 8, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[formal-spec] awf-config-sources-spec.md — Formal model & test suite — 2026-06-08

4 participants