Skip to content

Add formal RS-05a checkout gate coverage - #52103

Merged
pelikhan merged 2 commits into
mainfrom
copilot/formal-spec-security-architecture-summary
Aug 11, 2026
Merged

Add formal RS-05a checkout gate coverage#52103
pelikhan merged 2 commits into
mainfrom
copilot/formal-spec-security-architecture-summary

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

RS-05a requires workflow_dispatch runs with aw_context.item_type == "pull_request" to gate PR checkout on repository scope, actor trust, parse resilience, ref isolation, and a valid PR number. Existing SG formal tests covered SG-01..SG-07 but did not dedicatedly formalize this runtime checkout path.

  • Formal RS-05a test suite

    • Adds pkg/workflow/security_architecture_rs05a_formal_test.go.
    • Exercises the existing JS checkout implementation from Go via a small Node bridge.
    • Covers all requested RS-05a predicates: all-pass conjunction, repo mismatch/absence, actor trust, malformed JSON, ref isolation, shell-safe exec, missing/zero item_number, and non-PR bypass.
  • Runtime behavior asserted

    • Checkout proceeds only when all applicable gates pass.
    • Cross-repo aw_context.repo skips checkout with a warning.
    • Forked runtime repos and insufficient actor permissions block checkout.
    • Bot/app actors satisfy the actor trust gate.
    • PR refs are fetched only through array-based git fetch origin +refs/pull/<N>/head:....
func TestFormalRS05a_RefIsolationUsesPullHeadRef(t *testing.T) {
    result := runRS05aBridge(t, rs05aDefaultBridgeScenario(t, map[string]any{
        "item_type":   "pull_request",
        "item_number": 456,
        "repo":        "test-owner/test-repo",
    }))

    assertRS05aCheckoutSucceeded(t, result)
    assertRS05aFetchedPullHeadRef(t, result, 456)
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add formal model and test suite for security architecture Add formal RS-05a checkout gate coverage Aug 11, 2026
Copilot AI requested a review from pelikhan August 11, 2026 16:08
@pelikhan
pelikhan marked this pull request as ready for review August 11, 2026 17:20
Copilot AI balanced review requested due to automatic review settings August 11, 2026 17:20

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

Adds dedicated formal test coverage for the existing RS-05a runtime PR checkout security gate.

Changes:

  • Adds Node-bridged Go tests for repository, actor, parsing, ref, and PR-number validation.
  • Verifies safe bypass and checkout behavior.
Show a summary per file
File Description
pkg/workflow/security_architecture_rs05a_formal_test.go Adds comprehensive RS-05a runtime checkout tests and helpers.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage: #52103

  • Category: test
  • Risk: low
  • Priority score: 53/100 (impact 15/50, urgency 20/30, quality 18/20) → medium
  • Recommended action: fast_track

Automated triage — see labels for machine-readable classification.

Generated by 🔧 PR Triage Agent · auto · 45 AIC · ⌖ 2.09 AIC · ⊞ 7.8K ·

@pelikhan
pelikhan merged commit 901be67 into main Aug 11, 2026
31 checks passed
@pelikhan
pelikhan deleted the copilot/formal-spec-security-architecture-summary branch August 11, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[formal-spec] security-architecture-spec-summary.md — Formal model & test suite — 2026-08-11

3 participants