@tiinex/core 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/package.json +5 -5
  2. package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +47 -10
  3. package/src/tooling/portable/adapters/node/bootstrapCarrier.manufacture.js +18 -0
  4. package/src/tooling/portable/adapters/node/workspaceCarrier.manufacture.js +13 -3
  5. package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.md +2 -2
  6. package/src/tooling/portable/handoff/bootstrapCarrier.manufacture.js +56 -0
  7. package/src/tooling/portable/handoff/contracts/tiinex.handoff.package.v1.schema.md +340 -77
  8. package/src/tooling/portable/handoff/manufacture.js +3 -1
  9. package/src/tooling/portable/handoff/recipientV2.artifactFirst.build.js +73 -32
  10. package/src/tooling/portable/handoff/recipientV2.artifactFirst.closure.js +1 -1
  11. package/src/tooling/portable/handoff/recipientV2.artifactFirst.inspect.js +9 -1
  12. package/src/tooling/portable/handoff/recipientV2.artifactFirst.materials.js +28 -6
  13. package/src/tooling/portable/handoff/recipientV2.artifactFirst.shared.js +8 -0
  14. package/src/tooling/portable/handoff/recipientV2.coldProjection.js +11 -6
  15. package/src/tooling/portable/handoff/recipientV2.entryContract.js +12 -0
  16. package/src/tooling/portable/handoff/recipientV2.humanOutput.js +48 -6
  17. package/src/tooling/portable/handoff/recipientV2.packageV1.build.js +55 -43
  18. package/src/tooling/portable/handoff/recipientV2.packageV1.contract.js +57 -31
  19. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.helpers.js +63 -10
  20. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +55 -16
  21. package/src/tooling/portable/handoff/recipientV2.packageV1.workspaceProjection.js +14 -1
  22. package/src/tooling/portable/handoff/recipientV2.topology.js +3 -4
  23. package/src/tooling/portable/handoff/recipientV2.topology.materials.js +14 -0
  24. package/src/tooling/portable/handoff/workspaceCarrier.manufacture.js +42 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiinex/core",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Shared host-neutral Tiinex implementation core for artifacts, schemas, validation, lineage, grounding, Handoffs, provenance and deterministic workflows.",
5
5
  "type": "module",
6
6
  "sideEffects": true,
@@ -168,12 +168,12 @@
168
168
  "type": "git",
169
169
  "url": "git+https://github.com/Tiinex/core.git"
170
170
  },
171
- "gitHead": "7e705cbd611919cc46659f9bcee0cf363a09c41c",
171
+ "gitHead": "030669b6596196da946edb049d15af044bcd96c6",
172
172
  "tiinexRelease": {
173
173
  "policy": "tiinex.master-npm-release.v1",
174
- "sourceCommit": "7e705cbd611919cc46659f9bcee0cf363a09c41c",
175
- "sourceTree": "f6b7df8dfa2757bd05cd4d9f764cd0696cc23797",
174
+ "sourceCommit": "030669b6596196da946edb049d15af044bcd96c6",
175
+ "sourceTree": "090aaead28df51b2aeb6679018526f54260a1ca8",
176
176
  "repository": "Tiinex/core",
177
- "previousVersion": "0.12.0"
177
+ "previousVersion": "0.13.0"
178
178
  }
179
179
  }
@@ -2,6 +2,7 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { prepareNodeHandoffManufacturingInput } from '../node/handoff.manufacture.js';
4
4
  import { prepareNodeWorkspaceCarrierManufacturingInput } from '../node/workspaceCarrier.manufacture.js';
5
+ import { prepareNodeBootstrapCarrierManufacturingInput } from '../node/bootstrapCarrier.manufacture.js';
5
6
  import { projectHandoffHumanOutput } from '../../handoff/carrierProjection.js';
6
7
  import { writePortableRuntimePackageZip } from '../../output/node.zip.js';
7
8
  import { writeRecipientFacingV2PackageZip } from '../../output/recipientV2.zip.js';
@@ -16,8 +17,9 @@ export async function prepareHandoffManufactureCliCommand(parsed = {}, runtime =
16
17
  const flags = parsed.flags || {};
17
18
  const workspaceRoot = flags.workspace || parsed.positionals?.[0] || '.';
18
19
  const carrierMode = String(flags['carrier-mode'] || 'handoff').trim().toLowerCase();
19
- if (!['handoff', 'workspace'].includes(carrierMode)) throw new Error(`portable.cli.handoff-carrier.carrier-mode.invalid:${carrierMode}`);
20
+ if (!['handoff', 'workspace', 'bootstrap'].includes(carrierMode)) throw new Error(`portable.cli.handoff-carrier.carrier-mode.invalid:${carrierMode}`);
20
21
  if (carrierMode === 'workspace') return prepareWorkspaceCarrierCliCommand(flags, workspaceRoot, runtime);
22
+ if (carrierMode === 'bootstrap') return prepareBootstrapCarrierCliCommand(flags, runtime);
21
23
  const continuationState = parsed.surfaceCommand === 'handoff'
22
24
  ? await readGroundContinuationState(workspaceRoot)
23
25
  : {};
@@ -146,13 +148,15 @@ export async function prepareHandoffManufactureCliCommand(parsed = {}, runtime =
146
148
  }
147
149
 
148
150
  export async function materializeHandoffManufactureCliOutput(result = {}, flags = {}) {
149
- const workspaceMode = String(result.carrierProjection?.mode || '') === 'workspace';
150
- let humanOutput = workspaceMode ? projectWorkspaceCarrierHumanOutput(result, flags) : projectHandoffHumanOutput({
151
+ const carrierMode = String(result.carrierProjection?.mode || '');
152
+ const workspaceMode = carrierMode === 'workspace';
153
+ const bootstrapMode = carrierMode === 'bootstrap';
154
+ let humanOutput = workspaceMode ? projectWorkspaceCarrierHumanOutput(result, flags) : bootstrapMode ? projectBootstrapCarrierHumanOutput(result, flags) : projectHandoffHumanOutput({
151
155
  projection: result.carrierProjection || {},
152
156
  route: flags.route || '',
153
157
  collisionInstance: flags['collision-instance'] || 1
154
158
  });
155
- if (!workspaceMode && result.bundle?.transportFormat) humanOutput = projectRecipientV2HumanOutput(humanOutput, result.inspection || {});
159
+ if (result.bundle?.transportFormat) humanOutput = projectRecipientV2HumanOutput(humanOutput, result.inspection || {});
156
160
  const wantsWrite = Boolean(flags.output || flags['output-dir']);
157
161
  const blocked = result.status === 'blocked' || result.transportExecutable === false || Number(result.findingSummary?.counts?.error || 0) > 0;
158
162
  if (!wantsWrite || blocked) return summarizeHandoffManufactureCliOutput(result, {}, humanOutput, null);
@@ -163,7 +167,6 @@ export async function materializeHandoffManufactureCliOutput(result = {}, flags
163
167
  const writeReceipt = writeBundle?.transportFormat
164
168
  ? await writeRecipientFacingV2PackageZip(writeBundle, target, writeBundle === result.bundle ? { inspection: result.inspection } : {})
165
169
  : await writePortableRuntimePackageZip(writeBundle, target);
166
- if (workspaceMode && flags['transport-text']) throw new Error('portable.cli.workspace-carrier.transport-text.unavailable');
167
170
  const transportTextReceipt = flags['transport-text'] ? await writeTransportTextSidecar(humanOutput, target, flags['transport-text']) : null;
168
171
  return summarizeHandoffManufactureCliOutput(result, writeReceipt, humanOutput, transportTextReceipt);
169
172
  }
@@ -174,6 +177,7 @@ async function prepareWorkspaceCarrierCliCommand(flags = {}, workspaceRoot = '.'
174
177
  const expectedToolingBootstrap = await readOptionalJson(flags['tooling-bootstrap-manifest']);
175
178
  const workspaceDescriptorValue = await readOptionalJson(flags['workspace-roots'] || flags['workspace-descriptors']);
176
179
  const workspaceTargetValue = await readOptionalJson(flags['workspace-targets']);
180
+ const workspaceScopeValue = await readOptionalJson(flags['workspace-scopes']);
177
181
  const additionalWorkspaces = [...splitFlag(flags['additional-workspaces']), ...descriptorArray(workspaceDescriptorValue, 'workspaces')];
178
182
  const verifyRoundtrip = !flags['no-roundtrip'];
179
183
  const carrierProfile = selectCarrierProfile({ operator: operatorCarrierProfile, runtime: runtime.defaultCarrierProfile || null });
@@ -185,6 +189,8 @@ async function prepareWorkspaceCarrierCliCommand(flags = {}, workspaceRoot = '.'
185
189
  workspaceTitle: flags['workspace-title'] || flags.title || '',
186
190
  workspaceTargetPath: flags['workspace-target'] || flags['workspace-artifact'] || '',
187
191
  workspaceTargets: workspaceTargetValue,
192
+ workspaceScopes: descriptorArray(workspaceScopeValue, 'scopes').length ? descriptorArray(workspaceScopeValue, 'scopes') : workspaceScopeValue,
193
+ materialRepresentationWorkspaceIds: splitFlag(flags['material-representation-workspaces'] || flags['generic-material-workspaces']),
188
194
  toolingBootstrap: flags['tooling-bootstrap'] || 'embedded',
189
195
  expectedToolingBootstrap,
190
196
  maxFiles: flags['max-files'],
@@ -198,6 +204,37 @@ async function prepareWorkspaceCarrierCliCommand(flags = {}, workspaceRoot = '.'
198
204
  return { input, options: { verifyRoundtrip, packageInput: { builtAt: flags['built-at'] || undefined } } };
199
205
  }
200
206
 
207
+ async function prepareBootstrapCarrierCliCommand(flags = {}, runtime = {}) {
208
+ if (flags.handoff || flags.route || flags.routes || flags['handoff-routes'] || flags['workspace-routes'] || flags.workspace || flags['workspace-target'] || flags['workspace-targets'] || flags['workspace-roots'] || flags['workspace-descriptors']) throw new Error('portable.cli.bootstrap-carrier.source-material-or-route.forbidden');
209
+ const operatorCarrierProfile = await readOptionalJson(flags['carrier-profile']);
210
+ const expectedToolingBootstrap = await readOptionalJson(flags['tooling-bootstrap-manifest']);
211
+ const verifyRoundtrip = !flags['no-roundtrip'];
212
+ const carrierProfile = selectCarrierProfile({ operator: operatorCarrierProfile, runtime: runtime.defaultCarrierProfile || null });
213
+ const input = await prepareNodeBootstrapCarrierManufacturingInput({
214
+ toolingBootstrap: flags['tooling-bootstrap'] || 'embedded', expectedToolingBootstrap, bootstrapMaxFiles: flags['bootstrap-max-files'], verifyRoundtrip, createdAt: flags['built-at'] || undefined,
215
+ carrierLineage: Object.freeze({ ...initialHandoffCarrierLineage(), checkpointKind: 'progression', majorReason: '' }), carrierProfile
216
+ }, runtime);
217
+ return { input, options: { verifyRoundtrip, packageInput: { builtAt: flags['built-at'] || undefined } } };
218
+ }
219
+
220
+ function projectBootstrapCarrierHumanOutput(result = {}, flags = {}) {
221
+ const projection = result.carrierProjection || {};
222
+ const ready = result.status === 'ready' && projection.status === 'ready' && projection.mode === 'bootstrap' && (projection.routes || []).length === 0 && (projection.workspaces || []).length === 0;
223
+ const dimension = String(projection.lineage?.dimension || '001');
224
+ const projectedFilename = String(flags['projected-filename'] || flags.projectedFilename || '').trim();
225
+ const filename = projectedFilename || `tiinex-${dimension}.handoff-package.zip`;
226
+ if (filename !== filename.trim() || !filename.endsWith('.handoff-package.zip') || /[<>:"/\\|?*\x00-\x1f\x7f]/.test(filename) || /[. ]$/.test(filename) || /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(filename) || new TextEncoder().encode(filename).byteLength > 255) throw new Error('portable.cli.bootstrap-carrier.filename.invalid');
227
+ return Object.freeze({
228
+ schema: 'tiinex.portable.handoff-human-output.v1', status: ready ? 'ready' : 'blocked',
229
+ primary: ready ? Object.freeze({ kind: 'bootstrap-package', filename, dimension, parentDimension: String(projection.lineage?.parentDimension || ''), checkpointKind: String(projection.lineage?.checkpointKind || ''), routeId: '', workspaceId: '', workspaceRelativeHandoffPath: '', collisionInstance: 1, singleHumanTransportChoice: true }) : null,
230
+ normalInlineRouting: ready ? Object.freeze({ kind: 'transport-text', content: '', normalEmission: true, requiredForHumanCompletion: true, placement: 'adjacent-to-primary', authority: 'none' }) : null, sharedRouting: null,
231
+ presentation: Object.freeze({ kind: 'bootstrap-only-carrier', label: 'Bootstrap carrier', authority: 'none', recipientLabel: '' }),
232
+ normalEmissionBoundary: Object.freeze({ allowed: Object.freeze(['package-file', 'generic-start-transport-text']), forbidden: Object.freeze(['workspace-label', 'route-specific-continue-from', 'recipient-label', 'holder-label', 'current-work-label']) }),
233
+ fallbackTransportText: ready ? Object.freeze({ supported: true, filename: filename.replace(/\.handoff-package\.zip$/i, '.transport.txt'), content: '', normalEmission: false, requiredForHumanCompletion: false, authority: 'none' }) : null, selectedRoute: null, findings: Object.freeze([]),
234
+ boundary: 'Bootstrap-only carrier output projection. Generic Start transport text only; no Workspace, Handoff route, recipient, holder, Role, or work projection exists.'
235
+ });
236
+ }
237
+
201
238
  function projectWorkspaceCarrierHumanOutput(result = {}, flags = {}) {
202
239
  const projection = result.carrierProjection || {};
203
240
  const ready = result.status === 'ready' && projection.status === 'ready' && projection.mode === 'workspace' && (projection.routes || []).length === 0;
@@ -213,11 +250,11 @@ function projectWorkspaceCarrierHumanOutput(result = {}, flags = {}) {
213
250
  schema: 'tiinex.portable.handoff-human-output.v1',
214
251
  status: ready ? 'ready' : 'blocked',
215
252
  primary: ready ? Object.freeze({ kind: 'workspace-package', filename, dimension, parentDimension: String(projection.lineage?.parentDimension || ''), checkpointKind: String(projection.lineage?.checkpointKind || ''), routeId: '', workspaceId: '', workspaceRelativeHandoffPath: '', collisionInstance: 1, singleHumanTransportChoice: true }) : null,
216
- normalInlineRouting: null, sharedRouting: null,
217
- presentation: Object.freeze({ kind: 'pointerless-workspace-carrier', label: 'Workspace carrier', authority: 'none' }),
218
- normalEmissionBoundary: Object.freeze({ allowed: Object.freeze(['package-file']), forbidden: Object.freeze(['handoff-routing-text', 'continue-from-pointer']) }),
219
- fallbackTransportText: null, selectedRoute: null, findings: Object.freeze([]),
220
- boundary: 'Pointerless Workspace-carrier output projection only. No Handoff routing text exists because the package role declares no Handoff route.'
253
+ normalInlineRouting: ready ? Object.freeze({ kind: 'transport-text', content: '', normalEmission: true, requiredForHumanCompletion: true, placement: 'adjacent-to-primary', authority: 'none' }) : null, sharedRouting: null,
254
+ presentation: Object.freeze({ kind: 'pointerless-workspace-carrier', label: 'Workspace carrier', authority: 'none', recipientLabel: '' }),
255
+ normalEmissionBoundary: Object.freeze({ allowed: Object.freeze(['package-file', 'generic-start-transport-text']), forbidden: Object.freeze(['route-specific-continue-from', 'recipient-label-from-material']) }),
256
+ fallbackTransportText: ready ? Object.freeze({ supported: true, filename: filename.replace(/\.handoff-package\.zip$/i, '.transport.txt'), content: '', normalEmission: false, requiredForHumanCompletion: false, authority: 'none' }) : null, selectedRoute: null, findings: Object.freeze([]),
257
+ boundary: 'Pointerless Workspace-carrier output projection. Generic Start transport text is permitted; Handoff Continue-from and recipient projection remain absent.'
221
258
  });
222
259
  }
223
260
 
@@ -0,0 +1,18 @@
1
+ import { buildToolingBootstrapTransportFiles } from './handoff.manufacture.bootstrap.js';
2
+ import { normalizeHandoffCarrierLineage } from '../../handoff/carrierLineage.js';
3
+ import { normalizeHandoffCarrierProfile } from '../../handoff/carrierProfile.js';
4
+
5
+ export async function prepareNodeBootstrapCarrierManufacturingInput(input = {}, options = {}) {
6
+ const toolingBootstrap = await buildToolingBootstrapTransportFiles({
7
+ delivery: input.toolingBootstrap || input.bootstrapDelivery || 'embedded',
8
+ runtimeRoot: input.runtimeRoot || options.runtimeRoot,
9
+ expected: input.expectedToolingBootstrap || null,
10
+ maxFiles: input.bootstrapMaxFiles || options.bootstrapMaxFiles
11
+ });
12
+ return Object.freeze({
13
+ carrierMode: 'bootstrap', createdAt: String(input.createdAt || ''), workspaceMaterializations: Object.freeze([]), workspaceTargets: Object.freeze([]),
14
+ additionalTransportFiles: toolingBootstrap.files,
15
+ carrierLineage: normalizeHandoffCarrierLineage(input.carrierLineage || null), carrierProfile: normalizeHandoffCarrierProfile(input.carrierProfile || null),
16
+ toolingBootstrap: toolingBootstrap.summary, manufacturingEvidence: Object.freeze({ toolingBootstrap: toolingBootstrap.summary }), verifyRoundtrip: input.verifyRoundtrip !== false
17
+ });
18
+ }
@@ -3,7 +3,7 @@ import { enumerateNodeWorkspace } from './handoff.manufacture.enumeration.js';
3
3
  import { buildToolingBootstrapTransportFiles } from './handoff.manufacture.bootstrap.js';
4
4
  import { qualifyToolingRuntimeSourceAlignment } from './handoff.manufacture.runtimeSource.js';
5
5
  import { inferWorkspaceTitle, normalizeAdditionalWorkspaceDescriptors, safeWorkspaceToken } from './handoff.manufacture.multiRoot.js';
6
- import { normalizeWorkspaceTargetBindings } from './handoff.manufacture.scope.js';
6
+ import { normalizeWorkspaceScopes, normalizeWorkspaceTargetBindings, projectBoundedWorkspaceMaterialization } from './handoff.manufacture.scope.js';
7
7
  import { normalizeHandoffCarrierLineage } from '../../handoff/carrierLineage.js';
8
8
  import { normalizeHandoffCarrierProfile } from '../../handoff/carrierProfile.js';
9
9
 
@@ -43,6 +43,15 @@ export async function prepareNodeWorkspaceCarrierManufacturingInput(input = {},
43
43
  explicitBindings: input.workspaceTargets || input.workspaceTargetBindings || [],
44
44
  additionalWorkspaceDescriptors
45
45
  });
46
+ const workspaceScopes = normalizeWorkspaceScopes(input.workspaceScopes || input.workspaceScopeBindings || []);
47
+ const materializations = enumerations.map((item) => {
48
+ const materialization = item.materialization;
49
+ const scope = workspaceScopes.get(String(materialization.id || '')) || null;
50
+ if (!scope || scope.coverage !== 'bounded') return materialization;
51
+ const targets = workspaceTargets.filter((target) => String(target.workspaceId || '') === String(materialization.id || ''));
52
+ if (targets.length !== 1) throw new Error(`portable.workspace-carrier.workspace-scope.target-${targets.length ? 'ambiguous' : 'required'}:${materialization.id}`);
53
+ return projectBoundedWorkspaceMaterialization(materialization, scope, targets[0].path);
54
+ });
46
55
  const toolingBootstrap = await buildToolingBootstrapTransportFiles({
47
56
  delivery: input.toolingBootstrap || input.bootstrapDelivery || 'embedded',
48
57
  runtimeRoot: input.runtimeRoot || options.runtimeRoot,
@@ -51,13 +60,14 @@ export async function prepareNodeWorkspaceCarrierManufacturingInput(input = {},
51
60
  });
52
61
  const runtimeSourceAlignment = await qualifyToolingRuntimeSourceAlignment({
53
62
  runtimeIdentity: toolingBootstrap.runtimeIdentity,
54
- localWorkspaces: enumerations.map((item) => Object.freeze({ id: item.materialization.id, root: item.root, materialization: item.materialization })),
63
+ localWorkspaces: enumerations.map((item, index) => Object.freeze({ id: materializations[index].id, root: item.root, materialization: item.materialization })),
55
64
  maxFiles: input.bootstrapMaxFiles || options.bootstrapMaxFiles
56
65
  });
57
66
  return Object.freeze({
58
67
  carrierMode: 'workspace',
59
68
  createdAt: String(input.createdAt || ''),
60
- workspaceMaterializations: Object.freeze(enumerations.map((item) => item.materialization)),
69
+ workspaceMaterializations: Object.freeze(materializations),
70
+ materialRepresentationWorkspaceIds: Object.freeze([...(input.materialRepresentationWorkspaceIds || input.genericMaterialWorkspaceIds || [])].map(String)),
61
71
  workspaceTargets,
62
72
  additionalTransportFiles: toolingBootstrap.files,
63
73
  carrierLineage: normalizeHandoffCarrierLineage(input.carrierLineage || null),
@@ -18,9 +18,9 @@ The same workflow must survive different host arrangements:
18
18
 
19
19
  When this bootstrap or the portable repository is available as a project source, normalize only the explicitly uploaded Markdown, archive, and project-source material, then start with `discover-tooling` or `prepare-task`.
20
20
 
21
- ### Qualified routed Handoff package
21
+ ### Qualified Tiinex package
22
22
 
23
- When a received carrier exposes the qualified recipient-facing Tiinex Handoff package surface, start at `001-1-READ-BEFORE-PROCEEDING.trace.md`. Before Tiinex Tooling is available, the host may perform only the bounded bootstrap exception: read the declared bootstrap node, extract `001-2-bootstrap.zip` into a writable runtime location, and make its Tooling entrypoint callable. Prefer a location that survives turns in the current runtime, but never treat that location as project or artifact authority. Do not manually unpack Workspace/cache payloads or perform broad ZIP/filesystem/repository archaeology. The Tooling entrypoint is exactly `runtime/tools/tiinex-portable.mjs` relative to the chosen extraction root; do not search/list the extracted runtime to discover it. Give the untouched original Handoff-package carrier to that entrypoint and use `orient-handoff-package` as the first semantic operation. Keep the outer Continue-from path opaque to native access. After orientation, use `ground <same-package.zip> --route <same-Continue-from>` as the one shared human/LLM decision-grounding path. Its bounded default receipt composes the selected Handoff authority, exact qualified Required Context identities, the selected-route declared-Parent leaf, a compact declared-Parent continuity-to-qualified-root proof, declared current-work frontier, blockers, and explicit unresolved evidence. Continue substantive bounded work only when `readiness.state` is `grounded-to-act`; `grounded-to-discuss` and `insufficient-grounding` must not be upgraded by generic inference. An apparent loaded root that still declares an unavailable Parent is not cold-start closure: follow `readiness.nextAction.recovery` exactly. If a bound exact repository-read host capability is available, use the projected `plan-host-action` request, normalize the host result through `accept-host-receipt`, then resume the same `ground` command with `--recovery <accepted-host-receipt.json>`; otherwise request exactly the named material from the Transport Operator. When an accepted pinned repository Parent declares a deterministic relative Parent, Tooling may derive only that exact sibling path from the accepted repository/commit/base-path context. For repeated recovery, call `accept-host-receipt --prior <previous-accepted.json>` so the newest accepted result explicitly carries all prior accepted recovery material; pass only that newest cumulative result back to the same `ground --recovery` seam. Never broaden search or treat fetched material as verified before lineage identity/integrity qualification. Re-run the same `ground` command with `--include-required-context <requirement-id,name|all>` only when exact qualified Required Context body text is needed. No external qualification schema, Tooling source inspection, `--help`/operation discovery, context-audit detour, or separate `ground-cold-consumer` call is required before this decision grounding. Native host tools remain valid execution mechanics after Tiinex takeover on already-resolved ordinary source, and explicit degraded fallback only when qualification explains why it was required.
23
+ When a received carrier exposes the qualified recipient-facing Tiinex package surface, start at its declared Start artifact (normally `001-1-READ-BEFORE-PROCEEDING.trace.md`). Before Tiinex Tooling is available, the host may perform only the bounded bootstrap exception: read the declared bootstrap node, extract `001-2-bootstrap.zip` into a writable runtime location, and make its Tooling entrypoint callable. Prefer a location that survives turns in the current runtime, but never treat that location as project or artifact authority. Do not manually unpack Workspace/cache payloads or perform broad ZIP/filesystem/repository archaeology. The Tooling entrypoint is exactly `runtime/tools/tiinex-portable.mjs` relative to the chosen extraction root; do not search/list the extracted runtime to discover it. Give the untouched original package carrier to that entrypoint and use `orient-handoff-package` as the first semantic operation. Package role is qualified from the carried package contract rather than inferred from filenames, Workspace/Role presence, or transport labels. A bootstrap-only or pointerless Workspace carrier has no Handoff route and must not be upgraded into recipient, holder, participation, delegation, current-work, or grounded-to-act authority; use the qualified route-less orientation/material projection only. For a routed Handoff carrier, keep the outer Continue-from path opaque to native access and, after orientation, use `ground <same-package.zip> --route <same-Continue-from>` as the one shared human/LLM decision-grounding path. Its bounded default receipt composes the selected Handoff authority, exact qualified Required Context identities, the selected-route declared-Parent leaf, a compact declared-Parent continuity-to-qualified-root proof, declared current-work frontier, blockers, and explicit unresolved evidence. Continue substantive bounded work only when `readiness.state` is `grounded-to-act`; `grounded-to-discuss` and `insufficient-grounding` must not be upgraded by generic inference. An apparent loaded root that still declares an unavailable Parent is not cold-start closure: follow `readiness.nextAction.recovery` exactly. If a bound exact repository-read host capability is available, use the projected `plan-host-action` request, normalize the host result through `accept-host-receipt`, then resume the same `ground` command with `--recovery <accepted-host-receipt.json>`; otherwise request exactly the named material from the Transport Operator. When an accepted pinned repository Parent declares a deterministic relative Parent, Tooling may derive only that exact sibling path from the accepted repository/commit/base-path context. For repeated recovery, call `accept-host-receipt --prior <previous-accepted.json>` so the newest accepted result explicitly carries all prior accepted recovery material; pass only that newest cumulative result back to the same `ground --recovery` seam. Never broaden search or treat fetched material as verified before lineage identity/integrity qualification. Re-run the same `ground` command with `--include-required-context <requirement-id,name|all>` only when exact qualified Required Context body text is needed. No external qualification schema, Tooling source inspection, `--help`/operation discovery, context-audit detour, or separate `ground-cold-consumer` call is required before this decision grounding. Native host tools remain valid execution mechanics after Tiinex takeover on already-resolved ordinary source, and explicit degraded fallback only when qualification explains why it was required.
24
24
 
25
25
  ### Bootstrap travels inside an archive
26
26
 
@@ -0,0 +1,56 @@
1
+ import { finalizeFile } from '../../../export/package.fileMap.js';
2
+ import { summarizePortableFindings } from '../findings.js';
3
+ import { inspectPortableToolingBootstrap } from './toolingBootstrap.js';
4
+ import { renderRecipientV2Pointer } from './recipientV2.artifacts.js';
5
+ import { RECIPIENT_V2_READ_PATH, RECIPIENT_V2_FORMAT_ID } from './recipientV2.topology.js';
6
+ import { recipientV2BootstrapEntryCurrentRead } from './recipientV2.entryContract.js';
7
+ import { recipientV2TransportFacts } from './recipientV2.transportManifest.js';
8
+ import { buildRecipientV2BootstrapCarrier, recipientV2ParentAuthority } from './recipientV2.topology.workspaces.js';
9
+ import { RECIPIENT_V2_PACKAGE_V1_ROOT_PATH, RECIPIENT_V2_PACKAGE_V1_SCHEMA_ID, RECIPIENT_V2_PACKAGE_V1_SCHEMA_TARGET } from './recipientV2.packageV1.constants.js';
10
+ import { BOOTSTRAP_PACKAGE_ROLE, renderHandoffPackageV1 } from './recipientV2.packageV1.contract.js';
11
+ import { deepFreeze } from './recipientV2.packageV1.shared.js';
12
+ import { inspectRecipientFacingV2Topology, roundTripRecipientFacingV2Topology } from './recipientV2.inspect.js';
13
+
14
+ export function manufactureRecipientRelativeBootstrapPackage(input = {}) {
15
+ const findings = [];
16
+ const createdAt = String(input.createdAt || '1970-01-01 00:00:00');
17
+ const bootstrapSource = (input.additionalTransportFiles || []).filter((file) => String(file.path || '').startsWith('tiinex.bootstrap/'));
18
+ const sourceInspection = inspectPortableToolingBootstrap({ files: bootstrapSource });
19
+ if (sourceInspection.status !== 'valid') findings.push(...(sourceInspection.findings || []));
20
+ if (!bootstrapSource.length) findings.push(Object.freeze({ severity: 'error', code: 'portable.bootstrap-carrier.bootstrap-missing', message: 'Bootstrap-only carrier requires one qualified portable Tooling bootstrap source.' }));
21
+ const packageFile = finalizeFile({
22
+ path: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH,
23
+ kind: 'tiinex-handoff-package-artifact', logicalKind: 'recipient-v2-package-v1-root', mediaType: 'text/markdown',
24
+ content: renderHandoffPackageV1({ createdAt, packageRole: BOOTSTRAP_PACKAGE_ROLE, workspaces: [], materialRepresentations: [], carrierLineage: input.carrierLineage || {}, carrierProfile: input.carrierProfile || null, startPath: RECIPIENT_V2_READ_PATH, bootstrapPath: '001-2-bootstrap.trace.md' })
25
+ });
26
+ const packageParent = recipientV2ParentAuthority(packageFile, RECIPIENT_V2_PACKAGE_V1_SCHEMA_ID, RECIPIENT_V2_PACKAGE_V1_SCHEMA_TARGET, createdAt);
27
+ const files = [packageFile];
28
+ const bootstrap = bootstrapSource.length ? buildRecipientV2BootstrapCarrier(bootstrapSource, createdAt, findings, packageParent) : null;
29
+ if (bootstrap) files.push(bootstrap.artifact, bootstrap.payload);
30
+ const readFacts = recipientV2TransportFacts('recovery-orientation', {
31
+ format: 'tiinex-recipient-facing-handoff-package-v1', packageRole: BOOTSTRAP_PACKAGE_ROLE,
32
+ packageRootPath: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH, entryArtifactPath: RECIPIENT_V2_READ_PATH,
33
+ artifactSurface: 'tiinex.handoff.package.v1-plus-qualified-bootstrap-only', routeAuthority: 'none', routeSelectionAuthority: 'none', siblingRouteInference: false,
34
+ carrierLineage: input.carrierLineage || null, pathParentProjection: true, pathAuthority: false
35
+ });
36
+ const readFile = finalizeFile({
37
+ path: RECIPIENT_V2_READ_PATH, kind: 'handoff-recovery-pointer', logicalKind: 'recipient-v2-package-v1-bootstrap-recovery-orientation', mediaType: 'text/markdown', transportFacts: readFacts,
38
+ content: renderRecipientV2Pointer({ createdAt, parent: packageParent, role: 'recovery-orientation', title: 'READ BEFORE PROCEEDING — Tiinex Bootstrap Carrier', summary: 'Qualified recovery/orientation Pointer for a bootstrap-only package-v1 carrier.', prose: 'Read this Start artifact first and qualify the declared Tooling bootstrap. This carrier intentionally contains no project/source Workspace material and no Handoff route. Do not infer recipient, holder, Role, current-work, participation, delegation, or grounded-to-act authority from transport.', currentRead: [...recipientV2BootstrapEntryCurrentRead(), { label: 'Package Artifact', value: `[Bootstrap Package](${RECIPIENT_V2_PACKAGE_V1_ROOT_PATH})` }, { label: 'Carrier Dimension', value: `\`${String(input.carrierLineage?.dimension || '001')}\`` }], destinations: [{ label: 'Bootstrap Package contract', target: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH }, ...(bootstrap ? [{ label: 'Portable Tooling bootstrap', target: bootstrap.projection.artifactPath }] : [])], facts: readFacts })
39
+ });
40
+ files.push(readFile);
41
+ const sortedFiles = Object.freeze([...files].sort((a, b) => String(a.path || '').localeCompare(String(b.path || ''))));
42
+ const bundle = deepFreeze({ status: 'ready', files: sortedFiles, handoffClosure: null, transportFormat: RECIPIENT_V2_FORMAT_ID, boundary: 'Bootstrap-only recipient carrier. Start/bootstrap qualification creates no Workspace, Role, Handoff, recipient, holder, work, or action authority.' });
43
+ const inspection = inspectRecipientFacingV2Topology(bundle);
44
+ const roundtrip = input.verifyRoundtrip === false ? null : roundTripRecipientFacingV2Topology(bundle, inspection);
45
+ const toolingBootstrapInspection = inspection.bootstrapInspection || sourceInspection;
46
+ const allFindings = [...findings, ...(inspection.findings || []), ...(roundtrip?.findings || [])];
47
+ const ready = inspection.status === 'valid' && inspection.carrierProjection?.mode === 'bootstrap' && inspection.carrierProjection?.status === 'ready' && (!roundtrip || roundtrip.status === 'passed') && toolingBootstrapInspection.status === 'valid' && !allFindings.some((item) => item.severity === 'error');
48
+ return deepFreeze({
49
+ schema: 'tiinex.portable.handoff-manufacturing.v2', status: ready ? 'ready' : 'blocked', executable: ready, transportExecutable: ready,
50
+ verification: Object.freeze({ baselineManufacture: 'ready', manufacturePath: 'qualified-bootstrap-to-zero-material-package-v1', packageInspection: inspection.status, closureInspection: 'not-applicable', carrierInspection: inspection.status, selectedHandoffConformance: 'not-applicable', pointerEntrypointInspection: 'not-applicable', coldConsumerEntrypointInspection: inspection.status, companionInspection: 'not-applicable', roundtrip: roundtrip?.status || 'not-requested', toolingBootstrap: toolingBootstrapInspection.status }),
51
+ plan: Object.freeze({ status: ready ? 'ready' : 'blocked', requiredClosureReady: true, semanticHandoffStatus: 'not-declared', workspaceMaterializations: Object.freeze([]), requirements: Object.freeze({ required: Object.freeze([]), reference: Object.freeze([]) }) }),
52
+ bundle, inspection, carrierProjection: inspection.carrierProjection, roundtrip, toolingBootstrapInspection, toolingBootstrap: input.toolingBootstrap || null, carrierLineage: input.carrierLineage || inspection.carrierProjection?.lineage || null, manufacturingEvidence: input.manufacturingEvidence || null,
53
+ findings: Object.freeze(allFindings), findingSummary: summarizePortableFindings(allFindings), operationBoundary: Object.freeze({ sourceMutation: false, remoteWrite: false, handoffSemantics: false, recipientAuthority: false, holderAuthority: false, workAuthority: false }),
54
+ boundary: 'Canonical bootstrap-only carrier manufacture. Qualified Start/bootstrap mechanics only; no project/source material or Handoff/Role/recipient/holder/work authority is created.'
55
+ });
56
+ }