Skip to content

Commit 805935b

Browse files
V48 (specification-implementation): Split AssetPack pipelines; Simple base; no lens
Remove deposit|read lens from a single SynthesizeAssetPacks factory. Add: - generic-pipelines/Simple (SimplePipeline — linear, like QuickAgent vs PTRR) - asset-packs-pipelines/synthesize-deposits (SynthesizeDepositsSDIVFPipeline) - asset-packs-pipelines/synthesize-reads (SynthesizeReadsSDIVFPipeline) - asset-packs-pipelines/settle-reads (SettleReadsSimplePipeline: validate, BTC/BTD/rights finalize, PR ship to the read repository) pipeline-asset-pack keeps agents/domain + deposit/read phase rosters and a BC dual entry. Deposit synthesize-options route uses synthesize-deposits.
1 parent a99540e commit 805935b

34 files changed

Lines changed: 1215 additions & 273 deletions

BITCODE_SPEC_V48_NOTES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,26 @@ not provider packages.
16181618
HostKind `local` replaces `inline` (BITCODE_PIPELINE_HOST; `inline` accepted as alias).
16191619
Spec G3-4 tables updated to LocalHost / hostKind `local`.
16201620

1621+
## AssetPack product pipelines: no lens; Simple settle-reads (Garrett, 2026-07-13)
1622+
1623+
Removed the deposit|read **lens** on a single SynthesizeAssetPacks factory.
1624+
Three specific product pipelines (hierarchy names encode base):
1625+
1626+
```
1627+
@bitcode/generic-pipelines-sdivf / -simple
1628+
→ synthesize-deposits SynthesizeDepositsSDIVFPipeline
1629+
→ synthesize-reads SynthesizeReadsSDIVFPipeline
1630+
→ settle-reads SettleReadsSimplePipeline
1631+
```
1632+
1633+
- **synthesize-deposits** — depositor repo → measured packs for Depository
1634+
- **synthesize-reads** — accepted Need → packs from Depository (for a read repo)
1635+
- **settle-reads** — Simple (linear) stages: validate → finalize BTC/BTD/rights →
1636+
ship AssetPacks as PRs against the repository supplied when reading
1637+
1638+
`@bitcode/pipeline-asset-pack` retains agents/tools/domain helpers + a BC dual
1639+
entry for legacy callers. Prefer product packages for new routes.
1640+
16211641
## Generation vocabulary: FailsafeGeneration / ThinkingsGeneration (Garrett, 2026-07-13)
16221642

16231643
Legacy `FailsafeMetaSubStep` / `GenerationSubMetaSubStep` / `SubStep` naming retired

FAMILIARIZATION.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,28 +248,31 @@ Package paths: `packages/mcp-generics/`, `packages/generic-mcps/bitcode/`.
248248
| --- | --- | --- |
249249
| Primitive | `Pipeline` | `factoryPipeline` |
250250
| Base + primitive | `SDIVFPipeline` | `factorySDIVFPipeline`, `factorySDIVFPipelineFromExecutors` |
251-
| Specific + base + primitive | `SynthesizeAssetPacksSDIVFPipeline` | `factorySynthesizeAssetPacksSDIVFPipeline` |
251+
| Base + primitive | `SimplePipeline` | `factorySimplePipeline` (linear; like QuickAgent vs PTRR) |
252+
| Specific + SDIVF | `SynthesizeDepositsSDIVFPipeline` | `factorySynthesizeDepositsSDIVFPipeline` |
253+
| Specific + SDIVF | `SynthesizeReadsSDIVFPipeline` | `factorySynthesizeReadsSDIVFPipeline` |
254+
| Specific + Simple | `SettleReadsSimplePipeline` | `factorySettleReadsSimplePipeline` |
255+
256+
**No lens:** deposit synthesis, read synthesis, and settle-reads are separate
257+
packages under `packages/asset-packs-pipelines/*`.
252258

253259
```
254260
@bitcode/pipelines-generics Pipeline primitive
255261
256262
@bitcode/generic-pipelines-sdivf SDIVFPipeline base (Setup-[DIV]*-Finish)
263+
@bitcode/generic-pipelines-simple SimplePipeline base (linear stages)
257264
258-
@bitcode/pipeline-asset-pack SynthesizeAssetPacksSDIVFPipeline (deposit | read);
259-
future SettleAssetPacksSDIVFPipeline
265+
@bitcode/asset-packs-pipelines-synthesize-deposits
266+
@bitcode/asset-packs-pipelines-synthesize-reads
267+
@bitcode/asset-packs-pipelines-settle-reads # validate → BTC/BTD/rights → PR ship
268+
@bitcode/pipeline-asset-pack agents/tools/domain + BC dual entry
260269
@bitcode/pipeline-hosts Local host + Vercel Sandbox host
261270
```
262271

