You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2026/10/09 20:05:27 UTC
(tinkerpop) 09/13: Scope the tinker-review confidence worklist to changed code
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 4ae2341bd440900880f7715eba468f09ffd7f18a
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Fri Oct 9 15:44:20 2026 -0400
Scope the tinker-review confidence worklist to changed code
listInferred --changedOnly returns only edges that touch code the PR changed,
and the playbook's confidence loop starts there.
Assisted-by: Claude Code:claude-opus-5-5
---
.skills/tinker-review/playbooks/general.md | 7 ++++---
.skills/tinker-review/references/enrichment-cli.md | 7 +++++--
.skills/tinker-review/scripts/enrichment/cli.js | 4 ++--
.skills/tinker-review/scripts/patterns/confidence-audit.js | 14 +++++++++++++-
4 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/.skills/tinker-review/playbooks/general.md b/.skills/tinker-review/playbooks/general.md
index f55d59b668..9d8cae833e 100644
--- a/.skills/tinker-review/playbooks/general.md
+++ b/.skills/tinker-review/playbooks/general.md
@@ -9,9 +9,10 @@ domain-specific playbook.
The confidence pass runs on every review; it lives here and every playbook
inherits it. Run in order:
- `auditConfidence` — read the edge-confidence distribution and the `AMBIGUOUS` list.
-- `listInferred` — pull the verification worklist (`--relation implements_step`
- first, then any `calls` edges your findings lean on); read each against the
- worktree source.
+- `listInferred --changedOnly` — pull the verification worklist: the INFERRED
+ edges touching changed code (`--relation implements_step` first, then the
+ `calls` edges your findings lean on). Read each against the worktree source.
+ Edges between untouched code are not worth verifying.
- `setEdgeConfidence` — re-grade what you verified: promote a confirmed edge to
`EXTRACTED`, downgrade a wrong name-resolution to `AMBIGUOUS`.
- `auditConfidence` again — anything still `AMBIGUOUS` goes to `openQuestions`,
diff --git a/.skills/tinker-review/references/enrichment-cli.md b/.skills/tinker-review/references/enrichment-cli.md
index 36cf4eaaf7..c23a4eaa42 100644
--- a/.skills/tinker-review/references/enrichment-cli.md
+++ b/.skills/tinker-review/references/enrichment-cli.md
@@ -87,8 +87,11 @@ in the report's `openQuestions`, not asserted as fact.
### listInferred
Your **verification worklist**: the name-resolved / agent-mapped edges worth a
source check, optionally narrowed with `--relation` (start with
-`implements_step`, then `calls`). After reading the source, promote or downgrade
-each with `setEdgeConfidence`. This is how INFERRED becomes EXTRACTED.
+`implements_step`, then `calls`). Pass `--changedOnly` to keep only edges with an
+endpoint the PR changed (behavior or signature): a large PR has tens of
+thousands of INFERRED edges, mostly calls between untouched code, and the
+default 100 of those is an arbitrary sample. After reading the source, promote
+or downgrade each with `setEdgeConfidence`. This is how INFERRED becomes EXTRACTED.
### listDeleted
The files the PR deleted (graph stubs marked `deleted: true`), each paired with
diff --git a/.skills/tinker-review/scripts/enrichment/cli.js b/.skills/tinker-review/scripts/enrichment/cli.js
index f9fdfdfd92..38511f5862 100644
--- a/.skills/tinker-review/scripts/enrichment/cli.js
+++ b/.skills/tinker-review/scripts/enrichment/cli.js
@@ -99,7 +99,7 @@ async function main() {
console.log(" getCallsFrom --function <name> --file <path>");
console.log(" getCanonicalSteps");
console.log(" auditConfidence [--maxAmbiguous 50]");
- console.log(" listInferred [--relation implements_step|calls|...] [--limit 100]");
+ console.log(" listInferred [--relation implements_step|calls|...] [--changedOnly] [--limit 100]");
console.log(" listDeleted");
console.log(" listExternalRefs");
console.log(" listBeads [--root <beadId>] [--type decision|task|record] [--status in_progress]");
@@ -169,7 +169,7 @@ async function main() {
result = await fn(g, { maxAmbiguous: args.maxAmbiguous });
break;
case "listInferred":
- result = await fn(g, { relation: args.relation, limit: args.limit });
+ result = await fn(g, { relation: args.relation, changedOnly: args.changedOnly, limit: args.limit });
break;
case "listDeleted":
result = await fn(g);
diff --git a/.skills/tinker-review/scripts/patterns/confidence-audit.js b/.skills/tinker-review/scripts/patterns/confidence-audit.js
index 29d6cb326f..8d00415464 100644
--- a/.skills/tinker-review/scripts/patterns/confidence-audit.js
+++ b/.skills/tinker-review/scripts/patterns/confidence-audit.js
@@ -19,6 +19,7 @@
import gremlin from "gremlin";
import { CONFIDENCE } from "../graph/confidence.js";
+import { changedMeaningful } from "../graph/change-levels.js";
const { process: { statics: __ } } = gremlin;
@@ -103,14 +104,17 @@ export async function confidenceAudit(g, params = {}) {
* @param {object} [opts]
* @param {string} [opts.confidence] - Filter to this confidence value
* @param {string} [opts.relation] - Filter to this edge label (e.g. implements_step)
+ * @param {boolean} [opts.changedOnly] - Only edges with an endpoint whose behavior or
+ * signature the PR changed (changeLevel BEHAVIORAL or STRUCTURAL)
* @param {number} [opts.limit] - Cap the result count (default 100)
* @returns {Promise<EdgeConfidenceRow[]>}
*/
export async function listEdgesByConfidence(g, opts = {}) {
- const { confidence, relation, limit = 100 } = opts;
+ const { confidence, relation, changedOnly, limit = 100 } = opts;
let t = g.E();
if (relation) t = t.hasLabel(relation);
if (confidence) t = t.has("confidence", confidence);
+ if (changedOnly) t = t.where(__.bothV().has("changeLevel", changedMeaningful()));
const rows = await t
.limit(limit)
@@ -141,7 +145,14 @@ export async function listEdgesByConfidence(g, opts = {}) {
*
* @param {object} g - gremlin-js GraphTraversalSource (already connected)
* @param {object} [params]
+ * A large PR carries tens of thousands of INFERRED edges, mostly name-resolved
+ * calls between code it did not touch, so `changedOnly` is the usable worklist:
+ * the edges with an endpoint the PR changed, which are the ones findings rest on.
+ *
+ * @param {object} g - gremlin-js GraphTraversalSource (already connected)
+ * @param {object} [params]
* @param {string} [params.relation] - Narrow to one relation (e.g. implements_step)
+ * @param {boolean} [params.changedOnly] - Only edges touching changed code
* @param {number} [params.limit] - Cap results (default 100)
* @returns {Promise<EdgeConfidenceRow[]>}
*/
@@ -149,6 +160,7 @@ export async function listInferred(g, params = {}) {
return listEdgesByConfidence(g, {
confidence: CONFIDENCE.INFERRED,
relation: params.relation,
+ changedOnly: params.changedOnly === true,
limit: params.limit || 100,
});
}