Skip to content

fix: strip checkboxes from scope section in follow-up issues#322

Merged
stranske merged 8 commits intomainfrom
fix/scope-checkbox-stripping
Dec 30, 2025
Merged

fix: strip checkboxes from scope section in follow-up issues#322
stranske merged 8 commits intomainfrom
fix/scope-checkbox-stripping

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Dec 30, 2025

Summary

Strip checkboxes from scope sections and add source context visibility for Codex.

Changes

1. Scope Checkbox Stripping

Scope sections are informational, not actionable checkboxes. This PR:

  • Adds stripCheckboxesFromScope() to convert - [ ] text to - text in scope sections
  • Updates the scope placeholder from checkbox to italicized text
  • Fixes verifier issue formatting to use plain bullets for scope items

2. Source Context for Codex Agent

When Codex works on a PR, it may need context from linked issues/PRs. This PR:

  • Adds extractSourceSection() to parse Source links from PR body
  • Updates buildTaskAppendix() to include "Source Context" section in agent prompt
  • Adds CONTEXT TIP to keepalive-instruction.md about checking linked issues/PRs

Files Changed

Scope checkbox stripping:

  • .github/scripts/verifier_issue_formatter.js - Add stripCheckboxesFromScope() function
  • .github/scripts/issue_scope_parser.js - Update scope placeholder to italicized text
  • templates/consumer-repo/.github/scripts/issue_scope_parser.js - Sync template update

Source context for Codex:

  • .github/scripts/keepalive_loop.js - Add extractSourceSection() and update buildTaskAppendix()
  • .github/templates/keepalive-instruction.md - Add CONTEXT TIP about source links

Tests:

  • .github/scripts/__tests__/verifier-issue-formatter.test.js - Tests for checkbox stripping
  • .github/scripts/__tests__/issue_scope_parser.test.js - Update placeholder test
  • .github/scripts/__tests__/keepalive-loop.test.js - 5 new tests for source extraction

Testing

All 424 tests passing (58 + 5 new = 63 tests related to these changes).

Scope is informational context, not actionable items to check off.

1. Add stripCheckboxesFromScope() function that:
   - Converts '- [ ] text' to '- text' (plain bullets)
   - Filters out placeholder content entirely
   - Removes empty lines

2. Update PR_META_FALLBACK_PLACEHOLDERS.scope:
   - Change from '- [ ] Scope section missing...' to italicized text
   - Matches standard PLACEHOLDERS.scope pattern

3. Update consumer repo template with same placeholder change

4. Update test to match new placeholder format

This ensures scope sections in:
- PR Automated Status Summary (via issue_scope_parser.js)
- Verifier follow-up issues (via verifier_issue_formatter.js)

...display as informational text rather than checkbox items.
Copilot AI review requested due to automatic review settings December 30, 2025 16:08
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #322. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 30, 2025

Automated Status Summary

Head SHA: c4d8c7c
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 0.00%
Baseline 85.00%
Delta -85.00%
Minimum 70.00%
Status ❌ Below minimum

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 30, 2025

🤖 Keepalive Loop Status

PR #322 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Gate success
Tasks 0/0 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an issue where scope sections in follow-up issues contained checkboxes that users couldn't interact with meaningfully. Since scope is informational rather than actionable, the PR removes checkboxes from scope content and updates placeholders to use italicized text instead of checkbox format.

Key Changes:

  • Added stripCheckboxesFromScope() function to convert checkbox items to plain bullets in scope sections
  • Changed scope placeholder from - [ ] Scope section missing... to _Scope section missing..._ (italicized)
  • Applied changes consistently across main codebase and consumer repo templates

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/scripts/verifier_issue_formatter.js Implements stripCheckboxesFromScope() function and applies it to scope section generation in follow-up issues
.github/scripts/issue_scope_parser.js Updates PR_META_FALLBACK_PLACEHOLDERS.scope to use italicized text format instead of checkbox
templates/consumer-repo/.github/scripts/issue_scope_parser.js Mirrors the placeholder format change for consistency in consumer repos
.github/scripts/__tests__/issue_scope_parser.test.js Updates test expectations to match the new italicized placeholder format

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Add extractSourceSection() to parse Source section from PR body and
include it in buildTaskAppendix(). This gives Codex visibility into
linked parent issues and original PRs for additional context.

