Merge origin/main (v1.91.9.0, #2998) into capy/audit-fix-wave; release as v1.91.10.0

Main shipped v1.91.9.0, so this wave becomes v1.91.10.0. Conflicts kept this
branch's planner-derived assertions. Main's new test-value eval gets rule
kinds for its three gate cases and its measured 332 s duration from #2998's
CI; census counts and the PR fallback floor follow the new file. The packing
test now weighs each tier's recorded durations the way the planner does.
This commit is contained in:
garrytan committed 2026-09-29 22:00:14 +00:00
commit 58b5e3f977
58 files changed
+2453 -220

No files matched your search

+3 -3
View File
@@ -166,7 +166,7 @@ export const CARVE_GUARDS: Record<string, CarveGuard> = {
// wave's headline capability) grows the union to 1.195x. Deliberate:
// the section is on-demand (loads only for Apple store targets), so
// per-invocation cost for non-iOS ships is one manifest line.
maxSizeRatio: 1.322, // Shared advisory identity/dedup + critical-severity validation: 248,065 union bytes / 187,706 baseline = 1.3216 (2026-09-17).
maxSizeRatio: 1.397, // Shared advisory identity/dedup + critical-severity validation: 248,065 union bytes / 187,706 baseline = 1.3216 (2026-09-17). + test value bar in the lazy Step 7 section (value cards, weak paths, gate table, base control, machine checks; ~13.6KB): measured 1.396 (2026-09-29).
},
'plan-ceo-review': {
skill: 'plan-ceo-review',
@@ -221,7 +221,7 @@ export const CARVE_GUARDS: Record<string, CarveGuard> = {
// 1.08 → 1.10: the scope-gate exceptions block (+ its adversarial-review
// hardening: host-anchored mode signal, precedence, passing-mention
// guards) and the plan-mode preamble reword land the union at 1.092.
maxSizeRatio: 1.151, // + clarity rules for saved decisions/setup gates + the Aside probe's failure reason; measured 1.1504
maxSizeRatio: 1.169, // + clarity rules for saved decisions/setup gates + the Aside probe's failure reason; measured 1.1504. + test value bar and Tests to Retire in the lazy Test review section (~2.6KB); measured 1.168
},
'plan-design-review': {
skill: 'plan-design-review',
@@ -664,7 +664,7 @@ do not launch the downstream skill or open a browser.`,
},
behavioral: 'prompt',
maxSkeletonBytes: 63_500, // + v2.0 {{ASIDE_SETUP}}/{{BROWSE_FALLBACK}} (replaces the browse setup block); measured 61_253
maxSizeRatio: 1.08, // + v1.81 Aside contract + gstack-browser fallback block; measured 1.063
maxSizeRatio: 1.095, // + v1.81 Aside contract + gstack-browser fallback block (1.080 on v1.91.7.0) + the shared test value bar at 8a.5 ({{TEST_VALUE_BAR:qa}}); measured 1.094
minUnionBytes: 69_500, // measured union 70,385
// 'aside repl' pins the Aside contract; '$B goto' pins the fallback block in the always-loaded skeleton.
mustContain: ['bug', 'aside repl', '$B goto', 'fix', 'Health Score Rubric', 'regression'],
+120
View File
@@ -0,0 +1,120 @@
/**
* Fixture for the test value bar evals (test/skill-e2e-test-value.test.ts).
*
* A tiny Bun project. The feature branch adds three tests:
* - test/pricing-source.test.ts greps src/pricing.ts for a function name
* (low value: exact source grep, no declared contract);
* - test/pricing-reset.test.ts exists only to call _resetPriceCacheForTests,
* a test-only export with no production caller (low value);
* - test/skill-golden.test.ts compares generated SKILL.md bytes with a golden
* file (a generated-output contract the retention bar keeps).
*/
import * as fs from 'node:fs';
import * as path from 'node:path';
import { spawnSync } from 'node:child_process';
export const LOW_VALUE_TESTS = {
sourceGrep: 'test/pricing-source.test.ts',
testOnlyExport: 'test/pricing-reset.test.ts',
golden: 'test/skill-golden.test.ts',
testOnlySymbol: '_resetPriceCacheForTests',
} as const;
function write(dir: string, relative: string, content: string): void {
fs.mkdirSync(path.dirname(path.join(dir, relative)), { recursive: true });
fs.writeFileSync(path.join(dir, relative), content);
}
function git(dir: string, args: string[]): void {
const result = spawnSync('git', args, { cwd: dir, stdio: 'pipe', timeout: 10_000 });
if (result.status !== 0) throw new Error(`git ${args.join(' ')} failed: ${result.stderr}`);
}
export function createTestValueFixture(dir: string): void {
write(dir, 'package.json', JSON.stringify({ name: 'pricing-app', version: '1.0.0', type: 'module', scripts: { test: 'bun test' } }, null, 2) + '\n');
write(dir, 'src/pricing.ts', `const cache = new Map<string, number>();
export function applyDiscount(price: number, percent: number): number {
if (percent < 0 || percent > 100) throw new Error('Invalid discount');
const key = \`\${price}:\${percent}\`;
if (!cache.has(key)) cache.set(key, Math.round(price * (100 - percent)) / 100);
return cache.get(key)!;
}
`);
write(dir, 'src/checkout.ts', `import { applyDiscount } from './pricing';
export function total(prices: number[], percent: number): number {
return prices.reduce((sum, price) => sum + applyDiscount(price, percent), 0);
}
`);
write(dir, 'scripts/gen-skill.ts', `export function renderSkill(name: string): string {
return \`# \${name}\\n\\nRun \\\`/\${name}\\\` to start.\\n\`;
}
`);
write(dir, 'test/fixtures/golden/SKILL.md', '# pricing\n\nRun `/pricing` to start.\n');
write(dir, 'test/pricing.test.ts', `import { test, expect } from 'bun:test';
import { applyDiscount } from '../src/pricing';
import { total } from '../src/checkout';
test('applies a discount and rejects an invalid percent', () => {
expect(applyDiscount(100, 25)).toBe(75);
expect(() => applyDiscount(100, 101)).toThrow('Invalid discount');
expect(total([100, 50], 10)).toBe(135);
});
`);
write(dir, 'CLAUDE.md', '# pricing-app\n\n## Testing\n\nRun `bun test`.\n');
git(dir, ['init', '-q', '-b', 'main']);
git(dir, ['config', 'user.email', 'test@test.com']);
git(dir, ['config', 'user.name', 'Test']);
git(dir, ['add', '.']);
git(dir, ['commit', '-q', '-m', 'initial pricing app']);
git(dir, ['checkout', '-q', '-b', 'feature/pricing-cache']);
fs.appendFileSync(path.join(dir, 'src/pricing.ts'), `
export function ${LOW_VALUE_TESTS.testOnlySymbol}(): void {
cache.clear();
}
`);
write(dir, LOW_VALUE_TESTS.sourceGrep, `import { test, expect } from 'bun:test';
import * as fs from 'node:fs';
test('pricing module defines applyDiscount', () => {
const source = fs.readFileSync(new URL('../src/pricing.ts', import.meta.url), 'utf8');
expect(source).toContain('export function applyDiscount');
});
`);
write(dir, LOW_VALUE_TESTS.testOnlyExport, `import { test, expect } from 'bun:test';
import { ${LOW_VALUE_TESTS.testOnlySymbol} } from '../src/pricing';
test('cache reset helper is callable', () => {
expect(() => ${LOW_VALUE_TESTS.testOnlySymbol}()).not.toThrow();
});
`);
write(dir, LOW_VALUE_TESTS.golden, `import { test, expect } from 'bun:test';
import * as fs from 'node:fs';
import { renderSkill } from '../scripts/gen-skill';
test('generated SKILL.md matches the golden bytes', () => {
const golden = fs.readFileSync(new URL('./fixtures/golden/SKILL.md', import.meta.url), 'utf8');
expect(renderSkill('pricing')).toBe(golden);
});
`);
git(dir, ['add', '.']);
git(dir, ['commit', '-q', '-m', 'add pricing cache and tests']);
}
export function lastJsonLine(output: string): any {
const lines = output.trim().split('\n').map(line => line.trim()).filter(Boolean);
for (let index = lines.length - 1; index >= 0; index--) {
const line = lines[index]!.replace(/^`+|`+$/g, '');
if (!line.startsWith('{')) continue;
try { return JSON.parse(line); } catch {}
}
return undefined;
}
export function jsonFindings(output: string): any[] {
return output.split('\n').map(line => line.trim()).filter(line => line.startsWith('{') && line.includes('"severity"')).flatMap(line => {
try { return [JSON.parse(line)]; } catch { return []; }
});
}
+10
View File
@@ -783,6 +783,10 @@ export const E2E_TOUCHFILES: Record<string, string[]> = {
"test/fixtures/coverage-diagram-legend-as.json",
'test/helpers/coverage-audit.ts', 'test/helpers/office-hours-attempt.ts'
],
// Test value bar behavior (weak paths, low-value findings, report-only sweep)
'ship-coverage-value': ['ship/**', 'scripts/resolvers/testing.ts', 'test/fixtures/coverage-audit-fixture.ts', 'test/skill-e2e-test-value.test.ts', 'test/helpers/test-value-fixture.ts', 'scripts/resolvers/test-value.ts', 'test/helpers/office-hours-attempt.ts', 'lib/eval-model.ts'],
'review-test-value': ['review/**', 'test/fixtures/coverage-audit-fixture.ts', 'test/skill-e2e-test-value.test.ts', 'test/helpers/test-value-fixture.ts', 'scripts/resolvers/test-value.ts', 'test/helpers/office-hours-attempt.ts', 'lib/eval-model.ts'],
'test-audit-report-only': ['test-audit/**', 'test/fixtures/coverage-audit-fixture.ts', 'test/skill-e2e-test-value.test.ts', 'test/helpers/test-value-fixture.ts', 'scripts/resolvers/test-value.ts', 'test/helpers/office-hours-attempt.ts', 'lib/eval-model.ts'],
'plan-eng-coverage-audit': [
'scripts/resolvers/learnings.ts',
'test/fixtures/coverage-audit-ci-diagrams.json',
@@ -1231,6 +1235,9 @@ export const E2E_TIERS: Record<string, 'gate' | 'periodic' | 'marathon'> = {
'plan-eng-review': 'periodic',
'plan-eng-review-artifact': 'periodic',
'plan-eng-coverage-audit': 'gate',
'ship-coverage-value': 'gate',
'review-test-value': 'gate',
'test-audit-report-only': 'gate',
'plan-review-report': 'gate',
// Plan-mode handshake. plan-ceo/plan-devex ask-first reliably (gate-tier);
@@ -1664,6 +1671,9 @@ export const E2E_KINDS: Record<string, 'rule' | 'behavior' | 'judge'> = {
'plan-ceo-review-plan-mode': 'rule',
'plan-eng-review-plan-mode': 'rule',
'plan-design-review-plan-mode': 'rule',
'ship-coverage-value': 'rule',
'review-test-value': 'rule',
'test-audit-report-only': 'rule',
'plan-devex-review-plan-mode': 'rule',
'plan-mode-no-op': 'rule',
'office-hours-auto-mode': 'rule',