Skip to content

chore(codex): bootstrap PR for issue #4#5

Merged
stranske merged 2 commits intomainfrom
codex/issue-4
Dec 17, 2025
Merged

chore(codex): bootstrap PR for issue #4#5
stranske merged 2 commits intomainfrom
codex/issue-4

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Dec 17, 2025

Automated Status Summary

Scope

  • scripts/validate_fast.sh contains 12 TODO Phase 4 markers referencing Trend_Model_Project-specific features (SRC_FILES detection, autofix tests, coverage requirements) that are not applicable to this workflow repository. These dead code paths and stale references cause confusion and add maintenance burden.

Tasks

  • Remove all TODO Phase 4 markers and their associated dead/commented code blocks.
  • Remove SRC_FILES and AUTOFIX_FILES detection logic that references src/ directory patterns not present in this repo.
  • Update linting targets to use scripts/ and .github/ instead of src/ tests/.
  • Replace Python package-specific validation (coverage requirements, import tests) with workflow-specific checks (actionlint, YAML validation).
  • Ensure the script still runs successfully after cleanup.

Acceptance criteria

  • - grep -c "TODO Phase" scripts/validate_fast.sh returns 0.
  • - Script executes without errors: bash scripts/validate_fast.sh --help works.
  • - No references to src/ directory or Trend_Model_Project-specific patterns remain.
  • - Validation targets are appropriate for a workflow repository (scripts/, .github/).

Head SHA: 4ace6aa
Latest Runs: ❔ startup failure — Gate
Required: gate: ❔ startup failure

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ success View run
Gate ❔ startup failure View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ❌ failure View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ✅ success View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ success View run

Copilot AI review requested due to automatic review settings December 17, 2025 14:21
@stranske stranske added agent:codex Agent-created issues from Codex agents:keepalive Use to initiate keepalive functionality with agents autofix Opt-in automated formatting & lint remediation labels Dec 17, 2025
@stranske
Copy link
Copy Markdown
Owner Author

@codex Your objective is to satisfy the Acceptance Criteria by completing each Task within the defined Scope.

This round you MUST:

  1. Implement actual code or test changes that advance at least one incomplete task toward acceptance.
  2. Commit meaningful source code (.py, .yml, .js, etc.)—not just status/docs updates.
  3. Mark a task checkbox complete ONLY after verifying the implementation works.
  4. POST A REPLY COMMENT with completed checkboxes using the EXACT TEXT from the lists below.

CRITICAL - Checkbox Format:
When posting your reply, copy the exact checkbox text from the Tasks and Acceptance Criteria sections below. Do NOT paraphrase or summarize. The automation matches text exactly.

Example format for your reply:

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 is an automated bootstrap PR created by the agent workflow system for issue #4. The PR follows the standard pattern used by the repository's Codex automation infrastructure to initialize agent-managed work.

Key changes:

  • Adds a bootstrap marker file for Codex agent automation

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

@chatgpt-codex-connector
Copy link
Copy Markdown

Tasks

  • Remove all TODO Phase 4 markers and their associated dead/commented code blocks.
  • Remove SRC_FILES and AUTOFIX_FILES detection logic that references src/ directory patterns not present in this repo.
  • Update linting targets to use scripts/ and .github/ instead of src/ tests/.
  • Replace Python package-specific validation (coverage requirements, import tests) with workflow-specific checks (actionlint, YAML validation).
  • Ensure the script still runs successfully after cleanup.

Acceptance criteria

  • - grep -c "TODO Phase" scripts/validate_fast.sh returns 0.
  • - Script executes without errors: bash scripts/validate_fast.sh --help works.
  • - No references to src/ directory or Trend_Model_Project-specific patterns remain.
  • - Validation targets are appropriate for a workflow repository (scripts/, .github/).