Changes:
- Add extractSourceSection() function to extract Source links from PR body
- Update buildTaskAppendix() to accept options.prBody parameter
- Add 'Source Context' section to agent prompt when Source links present
- Add CONTEXT TIP to keepalive-instruction.md template
- Add 5 new tests for source section extraction

When a PR has a Source section with links like:
- Original PR: #123
- Parent issue: #456

The agent prompt now includes these as 'Source Context' so Codex
knows to check linked issues/PRs for additional background.
The src/trend_analysis/ directory contains CI test fixtures used to
exercise the autofix pipeline workflows - not production code. These
files (e.g., _autofix_trigger_sample.py, _ci_probe_faults.py) were
showing 0% coverage and artificially dragging down overall metrics.

Add 'src/trend_analysis/*' to [tool.coverage.run].omit patterns.
These CI autofix test fixtures were at risk of being mistakenly deleted
or flagged as orphaned code. The README explains:
- Why these files exist (autofix pipeline testing)
- Why they're excluded from coverage
- Which tests use them
@stranske stranske added the autofix:bot-comments Trigger bot comment handler to address review comments label Dec 30, 2025
The Workflows repo was missing the caller workflow for the bot comment
handler - only the reusable version existed. This meant the
'autofix:bot-comments' label had no effect.

Copied from templates/consumer-repo/.github/workflows/ to enable:
- Manual trigger via 'autofix:bot-comments' label
- Automatic trigger after Gate completion for agent PRs
- Manual dispatch via workflow_dispatch
@github-actions
Copy link
Copy Markdown
Contributor

✅ Codex Completion Checkpoint

Commit: 6c28afe
Recorded: 2025-12-30T16:41:39.647Z

No new completions recorded this round.

About this comment

This comment is automatically generated to track task completions.
The Automated Status Summary reads these checkboxes to update PR progress.
Do not edit this comment manually.

@github-actions github-actions bot added autofix Opt-in automated formatting & lint remediation and removed autofix:escalated labels Dec 30, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 30, 2025

Status | ✅ no new diagnostics
History points | 1
Timestamp | 2025-12-30 16:50:08 UTC
Report artifact | autofix-report-pr-322
Remaining | 0
New | 0
No additional artifacts

…r bug

Addresses 3 review comments from Copilot and Codex:

1. **Copilot (regex)**: Changed `\s+` to `\s*` in checkbox pattern to handle
   edge cases where space after bracket is missing (e.g., `- [ ]text`)

2. **Copilot (tests)**: Added 11 new tests for `stripCheckboxesFromScope()`:
   - Checkbox-to-bullet conversion (unchecked, x, X)
   - Preservation of indentation
   - Filtering of placeholder content
   - Handling of empty lines and null input
   - Edge case: no space after bracket

3. **Codex P1 (scope placeholder alignment)**: Fixed critical regression where
   `agents_pr_meta_update_body.js` was still emitting checkbox format for scope
   fallback while `issue_scope_parser.js` changed to italicized format.
   Scope is now treated as informational (plain text), not actionable (checkbox).

Tests: 471 passing (up from 424)
@stranske stranske temporarily deployed to agent-high-privilege December 30, 2025 16:49 — with GitHub Actions Inactive
@stranske stranske merged commit a1d3517 into main Dec 30, 2025
37 checks passed
@stranske stranske deleted the fix/scope-checkbox-stripping branch December 30, 2025 16:54
stranske added a commit that referenced this pull request Dec 30, 2025
* fix: strip checkboxes from scope section in verifier follow-up issues

