Repository navigation
Sweep ranking: discount bot updates; lockfile-only transitive churn is version-only - #399
Open
agorischek wants to merge 7 commits into
Open
agorischek wants to merge 7 commits into
agorischek wants to merge 7 commits into
Conversation
…s version-only Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…n their own modules Keeps sweep/mod.rs and sweep/run.rs within the file complexity standard. A merge commit's committer (whoever merged it) never makes it a bot change. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… agent briefs; describe ranking in the onboarding design Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
GitHub Actions image-only bumps incorrectly affect ranking because masking misses the extractor’s container and Docker-step image paths; Swift manifest-only range bumps likewise count as signal because the requirement attribute is not masked. Separately, adding or removing an unused direct Swift dependency is incorrectly suppressed as version-only because the check does not use declaration/transitive metadata to distinguish direct dependencies from lockfile churn.
3 open issues
What changed in this PR
This PR reduces dependency-update noise in Projections’ sweep rankings without changing extractions, comparisons, or rendered output.
Changes:
- Weights bot-authored changes at one quarter across CLI and Inspector rankings.
- Restricts version-only classification to dependency-like projections and includes transitive lockfile churn.
- Updates summaries, schemas, regression tests, and documentation.
| File | Description |
|---|---|
| tools/scripts/reference-docs/agents.mjs | Updates generated agent guidance. |
| packages/schemas/src/runner/api.ts | Defines bot metadata and version-only semantics. |
| packages/schemas/internal/runner-api.json | Updates generated API schema. |
| packages/host/inspector/test/client.test.mjs | Tests weighted rankings and summaries. |
| packages/host/inspector/src/sweep/stats.ts | Applies bot weighting in Inspector. |
| packages/cli/tests/authoring.rs | Adds end-to-end sweep regressions. |
| packages/cli/templates/SKILL.md | Explains revised ranking behavior. |
| packages/cli/src/tools/tests.rs | Tests bot-count summaries. |
| packages/cli/src/tools/read/sweep.rs | Reports bot counts in agent output. |
| packages/cli/src/sweep/window.rs | Uses relocated log parsing. |
| packages/cli/src/sweep/versions.rs | Classifies version-only dependency changes. |
| packages/cli/src/sweep/tests.rs | Tests classification and bot weighting. |
| packages/cli/src/sweep/signal.rs | Implements weighted ranking and advice. |
| packages/cli/src/sweep/run.rs | Annotates cells with bot and version-only flags. |
| packages/cli/src/sweep/mod.rs | Extends change metadata and text summaries. |
| packages/cli/src/sweep/log.rs | Parses history with author metadata. |
| packages/cli/src/sweep/bots.rs | Centralizes bot detection and reporting. |
| packages/cli/src/service/sweeps.rs | Initializes metadata for explicit revision pairs. |
| packages/cli/src/onboard/tests.rs | Updates change fixtures. |
| packages/cli/src/commands/explore.rs | Exposes bot counts in JSON. |
| docs/setup/quick-start.md | Explains dependency-update weighting. |
| docs/runner/commands.md | Documents ranking rules and output fields. |
| docs/runner/agent-tools.md | Documents bot summaries. |
| docs/design/onboarding-loop.md | Describes sweep ranking design. |
| docs/agents/explore.md | Refreshes generated exploration guidance. |
| docs/agents/create-projection.md | Refreshes generated authoring guidance. |
| changelog.d/399.md | Records user-visible ranking changes. |
Review effort: Balanced
| fn attributes(self) -> &'static [&'static str] { | ||
| match self { | ||
| // A package's version, a declaration's range and the version it resolved to, a pinned revision. | ||
| Self::Dependencies => &["version", "resolved", "revision"], |
| // A package's version, a declaration's range and the version it resolved to, a pinned revision. | ||
| Self::Dependencies => &["version", "resolved", "revision"], | ||
| // An action's ref, a reusable workflow's `@ref`, an image's tag or digest. | ||
| Self::Actions => &["ref", "uses", "image"], |
| /// that no root declares. | ||
| fn transitive(document: &Value, collection: Option<&str>, item: &Value) -> bool { | ||
| match collection { | ||
| Some("entities") => !root(item), |
…s, not its renderer A projection is version-only only in the data attributes its definition names; without the field, no change is. Explore writes the field into the built-in dependency and GitHub Actions templates. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…n's; its other presentation settings stay Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
4 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
explore --sweepranks candidates (rare,steady,noisy,quiet) by how often they change across recent pull requests. Dependency-bump noise skewed that ranking in both directions. This PR changes how two kinds of change count in the ranking. Extractions, comparisons and pictures stay the same for every change, and the docs now say so.B. Bot changes count a quarter
[bot]accounts (name or email) plus Renovate, Dependabot and the common release-notes and changeset bots (release-please, release-drafter, semantic-release, changesets, GoReleaser). The list is kept in one place,BOT_AUTHORSinpackages/cli/src/sweep/bots.rs, and the docs point there.BOT_SHARE = 4insignal.rs), both when it changed and when it didn't. Once four non-bot changes have been judged, a candidate that changed only on bot changes ranksquiet.sweepagent tool report, for example,7 of 20 changes were bot updates, and each bot change in a row's list is marked, bot update. The JSON addsbotChanges, each change'sauthorandbot, each cell'sbot, and each projection row'sbots. The Inspector's Explore view (stats.ts) ranks the same way.C. Version-only only where the definition names its version attributes, including lockfile-only transitive churn
presentation.versionAttributes. It is a list of 1 to 16 data attribute names on entities and relationships that hold only versions. A change isversionOnly(not counted when ranking) only when every modified item differs only in the versions inside those attributes. A label that equals one of those values is also masked, as with a dependency's declared range. Projections without the field are never version-only, whatever their renderer. The Rust validator and the definition JSON Schema both accept it, and viewers ignore it.workspace-dependenciesusesversionandresolved(a declaration's range and what it resolved to). Swift usesversion,revisionandrequirement.github-actions-jobsusesref,usesandimage. With a single name, some of today's bumps would start counting.VERSION_ATTRIBUTESinpackages/extractors/catalog/src/lib.rswrites the field into the templates of the built-in dependency extractors (workspace-dependencies,cargo-dependencies,nuget-dependencies,swift-package-dependencies,xcode-modules) and ofgithub-actions-jobs.explore,adoptandinittherefore all write it.initswitching an existing definition to a built-in extractor replaces onlyversionAttributesand keeps the definition's otherpresentationsettings. The table lives in the catalog rather than in the extractor SDK'sDescriptor, because a newDescriptorfield would touch all 30 extractors and break sibling PRs that add extractors (for example python-dependencies: a built-in extractor for Python projects #386). An extractor added later opts in with one line in that table.quiet.Behaviour change
On
main, any projection could beversionOnly, because any version-like string was masked. Now only projections with the field can be. A definition adopted before this change, such as an existingworkspace-dependenciesdefinition, has no field, so its bumps count until the field is added. Each built-in's page shows the field. A separatebehaviour-changeschangelog fragment (changelog.d/399-behaviour-changes.md) explains this.Remaining notes for review
presentation, as requested. That block is otherwise viewer settings, so the schema and contract docs now sayversionAttributesaffects only how a sweep ranks a projection.packages/schemas) hasn't merged. This PR updates the definition schema and the runner API'sversionOnlyandbotdescriptions. When Schemas for the CLI's JSON output #395 lands, itsexplore --sweepschema needsbotChanges, the per-changeauthorandbot, the per-cellbot, and the per-rowbots.Evidence
Run on Linux with the CLI crate built in debug:
npm run tools -- check --fast: passed (lint,cargo check, format, the file-complexity standard and the repository rules).cargo clippy -p projections-cli -p projections-extractor-catalog --all-targets --locked -- -D warnings: passed.cargo test -p projections-cli --lib: 233 passed. The new and updated tests cover:ref,usesandimageonly_projections_that_name_their_version_attributes_are_version_only: without the field, even a pure version bump counts, whatever the rendererinitreplacing onlyversionAttributesand keeping the otherpresentationsettingscheck::tests::a_custom_comparator_scenario_names_its_file_by_its_repository_pathfailed only because therulescomparator Wasm isn't built in this environment.cargo test -p projections-cli --test authoring: 28 passed.init_adds_a_custom_renderer_and_comparator_to_an_existing_projectionfailed for the same missingrulescomparator. The end-to-end sweep test,a_sweep_discounts_bot_updates_and_lockfile_churn_only_in_dependency_projections, does three things:workspace-dependenciesdefinition thatexplore --listproposes and checks it carriesversionAttributes: ["version", "resolved"]releasesprojection without the fieldversionOnlyonly in the proposed projection, which ranksquiet, whilereleasescounts both and isn'tquietcargo test -p projections-cli --test native presentation_defaults: passed. The field passes through, and empty, non-list, duplicate and blank lists are rejected.cargo test -p projections-cli --test extractors catalog_advertises: passed; every template, the new field included, validates.Inspector
stats.ts: I ran the newclient.test.mjsassertions directly against the source. I didn't run the Inspector workspace's own suite, which needs every renderer built.Generated pages:
npm run generate --workspace @githubnext/projections-schemasregenerateddefinition/v0.jsonandrunner-api.json.node tools/scripts/reference-docs.mjs --only agents,extractors,schemasregenerated the explore and create-projection briefs,docs/reference/extractors.mdanddocs/reference/schemas/definition.md.docs/builtins/fromprojections extractor list --json, using the generator's ownJSON.stringify(template, null, 2)formatting. CI's generated-files check confirms them.node --test tools/scripts/reference-docs/agents.test.mjs: passed.npm run tools -- changelog: passed.Docs changed:
docs/contracts/definitions.md(the new field)docs/runner/commands.mddocs/setup/quick-start.md(and through it the explore brief,docs/agents/explore.md)packages/cli/templates/SKILL.md(anddocs/agents/create-projection.md)docs/runner/agent-tools.mddocs/design/onboarding-loop.md(a Ranking bullet under Sweeps)Each says that neither rule changes extractions, comparisons or pictures, only the ranking.
Scope: this changes only how
explore --sweepand thesweeptool rank and summarize, plus the new definition field that explore writes. It doesn't touch the sweep's timeouts, streaming, grouping oradopt's reuse of a sweep.pages are regenerated (
npm run docs:generate).changelog.d/<this PR's number>.mddescribes whatusers will notice, or the PR has the
no changeloglabel (seechangelog.d/README.md).