Repository navigation
feat(apr): apr plot verb over the proven ggplot2 rows (re-cut AP3 of #6992) - #7042
Conversation
The library core of `apr plot`: a CSV file drawn as ggplot2's row 1 (geom_point) to the terminal or SVG. No CLI wiring yet. - Scales train on the f64 column range (GGPlot::trained_on), so edge labels match R where the f32 engine frame would round them (B3). - breaks.rs: pow10 is exact for |z| <= 22, as R's powl is; libm::pow(10, -5) is one ulp low and moved an edge break inside. - Inf, -inf, infinity and 1e400 are refused by column and line (B4); only "" and NA are missing, null is text (N8); "1 row" (N9). - New fixture geom_point_edges (R 4.6.2, ggplot2 4.0.3, LC_ALL=C): 17 sets whose labels the test reads byte for byte. - FALSIFY-GG1-004/005 in ggplot2-row1-point-v1; GG1-INV-002 states what is compared. contracts.nt, witness and README regenerated. Refs #6909 Closes #7009 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6992) Second slice of the #6992 re-cut, stacked on AP1. build.rs derives src/plot_cli/proven_rows.rs from the ggplot2_row blocks of contracts/trueno-viz/ggplot2-*.yaml and fails the build when the committed table differs. The generator lives in plot_cli/proven_gen.rs, include!d by build.rs and by the plot_cli unit tests. Carries #6992 review findings: - N4: an oracle must draw exactly one layer of the block's geom. - N3: a column with one value is refused by name. - N7: tests pin MAX_F32_ERROR_OF_RANGE = 1e-4 from both sides. Kept lines are byte-identical to #6992 @ c9f2448; new-in-slice lines are listed in the PR body. Contract falsifiers FALSIFY-GG1-006/007. Refs #6909 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fixtures (Refs #6909) The review of c05f286 found the build.rs wiring untested: deleting the check_oracle call, the contract-dir check or the drift check left every test green, and only the first expected*.json was ever exercised. - read_rows, expected_jsons and the drift check (sync) move from build.rs into proven_gen.rs; build.rs only calls sync. - the_contract_walk_admits_only_rows_their_oracles_back drives sync on a tempdir: no contracts dir, a non-row yaml, an oracle with only expected_*.json, drift then regen, a valid second row (scale_x log10), a bad second oracle after a good one, a second row whose oracle draws GeomLine, and a row without a falsifier. - check_oracle cross-checks the oracle spec for stat, position, scale_x, scale_y, coord, facet and theme. - the_committed_table_is_the_contracts_rendered runs sync over every contracts/trueno-viz/ggplot2-*.yaml, not row 1 alone. - N7 is pinned at exactly 1e-4: refused at range 9999, drawn at 10000. - FALSIFY-GG1-006 names the walk test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… double-quoted spec is refused (Refs #6909) The rule claimed the spec dimensions and the one-layer check, but its test ran only the walk test. It now runs plot_cli::generator::, and the prediction names both tests. named() refuses a spec naming a key twice or holding a double quote instead of reading the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts were derived files only: README contract count and the contracts.nt witness; took main and re-derived. Refs #6909 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oven-rows Refs #6909 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6992) Wires the plot library of the previous slice into `apr plot`: `--data <CSV> --aes x=..,y=.. [--geom point] [--width N] [--height N] [--output term|svg] [--no-color]`. Behind aprender-viz feature `plot-cli` (clap + batuta-common/cli-roles), enabled by apr-cli's `visualization` feature. Re-cut of source head c9f2448 (#6992). Line map: - verbatim from source: apr-cli wiring (commands_enum variant, dispatch plot_result, dispatch_run command_owns_stdout), the cli_commands plot tests (7 of 10; the 3 spec tests move with --spec), command registry entry, dogfood coverage 927->928, surface audit row, contracts.nt triples, book SUMMARY, the ci fragment 729, parse_aes and refuse. - new in slice: crates/aprender-viz/src/plot_cli/cli.rs (PlotFlags, a clap front end onto the previous slice's PlotArgs, since its PlotArgs is not a clap struct), the feature lines, the type paths in the apr-cli wiring, and a book page limited to the flags this slice ships. Deferred to a later slice: --spec, --title, --xlab, --ylab, --out. Refs #6909 Refs #6991 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Non-author review: PASS at 6db5761 (delta on top of #7020)Reviewer: Non-blocking follow-up: Not measured by the reviewer: build, tests, clippy (CI measures them). This PASS is bound to this head: the PR is stacked (#7018 -> #7020 -> this). It is armed only after it is retargeted to |
Refs #6909 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
noahgift
left a comment
There was a problem hiding this comment.
Non-author review: gemini-4-argon-high PASS at 634076f (tree 611aab6df27d, witness 23d423433efa094291c9f5340415a4aa). 0 blocking.
Checked: apr plot parsing and dispatch have no unwrap or panic on user input; unsupported geoms, aesthetics, --json and --quiet are refused; the CLI registry and cli_commands.rs are in step; no content from main was lost in the branch's merges; no gate, threshold, allow-list or workflow change.
Non-blocking, for a follow-up: book/src/cli/plot.md:44-45 still says a one-value column is refused. After #7018 it is drawn over the expanded span (v ± 0.05), and only values f32 moves by more than 1e-4 of that span are refused.
The review read the diff; it did not build or run tests.
Closes #7041
Refs #6991
Refs #6909
keep-open: #6909 is the master ticket; rows remain
degraded: same-family
What
Third slice of the #6992 re-cut, on top of #7020, which is now merged to main. It wires the plot library from #7020 into
apr plot:crates/aprender-viz/src/plot_cli/cli.rs(new):PlotFlags, a clap front end behind the new featureplot-cli(clap +batuta-common/cli-roles, soapr surfacereads theInputFile/FreeTextroles). It maps the flags onto the library's existingPlotArgs. It refuses by name any geom other thanpointand any aesthetic other thanx/y, along with a missingxory.Plotvariant (featurevisualization, which now enablestrueno-viz/plot-cli) andplot_result, which refuses the global--json/--quiet.command_owns_stdoutsends the--verbosepreamble to stderr for plot only.contracts.ntregenerated, book page, and the ci fragment 729 running theplot-cliunit tests.--spec,--title,--xlab,--ylab,--out.Provenance (source head c9f2448)
Size vs main (head 111d9e7): 17 files, +587/-11 = 598 lines. Since 6db5761: merged #7020 and main, reworded the plot comments in the registry YAML and cli_commands.rs (
aprender-present plotis a separate front end), and aprender-viz now takes clap from the workspace.Verbatim from the source: the apr-cli wiring shape, 7 of the source's 10
cli_commandsplot tests (the 3 spec tests move with--spec), the registry/audit/coverage/nt rows, SUMMARY, the fragment,parse_aesandrefuse.New in slice (132 lines):
cli.rs: 102 lines.PlotFlags,plot_args,runand their tests. This is needed because the base'sPlotArgsis not a clap struct.--outremoved:commands_enum.rs2dispatch.rs4apr-cli-commands-v1.yaml2aprender-viz/Cargo.toml2plot_cli/mod.rs3Gates (head 6db5761)
cargo fmt --all -- --check-p aprender-viz --lib --tests -D warnings(default /--features plot-cli)-p apr-cli --lib -D warningscargo test -p aprender-viz --lib --features plot-cli plot_cli::-p aprender-viz --lib --tests/--lib --features plot-cli-p apr-cli --libcargo test -p apr-cli --test cli_commandscargo test -p aprender-contracts --libpv validateapr-cli-commands-v1 / apr-dogfood-coverage-v1scripts/contracts_gate.sh(8 of 8 steps ran)fail_fast.py ids --base origin/maincheck_complexity_ratchet.shcheck_tree_reader_tests.sh/check_include_files.shcheck_dogfood_coverage.sh/surface_audit_bins_gate.shcargo deny check advisoriesKnown on the base, not in this diff:
clippy -p apr-cli --testsis red in the existingfalsification_crux_*.rsandnf4_classifier.rstests, and atcli_commands.rs:845and:1204. This PR adds lines only after line 1382 of that file.Mutants
cargo mutants --in-diffonaprender-viz --features plot-cli: 15 found, 15 caught, 0 missed, 0 timeout, 0 unviable.include!(), so it finds no mutants in apr-clidispatch.rs/dispatch_run.rs. They were hand-mutated instead. Each red below is a test panic, not a build error:if on->if falsecli::runReview: same-family Claude review only, so this is marked
degraded: same-family. Draft, auto-merge not armed.🤖 Generated with Claude Code
ont-delta: none (apr plot clap front end; no ontology type, shape or concept changes)