Scope is informational context, not actionable items to check off.

1. Add stripCheckboxesFromScope() function that:
   - Converts '- [ ] text' to '- text' (plain bullets)
   - Filters out placeholder content entirely
   - Removes empty lines

2. Update PR_META_FALLBACK_PLACEHOLDERS.scope:
   - Change from '- [ ] Scope section missing...' to italicized text
   - Matches standard PLACEHOLDERS.scope pattern

3. Update consumer repo template with same placeholder change

4. Update test to match new placeholder format

This ensures scope sections in:
- PR Automated Status Summary (via issue_scope_parser.js)
- Verifier follow-up issues (via verifier_issue_formatter.js)

...display as informational text rather than checkbox items.

* feat(keepalive): include Source section links in agent prompt

Add extractSourceSection() to parse Source section from PR body and
include it in buildTaskAppendix(). This gives Codex visibility into
linked parent issues and original PRs for additional context.

Changes:
- Add extractSourceSection() function to extract Source links from PR body
- Update buildTaskAppendix() to accept options.prBody parameter
- Add 'Source Context' section to agent prompt when Source links present
- Add CONTEXT TIP to keepalive-instruction.md template
- Add 5 new tests for source section extraction

When a PR has a Source section with links like:
- Original PR: #123
- Parent issue: #456

The agent prompt now includes these as 'Source Context' so Codex
knows to check linked issues/PRs for additional background.

* fix(coverage): exclude src/trend_analysis from coverage metrics

The src/trend_analysis/ directory contains CI test fixtures used to
exercise the autofix pipeline workflows - not production code. These
files (e.g., _autofix_trigger_sample.py, _ci_probe_faults.py) were
showing 0% coverage and artificially dragging down overall metrics.

Add 'src/trend_analysis/*' to [tool.coverage.run].omit patterns.

* docs: add README explaining src/trend_analysis test fixtures

These CI autofix test fixtures were at risk of being mistakenly deleted
or flagged as orphaned code. The README explains:
- Why these files exist (autofix pipeline testing)
- Why they're excluded from coverage
- Which tests use them

* feat: add agents-bot-comment-handler workflow to Workflows repo

The Workflows repo was missing the caller workflow for the bot comment
handler - only the reusable version existed. This meant the
'autofix:bot-comments' label had no effect.

Copied from templates/consumer-repo/.github/workflows/ to enable:
- Manual trigger via 'autofix:bot-comments' label
- Automatic trigger after Gate completion for agent PRs
- Manual dispatch via workflow_dispatch

