Address SPDD daily spec review: DriftRecord conformance tests, guard-policy dry-run report, spec gaps - #51135
Merged
Conversation
9 tasks
…ort, spec sections Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review daily SPDD spec files for gaps and validations
Address SPDD daily spec review: DriftRecord conformance tests, guard-policy dry-run report, spec gaps
Aug 7, 2026
pelikhan
marked this pull request as ready for review
August 7, 2026 16:38
Copilot stopped reviewing on behalf of
pelikhan due to an error
August 7, 2026 16:39
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
This PR improves spec ↔ implementation traceability by documenting verified normative behaviors and adding compile-time/test enforcement for guard-policy and DriftRecord conformance.
Changes:
- Add a
--strictcompile-time guard-policy “dry-run report” and tests for its output. - Add conformance tests for the
DriftRecordschema and required follow-on behaviors. - Update spec/README text to reflect implemented test coverage and verification links.
Show a summary per file
| File | Description |
|---|---|
| specs/awf-config-sources-compliance/README.md | Updates DriftRecord conformance test location/IDs and run instructions wording. |
| specs/aw-harness.md | Adds explicit test traceability citations (T-AW-002/003/006/007) to normative responses. |
| scratchpad/safe-outputs-specification.md | Adds “Norms” and “Entities” sections and TOC entries to clarify normative language and schema types. |
| scratchpad/guard-policies-specification.md | Updates decision record to reflect implemented compile-time dry-run report. |
| scratchpad/github-mcp-access-control-specification.md | Adds guard-policy malformed-config safeguards + documents lockdown precedence reporting. |
| pkg/workflow/tools_validation_github_test.go | Adds golden-text test to keep lockdown/guard-policy warning byte-identical to spec example. |
| pkg/workflow/awf_config_drift_test.go | Adds DriftRecord schema + behavioral conformance tests (T-DR-001..T-DR-010). |
| pkg/cli/compile_workflow_processor.go | Emits guard-policy dry-run report during compile (non-JSON output). |
| pkg/cli/compile_guard_policy_report.go | Implements guard-policy dry-run report building/formatting/printing. |
| pkg/cli/compile_guard_policy_report_test.go | Adds unit tests for report generation + strict-mode printing behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 5
- Review effort level: Lite
Comment on lines
+188
to
+191
| // Emit a compile-time guard-policy dry-run report in --strict mode. | ||
| if !opts.jsonOutput { | ||
| printGuardPolicyDryRunReport(filepath.Base(resolvedFile), workflowData, opts.strict) | ||
| } |
Comment on lines
+36
to
+41
| hasRepos := github.AllowedRepos != nil || github.Repos != nil | ||
| hasMinIntegrity := github.MinIntegrity != "" | ||
| hasBlockedUsers := len(github.BlockedUsers) > 0 || github.BlockedUsersExpr != "" | ||
| hasApprovalLabels := len(github.ApprovalLabels) > 0 || github.ApprovalLabelsExpr != "" | ||
| hasTrustedUsers := len(github.TrustedUsers) > 0 || github.TrustedUsersExpr != "" | ||
| return hasRepos || hasMinIntegrity || hasBlockedUsers || hasApprovalLabels || hasTrustedUsers |
Comment on lines
+17
to
+37
| func captureStderrForGuardPolicyReportTest(fn func()) string { | ||
| old := os.Stderr | ||
| r, w, err := os.Pipe() | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| os.Stderr = w | ||
|
|
||
| fn() | ||
|
|
||
| if err := w.Close(); err != nil { | ||
| panic(err) | ||
| } | ||
| os.Stderr = old | ||
|
|
||
| out, err := io.ReadAll(r) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| return string(out) | ||
| } |
Comment on lines
+42
to
+44
| if _, err := time.Parse(time.RFC3339, r.DetectedAt); err != nil { | ||
| return assertError("detected_at must be a valid ISO 8601 UTC timestamp: " + err.Error()) | ||
| } |
Comment on lines
+55
to
+63
| func validateDriftRecordJSONStrict(raw []byte) (driftRecord, error) { | ||
| var r driftRecord | ||
| dec := json.NewDecoder(bytes.NewReader(raw)) | ||
| dec.DisallowUnknownFields() | ||
| if err := dec.Decode(&r); err != nil { | ||
| return driftRecord{}, err | ||
| } | ||
| return r, nil | ||
| } |
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The daily SPDD spec review flagged several concrete gaps across
specs/andscratchpad/: an unimplemented compile-time guard-policy dry-run mode, missingDriftRecordconformance tests, and missing Norms/Safeguards/Entities sections in a few specifications.Guard policy dry-run (
gh aw compile --strict)pkg/cli/compile_guard_policy_report.go: builds and prints a per-workflow guard-policy summary (allowed-repos, min-integrity, blocked/trusted users, approval-labels, lockdown precedence) to stderr when--strictis set and the GitHub tool has guard-policy fields configured.compileWorkflowFileinpkg/cli/compile_workflow_processor.go.guard-policies-specification.mdOpen Question Add workflow: githubnext/agentics/weekly-research #4, previously marked "deferred."DriftRecord conformance tests
pkg/workflow/awf_config_drift_test.goimplementingTestDriftRecord_TDR001–TDR010, covering all IDs listed inspecs/awf-config-sources-compliance/README.md(go test -v -run "TestDriftRecord" ./pkg/workflow/).Compiler warning byte-fidelity
pkg/workflow/tools_validation_github_test.goasserting the lockdown/guard-policy compile warning stays byte-identical to the example message ingithub-mcp-access-control-specification.md§9.5.2.Spec doc gaps
scratchpad/safe-outputs-specification.md: added §2.4 Norms (RFC-2119 usage conventions) and §3.6 Entities (SafeOutputRequest,GuardrailViolation,ExecutionResultfield tables).scratchpad/github-mcp-access-control-specification.md: added §9.6 Safeguards (fail-closed behavior for malformed guard policy) and §9.7 Open Questions, with a Decision/Rationale record covering the dry-run report's handling of lockdown precedence.specs/aw-harness.md: cross-linked each §11.2 safeguard bullet to its verifyingT-AW-###compliance test.scratchpad/guard-policies-specification.md: Open Question Add workflow: githubnext/agentics/weekly-research #4 decision updated to reflect the implemented--strictreport.