@calliopelabs/cli 3.5.4 → 3.7.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.
- package/README.md +8 -0
- package/dist/acp/controls.d.ts +10 -0
- package/dist/acp/controls.d.ts.map +1 -0
- package/dist/acp/controls.js +81 -0
- package/dist/acp/controls.js.map +1 -0
- package/dist/acp.d.ts +21 -7
- package/dist/acp.d.ts.map +1 -1
- package/dist/acp.js +139 -23
- package/dist/acp.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +28 -8
- package/dist/bin.js.map +1 -1
- package/dist/build-identity.d.ts +27 -0
- package/dist/build-identity.d.ts.map +1 -0
- package/dist/build-identity.js +32 -0
- package/dist/build-identity.js.map +1 -0
- package/dist/build-metadata.json +1 -0
- package/dist/execution/authority.d.ts +4 -1
- package/dist/execution/authority.d.ts.map +1 -1
- package/dist/execution/authority.js +23 -7
- package/dist/execution/authority.js.map +1 -1
- package/dist/execution/child-grants.d.ts +2 -0
- package/dist/execution/child-grants.d.ts.map +1 -1
- package/dist/execution/child-grants.js +19 -4
- package/dist/execution/child-grants.js.map +1 -1
- package/dist/execution/delegated.d.ts +14 -0
- package/dist/execution/delegated.d.ts.map +1 -0
- package/dist/execution/delegated.js +66 -0
- package/dist/execution/delegated.js.map +1 -0
- package/dist/execution/files.js +6 -6
- package/dist/execution/files.js.map +1 -1
- package/dist/execution/guard.d.ts +5 -0
- package/dist/execution/guard.d.ts.map +1 -1
- package/dist/execution/guard.js +31 -16
- package/dist/execution/guard.js.map +1 -1
- package/dist/execution/index.d.ts +4 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +4 -0
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/ledger-cli.d.ts +2 -1
- package/dist/execution/ledger-cli.d.ts.map +1 -1
- package/dist/execution/ledger-cli.js +51 -14
- package/dist/execution/ledger-cli.js.map +1 -1
- package/dist/execution/ledger-protocol.d.ts +6 -2
- package/dist/execution/ledger-protocol.d.ts.map +1 -1
- package/dist/execution/ledger-protocol.js +110 -24
- package/dist/execution/ledger-protocol.js.map +1 -1
- package/dist/execution/ledger-server.d.ts +13 -0
- package/dist/execution/ledger-server.d.ts.map +1 -1
- package/dist/execution/ledger-server.js +57 -13
- package/dist/execution/ledger-server.js.map +1 -1
- package/dist/execution/ledger-tunnel.d.ts +50 -0
- package/dist/execution/ledger-tunnel.d.ts.map +1 -0
- package/dist/execution/ledger-tunnel.js +307 -0
- package/dist/execution/ledger-tunnel.js.map +1 -0
- package/dist/execution/ledger.d.ts +4 -0
- package/dist/execution/ledger.d.ts.map +1 -1
- package/dist/execution/ledger.js +30 -4
- package/dist/execution/ledger.js.map +1 -1
- package/dist/execution/parent-accounting.d.ts +41 -0
- package/dist/execution/parent-accounting.d.ts.map +1 -0
- package/dist/execution/parent-accounting.js +52 -0
- package/dist/execution/parent-accounting.js.map +1 -0
- package/dist/execution/parent-budget.d.ts +25 -0
- package/dist/execution/parent-budget.d.ts.map +1 -0
- package/dist/execution/parent-budget.js +102 -0
- package/dist/execution/parent-budget.js.map +1 -0
- package/dist/execution/project-spend.d.ts.map +1 -1
- package/dist/execution/project-spend.js +35 -5
- package/dist/execution/project-spend.js.map +1 -1
- package/dist/execution/remote-checkpoint.d.ts +15 -0
- package/dist/execution/remote-checkpoint.d.ts.map +1 -0
- package/dist/execution/remote-checkpoint.js +165 -0
- package/dist/execution/remote-checkpoint.js.map +1 -0
- package/dist/execution/remote-ledger.d.ts +12 -2
- package/dist/execution/remote-ledger.d.ts.map +1 -1
- package/dist/execution/remote-ledger.js +53 -21
- package/dist/execution/remote-ledger.js.map +1 -1
- package/dist/execution/types.d.ts +23 -5
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/execution/types.js.map +1 -1
- package/dist/goals/supervised.js +2 -2
- package/dist/goals/supervised.js.map +1 -1
- package/dist/headless.d.ts +2 -6
- package/dist/headless.d.ts.map +1 -1
- package/dist/headless.js +17 -21
- package/dist/headless.js.map +1 -1
- package/dist/improvement/actions.d.ts +3 -4
- package/dist/improvement/actions.d.ts.map +1 -1
- package/dist/improvement/actions.js +10 -7
- package/dist/improvement/actions.js.map +1 -1
- package/dist/improvement/capabilities.d.ts +54 -0
- package/dist/improvement/capabilities.d.ts.map +1 -0
- package/dist/improvement/capabilities.js +44 -0
- package/dist/improvement/capabilities.js.map +1 -0
- package/dist/improvement/cli.d.ts +1 -1
- package/dist/improvement/cli.d.ts.map +1 -1
- package/dist/improvement/cli.js +29 -3
- package/dist/improvement/cli.js.map +1 -1
- package/dist/improvement/host-capabilities.d.ts +119 -0
- package/dist/improvement/host-capabilities.d.ts.map +1 -0
- package/dist/improvement/host-capabilities.js +18 -0
- package/dist/improvement/host-capabilities.js.map +1 -0
- package/dist/improvement/index.d.ts +6 -0
- package/dist/improvement/index.d.ts.map +1 -1
- package/dist/improvement/index.js +6 -0
- package/dist/improvement/index.js.map +1 -1
- package/dist/improvement/proposal-hash.d.ts +3 -0
- package/dist/improvement/proposal-hash.d.ts.map +1 -0
- package/dist/improvement/proposal-hash.js +5 -0
- package/dist/improvement/proposal-hash.js.map +1 -0
- package/dist/improvement/review-contract.d.ts +32 -0
- package/dist/improvement/review-contract.d.ts.map +1 -0
- package/dist/improvement/review-contract.js +62 -0
- package/dist/improvement/review-contract.js.map +1 -0
- package/dist/improvement/review-requests.d.ts +72 -0
- package/dist/improvement/review-requests.d.ts.map +1 -0
- package/dist/improvement/review-requests.js +63 -0
- package/dist/improvement/review-requests.js.map +1 -0
- package/dist/improvement/source-changes.d.ts +78 -0
- package/dist/improvement/source-changes.d.ts.map +1 -0
- package/dist/improvement/source-changes.js +91 -0
- package/dist/improvement/source-changes.js.map +1 -0
- package/dist/improvement/task-outcomes.d.ts +82 -0
- package/dist/improvement/task-outcomes.d.ts.map +1 -0
- package/dist/improvement/task-outcomes.js +72 -0
- package/dist/improvement/task-outcomes.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/isolation/contracts.d.ts +13 -0
- package/dist/isolation/contracts.d.ts.map +1 -1
- package/dist/isolation/contracts.js +9 -1
- package/dist/isolation/contracts.js.map +1 -1
- package/dist/isolation/coordinator.d.ts.map +1 -1
- package/dist/isolation/coordinator.js +4 -0
- package/dist/isolation/coordinator.js.map +1 -1
- package/dist/isolation/process.d.ts.map +1 -1
- package/dist/isolation/process.js +3 -1
- package/dist/isolation/process.js.map +1 -1
- package/dist/isolation/worktree.d.ts +9 -1
- package/dist/isolation/worktree.d.ts.map +1 -1
- package/dist/isolation/worktree.js +8 -3
- package/dist/isolation/worktree.js.map +1 -1
- package/dist/memory.d.ts +5 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +8 -6
- package/dist/memory.js.map +1 -1
- package/dist/migration/assessment-contract.d.ts +60 -0
- package/dist/migration/assessment-contract.d.ts.map +1 -0
- package/dist/migration/assessment-contract.js +132 -0
- package/dist/migration/assessment-contract.js.map +1 -0
- package/dist/migration/assessment-schema.d.ts +19 -0
- package/dist/migration/assessment-schema.d.ts.map +1 -0
- package/dist/migration/assessment-schema.js +43 -0
- package/dist/migration/assessment-schema.js.map +1 -0
- package/dist/migration/assessment.d.ts +159 -0
- package/dist/migration/assessment.d.ts.map +1 -0
- package/dist/migration/assessment.js +219 -0
- package/dist/migration/assessment.js.map +1 -0
- package/dist/migration/cli.d.ts +6 -0
- package/dist/migration/cli.d.ts.map +1 -0
- package/dist/migration/cli.js +101 -0
- package/dist/migration/cli.js.map +1 -0
- package/dist/migration/evidence.d.ts +27 -0
- package/dist/migration/evidence.d.ts.map +1 -0
- package/dist/migration/evidence.js +124 -0
- package/dist/migration/evidence.js.map +1 -0
- package/dist/migration/example.d.ts +33 -0
- package/dist/migration/example.d.ts.map +1 -0
- package/dist/migration/example.js +28 -0
- package/dist/migration/example.js.map +1 -0
- package/dist/migration/index.d.ts +21 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +15 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/inventory.d.ts +70 -0
- package/dist/migration/inventory.d.ts.map +1 -0
- package/dist/migration/inventory.js +233 -0
- package/dist/migration/inventory.js.map +1 -0
- package/dist/migration/schema.d.ts +61 -0
- package/dist/migration/schema.d.ts.map +1 -0
- package/dist/migration/schema.js +76 -0
- package/dist/migration/schema.js.map +1 -0
- package/dist/migration/verification.d.ts +146 -0
- package/dist/migration/verification.d.ts.map +1 -0
- package/dist/migration/verification.js +260 -0
- package/dist/migration/verification.js.map +1 -0
- package/dist/orchestration/actions.d.ts +2 -0
- package/dist/orchestration/actions.d.ts.map +1 -1
- package/dist/orchestration/actions.js.map +1 -1
- package/dist/orchestration/artifact-host.d.ts +46 -0
- package/dist/orchestration/artifact-host.d.ts.map +1 -0
- package/dist/orchestration/artifact-host.js +64 -0
- package/dist/orchestration/artifact-host.js.map +1 -0
- package/dist/orchestration/coordinator-actions.d.ts +1 -1
- package/dist/orchestration/coordinator-actions.d.ts.map +1 -1
- package/dist/orchestration/coordinator-actions.js +5 -3
- package/dist/orchestration/coordinator-actions.js.map +1 -1
- package/dist/orchestration/coordinator-types.d.ts +23 -2
- package/dist/orchestration/coordinator-types.d.ts.map +1 -1
- package/dist/orchestration/coordinator.d.ts +5 -0
- package/dist/orchestration/coordinator.d.ts.map +1 -1
- package/dist/orchestration/coordinator.js +30 -13
- package/dist/orchestration/coordinator.js.map +1 -1
- package/dist/orchestration/execution-cli.d.ts +1 -1
- package/dist/orchestration/execution-cli.d.ts.map +1 -1
- package/dist/orchestration/execution-cli.js +29 -6
- package/dist/orchestration/execution-cli.js.map +1 -1
- package/dist/orchestration/execution-journal.d.ts.map +1 -1
- package/dist/orchestration/execution-journal.js +79 -6
- package/dist/orchestration/execution-journal.js.map +1 -1
- package/dist/orchestration/execution-store.d.ts +5 -1
- package/dist/orchestration/execution-store.d.ts.map +1 -1
- package/dist/orchestration/execution-store.js +66 -5
- package/dist/orchestration/execution-store.js.map +1 -1
- package/dist/orchestration/execution.d.ts.map +1 -1
- package/dist/orchestration/execution.js +37 -10
- package/dist/orchestration/execution.js.map +1 -1
- package/dist/orchestration/index.d.ts +6 -0
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +6 -0
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/interruption.d.ts +10 -0
- package/dist/orchestration/interruption.d.ts.map +1 -0
- package/dist/orchestration/interruption.js +38 -0
- package/dist/orchestration/interruption.js.map +1 -0
- package/dist/orchestration/question-contract.d.ts +19 -0
- package/dist/orchestration/question-contract.d.ts.map +1 -0
- package/dist/orchestration/question-contract.js +21 -0
- package/dist/orchestration/question-contract.js.map +1 -0
- package/dist/orchestration/questions.d.ts +9 -0
- package/dist/orchestration/questions.d.ts.map +1 -0
- package/dist/orchestration/questions.js +75 -0
- package/dist/orchestration/questions.js.map +1 -0
- package/dist/orchestration/reviewed-ledger.d.ts +23 -0
- package/dist/orchestration/reviewed-ledger.d.ts.map +1 -0
- package/dist/orchestration/reviewed-ledger.js +57 -0
- package/dist/orchestration/reviewed-ledger.js.map +1 -0
- package/dist/orchestration/routing.d.ts +3 -0
- package/dist/orchestration/routing.d.ts.map +1 -1
- package/dist/orchestration/routing.js +5 -1
- package/dist/orchestration/routing.js.map +1 -1
- package/dist/orchestration/source-candidates.d.ts +64 -0
- package/dist/orchestration/source-candidates.d.ts.map +1 -0
- package/dist/orchestration/source-candidates.js +95 -0
- package/dist/orchestration/source-candidates.js.map +1 -0
- package/dist/orchestration/validation.js +1 -1
- package/dist/orchestration/validation.js.map +1 -1
- package/dist/runlog.js +2 -2
- package/dist/runlog.js.map +1 -1
- package/dist/runtime/permissions.d.ts.map +1 -1
- package/dist/runtime/permissions.js +3 -2
- package/dist/runtime/permissions.js.map +1 -1
- package/dist/runtime/turn.d.ts +2 -0
- package/dist/runtime/turn.d.ts.map +1 -1
- package/dist/runtime/turn.js +21 -7
- package/dist/runtime/turn.js.map +1 -1
- package/dist/session-management/actions.js +1 -1
- package/dist/session-management/actions.js.map +1 -1
- package/dist/sessions/execution-binding.d.ts +8 -0
- package/dist/sessions/execution-binding.d.ts.map +1 -0
- package/dist/sessions/execution-binding.js +9 -0
- package/dist/sessions/execution-binding.js.map +1 -0
- package/dist/sessions/index.d.ts +1 -0
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +1 -0
- package/dist/sessions/index.js.map +1 -1
- package/dist/source-changes/writer.d.ts +77 -0
- package/dist/source-changes/writer.d.ts.map +1 -0
- package/dist/source-changes/writer.js +189 -0
- package/dist/source-changes/writer.js.map +1 -0
- package/dist/spawning/actions.d.ts +10 -1
- package/dist/spawning/actions.d.ts.map +1 -1
- package/dist/spawning/actions.js +26 -7
- package/dist/spawning/actions.js.map +1 -1
- package/dist/spawning/cli.js +1 -1
- package/dist/spawning/cli.js.map +1 -1
- package/dist/spawning/execution.d.ts.map +1 -1
- package/dist/spawning/execution.js +2 -0
- package/dist/spawning/execution.js.map +1 -1
- package/dist/spawning/types.d.ts +19 -6
- package/dist/spawning/types.d.ts.map +1 -1
- package/dist/spawning/validation.d.ts +16 -0
- package/dist/spawning/validation.d.ts.map +1 -1
- package/dist/spawning/validation.js +44 -8
- package/dist/spawning/validation.js.map +1 -1
- package/dist/storage.d.ts +5 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +10 -1
- package/dist/storage.js.map +1 -1
- package/dist/supervision/contracts.js +4 -1
- package/dist/supervision/contracts.js.map +1 -1
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +5 -0
- package/dist/tools.js.map +1 -1
- package/docs/README.md +66 -0
- package/docs/acp.md +228 -0
- package/docs/delegation-ledger.md +331 -0
- package/docs/improvement-cycles.md +304 -0
- package/docs/migration-assessment.md +113 -0
- package/docs/migration-example-plan.json +88 -0
- package/docs/migration-example-report.json +511 -0
- package/docs/migration-inventory.md +63 -0
- package/docs/migration-playbook.md +152 -0
- package/docs/migration-verification.md +177 -0
- package/docs/releases/3.6.0.md +43 -0
- package/docs/releases/3.7.0.md +53 -0
- package/package.json +11 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const ASSESSMENT_SCHEMAS: {
|
|
2
|
+
request: {
|
|
3
|
+
type: string;
|
|
4
|
+
properties: Record<string, unknown>;
|
|
5
|
+
required: string[];
|
|
6
|
+
additionalProperties: boolean;
|
|
7
|
+
$schema: string;
|
|
8
|
+
$id: string;
|
|
9
|
+
};
|
|
10
|
+
report: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: Record<string, unknown>;
|
|
13
|
+
required: string[];
|
|
14
|
+
additionalProperties: boolean;
|
|
15
|
+
$schema: string;
|
|
16
|
+
$id: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=assessment-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment-schema.d.ts","sourceRoot":"","sources":["../../src/migration/assessment-schema.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAqB9B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { INVENTORY_SCHEMA } from './schema.js';
|
|
2
|
+
const text = { type: 'string', minLength: 1, maxLength: 2048 };
|
|
3
|
+
const path = { type: 'string', minLength: 1, maxLength: 1024 };
|
|
4
|
+
const hash = { type: 'string', pattern: '^[a-f0-9]{64}$' };
|
|
5
|
+
const oid = { type: 'string', pattern: '^(?:[a-f0-9]{40}|[a-f0-9]{64})$' };
|
|
6
|
+
const list = (items, maxItems, minItems = 0) => ({ type: 'array', items, maxItems, minItems });
|
|
7
|
+
const object = (properties) => ({ type: 'object', properties, required: Object.keys(properties), additionalProperties: false });
|
|
8
|
+
const nullable = (schema) => ({ anyOf: [schema, { type: 'null' }] });
|
|
9
|
+
const integer = (minimum, maximum) => ({ type: 'integer', minimum, maximum });
|
|
10
|
+
const pin = object({ revision: oid, path, object: oid });
|
|
11
|
+
const source = object({ revision: oid, readPaths: { ...list(path, 64, 1), uniqueItems: true } });
|
|
12
|
+
const target = object({ adapter: { ...text, maxLength: 128 }, stack: text, runtime: object({ image: { ...text, maxLength: 128 }, node: { ...text, maxLength: 64 } }) });
|
|
13
|
+
const intent = object({ kind: { enum: ['port', 'redesign', 'incremental-upgrade'] }, motivation: text, compatibility: list(text, 16, 1), deployment: list(text, 16, 1), success: list(text, 16, 1) });
|
|
14
|
+
const budget = object({ currency: { const: 'USD' }, maxCostMicros: integer(0, 1000000000000000), maxDurationMs: integer(1, 2678400000), concurrency: integer(1, 32) });
|
|
15
|
+
const exclusion = object({ path, reason: text });
|
|
16
|
+
const measurement = object({ evidenceId: { ...text, maxLength: 256 }, reportDigest: hash, costMicros: integer(0, 1000000000000), workMs: integer(1, 1000000000), reviewMs: integer(0, 1000000000) });
|
|
17
|
+
const risk = { enum: ['low', 'medium', 'high'] };
|
|
18
|
+
const pilot = object({ source: path, planDigest: nullable(hash), reportDigest: nullable(hash), status: { enum: ['stale', 'invalid', 'passing-observations', 'not-passing'] }, measurementDigest: nullable(hash) });
|
|
19
|
+
const unitId = { type: 'string', pattern: '^unit-[a-f0-9]{24}$' };
|
|
20
|
+
const range = object({ low: integer(0, Number.MAX_SAFE_INTEGER), high: integer(0, Number.MAX_SAFE_INTEGER) });
|
|
21
|
+
export const ASSESSMENT_SCHEMAS = {
|
|
22
|
+
request: { $schema: 'https://json-schema.org/draft/2020-12/schema', $id: 'https://calliope.ai/schemas/migration/assessment-request-v1',
|
|
23
|
+
...object({ format: { const: 'calliope.migration.assessment-request/v1' }, source, target, intent, budget, rules: pin,
|
|
24
|
+
units: list(object({ source: path, target: path, dependencies: { ...list(path, 128), uniqueItems: true }, risk, rationale: text }), 128, 1), exclusions: list(exclusion, 128),
|
|
25
|
+
pilots: list(object({ source: path, plan: {}, report: {}, measurement: nullable(measurement) }), 16) }) },
|
|
26
|
+
report: { $schema: 'https://json-schema.org/draft/2020-12/schema', $id: 'https://calliope.ai/schemas/migration/assessment-v1',
|
|
27
|
+
...object({ format: { const: 'calliope.migration.assessment/v1' }, requestDigest: hash, inventoryDigest: hash,
|
|
28
|
+
implementation: nullable(object({ kitSha256: hash, verifierSha256: hash })),
|
|
29
|
+
kit: object({ inventory: { const: 'inventory-v1' }, assessment: { const: 'assessment-v1' }, verifier: { const: 'byte-parity-v1' } }), rules: pin, source, target,
|
|
30
|
+
recommendation: { enum: ['go', 'investigate', 'do-not-migrate'] }, recommendationScope: text,
|
|
31
|
+
findings: list(object({ code: text, source: nullable(path), severity: { enum: ['investigate', 'do-not-migrate'] } }), 20000),
|
|
32
|
+
review: object({ digest: hash, result: nullable(object({ decision: { enum: ['accepted', 'rejected'] }, receipt: { type: 'string', pattern: '^[a-zA-Z0-9_.:-]{1,256}$' } })) }),
|
|
33
|
+
estimate: object({ status: { enum: ['insufficient-reviewed-evidence', 'measured-pilot-range'] }, units: integer(1, 128), observedPilots: integer(0, 16), costMicros: nullable(range), durationMs: nullable(range) }),
|
|
34
|
+
estimateAssumptions: list(text, 16), inventory: INVENTORY_SCHEMA,
|
|
35
|
+
rulebook: object({ format: { const: 'calliope.migration.rulebook/v1' }, intent, sourceRules: pin, exclusions: list(exclusion, 128), preserve: { ...INVENTORY_SCHEMA.properties.files, minItems: 0 }, requirements: list(text, 16) }),
|
|
36
|
+
manifest: object({ format: { const: 'calliope.migration.work-manifest/v1' },
|
|
37
|
+
pilotGroups: list(object({ risk, units: integer(1, 128), passingPilots: list(unitId, 16) }), 3),
|
|
38
|
+
units: list(object({ id: unitId, source: object({ revision: oid, path, object: nullable(oid) }), target: path, dependencies: list(unitId, 128), risk, rationale: text, bindingDigest: hash, state: { const: 'planned' }, pilot: nullable(pilot) }), 128, 1),
|
|
39
|
+
graph: object({ kind: { const: 'declared-unit-dependencies' }, order: nullable(list(unitId, 128)), cycles: list(list(unitId, 128), 128) }),
|
|
40
|
+
evidenceStorage: object({ root: path, files: list(path, 16), unitFiles: list(path, 16), written: { const: false } }) }),
|
|
41
|
+
limitations: list(text, 16), execution: { const: 'none' }, digest: hash }) },
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=assessment-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment-schema.js","sourceRoot":"","sources":["../../src/migration/assessment-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/D,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/D,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC3D,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAC3E,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,QAAgB,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChH,MAAM,MAAM,GAAG,CAAC,UAAmC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;AACzJ,MAAM,QAAQ,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC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C;gBAC1I,eAAe,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;YACzH,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;CACjF,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { type SourcePin } from './verification.js';
|
|
2
|
+
import { type AssessmentRequest } from './assessment-contract.js';
|
|
3
|
+
type Finding = {
|
|
4
|
+
code: string;
|
|
5
|
+
source: string | null;
|
|
6
|
+
severity: 'investigate' | 'do-not-migrate';
|
|
7
|
+
};
|
|
8
|
+
export type AssessmentImplementation = {
|
|
9
|
+
kitSha256: string;
|
|
10
|
+
verifierSha256: string;
|
|
11
|
+
};
|
|
12
|
+
export type AssessmentReviewRequest = {
|
|
13
|
+
digest: string;
|
|
14
|
+
repository: string;
|
|
15
|
+
implementation: AssessmentImplementation | null;
|
|
16
|
+
requestDigest: string;
|
|
17
|
+
inventoryDigest: string;
|
|
18
|
+
request: AssessmentRequest;
|
|
19
|
+
findings: Finding[];
|
|
20
|
+
};
|
|
21
|
+
export type AssessmentReview = {
|
|
22
|
+
decision: 'accepted' | 'rejected';
|
|
23
|
+
receipt: string;
|
|
24
|
+
};
|
|
25
|
+
export type AssessmentOptions = {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
/** Trusted host's installed kit artifact and verifier implementation hashes, not claims copied from request JSON. */
|
|
28
|
+
implementation?: AssessmentImplementation;
|
|
29
|
+
/** Trusted host verifies provenance, scope/criteria coverage, risk classification and measured pilot accounting.
|
|
30
|
+
* Never construct this capability from request JSON. Acceptance does not authorize execution. */
|
|
31
|
+
review?: (input: AssessmentReviewRequest) => Promise<AssessmentReview>;
|
|
32
|
+
};
|
|
33
|
+
export declare function assessMigration(repository: string, input: unknown, options?: AssessmentOptions): Promise<{
|
|
34
|
+
requestDigest: string;
|
|
35
|
+
inventoryDigest: string;
|
|
36
|
+
kit: {
|
|
37
|
+
inventory: string;
|
|
38
|
+
assessment: string;
|
|
39
|
+
verifier: string;
|
|
40
|
+
};
|
|
41
|
+
implementation: AssessmentImplementation | null;
|
|
42
|
+
rules: SourcePin;
|
|
43
|
+
source: {
|
|
44
|
+
revision: string;
|
|
45
|
+
readPaths: string[];
|
|
46
|
+
};
|
|
47
|
+
target: {
|
|
48
|
+
adapter: string;
|
|
49
|
+
stack: string;
|
|
50
|
+
runtime: {
|
|
51
|
+
image: string;
|
|
52
|
+
node: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
format: string;
|
|
56
|
+
recommendation: string;
|
|
57
|
+
recommendationScope: string;
|
|
58
|
+
findings: Finding[];
|
|
59
|
+
review: {
|
|
60
|
+
digest: string;
|
|
61
|
+
result: AssessmentReview | null;
|
|
62
|
+
};
|
|
63
|
+
estimate: {
|
|
64
|
+
status: string;
|
|
65
|
+
units: number;
|
|
66
|
+
observedPilots: number;
|
|
67
|
+
costMicros: {
|
|
68
|
+
low: number;
|
|
69
|
+
high: number;
|
|
70
|
+
} | null;
|
|
71
|
+
durationMs: {
|
|
72
|
+
low: number;
|
|
73
|
+
high: number;
|
|
74
|
+
} | null;
|
|
75
|
+
};
|
|
76
|
+
estimateAssumptions: string[];
|
|
77
|
+
inventory: {
|
|
78
|
+
format: string;
|
|
79
|
+
kit: string;
|
|
80
|
+
source: {
|
|
81
|
+
commit: string;
|
|
82
|
+
tree: string;
|
|
83
|
+
mode: string;
|
|
84
|
+
readPaths: string[];
|
|
85
|
+
};
|
|
86
|
+
files: import("./inventory.js").SourceFile[];
|
|
87
|
+
packages: import("./inventory.js").Package[];
|
|
88
|
+
graph: {
|
|
89
|
+
order: string[] | null;
|
|
90
|
+
cycles: string[][];
|
|
91
|
+
kind: string;
|
|
92
|
+
};
|
|
93
|
+
findings: import("./inventory.js").Finding[];
|
|
94
|
+
limitations: string[];
|
|
95
|
+
digest: string;
|
|
96
|
+
};
|
|
97
|
+
rulebook: {
|
|
98
|
+
format: string;
|
|
99
|
+
intent: {
|
|
100
|
+
kind: 'port' | 'redesign' | 'incremental-upgrade';
|
|
101
|
+
motivation: string;
|
|
102
|
+
compatibility: string[];
|
|
103
|
+
deployment: string[];
|
|
104
|
+
success: string[];
|
|
105
|
+
};
|
|
106
|
+
sourceRules: SourcePin;
|
|
107
|
+
exclusions: {
|
|
108
|
+
path: string;
|
|
109
|
+
reason: string;
|
|
110
|
+
}[];
|
|
111
|
+
preserve: import("./inventory.js").SourceFile[];
|
|
112
|
+
requirements: string[];
|
|
113
|
+
};
|
|
114
|
+
manifest: {
|
|
115
|
+
format: string;
|
|
116
|
+
units: {
|
|
117
|
+
id: string;
|
|
118
|
+
source: {
|
|
119
|
+
revision: string;
|
|
120
|
+
path: string;
|
|
121
|
+
object: string | null;
|
|
122
|
+
};
|
|
123
|
+
target: string;
|
|
124
|
+
dependencies: string[];
|
|
125
|
+
risk: "high" | "low" | "medium";
|
|
126
|
+
rationale: string;
|
|
127
|
+
bindingDigest: string;
|
|
128
|
+
state: string;
|
|
129
|
+
pilot: {
|
|
130
|
+
source: string;
|
|
131
|
+
planDigest: string | null;
|
|
132
|
+
reportDigest: string | null;
|
|
133
|
+
status: string;
|
|
134
|
+
measurementDigest: string | null;
|
|
135
|
+
} | null;
|
|
136
|
+
}[];
|
|
137
|
+
pilotGroups: {
|
|
138
|
+
risk: string;
|
|
139
|
+
units: number;
|
|
140
|
+
passingPilots: string[];
|
|
141
|
+
}[];
|
|
142
|
+
graph: {
|
|
143
|
+
kind: string;
|
|
144
|
+
order: string[] | null;
|
|
145
|
+
cycles: string[][];
|
|
146
|
+
};
|
|
147
|
+
evidenceStorage: {
|
|
148
|
+
root: string;
|
|
149
|
+
files: string[];
|
|
150
|
+
unitFiles: string[];
|
|
151
|
+
written: boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
limitations: string[];
|
|
155
|
+
execution: string;
|
|
156
|
+
digest: string;
|
|
157
|
+
}>;
|
|
158
|
+
export {};
|
|
159
|
+
//# sourceMappingURL=assessment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment.d.ts","sourceRoot":"","sources":["../../src/migration/assessment.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEpH,OAAO,EAAgD,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEhH,KAAK,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,aAAa,GAAG,gBAAgB,CAAA;CAAE,CAAC;AACnG,MAAM,MAAM,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AACrF,MAAM,MAAM,uBAAuB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAC/N,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qHAAqH;IACrH,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C;qGACiG;IACjG,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACxE,CAAC;AAIF,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsIlE,MAAM;QAAgB,MAAM;;;gBArBzC,MAAM;eAAS,MAAM;wBAAkB,MAAM;oBAAc;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI;oBAAc;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;QAwB3J,MAAM;QAAoC,MAAM;;;;;;;QAAkB,WAAW;QAAiB,UAAU;;;;QAClH,QAAQ;QACR,YAAY;;;;;;;gBAVwD,QAAQ;gBAA2B,IAAI;gBAAY,MAAM;;;;;;;;;wBAjFzG,MAAM;4BAAc,MAAM,GAAG,IAAI;8BAAgB,MAAM,GAAG,IAAI;wBAAU,MAAM;mCAAqB,MAAM,GAAG,IAAI;;;;;;;;;YA4F9C,IAAI;YAAgC,KAAK;YAAoC,MAAM;;;YACtJ,IAAI;YAA2C,KAAK;YAAyD,SAAS;YAAgH,OAAO;;;;;;GAMrQ"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/** Read-only feasibility and planning; native workflow owners retain execution authority. */
|
|
2
|
+
import { canonicalJson, digest } from '../approvals/index.js';
|
|
3
|
+
import { realpathSync } from 'node:fs';
|
|
4
|
+
import { posix } from 'node:path';
|
|
5
|
+
import { cancellable, isCancellation, throwIfCancelled } from '../cancellation.js';
|
|
6
|
+
import { inventorySource, dependencyGraph, KIT_VERSION, MigrationError } from './inventory.js';
|
|
7
|
+
import { analyzeVerificationPlan, VERIFIER_VERSION, VERIFICATION_ADAPTER } from './verification.js';
|
|
8
|
+
import { analyzeVerificationEvidence } from './evidence.js';
|
|
9
|
+
import { analyzeAssessmentRequest, ASSESSMENT_VERSION } from './assessment-contract.js';
|
|
10
|
+
const same = (a, b) => canonicalJson(a) === canonicalJson(b);
|
|
11
|
+
const unitId = (path) => 'unit-' + digest(path).slice(0, 24);
|
|
12
|
+
export async function assessMigration(repository, input, options = {}) {
|
|
13
|
+
if (options.review !== undefined && typeof options.review !== 'function')
|
|
14
|
+
throw new MigrationError('invalid', 'An assessment reviewer must be a host callback, never request data.');
|
|
15
|
+
let implementation = null;
|
|
16
|
+
if (options.implementation !== undefined) {
|
|
17
|
+
const value = options.implementation;
|
|
18
|
+
if (!value || Object.keys(value).length !== 2 || ![value.kitSha256, value.verifierSha256].every(v => typeof v === 'string' && /^[a-f0-9]{64}$/.test(v)))
|
|
19
|
+
throw new MigrationError('invalid', 'The host must supply exact kit artifact and verifier SHA-256 identities.');
|
|
20
|
+
implementation = { kitSha256: value.kitSha256, verifierSha256: value.verifierSha256 };
|
|
21
|
+
}
|
|
22
|
+
const { request, digest: requestDigest } = analyzeAssessmentRequest(input);
|
|
23
|
+
if (typeof repository !== 'string' || repository.length > 4096 || /[\x00-\x1f\x7f]/.test(repository))
|
|
24
|
+
throw new MigrationError('invalid', 'Select a local repository root.');
|
|
25
|
+
try {
|
|
26
|
+
repository = realpathSync(repository);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
throw new MigrationError('unavailable', 'The assessment repository is unavailable.');
|
|
30
|
+
}
|
|
31
|
+
const signal = AbortSignal.any([AbortSignal.timeout(30000), ...(options.signal ? [options.signal] : [])]);
|
|
32
|
+
throwIfCancelled(signal);
|
|
33
|
+
const inventory = await inventorySource({ repository, revision: request.source.revision, readPaths: request.source.readPaths }, { signal });
|
|
34
|
+
const files = new Map(inventory.files.map(f => [f.path, f]));
|
|
35
|
+
const findings = [];
|
|
36
|
+
const finding = (code, source = null, severity = 'investigate') => findings.push({ code, source, severity });
|
|
37
|
+
if (!implementation)
|
|
38
|
+
finding('implementation-binding-required');
|
|
39
|
+
const within = (path) => request.source.readPaths.some(p => p === '.' || p === path || path.startsWith(p + '/'));
|
|
40
|
+
if (request.target.adapter !== VERIFICATION_ADAPTER)
|
|
41
|
+
finding('unsupported-adapter', null, 'do-not-migrate');
|
|
42
|
+
if (!/^sha256:[a-f0-9]{64}$/.test(request.target.runtime.image) || !/^v24\.\d+\.\d+$/.test(request.target.runtime.node))
|
|
43
|
+
finding('unsupported-runtime', null, 'do-not-migrate');
|
|
44
|
+
if (request.intent.kind !== 'port')
|
|
45
|
+
finding('separate-' + request.intent.kind + '-plan-required');
|
|
46
|
+
for (const row of inventory.findings)
|
|
47
|
+
finding('inventory-' + row.code, row.path);
|
|
48
|
+
if (inventory.graph.cycles.length)
|
|
49
|
+
finding('declared-package-cycle');
|
|
50
|
+
for (const pkg of inventory.packages)
|
|
51
|
+
for (const dep of pkg.dependencies)
|
|
52
|
+
if (!dep.target)
|
|
53
|
+
finding('external-dependency-needs-evidence', pkg.path);
|
|
54
|
+
const sourcePaths = new Set(request.units.map(u => u.source)), excluded = new Set(request.exclusions.map(e => e.path));
|
|
55
|
+
for (const file of inventory.files)
|
|
56
|
+
if (file.surface === 'source' && !sourcePaths.has(file.path) && !excluded.has(file.path))
|
|
57
|
+
finding('unplanned-source', file.path);
|
|
58
|
+
for (const exclusion of request.exclusions)
|
|
59
|
+
if (!files.has(exclusion.path))
|
|
60
|
+
finding('exclusion-outside-inventory', exclusion.path);
|
|
61
|
+
for (const unit of request.units) {
|
|
62
|
+
const file = files.get(unit.source);
|
|
63
|
+
if (!file || !['100644', '100755'].includes(file.mode) || file.surface !== 'source')
|
|
64
|
+
finding('unit-source-unavailable', unit.source);
|
|
65
|
+
if (!unit.source.endsWith('.mjs') || !unit.target.endsWith('.mts'))
|
|
66
|
+
finding('unsupported-unit', unit.source, 'do-not-migrate');
|
|
67
|
+
if (file?.bytes === null || (file?.bytes ?? 0) > 65536)
|
|
68
|
+
finding('unsupported-unit-size', unit.source, 'do-not-migrate');
|
|
69
|
+
if (files.has(unit.target) && !request.pilots.some(p => p.source === unit.source))
|
|
70
|
+
finding('existing-target-needs-review', unit.source);
|
|
71
|
+
}
|
|
72
|
+
const graph = dependencyGraph(request.units.map(u => ({ path: u.source, dependencies: u.dependencies.map(target => ({ target })) })));
|
|
73
|
+
if (graph.cycles.length)
|
|
74
|
+
finding('unit-dependency-cycle');
|
|
75
|
+
const packageFor = (path) => inventory.packages.filter(p => {
|
|
76
|
+
const directory = posix.dirname(p.path);
|
|
77
|
+
return directory === '.' || path.startsWith(directory + '/');
|
|
78
|
+
}).sort((a, b) => b.path.length - a.path.length)[0];
|
|
79
|
+
for (const unit of request.units) {
|
|
80
|
+
const pkg = packageFor(unit.source);
|
|
81
|
+
for (const dep of pkg?.dependencies ?? [])
|
|
82
|
+
if (dep.target && dep.target !== pkg.path) {
|
|
83
|
+
for (const other of request.units)
|
|
84
|
+
if (packageFor(other.source)?.path === dep.target && !unit.dependencies.includes(other.source))
|
|
85
|
+
finding('missing-declared-package-order', unit.source);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Read every evidence pin through the existing bounded committed inventory, never the working tree.
|
|
89
|
+
const pins = [request.rules];
|
|
90
|
+
const pilots = [];
|
|
91
|
+
for (const pilot of request.pilots) {
|
|
92
|
+
try {
|
|
93
|
+
const analysis = analyzeVerificationPlan(pilot.plan), review = analyzeVerificationEvidence(pilot.plan, pilot.report), plan = analysis.plan;
|
|
94
|
+
const unit = request.units.find(u => u.source === pilot.source);
|
|
95
|
+
const file = files.get(pilot.source);
|
|
96
|
+
const bindingMatches = plan.source.revision === request.source.revision && plan.source.path === unit.source && plan.source.object === file?.object &&
|
|
97
|
+
plan.candidate.path === unit.target && same(plan.rules, request.rules) && same(plan.runtime, request.target.runtime) && plan.adapter === request.target.adapter;
|
|
98
|
+
const measurementMatches = pilot.measurement?.reportDigest === review.reportDigest;
|
|
99
|
+
const status = !bindingMatches ? 'stale' : review.status;
|
|
100
|
+
pilots.push({ source: pilot.source, planDigest: analysis.digest, reportDigest: review.reportDigest, status,
|
|
101
|
+
measurementDigest: pilot.measurement && measurementMatches ? digest(canonicalJson(pilot.measurement)) : null });
|
|
102
|
+
pins.push(plan.source, plan.candidate, plan.negative, plan.rules);
|
|
103
|
+
if (!bindingMatches)
|
|
104
|
+
finding('stale-pilot-binding', pilot.source);
|
|
105
|
+
if (review.status !== 'passing-observations')
|
|
106
|
+
finding('nonpassing-pilot', pilot.source);
|
|
107
|
+
if (!pilot.measurement)
|
|
108
|
+
finding('missing-pilot-measurement', pilot.source);
|
|
109
|
+
else if (!measurementMatches)
|
|
110
|
+
finding('stale-pilot-measurement', pilot.source);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
if (!(error instanceof MigrationError))
|
|
114
|
+
throw error;
|
|
115
|
+
pilots.push({ source: pilot.source, planDigest: null, reportDigest: null, status: 'invalid', measurementDigest: null });
|
|
116
|
+
finding('invalid-pilot-evidence', pilot.source);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const grouped = new Map();
|
|
120
|
+
for (const pin of pins) {
|
|
121
|
+
if (!within(pin.path)) {
|
|
122
|
+
finding('evidence-pin-outside-read-scope', pin.path);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
grouped.set(pin.revision, [...(grouped.get(pin.revision) ?? []), pin]);
|
|
126
|
+
}
|
|
127
|
+
for (const [revision, group] of grouped) {
|
|
128
|
+
const paths = [...new Set(group.map(p => p.path))].sort();
|
|
129
|
+
try {
|
|
130
|
+
const observed = await inventorySource({ repository, revision, readPaths: paths }, { signal });
|
|
131
|
+
for (const pin of group) {
|
|
132
|
+
const file = observed.files.find(f => f.path === pin.path);
|
|
133
|
+
if (!file || file.object !== pin.object || !['100644', '100755'].includes(file.mode) || file.bytes === null || file.bytes > 65536)
|
|
134
|
+
finding('stale-or-unsupported-evidence-pin', pin.path);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (isCancellation(error))
|
|
139
|
+
throw error;
|
|
140
|
+
finding('evidence-revision-unavailable');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const requiredPilots = [];
|
|
144
|
+
const pilotGroups = [];
|
|
145
|
+
for (const risk of ['low', 'medium', 'high']) {
|
|
146
|
+
const choices = request.units.filter(u => u.risk === risk).map(u => u.source).sort();
|
|
147
|
+
const passing = pilots.filter(p => choices.includes(p.source) && p.status === 'passing-observations').map(p => unitId(p.source)).sort();
|
|
148
|
+
if (choices.length)
|
|
149
|
+
pilotGroups.push({ risk, units: choices.length, passingPilots: passing });
|
|
150
|
+
if (choices.length && !passing.length)
|
|
151
|
+
requiredPilots.push(choices[0]);
|
|
152
|
+
}
|
|
153
|
+
for (const source of requiredPilots)
|
|
154
|
+
if (!pilots.some(p => p.source === source && p.status === 'passing-observations'))
|
|
155
|
+
finding('representative-pilot-required', source);
|
|
156
|
+
if (!pilots.length)
|
|
157
|
+
finding('missing-baseline-and-verifier-evidence');
|
|
158
|
+
const uniqueFindings = () => [...new Map(findings.map(f => [canonicalJson(f), f])).values()].sort((a, b) => canonicalJson(a) < canonicalJson(b) ? -1 : canonicalJson(a) > canonicalJson(b) ? 1 : 0);
|
|
159
|
+
const reviewBody = { repository, implementation, requestDigest, inventoryDigest: inventory.digest, request, findings: uniqueFindings() };
|
|
160
|
+
const reviewDigest = digest(canonicalJson(reviewBody));
|
|
161
|
+
let review = null;
|
|
162
|
+
if (options.review) {
|
|
163
|
+
try {
|
|
164
|
+
const value = await cancellable(options.review(JSON.parse(JSON.stringify({ ...reviewBody, digest: reviewDigest }))), signal);
|
|
165
|
+
if (!value || Object.keys(value).length !== 2 || !['accepted', 'rejected'].includes(value.decision) || typeof value.receipt !== 'string' || !/^[a-zA-Z0-9_.:-]{1,256}$/.test(value.receipt))
|
|
166
|
+
finding('invalid-host-review');
|
|
167
|
+
else
|
|
168
|
+
review = { decision: value.decision, receipt: value.receipt };
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
if (isCancellation(error))
|
|
172
|
+
throw error;
|
|
173
|
+
finding('host-review-unavailable');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (!review)
|
|
177
|
+
finding('evidence-and-coverage-review-required');
|
|
178
|
+
else if (review.decision !== 'accepted')
|
|
179
|
+
finding('evidence-and-coverage-review-rejected');
|
|
180
|
+
const measured = request.pilots.filter(p => pilots.some(row => row.source === p.source && row.status === 'passing-observations' && row.measurementDigest)).map(p => p.measurement);
|
|
181
|
+
let estimate = {
|
|
182
|
+
status: 'insufficient-reviewed-evidence', units: request.units.length, observedPilots: measured.length, costMicros: null, durationMs: null,
|
|
183
|
+
};
|
|
184
|
+
if (review?.decision === 'accepted' && !findings.length && measured.length && graph.order) {
|
|
185
|
+
const n = request.units.length, depths = new Map();
|
|
186
|
+
for (const path of graph.order)
|
|
187
|
+
depths.set(path, 1 + Math.max(0, ...request.units.find(u => u.source === path).dependencies.map(d => depths.get(d))));
|
|
188
|
+
const waves = Math.max(Math.ceil(n / request.budget.concurrency), ...depths.values());
|
|
189
|
+
estimate = { status: 'measured-pilot-range', units: n, observedPilots: measured.length,
|
|
190
|
+
costMicros: { low: n * Math.min(...measured.map(m => m.costMicros)), high: n * Math.max(...measured.map(m => m.costMicros)) },
|
|
191
|
+
durationMs: { low: waves * Math.min(...measured.map(m => m.workMs)) + n * Math.min(...measured.map(m => m.reviewMs)), high: n * Math.max(...measured.map(m => m.workMs + m.reviewMs)) } };
|
|
192
|
+
if (estimate.costMicros.low > request.budget.maxCostMicros || estimate.durationMs.low > request.budget.maxDurationMs)
|
|
193
|
+
finding('measured-range-exceeds-budget', null, 'do-not-migrate');
|
|
194
|
+
else if (estimate.costMicros.high > request.budget.maxCostMicros || estimate.durationMs.high > request.budget.maxDurationMs)
|
|
195
|
+
finding('budget-overlaps-measured-range');
|
|
196
|
+
}
|
|
197
|
+
const finalFindings = uniqueFindings();
|
|
198
|
+
const recommendation = finalFindings.some(f => f.severity === 'do-not-migrate') ? 'do-not-migrate' : finalFindings.length ? 'investigate' : 'go';
|
|
199
|
+
const binding = { requestDigest, inventoryDigest: inventory.digest, kit: { inventory: KIT_VERSION, assessment: ASSESSMENT_VERSION, verifier: VERIFIER_VERSION }, implementation, rules: request.rules, source: request.source, target: request.target };
|
|
200
|
+
const units = request.units.map(u => ({ id: unitId(u.source), source: { revision: request.source.revision, path: u.source, object: files.get(u.source)?.object ?? null }, target: u.target,
|
|
201
|
+
dependencies: u.dependencies.map(unitId).sort(), risk: u.risk, rationale: u.rationale,
|
|
202
|
+
bindingDigest: digest(canonicalJson({ binding, unit: u })), state: 'planned', pilot: pilots.find(p => p.source === u.source) ?? null }));
|
|
203
|
+
const value = {
|
|
204
|
+
format: 'calliope.migration.assessment/v1', ...binding, recommendation, recommendationScope: 'This pinned plan and supported adapter only; not a general verdict on the target technology.',
|
|
205
|
+
findings: finalFindings, review: { digest: reviewDigest, result: review }, estimate,
|
|
206
|
+
estimateAssumptions: ['Pilot costs include implementation, verification and independent review; the trusted host must verify their accounting receipts.', 'Ranges extrapolate measured pilot minima/maxima to every manifest unit; they are not statistical confidence intervals.', 'Lower duration uses concurrency and dependency depth, followed by serial review. Upper duration assumes serial work and review.', 'No unmeasured deployment, external data migration or operating cost is included.'],
|
|
207
|
+
inventory,
|
|
208
|
+
rulebook: { format: 'calliope.migration.rulebook/v1', intent: request.intent, sourceRules: request.rules, exclusions: request.exclusions,
|
|
209
|
+
preserve: inventory.files.filter(f => ['test', 'manifest', 'build-config', 'lockfile'].includes(f.surface)),
|
|
210
|
+
requirements: ['Preserve the pinned behavioral contract and original tests.', 'Criteria or compatibility changes require an independently reviewed new plan and evidence.', 'Keep implementation, review and verification states separate.', 'No merge, deployment or external data migration is authorized by assessment.'] },
|
|
211
|
+
manifest: { format: 'calliope.migration.work-manifest/v1', units, pilotGroups, graph: { kind: 'declared-unit-dependencies', order: graph.order?.map(unitId) ?? null, cycles: graph.cycles.map(c => c.map(unitId)) },
|
|
212
|
+
evidenceStorage: { root: '.calliope/migrations/' + requestDigest, files: ['assessment.json', 'rulebook.json', 'manifest.json'], unitFiles: ['source-pin.json', 'verification-plan.json', 'verification-report.json', 'measurement.json', 'review.json'], written: false } },
|
|
213
|
+
limitations: ['Declared package and unit dependencies only; source imports and dynamic constructs are not statically analyzed.', 'Only declared cases of the self-contained JS-to-TS CLI adapter are evidenced, without TypeScript type-check or deployment proof.', 'Host review receipts are references, not portable authentication or permission grants.', 'Assessment does not create native workflow bindings, start workers, persist artifacts or propose brain changes. Those require their owning host.'],
|
|
214
|
+
execution: 'none',
|
|
215
|
+
};
|
|
216
|
+
throwIfCancelled(signal);
|
|
217
|
+
return { ...value, digest: digest(canonicalJson(value)) };
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=assessment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment.js","sourceRoot":"","sources":["../../src/migration/assessment.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,oBAAoB,EAAkB,MAAM,mBAAmB,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAA0B,MAAM,0BAA0B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AE,KAAK,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;YACjN,eAAe,EAAE,EAAE,IAAI,EAAE,uBAAuB,GAAG,aAAa,EAAE,KAAK,EAAE,CAAC,iBAAiB,EAAE,eAAe,EAAE,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC7Q,WAAW,EAAE,CAAC,iHAAiH,EAAE,kIAAkI,EAAE,wFAAwF,EAAE,kJAAkJ,CAAC;QAClf,SAAS,EAAE,MAAM;KAClB,CAAC;IACF,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MIGRATION_USAGE = "calliope migration capabilities|schema|baseline-schema|review-baseline|verify-baseline|review-baseline-evidence|verification-schema|evidence-schema|assessment-schema|example|inventory|review-verification|verify|review-evidence|review-assessment|assess [--repository <root>] [--revision <full-commit>] [--path <relative-prefix>] [--plan <file>] [--report <file>] [--request <file>] [--approve <digest>] [--json]";
|
|
2
|
+
export declare function runMigrationCommand(args: string[], options?: {
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
write?: (line: string) => void;
|
|
5
|
+
}): Promise<number>;
|
|
6
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/migration/cli.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,eAAe,+ZAA+Z,CAAC;AAC5b,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAmDjJ"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { sourceCandidateCapabilities } from '../orchestration/source-candidates.js';
|
|
2
|
+
import { INVENTORY_SCHEMA, VERIFICATION_SCHEMAS, BASELINE_SCHEMAS, EVIDENCE_REVIEW_SCHEMA } from './schema.js';
|
|
3
|
+
import { analyzeVerificationEvidence, analyzeBaselineEvidence } from './evidence.js';
|
|
4
|
+
import { analyzeAssessmentRequest } from './assessment-contract.js';
|
|
5
|
+
import { assessMigration } from './assessment.js';
|
|
6
|
+
import { ASSESSMENT_SCHEMAS } from './assessment-schema.js';
|
|
7
|
+
import { analyzeVerificationPlan, verifyMigration, analyzeBaselinePlan, verifyMigrationBaseline } from './verification.js';
|
|
8
|
+
import { realpathSync } from 'node:fs';
|
|
9
|
+
import { readArtifactBytes } from '../orchestration/execution-store.js';
|
|
10
|
+
import { migrationExample } from './example.js';
|
|
11
|
+
import { parseArgs } from 'node:util';
|
|
12
|
+
import { isCancellation } from '../cancellation.js';
|
|
13
|
+
import { inventorySource, MigrationError, KIT_VERSION } from './inventory.js';
|
|
14
|
+
export const MIGRATION_USAGE = 'calliope migration capabilities|schema|baseline-schema|review-baseline|verify-baseline|review-baseline-evidence|verification-schema|evidence-schema|assessment-schema|example|inventory|review-verification|verify|review-evidence|review-assessment|assess [--repository <root>] [--revision <full-commit>] [--path <relative-prefix>] [--plan <file>] [--report <file>] [--request <file>] [--approve <digest>] [--json]';
|
|
15
|
+
export async function runMigrationCommand(args, options = {}) {
|
|
16
|
+
const write = options.write ?? (line => process.stdout.write(line));
|
|
17
|
+
const json = args.includes('--json');
|
|
18
|
+
try {
|
|
19
|
+
if (args.length > 140 || args.some(arg => arg.length > 4096 || /[\x00-\x1f\x7f]/.test(arg)))
|
|
20
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
21
|
+
const { positionals, values } = parseArgs({ args, allowPositionals: true, options: { json: { type: 'boolean' }, repository: { type: 'string' }, revision: { type: 'string' }, path: { type: 'string', multiple: true }, plan: { type: 'string' }, report: { type: 'string' }, request: { type: 'string' }, approve: { type: 'string' } } });
|
|
22
|
+
if (positionals.length !== 1)
|
|
23
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
24
|
+
if (['assess', 'review-assessment'].includes(positionals[0])) {
|
|
25
|
+
if (!values.request || values.plan || values.report || values.path || values.revision || values.approve || (positionals[0] === 'assess' ? !values.repository : values.repository))
|
|
26
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
27
|
+
const input = JSON.parse(readArtifactBytes(realpathSync(values.request), 2097152).toString('utf8'));
|
|
28
|
+
const result = positionals[0] === 'review-assessment' ? analyzeAssessmentRequest(input) : await assessMigration(values.repository, input, { signal: options.signal });
|
|
29
|
+
write(JSON.stringify(result) + '\n');
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
if (values.request)
|
|
33
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
34
|
+
if (['review-evidence', 'review-baseline-evidence'].includes(positionals[0])) {
|
|
35
|
+
if (!values.plan || !values.report || values.path || values.revision || values.repository || values.approve)
|
|
36
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
37
|
+
const read = (file) => JSON.parse(readArtifactBytes(realpathSync(file), 262144).toString('utf8'));
|
|
38
|
+
const result = (positionals[0] === 'review-baseline-evidence' ? analyzeBaselineEvidence : analyzeVerificationEvidence)(read(values.plan), read(values.report));
|
|
39
|
+
write(JSON.stringify(result) + '\n');
|
|
40
|
+
return ['passing-observations', 'baseline-observations'].includes(result.status) ? 0 : 1;
|
|
41
|
+
}
|
|
42
|
+
if (values.report)
|
|
43
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
44
|
+
if (['review-verification', 'verify', 'review-baseline', 'verify-baseline'].includes(positionals[0])) {
|
|
45
|
+
const baselineOnly = positionals[0].endsWith('baseline'), execute = positionals[0] === 'verify' || positionals[0] === 'verify-baseline';
|
|
46
|
+
if (!values.plan || values.path || values.revision || (execute ? !values.repository || !values.approve : values.repository || values.approve))
|
|
47
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
48
|
+
const input = JSON.parse(readArtifactBytes(realpathSync(values.plan), 262144).toString('utf8'));
|
|
49
|
+
const analysis = (baselineOnly ? analyzeBaselinePlan : analyzeVerificationPlan)(input);
|
|
50
|
+
if (!execute) {
|
|
51
|
+
write(JSON.stringify(analysis) + '\n');
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
const result = await (baselineOnly ? verifyMigrationBaseline : verifyMigration)(values.repository, input, { signal: options.signal, approve: async (request) => request.digest === values.approve });
|
|
55
|
+
write(json ? JSON.stringify(result) + '\n' : `${result.outcome}: ${result.reason}\nVerification ${result.digest}\n`);
|
|
56
|
+
return result.outcome === (baselineOnly ? 'baseline-verified' : 'passed') ? 0 : result.outcome === 'cancelled' ? 130 : 1;
|
|
57
|
+
}
|
|
58
|
+
if (values.plan || values.approve)
|
|
59
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
60
|
+
if (positionals[0] === 'example' && !values.repository && !values.revision && !values.path) {
|
|
61
|
+
write(JSON.stringify(migrationExample()) + '\n');
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
if (positionals[0] === 'baseline-schema' && !values.repository && !values.revision && !values.path) {
|
|
65
|
+
write(JSON.stringify(BASELINE_SCHEMAS) + '\n');
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
if (positionals[0] === 'verification-schema' && !values.repository && !values.revision && !values.path) {
|
|
69
|
+
write(JSON.stringify(VERIFICATION_SCHEMAS) + '\n');
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
if (positionals[0] === 'evidence-schema' && !values.repository && !values.revision && !values.path) {
|
|
73
|
+
write(JSON.stringify(EVIDENCE_REVIEW_SCHEMA) + '\n');
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
if (positionals[0] === 'assessment-schema' && !values.repository && !values.revision && !values.path) {
|
|
77
|
+
write(JSON.stringify(ASSESSMENT_SCHEMAS) + '\n');
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
if (positionals[0] === 'schema' && !values.repository && !values.revision && !values.path) {
|
|
81
|
+
write(JSON.stringify(INVENTORY_SCHEMA) + '\n');
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
if (positionals[0] === 'capabilities' && !values.repository && !values.revision && !values.path) {
|
|
85
|
+
write(JSON.stringify({ kit: 'migration-v1', inventoryVersion: KIT_VERSION, phases: ['inventory', 'verify-baseline', 'review-baseline-evidence', 'verify', 'review-evidence', 'assess'], dependencyAnalysis: ['npm-declarations', 'declared-unit-dependencies'], schemas: ['calliope.migration.baseline-plan/v1', 'calliope.migration.baseline-report/v1', 'calliope.migration.baseline-evidence-review/v1', 'calliope.migration.inventory/v1', 'calliope.migration.verification-plan/v1', 'calliope.migration.verification-report/v1', 'calliope.migration.evidence-review/v1', 'calliope.migration.assessment-request/v1', 'calliope.migration.assessment/v1'], execution: { candidate: sourceCandidateCapabilities(), baseline: 'explicit-plan-digest-approval; no-candidate-read-or-execution', verification: 'explicit-plan-digest-approval', evidenceReview: 'read-only-no-execution-or-approval', assessment: 'read-only-no-dispatch; host-evidence-review-required-for-go', adapters: ['javascript-to-typescript-cli/v1'], backend: 'native-isolated-command' } }) + '\n');
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
if (positionals[0] !== 'inventory' || !values.repository || !values.revision)
|
|
89
|
+
throw new MigrationError('invalid', MIGRATION_USAGE);
|
|
90
|
+
const result = await inventorySource({ repository: values.repository, revision: values.revision, ...(values.path ? { readPaths: values.path } : {}) }, options);
|
|
91
|
+
write(json ? JSON.stringify(result) + '\n' : `Commit ${result.source.commit}\n${result.files.length} tracked entries; ${result.packages.length} package manifests; ${result.graph.cycles.length} declared dependency cycles.\nInventory ${result.digest}\nUse --json for exact files, findings and limitations. No repository code was executed.\n`);
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const code = isCancellation(error) ? 'cancelled' : error instanceof MigrationError ? error.code : 'unavailable';
|
|
96
|
+
const message = error instanceof MigrationError ? error.message : code === 'cancelled' ? 'Migration operation cancelled.' : 'Migration operation could not read its local inputs within their bounds.';
|
|
97
|
+
write(json ? JSON.stringify({ error: { code, message } }) + '\n' : message + '\n');
|
|
98
|
+
return code === 'cancelled' ? 130 : 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=cli.js.map
|