Skip to content

fix: setup_pointblank_agent - cols_reference deprecie, steps egalite sur booleen derive#52

Merged
VincentGuyader merged 1 commit into
audit-0.4.10from
fix/issue-25-setup-agent
Jul 3, 2026
Merged

fix: setup_pointblank_agent - cols_reference deprecie, steps egalite sur booleen derive#52
VincentGuyader merged 1 commit into
audit-0.4.10from
fix/issue-25-setup-agent

Conversation

@VincentGuyader

Copy link
Copy Markdown
Member

Closes #25

Les 5 points de l'issue

  1. Parametre mort : cols_reference (2e position, documente) jamais lu depuis son introduction (verifie par grep). Depreciation propre : NULL par defaut + warning quand fourni, position conservee (pas de decalage silencieux d'arguments, verifie par la review) ; variables mortes cols_reference/cols_candidate supprimees de l'appelant.
  2. Memoire : les steps d'egalite locaux embarquaient le vecteur de reference entier dans chaque step (O(lignes), serialise avec le rapport). Ils valident desormais un booleen __eq derive en amont de create_agent via le kernel partage eq_col_bool - ce qui aligne aussi la semantique NA des appels directs (unilateral echoue) que na_pass ne peut pas exprimer.
  3. Exemple roxygen : executable et representatif (il ciblait un b__ok inexistant, l'agent produit echouait a l'interrogation).
  4. Export : maintenu (le retrait serait cassant ; l'internalisation est proposee au RFC 0.5). Contrat des booleens precalcules documente ; un cmp lazy sans __eq recoit une erreur de contrat explicite.
  5. get_col_names hisse hors boucle, apres toutes les mutations ; doc de common_cols precise que le pipeline ne passe que les colonnes en echec.

Tests (TDD red-first)

Warning de depreciation, semantique NA des appels directs (rouge avant), appels legacy du fichier passes en arguments nommes (zero warning residuel).

Suite complete : 1023 PASS / 0 FAIL sur la pile. Check --as-cran 0/0.

Review interne

pr-reviewer : APPROVE (pas de risque de decalage d'arguments, mutation avant create_agent donc agent$tbl coherent).

Copilot AI left a comment

Copy link
Copy Markdown

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 API and performance issues around setup_pointblank_agent() by deprecating an unused argument, aligning equality validation with the package’s shared boolean-based semantics, and making the documentation/examples executable and representative (per issue #25).

Changes:

  • Deprecate cols_reference (kept in position for compatibility) with a warning when provided, and remove dead locals at the caller.
  • Switch equality validation steps to validate <col>__eq booleans (deriving them for local tables; enforcing presence for lazy tables), avoiding embedding full reference vectors in validation steps.
  • Update tests, NEWS, and generated docs to reflect the new contract and example usage.

Reviewed changes

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

Show a summary per file
File Description
tests/testthat/test-pointblank-setup.R Updates calls to named args and adds tests for deprecation + NA/equality semantics.
R/pointblank_setup.R Implements cols_reference deprecation and boolean-based equality step behavior; updates roxygen docs/example.
R/compare_datasets_from_yaml.R Removes dead locals and updates the setup_pointblank_agent() call to avoid deprecated positional usage.
NEWS.md Documents the deprecation and equality-step behavior change as a bug fix.
man/setup_pointblank_agent.Rd Updates generated usage/details/examples to match the new contract.
Files not reviewed (1)
  • man/setup_pointblank_agent.Rd: Generated file

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

Comment thread tests/testthat/test-pointblank-setup.R Outdated
Comment on lines +170 to +175
# Omitting it works and produces the same agent shape
agent <- setup_pointblank_agent(cmp, common_cols = "a",
tol_cols = character(0), row_validation_info = row_info,
ref_suffix = "__reference", warn_at = 0.1, stop_at = 0.1,
label = "x", na_equal = TRUE)
expect_s3_class(agent, "ptblank_agent")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Valides tous les deux, appliques : expect_no_warning sur le cas omis, et la doc precise que seul un non-NULL declenche le warning (un NULL explicite est silencieux).

Comment thread R/pointblank_setup.R Outdated
Comment on lines +14 to +16
#' @param cols_reference Deprecated and unused; supplying it raises a warning
#' and it will be removed in a future release
#' @param common_cols Character vector of equality columns to validate (the
…sur booleen derive (issue #25)

- cols_reference jamais lu depuis son introduction : NULL par defaut +
  warning de depreciation quand fourni ; l'appelant pipeline passe en
  arguments nommes sans lui ; variables mortes cols_reference/
  cols_candidate supprimees de l'appelant
- les steps d'egalite locaux valident un booleen __eq derive en amont de
  create_agent (semantique NA partagee : unilateral echoue, bilateral
  suit na_equal) au lieu d'embarquer le vecteur de reference entier dans
  chaque step (O(lignes) par step, serialise avec le rapport, na_pass
  incapable d'exprimer la distinction) ; un cmp lazy sans __eq
  precalcule recoit une erreur de contrat explicite
- exemple roxygen executable et representatif (il ciblait b__ok
  inexistant : l'agent produit echouait a l'interrogation)
- get_col_names hisse hors boucle, calcule apres toutes les mutations
- tests : depreciation, semantique NA des appels directs (rouge avant),
  appels legacy du fichier de tests passes en arguments nommes
@VincentGuyader
VincentGuyader force-pushed the fix/issue-25-setup-agent branch from b9ebd6a to e30f8c3 Compare July 3, 2026 10:17
@VincentGuyader
VincentGuyader merged commit a7ec676 into audit-0.4.10 Jul 3, 2026
6 checks passed
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.

2 participants