Skip to content

Formalize replace-label compliance model and fixture-backed conformance tests#44981

Merged
pelikhan merged 16 commits into
mainfrom
copilot/formal-spec-replace-label-compliance
Jul 13, 2026
Merged

Formalize replace-label compliance model and fixture-backed conformance tests#44981
pelikhan merged 16 commits into
mainfrom
copilot/formal-spec-replace-label-compliance

Conversation

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This PR codifies the replace-label compliance fixtures as executable formal predicates and aligns the spec-facing compliance README with the generated Go test suite. It closes gaps between RL fixture semantics and in-repo conformance coverage by making the predicate/test mapping explicit.

  • Formal fixture execution for RL-001/002/003

    • Added fixture-backed runners in pkg/workflow/replace_label_formal_test.go for:
      • rl-001-glob-semantics.yaml
      • rl-002-allowlist-enforcement.yaml
      • rl-003-blocklist-ordering.yaml
    • Added fixture parsing guards (malformed YAML, empty scenarios).
  • Predicate-level conformance coverage (P1–P15 + edges)

    • Added/expanded focused formal tests for:
      • required fields and length bounds (label_to_remove, label_to_add, repo)
      • count gate exclusivity (count < max, default max=5 behavior checks)
      • label-set arithmetic (remove/add semantics, dedup, missing-remove behavior)
      • staged semantics, blocklist symmetry, required-label/title-prefix gates
      • alias resolution (item_number / issue_number / pr_number / pull_number)
      • cross-repo restriction and exact-glob edge behavior
      • hard-error predicate modeling for REST failure outcomes.
  • Spec-compliance documentation alignment

    • Updated specs/replace-label-compliance/README.md with:
      • formal model section
      • behavioral coverage map (predicate → test function)
      • generated test suite reference for in-process Go conformance.
func TestFormalGlobSemantics(t *testing.T) {
	runReplaceLabelFixture(t, "rl-001-glob-semantics.yaml")
}

Generated by 👨‍🍳 PR Sous Chef · 8.27 AIC · ⌖ 6.32 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI and others added 5 commits July 11, 2026 16:09
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review July 11, 2026 16:32
Copilot AI review requested due to automatic review settings July 11, 2026 16:32
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README for replace-label compliance specification Formalize replace-label compliance model and fixture-backed conformance tests Jul 11, 2026
Copilot AI requested a review from pelikhan July 11, 2026 16:35

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 compliance coverage and documentation for replace-label behavior.

Changes:

  • Loads YAML compliance fixtures into Go tests.
  • Adds predicate and edge-case tests.
  • Documents the formal model and test mapping.
Show a summary per file
File Description
pkg/workflow/replace_label_formal_test.go Adds fixture loading and formal tests.
specs/replace-label-compliance/README.md Documents predicates and coverage mapping.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 5
  • Review effort level: Medium

Comment thread pkg/workflow/replace_label_formal_test.go Outdated
Comment thread pkg/workflow/replace_label_formal_test.go
Comment thread pkg/workflow/replace_label_formal_test.go Outdated
Comment thread pkg/workflow/replace_label_formal_test.go Outdated
Comment thread pkg/workflow/replace_label_formal_test.go Outdated
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks when done.

Unresolved review feedback to address:

Generated by 👨‍🍳 PR Sous Chef · 22.6 AIC · ⌖ 7.57 AIC · ⊞ 4.2K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 11, 2026 17:22
…view feedback

- formalMatchAnyPattern: replace path.Match with production-faithful regex
  (escapes brackets to literals, * spans any char) matching matchesSimpleGlob
- rl-001 fixture: update char-class scenario to expect deny, reflecting that
  production implementation escapes brackets rather than treating them as
  character classes
