Formalize replace-label compliance model and fixture-backed conformance tests#44981
replace-label compliance model and fixture-backed conformance tests#44981Conversation
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>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
replace-label compliance model and fixture-backed conformance tests
There was a problem hiding this comment.
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
|
@copilot please run the Unresolved review feedback to address:
|
…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>
All five review threads addressed in commits
|
|
Unresolved review feedback to address:
Run: https://github.com/github/gh-aw/actions/runs/29161645125
|
…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>
|
@copilot please run the
|
Branch is already up to date with |
@copilot please run the
|
…eplace-label-compliance Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Branch merged up to date with |
🤖 PR Triage
Rationale: Non-draft, test-only additions formalizing replace-label compliance fixtures. Low risk, good description, no behavior changes. CI unknown — human review/approval likely quick. Triage run §29183606049
|
|
|
…eplace-label-compliance Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Branch merged up to date with |
🤖 PR Triage
CI fully green ✅. Formalizes replace-label compliance model with fixture-backed tests. +418/-21. Low risk, high quality — fast track.
|
|
@copilot please run the
|
…eplace-label-compliance Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Branch merged up to date with |
|
@copilot please run the Run: https://github.com/github/gh-aw/actions/runs/29196572530
|
Branch is already up to date with |
|
@copilot please run the Run: https://github.com/github/gh-aw/actions/runs/29200137487
|
Branch is already up to date with |
This PR codifies the
replace-labelcompliance 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
pkg/workflow/replace_label_formal_test.gofor:rl-001-glob-semantics.yamlrl-002-allowlist-enforcement.yamlrl-003-blocklist-ordering.yamlPredicate-level conformance coverage (P1–P15 + edges)
label_to_remove,label_to_add,repo)count < max, default max=5 behavior checks)item_number/issue_number/pr_number/pull_number)Spec-compliance documentation alignment
specs/replace-label-compliance/README.mdwith: