Skip to content

Logic bugs in luna_run, luna_note, runs_as_table, luna_new_project, luna_clone, update_cache - #65

Merged
roninsightrx merged 2 commits into
mainfrom
auto/62-logic-bugs-in-luna-run-luna-note-runs-as
Oct 20, 2026
Merged

roninsightrx merged 2 commits into
mainfrom
auto/62-logic-bugs-in-luna-run-luna-note-runs-as

Conversation

@roninsightrx

Copy link
Copy Markdown
Collaborator

Closes #62

Fixed all logic bugs listed in #62 (luna_run nmfe fallback, luna_note clear/unknown id, empty-project runs_as_table/luna_list, luna_new_project import/template, luna_clone source checks, update_cache folder paths, empty-log handling, luna_ind paging, find_file_with_fallback abort, get_flag_from_config default, luna_gof residual) and added regression tests; full test suite passes.


🤖 Implemented by Claude Code and reviewed by Codex, orchestrated by auto. Review rounds are posted as comments below.

- luna_run: allow a NULL nmfe fallback so an unset tools.nonmem.nmfe no
  longer aborts when tools.modelfit.nmfe is set (or neither is set).
- luna_note/luna_tag: always write the run back, so clear = TRUE without
  a note actually clears; abort when the run id is not in the project.
- runs_as_table/luna_list: return an empty table for projects without runs.
- luna_new_project: define models when import_models = FALSE, use
  seq_along(), and give template-based projects their metadata.
- luna_clone: check the cache up front, abort when the source model (or
  the run folder for update_inits) is missing, and check file.copy().
- update_cache: use full folder paths for folder timestamps and avoid
  using the project path as a regex.
- log_get_last_event: return NULL on an empty log; luna_help checks for
  NULL before using the event.
- luna_ind: use ceiling() for the number of pages so partial pages work.
- find_file_with_fallback: abort regardless of verbose; luna_tables now
  opts out explicitly to keep its own message.
- get_flag_from_config: honour the default argument.
- luna_gof: plot the selected residual (CWRES or NPDE).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@roninsightrx roninsightrx left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 Codex review, round 1: ✅ approved

The implementation addresses all reported logic bugs with appropriate regression coverage. The full test suite passes: 466 tests, 0 failures or warnings.

@roninsightrx
roninsightrx marked this pull request as ready for review October 20, 2026 21:19

@roninsightrx roninsightrx left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 Codex review, round 1: ✅ approved

The implementation addresses all reported logic bugs with appropriate regression coverage. The full test suite passes. R CMD check also completed; its warnings/notes concern pre-existing package-wide issues rather than this change.

Resolve conflicts with #63/#64 and #66:
- DESCRIPTION: bump to 0.2.4 (main is at 0.2.3).
- luna_new_project: use main's new_project_from_template() for the YAML,
  keep this branch's shared metadata assignment.
- luna_ind: take main's min()-based end index (partial pages already
  handled there); keep the page-out-of-range test from this branch.
- luna_gof: keep plotting the selected residual, with main's descriptive
  axis label extended to NPDE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@roninsightrx roninsightrx left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 Codex review, round 2: ✅ approved

All issue items are correctly addressed, with appropriate regression coverage. The full test suite passes: 492 tests, 0 failures, 0 warnings.

@roninsightrx
roninsightrx merged commit 79a74d3 into main Oct 20, 2026
3 checks passed
@roninsightrx
roninsightrx deleted the auto/62-logic-bugs-in-luna-run-luna-note-runs-as branch October 20, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logic bugs in luna_run, luna_note, runs_as_table, luna_new_project, luna_clone, update_cache

1 participant