Summary

  • Added a CLI help path and change detection for workflow YAML, plus YAML syntax validation backed by automatic PyYAML installation. scripts/validate_fast.shL18-L361
  • Reworked validation strategies to focus on scripts and .github workflows, running actionlint on workflow files and failing when linting cannot run, while dropping legacy src/autofix logic. scripts/validate_fast.shL158-L477

Testing

  • bash scripts/validate_fast.sh --help
  • bash scripts/validate_fast.sh

View task →

@stranske stranske merged commit e2d3568 into main Dec 17, 2025
99 of 100 checks passed
@stranske stranske deleted the codex/issue-4 branch December 22, 2025 17:03
stranske pushed a commit that referenced this pull request Dec 27, 2025
When copying agents-63-issue-intake.yml from Workflows to consumer repos,
it contains a LOCAL reference to reusable-agents-issue-bridge.yml that
doesn't exist in consumer repos and will cause issue intake to fail.

Added:
1. Critical warning in section 4.1b with:
   - Explanation of the problem
   - Before/after code showing what to change
   - Alternative: copy from Template instead (already correct)

2. New item #5 in Common Mistakes section

This was discovered when Manager-Database issue #49 and trip-planner
issue intake failed after copying agents-63-issue-intake.yml directly
from Workflows without fixing the local reference.
stranske added a commit that referenced this pull request Dec 27, 2025
When copying agents-63-issue-intake.yml from Workflows to consumer repos,
it contains a LOCAL reference to reusable-agents-issue-bridge.yml that
doesn't exist in consumer repos and will cause issue intake to fail.

Added:
1. Critical warning in section 4.1b with:
   - Explanation of the problem
   - Before/after code showing what to change
   - Alternative: copy from Template instead (already correct)

2. New item #5 in Common Mistakes section

This was discovered when Manager-Database issue #49 and trip-planner
issue intake failed after copying agents-63-issue-intake.yml directly
from Workflows without fixing the local reference.

