Skip to content

Commit 1b9c8a9

Browse files
V48 Gate 3 (implementation-only): Align deposit tests with formal absolutes and source-safe inventory
Neediness validation now fails closed without Validation-phase formal absolutes, and pipeline:input projects inventory without full sources. Update pins so Gate Quality package tests match the G3 deposit law already shipped on this branch.
1 parent 8b1ee52 commit 1b9c8a9

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

packages/pipelines/asset-pack/src/__tests__/deposit-preprocess.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,19 @@ describe('deposit-mode preprocess context assembly', () => {
135135
expect(execution.get('deposit', 'obfuscations')).toEqual(input.obfuscations);
136136
expect(execution.get('deposit', 'forcedExclusions')).toEqual(['src/secret/**']);
137137
expect(execution.get('deposit', 'demandContext')).toEqual([{ topic: 'terminal reads', demand: 'high' }]);
138+
// Full inventory stays on the deposit data plane for measurement tools.
138139
expect(execution.get('deposit', 'inventory')).toEqual({ assetCount: 2 });
139140
expect(execution.get('pipeline', 'synthesizeMode')).toBe('deposit');
140-
expect(execution.get('pipeline', 'input')).toBe(input);
141+
// pipeline:input is telemetried — inventory is projected without sources
142+
// (path/sample counts only). Full sources live only on deposit:inventory.
143+
expect(execution.get('pipeline', 'input')).toMatchObject({
144+
mode: 'deposit',
145+
inventory: {
146+
sourceFileCount: 0,
147+
},
148+
});
149+
expect(execution.get('pipeline', 'input').inventory).not.toHaveProperty('sources');
150+
expect(execution.get('pipeline', 'input').inventory).not.toHaveProperty('assetCount');
141151
// Consumer resolution from a phase sibling's subtree.
142152
expect(execution.child('probe').findUp('deposit', 'inventory')).toEqual({ assetCount: 2 });
143153

packages/pipelines/asset-pack/src/__tests__/neediness.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@ describe('neediness (deposit preview of read Need-fit, v0)', () => {
3737
});
3838

3939
it('attaches neediness to deposit candidates and omits it for read', () => {
40+
// Gate 3 Validation attaches formal absolutes; the validator fails closed without them.
41+
const formalAbsolutes = [
42+
{
43+
measurementKind: 'function-count',
44+
label: 'Functions',
45+
weight: 0.12,
46+
volume: 0.7,
47+
category: 'absolute' as const,
48+
magnitude: 4,
49+
unit: 'functions',
50+
},
51+
{
52+
measurementKind: 'correctness-estimate',
53+
label: 'Correctness',
54+
weight: 0.18,
55+
volume: 0.8,
56+
category: 'absolute' as const,
57+
},
58+
];
4059
const raw = [
4160
{
4261
kind: 'capability-slice',
@@ -46,6 +65,7 @@ describe('neediness (deposit preview of read Need-fit, v0)', () => {
4665
measurements: { 'source-coverage': 0.7, 'demand-alignment': 0.6, 'reuse-likelihood': 0.5 },
4766
measurementRationale: 'Covers the auth module thoroughly.',
4867
confidence: 0.8,
68+
absolutes: formalAbsolutes,
4969
needinessSignal: { demand: 0.9, saturation: 0.2, rationale: 'High demand, few existing suppliers.' },
5070
},
5171
];
@@ -63,6 +83,10 @@ describe('neediness (deposit preview of read Need-fit, v0)', () => {
6383
expect(deposit.candidates[0].measurements.map((m) => m.measurementKind)).not.toContain(
6484
DEPOSIT_NEEDINESS_MEASUREMENT.measurementKind,
6585
);
86+
// Formal absolutes project onto the candidate measurements array.
87+
expect(deposit.candidates[0].measurements.map((m) => m.measurementKind)).toEqual(
88+
expect.arrayContaining(['function-count', 'correctness-estimate']),
89+
);
6690

6791
const read = validateDepositSynthesisOptions(raw, { ...context, lens: 'read' });
6892
expect(read.candidates[0].neediness).toBeUndefined();

0 commit comments

Comments
 (0)