Repository navigation
jpdev check --changed: run only the check-list steps the changed paths map to - #40
Conversation
…s map to `jpdev check --changed [BASE]` takes the paths that differ between the merge base of BASE (default: the default branch) and HEAD and the working tree, plus untracked files that are not ignored, and maps them to check-list steps through the `changed` rules of jpdev.json (path globs to check names). Only the mapped steps run. A path no rule covers, a change to jpdev.json, the manifest or scripts/dev/check.sh, no changed path, or no mapping runs the whole list. A block before the summary names each step selected with the globs that selected it, or why the whole list runs. An invalid mapping, an unresolved BASE and --changed with --only are refused with exit 2 before any step runs. The jpdev.json schema and template carry the mapping (generators becomes optional when changed is present), the generated-docs checker accepts the member, and this repository maps its documentation paths. docs/policy.md says the scoped run is allowed for local iteration and on pull requests, and the full list is required on the default branch, before a release and when check-selection semantics changed. Closes #33. Signed-off-by: kikashy <35789537+kikashy@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clean-room review (same vendor): Claude Opus 5.5, effort xhigh, 2026-10-25, reviewed SHA 69d1d94Same-vendor review at the maintainer's direction; not a cross-vendor claim. A fresh reviewer in a separate clone at the PR head, CI green; probes under
Disposition (the coordinator's)
The same reviewer re-reads the fixed head. |
…t paths The review of the first commit found that the whole-list fallback could be bypassed. The changed paths are now the union of the merge base against the working tree, against the index and against HEAD, so a change staged or committed and then reverted in the working tree still counts. Every diff passes --ignore-submodules=none, so a submodule hidden by an ignore setting in .gitmodules or in the git configuration still counts. The manifest is a selection input both as named and as a symlink resolves it. Fixture tests cover a submodule under ignore = all and ignore = dirty, a staged and a committed change reverted in the working tree, a retargeted symlinked manifest and a change to scripts/dev/check.sh. The schema test reads its vectors with a standard-library reader, so it no longer skips without the jsonschema package. The usage text and docs/adopting.md list every whole-list reason; the README states what is diffed; adopting.md says that * matches dotfiles and that selection sees only what git reports. Signed-off-by: kikashy <35789537+kikashy@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-read (same vendor): Claude Opus 5.5, effort xhigh, 2026-10-25, reviewed SHA 27bb34eThe same reviewer, the review clone moved to the fixed head; CI green (lint, tests, DCO). Condensed:
Disposition (the coordinator's)Findings 1-4 and 6 closed; 5 and 7 are LOW and ride (7's sentence goes with the next docs change). Merging on the maintainer's word. |
|
🎉 Thank you for your contribution to Judgment Pack! If you’d like another task, choose a path that interests you: |
Both pull requests extend jpdev.json. The resolution keeps both:
- lib/generated_docs.py and scripts/dev/generated_docs.py accept the
members {version, generators, changed, duplication} and read generators.
- templates/jpdev.schema.json requires version and one of generators,
changed or duplication; its title names all three.
- lib/changed_checks.py accepts the duplication member (it refused every
member but version, generators and changed, so `jpdev check --changed`
would have refused templates/jpdev.json).
- The standard-library schema reader of tests/changed_checks_test.py reads
`enum`, which the duplication member's languages use.
- README "What is here" names the duplication check and thresholds.
Signed-off-by: kikashy <35789537+kikashy@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What it adds
jpdev check --changed [BASE](bin/jpdev,lib/changed_checks.py, standard library only). The changed paths are those that differ between the merge base ofBASEandHEADand the working tree (committed, staged, unstaged and deleted paths, both sides of a rename), plus untracked files that are not ignored.BASEdefaults to the default branch:origin/HEAD, elseorigin/main, elseorigin/master. The paths are mapped to check-list steps through thechangedrules ofjpdev.json(path globs to check names), and only those steps run (passed to the runner as--only).unmapped path X: whole list), whenjpdev.json, the manifest orscripts/dev/check.shchanged (selection input changed: X: whole list), when nothing changed, or when there is no mapping. Before the summary block, the report names each step selected with the globs that selected it, and each step not selected.*and?stay within one segment, and a**segment matches any number of segments.[ ] { } \, a rooted glob, an empty,.or..segment, a**that is not a whole segment, a check the manifest does not list, an empty or repeated list and an unknown member are all refused with exit 2 before any step runs, and the message names the member or rule (for examplejpdev check --changed: refused: jpdev.json changed[1].checks: no check named 'go-tset' in dev.json). An unresolvedBASE, a missing default branch or merge base, and--changedtogether with--onlyare refused the same way.--skipand--allstill apply.templates/jpdev.schema.jsonandtemplates/jpdev.jsoncarry thechangedmember.generatorsis now required only whenchangedis absent (anyOf).lib/generated_docs.py, and its copyscripts/dev/generated_docs.py, accept the member and do not read it. This repository's ownjpdev.jsonmaps its documentation paths: docs and top-level Markdown todiff-check,local-paths; the agent docs also toagent-docs,tests;docs/adopting.mdandtemplates/*.mdalso totests. Every other path runs the whole list.docs/policy.mdhas a "Scoped runs" paragraph. The scoped run is allowed for local iteration and on pull requests. The full list is required on the default branch, before a release, and whenever check-selection semantics changed. The stale sentence that named jpdev check --changed: run only the check-list steps the changed paths can affect #33 as separate work is removed. README documents the command and its flags,docs/adopting.mdhas a "Changed-path check selection" section, anddocs/generated-docs.mdnames the new member.jpdev checkoption and its output block, and a newjpdev.jsonmember with its schema. Vectors and documentation for both are changed in this pull request.Checks
Candidate: head
69d1d94(this branch, one commit on5da7aff), no uncommitted diff. The whole list ran once on that head:Environment notes. The session's default
python3is 3.8, which the existing generated-docs tests do not support (Path.is_relative_to). CI's 3.12 was put first on PATH for this run. The session also exportsGIT_EDITOR, which the existing cleanup tests refuse as an inherited Git setting, so it was unset. Onmain(5da7aff) under 3.12 withGIT_EDITORstill set, the tests step failed only atclean deletion boundaries hold in disposable fixtures(427 passed, 1 failed). Neither condition touches this change.Focused runs during development:
tests/changed_checks_test.py: 19 tests OK. It covers the glob semantics, and fixture clones of a bare origin driven throughbin/jpdev check --changedwith the handwrittentests/fixture/changed-dev.jsonandchanged-jpdev.json. The cases are a docs-only change, a mapped Go path, an unmapped untracked path, two rules giving their union, a rename away from an unmapped path, a change tojpdev.jsonand todev.json, no mapping, nojpdev.json, no changed path, an explicitBASEwith--skip, 13 invalid mappings plus unreadable JSON, an unresolvedBASE, no default branch, and--changedwith--only. It also checks that the shipped mappings name steps of their manifests, and that the schema accepts the shipped mappings and refuses 16 bad vectors.tests/generated_docs_test.py: 20 tests OK against both helper copies.docs/policy.mdedit and--changed HEAD, selecteddiff-checkandlocal-paths(docs/**), and 2 passed. Addinglib/probe.txtprintedunmapped path lib/probe.txt: whole list.Safeguard probes. Each one broke the code once in a scratch copy, then ran the test file. The clone was not changed.
BASEtests, atassertEqual(self.ran(out), {...})(the whole list ran instead)assertIn('unmapped path ...: whole list')assertIn('selection input changed: jpdev.json: whole list')--no-renamesremoved)unknown check(exit 0, wanted 2)*crosses/test_star_stays_within_one_segmentand the union testchangedtest_change_mapping_member_is_left_to_jpdev_checkSelf-checks from AGENTS.md:
dev.jsonhere has nohandovermember.anyOf, the relaxedrequired, thechangedproperty, its type andminItems, the rule's type,additionalPropertiesandrequired, and forpathsandcheckstheirminItems,uniqueItems, item type and pattern) was removed in a scratch copy, and a vector failed each time.checks), malformed JSON, a wrong version and unknown members. No size bound was added.CI runs the lint and tests jobs on this head. No CI watch was started.
Not in this PR
templates/ci-check.ymland this repository'sci.yml. Moving a pull-request job to the scoped run, and vendoring the selection for repositories that runscripts/dev/check.shwithout the kit, are separate.templates/check.sh(the vendored runner) is unchanged:--changedis ajpdev checkoption, and the runner receives the selection as--only.jpdev codex run --smallstill namesjpdev check --only.Fix round
Head
27bb34e, one more signed-off commit on69d1d94. These are the findings of the clean-room review record above.--ignore-submodules=none, so a submodule hidden byignore = allorignore = dirty(in.gitmodulesor the git configuration) or bydiff.ignoreSubmodulesstill counts. The new testtest_a_submodule_change_counts_whatever_its_ignore_settinghas two cases, each with a docs edit, and each runs the whole list withunmapped path third_party/lib: whole list: a committed pointer bump underignore = allin.gitmodules, and a changed file inside the submodule underignore = dirtyin the clone configuration.--cached) andHEAD. New tests: a Go change staged and then reverted in the working tree, and a Go change committed and then reverted and staged. Both select the Go steps. The README sentence now says what is diffed, as dodocs/adopting.mdand the module docstring.dev.jsonis a symlink retargeted frommanifests/a.jsontomanifests/b.jsonunder a rule that maps*.json, and the run printsselection input changed: dev.json: whole list.scripts/dev/check.shunder a rule that mapsscripts/dev/**printsselection input changed: scripts/dev/check.sh: whole listand runs the whole list.jsonschemareads them as well where it is installed. Thejpdevusage text anddocs/adopting.mdnow list every whole-list reason.docs/adopting.mdadds that*matches a name that starts with a dot, and that selection sees only what git reports in this clone: assume-unchanged and skip-worktree edits, ignored files and paths outside the clone are not seen, and the full list remains the guard. Theversioncases of finding 5 ride, as dispositioned.Safeguard probes. Each one broke the code once in a scratch copy, then ran
tests/changed_checks_test.py.--ignore-submodules=noneremovedassertIn('unmapped path third_party/lib: whole list')test_a_staged_change_the_worktree_reverted_still_counts, atassertEqual(self.ran(out), {...})HEADdiff droppedtest_a_commit_the_index_and_worktree_reverted_still_counts, atassertEqual(self.ran(out), {...})test_a_symlinked_manifest_retargeted_runs_the_whole_list, atassertIn('selection input changed: dev.json: whole list')scripts/dev/check.shdropped from the inputstest_a_change_to_the_vendored_runner_runs_the_whole_list, atassertIn('selection input changed: scripts/dev/check.sh: whole list')Each of the 16 added schema constraints was also removed in turn, with
python3 -S(nojsonschema), and a vector failed every time.tests/changed_checks_test.pynow has 24 tests, all passing;DeclarationTestsalso passes underpython3 -S.The whole list ran once on
27bb34e, with no uncommitted diff and the same environment as before (Python 3.12 first on PATH,GIT_EDITORunset, scratchTMPDIRandJPDEV_SCRATCH):CI runs on this head. No CI watch was started.
Closes #33
🤖 Generated with Claude Code