* chore(codex-autofix): apply updates (PR #322)

* fix: address bot review comments - regex, tests, and scope placeholder bug

Addresses 3 review comments from Copilot and Codex:

1. **Copilot (regex)**: Changed `\s+` to `\s*` in checkbox pattern to handle
   edge cases where space after bracket is missing (e.g., `- [ ]text`)

2. **Copilot (tests)**: Added 11 new tests for `stripCheckboxesFromScope()`:
   - Checkbox-to-bullet conversion (unchecked, x, X)
   - Preservation of indentation
   - Filtering of placeholder content
   - Handling of empty lines and null input
   - Edge case: no space after bracket

3. **Codex P1 (scope placeholder alignment)**: Fixed critical regression where
   `agents_pr_meta_update_body.js` was still emitting checkbox format for scope
   fallback while `issue_scope_parser.js` changed to italicized format.
   Scope is now treated as informational (plain text), not actionable (checkbox).

Tests: 471 passing (up from 424)

* feat: ask Codex to post explicit task completion markers

Add instruction #5 and CRITICAL section to keepalive-instruction.md
asking Codex to output '✅ Completed: [task text]' in final summary.

This enables reliable reconciliation parsing for completed tasks.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
stranske added a commit that referenced this pull request Dec 30, 2025
* fix: strip checkboxes from scope section in verifier follow-up issues

Scope is informational context, not actionable items to check off.

1. Add stripCheckboxesFromScope() function that:
   - Converts '- [ ] text' to '- text' (plain bullets)
   - Filters out placeholder content entirely
   - Removes empty lines

2. Update PR_META_FALLBACK_PLACEHOLDERS.scope:
   - Change from '- [ ] Scope section missing...' to italicized text
   - Matches standard PLACEHOLDERS.scope pattern

3. Update consumer repo template with same placeholder change

4. Update test to match new placeholder format

This ensures scope sections in:
- PR Automated Status Summary (via issue_scope_parser.js)
- Verifier follow-up issues (via verifier_issue_formatter.js)

...display as informational text rather than checkbox items.

* feat(keepalive): include Source section links in agent prompt

Add extractSourceSection() to parse Source section from PR body and
include it in buildTaskAppendix(). This gives Codex visibility into
linked parent issues and original PRs for additional context.

Changes:
- Add extractSourceSection() function to extract Source links from PR body
- Update buildTaskAppendix() to accept options.prBody parameter
- Add 'Source Context' section to agent prompt when Source links present
- Add CONTEXT TIP to keepalive-instruction.md template
- Add 5 new tests for source section extraction

When a PR has a Source section with links like:
- Original PR: #123
- Parent issue: #456

The agent prompt now includes these as 'Source Context' so Codex
knows to check linked issues/PRs for additional background.

* fix(coverage): exclude src/trend_analysis from coverage metrics

The src/trend_analysis/ directory contains CI test fixtures used to
exercise the autofix pipeline workflows - not production code. These
files (e.g., _autofix_trigger_sample.py, _ci_probe_faults.py) were
showing 0% coverage and artificially dragging down overall metrics.

Add 'src/trend_analysis/*' to [tool.coverage.run].omit patterns.

* docs: add README explaining src/trend_analysis test fixtures

These CI autofix test fixtures were at risk of being mistakenly deleted
or flagged as orphaned code. The README explains:
- Why these files exist (autofix pipeline testing)
- Why they're excluded from coverage
- Which tests use them

* feat: add agents-bot-comment-handler workflow to Workflows repo

The Workflows repo was missing the caller workflow for the bot comment
handler - only the reusable version existed. This meant the
'autofix:bot-comments' label had no effect.

Copied from templates/consumer-repo/.github/workflows/ to enable:
- Manual trigger via 'autofix:bot-comments' label
- Automatic trigger after Gate completion for agent PRs
- Manual dispatch via workflow_dispatch

* chore(codex-autofix): apply updates (PR #322)

* fix: address bot review comments - regex, tests, and scope placeholder bug

Addresses 3 review comments from Copilot and Codex:

1. **Copilot (regex)**: Changed `\s+` to `\s*` in checkbox pattern to handle
   edge cases where space after bracket is missing (e.g., `- [ ]text`)

2. **Copilot (tests)**: Added 11 new tests for `stripCheckboxesFromScope()`:
   - Checkbox-to-bullet conversion (unchecked, x, X)
   - Preservation of indentation
   - Filtering of placeholder content
   - Handling of empty lines and null input
   - Edge case: no space after bracket

3. **Codex P1 (scope placeholder alignment)**: Fixed critical regression where
   `agents_pr_meta_update_body.js` was still emitting checkbox format for scope
   fallback while `issue_scope_parser.js` changed to italicized format.
   Scope is now treated as informational (plain text), not actionable (checkbox).

Tests: 471 passing (up from 424)

* feat: ask Codex to post explicit task completion markers

Add instruction #5 and CRITICAL section to keepalive-instruction.md
asking Codex to output '✅ Completed: [task text]' in final summary.

This enables reliable reconciliation parsing for completed tasks.

* sync: add keepalive-instruction.md template to sync manifest

Consumer repos had their own copies that weren't being updated.
Now the template will sync automatically with other consumer files.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix:bot-comments Trigger bot comment handler to address review comments autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants