Skip to content

Commit 5d84952

Browse files
V48 (specification-implementation): Hierarchy-encoded Pipeline type names
Enforce naming that always expresses full inheritance ancestry: Pipeline → SDIVFPipeline → SynthesizeAssetPacksSDIVFPipeline. Rename factories and types accordingly (factorySDIVFPipelineFromExecutors, factorySynthesizeAssetPacksSDIVFPipeline, …) with deprecated short aliases for compatibility. Document the law in FAMILIARIZATION, SOURCE_LAYOUT, and V48 notes.
1 parent 98e0859 commit 5d84952

18 files changed

Lines changed: 264 additions & 107 deletions

File tree

BITCODE_SPEC_V48_NOTES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,3 +1550,21 @@ Those failsafe types now live with failsafes.
15501550
Physical move of `createFailsafeGenerationSequence` / Thinkings factories out of
15511551
agent-generics remains gated on inverting AgentExecution LLM coupling.
15521552

1553+
## Pipeline hierarchy naming law (Garrett, 2026-07-13)
1554+
1555+
Type and factory names must always express full inheritance ancestry:
1556+
1557+
```
1558+
Pipeline # primitive
1559+
SDIVFPipeline # base + primitive
1560+
SynthesizeAssetPacksSDIVFPipeline # specific + base + primitive
1561+
```
1562+
1563+
Canonical factories:
1564+
- `factoryPipeline``Pipeline`
1565+
- `factorySDIVFPipeline` / `factorySDIVFPipelineFromExecutors``SDIVFPipeline`
1566+
- `factorySynthesizeAssetPacksSDIVFPipeline``SynthesizeAssetPacksSDIVFPipeline`
1567+
1568+
Short aliases (`factorySDIVFExecutorPipeline`, `synthesizeAssetPacksPipeline`,
1569+
`runSDIVFPipeline`) are deprecated compatibility shims only.
1570+

FAMILIARIZATION.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,22 @@ pipeline-local tools e.g. AssetPackLexicalDepositorySearchTool
164164

165165
### 3.3 Pipelines
166166

167+
**Hierarchy naming law:** names always encode full ancestry
168+
(specific → base → primitive), never a leaf-only label.
169+
170+
| Layer | Type name | Factory (examples) |
171+
| --- | --- | --- |
172+
| Primitive | `Pipeline` | `factoryPipeline` |
173+
| Base + primitive | `SDIVFPipeline` | `factorySDIVFPipeline`, `factorySDIVFPipelineFromExecutors` |
174+
| Specific + base + primitive | `SynthesizeAssetPacksSDIVFPipeline` | `factorySynthesizeAssetPacksSDIVFPipeline` |
175+
167176
```
168-
@bitcode/pipelines-generics Pipeline, PhaseDelegator, composition, streaming
177+
@bitcode/pipelines-generics Pipeline primitive
169178
170-
@bitcode/generic-pipelines-sdivf SDIVF *base* loop (Setup-[DIV]*-Finish)
179+
@bitcode/generic-pipelines-sdivf SDIVFPipeline base (Setup-[DIV]*-Finish)
171180
172-
@bitcode/pipeline-asset-pack SynthesizeAssetPacks (deposit | read);
173-
future SettleAssetPacks extends SDIVF base
181+
@bitcode/pipeline-asset-pack SynthesizeAssetPacksSDIVFPipeline (deposit | read);
182+
future SettleAssetPacksSDIVFPipeline
174183
@bitcode/pipeline-hosts Inline host + Vercel Sandbox harness
175184
```
176185

@@ -182,6 +191,9 @@ Product pipelines supply phase executors/agents; they do not reimplement the DIV
182191
`pipelines-generics` re-exports SDIVF for compatibility — prefer importing
183192
`@bitcode/generic-pipelines-sdivf` in new code.
184193

194+
Deprecated short aliases (`synthesizeAssetPacksPipeline`, `factorySDIVFExecutorPipeline`,
195+
`runSDIVFPipeline`, …) remain for BC; new code uses hierarchy-encoded names.
196+
185197
Product UI says **Pipeline**. Low-level packages may still say `execution` /
186198
`Execution` — do **not** rename `execution-generics` blindly.
187199

internal-docs/BITCODE_SOURCE_LAYOUT.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,21 @@ uapi/components/bitcode/
174174
Packages hold **framework-agnostic** domain logic. Prefer existing packages;
175175
add new packages when a domain is clearly shared and non-UI.
176176

177+
### 6.0 Hierarchy naming law (required)
178+
179+
Type, factory, and export names **always encode full inheritance ancestry**:
180+
181+
```
182+
Pipeline # primitive
183+
SDIVFPipeline # base + primitive
184+
SynthesizeAssetPacksSDIVFPipeline # specific + base + primitive
185+
```
186+
187+
Do not introduce leaf-only names for layered types (e.g. avoid a product
188+
pipeline named only `AssetPackPipeline` when it is an `…SDIVFPipeline`).
189+
Deprecated short aliases may exist for compatibility; new code uses the
190+
full hierarchy name.
191+
177192
### 6.1 Nested `generic-*` families (required)
178193

179194
Every `packages/generic-*` path is a **family folder**, not a single package.
@@ -191,7 +206,7 @@ packages/generic-<family>/ # README only (no package.json)
191206
| --- | --- | --- |
192207
| `generic-agents/` | `vcs/`, `danger-wall/`, … | `@bitcode/generic-agents-*` |
193208
| `generic-tools/` | `web-search/`, `vcs/`, … | `@bitcode/generic-tools-*` |
194-
| `generic-pipelines/` | `SDIVF/` | `@bitcode/generic-pipelines-sdivf` |
209+
| `generic-pipelines/` | `SDIVF/` | `@bitcode/generic-pipelines-sdivf` (`SDIVFPipeline`) |
195210
| `generic-llms/` | `xAI/`, `OpenAI/`, `Anthropic/`, `Google/`, `defaults/`, `registry/` | `@bitcode/generic-llms-*` (+ aggregator `@bitcode/generic-llms`) |
196211
| `generic-generations/` | `failsafes/`, `thinkings/` | `@bitcode/generic-generations-failsafes`, `-thinkings` |
197212
| `generic-doc-comment-plugins/` | `doc-developing/` | `@bitcode/doc-comment-developing` |

packages/agent-generics/src/steps/thinkings-generation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import { sequential, type Executor } from '@bitcode/execution-generics';
1111
import { z } from 'zod';
1212
import { factoryReason, factoryJudge, factoryStructuredOutput } from '../substeps/factories';
1313

14+
/**
15+
* Thinkings + Generation hierarchy name (base Thinkings composition of the
16+
* Generation primitive). Prefer hierarchy-encoded names for product extensions
17+
* (e.g. MeasureAbsolutesThinkingsGeneration) when introducing specialized bases.
18+
*/
1419
export type ThinkingsGeneration<TIn = any, TOut = any> = Executor<TIn, TOut>;
1520