Co-authored-by: GitHub Copilot <copilot@github.com>
stranske added a commit that referenced this pull request Dec 30, 2025
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.
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>
stranske added a commit that referenced this pull request Jan 1, 2026
- Fix tomlkit isinstance checks - use hasattr for duck typing (#3)
- Add type validation for python_version before str() conversion (#6)
- Fix redundant ternary operators in agents-guard.yml (3 instances) (#1)
- Fix authorIsCodeowner indentation in agents-guard.js (#4)
- Fix inconsistent array indentation in agents-guard.js (#5)
- Remove redundant instructions=[] reassignment in agents-guard.js (#7)
- Fix typo in keepalive_loop.js numbered list comment (#9)

All fixes applied to both main files and templates/consumer-repo.
See docs/CODE_QUALITY_ISSUES.md for issue tracking.
stranske added a commit that referenced this pull request Jan 1, 2026
* fix: address code quality issues from Copilot reviews

- Fix tomlkit isinstance checks - use hasattr for duck typing (#3)
- Add type validation for python_version before str() conversion (#6)
- Fix redundant ternary operators in agents-guard.yml (3 instances) (#1)
- Fix authorIsCodeowner indentation in agents-guard.js (#4)
- Fix inconsistent array indentation in agents-guard.js (#5)
- Remove redundant instructions=[] reassignment in agents-guard.js (#7)
- Fix typo in keepalive_loop.js numbered list comment (#9)

All fixes applied to both main files and templates/consumer-repo.
See docs/CODE_QUALITY_ISSUES.md for issue tracking.

* chore: archive resolved CODE_QUALITY_ISSUES.md
stranske added a commit that referenced this pull request Jan 1, 2026
- Fix tomlkit isinstance checks - use hasattr for duck typing (#3)
- Add type validation for python_version before str() conversion (#6)
- Fix redundant ternary operators in agents-guard.yml (3 instances) (#1)
- Fix authorIsCodeowner indentation in agents-guard.js (#4)
- Fix inconsistent array indentation in agents-guard.js (#5)
- Remove redundant instructions=[] reassignment in agents-guard.js (#7)
- Fix typo in keepalive_loop.js numbered list comment (#9)

All fixes applied to both main files and templates/consumer-repo.
See docs/CODE_QUALITY_ISSUES.md for issue tracking.
stranske added a commit that referenced this pull request Jan 1, 2026
* fix: address code quality issues from Copilot reviews

- Fix tomlkit isinstance checks - use hasattr for duck typing (#3)
- Add type validation for python_version before str() conversion (#6)
- Fix redundant ternary operators in agents-guard.yml (3 instances) (#1)
- Fix authorIsCodeowner indentation in agents-guard.js (#4)
- Fix inconsistent array indentation in agents-guard.js (#5)
- Remove redundant instructions=[] reassignment in agents-guard.js (#7)
- Fix typo in keepalive_loop.js numbered list comment (#9)

All fixes applied to both main files and templates/consumer-repo.
See docs/CODE_QUALITY_ISSUES.md for issue tracking.

* chore: archive resolved CODE_QUALITY_ISSUES.md

* fix: prevent useless follow-up issues when source lacks criteria

Add isMissingInfoGap() to detect verifier gaps that are about missing
source info rather than actual verification failures. These gaps (like
'Provide explicit acceptance criteria in the PR description') indicate
the source issue/PR lacked structured criteria, not that verification
found actual problems.

Updated hasSubstantiveContent check to filter out these 'missing info'
gaps, preventing creation of follow-up issues when there's nothing
actionable to fix.

Fixes issue #415 scenario where follow-up issues were created despite
having only placeholder content because the verifier gaps were about
missing source info.

Added 7 new tests:
- isMissingInfoGap() unit tests
- Integration tests for hasSubstantiveContent with missing info gaps

* fix: resolve mypy union-attr errors in resolve_mypy_pin.py

Use dict() to normalize tomlkit Table objects with type: ignore[call-overload]
comments to satisfy mypy type checking while preserving duck-typing
compatibility with tomlkit's custom container types.

Fixes mypy errors:
  tools/resolve_mypy_pin.py:36: error: Item "None" has no attribute "get" [union-attr]
  tools/resolve_mypy_pin.py:39: error: Item "None" has no attribute "get" [union-attr]

* fix: broaden type ignore to cover both arg-type and call-overload

Different mypy versions report different error codes for the same issue.
Use a combined ignore comment to handle both.

* fix: address bot review comments from PR #417

1. Remove redundant /i regex flags in isMissingInfoGap() since text
   is already lowercased via .toLowerCase()

2. Improve numbered list comment in keepalive_loop.js to clarify
   both 1., 2., 3. and 1), 2), 3) formats are matched

3. Fix ALL remaining redundant ternary operators for Number() conversion:
   - agents-guard.yml (3 instances - lines 314, 442 fixed)
   - health-44-gate-branch-protection.yml (1 instance)
   - agents_pr_meta_update_body.js (1 instance)
   - templates/consumer-repo agents-guard.yml (2 instances)

4. Add missing tests for formatSimpleFollowUpIssue hasSubstantiveContent
   with missing info gaps (2 new test cases)
stranske added a commit that referenced this pull request Jan 6, 2026
- Add 'mode' input: 'checkbox' (default) or 'evaluate' for LLM-based
- Add Python setup and langchain dependencies for evaluate mode
- Add pr_verifier.py execution with context and diff files
- Add PR comment posting with structured evaluation report
- Add unified verdict handling for both modes
- Update follow-up issue conditions for LLM verdicts (PASS/CONCERNS/FAIL)
- Update pull-requests permission to 'write' for commenting

Implements tasks #5 and #6 from issue #580:
- Update reusable-agents-verifier.yml to branch on mode=evaluate
- Add comment posting for evaluation results on the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:codex Agent-created issues from Codex agents:keepalive Use to initiate keepalive functionality with agents autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants