Skip to content

Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.

Verify bounded installed output and prepare measured source policy trial

David Zhangbb0e96b724d3
diff --git a/scripts/test-installed.sh b/scripts/test-installed.sh
index 03bf29d..026911b 100755
--- a/scripts/test-installed.sh
+++ b/scripts/test-installed.sh
@@ -20,18 +20,19 @@ while [[ $# -gt 0 ]]; do
[[ $# -ge 2 && -f "$2" ]] || { echo "--prebuilt requires a package tarball"; exit 1; }
package_input="$2"; shift 2 ;;
--case)
- [[ $# -ge 2 ]] || { echo "--case requires checkpoint, failures, or cache"; exit 1; }
+ [[ $# -ge 2 ]] || { echo "--case requires checkpoint, failures, cache, or output"; exit 1; }
case "$2" in
checkpoint) pattern="" ;;
failures) pattern="provider|malformed|invalid JSON|cancellation|interrupt|stdout pipe" ;;
cache) pattern="cache" ;;
+ output) pattern="source budget|head -200" ;;
*) echo "Unknown installed test case: $2"; exit 1 ;;
esac
shift 2 ;;
--test-name-pattern)
[[ $# -ge 2 ]] || { echo "--test-name-pattern requires a pattern"; exit 1; }
pattern="$2"; shift 2 ;;
- *) echo "Usage: $0 [--prebuilt package.tgz] [--case checkpoint|failures|cache] [--test-name-pattern regex]"; exit 1 ;;
+ *) echo "Usage: $0 [--prebuilt package.tgz] [--case checkpoint|failures|cache|output] [--test-name-pattern regex]"; exit 1 ;;
esac
done
if [[ -n "$package_input" ]]; then
diff --git a/specs/jevgrep/choices.md b/specs/jevgrep/choices.md
index 490055d..d55c5aa 100644
--- a/specs/jevgrep/choices.md
+++ b/specs/jevgrep/choices.md
@@ -138,3 +138,29 @@ Gap: the filesystem interruption and invalidation paths shared a preparation
boundary, so the implementation had to distinguish their effect on retained data.
Reach: partial output remains useful without claiming complete discovery or a
filesystem lock. Verdict: sound. Confidence: high.
+
+
+### Use available declaration scores to allocate limited source
+
+When: source-budget trial. If a byte cap cannot fit every selected excerpt,
+prefer an excerpt containing a declaration Jev scored above 0.5, starting with
+the strongest score. Keep all file locations and reading leads, and explicitly
+mark source omissions. Equal scores preserve original ordering. A class-context
+snippet can be useful despite lacking such a score; this heuristic does not
+claim to measure the value of all context.
+
+Gap: numerical source allocation and tie breaks were delegated. Reach: finite
+budgets may omit useful surrounding context, so the default stays uncapped until
+the official task and complete Sol bill support the candidate. Verdict: sound
+as a reversible trial, not an accepted default. Confidence: medium.
+
+### Freeze one installed package across the official cohort
+
+When: maintained benchmark runner. Prepare all ten cells before execution, binding
+package, skill, agent inputs, dataset and harness sources. Each cell can execute
+once; an abandoned attempt is retained as interrupted. A smaller diagnostic study
+cannot satisfy the cohort gate, and the runner has no baseline execution path.
+
+Gap: artifact layout and execution mechanics were delegated. Reach: results from
+different candidates cannot be pooled into acceptance; failed attempts and unknown
+bills remain visible. Verdict: sound. Confidence: high.
diff --git a/specs/jevgrep/slices/07-output-policy.md b/specs/jevgrep/slices/07-output-policy.md
index a385380..4df51a1 100644
--- a/specs/jevgrep/slices/07-output-policy.md
+++ b/specs/jevgrep/slices/07-output-policy.md
@@ -1,6 +1,6 @@
# Choose source allocation using completed tasks
-Status: planned. Depends on: 06. Read [contracts](../contracts.md) first.
+Status: measuring. Depends on: 06. Read [contracts](../contracts.md) first.
## Contract and owner
@@ -12,7 +12,7 @@ Record the chosen default and all attempts in the spec before freezing the relea
Recorded source-budget decision.
-`bun run eval:swebench -- --task psf__requests-1142 --compare-source-budgets --reuse-baseline` plus `bun run test:e2e -- --case output`.
+Use `bun run eval:swebench prepare --package /absolute/package.tgz --output /absolute/new-study --task psf__requests-1142`, then the maintained runner's `run`, `grade` and `account` operations on that plan. See [the runner workflow](../../../evals/implementation/swebench/installed.md). `bun run test:e2e -- --case output` verifies installed rendering and actual head truncation.
Commands are implementation targets. Add them in this slice; do not imply they
already exist. CLI transcripts replace visual/screenshot gates for this product.
@@ -35,3 +35,15 @@ Show the artifact and summarize deviations. This is a non-blocking review checkp
continue on the evidence if the user does not respond. Feedback that changes the
public contract or acceptance measure requires updating this slice before broadening
implementation. Record new choices and update the README handoff before ending.
+
+Current candidate: 1,500 source bytes, with whole excerpts ranked by contained
+reading leads scoring above 0.5; equal scores keep original order. It preserves
+all admitted paths and leads. This is a heuristic because class-context snippets
+have no reading-lead score. Production default remains 0 (uncapped) until measured.
+On the retained Requests packet it keeps the decisive method and test helper
+(1,208 source bytes) while omitting 689 bytes of scaffolding. Unlimited output
+is byte-identical to the retained 2,852-byte stdout. This is packet evidence only.
+
+The candidate package and skill are frozen in the single-task study
+`evals/runs/swebench/installed-jg-requests-budget1500-v1/plan.json`.
+No baseline execution is available in the maintained runner.
diff --git a/test/Dockerfile b/test/Dockerfile
index 71fbc3e..b8b05bc 100644
--- a/test/Dockerfile
+++ b/test/Dockerfile
@@ -19,6 +19,7 @@ RUN mkdir -p /opt/npm-cache && cd apps/cli && npm pack --ignore-scripts --pack-d
ENV npm_config_cache=/opt/npm-cache npm_config_offline=true
COPY evals/implementation/swebench/hierarchy-unit-locators-spike.ts evals/implementation/swebench/source-method-windows-spike.ts evals/implementation/swebench/source-method-declarations-spike.py evals/implementation/swebench/content-handoff-v47-spike.ts evals/implementation/swebench/content-handoff-v47-spike.py evals/implementation/swebench/complete-source-v64-spike.ts evals/implementation/swebench/preview-fragments-v51-spike.ts evals/implementation/swebench/source-neighborhood-spike.py evals/implementation/swebench/
COPY evals/implementation/swebench/installed.py evals/implementation/swebench/gateway_broker.py evals/implementation/swebench/test_installed.py evals/implementation/swebench/
+COPY evals/implementation/swebench/fixed-baselines.json evals/implementation/swebench/
RUN bun build evals/implementation/swebench/hierarchy-unit-locators-spike.ts --target=node --outfile=/opt/jevgrep-reference.mjs
ENV JEVGREP_TEST_IN_DOCKER=1 HOME=/tmp/jevgrep-home XDG_CONFIG_HOME=/tmp/jevgrep-config XDG_CACHE_HOME=/tmp/jevgrep-cache AI_GATEWAY_API_KEY=""
CMD ["bun", "test", "test/reference/replay.test.ts"]
diff --git a/test/installed.test.mjs b/test/installed.test.mjs
index 7c795ba..4d83b55 100644
--- a/test/installed.test.mjs
+++ b/test/installed.test.mjs
@@ -631,3 +631,22 @@ test("a rate-limited provider retry waits and recovers the installed evidence",
assert.ok(fixture.requests[1].receivedAt - fixture.requests[0].receivedAt >= 950);
assert.equal(fixture.requests.filter(({ raw }) => raw === fixture.requests[0].raw).length, 2);
});
+
+test("source budget preserves every file and lead while explicitly omitting source", async (t) => {
+ const fixture = await context(t);
+ const unlimited = await fixture.run([query, "--max-source-bytes", "0"]);
+ complete(unlimited);
+ const before = fixture.requests.length;
+ const bounded = await fixture.run([query, "--max-source-bytes", "1"]);
+ assert.equal(bounded.code, 0);
+ assert.match(bounded.stdout, /Source omitted: [1-9]/);
+ assert.ok(!bounded.stdout.includes("py-evidence-"));
+ const locations = (stdout) =>
+ stdout.split("\n").filter((line) => line.startsWith("- ") || /^ \"/.test(line));
+ assert.deepEqual(locations(bounded.stdout), locations(unlimited.stdout));
+ assert.equal(
+ fixture.requests.length,
+ before,
+ "Rendering policy must not change cached classification requests",
+ );
+});