1621
export function createThinkingsGeneration<TIn, TOut>(outputSchema: z.ZodType<TOut>): ThinkingsGeneration<TIn, TOut> {

packages/executions-mcp/src/mcp-server/src/__tests__/setup/mcpTestSetup.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,20 @@ jest.mock('@bitcode/pipelines-generics', () => ({
382382
success: true
383383
}))
384384
),
385+
factorySDIVFPipelineFromExecutors: jest.fn().mockImplementation((_name: string, config: any) =>
386+
jest.fn().mockImplementation(async (input: any, execution: any) => {
387+
let current = input;
388+
if (config?.preprocess) current = await config.preprocess(current, execution);
389+
if (config?.setup) current = await config.setup(current, execution);
390+
if (config?.discovery) current = await config.discovery(current, execution);
391+
if (config?.implementation) current = await config.implementation(current, execution);
392+
if (config?.validation) current = await config.validation(current, execution);
393+
if (config?.finish) current = await config.finish(current, execution);
394+
if (config?.postprocess) current = await config.postprocess(current, execution);
395+
return current;
396+
})
397+
),
398+
// @deprecated alias of factorySDIVFPipelineFromExecutors
385399
factorySDIVFExecutorPipeline: jest.fn().mockImplementation((_name: string, config: any) =>
386400
jest.fn().mockImplementation(async (input: any, execution: any) => {
387401
let current = input;

packages/generic-pipelines/README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,35 @@
22

33
Base pipeline implementations that extend `@bitcode/pipelines-generics` primitives.
44

5-
## Hierarchy
5+
## Hierarchy (names encode full ancestry)
66

77
```
8-
@bitcode/pipelines-generics # Pipeline / PhaseDelegator / composition primitives
8+
Pipeline # primitive (@bitcode/pipelines-generics)
99
10-
@bitcode/generic-pipelines-sdivf # SDIVF base loop (this folder: SDIVF/)
10+
SDIVFPipeline # base + primitive (@bitcode/generic-pipelines-sdivf)
1111
12-
@bitcode/pipeline-asset-pack # SynthesizeAssetPacks (and future SettleAssetPacks)
12+
SynthesizeAssetPacksSDIVFPipeline # specific + base + primitive (pipeline-asset-pack)
13+
SettleAssetPacksSDIVFPipeline # future product
14+
```
15+
16+
```
17+
@bitcode/pipelines-generics # factoryPipeline → Pipeline
18+
19+
@bitcode/generic-pipelines-sdivf # factorySDIVFPipeline / FromExecutors → SDIVFPipeline
20+
21+
@bitcode/pipeline-asset-pack # factorySynthesizeAssetPacksSDIVFPipeline
1322
```
1423

1524
## Packages
1625

1726
| Path | Package name | Role |
1827
| --- | --- | --- |
19-
| `SDIVF/` | `@bitcode/generic-pipelines-sdivf` | Setup-[Discovery-Implementation-Validation]*-Finish base |
28+
| `SDIVF/` | `@bitcode/generic-pipelines-sdivf` | `SDIVFPipeline` base (Setup-[DIV]*-Finish) |
2029

2130
Product pipelines supply phase agents/executors; they do not reimplement the DIV loop.
31+
**Naming law:** every type/factory name must express the full inheritance chain
32+
(e.g. never call a product pipeline merely `AssetPackPipeline` when it is an
33+
`…SDIVFPipeline`).
2234

2335
## Nested-package pattern
2436

packages/generic-pipelines/SDIVF/src/__tests__/sdivf-executor-loop.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-nocheck
22
/**
3-
* factorySDIVFExecutorPipeline semantics (V48 Gate 3).
3+
* factorySDIVFPipelineFromExecutors semantics (V48 Gate 3).
44
*
55
* This is the SDIVF variant the SynthesizeAssetPacks pipeline actually runs
66
* (packages/pipelines/asset-pack/src/index.ts) — NOT factorySDIVFPipeline,
@@ -28,7 +28,7 @@
2828
* (finalApproval/passed false), so the exact-iteration-count pins exercise the
2929
* bounded (max-iterations) side of the gate.
3030
*/
31-
import { factorySDIVFExecutorPipeline } from '../index';
31+
import { factorySDIVFPipelineFromExecutors } from '../index';
3232
import { Execution } from '@bitcode/execution-generics/Execution';
3333

3434
type Recorded = { calls: string[]; inputs: Record<string, any[]>; nodes: Record<string, string[]> };
@@ -66,10 +66,10 @@ function buildConfig(recorded: Recorded, overrides: Record<string, any> = {}) {
6666
};
6767
}
6868

69-
describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
69+
describe('factorySDIVFPipelineFromExecutors (executor-variant SDIVF loop)', () => {
7070
it('runs preprocess → setup → (D→I→V) × maxIterations → finish → postprocess in order', async () => {
7171
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
72-
const pipeline = factorySDIVFExecutorPipeline('sdivf-loop-order', {
72+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-loop-order', {
7373
...buildConfig(recorded),
7474
maxIterations: 2,
7575
});
@@ -94,7 +94,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
9494

9595
it('never exceeds maxIterations (single-iteration loop)', async () => {
9696
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
97-
const pipeline = factorySDIVFExecutorPipeline('sdivf-loop-single', {
97+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-loop-single', {
9898
...buildConfig(recorded),
9999
maxIterations: 1,
100100
});
@@ -109,7 +109,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
109109

110110
it('exits the DIV loop early when the validation RESULT signals ready-to-finish', async () => {
111111
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
112-
const pipeline = factorySDIVFExecutorPipeline('sdivf-gate-result', {
112+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-gate-result', {
113113
...buildConfig(recorded, {
114114
validation: async (input: any, exec: any) => {
115115
record(recorded, 'validation', input, exec);
@@ -135,7 +135,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
135135
it('exits the DIV loop early via the cross-phase validation:readyToFinish artifact on the ROOT', async () => {
136136
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
137137
const root = new Execution('root-gate-artifact');
138-
const pipeline = factorySDIVFExecutorPipeline('sdivf-gate-artifact', {
138+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-gate-artifact', {
139139
...buildConfig(recorded, {
140140
validation: async (input: any, exec: any) => {
141141
record(recorded, 'validation', input, exec);
@@ -163,7 +163,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
163163
it('honors a cfg.readyToFinish override as the gate', async () => {
164164
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
165165
const gateCalls: any[] = [];
166-
const pipeline = factorySDIVFExecutorPipeline('sdivf-gate-override', {
166+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-gate-override', {
167167
...buildConfig(recorded),
168168
readyToFinish: async (result: any) => {
169169
gateCalls.push(result);
@@ -186,7 +186,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
186186
it('records loop observability: per-iteration pass flags and the max-iterations marker', async () => {
187187
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
188188
const root = new Execution('root-gate-observe');
189-
const pipeline = factorySDIVFExecutorPipeline('sdivf-gate-observe', {
189+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-gate-observe', {
190190
...buildConfig(recorded),
191191
maxIterations: 2,
192192
});
@@ -203,7 +203,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
203203

204204
it('threads each phase output into the next phase input', async () => {
205205
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
206-
const pipeline = factorySDIVFExecutorPipeline('sdivf-threading', {
206+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-threading', {
207207
...buildConfig(recorded),
208208
maxIterations: 2,
209209
});
@@ -230,7 +230,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
230230

231231
it('runs iterationPreprocess before each Discovery and threads its return into the loop', async () => {
232232
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
233-
const pipeline = factorySDIVFExecutorPipeline('sdivf-iterpre', {
233+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-iterpre', {
234234
...buildConfig(recorded),
235235
iterationPreprocess: async (input: any, exec: any) => {
236236
record(recorded, 'iterationPreprocess', input, exec);
@@ -257,7 +257,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
257257
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
258258
const seen: Record<string, any> = {};
259259
const root = new Execution('root-topology');
260-
const pipeline = factorySDIVFExecutorPipeline('sdivf-topology', {
260+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-topology', {
261261
...buildConfig(recorded, {
262262
setup: async (input: any, exec: any) => {
263263
record(recorded, 'setup', input, exec);
@@ -297,7 +297,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
297297
it('stores phase start/complete observability with iteration numbers', async () => {
298298
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
299299
const root = new Execution('root-observe');
300-
const pipeline = factorySDIVFExecutorPipeline('sdivf-observe', {
300+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-observe', {
301301
...buildConfig(recorded),
302302
maxIterations: 2,
303303
});
@@ -325,7 +325,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
325325
it('fails closed: a throwing implementation rejects the pipeline and stops downstream phases', async () => {
326326
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
327327
const root = new Execution('root-fail');
328-
const pipeline = factorySDIVFExecutorPipeline('sdivf-fail', {
328+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-fail', {
329329
...buildConfig(recorded, {
330330
implementation: async (input: any, exec: any) => {
331331
record(recorded, 'implementation', input, exec);
@@ -354,7 +354,7 @@ describe('factorySDIVFExecutorPipeline (executor-variant SDIVF loop)', () => {
354354

355355
it('fails closed on a throwing setup: the DIV loop and finish never start', async () => {
356356
const recorded: Recorded = { calls: [], inputs: {}, nodes: {} };
357-
const pipeline = factorySDIVFExecutorPipeline('sdivf-fail-setup', {
357+
const pipeline = factorySDIVFPipelineFromExecutors('sdivf-fail-setup', {
358358
...buildConfig(recorded, {
359359
setup: async (input: any, exec: any) => {
360360
record(recorded, 'setup', input, exec);
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
/**
22
* @bitcode/generic-pipelines-sdivf
33
*
4-
* Base SDIVF Pipeline implementation extending pipelines-generics primitives.
5-
* Product pipelines (SynthesizeAssetPacks, future SettleAssetPacks) extend this
6-
* base rather than reimplementing the Setup-[DIV]*-Finish loop.
4+
* Base SDIVFPipeline (hierarchy: SDIVF + Pipeline primitive).
5+
* Product pipelines name themselves as Specific+SDIVF+Pipeline, e.g.
6+
* SynthesizeAssetPacksSDIVFPipeline — they do not reimplement the DIV loop.
77
*/
88

9+
export type { SDIVFPipeline } from './sdivf-factory';
10+
911
export {
1012
factorySDIVFPipeline,
13+
factorySDIVFPipelineFromExecutors,
14+
/** @deprecated Use factorySDIVFPipelineFromExecutors */
1115
factorySDIVFExecutorPipeline,
16+
type SDIVFPipelineConfig,
17+
type SDIVFPipelineExecutorConfig,
18+
/** @deprecated Use SDIVFPipelineConfig */
1219
type SDIVFConfig,
20+
/** @deprecated Use SDIVFPipelineExecutorConfig */
1321
type SDIVFExecutorConfig,
1422
} from './sdivf-factory';
1523

1624
export {
25+
SDIVFPipelinePhase,
26+
factorySDIVFPipelinePhaseDelegators,
27+
/** @deprecated Use SDIVFPipelinePhase */
1728
SDIVFPhase,
29+
/** @deprecated Use factorySDIVFPipelinePhaseDelegators */
1830
factorySDIVFPhaseDelegators,
1931
} from './sdivf-phases';

0 commit comments

Comments
 (0)