@highstate/backend 0.9.18 → 0.9.19
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/dist/chunk-5WVU2AK4.js +1535 -0
- package/dist/chunk-5WVU2AK4.js.map +1 -0
- package/dist/{chunk-OU5OQBLB.js → chunk-I7BWSAN6.js} +3 -28
- package/dist/{chunk-OU5OQBLB.js.map → chunk-I7BWSAN6.js.map} +1 -1
- package/dist/chunk-VB4YL327.js +139 -0
- package/dist/chunk-VB4YL327.js.map +1 -0
- package/dist/database/local/prisma.config.js +26 -0
- package/dist/database/local/prisma.config.js.map +1 -0
- package/dist/highstate.manifest.json +2 -1
- package/dist/index.js +7587 -7291
- package/dist/index.js.map +1 -1
- package/dist/library/package-resolution-worker.js +1 -1
- package/dist/library/package-resolution-worker.js.map +1 -1
- package/dist/library/worker/main.js +35 -29
- package/dist/library/worker/main.js.map +1 -1
- package/dist/shared/index.js +2 -2
- package/package.json +18 -9
- package/prisma/backend/_schema/layout.prisma +7 -0
- package/prisma/backend/_schema/library.prisma +17 -0
- package/prisma/backend/_schema/project.prisma +101 -0
- package/prisma/backend/_schema/pulumi.prisma +17 -0
- package/prisma/backend/postgresql/main.prisma +17 -0
- package/prisma/backend/sqlite/main.prisma +17 -0
- package/prisma/backend/sqlite/migrations/20250817070609_initiial/migration.sql +34 -0
- package/prisma/backend/sqlite/migrations/20250817104948_add_fields/migration.sql +59 -0
- package/prisma/backend/sqlite/migrations/20250818082732_add_models/migration.sql +41 -0
- package/prisma/backend/sqlite/migrations/20250818083106_a/migration.sql +19 -0
- package/prisma/backend/sqlite/migrations/20250818101945_hi/migration.sql +1 -0
- package/prisma/backend/sqlite/migrations/20250819082315_a/migration.sql +5 -0
- package/prisma/backend/sqlite/migrations/migration_lock.toml +3 -0
- package/prisma/project/api-key.prisma +27 -0
- package/prisma/project/artifact.prisma +52 -0
- package/prisma/project/custom-status.prisma +46 -0
- package/prisma/project/evaluation.prisma +35 -0
- package/prisma/project/instance.prisma +160 -0
- package/prisma/project/layout.prisma +23 -0
- package/prisma/project/lock.prisma +18 -0
- package/prisma/project/main.prisma +17 -0
- package/prisma/project/migrations/20250816081310_initial/migration.sql +300 -0
- package/prisma/project/migrations/20250816082523_test/migration.sql +72 -0
- package/prisma/project/migrations/20250818065643_update/migration.sql +42 -0
- package/prisma/project/migrations/20250818070758_a/migration.sql +8 -0
- package/prisma/project/migrations/20250818070913_a/migration.sql +8 -0
- package/prisma/project/migrations/20250818082720_add_motels/migration.sql +11 -0
- package/prisma/project/migrations/20250818112523_hello/migration.sql +35 -0
- package/prisma/project/migrations/20250819082305_a/migration.sql +14 -0
- package/prisma/project/migrations/20250819165004_add_missing_fields/migration.sql +216 -0
- package/prisma/project/migrations/20250819171309_a/migration.sql +22 -0
- package/prisma/project/migrations/20250820113949_a/migration.sql +66 -0
- package/prisma/project/migrations/20250820144256_b/migration.sql +31 -0
- package/prisma/project/migrations/20250820145547_a/migration.sql +24 -0
- package/prisma/project/migrations/20250820182517_b/migration.sql +2 -0
- package/prisma/project/migrations/20250821172324_a/migration.sql +2 -0
- package/prisma/project/migrations/20250822081339_a/migration.sql +219 -0
- package/prisma/project/migrations/20250822083742_b/migration.sql +1 -0
- package/prisma/project/migrations/20250822105134_boom/migration.sql +1 -0
- package/prisma/project/migrations/20250822141028_b/migration.sql +1 -0
- package/prisma/project/migrations/20250822142342_b/migration.sql +16 -0
- package/prisma/project/migrations/20250824072720_a/migration.sql +1 -0
- package/prisma/project/migrations/20250824093656_b/migration.sql +21 -0
- package/prisma/project/migrations/20250825082518_a/migration.sql +1 -0
- package/prisma/project/migrations/20250825085343_b/migration.sql +1 -0
- package/prisma/project/migrations/20250825091312_a/migration.sql +1 -0
- package/prisma/project/migrations/20250903095431_hi/migration.sql +44 -0
- package/prisma/project/migrations/20250903174255_a/migration.sql +24 -0
- package/prisma/project/migrations/20250908095205_hi/migration.sql +18 -0
- package/prisma/project/migrations/20250909155857_hi/migration.sql +15 -0
- package/prisma/project/migrations/migration_lock.toml +3 -0
- package/prisma/project/model.prisma +37 -0
- package/prisma/project/operation.prisma +148 -0
- package/prisma/project/page.prisma +41 -0
- package/prisma/project/secret.prisma +42 -0
- package/prisma/project/service-account.prisma +36 -0
- package/prisma/project/terminal.prisma +90 -0
- package/prisma/project/trigger.prisma +31 -0
- package/prisma/project/unlock-method.prisma +32 -0
- package/prisma/project/worker.prisma +138 -0
- package/src/artifact/abstractions.ts +13 -13
- package/src/artifact/encryption.ts +30 -54
- package/src/artifact/factory.ts +6 -9
- package/src/artifact/local.ts +33 -46
- package/src/business/api-key.ts +24 -36
- package/src/business/artifact.test.ts +978 -0
- package/src/business/artifact.ts +136 -216
- package/src/business/evaluation.ts +328 -0
- package/src/business/index.ts +5 -2
- package/src/business/instance-lock.test.ts +1060 -0
- package/src/business/instance-lock.ts +387 -78
- package/src/business/instance-state.test.ts +735 -0
- package/src/business/instance-state.ts +582 -337
- package/src/business/operation.test.ts +439 -0
- package/src/business/operation.ts +174 -208
- package/src/business/project-model.ts +258 -0
- package/src/business/project-unlock.ts +168 -126
- package/src/business/project.ts +287 -179
- package/src/business/secret.test.ts +465 -130
- package/src/business/secret.ts +186 -217
- package/src/business/settings.test.ts +695 -0
- package/src/business/settings.ts +855 -0
- package/src/business/terminal-session.ts +90 -0
- package/src/business/unit-extra.test.ts +539 -0
- package/src/business/unit-extra.ts +160 -0
- package/src/business/worker.test.ts +356 -579
- package/src/business/worker.ts +238 -339
- package/src/common/codebase.ts +65 -0
- package/src/common/index.ts +3 -5
- package/src/common/logger.ts +5 -0
- package/src/common/utils.ts +4 -3
- package/src/config.ts +10 -11
- package/src/database/_generated/backend/postgresql/client.ts +72 -0
- package/src/database/_generated/backend/postgresql/commonInputTypes.ts +350 -0
- package/src/database/_generated/backend/postgresql/enums.ts +13 -0
- package/src/database/_generated/backend/postgresql/internal/class.ts +320 -0
- package/src/database/_generated/backend/postgresql/internal/prismaNamespace.ts +1238 -0
- package/src/database/_generated/backend/postgresql/models/Library.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/Project.ts +2175 -0
- package/src/database/_generated/backend/postgresql/models/ProjectModelStorage.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/ProjectSpace.ts +1602 -0
- package/src/database/_generated/backend/postgresql/models/PulumiBackend.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/UserWorkspaseLayout.ts +1065 -0
- package/src/database/_generated/backend/postgresql/models.ts +16 -0
- package/src/database/_generated/backend/postgresql/pjtg.ts +182 -0
- package/src/database/_generated/backend/sqlite/client.ts +72 -0
- package/src/database/_generated/backend/sqlite/commonInputTypes.ts +331 -0
- package/src/database/_generated/backend/sqlite/enums.ts +13 -0
- package/src/database/_generated/backend/sqlite/internal/class.ts +318 -0
- package/src/database/_generated/backend/sqlite/internal/prismaNamespace.ts +1207 -0
- package/src/database/_generated/backend/sqlite/models/Library.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/Project.ts +2169 -0
- package/src/database/_generated/backend/sqlite/models/ProjectModelStorage.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/ProjectSpace.ts +1599 -0
- package/src/database/_generated/backend/sqlite/models/PulumiBackend.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/UserWorkspaseLayout.ts +1063 -0
- package/src/database/_generated/backend/sqlite/models.ts +16 -0
- package/src/database/_generated/backend/sqlite/pjtg.ts +182 -0
- package/src/database/_generated/project/client.ts +204 -0
- package/src/database/_generated/project/commonInputTypes.ts +827 -0
- package/src/database/_generated/project/enums.ts +104 -0
- package/src/database/_generated/project/internal/class.ts +479 -0
- package/src/database/_generated/project/internal/prismaNamespace.ts +2974 -0
- package/src/database/_generated/project/models/ApiKey.ts +1506 -0
- package/src/database/_generated/project/models/Artifact.ts +2051 -0
- package/src/database/_generated/project/models/HubModel.ts +1125 -0
- package/src/database/_generated/project/models/InstanceCustomStatus.ts +1713 -0
- package/src/database/_generated/project/models/InstanceEvaluationState.ts +1312 -0
- package/src/database/_generated/project/models/InstanceLock.ts +1268 -0
- package/src/database/_generated/project/models/InstanceModel.ts +1125 -0
- package/src/database/_generated/project/models/InstanceOperationState.ts +1707 -0
- package/src/database/_generated/project/models/InstanceState.ts +4613 -0
- package/src/database/_generated/project/models/Operation.ts +1647 -0
- package/src/database/_generated/project/models/OperationLog.ts +1455 -0
- package/src/database/_generated/project/models/Page.ts +1838 -0
- package/src/database/_generated/project/models/Secret.ts +1692 -0
- package/src/database/_generated/project/models/ServiceAccount.ts +2165 -0
- package/src/database/_generated/project/models/Terminal.ts +2038 -0
- package/src/database/_generated/project/models/TerminalSession.ts +1454 -0
- package/src/database/_generated/project/models/TerminalSessionLog.ts +1280 -0
- package/src/database/_generated/project/models/Trigger.ts +1430 -0
- package/src/database/_generated/project/models/UnlockMethod.ts +1220 -0
- package/src/database/_generated/project/models/UserCompositeViewport.ts +1280 -0
- package/src/database/_generated/project/models/UserProjectViewport.ts +1059 -0
- package/src/database/_generated/project/models/Worker.ts +1459 -0
- package/src/database/_generated/project/models/WorkerUnitRegistration.ts +1524 -0
- package/src/database/_generated/project/models/WorkerVersion.ts +1974 -0
- package/src/database/_generated/project/models/WorkerVersionLog.ts +1318 -0
- package/src/database/_generated/project/models.ts +35 -0
- package/src/database/_generated/project/pjtg.ts +182 -0
- package/src/database/abstractions.ts +19 -0
- package/src/database/factory.ts +37 -0
- package/src/database/index.ts +6 -0
- package/src/database/local/backend.ts +134 -0
- package/src/database/local/index.ts +3 -0
- package/src/database/local/meta.ts +46 -0
- package/src/database/local/prisma.config.ts +25 -0
- package/src/database/local/project.ts +39 -0
- package/src/database/manager.ts +181 -0
- package/src/database/migrate.ts +35 -0
- package/src/database/prisma.ts +56 -0
- package/src/database/well-known.ts +38 -0
- package/src/index.ts +4 -4
- package/src/library/abstractions.ts +3 -5
- package/src/library/factory.ts +1 -1
- package/src/library/local.ts +81 -26
- package/src/library/package-resolution-worker.ts +1 -1
- package/src/library/worker/evaluator.ts +40 -23
- package/src/library/worker/loader.lite.ts +1 -1
- package/src/library/worker/main.ts +3 -10
- package/src/library/worker/protocol.ts +0 -1
- package/src/lock/index.ts +0 -1
- package/src/lock/manager.ts +0 -10
- package/src/orchestrator/manager.ts +190 -104
- package/src/orchestrator/operation-context.ts +357 -0
- package/src/orchestrator/operation-plan.destroy.test.md +357 -0
- package/src/orchestrator/operation-plan.destroy.test.ts +775 -0
- package/src/orchestrator/operation-plan.fixtures.ts +213 -0
- package/src/orchestrator/operation-plan.md +198 -0
- package/src/orchestrator/operation-plan.refresh.test.md +199 -0
- package/src/orchestrator/operation-plan.refresh.test.ts +367 -0
- package/src/orchestrator/operation-plan.ts +709 -0
- package/src/orchestrator/operation-plan.update.test.md +485 -0
- package/src/orchestrator/operation-plan.update.test.ts +1066 -0
- package/src/orchestrator/operation-workset.ts +233 -578
- package/src/orchestrator/operation.ts +435 -948
- package/src/orchestrator/plan-test-builder.ts +267 -0
- package/src/project-model/abstractions.ts +118 -0
- package/src/project-model/backends/codebase.ts +365 -0
- package/src/project-model/backends/database.ts +440 -0
- package/src/project-model/errors.ts +81 -0
- package/src/project-model/factory.ts +24 -0
- package/src/project-model/index.ts +4 -0
- package/src/project-model/utils.test.ts +544 -0
- package/src/project-model/utils.ts +242 -0
- package/src/pubsub/abstractions.ts +10 -1
- package/src/pubsub/factory.ts +4 -4
- package/src/pubsub/index.ts +1 -0
- package/src/pubsub/manager.ts +29 -13
- package/src/pubsub/memory.ts +31 -0
- package/src/runner/abstractions.ts +33 -41
- package/src/runner/artifact-env.ts +19 -8
- package/src/runner/factory.ts +6 -6
- package/src/runner/force-abort.ts +3 -6
- package/src/runner/local.ts +64 -67
- package/src/runner/pulumi.ts +23 -63
- package/src/services.ts +181 -123
- package/src/shared/models/backend/index.ts +3 -1
- package/src/shared/models/backend/library.ts +9 -1
- package/src/shared/models/backend/project.ts +43 -42
- package/src/shared/models/backend/pulumi.ts +14 -0
- package/src/shared/models/backend/unlock-method.ts +1 -1
- package/src/shared/models/backend/well-known.ts +58 -0
- package/src/shared/models/base.ts +40 -26
- package/src/shared/models/errors.ts +82 -1
- package/src/shared/models/index.ts +3 -2
- package/src/shared/models/prisma.ts +36 -0
- package/src/shared/models/project/api-key.ts +37 -59
- package/src/shared/models/project/artifact.ts +16 -76
- package/src/shared/models/project/custom-status.ts +12 -0
- package/src/shared/models/project/index.ts +8 -7
- package/src/shared/models/project/lock.ts +10 -78
- package/src/shared/models/project/model.ts +19 -1
- package/src/shared/models/project/operation.ts +222 -99
- package/src/shared/models/project/page.ts +37 -48
- package/src/shared/models/project/secret.ts +29 -89
- package/src/shared/models/project/service-account.ts +12 -17
- package/src/shared/models/project/state.ts +100 -407
- package/src/shared/models/project/terminal.ts +75 -88
- package/src/shared/models/project/trigger.ts +13 -49
- package/src/shared/models/project/unlock-method.ts +20 -26
- package/src/shared/models/project/worker.ts +89 -90
- package/src/shared/resolvers/graph-resolver.ts +21 -0
- package/src/shared/resolvers/index.ts +1 -1
- package/src/shared/resolvers/input-hash.ts +24 -14
- package/src/shared/resolvers/input.ts +1 -1
- package/src/shared/resolvers/registry.ts +5 -4
- package/src/shared/resolvers/state.ts +12 -1
- package/src/shared/resolvers/validation.ts +7 -3
- package/src/shared/utils/index.ts +1 -2
- package/src/shared/utils/promise-tracker.ts +30 -3
- package/src/terminal/abstractions.ts +1 -1
- package/src/terminal/docker.ts +3 -3
- package/src/terminal/manager.ts +102 -118
- package/src/test-utils/database.ts +119 -0
- package/src/test-utils/index.ts +2 -0
- package/src/test-utils/services.ts +134 -0
- package/src/unlock/abstractions.ts +5 -23
- package/src/unlock/memory.ts +9 -14
- package/src/worker/abstractions.ts +7 -4
- package/src/worker/docker.ts +14 -19
- package/src/worker/manager.ts +366 -97
- package/dist/chunk-NAAIDR4U.js +0 -8499
- package/dist/chunk-NAAIDR4U.js.map +0 -1
- package/dist/chunk-Y7DXREVO.js +0 -1745
- package/dist/chunk-Y7DXREVO.js.map +0 -1
- package/dist/magic-string.es-5ABAC4JN.js +0 -1292
- package/dist/magic-string.es-5ABAC4JN.js.map +0 -1
- package/src/business/__traces__/secret/update-instance-secrets/create-and-delete-secrets-simultaneously.md +0 -356
- package/src/business/__traces__/secret/update-instance-secrets/create-new-secrets-for-instance.md +0 -274
- package/src/business/__traces__/secret/update-instance-secrets/delete-existing-secrets.md +0 -223
- package/src/business/__traces__/secret/update-instance-secrets/no-op-when-no-changes.md +0 -147
- package/src/business/__traces__/secret/update-instance-secrets/update-existing-secrets.md +0 -280
- package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration-when-other-exists.md +0 -360
- package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration.md +0 -215
- package/src/business/__traces__/worker/update-unit-registrations/create-multiple-workers-with-different-identities.md +0 -427
- package/src/business/__traces__/worker/update-unit-registrations/handle-nonexistent-registration-id-gracefully.md +0 -217
- package/src/business/__traces__/worker/update-unit-registrations/no-op-when-no-changes.md +0 -132
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-changes.md +0 -454
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-version-changes.md +0 -426
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-with-same-identity-reuses-service-account.md +0 -372
- package/src/business/__traces__/worker/update-unit-registrations/remove-one-of-multiple-unit-registrations.md +0 -383
- package/src/business/__traces__/worker/update-unit-registrations/remove-unit-registration.md +0 -245
- package/src/business/__traces__/worker/update-unit-registrations/update-existing-unit-registration-when-params-change.md +0 -174
- package/src/business/__traces__/worker/update-unit-registrations/update-params-and-image-simultaneously.md +0 -432
- package/src/business/__traces__/worker/update-unit-registrations/worker-with-multiple-registrations-not-deleted-when-one-removed.md +0 -220
- package/src/business/backend-unlock.ts +0 -10
- package/src/common/clock.ts +0 -18
- package/src/common/performance.ts +0 -44
- package/src/common/random.ts +0 -68
- package/src/common/test/index.ts +0 -2
- package/src/common/test/render.ts +0 -98
- package/src/common/test/tracer.ts +0 -359
- package/src/hotstate/abstractions.ts +0 -48
- package/src/hotstate/factory.ts +0 -17
- package/src/hotstate/index.ts +0 -3
- package/src/hotstate/manager.ts +0 -192
- package/src/hotstate/memory.ts +0 -100
- package/src/hotstate/validation.ts +0 -100
- package/src/lock/test.ts +0 -108
- package/src/project/abstractions.ts +0 -78
- package/src/project/evaluation.ts +0 -248
- package/src/project/factory.ts +0 -11
- package/src/project/index.ts +0 -3
- package/src/project/local.ts +0 -417
- package/src/pubsub/local.ts +0 -36
- package/src/pubsub/validation.ts +0 -33
- package/src/shared/utils/args.ts +0 -25
- package/src/state/abstractions.ts +0 -289
- package/src/state/encryption.ts +0 -98
- package/src/state/factory.ts +0 -20
- package/src/state/index.ts +0 -7
- package/src/state/local/backend.ts +0 -106
- package/src/state/local/collection.ts +0 -361
- package/src/state/local/index.ts +0 -2
- package/src/state/manager.ts +0 -890
- package/src/state/memory/backend.ts +0 -70
- package/src/state/memory/collection.ts +0 -270
- package/src/state/memory/index.ts +0 -2
- package/src/state/repository/index.ts +0 -2
- package/src/state/repository/repository.index.ts +0 -193
- package/src/state/repository/repository.ts +0 -507
- package/src/state/test.ts +0 -457
- /package/src/{state → database/local}/keyring.ts +0 -0
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# Update Phase Examples
|
|
2
|
+
|
|
3
|
+
**Legend:**
|
|
4
|
+
|
|
5
|
+
- `✅` = Up-to-date instance
|
|
6
|
+
- `≠` = Out-of-date instance
|
|
7
|
+
- `∅` = Non-deployed instance
|
|
8
|
+
- `❌` = Error instance
|
|
9
|
+
- `🚀` = Explicitly requested instance
|
|
10
|
+
- `👻` = Ghost instance (virtual)
|
|
11
|
+
|
|
12
|
+
### Example 1: Simple Dependency Chain
|
|
13
|
+
|
|
14
|
+
**Test**: `should include out-of-date dependencies in linear chain`
|
|
15
|
+
|
|
16
|
+
```mermaid
|
|
17
|
+
graph RL
|
|
18
|
+
A["A ✅"]
|
|
19
|
+
B["B ≠"]
|
|
20
|
+
C["C 🚀"]
|
|
21
|
+
|
|
22
|
+
C --> B --> A
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Decision Steps**:
|
|
26
|
+
|
|
27
|
+
1. `C` explicitly requested;
|
|
28
|
+
2. `C` depends on `B`, `B` is outdated → `B` included;
|
|
29
|
+
3. `B` depends on `A`, `A` is up-to-date → `A` excluded.
|
|
30
|
+
|
|
31
|
+
**Update Phase**: `B`, `C`
|
|
32
|
+
|
|
33
|
+
### Example 2: Composite Boundary Isolation
|
|
34
|
+
|
|
35
|
+
**Test**: `should not propagate beyond compositional inclusion`
|
|
36
|
+
|
|
37
|
+
```mermaid
|
|
38
|
+
graph RL
|
|
39
|
+
subgraph GrandParent
|
|
40
|
+
subgraph Parent
|
|
41
|
+
A["A ≠"]
|
|
42
|
+
end
|
|
43
|
+
B["B 🚀"]
|
|
44
|
+
C["C ≠"]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
B --> A
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Decision Steps**:
|
|
51
|
+
|
|
52
|
+
1. `B` explicitly requested;
|
|
53
|
+
2. `B` depends on `A`, `A` is outdated → `A` included;
|
|
54
|
+
3. `A` is child of `Parent` → `Parent` included (compositional);
|
|
55
|
+
4. `Parent` is child of `GrandParent` → `GrandParent` NOT included (compositional boundary);
|
|
56
|
+
5. `C` is sibling of `Parent`, `C` is outdated but `GrandParent` is not included → `C` NOT included.
|
|
57
|
+
|
|
58
|
+
**Update Phase**: `A`, `Parent`, `B`
|
|
59
|
+
|
|
60
|
+
### Example 3: Force Dependencies
|
|
61
|
+
|
|
62
|
+
**Test**: `should force all dependencies when flag enabled`
|
|
63
|
+
|
|
64
|
+
```mermaid
|
|
65
|
+
graph RL
|
|
66
|
+
A["A ✅"]
|
|
67
|
+
B["B ✅"]
|
|
68
|
+
C["C 🚀"]
|
|
69
|
+
|
|
70
|
+
C --> B --> A
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Options:**
|
|
74
|
+
|
|
75
|
+
- `forceUpdateDependencies`: `true`
|
|
76
|
+
|
|
77
|
+
**Decision Steps**:
|
|
78
|
+
|
|
79
|
+
1. `C` explicitly requested;
|
|
80
|
+
2. `C` depends on `B`, force flag enabled → `B` included;
|
|
81
|
+
3. `B` depends on `A`, force flag enabled → `A` included.
|
|
82
|
+
|
|
83
|
+
**Update Phase**: `A`, `B`, `C`
|
|
84
|
+
|
|
85
|
+
### Example 4: Substantive Composite with Mixed Child States
|
|
86
|
+
|
|
87
|
+
**Test**: `should include outdated children of substantive composite`
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
graph RL
|
|
91
|
+
subgraph Parent["Parent 🚀"]
|
|
92
|
+
Child1["Child1 ≠"]
|
|
93
|
+
Child2["Child2 ∅"]
|
|
94
|
+
Child3["Child3 ✅"]
|
|
95
|
+
end
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Decision Steps**:
|
|
99
|
+
|
|
100
|
+
1. `Parent` explicitly requested (substantive composite);
|
|
101
|
+
2. `Child1` is child of substantive composite, outdated → `Child1` included;
|
|
102
|
+
3. `Child2` is child of substantive composite, outdated → `Child2` included;
|
|
103
|
+
4. `Child3` is child of substantive composite, up-to-date → `Child3` excluded.
|
|
104
|
+
|
|
105
|
+
**Update Phase**: `Child1`, `Child2`, `Parent`
|
|
106
|
+
|
|
107
|
+
### Example 5: Ghost Cleanup During Update
|
|
108
|
+
|
|
109
|
+
**Test**: `should cleanup ghost children during composite update`
|
|
110
|
+
|
|
111
|
+
```mermaid
|
|
112
|
+
graph RL
|
|
113
|
+
subgraph Parent["Parent 🚀"]
|
|
114
|
+
Child1["Child1 ✅"]
|
|
115
|
+
GhostChild["GhostChild 👻"]
|
|
116
|
+
end
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Decision Steps**:
|
|
120
|
+
|
|
121
|
+
1. `Parent` explicitly requested (substantive composite), but will not be added to update phase as all real children are up-to-date;
|
|
122
|
+
2. `GhostChild` is ghost child of `Parent` → `GhostChild` added to destroy phase;
|
|
123
|
+
3. `Parent` has destroyed children → `Parent` added to destroy phase.
|
|
124
|
+
|
|
125
|
+
**Destroy Phase**: `GhostChild`, `Parent`
|
|
126
|
+
|
|
127
|
+
### Example 6: Nested Composites with Mixed Updates
|
|
128
|
+
|
|
129
|
+
**Test**: `should handle complex nested hierarchy correctly`
|
|
130
|
+
|
|
131
|
+
```mermaid
|
|
132
|
+
graph RL
|
|
133
|
+
subgraph GrandParent["GrandParent 🚀"]
|
|
134
|
+
subgraph Parent1
|
|
135
|
+
Child1["Child1 ≠"]
|
|
136
|
+
Child2["Child2 ✅"]
|
|
137
|
+
end
|
|
138
|
+
subgraph Parent2
|
|
139
|
+
Child3["Child3 ✅"]
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
Child1 --> Child3
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Decision Steps**:
|
|
147
|
+
|
|
148
|
+
1. `GrandParent` explicitly requested (substantive composite);
|
|
149
|
+
2. `Child1` is child of substantive composite, outdated → `Child1` included;
|
|
150
|
+
3. `Child1` depends on `Child3`, `Child3` up-to-date → `Child3` excluded;
|
|
151
|
+
4. `Child1` is child of `Parent1` → `Parent1` included (compositional);
|
|
152
|
+
5. `Parent1` is child of `GrandParent` → already included.
|
|
153
|
+
|
|
154
|
+
**Update Phase**: `Child1`, `Parent1`, `GrandParent`
|
|
155
|
+
|
|
156
|
+
### Example 7: Request Child with Isolated Update
|
|
157
|
+
|
|
158
|
+
**Test**: `should not include siblings when child explicitly requested (isolated update)`
|
|
159
|
+
|
|
160
|
+
```mermaid
|
|
161
|
+
graph RL
|
|
162
|
+
subgraph Parent
|
|
163
|
+
Child1["Child1 🚀"]
|
|
164
|
+
Child2["Child2 ∅"]
|
|
165
|
+
Child3["Child3 ✅"]
|
|
166
|
+
end
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Decision Steps**:
|
|
170
|
+
|
|
171
|
+
1. `Child1` explicitly requested;
|
|
172
|
+
2. `Child1` is child of `Parent` → `Parent` included (compositional);
|
|
173
|
+
3. `Child2` is child of compositional composite → `Child2` NOT included (rule 3 doesn't apply);
|
|
174
|
+
4. `Child3` is child of compositional composite → `Child3` NOT included (rule 3 doesn't apply).
|
|
175
|
+
|
|
176
|
+
**Update Phase**: `Child1`, `Parent`
|
|
177
|
+
|
|
178
|
+
### Example 8: Force Children Flag
|
|
179
|
+
|
|
180
|
+
**Test**: `should force all children when flag enabled`
|
|
181
|
+
|
|
182
|
+
```mermaid
|
|
183
|
+
graph RL
|
|
184
|
+
subgraph Parent["Parent 🚀"]
|
|
185
|
+
Child1["Child1 ≠"]
|
|
186
|
+
Child2["Child2 ∅"]
|
|
187
|
+
Child3["Child3 ✅"]
|
|
188
|
+
end
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Options:**
|
|
192
|
+
|
|
193
|
+
- `forceUpdateChildren`: `true`
|
|
194
|
+
|
|
195
|
+
**Decision Steps**:
|
|
196
|
+
|
|
197
|
+
1. `Parent` explicitly requested (substantive composite);
|
|
198
|
+
2. `Child1` is child of substantive composite, force children enabled → `Child1` included;
|
|
199
|
+
3. `Child2` is child of substantive composite, force children enabled → `Child2` included;
|
|
200
|
+
4. `Child3` is child of substantive composite, force children enabled → `Child3` included.
|
|
201
|
+
|
|
202
|
+
**Update Phase**: `Child1`, `Child2`, `Child3`, `Parent`
|
|
203
|
+
|
|
204
|
+
### Example 9: Error State Recovery
|
|
205
|
+
|
|
206
|
+
**Test**: `should include instances with error status for recovery`
|
|
207
|
+
|
|
208
|
+
```mermaid
|
|
209
|
+
graph RL
|
|
210
|
+
A["A ✅"]
|
|
211
|
+
B["B ❌"]
|
|
212
|
+
C["C 🚀"]
|
|
213
|
+
|
|
214
|
+
C --> B --> A
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Decision Steps**:
|
|
218
|
+
|
|
219
|
+
1. `C` explicitly requested;
|
|
220
|
+
2. `C` depends on `B`, `B` is outdated (failed) → `B` included;
|
|
221
|
+
3. `B` depends on `A`, `A` is up-to-date → `A` excluded.
|
|
222
|
+
|
|
223
|
+
**Update Phase**: `B`, `C`
|
|
224
|
+
|
|
225
|
+
### Example 10: Cross-Composite Dependencies
|
|
226
|
+
|
|
227
|
+
**Test**: `should handle dependencies crossing composite boundaries`
|
|
228
|
+
|
|
229
|
+
```mermaid
|
|
230
|
+
graph RL
|
|
231
|
+
subgraph CompositeA
|
|
232
|
+
ChildA["ChildA ≠"]
|
|
233
|
+
end
|
|
234
|
+
subgraph CompositeB
|
|
235
|
+
ChildB["ChildB 🚀"]
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
ChildB --> ChildA
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Decision Steps**:
|
|
242
|
+
|
|
243
|
+
1. `ChildB` explicitly requested;
|
|
244
|
+
2. `ChildB` depends on `ChildA`, `ChildA` is outdated → `ChildA` included;
|
|
245
|
+
3. `ChildB` is child of `CompositeB` → `CompositeB` included (compositional);
|
|
246
|
+
4. `ChildA` is child of `CompositeA`, included due to external dependency → `CompositeA` included (substantive).
|
|
247
|
+
|
|
248
|
+
**Update Phase**: `ChildA`, `CompositeA`, `ChildB`, `CompositeB`
|
|
249
|
+
|
|
250
|
+
### Example 11: Unrelated Instance Isolation
|
|
251
|
+
|
|
252
|
+
**Test**: `should not include unrelated instances even if they depend on updated instance`
|
|
253
|
+
|
|
254
|
+
```mermaid
|
|
255
|
+
graph RL
|
|
256
|
+
subgraph Parent["Parent ✅"]
|
|
257
|
+
Child1["Child1 ≠"]
|
|
258
|
+
Child2["Child2 ✅"]
|
|
259
|
+
end
|
|
260
|
+
ExternalX["ExternalX ≠ 🚀"]
|
|
261
|
+
|
|
262
|
+
Child1 --> ExternalX
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Decision Steps**:
|
|
266
|
+
|
|
267
|
+
1. `ExternalX` explicitly requested;
|
|
268
|
+
2. no instances depend on `ExternalX` (`Child1` depends on `ExternalX`, not vice versa);
|
|
269
|
+
3. `Child1` is not explicitly requested, not a dependency of `ExternalX`, not a child of substantive composite;
|
|
270
|
+
4. `Parent` and its children remain unaffected.
|
|
271
|
+
|
|
272
|
+
**Update Phase**: `ExternalX`
|
|
273
|
+
|
|
274
|
+
### Example 12: Multiple Explicit Requests
|
|
275
|
+
|
|
276
|
+
**Test**: `should handle multiple explicit requests with overlapping dependencies`
|
|
277
|
+
|
|
278
|
+
```mermaid
|
|
279
|
+
graph RL
|
|
280
|
+
A["A 🚀"]
|
|
281
|
+
B["B ✅"]
|
|
282
|
+
C["C 🚀"]
|
|
283
|
+
|
|
284
|
+
C --> B --> A
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Decision Steps**:
|
|
288
|
+
|
|
289
|
+
1. `A` explicitly requested;
|
|
290
|
+
2. `C` explicitly requested;
|
|
291
|
+
3. `C` depends on `B`, `B` is up-to-date → `B` excluded;
|
|
292
|
+
4. `B` depends on `A`, `A` already included → no change.
|
|
293
|
+
|
|
294
|
+
**Update Phase**: `A`, `C`
|
|
295
|
+
|
|
296
|
+
### Example 13: Deep Nesting with Boundary Isolation
|
|
297
|
+
|
|
298
|
+
**Test**: `should isolate boundaries in deep composite hierarchies`
|
|
299
|
+
|
|
300
|
+
```mermaid
|
|
301
|
+
graph RL
|
|
302
|
+
subgraph GreatGrandParent
|
|
303
|
+
subgraph GrandParent
|
|
304
|
+
subgraph Parent
|
|
305
|
+
Child["Child 🚀"]
|
|
306
|
+
end
|
|
307
|
+
Uncle["Uncle ✅"]
|
|
308
|
+
end
|
|
309
|
+
GreatUncle["GreatUncle ✅"]
|
|
310
|
+
end
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Decision Steps**:
|
|
314
|
+
|
|
315
|
+
1. `Child` explicitly requested;
|
|
316
|
+
2. `Child` is child of `Parent` → `Parent` included (compositional);
|
|
317
|
+
3. `Parent` is child of `GrandParent` → `GrandParent` NOT included (compositional boundary);
|
|
318
|
+
4. `Uncle` and `GreatUncle` not affected.
|
|
319
|
+
|
|
320
|
+
**Update Phase**: `Child`, `Parent`
|
|
321
|
+
|
|
322
|
+
### Example 14: Mixed Force Flags
|
|
323
|
+
|
|
324
|
+
**Test**: `should handle both force flags enabled together`
|
|
325
|
+
|
|
326
|
+
```mermaid
|
|
327
|
+
graph RL
|
|
328
|
+
A["A ✅"]
|
|
329
|
+
B["B ✅"]
|
|
330
|
+
C["C 🚀"]
|
|
331
|
+
subgraph Parent["Parent ✅"]
|
|
332
|
+
Child1["Child1 ✅"]
|
|
333
|
+
Child2["Child2 ✅"]
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
C --> B --> A
|
|
337
|
+
C --> Child1
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Options:**
|
|
341
|
+
|
|
342
|
+
- `forceUpdateDependencies`: `true`
|
|
343
|
+
- `forceUpdateChildren`: `true`
|
|
344
|
+
|
|
345
|
+
**Decision Steps**:
|
|
346
|
+
|
|
347
|
+
1. `C` explicitly requested;
|
|
348
|
+
2. `C` depends on `B`, force dependencies enabled → `B` included;
|
|
349
|
+
3. `B` depends on `A`, force dependencies enabled → `A` included;
|
|
350
|
+
4. `C` depends on `Child1`, force dependencies enabled → `Child1` included;
|
|
351
|
+
5. `Child1` is child of `Parent` → `Parent` becomes substantive composite (has child included due to external dependency);
|
|
352
|
+
6. `Child2` is child of substantive composite, force children enabled → `Child2` included.
|
|
353
|
+
|
|
354
|
+
**Update Phase**: `A`, `B`, `Child1`, `Child2`, `Parent`, `C`
|
|
355
|
+
|
|
356
|
+
### Example 15: Diamond Dependency Pattern
|
|
357
|
+
|
|
358
|
+
**Test**: `should handle diamond dependency correctly`
|
|
359
|
+
|
|
360
|
+
```mermaid
|
|
361
|
+
graph RL
|
|
362
|
+
A["A ✅"]
|
|
363
|
+
B["B ≠"]
|
|
364
|
+
C["C ≠"]
|
|
365
|
+
D["D 🚀"]
|
|
366
|
+
|
|
367
|
+
D --> B
|
|
368
|
+
D --> C
|
|
369
|
+
B --> A
|
|
370
|
+
C --> A
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Decision Steps**:
|
|
374
|
+
|
|
375
|
+
1. `D` explicitly requested;
|
|
376
|
+
2. `D` depends on `B`, `B` is outdated → `B` included;
|
|
377
|
+
3. `D` depends on `C`, `C` is outdated → `C` included;
|
|
378
|
+
4. `B` depends on `A`, `A` is up-to-date → `A` excluded;
|
|
379
|
+
5. `C` depends on `A`, `A` is up-to-date → `A` excluded (already evaluated).
|
|
380
|
+
|
|
381
|
+
**Update Phase**: `B`, `C`, `D`
|
|
382
|
+
|
|
383
|
+
### Example 16: Mixed Ghost and Real Children
|
|
384
|
+
|
|
385
|
+
**Test**: `should handle composite with both ghost and real children`
|
|
386
|
+
|
|
387
|
+
```mermaid
|
|
388
|
+
graph RL
|
|
389
|
+
subgraph Parent["Parent 🚀"]
|
|
390
|
+
Child1["Child1 ≠"]
|
|
391
|
+
Child2["Child2 ✅"]
|
|
392
|
+
GhostChild["GhostChild 👻"]
|
|
393
|
+
end
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
**Decision Steps**:
|
|
397
|
+
|
|
398
|
+
1. `Parent` explicitly requested (substantive composite);
|
|
399
|
+
2. `Child1` is child of substantive composite, outdated → `Child1` included;
|
|
400
|
+
3. `Child2` is child of substantive composite, up-to-date → `Child2` excluded;
|
|
401
|
+
4. `GhostChild` is ghost child of `Parent` → `GhostChild` added to destroy phase;
|
|
402
|
+
5. `Parent` has destroyed children → `Parent` added to destroy phase.
|
|
403
|
+
|
|
404
|
+
**Update Phase**: `Child1`, `Parent`
|
|
405
|
+
|
|
406
|
+
**Destroy Phase**: `GhostChild`, `Parent`
|
|
407
|
+
|
|
408
|
+
### Example 17: Dependency Chain with Partial Update Disabled
|
|
409
|
+
|
|
410
|
+
**Test**: `should include dependency chain and force siblings when partial update disabled`
|
|
411
|
+
|
|
412
|
+
```mermaid
|
|
413
|
+
graph RL
|
|
414
|
+
subgraph Parent["Parent ✅"]
|
|
415
|
+
Child1["Child1 ≠"]
|
|
416
|
+
Child2["Child2 ≠"]
|
|
417
|
+
end
|
|
418
|
+
ExternalX["ExternalX 🚀"]
|
|
419
|
+
|
|
420
|
+
ExternalX --> Child1
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Decision Steps**:
|
|
424
|
+
|
|
425
|
+
1. `ExternalX` explicitly requested;
|
|
426
|
+
2. `ExternalX` depends on `Child1`, `Child1` is outdated → `Child1` included;
|
|
427
|
+
3. `Parent` has child included due to external dependency, so `Parent` becomes substantive composite;
|
|
428
|
+
4. `Child2` is child of substantive composite, outdated and partial update disabled → `Child2` included.
|
|
429
|
+
|
|
430
|
+
**Update Phase**: `Child1`, `Child2`, `Parent`, `ExternalX`
|
|
431
|
+
|
|
432
|
+
### Example 18: Dependency Chain with Partial Update Enabled
|
|
433
|
+
|
|
434
|
+
**Test**: `should include dependency chain without forcing siblings when partial update enabled`
|
|
435
|
+
|
|
436
|
+
```mermaid
|
|
437
|
+
graph RL
|
|
438
|
+
subgraph Parent["Parent ✅"]
|
|
439
|
+
Child1["Child1 ≠"]
|
|
440
|
+
Child2["Child2 ≠"]
|
|
441
|
+
end
|
|
442
|
+
ExternalX["ExternalX 🚀"]
|
|
443
|
+
|
|
444
|
+
ExternalX --> Child1
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Options:**
|
|
448
|
+
|
|
449
|
+
- `allowPartialCompositeInstanceUpdate`: `true`
|
|
450
|
+
|
|
451
|
+
**Decision Steps**:
|
|
452
|
+
|
|
453
|
+
1. `ExternalX` explicitly requested;
|
|
454
|
+
2. `ExternalX` depends on `Child1`, `Child1` is outdated → `Child1` included;
|
|
455
|
+
3. `Parent` has child included due to external dependency, so `Parent` becomes substantive composite;
|
|
456
|
+
4. `Child2` is child of substantive composite, outdated but partial update enabled → `Child2` excluded.
|
|
457
|
+
|
|
458
|
+
**Update Phase**: `Child1`, `Parent`, `ExternalX`
|
|
459
|
+
|
|
460
|
+
### Example 19: Child Dependencies with Compositional Parent
|
|
461
|
+
|
|
462
|
+
**Test**: `should include child dependencies when child explicitly requested`
|
|
463
|
+
|
|
464
|
+
```mermaid
|
|
465
|
+
graph RL
|
|
466
|
+
subgraph Parent
|
|
467
|
+
Child1["Child1 ≠"]
|
|
468
|
+
Child2["Child2 🚀≠"]
|
|
469
|
+
Child3["Child3 ≠"]
|
|
470
|
+
Child4["Child4 ≠"]
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
Child2 --> Child1
|
|
474
|
+
Child3 --> Child4
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
**Decision Steps**:
|
|
478
|
+
|
|
479
|
+
1. `Child2` explicitly requested (outdated);
|
|
480
|
+
2. `Child2` depends on `Child1`, `Child1` is outdated → `Child1` included;
|
|
481
|
+
3. `Child2` is child of `Parent` → `Parent` included (compositional, since `Child1` is internal dependency);
|
|
482
|
+
4. `Child3` is child of compositional composite, outdated → `Child3` excluded (rule 3 doesn't apply);
|
|
483
|
+
5. `Child4` is child of compositional composite, outdated → `Child4` excluded (rule 3 doesn't apply).
|
|
484
|
+
|
|
485
|
+
**Update Phase**: `Child1`, `Child2`, `Parent`
|