@paradigma-inc/flywheel 0.1.115 → 0.1.134
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 +67 -10
- package/package.json +14 -6
- package/skills/flywheel/SKILL.md +9 -6
- package/skills/flywheel/example-workflows/organizing-exploring-and-iterating-on-a-research-topic.md +38 -46
- package/skills/flywheel/example-workflows/reproducing-papers-on-a-budget.md +34 -36
- package/skills/flywheel/getting-started/flywheel-quickstart.md +2 -5
- package/skills/flywheel/references/INTERFACES.md +2 -2
- package/skills/flywheel/references/experiment-design-protocol.md +32 -25
- package/skills/flywheel/references/flywheel-cli-tool-map.md +120 -76
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +42 -32
- package/skills/flywheel/setting-up-flywheel/claude-code-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/codex-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/installation-overview.md +2 -6
- package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +45 -25
- package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +34 -11
- package/skills/flywheel-auto/SKILL.md +40 -23
- package/skills/flywheel-auto/evals/evals.json +1 -1
- package/skills/flywheel-auto/references/INTERFACES.md +2 -2
- package/skills/flywheel-auto/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-lookahead/SKILL.md +47 -28
- package/skills/flywheel-lookahead/agents/openai.yaml +1 -1
- package/skills/flywheel-lookahead/evals/evals.json +6 -6
- package/skills/flywheel-lookahead/references/INTERFACES.md +2 -2
- package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-prove/SKILL.md +2 -2
- package/skills/flywheel-prove/references/workflow.md +21 -2
- package/skills/flywheel-reproduce/SKILL.md +39 -19
- package/skills/flywheel-reproduce/evals/evals.json +1 -1
- package/skills/flywheel-reproduce/references/INTERFACES.md +2 -2
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-to-graph/SKILL.md +37 -17
- package/skills/flywheel-to-graph/references/INTERFACES.md +2 -2
- package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-tree/references/workflow.md +6 -37
- package/src/cli.mjs +1145 -1141
- package/src/mcp-writer.mjs +413 -435
- package/src/public-command-metadata.mjs +28 -5
- package/src/runtime/delegate.mjs +2 -19
- package/src/runtime/required-runtime-commands.json +80 -28
- package/src/runtime/runtime-config.mjs +39 -60
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js +330 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +90 -139
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js +116 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js +248 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js +65 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js +3 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js +46 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +17 -40
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js +305 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js +286 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js +30 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +27 -12
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js +169 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js +227 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +21 -51
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js +11 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +38 -45
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js +14 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js +13 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +34 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +9 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js +76 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +4 -138
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +8 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js +362 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +45 -183
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js +47 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js +181 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js +163 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js +79 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js +78 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js +3 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js +139 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js +299 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.js +1 -16
- package/src/runtime/vendor/flywheel-cli-dist/errors.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js +3 -3
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js +19 -9
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js +33 -4
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js +322 -304
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js +1 -21
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js +244 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js +35 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js +42 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js +179 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js +152 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js +73 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js +82 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js +345 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js +57 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js +149 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js +115 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js +159 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js +346 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js +207 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js +109 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js +61 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js +46 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js +54 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js +183 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js +16 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js +59 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js +58 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js +118 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js +132 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js +372 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js +210 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js +278 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js +192 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js +114 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js +65 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js +145 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js +218 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js +298 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js +424 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/001_initial.sql +319 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/002_staged_latest_values.sql +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/003_remove_cli_editing_lease.sql +21 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/004_hosted_association.sql +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/005_artifact_properties.sql +68 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js +410 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js +77 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js +240 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js +127 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js +107 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js +219 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js +164 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js +41 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js +38 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js +133 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js +98 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js +161 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js +97 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js +651 -376
- package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js +18 -11
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-x64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/manifest.json +246 -257
- package/src/setup/command.mjs +5 -0
- package/src/setup/io/patchers/json.mjs +1 -1
- package/src/setup/io/patchers/toml.mjs +3 -1
- package/src/setup/io/patchers/yaml.mjs +1 -1
- package/src/setup/modes/cli.mjs +76 -7
- package/src/setup/modes/mcp-command.mjs +802 -793
- package/src/setup/modes/mcp.mjs +7 -3
- package/src/setup/shared/prior-mode-detect.mjs +18 -21
- package/src/setup/test-seams.mjs +25 -0
- package/src/setup-auth.mjs +76 -10
- package/src/toml-lines.mjs +52 -0
- package/src/unified-cli.mjs +31 -16
- package/skills/flywheel-llm-proof-paper/scripts/__pycache__/check_paper.cpython-312.pyc +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js +0 -92
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +0 -24
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.d.ts +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js +0 -150
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.d.ts +0 -32
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js +0 -213
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.d.ts +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.d.ts +0 -39
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.d.ts +0 -50
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/feedback-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.d.ts +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.d.ts +0 -36
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.d.ts +0 -23
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js +0 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js +0 -16
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js +0 -140
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js +0 -98
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js +0 -28
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.d.ts +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.d.ts +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/errors.d.ts +0 -86
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/generatedFeedbackContract.d.ts +0 -41
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.d.ts +0 -26
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/http/client.d.ts +0 -91
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/main.d.ts +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/output/format.d.ts +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/version.d.ts +0 -3
- package/src/secure-write.mjs +0 -43
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { foldArtifactPropertiesOperation } from "../domain/models/artifact-properties.js";
|
|
2
|
+
import { RepositoryContractError } from "../domain/errors.js";
|
|
3
|
+
import { RepositoryCommit } from "../domain/models/commits.js";
|
|
4
|
+
import { NODE_FIELDS } from "../domain/models/constants.js";
|
|
5
|
+
import { commitLatestValues, workspaceHeadIn } from "./commits.js";
|
|
6
|
+
import { assertRowDigests } from "./snapshot/validate.js";
|
|
7
|
+
import { valueDigest } from "../domain/models/encoding.js";
|
|
8
|
+
import { latestValueWrites } from "./latest-values.js";
|
|
9
|
+
import { RepositoryStoreError } from "./sqlite/errors.js";
|
|
10
|
+
import { iterateRows } from "./sqlite/rows.js";
|
|
11
|
+
import { importedBaselineArtifactInventory } from "./migration/provenance.js";
|
|
12
|
+
const CURRENT_TABLES = [
|
|
13
|
+
["repository_node_latest_values", "node_id", NODE_FIELDS],
|
|
14
|
+
["repository_semantic_edges", "edge_id", ["content"]],
|
|
15
|
+
];
|
|
16
|
+
const LEGACY_ARTIFACT_FIELDS = ["name", "media_type", "notes", "tags"];
|
|
17
|
+
function checkCurrentValues(database, repositoryId, commits, latestByCommit, loadAggregate) {
|
|
18
|
+
const root = commits[0];
|
|
19
|
+
// A baseline authenticates an imported snapshot, not replayable initial rows.
|
|
20
|
+
// Undefined entries/fields are unknown; null entries are known deletions.
|
|
21
|
+
const importedBaseline = root?.parentCommitId === null && root.operations.length === 1 &&
|
|
22
|
+
root.operations[0].type === "imported_baseline.v1";
|
|
23
|
+
const nodes = new Map();
|
|
24
|
+
const edges = new Map();
|
|
25
|
+
const artifacts = new Map();
|
|
26
|
+
if (importedBaseline) {
|
|
27
|
+
const inventory = importedBaselineArtifactInventory(database, repositoryId, root.commitId, loadAggregate);
|
|
28
|
+
if (inventory === undefined)
|
|
29
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
30
|
+
for (const [artifactId, artifact] of inventory) {
|
|
31
|
+
artifacts.set(artifactId, {
|
|
32
|
+
objectDigest: artifact.objectDigest,
|
|
33
|
+
properties: artifact.properties,
|
|
34
|
+
propertiesDigest: valueDigest(artifact.properties),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const commit of commits) {
|
|
39
|
+
const latest = latestByCommit.get(commit.commitId);
|
|
40
|
+
if (!latest)
|
|
41
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
42
|
+
for (const [position, operation] of commit.operations.entries()) {
|
|
43
|
+
const payload = operation.payload;
|
|
44
|
+
switch (operation.type) {
|
|
45
|
+
case "node.create.v1":
|
|
46
|
+
nodes.set(String(payload.node_id), { ...payload.initial_field_digests });
|
|
47
|
+
break;
|
|
48
|
+
case "node.field.set.v1": {
|
|
49
|
+
let node = nodes.get(String(payload.node_id));
|
|
50
|
+
if (!node) {
|
|
51
|
+
if (!importedBaseline || node === null)
|
|
52
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
53
|
+
node = {};
|
|
54
|
+
nodes.set(String(payload.node_id), node);
|
|
55
|
+
}
|
|
56
|
+
node[String(payload.field)] = payload.new_digest;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "node.purge.v1":
|
|
60
|
+
nodes.set(String(payload.node_id), null);
|
|
61
|
+
break;
|
|
62
|
+
case "edge.add.v1":
|
|
63
|
+
edges.set(String(payload.edge_id), { content: payload.content_digest });
|
|
64
|
+
break;
|
|
65
|
+
case "edge.field.set.v1":
|
|
66
|
+
edges.set(String(payload.edge_id), { content: payload.new_digest });
|
|
67
|
+
break;
|
|
68
|
+
case "edge.remove.v1":
|
|
69
|
+
edges.set(String(payload.edge_id), null);
|
|
70
|
+
break;
|
|
71
|
+
case "artifact.attach.v1":
|
|
72
|
+
case "artifact.attach.v2":
|
|
73
|
+
case "artifact.metadata.set.v1":
|
|
74
|
+
case "artifact.properties.set.v1":
|
|
75
|
+
case "artifact.content.set.v1": {
|
|
76
|
+
const artifactId = payload.artifact_id;
|
|
77
|
+
if (typeof artifactId !== "string")
|
|
78
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
79
|
+
let current = artifacts.get(artifactId);
|
|
80
|
+
if (operation.type === "artifact.content.set.v1") {
|
|
81
|
+
const expected = payload.expected_object_digest;
|
|
82
|
+
const replacement = payload.object_digest;
|
|
83
|
+
if (!current || typeof expected !== "string" || typeof replacement !== "string" || current.objectDigest !== expected) {
|
|
84
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
85
|
+
}
|
|
86
|
+
current.objectDigest = replacement;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (operation.type === "artifact.attach.v1" || operation.type === "artifact.attach.v2") {
|
|
90
|
+
const objectDigest = payload.object_digest;
|
|
91
|
+
if (typeof objectDigest !== "string")
|
|
92
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
93
|
+
if (current === undefined) {
|
|
94
|
+
current = { objectDigest };
|
|
95
|
+
artifacts.set(artifactId, current);
|
|
96
|
+
}
|
|
97
|
+
else if (current.objectDigest !== objectDigest) {
|
|
98
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
99
|
+
}
|
|
100
|
+
if (operation.type === "artifact.attach.v2") {
|
|
101
|
+
const declaredDigest = payload.properties_digest;
|
|
102
|
+
const laterPropertiesUpdate = commit.operations.slice(position + 1).some(candidate => candidate.type === "artifact.properties.set.v1" && candidate.payload.artifact_id === artifactId);
|
|
103
|
+
const write = latest.get(JSON.stringify(["artifact", artifactId, "properties"]));
|
|
104
|
+
if (typeof declaredDigest !== "string")
|
|
105
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
106
|
+
if (!laterPropertiesUpdate && write !== undefined) {
|
|
107
|
+
if (write.value === null || write.valueDigest !== declaredDigest) {
|
|
108
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
current.properties = foldArtifactPropertiesOperation(current.properties, operation, latest);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid", { cause: error });
|
|
115
|
+
}
|
|
116
|
+
current.propertiesDigest = declaredDigest;
|
|
117
|
+
}
|
|
118
|
+
else if (current.propertiesDigest === undefined) {
|
|
119
|
+
current.propertiesDigest = declaredDigest;
|
|
120
|
+
}
|
|
121
|
+
else if (current.propertiesDigest !== declaredDigest) {
|
|
122
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
const hasMetadataSideband = LEGACY_ARTIFACT_FIELDS.some(field => latest.has(JSON.stringify(["artifact", artifactId, field])));
|
|
127
|
+
if (!hasMetadataSideband)
|
|
128
|
+
break;
|
|
129
|
+
try {
|
|
130
|
+
const properties = foldArtifactPropertiesOperation(current.properties, operation, latest);
|
|
131
|
+
if (properties === undefined)
|
|
132
|
+
throw new Error("artifact properties are missing");
|
|
133
|
+
current.properties = properties;
|
|
134
|
+
current.propertiesDigest = valueDigest(properties);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid", { cause: error });
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (current === undefined)
|
|
142
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
143
|
+
if (operation.type === "artifact.properties.set.v1") {
|
|
144
|
+
const expected = payload.expected_digest;
|
|
145
|
+
const replacement = payload.new_digest;
|
|
146
|
+
if (typeof expected !== "string" || typeof replacement !== "string" ||
|
|
147
|
+
current.properties !== undefined && valueDigest(current.properties) !== expected ||
|
|
148
|
+
current.propertiesDigest !== undefined && current.propertiesDigest !== expected) {
|
|
149
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid");
|
|
150
|
+
}
|
|
151
|
+
const write = latest.get(JSON.stringify(["artifact", artifactId, "properties"]));
|
|
152
|
+
if (write === undefined) {
|
|
153
|
+
current.properties = undefined;
|
|
154
|
+
current.propertiesDigest = replacement;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
const properties = foldArtifactPropertiesOperation(current.properties, operation, latest);
|
|
159
|
+
if (properties === undefined || valueDigest(properties) !== replacement)
|
|
160
|
+
throw new Error("artifact properties are invalid");
|
|
161
|
+
current.properties = properties;
|
|
162
|
+
current.propertiesDigest = replacement;
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid", { cause: error });
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
const hasMetadataSideband = [...latest.values()].some(write => write.ownerType === "artifact" && write.ownerId === artifactId && write.field === payload.field);
|
|
170
|
+
if (!hasMetadataSideband) {
|
|
171
|
+
current.properties = undefined;
|
|
172
|
+
current.propertiesDigest = undefined;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
const properties = foldArtifactPropertiesOperation(current.properties, operation, latest);
|
|
177
|
+
if (properties === undefined)
|
|
178
|
+
throw new Error("artifact properties are missing");
|
|
179
|
+
current.properties = properties;
|
|
180
|
+
current.propertiesDigest = valueDigest(properties);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
throw new RepositoryStoreError("stored canonical current-value history is invalid", { cause: error });
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
const expectedTables = [nodes, edges];
|
|
191
|
+
for (const [index, [table, id, fields]] of CURRENT_TABLES.entries()) {
|
|
192
|
+
const columns = [...fields, ...fields.map(field => `${field}_digest`)];
|
|
193
|
+
const expected = expectedTables[index];
|
|
194
|
+
for (const row of iterateRows(database.prepare(`SELECT ${id}, ${columns.join(", ")} FROM ${table} WHERE repository_id = ?`), repositoryId)) {
|
|
195
|
+
assertRowDigests(columns, columns.map(column => row[column]));
|
|
196
|
+
const digests = expected.get(String(row[id]));
|
|
197
|
+
if (digests === null || (digests === undefined && !importedBaseline) ||
|
|
198
|
+
(digests && fields.some(field => Object.hasOwn(digests, field) && digests[field] !== row[`${field}_digest`]))) {
|
|
199
|
+
throw new RepositoryStoreError("repository current-value digests do not match canonical history");
|
|
200
|
+
}
|
|
201
|
+
expected.delete(String(row[id]));
|
|
202
|
+
}
|
|
203
|
+
for (const digests of expected.values()) {
|
|
204
|
+
if (digests !== null)
|
|
205
|
+
throw new RepositoryStoreError("repository current-value digests do not match canonical history");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const actualArtifacts = new Map();
|
|
209
|
+
for (const row of iterateRows(database.prepare("SELECT artifact_id, object_digest, properties, properties_digest FROM repository_artifacts WHERE repository_id = ?"), repositoryId)) {
|
|
210
|
+
if (typeof row.artifact_id !== "string" || typeof row.object_digest !== "string" || typeof row.properties !== "string" ||
|
|
211
|
+
typeof row.properties_digest !== "string") {
|
|
212
|
+
throw new RepositoryStoreError("repository current-value digests do not match canonical history");
|
|
213
|
+
}
|
|
214
|
+
assertRowDigests(["properties", "properties_digest"], [row.properties, row.properties_digest]);
|
|
215
|
+
actualArtifacts.set(row.artifact_id, {
|
|
216
|
+
objectDigest: row.object_digest,
|
|
217
|
+
properties: row.properties,
|
|
218
|
+
propertiesDigest: row.properties_digest,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (actualArtifacts.size !== artifacts.size || [...artifacts].some(([artifactId, expected]) => {
|
|
222
|
+
const actual = actualArtifacts.get(artifactId);
|
|
223
|
+
return actual === undefined || actual.objectDigest !== expected.objectDigest ||
|
|
224
|
+
expected.properties !== undefined && actual.properties !== expected.properties ||
|
|
225
|
+
expected.propertiesDigest !== undefined && actual.propertiesDigest !== expected.propertiesDigest;
|
|
226
|
+
})) {
|
|
227
|
+
throw new RepositoryStoreError("repository current-value digests do not match canonical history");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
export function validateCanonicalHistoryIn(database, repositoryId, loadAggregate = () => undefined) {
|
|
231
|
+
const parents = iterateRows(database.prepare("SELECT commit_id, parent_commit_id, parent_position FROM repository_commit_parents WHERE repository_id = ? ORDER BY commit_id, parent_position", { readBigInts: true }), repositoryId);
|
|
232
|
+
const operations = iterateRows(database.prepare("SELECT commit_id, operation_id, operation_position, canonical_bytes FROM repository_operations WHERE repository_id = ? ORDER BY commit_id, operation_position", { readBigInts: true }), repositoryId);
|
|
233
|
+
const commits = new Map();
|
|
234
|
+
const latestByCommit = new Map();
|
|
235
|
+
try {
|
|
236
|
+
let parent = parents.next();
|
|
237
|
+
let operation = operations.next();
|
|
238
|
+
for (const row of iterateRows(database.prepare("SELECT commit_id, canonical_bytes, latest_values_bytes FROM repository_commits WHERE repository_id = ? ORDER BY commit_id"), repositoryId)) {
|
|
239
|
+
let commit;
|
|
240
|
+
try {
|
|
241
|
+
if (typeof row.commit_id !== "string" || !(row.canonical_bytes instanceof Uint8Array)) {
|
|
242
|
+
throw new RepositoryContractError("invalid stored commit");
|
|
243
|
+
}
|
|
244
|
+
commit = RepositoryCommit.fromCanonicalBytes(row.commit_id, row.canonical_bytes);
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
if (!(error instanceof RepositoryContractError))
|
|
248
|
+
throw error;
|
|
249
|
+
throw new RepositoryStoreError("stored canonical commit is invalid", { cause: error });
|
|
250
|
+
}
|
|
251
|
+
if (commit.repositoryId !== repositoryId)
|
|
252
|
+
throw new RepositoryStoreError("stored canonical commit ownership is invalid");
|
|
253
|
+
commits.set(commit.commitId, commit);
|
|
254
|
+
const latest = commitLatestValues(row.latest_values_bytes);
|
|
255
|
+
latestByCommit.set(commit.commitId, latest.length === 0 ? new Map() : latestValueWrites(commit, latest.map(write => write.canonicalBytes)));
|
|
256
|
+
if (commit.parentCommitId !== null) {
|
|
257
|
+
if (parent.done || parent.value.commit_id !== commit.commitId || parent.value.parent_commit_id !== commit.parentCommitId ||
|
|
258
|
+
parent.value.parent_position !== 0n) {
|
|
259
|
+
throw new RepositoryStoreError("stored canonical parent rows are invalid");
|
|
260
|
+
}
|
|
261
|
+
parent = parents.next();
|
|
262
|
+
}
|
|
263
|
+
if (!parent.done && parent.value.commit_id === commit.commitId) {
|
|
264
|
+
throw new RepositoryStoreError("stored canonical parent rows are invalid");
|
|
265
|
+
}
|
|
266
|
+
for (const [position, expected] of commit.operations.entries()) {
|
|
267
|
+
if (operation.done || operation.value.commit_id !== commit.commitId || operation.value.operation_id !== expected.operationId ||
|
|
268
|
+
operation.value.operation_position !== BigInt(position) || !(operation.value.canonical_bytes instanceof Uint8Array) ||
|
|
269
|
+
!expected.canonicalBytes.equals(operation.value.canonical_bytes)) {
|
|
270
|
+
throw new RepositoryStoreError("stored canonical operation rows are invalid");
|
|
271
|
+
}
|
|
272
|
+
operation = operations.next();
|
|
273
|
+
}
|
|
274
|
+
if (!operation.done && operation.value.commit_id === commit.commitId) {
|
|
275
|
+
throw new RepositoryStoreError("stored canonical operation rows are invalid");
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (!parent.done || !operation.done)
|
|
279
|
+
throw new RepositoryStoreError("stored canonical history rows are invalid");
|
|
280
|
+
}
|
|
281
|
+
finally {
|
|
282
|
+
parents.return?.();
|
|
283
|
+
operations.return?.();
|
|
284
|
+
}
|
|
285
|
+
let head = workspaceHeadIn(database, repositoryId);
|
|
286
|
+
const seen = new Set();
|
|
287
|
+
const reachable = [];
|
|
288
|
+
while (head !== null) {
|
|
289
|
+
const commit = commits.get(head);
|
|
290
|
+
if (!commit || seen.has(head))
|
|
291
|
+
throw new RepositoryStoreError("repository canonical head chain is invalid");
|
|
292
|
+
seen.add(head);
|
|
293
|
+
reachable.push(commit);
|
|
294
|
+
head = commit.parentCommitId;
|
|
295
|
+
}
|
|
296
|
+
checkCurrentValues(database, repositoryId, reachable.reverse(), latestByCommit, loadAggregate);
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=history-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-validation.js","sourceRoot":"","sources":["../../../src/local/store/history-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAgC,MAAM,2BAA2B,CAAC;AAE5G,MAAM,cAAc,GAAG;IACrB,CAAC,+BAA+B,EAAE,SAAS,EAAE,WAAW,CAA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,GAAuB,EAAE,CAAC;IACzC,OAAO,IAAI,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,oBAAoB,CAAC,4CAA4C,CAAC,CAAC;QAC5G,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC;IAC/B,CAAC;IACD,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,OAAO,EAAE,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { parseArtifactProperties } from "../domain/models/artifact-properties.js";
|
|
3
|
+
import { canonicalBytes } from "../domain/models/encoding.js";
|
|
4
|
+
import { LatestValueWrite } from "./contract.js";
|
|
5
|
+
import { RepositoryStoreError } from "./sqlite/errors.js";
|
|
6
|
+
export function latestValueWrites(commit, rawWrites) {
|
|
7
|
+
const expected = [];
|
|
8
|
+
const optionalArtifactIds = new Set();
|
|
9
|
+
const propertiesUpdates = new Set();
|
|
10
|
+
for (const operation of commit.operations) {
|
|
11
|
+
if (operation.type === "artifact.properties.set.v1") {
|
|
12
|
+
const artifactId = operation.payload.artifact_id;
|
|
13
|
+
if (typeof artifactId !== "string")
|
|
14
|
+
throw new RepositoryStoreError("latest value operation is invalid");
|
|
15
|
+
propertiesUpdates.add(artifactId);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
for (const operation of commit.operations) {
|
|
19
|
+
const payload = operation.payload;
|
|
20
|
+
let ownerType;
|
|
21
|
+
let ownerId;
|
|
22
|
+
let field = payload.field;
|
|
23
|
+
let digest;
|
|
24
|
+
switch (operation.type) {
|
|
25
|
+
case "node.field.set.v1":
|
|
26
|
+
ownerType = "node";
|
|
27
|
+
ownerId = payload.node_id;
|
|
28
|
+
digest = payload.new_digest;
|
|
29
|
+
break;
|
|
30
|
+
case "edge.add.v1":
|
|
31
|
+
ownerType = "edge";
|
|
32
|
+
ownerId = payload.edge_id;
|
|
33
|
+
field = "content";
|
|
34
|
+
digest = payload.content_digest;
|
|
35
|
+
break;
|
|
36
|
+
case "edge.field.set.v1":
|
|
37
|
+
ownerType = "edge";
|
|
38
|
+
ownerId = payload.edge_id;
|
|
39
|
+
digest = payload.new_digest;
|
|
40
|
+
break;
|
|
41
|
+
case "artifact.metadata.set.v1":
|
|
42
|
+
ownerType = "artifact";
|
|
43
|
+
ownerId = payload.artifact_id;
|
|
44
|
+
digest = payload.new_digest;
|
|
45
|
+
break;
|
|
46
|
+
case "artifact.properties.set.v1":
|
|
47
|
+
ownerType = "artifact";
|
|
48
|
+
ownerId = payload.artifact_id;
|
|
49
|
+
field = "properties";
|
|
50
|
+
digest = payload.new_digest;
|
|
51
|
+
break;
|
|
52
|
+
case "artifact.attach.v1":
|
|
53
|
+
case "artifact.attach.v2":
|
|
54
|
+
if (typeof payload.artifact_id !== "string")
|
|
55
|
+
throw new RepositoryStoreError("latest value operation is invalid");
|
|
56
|
+
if (!propertiesUpdates.has(payload.artifact_id))
|
|
57
|
+
optionalArtifactIds.add(payload.artifact_id);
|
|
58
|
+
continue;
|
|
59
|
+
default: continue;
|
|
60
|
+
}
|
|
61
|
+
if (typeof ownerId !== "string" || typeof field !== "string" || typeof digest !== "string") {
|
|
62
|
+
throw new RepositoryStoreError("latest value operation is invalid");
|
|
63
|
+
}
|
|
64
|
+
expected.push({ key: JSON.stringify([ownerType, ownerId, field]), digest });
|
|
65
|
+
}
|
|
66
|
+
let writes;
|
|
67
|
+
try {
|
|
68
|
+
writes = rawWrites.map(raw => LatestValueWrite.fromCanonicalBytes(raw));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new RepositoryStoreError("latest value write is invalid", { cause: error });
|
|
72
|
+
}
|
|
73
|
+
const result = new Map();
|
|
74
|
+
let index = 0;
|
|
75
|
+
for (const write of writes) {
|
|
76
|
+
const key = JSON.stringify(write.key);
|
|
77
|
+
if (!(write.ownerType === "artifact" && optionalArtifactIds.has(write.ownerId))) {
|
|
78
|
+
const required = expected[index++];
|
|
79
|
+
if (!required || key !== required.key || write.valueDigest !== required.digest) {
|
|
80
|
+
throw new RepositoryStoreError("latest value writes do not match canonical field operations");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
result.set(key, write);
|
|
84
|
+
}
|
|
85
|
+
if (index !== expected.length)
|
|
86
|
+
throw new RepositoryStoreError("latest value writes do not match canonical field operations");
|
|
87
|
+
for (const operation of commit.operations) {
|
|
88
|
+
const artifactId = operation.payload.artifact_id;
|
|
89
|
+
if (typeof artifactId !== "string")
|
|
90
|
+
continue;
|
|
91
|
+
if (operation.type === "artifact.attach.v1") {
|
|
92
|
+
const metadata = {};
|
|
93
|
+
let found = false;
|
|
94
|
+
for (const write of writes) {
|
|
95
|
+
if (write.ownerType === "artifact" && write.ownerId === artifactId) {
|
|
96
|
+
metadata[write.field] = write.value;
|
|
97
|
+
found = true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (found && `sha256:${createHash("sha256").update(canonicalBytes(metadata)).digest("hex")}` !== operation.payload.metadata_digest) {
|
|
101
|
+
throw new RepositoryStoreError("artifact metadata digest does not match latest values");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (operation.type === "artifact.attach.v2" && !propertiesUpdates.has(artifactId)) {
|
|
105
|
+
const write = result.get(JSON.stringify(["artifact", artifactId, "properties"]));
|
|
106
|
+
if (write !== undefined) {
|
|
107
|
+
if (write.value === null || write.valueDigest !== operation.payload.properties_digest) {
|
|
108
|
+
throw new RepositoryStoreError("artifact properties digest does not match latest values");
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
parseArtifactProperties(write.value);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw new RepositoryStoreError("artifact properties are invalid", { cause: error });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=latest-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latest-values.js","sourceRoot":"","sources":["../../../src/local/store/latest-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,UAAU,iBAAiB,CAAC,MAAwB,EAAE,SAAgC;IAC1F,MAAM,QAAQ,GAA2C,EAAE,CAAC;IAC5D,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9C,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,SAAS,CAAC,IAAI,KAAK,4BAA4B,EAAE,CAAC;YACpD,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;YACjD,IAAI,OAAO,UAAU,KAAK,QAAQ;gBAAE,MAAM,IAAI,oBAAoB,CAAC,mCAAmC,CAAC,CAAC;YACxG,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,MAAM,OAAO,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AC,UAAU,CAAC,EAAE,CAAC;YAClF,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;YACjF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;oBACtF,MAAM,IAAI,oBAAoB,CAAC,yDAAyD,CAAC,CAAC;gBAC5F,CAAC;gBACD,IAAI,CAAC;oBACH,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,IAAI,oBAAoB,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;gBACtF,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { backupRepository } from "./backup/backup.js";
|
|
4
|
+
import { restoreRepositoryForMigration } from "./backup/restore.js";
|
|
5
|
+
import { applyForwardMigrations, readRepositoryIdentity, validateRepositoryAtVersion, } from "./migration/steps.js";
|
|
6
|
+
import { CURRENT_REPOSITORY_USER_VERSION, isPredecessorRepositoryUserVersion } from "./migration/versions.js";
|
|
7
|
+
import { validateRepositoryIdentity } from "./sqlite/verify.js";
|
|
8
|
+
import { RepositoryStoreError } from "./sqlite/errors.js";
|
|
9
|
+
import { reachableObjectDigestsIn } from "./gc.js";
|
|
10
|
+
function reachableObjectDigests(databasePath, repositoryId) {
|
|
11
|
+
let database;
|
|
12
|
+
try {
|
|
13
|
+
database = new DatabaseSync(databasePath, { allowExtension: false, defensive: true, readOnly: true });
|
|
14
|
+
return reachableObjectDigestsIn(database, repositoryId).map(digest => digest.slice("sha256:".length));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
throw new RepositoryStoreError("repository reachable object is unavailable", { cause: error });
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
database?.close();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Migrates the caller-held repository state with a verified predecessor archive before mutation. */
|
|
24
|
+
export async function migrateLocalRepository(state, options = {}) {
|
|
25
|
+
state.assertValid();
|
|
26
|
+
const databasePath = join(state.statePath, "db.sqlite");
|
|
27
|
+
const identity = readRepositoryIdentity(databasePath);
|
|
28
|
+
if (identity.userVersion > CURRENT_REPOSITORY_USER_VERSION)
|
|
29
|
+
throw new RepositoryStoreError("repository_schema_newer");
|
|
30
|
+
if (identity.userVersion === CURRENT_REPOSITORY_USER_VERSION) {
|
|
31
|
+
validateRepositoryIdentity(databasePath, identity.repositoryId);
|
|
32
|
+
return { repositoryId: identity.repositoryId, clientId: identity.clientId, migrated: false };
|
|
33
|
+
}
|
|
34
|
+
if (!isPredecessorRepositoryUserVersion(identity.userVersion))
|
|
35
|
+
throw new RepositoryStoreError("repository_schema_unsupported");
|
|
36
|
+
const predecessorVersion = identity.userVersion;
|
|
37
|
+
const validatePredecessor = (path, repositoryId) => {
|
|
38
|
+
validateRepositoryAtVersion(path, repositoryId, predecessorVersion);
|
|
39
|
+
};
|
|
40
|
+
const backupDirectory = options.migrationBackupDirectory ?? join(dirname(state.rootPath), ".flywheel-migration-backups");
|
|
41
|
+
const archive = join(backupDirectory, `${identity.repositoryId}-v${predecessorVersion}-to-v${CURRENT_REPOSITORY_USER_VERSION}.flywheel-backup.zip`);
|
|
42
|
+
const reachable = reachableObjectDigests(databasePath, identity.repositoryId);
|
|
43
|
+
await backupRepository({
|
|
44
|
+
state,
|
|
45
|
+
repositoryId: identity.repositoryId,
|
|
46
|
+
reachableObjectDigests: () => reachable,
|
|
47
|
+
validateSnapshot: validatePredecessor,
|
|
48
|
+
}, archive, { force: true });
|
|
49
|
+
try {
|
|
50
|
+
applyForwardMigrations(databasePath, predecessorVersion);
|
|
51
|
+
validateRepositoryIdentity(databasePath, identity.repositoryId);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
try {
|
|
55
|
+
await restoreRepositoryForMigration(archive, state, {
|
|
56
|
+
expectedRepositoryId: identity.repositoryId,
|
|
57
|
+
validateSnapshot: validatePredecessor,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (restoreError) {
|
|
61
|
+
throw new RepositoryStoreError("repository_migration_failed", { cause: restoreError });
|
|
62
|
+
}
|
|
63
|
+
if (error instanceof RepositoryStoreError && error.message === "repository_migration_staged_values_unavailable")
|
|
64
|
+
throw error;
|
|
65
|
+
throw new RepositoryStoreError("repository_migration_failed", { cause: error });
|
|
66
|
+
}
|
|
67
|
+
return { repositoryId: identity.repositoryId, clientId: identity.clientId, migrated: true };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/local/store/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,oBA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mBAAmB;aACtC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,oBAAoB,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,KAAK,YAAY,oBAAoB,IAAI,KAAK,CAAC,OAAO,KAAK,gDAAgD;YAAE,MAAM,KAAK,CAAC;QAC7H,MAAM,IAAI,oBAAoB,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RepositoryCommit } from "../../domain/models/commits.js";
|
|
2
|
+
import { parseImportedArtifactProperties, } from "../../domain/models/imported-artifact-properties.js";
|
|
3
|
+
import { isDigest } from "../../domain/models/constants.js";
|
|
4
|
+
import { RepositoryStoreError } from "../sqlite/errors.js";
|
|
5
|
+
/** Returns the complete authenticated baseline inventory, independent of mutable artifact rows. */
|
|
6
|
+
export function importedBaselineArtifactInventory(database, repositoryId, createdByCommitId, loadAggregate) {
|
|
7
|
+
const commitRow = database.prepare("SELECT canonical_bytes FROM repository_commits WHERE repository_id = ? AND commit_id = ?")
|
|
8
|
+
.get(repositoryId, createdByCommitId);
|
|
9
|
+
if (!(commitRow?.canonical_bytes instanceof Uint8Array))
|
|
10
|
+
throw new RepositoryStoreError("repository artifact provenance commit is invalid");
|
|
11
|
+
let commit;
|
|
12
|
+
try {
|
|
13
|
+
commit = RepositoryCommit.fromCanonicalBytes(createdByCommitId, commitRow.canonical_bytes);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw new RepositoryStoreError("repository artifact provenance commit is invalid", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
if (commit.parentCommitId !== null || commit.operations.length !== 1 || commit.operations[0].type !== "imported_baseline.v1")
|
|
19
|
+
return undefined;
|
|
20
|
+
const aggregateDigest = commit.operations[0].payload.aggregate_digest;
|
|
21
|
+
if (!isDigest(aggregateDigest))
|
|
22
|
+
throw new RepositoryStoreError("repository artifact provenance operation is invalid");
|
|
23
|
+
let raw;
|
|
24
|
+
try {
|
|
25
|
+
raw = loadAggregate(aggregateDigest);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new RepositoryStoreError("repository artifact provenance source is unavailable", { cause: error });
|
|
29
|
+
}
|
|
30
|
+
if (raw === undefined)
|
|
31
|
+
throw new RepositoryStoreError("repository artifact provenance source is unavailable");
|
|
32
|
+
try {
|
|
33
|
+
return parseImportedArtifactProperties(repositoryId, aggregateDigest, raw);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw new RepositoryStoreError("repository artifact provenance source is invalid", { cause: error });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function importedBaselineArtifactProperties(database, repositoryId, artifactId, objectDigest, createdByCommitId, loadAggregate) {
|
|
40
|
+
const inventory = importedBaselineArtifactInventory(database, repositoryId, createdByCommitId, loadAggregate);
|
|
41
|
+
if (inventory === undefined)
|
|
42
|
+
return undefined;
|
|
43
|
+
const artifact = inventory.get(artifactId);
|
|
44
|
+
if (artifact === undefined || artifact.objectDigest !== objectDigest) {
|
|
45
|
+
throw new RepositoryStoreError("repository artifact provenance is incomplete");
|
|
46
|
+
}
|
|
47
|
+
return artifact.properties;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../../../../src/local/store/migration/provenance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,+BAA+B,GAE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