Add AGENTS.md agent instructions - #51
roninsightrx wants to merge 3 commits into
Conversation
Use the harness-agnostic AGENTS.md filename so agents other than Claude Code pick up the instructions, and refresh the content against the current state of the package: - Correct the sample-weighting section: weighting lives in handle_sample_weighting() in run_eval_core.R (cumulative vs. incremental), not in a calculate_fit_weights.R with gradient schemes. - Document the incremental (MPC) fitting mode, covariate censoring, the _grouper column, and the required input columns / dictionary rules. - Add the missing bootstrap_summ element to the documented output list. - Describe the VPC/NPDE step, the option-helper validation pattern, the S3 print/plot methods, the example datasets and PsN reference data. - Add build_readme()/vignette/pkgdown commands and note what CI runs. - Drop the empty "Development Rules" heading. Also add AGENTS.md to .Rbuildignore so it is not shipped in the built package. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
roninsightrx
left a comment
There was a problem hiding this comment.
Changes requested: two factual claims in AGENTS.md would mislead coding agents.
AGENTS.md:66-69says the input requires onlyID,TIME,EVID, andDV. However,parse_nm_data()unconditionally selectsCMTinR/parse_input_data.R, so a data set containing only the documented columns fails later in the pipeline; the dictionary also cannot renameCMT. AddCMTto the operational input requirements and clarify the dictionary limitation (or makeCMToptional and validate that behavior in code).AGENTS.md:127-129saysprint()andplot()methods exist for the top-level result and thestats_summ,shrinkage, andbayesian_impactsub-objects. The namespace registers customprint()methods for those three sub-objects, butplot()only formipdeval_results. Rewrite this to distinguish the top-levelplot()method from the sub-objectprint()methods.
Reviewed by Codex
- Document that AMT and CMT are required in practice even though check_required_cols() only validates ID/TIME/EVID/DV, and that the dictionary cannot rename them. - Distinguish the top-level plot() method from the sub-object print() methods; plot() is only defined for mipdeval_results. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Addressed the Codex review. Both findings verified against source before changing anything. 1. 2. No code changes made — this PR is docs-only, so the Note: 🤖 Generated with Claude Code |
roninsightrx
left a comment
There was a problem hiding this comment.
Approval verdict: all findings are resolved. GitHub does not permit the authenticated PR owner to submit a formal approval, so this is recorded as a review comment.
- The input section now accurately distinguishes the four columns checked by
check_required_cols()from the additional practicalAMTandCMTrequirements, and correctly records that the dictionary cannot rename those two columns. - The method section now accurately states that the result and three summary sub-objects have custom
print()methods, while only the top-levelmipdeval_resultsobject has a customplot()method. - No harness-specific references or new inaccuracies were introduced.
Reviewed by Codex
mccarthy-m-g
left a comment
There was a problem hiding this comment.
lgtm! Just one suggestion. Also, CI is failing because some actual test values no longer match expected, likely due to one of our recent PKPDsim fixes
| get weight 1), or only the current group when `incremental = TRUE`; | ||
| - censors future covariates via `handle_covariate_censoring()` to prevent | ||
| data leakage (`censor_covariates = TRUE`; set `FALSE` to reproduce | ||
| `PsN::proseval` behaviour exactly); |
There was a problem hiding this comment.
Not sure if this syntax would confuse an agent into thinking this is an R package/function: PsN::proseval. Maybe rephrase to "PsN's proseval"?
There was a problem hiding this comment.
Good catch — changed to PsN's proseval, which also matches how PsN is referred to on lines 12 and 163; line 87 was the only :: in the file pointing at something that isn't an R package.
Use "PsN's `proseval`" instead of `PsN::proseval`, since the `::` namespace syntax could read as an R package/function call. PsN is a Perl toolkit; this also matches how PsN is referred to elsewhere in the file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Round 3 — outstanding feedback gathered from reviews, inline threads and conversation comments. Codex follow-up review: reports all previous findings resolved, so nothing further to do there. @mccarthy-m-g, @mccarthy-m-g, CI failure — out of scope for this PR. No other outstanding items: no other unresolved review threads, and no cross-repo suggestions were raised on this PR. If a shared "basic R package instructions" baseline across repos is something the team wants, that's worth its own discussion rather than settling it here. 🤖 Generated with Claude Code |
Renames
CLAUDE.mdtoAGENTS.mdand refreshes its contents.AGENTS.mdis the harness-agnostic filename, so agent harnesses other than Claude Code (Codex, Cursor, Copilot, Gemini CLI, ...) also pick up these instructions. The file itself is written for "AI coding agents" generally rather than for one tool.What the file contains
mipdevaldoes and its GitHub-only core dependencies (PKPDmap, PKPDsim).devtools::load_all(),test(),test(filter = ...),document(),check(),build_readme(), plus vignette/pkgdown builds, and what CI actually runs.run_eval()pipeline end to end: model parsing (S3 dispatch), input validation and thedictionary, per-subject data parsing and the_groupercolumn, the core iterative loop, the VPC/NPDE step, and the statistics layer.mipdeval_resultselement list and the S3print/plotmethods.furrrparallelism,progressr/cliprogress, and thecli::cli_abort()error style.data-raw/regeneration, and the PsNprosevalreference output used for validation.setup.R,local_mipdeval_options(), and vdiffr snapshots.Corrections to the previous content
calculate_fit_weights.Rwith gradient schemes, which does not exist onmain. Weighting ishandle_sample_weighting()inrun_eval_core.R(cumulative vs. incremental).bootstrap_summwas missing from the documented output list.Also adds
AGENTS.mdto.Rbuildignoreso it is not shipped in the built package.Docs-only change; no R code is touched.
🤖 Generated with Claude Code