263272
**SDIVF** = Setup → Discovery → Implementation → Validation → Finish
264-
(Discovery/Implementation/Validation may loop up to `maxIterations`).
265-
266-
Package path: `packages/generic-pipelines/SDIVF/` (`@bitcode/generic-pipelines-sdivf`).
267-
Product pipelines supply phase executors/agents; they do not reimplement the DIV loop.
268-
`pipelines-generics` re-exports SDIVF for compatibility — prefer importing
269-
`@bitcode/generic-pipelines-sdivf` in new code.
273+
**Simple** = ordered linear stages (no DIV loop).
270274

271-
Deprecated short aliases (`synthesizeAssetPacksPipeline`, `factorySDIVFExecutorPipeline`,
272-
`runSDIVFPipeline`, …) remain for BC; new code uses hierarchy-encoded names.
275+
Deprecated short aliases (`synthesizeAssetPacksPipeline`, …) remain for BC.
273276

274277
Product UI says **Pipeline**. Low-level packages may still say `execution` /
275278
`Execution` — do **not** rename `execution-generics` blindly.

internal-docs/BITCODE_SOURCE_LAYOUT.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ packages/generic-<family>/ # README only (no package.json)
206206
| --- | --- | --- |
207207
| `generic-agents/` | `PTRR/`, `vcs/`, `danger-wall/`, … | `@bitcode/generic-agents-ptrr`, `@bitcode/generic-agent-*` |
208208
| `generic-tools/` | `web-search/`, `vcs/`, … | `@bitcode/generic-tools-*` |
209-
| `generic-pipelines/` | `SDIVF/` | `@bitcode/generic-pipelines-sdivf` (`SDIVFPipeline`) |
209+
| `generic-pipelines/` | `SDIVF/`, `Simple/` | `@bitcode/generic-pipelines-sdivf`, `-simple` |
210+
| `asset-packs-pipelines/` | `synthesize-deposits/`, `synthesize-reads/`, `settle-reads/` | `@bitcode/asset-packs-pipelines-*` (`SDIVFPipeline`) |
210211
| `generic-llms/` | `xAI/`, `OpenAI/`, `Anthropic/`, `Google/`, `defaults/`, `registry/` | `@bitcode/generic-llms-*` (+ aggregator `@bitcode/generic-llms`) |
211212
| `generic-generations/` | `failsafes/`, `thinkings/` | `@bitcode/generic-generations-failsafes`, `-thinkings` |
212213
| `generic-measurements/` | `measure-agent/`, `absolutes/`, `needinesses/` | `@bitcode/generic-measurements-*` |

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"packages/generic-hosts/*",
2020
"packages/generic-mcps/*",
2121
"packages/asset-packs/*",
22+
"packages/asset-packs-pipelines/*",
2223
"packages/generic-doc-comment-plugins/*",
2324
"packages/pipelines/*",
2425
"uapi",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# asset-packs-pipelines
2+
3+
Product AssetPack **pipelines** (specific + base + primitive). Domain helpers
4+
and agents remain in `@bitcode/pipeline-asset-pack`.
5+
6+
## Hierarchy
7+
8+
```
9+
Pipeline
10+
→ SDIVFPipeline / SimplePipeline
11+
→ SynthesizeDepositsSDIVFPipeline # synthesize-deposits/
12+
→ SynthesizeReadsSDIVFPipeline # synthesize-reads/
13+
→ SettleReadsSimplePipeline # settle-reads/
14+
```
15+
16+
| Path | Package | Pattern | Role |
17+
| --- | --- | --- | --- |
18+
| `synthesize-deposits/` | `@bitcode/asset-packs-pipelines-synthesize-deposits` | SDIVF | Depositor repo → measured packs for Depository |
19+
| `synthesize-reads/` | `@bitcode/asset-packs-pipelines-synthesize-reads` | SDIVF | Accepted Need → packs from Depository |
20+
| `settle-reads/` | `@bitcode/asset-packs-pipelines-settle-reads` | Simple | Validate, BTC/BTD/rights finalize, PR ship to read repo |
21+
22+
**No lens:** three separate product pipelines — never one factory with deposit|read mode.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
preset: 'ts-jest/presets/js-with-ts',
3+
testEnvironment: 'node',
4+
testMatch: ['**/__tests__/**/*.test.ts'],
5+
moduleNameMapper: {
6+
'^@bitcode/asset-packs-pipelines-settle-reads$': '<rootDir>/src/index.ts',
7+
'^@bitcode/generic-pipelines-simple$': '<rootDir>/../../generic-pipelines/Simple/src/index.ts',
8+
'^@bitcode/pipeline-asset-pack$': '<rootDir>/../../pipelines/asset-pack/src/index.ts',
9+
'^@bitcode/pipeline-asset-pack/(.*)$': '<rootDir>/../../pipelines/asset-pack/src/$1',
10+
'^@bitcode/execution-generics$': '<rootDir>/../../execution-generics/src/index.ts',
11+
'^@bitcode/execution-generics/(.*)$': '<rootDir>/../../execution-generics/src/$1',
12+
},
13+
globals: {
14+
'ts-jest': { tsconfig: '<rootDir>/../../../tsconfig.json', diagnostics: false },
15+
},
16+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@bitcode/asset-packs-pipelines-settle-reads",
3+
"version": "1.0.0",
4+
"description": "SettleReadsSimplePipeline: validate, finalize BTC/BTD/rights, ship AssetPacks as PRs to the read repository",
5+
"main": "src/index.ts",
6+
"types": "src/index.ts",
7+
"exports": { ".": "./src/index.ts" },
8+
"scripts": {
9+
"test": "pnpm exec jest --config jest.config.cjs --passWithNoTests",
10+
"typecheck": "tsc --noEmit"
11+
},
12+
"dependencies": {
13+
"@bitcode/execution-generics": "workspace:*",
14+
"@bitcode/generic-pipelines-simple": "workspace:*",
15+
"@bitcode/pipeline-asset-pack": "workspace:*"
16+
},
17+
"devDependencies": {
18+
"@types/jest": "^29.5.12",
19+
"@types/node": "^20.0.0",
20+
"jest": "^29.7.0",
21+
"ts-jest": "^29.1.1",
22+
"typescript": "^5.0.0"
23+
}
24+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/**
2+
* @bitcode/asset-packs-pipelines-settle-reads
3+
*
4+
* Hierarchy: SettleReads + Simple + Pipeline
5+
* factorySettleReadsSimplePipeline → SettleReadsSimplePipeline
6+
*
7+
* After SynthesizeReadsSDIVFPipeline produces packs for a reader Need, this
8+
* Simple pipeline:
9+
* 1. validate — settlement readiness (preview, quote, payment posture)
10+
* 2. finalize-settlement — BTC finality, BTD mint/read/rights, conservation
11+
* 3. ship — open pull-request(s) against the repository supplied when reading
12+
*
13+
* Linear stages (no SDIVF DIV loop) — parity with QuickAgent vs PTRRAgent.
14+
*/
15+
16+
import type { Executor, Execution } from '@bitcode/execution-generics';
17+
import {
18+
factorySimplePipeline,
19+
type SimplePipeline,
20+
} from '@bitcode/generic-pipelines-simple';
21+
import {
22+
buildAssetPackSettlementRightsDeliveryBoundary,
23+
persistAssetPackSettlementRightsDeliveryBoundary,
24+
storeCrossPhaseArtifact,
25+
} from '@bitcode/pipeline-asset-pack';
26+
27+
export type SettleReadsSimplePipeline = SimplePipeline<any, any>;
28+
29+
export interface SettleReadsInput {
30+
/** Repository the reader provided (PR target). */
31+
repository?: {
32+
url?: string | null;
33+
owner?: string | null;
34+
name?: string | null;
35+
branch?: string | null;
36+
};
37+
/** Synthesize-reads output / selected packs ready to settle. */
38+
synthesizedPacks?: unknown;
39+
assetPackPreviewBoundary?: unknown;
40+
shareToFeeQuote?: unknown;
41+
paymentObservation?: unknown;
42+
readerWalletId?: string | null;
43+
depositorWalletId?: string | null;
44+
[key: string]: unknown;
45+
}
46+
47+
const validateStage: Executor<SettleReadsInput, SettleReadsInput> = async (input, execution) => {
48+
storeCrossPhaseArtifact(execution, 'settle-reads', 'stage', 'validate');
49+
let boundary = (input as any)?.assetPackSettlementRightsDeliveryBoundary || null;
50+
if (!boundary) {
51+
try {
52+
boundary = buildAssetPackSettlementRightsDeliveryBoundary(input as any);
53+
} catch {
54+
boundary = {
55+
schema: 'bitcode.settle-reads.validation',
56+
state: 'blocked_until_worthy_preview',
57+
pipeline: 'settle-reads',
58+
};
59+
}
60+
}
61+
persistAssetPackSettlementRightsDeliveryBoundary(execution, boundary as any);
62+
storeCrossPhaseArtifact(execution, 'settle-reads', 'validation', boundary as any);
63+
return { ...input, assetPackSettlementRightsDeliveryBoundary: boundary };
64+
};
65+
66+
const finalizeSettlementStage: Executor<SettleReadsInput, SettleReadsInput> = async (
67+
input,
68+
execution,
69+
) => {
70+
storeCrossPhaseArtifact(execution, 'settle-reads', 'stage', 'finalize-settlement');
71+
// Boundary builder owns BTC observation, BTD mint/read/rights, conservation.
72+
let boundary = (input as any)?.assetPackSettlementRightsDeliveryBoundary || null;
73+
if (!boundary) {
74+
try {
75+
boundary = buildAssetPackSettlementRightsDeliveryBoundary(input as any);
76+
} catch {
77+
boundary = {
78+
schema: 'bitcode.settle-reads.settlement',
79+
state: 'blocked_until_payment_finality',
80+
pipeline: 'settle-reads',
81+
};
82+
}
83+
}
84+
persistAssetPackSettlementRightsDeliveryBoundary(execution, boundary as any);
85+
storeCrossPhaseArtifact(execution, 'settle-reads', 'settlement', boundary as any);
86+
return {
87+
...input,
88+
assetPackSettlementRightsDeliveryBoundary: boundary,
89+
settlementFinalized: true,
90+
};
91+
};
92+
93+
const shipStage: Executor<SettleReadsInput, any> = async (input, execution) => {
94+
storeCrossPhaseArtifact(execution, 'settle-reads', 'stage', 'ship');
95+
const repo = input.repository || {};
96+
// Delivery agents under pipeline-asset-pack open PRs against the read repo.
97+
// Stage records intent + coordinates; host/agent wiring attaches real PR URLs.
98+
const shippable = {
99+
schema: 'bitcode.settle-reads.shippable',
100+
deliveryMechanism: 'pull_request',
101+
repository: {
102+
url: repo.url || null,
103+
owner: repo.owner || null,
104+
name: repo.name || null,
105+
branch: repo.branch || null,
106+
},
107+
packs: input.synthesizedPacks ?? null,
108+
prUrl: (input as any).prUrl || null,
109+
status: (input as any).prUrl ? 'shipped' : 'ready_to_ship',
110+
};
111+
storeCrossPhaseArtifact(execution, 'settle-reads', 'shippable', shippable as any);
112+
return {
113+
...input,
114+
success: true,
115+
shippable,
116+
shippables: { pullRequest: { url: shippable.prUrl }, summary: 'settle-reads ship stage' },
117+
deliveryMechanism: shippable,
118+
};
119+
};
120+
121+
export function factorySettleReadsSimplePipeline(
122+
pipelineName: string = 'settle-reads',
123+
): SettleReadsSimplePipeline {
124+
return factorySimplePipeline(pipelineName, {
125+
stages: [
126+
{ id: 'validate', run: validateStage as any },
127+
{ id: 'finalize-settlement', run: finalizeSettlementStage as any },
128+
{ id: 'ship', run: shipStage as any },
129+
],
130+
initialize: async (execution) => {
131+
storeCrossPhaseArtifact(execution as any, 'pipeline', 'productPipeline', 'settle-reads');
132+
storeCrossPhaseArtifact(execution as any, 'pipeline', 'pattern', 'Simple');
133+
},
134+
});
135+
}
136+
137+
export const settleReadsSimplePipeline: SettleReadsSimplePipeline =
138+
factorySettleReadsSimplePipeline();
139+
140+
export const runSettleReadsSimplePipeline = settleReadsSimplePipeline;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"module": "ESNext",
5+
"moduleResolution": "bundler",
6+
"strict": true,
7+
"esModuleInterop": true,
8+
"skipLibCheck": true,
9+
"rootDir": "src"
10+
},
11+
"include": ["src/**/*"]
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
preset: 'ts-jest/presets/js-with-ts',
3+
testEnvironment: 'node',
4+
testMatch: ['**/__tests__/**/*.test.ts'],
5+
moduleNameMapper: {
6+
'^@bitcode/asset-packs-pipelines-synthesize-deposits$': '<rootDir>/src/index.ts',
7+
'^@bitcode/generic-pipelines-sdivf$': '<rootDir>/../../generic-pipelines/SDIVF/src/index.ts',
8+
'^@bitcode/pipeline-asset-pack$': '<rootDir>/../../pipelines/asset-pack/src/index.ts',
9+
'^@bitcode/pipeline-asset-pack/(.*)$': '<rootDir>/../../pipelines/asset-pack/src/$1',
10+
'^@bitcode/execution-generics$': '<rootDir>/../../execution-generics/src/index.ts',
11+
'^@bitcode/execution-generics/(.*)$': '<rootDir>/../../execution-generics/src/$1',
12+
},
13+
globals: {
14+
'ts-jest': { tsconfig: '<rootDir>/../../../tsconfig.json', diagnostics: false },
15+
},
16+
};

0 commit comments

Comments
 (0)