Skip to content

Fix tasks subsystem parity coverage regression on top of PR #154#166

Open
badMade wants to merge 2 commits into
jules-5719735511058002206-6a57486bfrom
badmade/fix-issues-from-codex-review-#154
Open

Fix tasks subsystem parity coverage regression on top of PR #154#166
badMade wants to merge 2 commits into
jules-5719735511058002206-6a57486bfrom
badmade/fix-issues-from-codex-review-#154

Conversation

@badMade
Copy link
Copy Markdown
Owner

@badMade badMade commented May 5, 2026

Motivation

  • Prevent run_parity_audit() from erroneously treating the presence of task.py as coverage for the archived tasks directory, which masked missing parity for the tasks subsystem.

Description

  • Update ARCHIVE_DIR_MAPPINGS['tasks'] from 'task.py' to 'tasks' in src/parity_audit.py so directory parity is tracked independently and commit the change.

Testing

  • Ran python3 -m src.parity_audit and a small snippet (from src.parity_audit import run_parity_audit) which showed directory_coverage at 34/35 and that tasks is listed in missing_directory_targets, and noted that PYTHONPATH=. python3 src/parity_audit.py still fails due to an unrelated src/types import-shadowing issue.

Codex Task

Copilot AI review requested due to automatic review settings May 5, 2026 23:47
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the ARCHIVE_DIR_MAPPINGS in src/parity_audit.py to map the tasks subsystem to a directory instead of a single file. The review feedback highlights that the current audit logic only performs top-level directory checks, which may lead to inaccurate coverage reporting now that tasks is a directory; it is recommended to update the logic to support recursive checks. Additionally, the reviewer suggests evaluating whether other subsystems should also be transitioned to directory mappings for consistency.

Comment thread src/parity_audit.py
'skills': 'skills',
'state': 'state',
'tasks': 'task.py',
'tasks': 'tasks',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current audit logic in run_parity_audit (lines 122-124) only checks for existence within the top-level src/ directory using iterdir(). As subsystems like tasks transition to directory structures, any files moved into those directories (e.g., moving task.py into tasks/) will no longer be detected by the audit, causing a drop in reported root file coverage. Consider updating the audit logic to support recursive checks or relative path mappings to ensure continued accuracy as the project structure evolves.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@gemini-code-assist, what are the steps and line numbers to make this fix?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To resolve the parity coverage regression, you need to update the logic within the run_parity_audit function in src/parity_audit.py. Currently, the audit likely uses a check that only validates file existence (such as os.path.isfile or a direct check on a file path).

To support directory structures, you should update the validation logic to use pathlib.Path.exists(), which returns True for both files and directories.

Steps:

  1. Locate the run_parity_audit function (typically around line 122).
  2. Identify the loop iterating over ARCHIVE_DIR_MAPPINGS.
  3. Replace the existing file-specific check with pathlib.Path(target_path).exists(). This will ensure that when tasks is mapped to the tasks/ directory, the audit correctly identifies it as present.

Comment thread src/parity_audit.py
'skills': 'skills',
'state': 'state',
'tasks': 'task.py',
'tasks': 'tasks',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Consider whether other subsystems currently mapped to .py files (such as commands, context, ink, query, and tools) should also be updated to map to directories. Maintaining consistency across the ARCHIVE_DIR_MAPPINGS ensures that missing parity is not masked for these subsystems if they are intended to follow the same structural pattern as tasks.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@gemini-code-assist, what are the steps and line numbers to make this fix?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To determine if these mappings should be updated, you should verify if a corresponding directory exists for each of these subsystems within the src/ folder. The ARCHIVE_DIR_MAPPINGS dictionary in src/parity_audit.py is intended to track directory-based parity; if a subsystem is strictly file-based (e.g., src/tools.py exists but src/tools/ does not), it should remain mapped to the .py file.

If you find that a directory exists for any of these, you can update the mapping by changing the value from the filename to the directory name. Based on the current structure of src/parity_audit.py, you can find these mappings in the ARCHIVE_DIR_MAPPINGS dictionary (around lines 40-70). For example, if you were to update tools:

  1. Locate the line: 'tools': 'tools.py',
  2. Change it to: 'tools': 'tools',

If these subsystems do not have corresponding directories, no changes are required.

Copy link
Copy Markdown

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 fixes a parity-audit regression where src/parity_audit.py incorrectly treated task.py as satisfying parity for the archived tasks/ directory, masking that the Python port is missing the tasks directory surface.

Changes:

  • Update ARCHIVE_DIR_MAPPINGS['tasks'] to map to 'tasks' (a directory) instead of 'task.py' (a file), so directory parity is tracked independently of the root tasks.ts -> task.py shim mapping.

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

@badMade
Copy link
Copy Markdown
Owner Author

badMade commented May 6, 2026

@claude code review
@codex code review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@badMade
Copy link
Copy Markdown
Owner Author

badMade commented May 6, 2026

@copilot, resolve the merge conflicts in this pull request.

Copy link
Copy Markdown

Copilot AI commented May 6, 2026

@badMade Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 33596ef3-6261-4e99-8e0b-3ab9b297c0d6

Sorry for the inconvenience!

…sues-from-codex-review-#154

# Conflicts:
#	src/parity_audit.py

Co-authored-by: badMade <106821302+badMade@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented May 6, 2026

@copilot, resolve the merge conflicts in this pull request.

Resolved the merge conflict in src/parity_audit.py in commit 600ca25. The resolution preserves both changes: 'tasks': 'tasks' in ARCHIVE_DIR_MAPPINGS (from this PR) and 'tasks.ts': 'tasks.py' in ARCHIVE_ROOT_FILES (from the base branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants