Skip to content

Address SPDD daily spec review: DriftRecord conformance tests, guard-policy dry-run report, spec gaps - #51135

Merged
pelikhan merged 3 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-08-07
Aug 7, 2026
Merged

Address SPDD daily spec review: DriftRecord conformance tests, guard-policy dry-run report, spec gaps#51135
pelikhan merged 3 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-08-07

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The daily SPDD spec review flagged several concrete gaps across specs/ and scratchpad/: an unimplemented compile-time guard-policy dry-run mode, missing DriftRecord conformance tests, and missing Norms/Safeguards/Entities sections in a few specifications.

Guard policy dry-run (gh aw compile --strict)

  • Added 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 --strict is set and the GitHub tool has guard-policy fields configured.
  • Wired into compileWorkflowFile in pkg/cli/compile_workflow_processor.go.
  • Resolves guard-policies-specification.md Open Question Add workflow: githubnext/agentics/weekly-research #4, previously marked "deferred."
$ gh aw compile --strict my-workflow.md
guard policy dry-run report for my-workflow.md:
  allowed-repos: owner/repo-a, owner/repo-b
  min-integrity: approved

DriftRecord conformance tests

  • Added pkg/workflow/awf_config_drift_test.go implementing TestDriftRecord_TDR001TDR010, covering all IDs listed in specs/awf-config-sources-compliance/README.md (go test -v -run "TestDriftRecord" ./pkg/workflow/).
  • Updated the compliance README to point at the now-implemented test file instead of a placeholder.

Compiler warning byte-fidelity

  • Added pkg/workflow/tools_validation_github_test.go asserting the lockdown/guard-policy compile warning stays byte-identical to the example message in github-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, ExecutionResult field 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 verifying T-AW-### compliance test.
  • scratchpad/guard-policies-specification.md: Open Question Add workflow: githubnext/agentics/weekly-research #4 decision updated to reflect the implemented --strict report.

Copilot AI linked an issue Aug 7, 2026 that may be closed by this pull request
9 tasks
Copilot AI and others added 2 commits August 7, 2026 16:32
…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
Copilot AI requested a review from pelikhan August 7, 2026 16:35
@pelikhan
pelikhan marked this pull request as ready for review August 7, 2026 16:38
Copilot AI balanced review requested due to automatic review settings August 7, 2026 16:38
@pelikhan
pelikhan merged commit ecda8ef into main Aug 7, 2026
@pelikhan
pelikhan deleted the copilot/spdd-daily-spec-work-plan-2026-08-07 branch August 7, 2026 16:38
Copilot stopped reviewing on behalf of pelikhan due to an error August 7, 2026 16:39

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

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 --strict compile-time guard-policy “dry-run report” and tests for its output.
  • Add conformance tests for the DriftRecord schema 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
}
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.1

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.

[spdd] Daily spec work plan - 2026-08-07

3 participants