You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awf-config-sources-spec.md defines a conformance protocol for AWF configuration canonicalization. Agents and schema-reconciliation workflows must consult bothdocs/awf-config-spec.md (normative spec) and docs/awf-config.schema.json (published schema) from github/gh-aw-firewall before generating or validating AWF config behavior. The spec introduces the DriftRecord entity, a 5-business-day remediation SLA with escalation requirements (CR-06/CR-06a), and degraded-mode safeguards when canonical sources are temporarily unavailable. Ten formal predicates were derived from the conformance requirements and encoded as a Go testify suite.
ValidSession(s) => s.specConsulted ∧ s.schemaConsulted
Both docs/awf-config-spec.md and docs/awf-config.schema.json must be loaded; consulting one source alone is insufficient.
P2 — NoUndocumentedFieldGeneration(CR-03) — Z3
may_generate(f) => f ∈ NormativeSpec ∨ f ∈ AnySchema
Agents MUST NOT emit config fields absent from both normative spec and all JSON schemas.
P3 — DriftRecordStructuralValidity(§4.5.1) — F*
All four required fields (property_path, drift_category, suggested_action, detected_at) must be non-empty/non-zero.
Example test — P7 (CR-06 SLA business-day window):
funcTestFormal_P7_SLARemediationWindow(t*testing.T) {
t.Run("5 biz days from Mon 2026-06-08 → Mon 2026-06-15", func(t*testing.T) {
assert.Equal(t, time.Date(2026,6,15,0,0,0,0,time.UTC),
addBusinessDays(time.Date(2026,6,8,0,0,0,0,time.UTC), 5),
"CR-06: SLA deadline arithmetic must be correct")
})
t.Run("7 biz days after detection — SLA exceeded", func(t*testing.T) {
detected:=time.Date(2026,6,1,10,0,0,0,time.UTC)
now:=time.Date(2026,6,10,10,0,0,0,time.UTC)
assert.False(t, now.Before(addBusinessDays(detected, 5)),
"CR-06: escalation issue MUST be opened when SLA exceeded")
})
}
Full test file (623 lines) available at the path above. All 10 test functions follow the same table-driven pattern and cover P1–P10.
Usage
Copy full test file to pkg/workflow/awf_config_drift_formal_test.go.
Replace // stub types with real implementations when available.
Summary
awf-config-sources-spec.mddefines a conformance protocol for AWF configuration canonicalization. Agents and schema-reconciliation workflows must consult bothdocs/awf-config-spec.md(normative spec) anddocs/awf-config.schema.json(published schema) fromgithub/gh-aw-firewallbefore generating or validating AWF config behavior. The spec introduces theDriftRecordentity, a 5-business-day remediation SLA with escalation requirements (CR-06/CR-06a), and degraded-mode safeguards when canonical sources are temporarily unavailable. Ten formal predicates were derived from the conformance requirements and encoded as a Go testify suite.Specification
specs/awf-config-sources-spec.mdFormal Model
Predicates and invariants (illustrative notation)
P1 — DualSourceConsultation (CR-01) — TLA+
P2 — NoUndocumentedFieldGeneration (CR-03) — Z3
P3 — DriftRecordStructuralValidity (§4.5.1) — F*
P4 — DriftCategoryExhaustiveness (§4.5.1) — Z3 enum
P5 — SchemaOnlyPropertyFlaggedAsDrift (CR-02) — TLA+
P6 — CorrectionPRForActionableDrift (CR-05/§4.2) — F*
P7 — SLARemediationWindow (CR-06) — TLA+ temporal
P8 — EscalationIssueStructure (CR-06a) — F* record
P9 — SafeguardDegradedModeOnUnavailability (§5) — TLA+
P10 — DriftReportEmittedOnDetection (§4.2 step 5) — F* postcondition
Behavioral Coverage Map
DualSourceConsultation(CR-01)TestFormal_P1_DualSourceConsultationNoUndocumentedFieldGeneration(CR-03)TestFormal_P2_NoUndocumentedFieldGenerationDriftRecordStructuralValidity(§4.5.1)TestFormal_P3_DriftRecordStructuralValidityDriftCategoryExhaustiveness(§4.5.1)TestFormal_P4_DriftCategoryExhaustivenessSchemaOnlyPropertyFlaggedAsDrift(CR-02)TestFormal_P5_SchemaOnlyPropertyFlaggedAsDriftCorrectionPRForActionableDrift(CR-05)TestFormal_P6_CorrectionPRForActionableDriftmissing_in_ghawandspec_mismatchrequire a corrective PR;missing_in_schemadoes notSLARemediationWindow(CR-06)TestFormal_P7_SLARemediationWindowEscalationIssueStructure(CR-06a)TestFormal_P8_EscalationIssueStructureSafeguardDegradedModeOnUnavailability(§5)TestFormal_P9_SafeguardDegradedModeOnUnavailabilityDriftReportEmittedOnDetection(§4.2)TestFormal_P10_DriftReportEmittedOnDetectionGenerated Test Suite
📄 `pkg/workflow/awf_config_drift_formal_test.go` — 623 lines, 10 test functions, 39 sub-cases
Key types (stubs — replace with real implementation):
Example test — P1 (CR-01 dual-source enforcement):
Example test — P7 (CR-06 SLA business-day window):
Full test file (623 lines) available at the path above. All 10 test functions follow the same table-driven pattern and cover P1–P10.
Usage
pkg/workflow/awf_config_drift_formal_test.go.// stubtypes with real implementations when available.go test ./pkg/workflow/... -run FormalContext
specs/awf-config-sources-spec.mdWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgSee Network Configuration for more information.