Skip to content

[WIP] Formalize security and error handling for replace-label spec - #51129

Merged
pelikhan merged 2 commits into
mainfrom
copilot/formal-spec-replace-label
Aug 7, 2026
Merged

[WIP] Formalize security and error handling for replace-label spec#51129
pelikhan merged 2 commits into
mainfrom
copilot/formal-spec-replace-label

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
  • Add pkg/workflow/replace_label_security_formal_test.go with P1–P8 formal predicates (sanitization, rate-limit retry, REST label array, hard errors, server-side enforcement, token scope)
  • Run go test ./pkg/workflow/... -run TestFormalSec
  • Run make fmt / validation

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7deb91e6-9c90-4f01-8cdd-248ad3f2f8d7

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Triage Result

Category: test · Risk: low · Priority: low (score 28/100 — impact 12, urgency 8, quality 8)
Recommended action: defer

Notes: Draft, checklist-style WIP adding formal security tests for replace-label spec (P1–P8 predicates). No CI runs yet. Revisit once checklist items are completed and PR is marked ready.
Batch: wip-early (grouped with other early-WIP copilot PRs).

Generated by 🔧 PR Triage Agent · auto · 31.2 AIC · ⌖ 2.44 AIC · ⊞ 7.9K ·

@pelikhan
pelikhan marked this pull request as ready for review August 7, 2026 18:36
Copilot AI balanced review requested due to automatic review settings August 7, 2026 18:36
@pelikhan
pelikhan merged commit adb11e3 into main Aug 7, 2026
@pelikhan
pelikhan deleted the copilot/formal-spec-replace-label branch August 7, 2026 18:36

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 formal security and error-handling models for the replace-label safe-output specification.

Changes:

  • Adds P1–P8 formal predicates.
  • Covers sanitization, retries, REST failures, label constraints, enforcement, and token scope.
Show a summary per file
File Description
pkg/workflow/replace_label_security_formal_test.go Adds formal security and error-handling tests.

Review details

Tip

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

Suppressed comments (1)

pkg/workflow/replace_label_security_formal_test.go:36

  • This does not match the referenced standard safe-output sanitizer. sanitizeLabelContent strips complete ANSI sequences and applies Unicode hardening, while this loop removes only ESC and leaves strings such as [31mbug[0m; it also differs on embedded tabs/newlines. P1 therefore formalizes behavior that conflicts with RL-007. Please exercise the canonical sanitizer (for example through a JS harness) or mirror its full contract and vectors rather than defining a narrower sanitizer here.
		// C0 controls (including \t, \n, \r), DEL and C1 controls are removed.
		if r < 0x20 || r == 0x7f || (r >= 0x80 && r <= 0x9f) {
			continue
		}
		b.WriteRune(r)
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +11 to +14
// As with the sibling formal files, the helpers below are spec-level models of
// the semantics described in the specification, not wrappers around the
// production JavaScript handler (actions/setup/js/replace_label.cjs).
// Regressions in the handler itself are detected by the JavaScript test suite.
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[formal-spec] replace-label-spec.md — Formal model & test suite — 2026-08-07

3 participants