- replaceLabelExpected: add ErrorCode/*int and Reason/string fields decoded
  from fixture YAML
- formalEvaluateFixtureScenario: return error instead of bool so callers can
  distinguish blocked-pattern from allowlist denial
- runReplaceLabelFixture: switch on decision, fail on unknown values, assert
  error_code(-32003/-32002) ordering signal for deny scenarios
- formalResolveItemNumberAliases: stop at first present alias (even non-positive)
  matching production temporary_id.cjs precedence behaviour
- add formalRunReplaceLabel model + TestFormalStagedMode_NoWriteAPI to assert
  write API is not called in staged mode

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
… comment

- Add source citation (escapeRegexChars in glob_pattern_helpers.cjs) to the
  escaped character list in formalSimpleGlobToRegex
- Clarify formalResolveItemNumberAliases inline comment: first present alias
  returns 0 for non-positive without falling through

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks when done.

Unresolved review feedback to address:...

All five review threads addressed in commits 9a66ac5 and f0b3dac:

  1. Glob matcher aligned with productionformalMatchAnyPattern now uses formalSimpleGlobToRegex, a Go port of glob_pattern_helpers.cjs:simpleGlobToRegex (pathMode=false): brackets are escaped to literals, * expands to .*, matching is case-insensitive. The RL-001 char-class scenario updated to expect deny (production escapes brackets; the character-class scenario was a false green).

  2. Blocklist ordering signal decodedreplaceLabelExpected now includes ErrorCode *int and Reason string decoded from fixture YAML. formalEvaluateFixtureScenario returns an error instead of bool. The fixture runner asserts error_code -32003 → error contains "blocked pattern" and -32002 → error contains "allowed list", letting TestFormalBlocklistOrdering verify ordering rather than just the binary allow/deny.

  3. Unknown decision values fail the subtestrunReplaceLabelFixture now uses a switch on decision and calls t.Fatalf for any value that is not "allow" or "deny".

  4. Staged mode write-API assertion — Added formalRunReplaceLabel(staged bool, onWrite func()) model function and TestFormalStagedMode_NoWriteAPI which asserts the onWrite counter stays at zero when staged=true. If the staged-mode branch were removed, the counter would reach 1 and the test would fail.

  5. Alias resolution precedenceformalResolveItemNumberAliases now stops at the first present alias key even when the value is non-positive (returns 0 without falling through), matching temporary_id.cjs behaviour.

Copilot AI requested a review from gh-aw-bot July 11, 2026 17:25
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks when done.

Unresolved review feedback to address:

Run: https://github.com/github/gh-aw/actions/runs/29161645125

Generated by 👨‍🍳 PR Sous Chef · 6.92 AIC · ⌖ 7.23 AIC · ⊞ 4.2K ·
Comment /souschef to run again

…Mode

The direct struct construction in TestFormalStagedMode (lines 571-573) was
flagged in review as not exercising the handler. The new TestFormalStagedMode_NoWriteAPI
already asserts these properties via formalRunReplaceLabel, making the direct
construction redundant. Remove it so TestFormalStagedMode focuses on config
parsing and the write-API guard is tested by the dedicated test.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback if any, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 14.1 AIC · ⌖ 8.64 AIC · ⊞ 7.5K ·
Comment /souschef to run again

…eplace-label-compliance

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review feedback if any, and rerun checks once the branch is up to date.

...

Branch merged up to date with main (commit e1659c4, includes docs homepage updates). All 5 review threads remain resolved. Local make fmt, make test-unit, and make agent-report-progress all pass. CI needs a human re-trigger against the new HEAD before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29196572530

Generated by 👨‍🍳 PR Sous Chef · 8.11 AIC · ⌖ 5.41 AIC · ⊞ 4.2K ·
Comment /souschef to run again

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29196572530...

Branch is already up to date with main (HEAD e1659c4). All 5 review threads remain resolved. No new review feedback to address. CI needs a human re-trigger before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29200137487

Generated by 👨‍🍳 PR Sous Chef · 8.57 AIC · ⌖ 7.74 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29200137487...

Branch is already up to date with main (HEAD e1659c4). All 5 review threads remain resolved. No new review feedback to address. CI needs a human re-trigger before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

\n@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 5.74 AIC · ⌖ 6.61 AIC · ⊞ 7.5K ·
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29214279165

Generated by 👨‍🍳 PR Sous Chef · 13.2 AIC · ⌖ 8.72 AIC · ⊞ 7.5K ·
Comment /souschef to run again

…eplace-label-compliance

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.
...

Branch merged up to date with main (now includes private-to-public-flows feature #45113 and gVisor bump #45101). All 5 review threads remain resolved. Local make fmt, make test-unit, and make agent-report-progress all pass. CI needs a human re-trigger before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, review the current PR state, address any remaining feedback, and rerun checks once the branch is ready for maintainer review.

Run: https://github.com/github/gh-aw/actions/runs/29220275355

Generated by 👨‍🍳 PR Sous Chef · 8.27 AIC · ⌖ 6.32 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill, review the current PR state, address any remaining feedback, and rerun checks once the branch is ready for maintainer review.
...

Branch is up to date with main (HEAD 8f83a18, includes sbx credential refresh step #45146). All 5 review threads remain resolved. Local make fmt, make test-unit, and make agent-report-progress all pass. The action_required CI conclusions on the branch are GitHub's workflow approval gate for bot-triggered PRs — not test failures. CI needs a human re-trigger before merge.

@pelikhan pelikhan merged commit 32ef3f3 into main Jul 13, 2026
26 checks passed
@pelikhan pelikhan deleted the copilot/formal-spec-replace-label-compliance branch July 13, 2026 06:25
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.9

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-compliance/README.md — Formal model & test suite — 2026-07-11

4 participants