@tiinex/app 0.1.1
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/LICENSE +201 -0
- package/NOTICE +31 -0
- package/README.md +26 -0
- package/docs/CONSUMER-CONTRACT.md +65 -0
- package/package.json +94 -0
- package/src/acceptance/knownScenarios.case.mjs +48 -0
- package/src/acceptance/knownScenarios.js +89 -0
- package/src/acceptance/postV423CanonicalTransitionProductVerticalSlice.case.mjs +774 -0
- package/src/acceptance/postV437M0ETimePortalProductParityClosure.case.mjs +51 -0
- package/src/acceptance/postV447M0FGithubSocialPublicationProductIntegration.case.mjs +33 -0
- package/src/acceptance/postV450M0ProductAcceptanceHardening.case.mjs +82 -0
- package/src/acceptance/postV470SchemaReadingContractMaterializationIdentitySourceCoalescingAuthorityCorrection.case.mjs +236 -0
- package/src/acceptance/recoveryAcceptance.case.mjs +196 -0
- package/src/adapters/adapter.definition.schema.json +33 -0
- package/src/adapters/archive/archive.adapter.case.mjs +212 -0
- package/src/adapters/export/export.adapter.js +79 -0
- package/src/adapters/git-native/git-native.adapter.js +43 -0
- package/src/adapters/github/github.adapter.case.mjs +843 -0
- package/src/adapters/github/github.adapter.js +395 -0
- package/src/adapters/github/github.issueEmbedded.js +262 -0
- package/src/adapters/github/github.issueMirror.js +309 -0
- package/src/adapters/github/github.issueSnapshot.js +475 -0
- package/src/adapters/github/github.issueSurface.js +188 -0
- package/src/adapters/github/github.issueTransport.js +237 -0
- package/src/adapters/github/github.publicationRead.js +24 -0
- package/src/adapters/github/github.readTransport.js +18 -0
- package/src/adapters/github/github.repoDiscovery.js +222 -0
- package/src/adapters/github/github.repoMirror.js +255 -0
- package/src/adapters/github/github.repoProxy.js +276 -0
- package/src/adapters/github/github.repoSurface.js +60 -0
- package/src/adapters/github/github.transportDiagnostics.js +68 -0
- package/src/adapters/local/local.adapter.case.mjs +72 -0
- package/src/adapters/local/local.adapter.js +188 -0
- package/src/adapters/registry.js +35 -0
- package/src/adapters/static/static.adapter.js +84 -0
- package/src/app/App.js +1 -0
- package/src/app/TiinexApp.jsx +822 -0
- package/src/app/appShell.views.jsx +58 -0
- package/src/app/artifactAuthoringCapability.js +49 -0
- package/src/app/boot/bootApp.js +19 -0
- package/src/app/boot/environment.js +1 -0
- package/src/app/canonicalAuthoringValues.js +4 -0
- package/src/app/canonicalCreationProductController.js +57 -0
- package/src/app/canonicalCreationProductSettlement.case.mjs +10 -0
- package/src/app/canonicalCreationProductSettlement.js +11 -0
- package/src/app/canonicalReferenceLocalCreateCommand.js +210 -0
- package/src/app/canonicalReferenceTargets.js +73 -0
- package/src/app/canonicalTransitionLocalCreateCommand.js +217 -0
- package/src/app/defaultWorkspaceStart.case.mjs +39 -0
- package/src/app/defaultWorkspaceStart.js +65 -0
- package/src/app/defaultWorkspaceStartCommand.js +55 -0
- package/src/app/durableLocalMutationPolicy.js +21 -0
- package/src/app/githubMaterializationSummary.js +69 -0
- package/src/app/githubProgress.js +25 -0
- package/src/app/githubSourceInput.js +47 -0
- package/src/app/githubSourceMaterializationCommand.js +97 -0
- package/src/app/githubSourceOperation.js +226 -0
- package/src/app/governanceDialogData.js +27 -0
- package/src/app/handoffPackageImportCommand.js +182 -0
- package/src/app/historyAuthority.js +53 -0
- package/src/app/initialWorkspaceBootstrapOperation.js +105 -0
- package/src/app/lineageCommand.js +118 -0
- package/src/app/lineageSourceRecovery.js +339 -0
- package/src/app/localDraftMutationCommand.js +174 -0
- package/src/app/localMaterialCommand.js +124 -0
- package/src/app/nodeGraphVerse.case.mjs +111 -0
- package/src/app/persistenceOwnership.js +92 -0
- package/src/app/productStateBoundary.js +7 -0
- package/src/app/providers/AppProviders.js +1 -0
- package/src/app/providers/LocaleProvider.js +1 -0
- package/src/app/providers/SchemaRegistryProvider.js +1 -0
- package/src/app/providers/WorkspaceProvider.js +1 -0
- package/src/app/publicTarget.js +251 -0
- package/src/app/publicTargetRestoreCommand.js +149 -0
- package/src/app/recordUi.cache.js +35 -0
- package/src/app/recordUi.js +11 -0
- package/src/app/routes/RouteSurface.js +1 -0
- package/src/app/routes/routes.js +1 -0
- package/src/app/runtimeState.js +54 -0
- package/src/app/schemaCurrentDeclaration.js +69 -0
- package/src/app/schemaFactoryLocalCreateCommand.js +101 -0
- package/src/app/schemaFactoryViewerProof.case.mjs +134 -0
- package/src/app/schemaFactoryViewerProof.js +20 -0
- package/src/app/schemaNavigationCommand.js +285 -0
- package/src/app/schemaNavigationMaterialization.js +171 -0
- package/src/app/schemaNavigationRuntimeCatalog.js +25 -0
- package/src/app/schemaNavigationState.js +66 -0
- package/src/app/schemaReadingContractQualification.js +91 -0
- package/src/app/schemaSourceRecovery.js +373 -0
- package/src/app/scrollPersistence.js +30 -0
- package/src/app/semanticOperationHistory.js +18 -0
- package/src/app/shareActionCommand.js +55 -0
- package/src/app/shareProjection.js +190 -0
- package/src/app/shell/AppShell.js +1 -0
- package/src/app/shell/Header.js +1 -0
- package/src/app/shell/Navigation.js +1 -0
- package/src/app/shell/SurfaceSwitcher.js +1 -0
- package/src/app/sourceTransportRefresh.js +176 -0
- package/src/app/startupOwnership.js +40 -0
- package/src/app/startupPresentation.case.mjs +34 -0
- package/src/app/startupPresentation.js +33 -0
- package/src/app/startupPresentation.views.jsx +21 -0
- package/src/app/startupRenderPhase.js +9 -0
- package/src/app/startupWorkspaceCommand.js +62 -0
- package/src/app/startupWorkspaceConfigApplication.js +49 -0
- package/src/app/statePersistenceScheduler.js +106 -0
- package/src/app/tiinexAppConfigPlan.js +108 -0
- package/src/app/tiinexAppConfigSource.js +349 -0
- package/src/app/tiinexAppStartupSource.js +79 -0
- package/src/app/tiinexHostedWorkspaceConventions.js +572 -0
- package/src/app/timePortalHistoricalRead.js +114 -0
- package/src/app/timePortalSnapshotResolution.js +53 -0
- package/src/app/urlMaterialCommand.js +24 -0
- package/src/app/useCanonicalPlacementSelectionOptions.js +9 -0
- package/src/app/useCanonicalReferenceSelectionOptions.js +8 -0
- package/src/app/useLocalMaterialIntake.js +68 -0
- package/src/app/useTimePortalProductController.jsx +111 -0
- package/src/app/useWorkspaceEntrypointIntake.js +77 -0
- package/src/app/useWorkspaceSelectionProductController.jsx +21 -0
- package/src/app/viewState.js +35 -0
- package/src/app/viewport.js +21 -0
- package/src/app/visualDormancy.js +286 -0
- package/src/app/workspaceContinuityNotices.js +32 -0
- package/src/app/workspaceDisplayCounts.js +9 -0
- package/src/app/workspaceEntrypointIntakeCommand.js +87 -0
- package/src/app/workspaceEntrypointProductRouting.case.mjs +20 -0
- package/src/app/workspaceExportCommand.js +21 -0
- package/src/app/workspaceExportDownload.js +23 -0
- package/src/app/workspaceExportExecutionCommand.js +10 -0
- package/src/app/workspaceGithubPublication.js +237 -0
- package/src/app/workspaceHandoffExport.js +56 -0
- package/src/app/workspaceHomeTarget.js +9 -0
- package/src/app/workspaceMulticolumn.js +113 -0
- package/src/app/workspaceNavigationParity.case.mjs +110 -0
- package/src/app/workspaceOpenProgress.js +26 -0
- package/src/app/workspacePlacementOptions.js +46 -0
- package/src/app/workspaceRecordActions.js +158 -0
- package/src/app/workspaceScopedInteraction.js +68 -0
- package/src/app/workspaceSelectionOriginContext.js +29 -0
- package/src/app/workspaceSelectionSession.js +54 -0
- package/src/app/workspaceSourceCloseCommand.js +25 -0
- package/src/app/workspaceSpineProductRouting.case.mjs +22 -0
- package/src/app/workspaceStartupTransition.js +32 -0
- package/src/app/workspaceWindow.js +85 -0
- package/src/artifacts/artifact.fixture.js +1 -0
- package/src/artifacts/artifact.identity.js +6 -0
- package/src/artifacts/artifact.identityAggregation.js +218 -0
- package/src/artifacts/artifact.model.js +2 -0
- package/src/artifacts/artifact.parse.case.mjs +196 -0
- package/src/artifacts/artifact.participantIndex.js +189 -0
- package/src/artifacts/fixtures/evidence.trace.md +50 -0
- package/src/artifacts/fixtures/topic.trace.md +33 -0
- package/src/artifacts/fixtures/unknown-schema.trace.md +25 -0
- package/src/audit/audit.findings.js +1 -0
- package/src/audit/audit.model.js +2 -0
- package/src/audit/audit.plan.js +13 -0
- package/src/audit/audit.report.js +12 -0
- package/src/audit/audit.severity.js +1 -0
- package/src/audit/audit.traverse.js +119 -0
- package/src/audit/integrity/auditIntegrity.checks.js +1 -0
- package/src/audit/integrity/auditIntegrity.compare.js +1 -0
- package/src/audit/lineage/auditLineage.load.js +1 -0
- package/src/audit/lineage/auditLineage.plan.js +1 -0
- package/src/audit/lineage/auditLineage.resolve.js +12 -0
- package/src/audit/sources/auditSources.boundaries.js +1 -0
- package/src/audit/sources/auditSources.checks.js +1 -0
- package/src/audit/validation/auditValidation.recheck.js +1 -0
- package/src/audit/validation/auditValidation.run.js +1 -0
- package/src/build.identity.js +15 -0
- package/src/commands/command.vocabulary.js +14 -0
- package/src/conformance/conformance.fixtures.js +151 -0
- package/src/conformance/conformance.run.js +238 -0
- package/src/data/applicationDataStore.js +23 -0
- package/src/data/companionAccess.js +35 -0
- package/src/diagnostics/events.js +1 -0
- package/src/diagnostics/invariant.js +1 -0
- package/src/diagnostics/schemaBindingChecks.js +1 -0
- package/src/diagnostics/schemaModuleChecks.js +1 -0
- package/src/diagnostics/sourceBoundaryChecks.js +5 -0
- package/src/diagnostics/sourceTransport.report.js +190 -0
- package/src/discovery/discovery.controls.js +7 -0
- package/src/export/export.plan.js +182 -0
- package/src/export/handoff.plan.js +50 -0
- package/src/export/package.builder.case.mjs +97 -0
- package/src/export/package.controlTopology.case.mjs +130 -0
- package/src/export/package.zip.case.mjs +33 -0
- package/src/graph/artifactGraph.model.js +344 -0
- package/src/graph/artifactGraph.project.js +139 -0
- package/src/graph/artifactGraph.worker.js +10 -0
- package/src/i18n/i18n.keys.js +1 -0
- package/src/i18n/i18n.provider.js +1 -0
- package/src/i18n/i18n.resolve.js +5 -0
- package/src/i18n/locales/en/common.json +4 -0
- package/src/i18n/locales/en/schemas/evidence.json +3 -0
- package/src/i18n/locales/en/schemas/presentation-surface.json +3 -0
- package/src/i18n/locales/en/schemas/preservation.json +3 -0
- package/src/i18n/locales/en/schemas/root.json +3 -0
- package/src/i18n/locales/en/schemas/schema-module.json +3 -0
- package/src/i18n/locales/en/schemas/topic.json +3 -0
- package/src/i18n/locales/en/surfaces/audit.json +3 -0
- package/src/i18n/locales/en/surfaces/create.json +3 -0
- package/src/i18n/locales/en/surfaces/detail.json +3 -0
- package/src/i18n/locales/en/surfaces/display-options.json +3 -0
- package/src/i18n/locales/en/surfaces/edit.json +3 -0
- package/src/i18n/locales/en/surfaces/feed.json +3 -0
- package/src/i18n/locales/en/surfaces/lineage.json +3 -0
- package/src/i18n/locales/en/surfaces/preview.json +3 -0
- package/src/i18n/locales/en/surfaces/share.json +3 -0
- package/src/i18n/locales/en/surfaces/source-settings.json +3 -0
- package/src/i18n/locales/en/surfaces/tree.json +3 -0
- package/src/i18n/locales/sv/common.json +4 -0
- package/src/i18n/locales/sv/schemas/evidence.json +3 -0
- package/src/i18n/locales/sv/schemas/presentation-surface.json +3 -0
- package/src/i18n/locales/sv/schemas/preservation.json +3 -0
- package/src/i18n/locales/sv/schemas/root.json +3 -0
- package/src/i18n/locales/sv/schemas/schema-module.json +3 -0
- package/src/i18n/locales/sv/schemas/topic.json +3 -0
- package/src/i18n/locales/sv/surfaces/audit.json +3 -0
- package/src/i18n/locales/sv/surfaces/create.json +3 -0
- package/src/i18n/locales/sv/surfaces/detail.json +3 -0
- package/src/i18n/locales/sv/surfaces/display-options.json +3 -0
- package/src/i18n/locales/sv/surfaces/edit.json +3 -0
- package/src/i18n/locales/sv/surfaces/feed.json +3 -0
- package/src/i18n/locales/sv/surfaces/lineage.json +3 -0
- package/src/i18n/locales/sv/surfaces/preview.json +3 -0
- package/src/i18n/locales/sv/surfaces/share.json +3 -0
- package/src/i18n/locales/sv/surfaces/source-settings.json +3 -0
- package/src/i18n/locales/sv/surfaces/tree.json +3 -0
- package/src/index.js +10 -0
- package/src/integrity/integrity.testFixture.js +9 -0
- package/src/interaction/interaction.spine.js +12 -0
- package/src/lineage/lineage.audit.js +1 -0
- package/src/lineage/lineage.edges.js +1 -0
- package/src/main.js +319 -0
- package/src/main.jsx +34 -0
- package/src/multiverse/multiverse.model.js +10 -0
- package/src/parity/poc.m1ParityScenarios.js +42 -0
- package/src/parity/poc.parityLedger.js +261 -0
- package/src/publication/publication.githubSocialContract.case.mjs +247 -0
- package/src/publication/publication.preflight.case.mjs +64 -0
- package/src/react/TiinexApplication.jsx +39 -0
- package/src/react/VerseHost.jsx +29 -0
- package/src/react/applicationDataContext.jsx +30 -0
- package/src/react.js +2 -0
- package/src/readers/modes/audit.reader.js +1 -0
- package/src/readers/modes/detail.reader.js +1 -0
- package/src/readers/modes/handover.reader.js +1 -0
- package/src/readers/modes/mobile.reader.js +1 -0
- package/src/readers/modes/print.reader.js +1 -0
- package/src/readers/modes/scan.reader.js +1 -0
- package/src/readers/reader.model.js +1 -0
- package/src/readers/reader.resolve.js +2 -0
- package/src/reingest/reingest.plan.case.mjs +65 -0
- package/src/runtime.js +54 -0
- package/src/schemas/README.md +99 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.md +614 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.md +311 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.md +227 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.md +318 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.md +243 -0
- package/src/schemas/core/interpretation/.transitions/evidence-to-interpretation-transition-definition.trace.md +102 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.md +308 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.md +312 -0
- package/src/schemas/core/relation/.generation/reference-relation-generation-authority.trace.md +185 -0
- package/src/schemas/core/relation/.transitions/topic-references-task-transition-definition.trace.md +119 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.md +240 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.md +550 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.md +239 -0
- package/src/schemas/core/task/.transitions/create-task-transition-definition.trace.md +93 -0
- package/src/schemas/core/task/.transitions/topic-to-task-transition-definition.trace.md +102 -0
- package/src/schemas/core/task/task-semantic-package.trace.md +53 -0
- package/src/schemas/core/task/tiinex.task.v1-transitions.trace.md +33 -0
- package/src/schemas/core/task/tiinex.task.v1.authoring.js +65 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.md +229 -0
- package/src/schemas/core/topic/.transitions/create-topic-transition-definition.trace.md +93 -0
- package/src/schemas/core/topic/tiinex.topic.v1-transitions.trace.md +33 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.md +197 -0
- package/src/schemas/core/topic/topic-semantic-package.trace.md +53 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.md +240 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.md +294 -0
- package/src/schemas/manifest.json +367 -0
- package/src/schemas/origins.js +46 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.md +290 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.md +298 -0
- package/src/schemas/party/tiinex.party.v1.schema.js +14 -0
- package/src/schemas/party/tiinex.party.v1.schema.json +23 -0
- package/src/schemas/party/tiinex.party.v1.schema.md +311 -0
- package/src/schemas/party/tiinex.party.v1.schema.runtime.json +2033 -0
- package/src/schemas/party/tiinex.party.v1.schema.source.js +9 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.md +476 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.md +248 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.md +465 -0
- package/src/schemas/schema.companionContract.case.mjs +259 -0
- package/src/schemas/schema.factory.case.mjs +256 -0
- package/src/schemas/schema.factory.viewerProjection.js +183 -0
- package/src/schemas/schemaMarkdownCatalog.js +19 -0
- package/src/schemas/tiinex.root.v1.schema.md +865 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.md +309 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.md +280 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.md +300 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.md +486 -0
- package/src/schemas/workspace/workspace.add.views.jsx +327 -0
- package/src/schemas/workspace/workspace.audit.views.jsx +160 -0
- package/src/schemas/workspace/workspace.auditBadge.views.jsx +98 -0
- package/src/schemas/workspace/workspace.canonicalReferenceDialog.views.jsx +63 -0
- package/src/schemas/workspace/workspace.canonicalTaskDialog.views.jsx +169 -0
- package/src/schemas/workspace/workspace.cardActions.js +9 -0
- package/src/schemas/workspace/workspace.cards.views.jsx +146 -0
- package/src/schemas/workspace/workspace.chrome.views.jsx +299 -0
- package/src/schemas/workspace/workspace.continuationDialog.views.jsx +80 -0
- package/src/schemas/workspace/workspace.discovery.views.jsx +63 -0
- package/src/schemas/workspace/workspace.discoveryRenderWindow.js +56 -0
- package/src/schemas/workspace/workspace.displayOptions.views.jsx +114 -0
- package/src/schemas/workspace/workspace.entrypointChoice.views.jsx +30 -0
- package/src/schemas/workspace/workspace.exportDialog.controller.jsx +40 -0
- package/src/schemas/workspace/workspace.exportDialog.views.jsx +142 -0
- package/src/schemas/workspace/workspace.governance.views.jsx +45 -0
- package/src/schemas/workspace/workspace.graph.views.jsx +134 -0
- package/src/schemas/workspace/workspace.lineage.views.jsx +307 -0
- package/src/schemas/workspace/workspace.read.views.jsx +105 -0
- package/src/schemas/workspace/workspace.recordActionButton.views.jsx +35 -0
- package/src/schemas/workspace/workspace.recordDialogs.views.jsx +257 -0
- package/src/schemas/workspace/workspace.selection.views.jsx +14 -0
- package/src/schemas/workspace/workspace.sourceReceipt.views.jsx +40 -0
- package/src/schemas/workspace/workspace.timePortal.views.jsx +56 -0
- package/src/schemas/workspace/workspace.tree.views.jsx +107 -0
- package/src/schemas/workspace/workspace.viewFormatting.js +172 -0
- package/src/schemas/workspace/workspace.views.jsx +210 -0
- package/src/source-settings/sourceSettings.model.js +7 -0
- package/src/sources/draft/draft.source.js +1 -0
- package/src/sources/github/github.loader.js +204 -0
- package/src/sources/github/github.permalink.js +1 -0
- package/src/sources/github/github.source.js +1 -0
- package/src/sources/github/github.transport.case.mjs +237 -0
- package/src/sources/github/github.transport.js +472 -0
- package/src/sources/local/local.source.js +1 -0
- package/src/sources/source.assetReferences.js +109 -0
- package/src/sources/source.boundaries.js +24 -0
- package/src/sources/source.identity.js +56 -0
- package/src/sources/source.model.case.mjs +26 -0
- package/src/sources/source.model.js +56 -0
- package/src/sources/source.presenter.js +66 -0
- package/src/sources/source.resolve.js +11 -0
- package/src/sources/static/static.source.js +1 -0
- package/src/sources/transport.policy.case.mjs +39 -0
- package/src/sources/transport.policy.js +81 -0
- package/src/storage/storage.policy.js +79 -0
- package/src/styles/app.css +8699 -0
- package/src/styles/responsive.css +10 -0
- package/src/styles/theme.css +4 -0
- package/src/styles/tokens.css +30 -0
- package/src/surfaces/audit/AuditSurface.js +1 -0
- package/src/surfaces/audit/audit.model.js +1 -0
- package/src/surfaces/audit/audit.render.js +1 -0
- package/src/surfaces/contracts.js +45 -0
- package/src/surfaces/create/CreateSurface.js +1 -0
- package/src/surfaces/create/create.model.js +1 -0
- package/src/surfaces/create/create.render.js +1 -0
- package/src/surfaces/detail/DetailSurface.js +1 -0
- package/src/surfaces/detail/detail.model.js +1 -0
- package/src/surfaces/detail/detail.render.js +1 -0
- package/src/surfaces/display-options/DisplayOptionsSurface.js +1 -0
- package/src/surfaces/display-options/displayOptions.model.js +1 -0
- package/src/surfaces/display-options/displayOptions.render.js +1 -0
- package/src/surfaces/edit/EditSurface.js +1 -0
- package/src/surfaces/edit/edit.model.js +1 -0
- package/src/surfaces/edit/edit.render.js +1 -0
- package/src/surfaces/feed/FeedSurface.js +1 -0
- package/src/surfaces/feed/feed.model.js +1 -0
- package/src/surfaces/feed/feed.render.js +1 -0
- package/src/surfaces/lineage/LineageSurface.js +1 -0
- package/src/surfaces/lineage/lineage.model.js +1 -0
- package/src/surfaces/lineage/lineage.render.js +1 -0
- package/src/surfaces/preview/PreviewSurface.js +1 -0
- package/src/surfaces/preview/preview.model.js +1 -0
- package/src/surfaces/preview/preview.render.js +1 -0
- package/src/surfaces/registry.js +58 -0
- package/src/surfaces/share/ShareSurface.js +1 -0
- package/src/surfaces/share/share.model.js +1 -0
- package/src/surfaces/share/share.render.js +1 -0
- package/src/surfaces/source-settings/SourceSettingsSurface.js +1 -0
- package/src/surfaces/source-settings/sourceSettings.model.js +1 -0
- package/src/surfaces/source-settings/sourceSettings.render.js +1 -0
- package/src/surfaces/surfaceContext.js +1 -0
- package/src/surfaces/tree/TreeSurface.js +1 -0
- package/src/surfaces/tree/tree.model.js +1 -0
- package/src/surfaces/tree/tree.render.js +1 -0
- package/src/tooling/portable/adapters/cli/cli.common-output.case.mjs +153 -0
- package/src/tooling/portable/adapters/cli/cli.handoff-sibling-allocation.case.mjs +52 -0
- package/src/tooling/portable/adapters/cli/cli.run.case.mjs +372 -0
- package/src/tooling/portable/adapters/cli/cli.summaryProjection.case.mjs +46 -0
- package/src/tooling/portable/audit/audit.capability.case.mjs +45 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/collaboration/dogfood/001-tiinex-development-dogfood-collaboration-model.trace.fixture.txt +37 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/handoff/tooling/001-v480-tooling-workflow-schema-enablement-handoff.trace.fixture.txt +108 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/handoff/tooling/002-v481-tooling-recipient-relative-handoff-material-closure-planner-foundation-handoff.trace.fixture.txt +130 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/loom/role/001-loom-role.trace.fixture.txt +61 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/sigma/role/001-1-sigma-role.trace.fixture.txt +61 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-1-1-1-1-1-site-tooling-v474-loaded-parent-identity-evidence-closure-result.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-1-1-1-1-site-tooling-v474-loaded-parent-identity-evidence-closure.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-1-1-1-site-tooling-v473-portable-parent-authority-coherence-metadata-fidelity-closure-result.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-1-1-site-tooling-v473-portable-parent-authority-coherence-metadata-fidelity-closure.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-1-site-tooling-v472-portable-exact-authoring-fidelity-closure-result.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-1-site-tooling-v472-portable-exact-authoring-fidelity-closure.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-1-site-tooling-v471-portable-lineage-authoring-closure-result.trace.fixture.txt +48 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/001-site-tooling-v471-portable-lineage-authoring-closure.trace.fixture.txt +39 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/002-1-v475-canonical-artifact-envelope-reference-integrity-validation.trace.fixture.txt +43 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/003-1-v476-canonical-authority-binding-integrity-method-lineage-alloca.trace.fixture.txt +42 -0
- package/src/tooling/portable/fixtures/legacy-artifacts/tooling/dogfood/027-handoff-package-workspace-archive-and-control-plane-minimality-audit.trace.fixture.txt +56 -0
- package/src/tooling/portable/fixtures/legacyArtifactFixtures.mjs +34 -0
- package/src/tooling/portable/grounding/grounding.capsule.case.mjs +65 -0
- package/src/tooling/portable/grounding/grounding.readiness.case.mjs +543 -0
- package/src/tooling/portable/grounding/grounding.semanticIntegration.case.mjs +131 -0
- package/src/tooling/portable/handoff/boundedWorkspaceRepresentation.case.mjs +103 -0
- package/src/tooling/portable/handoff/carrierLineage.fixedWidth.case.mjs +97 -0
- package/src/tooling/portable/handoff/coldStartQualification.case.mjs +293 -0
- package/src/tooling/portable/handoff/fixtures/027-invalid-audit-result.fixture.txt +192 -0
- package/src/tooling/portable/handoff/fixtures/027-invalid-return-handoff.fixture.txt +92 -0
- package/src/tooling/portable/handoff/fixtures/cold-start-qualification.v1.examples.json +60 -0
- package/src/tooling/portable/handoff/handoff.manufacture.case.mjs +293 -0
- package/src/tooling/portable/handoff/materialClosure.case.mjs +727 -0
- package/src/tooling/portable/handoff/multiRootManufacture.case.mjs +615 -0
- package/src/tooling/portable/handoff/operatorBridgeCore.case.mjs +205 -0
- package/src/tooling/portable/handoff/workspaceLandingPlan.case.mjs +143 -0
- package/src/tooling/portable/input/node.input.case.mjs +293 -0
- package/src/tooling/portable/lifecycle/lifecycle.readiness.case.mjs +179 -0
- package/src/tooling/portable/lineage/fixtures/lineage.integrity.repair-projection.v1.examples.json +605 -0
- package/src/tooling/portable/lineage/lineage.integrity.shared-capability.case.mjs +37 -0
- package/src/tooling/portable/lineage/publicationProviderReceipt.fixture.mjs +50 -0
- package/src/tooling/portable/package/fixtures/reference-relation-generation-authority.trace.md +84 -0
- package/src/tooling/portable/package/fixtures/tiinex.root.v1.package-authority.contract-fixture.md +64 -0
- package/src/tooling/portable/package/fixtures/tiinex.schema.generation.v1.generation-binding.contract-fixture.md +140 -0
- package/src/tooling/portable/package/fixtures/tiinex.schema.transition.companion.v1.contract-fixture.md +73 -0
- package/src/tooling/portable/package/fixtures/tiinex.semantic.package.v1.contract-fixture.md +147 -0
- package/src/tooling/portable/package/fixtures/tiinex.transition.definition.v1.package-contract-fixture.md +77 -0
- package/src/tooling/portable/providers/schema.providers.genericity.case.mjs +31 -0
- package/src/tooling/portable/reduction/reduction.preflight.case.mjs +298 -0
- package/src/tooling/portable/schema/fixtures/evidence-preservation-body.inheritance-record-fixture.md +65 -0
- package/src/tooling/portable/schema/fixtures/tiinex.portal.time.v1.contract-fixture.md +294 -0
- package/src/tooling/portable/schema/fixtures/tiinex.root.v1.contract-fixture.md +584 -0
- package/src/tooling/portable/schema/fixtures/tiinex.root.v1.machine-shape.contract-fixture.md +44 -0
- package/src/tooling/portable/schema/fixtures/tiinex.root.v1.ordinary-target.contract-fixture.md +630 -0
- package/src/tooling/portable/schema/fixtures/tiinex.schema.contract.v1.repeated-record.contract-fixture.md +69 -0
- package/src/tooling/portable/schema/fixtures/tiinex.schema.generation.v1.repeated-record.contract-fixture.md +98 -0
- package/src/tooling/portable/schema/fixtures/tiinex.schema.inheritance.v1.repeated-record.contract-fixture.md +58 -0
- package/src/tooling/portable/schema/fixtures/tiinex.task.v1.contract-fixture.md +165 -0
- package/src/tooling/portable/schema/fixtures/tiinex.transition.definition.v1.contract-fixture.md +744 -0
- package/src/tooling/portable/schema/fixtures/tiinex.transition.definition.v1.field-domain.contract-fixture.md +319 -0
- package/src/transitions/canonical-schema-cache/053d46ce082d4ec261b82abc44ecca403d61e240/tiinex.relation.v1.schema.md +240 -0
- package/src/transitions/canonical-schema-cache/053d46ce082d4ec261b82abc44ecca403d61e240/tiinex.schema.contract.v1.schema.md +391 -0
- package/src/transitions/canonical-schema-cache/053d46ce082d4ec261b82abc44ecca403d61e240/tiinex.schema.generation.v1.schema.md +379 -0
- package/src/transitions/canonical-schema-cache/053d46ce082d4ec261b82abc44ecca403d61e240/tiinex.schema.transition.companion.v1.schema.md +265 -0
- package/src/transitions/canonical-schema-cache/053d46ce082d4ec261b82abc44ecca403d61e240/tiinex.semantic.package.v1.schema.md +402 -0
- package/src/transitions/canonical-schema-cache/52ecdea0a75893882ce282214d155f70e1309c2a/tiinex.topic.v1.schema.md +197 -0
- package/src/transitions/canonical-schema-cache/d69b8ff55a56b8cb9282b8684db6a938a4435b94/tiinex.root.v1.schema.md +797 -0
- package/src/transitions/canonical-schema-cache/d69b8ff55a56b8cb9282b8684db6a938a4435b94/tiinex.transition.definition.v1.schema.md +1062 -0
- package/src/transitions/canonicalTransition.packageContracts.js +22 -0
- package/src/transitions/canonicalTransition.productDefaults.js +105 -0
- package/src/transitions/canonicalTransition.schemaCache.case.mjs +45 -0
- package/src/transitions/canonicalTransition.schemaCache.js +81 -0
- package/src/transitions/canonicalTransition.semanticPackage.js +146 -0
- package/src/transitions/record.transitions.case.mjs +88 -0
- package/src/transitions/transition.authorityRepresentation.js +55 -0
- package/src/transitions/transition.availabilityPlanner.js +376 -0
- package/src/transitions/transition.availabilitySemantics.js +150 -0
- package/src/transitions/transition.definitionReadProjection.js +107 -0
- package/src/transitions/transition.definitionRegistry.js +355 -0
- package/src/transitions/transition.definitionRegistryAggregation.js +21 -0
- package/src/transitions/transition.definitions.js +46 -0
- package/src/transitions/transition.explicitGenerationPlanner.js +58 -0
- package/src/transitions/transition.generationInputPlanner.js +19 -0
- package/src/transitions/transition.interpretationMaterializer.js +2 -0
- package/src/transitions/transition.invocationBindingPacket.js +52 -0
- package/src/transitions/transition.invocationBindingPlanner.js +467 -0
- package/src/transitions/transition.legacyShorthand.js +133 -0
- package/src/transitions/transition.localArtifactMaterializers.js +16 -0
- package/src/transitions/transition.localCreateCapability.js +111 -0
- package/src/transitions/transition.outputMaterializationPlanner.js +336 -0
- package/src/transitions/transition.parentReference.js +90 -0
- package/src/transitions/transition.presentation.js +43 -0
- package/src/transitions/transition.productPreparation.js +377 -0
- package/src/transitions/transition.productPresentation.browser.js +28 -0
- package/src/transitions/transition.productPresentation.js +55 -0
- package/src/transitions/transition.referenceCreateCapability.js +119 -0
- package/src/transitions/transition.referenceTarget.js +50 -0
- package/src/transitions/transition.relationMaterializer.js +2 -0
- package/src/transitions/transition.resultSemantics.js +453 -0
- package/src/transitions/transition.taskMaterializer.js +2 -0
- package/src/transitions/transition.topicMaterializer.js +2 -0
- package/src/transitions/transition.validate.case.mjs +58 -0
- package/src/ui/cards/ArtifactCard.js +1 -0
- package/src/ui/cards/SchemaCard.js +1 -0
- package/src/ui/cards/SourceCard.js +1 -0
- package/src/ui/dialog.presenter.js +24 -0
- package/src/ui/feedback/DegradedNotice.js +1 -0
- package/src/ui/feedback/EmptyState.js +1 -0
- package/src/ui/feedback/ValidationNotice.js +1 -0
- package/src/ui/forms/FormRenderer.js +1 -0
- package/src/ui/forms/fields/MarkdownField.js +1 -0
- package/src/ui/forms/fields/SelectField.js +1 -0
- package/src/ui/forms/fields/SourcePickerField.js +1 -0
- package/src/ui/forms/fields/TextField.js +1 -0
- package/src/ui/icon.paths.js +37 -0
- package/src/ui/layout/Panel.js +1 -0
- package/src/ui/layout/ResponsiveFrame.js +1 -0
- package/src/ui/layout/SplitView.js +1 -0
- package/src/ui/layout/Stack.js +1 -0
- package/src/ui/panels/DetailPanel.js +1 -0
- package/src/ui/panels/LineagePanel.js +1 -0
- package/src/ui/panels/SourcePanel.js +1 -0
- package/src/ui/primitives/Badge.js +1 -0
- package/src/ui/primitives/Badge.jsx +5 -0
- package/src/ui/primitives/Button.js +1 -0
- package/src/ui/primitives/Button.jsx +12 -0
- package/src/ui/primitives/Card.js +1 -0
- package/src/ui/primitives/Field.js +1 -0
- package/src/ui/primitives/Field.jsx +21 -0
- package/src/ui/primitives/Icon.jsx +90 -0
- package/src/ui/primitives/Modal.jsx +27 -0
- package/src/validation/i18n.js +37 -0
- package/src/validation/validateArtifact.case.mjs +41 -0
- package/src/verses/column/ColumnVerse.js +1 -0
- package/src/verses/column/column.model.js +6 -0
- package/src/verses/column/column.project.js +7 -0
- package/src/verses/context.js +26 -0
- package/src/verses/contracts.js +1 -0
- package/src/verses/hostRegistry.js +47 -0
- package/src/verses/registry.js +22 -0
- package/src/verses/universe.model.js +8 -0
- package/src/verses/universe.presenter.js +8 -0
- package/src/verses/universe.project.js +12 -0
- package/src/viewer.js +34 -0
- package/src/workspace.model.js +5 -0
- package/src/workspaces/workspace.actions.js +1 -0
- package/src/workspaces/workspace.artifactActions.js +56 -0
- package/src/workspaces/workspace.auditView.js +153 -0
- package/src/workspaces/workspace.candidates.js +149 -0
- package/src/workspaces/workspace.config.js +153 -0
- package/src/workspaces/workspace.configuredSource.js +68 -0
- package/src/workspaces/workspace.discoveryProgress.js +34 -0
- package/src/workspaces/workspace.discoveryView.js +386 -0
- package/src/workspaces/workspace.displayFilters.js +63 -0
- package/src/workspaces/workspace.displayOptions.js +58 -0
- package/src/workspaces/workspace.emptyStateCopy.js +24 -0
- package/src/workspaces/workspace.entrypointLifecycle.js +131 -0
- package/src/workspaces/workspace.entrypointViewIntent.js +83 -0
- package/src/workspaces/workspace.entrypoints.js +157 -0
- package/src/workspaces/workspace.feedSort.js +152 -0
- package/src/workspaces/workspace.import.js +212 -0
- package/src/workspaces/workspace.importConflicts.js +200 -0
- package/src/workspaces/workspace.importLifecycle.case.mjs +103 -0
- package/src/workspaces/workspace.lifecycle.case.mjs +353 -0
- package/src/workspaces/workspace.lifecycle.js +357 -0
- package/src/workspaces/workspace.lineageView.js +244 -0
- package/src/workspaces/workspace.localSourceLifecycle.js +91 -0
- package/src/workspaces/workspace.materialLedger.js +110 -0
- package/src/workspaces/workspace.materialReconciliation.case.mjs +164 -0
- package/src/workspaces/workspace.materialReconciliation.js +390 -0
- package/src/workspaces/workspace.memberIdentity.js +140 -0
- package/src/workspaces/workspace.model.js +2 -0
- package/src/workspaces/workspace.navigation.js +20 -0
- package/src/workspaces/workspace.openSemantics.js +33 -0
- package/src/workspaces/workspace.pathTree.js +132 -0
- package/src/workspaces/workspace.persistence.case.mjs +271 -0
- package/src/workspaces/workspace.persistence.js +469 -0
- package/src/workspaces/workspace.persistenceCache.js +41 -0
- package/src/workspaces/workspace.persistenceClear.js +45 -0
- package/src/workspaces/workspace.persistencePresentation.js +93 -0
- package/src/workspaces/workspace.persistenceRecovery.js +147 -0
- package/src/workspaces/workspace.persistenceRouteCache.js +82 -0
- package/src/workspaces/workspace.publicationReceipts.case.mjs +36 -0
- package/src/workspaces/workspace.publicationReceipts.js +56 -0
- package/src/workspaces/workspace.recoverabilityView.js +264 -0
- package/src/workspaces/workspace.route.js +432 -0
- package/src/workspaces/workspace.runtimeCanonical.js +18 -0
- package/src/workspaces/workspace.sourceMaterial.js +71 -0
- package/src/workspaces/workspace.sourceRecordPath.js +5 -0
- package/src/workspaces/workspace.sourceRecords.js +75 -0
- package/src/workspaces/workspace.store.js +3 -0
- package/src/workspaces/workspace.summary.js +116 -0
- package/src/workspaces/workspace.timePortal.js +137 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { runGithubSourceOperation } from './githubSourceOperation.js';
|
|
2
|
+
import { runExplicitUrlMaterialImportCommand } from './urlMaterialCommand.js';
|
|
3
|
+
import { openWorkspaceRecordAction, openWorkspaceRecordMemberAction } from './workspaceRecordActions.js';
|
|
4
|
+
import { stateWithWorkspaceViewPatchAndFocus } from './workspaceScopedInteraction.js';
|
|
5
|
+
import {
|
|
6
|
+
normalizePublicTarget,
|
|
7
|
+
publicTargetRestoreCapability,
|
|
8
|
+
PublicTargetRestoreCapability
|
|
9
|
+
} from './publicTarget.js';
|
|
10
|
+
|
|
11
|
+
export async function runPublicTargetRestoreCommand({
|
|
12
|
+
target,
|
|
13
|
+
runtimeApi = {},
|
|
14
|
+
fetchImpl = globalThis.fetch,
|
|
15
|
+
workspaceConfig = {},
|
|
16
|
+
isCurrentOwner = () => true,
|
|
17
|
+
runGithubOperation = runGithubSourceOperation,
|
|
18
|
+
runUrlImport = runExplicitUrlMaterialImportCommand
|
|
19
|
+
} = {}) {
|
|
20
|
+
const normalized = normalizePublicTarget(target);
|
|
21
|
+
const lifecycle = runtimeApi.lifecycle;
|
|
22
|
+
if (!normalized) return failure('public-target.invalid', 'Public target is invalid.');
|
|
23
|
+
const restoreCapability = publicTargetRestoreCapability(normalized);
|
|
24
|
+
if (restoreCapability === PublicTargetRestoreCapability.invalid) return failure('public-target.invalid', 'Public target is invalid.', { target: normalized });
|
|
25
|
+
if (restoreCapability === PublicTargetRestoreCapability.unsupported) return failure('public-target.unsupported', 'This public URL target is not a supported Tiinex material target.', { target: normalized });
|
|
26
|
+
if (!lifecycle?.makeEmptyAppState || !lifecycle?.createWorkspace) return failure('public-target.lifecycle-missing', 'Workspace lifecycle is unavailable.');
|
|
27
|
+
if (!isCurrentOwner()) return failure('public-target.stale', 'Public target restore was superseded.');
|
|
28
|
+
|
|
29
|
+
const created = lifecycle.createWorkspace(lifecycle.makeEmptyAppState(), { id: 'public-target', name: publicTargetLabel(normalized) });
|
|
30
|
+
if (!created?.ok) return failure(created?.error || 'public-target.workspace-failed', 'Could not create public target workspace.');
|
|
31
|
+
let state = created.state;
|
|
32
|
+
const workspaceId = created.workspace.id;
|
|
33
|
+
|
|
34
|
+
const materialized = normalized.adapterId === 'github'
|
|
35
|
+
? await materializeGithubTarget({ normalized, state, workspaceId, runtimeApi, workspaceConfig, fetchImpl, runGithubOperation, isCurrentOwner })
|
|
36
|
+
: await runUrlImport({ lifecycle, state, workspaceId, urls: [normalized.externalTarget], fetchImpl });
|
|
37
|
+
if (!materialized?.ok) return failure(materialized?.error || 'public-target.materialization-failed', materialized?.notice || 'Could not materialize public target.', { target: normalized, state: materialized?.state || state });
|
|
38
|
+
if (!isCurrentOwner()) return failure('public-target.stale', 'Public target restore was superseded.', { state: materialized.state });
|
|
39
|
+
state = materialized.state;
|
|
40
|
+
|
|
41
|
+
const workspace = workspaceById(state, workspaceId) || lifecycle.activeWorkspace?.(state);
|
|
42
|
+
const record = selectPublicTargetRecord(workspace, normalized);
|
|
43
|
+
if (!record) return failure('public-target.record-missing', 'Public target materialized without a matching Tiinex artifact.', { target: normalized, state });
|
|
44
|
+
|
|
45
|
+
if (isWorkspaceArtifact(record) && ['workspace', 'workspace.member'].includes(normalized.targetKind)) {
|
|
46
|
+
const opened = normalized.targetKind === 'workspace.member'
|
|
47
|
+
? openWorkspaceRecordMemberAction({ lifecycle, parseWorkspaceConfig: runtimeApi.config?.parseWorkspaceConfig, state, record, memberIdentity: normalized.memberIdentity, descriptorTarget: normalized })
|
|
48
|
+
: openWorkspaceRecordAction({ lifecycle, parseWorkspaceConfig: runtimeApi.config?.parseWorkspaceConfig, state, record, descriptorTarget: normalized });
|
|
49
|
+
if (!opened?.ok) return failure(opened?.error || 'public-target.workspace-open-failed', opened?.message || 'Could not open public workspace target.', { target: normalized, state });
|
|
50
|
+
state = opened.state;
|
|
51
|
+
if (workspaceId && workspaceById(state, workspaceId) && String(opened.workspace?.id || '') !== workspaceId) {
|
|
52
|
+
const consumed = lifecycle.closeWorkspace?.(state, workspaceId);
|
|
53
|
+
if (consumed?.ok) state = consumed.state;
|
|
54
|
+
}
|
|
55
|
+
for (const sourceInput of opened.sourceInputs || []) {
|
|
56
|
+
if (!isCurrentOwner()) return failure('public-target.stale', 'Public target restore was superseded.', { state });
|
|
57
|
+
const loaded = await materializeWorkspaceSourceInput({ sourceInput, state, runtimeApi, workspaceConfig, fetchImpl, runGithubOperation, isCurrentOwner });
|
|
58
|
+
if (!loaded?.ok) return failure(loaded?.error || 'public-target.workspace-source-failed', loaded?.message || 'Could not materialize a workspace entrypoint from the public target.', { target: normalized, state: loaded?.state || state });
|
|
59
|
+
state = loaded.state;
|
|
60
|
+
}
|
|
61
|
+
return { ok: true, state, target: normalized, record, workspaceTarget: true, workspace: lifecycle.activeWorkspace?.(state) || null };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const selectedState = stateWithWorkspaceViewPatchAndFocus(state, workspace?.id || workspaceId, { workspaceVerse: 'lineage', selectedRecordId: record.id || '' });
|
|
65
|
+
return { ok: true, state: selectedState, target: normalized, record, workspaceTarget: false, workspace: workspaceById(selectedState, workspace?.id || workspaceId) };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function materializeGithubTarget({ normalized, state, workspaceId, runtimeApi, workspaceConfig, fetchImpl, runGithubOperation, isCurrentOwner }) {
|
|
69
|
+
const input = githubInputForTarget(normalized);
|
|
70
|
+
if (!input) return failure('public-target.github-invalid', 'GitHub public target could not be converted to an exact material request.', { state });
|
|
71
|
+
const operationRef = { current: { token: null, controller: null } };
|
|
72
|
+
const out = await runGithubOperation({
|
|
73
|
+
input: Object.assign({ resetSourceCache: false, allowSourceCache: false }, input),
|
|
74
|
+
options: { state, workspaceId },
|
|
75
|
+
state,
|
|
76
|
+
active: workspaceById(state, workspaceId),
|
|
77
|
+
runtimeApi,
|
|
78
|
+
workspaceConfig,
|
|
79
|
+
operationRef,
|
|
80
|
+
setNotice: () => {}, setDialog: () => {}, setGithubRequestPending: () => {}, commit: () => {},
|
|
81
|
+
getLatestState: () => state,
|
|
82
|
+
fetchImpl,
|
|
83
|
+
AbortControllerImpl: undefined
|
|
84
|
+
});
|
|
85
|
+
if (!isCurrentOwner()) return failure('public-target.stale', 'Public target restore was superseded.', { state: out?.state || state });
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async function materializeWorkspaceSourceInput({ sourceInput, state, runtimeApi, workspaceConfig, fetchImpl, runGithubOperation, isCurrentOwner }) {
|
|
90
|
+
if (String(sourceInput?.adapterId || 'github') !== 'github') return failure('public-target.workspace-source-unsupported', 'Public workspace target requested an unsupported source adapter.', { state });
|
|
91
|
+
const workspaceId = sourceInput.workspaceId || state.activeWorkspaceId;
|
|
92
|
+
const operationRef = { current: { token: null, controller: null } };
|
|
93
|
+
const out = await runGithubOperation({
|
|
94
|
+
input: Object.assign({ resetSourceCache: false, allowSourceCache: false }, sourceInput),
|
|
95
|
+
options: { state, workspaceId },
|
|
96
|
+
state,
|
|
97
|
+
active: workspaceById(state, workspaceId),
|
|
98
|
+
runtimeApi,
|
|
99
|
+
workspaceConfig,
|
|
100
|
+
operationRef,
|
|
101
|
+
setNotice: () => {}, setDialog: () => {}, setGithubRequestPending: () => {}, commit: () => {},
|
|
102
|
+
getLatestState: () => state,
|
|
103
|
+
fetchImpl,
|
|
104
|
+
AbortControllerImpl: undefined
|
|
105
|
+
});
|
|
106
|
+
if (!isCurrentOwner()) return failure('public-target.stale', 'Public target restore was superseded.', { state: out?.state || state });
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function githubInputForTarget(target = {}) {
|
|
111
|
+
if (target.targetKind === 'github.issue' || target.targetKind === 'github.issue.comment' || target.targetKind === 'github.discussion') {
|
|
112
|
+
return { repository: target.repository, rootPath: '.topics', repoDiscovery: false, issueDiscovery: false, issueUrls: target.externalTarget, explicitFileRefs: [] };
|
|
113
|
+
}
|
|
114
|
+
if (target.targetKind === 'github.file' || target.targetKind === 'workspace' || target.targetKind === 'workspace.member') {
|
|
115
|
+
if (!target.repository || !target.path) return null;
|
|
116
|
+
return { repository: target.repository, ref: target.ref || '', rootPath: '.topics', repoDiscovery: false, issueDiscovery: false, issueUrls: '', explicitFileRefs: [target.path] };
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function selectPublicTargetRecord(workspace = {}, target = {}) {
|
|
122
|
+
const records = Array.isArray(workspace?.records) ? workspace.records : [];
|
|
123
|
+
const external = String(target?.externalTarget || '').trim();
|
|
124
|
+
const commentId = String(target?.commentId || '').trim();
|
|
125
|
+
const targetPath = String(target?.path || '').replace(/^\/+/, '');
|
|
126
|
+
const scored = records.map((record) => ({ record, score: scoreRecord(record, { external, commentId, targetPath, target }) })).filter((item) => item.score > 0);
|
|
127
|
+
scored.sort((a, b) => b.score - a.score || String(a.record.path || '').localeCompare(String(b.record.path || '')));
|
|
128
|
+
return scored[0]?.record || (records.length === 1 ? records[0] : null);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function scoreRecord(record = {}, context = {}) {
|
|
132
|
+
const targetKind = String(record?.sourceTarget?.targetKind || '').toLowerCase();
|
|
133
|
+
const inputTarget = String(record?.sourceTarget?.inputTarget || record?.snapshot?.target?.canonicalUrl || '').trim();
|
|
134
|
+
const rawUrl = String(record?.sourceTarget?.rawUrl || record?.snapshot?.rawUrl || '').trim();
|
|
135
|
+
const path = String(record?.sourceTarget?.sourceArtifactPath || record?.path || '').replace(/^\/+/, '');
|
|
136
|
+
let score = 0;
|
|
137
|
+
if (context.external && (inputTarget === context.external || rawUrl === context.external)) score += 300;
|
|
138
|
+
if (context.commentId && (inputTarget.includes(`issuecomment-${context.commentId}`) || rawUrl.includes(`issuecomment-${context.commentId}`))) score += 400;
|
|
139
|
+
if (context.targetPath && path === context.targetPath) score += 300;
|
|
140
|
+
if (targetKind.includes('embedded-artifact')) score += 160;
|
|
141
|
+
if (targetKind.includes('shell') || targetKind.includes('snapshot')) score -= 40;
|
|
142
|
+
if (isWorkspaceArtifact(record) && ['workspace', 'workspace.member'].includes(context.target?.targetKind)) score += 250;
|
|
143
|
+
return score;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isWorkspaceArtifact(record = {}) { return Boolean(record?.workspaceArtifactRole?.openEligible) || /\.workspace\.md$/i.test(String(record?.path || record?.sourceTarget?.sourceArtifactPath || '')); }
|
|
147
|
+
function workspaceById(state = {}, workspaceId = '') { return (Array.isArray(state?.workspaces) ? state.workspaces : []).find((workspace) => workspace.id === workspaceId) || null; }
|
|
148
|
+
function publicTargetLabel(target = {}) { try { const url = new URL(target.externalTarget); return ['workspace', 'workspace.member'].includes(target.targetKind) ? 'Shared workspace' : `Shared ${url.hostname}`; } catch (_) { return 'Shared target'; } }
|
|
149
|
+
function failure(error, message, extra = {}) { return Object.assign({ ok: false, error, message, state: extra.state }, extra); }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hydrateGithubRecordFromSourceCache, hydrateGithubWorkspaceFromSourceCache } from '../sources/github/github.transport.js';
|
|
2
|
+
|
|
3
|
+
const positiveRecordHydration = new WeakMap();
|
|
4
|
+
const workspaceHydration = new WeakMap();
|
|
5
|
+
const NEGATIVE_RECHECK_MS = 1200;
|
|
6
|
+
|
|
7
|
+
export function cachedHydratedRecord(record, storage) {
|
|
8
|
+
if (!record || String(record.markdown || '').trim()) return record || null;
|
|
9
|
+
const cached = positiveRecordHydration.get(record);
|
|
10
|
+
if (cached) return cached;
|
|
11
|
+
const hydrated = hydrateGithubRecordFromSourceCache(record, { storage });
|
|
12
|
+
if (hydrated !== record) positiveRecordHydration.set(record, hydrated);
|
|
13
|
+
return hydrated;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function cachedHydratedWorkspace(workspace, storage) {
|
|
17
|
+
if (!workspace) return null;
|
|
18
|
+
const records = Array.isArray(workspace.records) ? workspace.records : [];
|
|
19
|
+
const now = Date.now();
|
|
20
|
+
const cached = workspaceHydration.get(workspace);
|
|
21
|
+
if (cached && cached.records === records && (cached.complete || now - cached.checkedAt < NEGATIVE_RECHECK_MS)) return cached.value;
|
|
22
|
+
const value = hydrateGithubWorkspaceFromSourceCache(workspace, { storage });
|
|
23
|
+
const hydratedRecords = Array.isArray(value?.records) ? value.records : records;
|
|
24
|
+
for (let index = 0; index < Math.min(records.length, hydratedRecords.length); index += 1) if (hydratedRecords[index] !== records[index]) positiveRecordHydration.set(records[index], hydratedRecords[index]);
|
|
25
|
+
const complete = !hydratedRecords.some(recordNeedsSourceCacheHydration);
|
|
26
|
+
workspaceHydration.set(workspace, { records, value, complete, checkedAt: now });
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function recordNeedsSourceCacheHydration(record = {}) {
|
|
31
|
+
if (String(record.markdown || '').trim()) return false;
|
|
32
|
+
const source = record.source || {};
|
|
33
|
+
const adapter = String(source.adapterId || record.sourceMode || '').toLowerCase();
|
|
34
|
+
return adapter.includes('github') || String(record.sourceMode || '').toLowerCase().includes('source-backed');
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cachedHydratedRecord, cachedHydratedWorkspace } from './recordUi.cache.js';
|
|
2
|
+
|
|
3
|
+
function browserStorage() { return typeof window !== 'undefined' ? window.localStorage : null; }
|
|
4
|
+
|
|
5
|
+
export function hydrateUiRecord(record) {
|
|
6
|
+
return cachedHydratedRecord(record, browserStorage());
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function hydrateUiWorkspace(workspace) {
|
|
10
|
+
return cachedHydratedWorkspace(workspace, browserStorage());
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function RouteSurface(route) { return { route }; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const routes = Object.freeze(['feed','tree','detail','lineage','audit']);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { canonicalProductState } from './productStateBoundary.js';
|
|
2
|
+
import { classifyRouteLocation } from './publicTarget.js';
|
|
3
|
+
import { durableLocalAuthorityForRoute } from './historyAuthority.js';
|
|
4
|
+
|
|
5
|
+
export const CLEAN_URL_BOUNDARY = 'clean-url-does-not-bootstrap-stale-local-storage';
|
|
6
|
+
|
|
7
|
+
export function runtime() {
|
|
8
|
+
return {
|
|
9
|
+
config: window.TiinexWorkspaceConfig,
|
|
10
|
+
lifecycle: window.TiinexWorkspaceLifecycle,
|
|
11
|
+
route: window.TiinexWorkspaceRoute,
|
|
12
|
+
persistence: window.TiinexWorkspacePersistence
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function defaultState() {
|
|
17
|
+
return runtime().lifecycle?.makeEmptyAppState?.() || {
|
|
18
|
+
version: 1,
|
|
19
|
+
activeWorkspaceId: '',
|
|
20
|
+
view: { universe: 'column', workspaceVerse: 'feed', reader: 'scan', query: '', displayOptions: { leavesFirst: false, leavesOnly: true, mismatchesOnly: false, showSupportingMarkdown: false, showWorkspaceArtifacts: true, showAssets: false, schemaFilter: 'all', artifactFilter: 'all', sourceFilter: 'all' }, expandedTreeFolders: [] },
|
|
21
|
+
workspaces: [],
|
|
22
|
+
audit: null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function initialRuntimeSnapshot() {
|
|
27
|
+
const { lifecycle, route, persistence } = runtime();
|
|
28
|
+
const routeOwner = classifyRouteLocation(window.location);
|
|
29
|
+
const durableLocalAuthority = durableLocalAuthorityForRoute(routeOwner.kind, window.history?.state || null);
|
|
30
|
+
const durableLocalPolicy = durableLocalAuthority === 'isolated-preexisting-recovery' ? 'preserve-existing' : 'normal';
|
|
31
|
+
const routeResolution = routeOwner.kind === 'semantic-state'
|
|
32
|
+
? (persistence?.resolveInitialState?.({ location: window.location, storage: window.localStorage, durableLocalPolicy }) || { requested: true, resolved: false, state: null, reason: 'route-resolution-unavailable' })
|
|
33
|
+
: { requested: routeOwner.kind === 'public-target', resolved: false, state: null, reason: routeOwner.kind };
|
|
34
|
+
const routeState = routeResolution?.resolved ? routeResolution.state : null;
|
|
35
|
+
const resolved = routeState ? route?.normalizeRouteState?.(routeState, lifecycle) || routeState : defaultState();
|
|
36
|
+
return {
|
|
37
|
+
state: canonicalProductState(resolved, persistence, 'initial-state'),
|
|
38
|
+
routeResolved: Boolean(routeResolution?.resolved),
|
|
39
|
+
routeRequested: Boolean(routeResolution?.requested),
|
|
40
|
+
routeReason: routeResolution?.reason || '',
|
|
41
|
+
routeState: routeState || null,
|
|
42
|
+
routeKind: routeOwner.kind,
|
|
43
|
+
durableLocalAuthority,
|
|
44
|
+
publicTarget: routeOwner.target || null
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function initialState() {
|
|
49
|
+
return initialRuntimeSnapshot().state;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function activeWorkspace(state) {
|
|
53
|
+
return runtime().lifecycle?.activeWorkspace?.(state) || null;
|
|
54
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { parseSchemaReferenceValue } from '@tiinex/core/schemas/schema.reference.js';
|
|
2
|
+
|
|
3
|
+
export const CURRENT_SCHEMA_DECLARATION_AUTHORITY_SCHEMA_ID = 'tiinex.site.current-schema-declaration-authority.v1';
|
|
4
|
+
|
|
5
|
+
export function qualifyRecordCurrentSchemaDeclaration(record = {}, requestedSchemaId = '') {
|
|
6
|
+
let markdown;
|
|
7
|
+
try { markdown = record?.markdown; }
|
|
8
|
+
catch (exception) {
|
|
9
|
+
return freezeResult({ state: 'unavailable', materialState: 'read-failed', reason: 'concrete-material-read-failed', requestedSchemaId, exception, occurrences: [] });
|
|
10
|
+
}
|
|
11
|
+
if (typeof markdown !== 'string' || !markdown.trim()) {
|
|
12
|
+
return freezeResult({ state: 'unavailable', materialState: 'unavailable', reason: 'concrete-material-unavailable', requestedSchemaId, occurrences: [] });
|
|
13
|
+
}
|
|
14
|
+
return qualifyCurrentSchemaDeclarationMarkdown(markdown, requestedSchemaId);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function qualifyCurrentSchemaDeclarationMarkdown(markdown = '', requestedSchemaId = '') {
|
|
18
|
+
const text = String(markdown || '').replace(/\r\n?/g, '\n');
|
|
19
|
+
if (!text.trim()) return freezeResult({ state: 'unavailable', materialState: 'unavailable', reason: 'concrete-material-unavailable', requestedSchemaId, occurrences: [] });
|
|
20
|
+
const occurrences = collectCurrentSchemaOccurrences(text);
|
|
21
|
+
if (occurrences.length === 0) return freezeResult({ state: 'unavailable', materialState: 'concrete', reason: 'current-schema-declaration-missing', requestedSchemaId, occurrences });
|
|
22
|
+
if (occurrences.length > 1) return freezeResult({ state: 'ambiguous', materialState: 'concrete', reason: 'current-schema-declaration-ambiguous', requestedSchemaId, occurrences });
|
|
23
|
+
|
|
24
|
+
const observed = parseSchemaReferenceValue(occurrences[0].raw);
|
|
25
|
+
const schemaId = observed.schemaId;
|
|
26
|
+
if (!schemaId) return freezeResult({ state: 'unavailable', materialState: 'concrete', reason: 'current-schema-declaration-invalid', requestedSchemaId, schemaId: '', target: '', observed, occurrences });
|
|
27
|
+
if (requestedSchemaId && schemaId !== requestedSchemaId) {
|
|
28
|
+
return freezeResult({ state: 'mismatch', materialState: 'concrete', reason: 'current-schema-declaration-identity-mismatch', requestedSchemaId, schemaId, target: observed.target || '', observed, occurrences });
|
|
29
|
+
}
|
|
30
|
+
return freezeResult({ state: 'qualified', materialState: 'concrete', reason: '', requestedSchemaId, schemaId, target: observed.target || '', observed, occurrences });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function collectCurrentSchemaOccurrences(markdown = '') {
|
|
34
|
+
const envelope = String(markdown || '').split(/^---\s*$/m, 1)[0] || '';
|
|
35
|
+
const lines = envelope.split('\n');
|
|
36
|
+
const occurrences = [];
|
|
37
|
+
let inCurrent = false;
|
|
38
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
39
|
+
const line = lines[index];
|
|
40
|
+
if (/^-\s+Current\s*$/u.test(line)) {
|
|
41
|
+
inCurrent = true;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (/^-\s+\S/u.test(line)) {
|
|
45
|
+
inCurrent = false;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!inCurrent) continue;
|
|
49
|
+
const match = line.match(/^\s+-\s*Current Schema:\s*(.*?)\s*$/u);
|
|
50
|
+
if (!match) continue;
|
|
51
|
+
occurrences.push(Object.freeze({ line: index + 1, raw: match[1] }));
|
|
52
|
+
}
|
|
53
|
+
return occurrences;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function freezeResult(value = {}) {
|
|
57
|
+
const occurrences = Object.freeze([...(value.occurrences || [])]);
|
|
58
|
+
return Object.freeze(Object.assign({
|
|
59
|
+
schema: CURRENT_SCHEMA_DECLARATION_AUTHORITY_SCHEMA_ID,
|
|
60
|
+
state: 'unavailable',
|
|
61
|
+
materialState: 'unavailable',
|
|
62
|
+
reason: '',
|
|
63
|
+
requestedSchemaId: '',
|
|
64
|
+
schemaId: '',
|
|
65
|
+
target: '',
|
|
66
|
+
observed: null,
|
|
67
|
+
occurrences
|
|
68
|
+
}, value, { occurrences }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { createRecordFromMarkdown } from '@tiinex/core/artifacts/artifact.record.js';
|
|
2
|
+
import { buildArtifactCreationContract, createArtifactDraftMarkdown, validateArtifactCreationResult } from '@tiinex/core/schemas/creation.contracts.js';
|
|
3
|
+
import { firstMissingSchemaFactoryAuthoringInput, isSchemaFactoryViewerCreateAction, normalizeSchemaFactoryAuthoringValues, projectSchemaFactoryViewerCreateAction } from '../schemas/schema.factory.viewerProjection.js';
|
|
4
|
+
import { allocateRootArtifactPath } from '@tiinex/core/transitions/record.transitions.js';
|
|
5
|
+
import { durableLocalMutationDecision, DurableLocalMutationOperation } from './durableLocalMutationPolicy.js';
|
|
6
|
+
import { explicitPlacementPath } from './workspacePlacementOptions.js';
|
|
7
|
+
|
|
8
|
+
export const SCHEMA_FACTORY_LOCAL_CREATE_COMMAND_SCHEMA_ID = 'tiinex.site.schema-factory-local-create-command.v1';
|
|
9
|
+
|
|
10
|
+
export function executeSchemaFactoryLocalCreate(input = {}) {
|
|
11
|
+
const state = input.state || {};
|
|
12
|
+
const workspace = (state.workspaces || []).find((item) => String(item?.id || '') === String(input.workspaceId || ''));
|
|
13
|
+
if (!workspace) return refusal('workspace-not-found', state, 'Artifact cannot be created because the target workspace is unavailable.');
|
|
14
|
+
if (input.currentRecordId) return refusal('schema-factory-root-create-source-unexpected', state, 'Standalone factory creation cannot bind a selected source artifact.');
|
|
15
|
+
|
|
16
|
+
const suppliedAction = input.action || {};
|
|
17
|
+
if (!isSchemaFactoryViewerCreateAction(suppliedAction)) return refusal('schema-factory-action-required', state, 'Artifact cannot be created because the selected action is not a shared schema-factory create projection.');
|
|
18
|
+
const schemaId = String(suppliedAction?.authoring?.schemaId || '').trim();
|
|
19
|
+
const action = projectSchemaFactoryViewerCreateAction(schemaId);
|
|
20
|
+
if (!action.productCapable || action.definitionKey !== suppliedAction.definitionKey) return refusal('schema-factory-action-unqualified', state, `${action.authoring?.schemaLabel || 'Artifact'} cannot be created because its shared factory projection is not qualified.`);
|
|
21
|
+
|
|
22
|
+
const values = normalizeSchemaFactoryAuthoringValues(action, input.values || {});
|
|
23
|
+
const missing = firstMissingSchemaFactoryAuthoringInput(action, values);
|
|
24
|
+
if (missing) return refusal('schema-factory-input-incomplete', state, `Complete ${missing} before creating the local ${String(action.authoring?.schemaLabel || 'artifact').toLowerCase()}.`);
|
|
25
|
+
|
|
26
|
+
const contract = buildArtifactCreationContract({ schemaId, transitionType: 'create-artifact' });
|
|
27
|
+
if (contract.status !== 'ready' || contract.id !== action.authoring.creationContractId) return refusal('schema-factory-contract-unqualified', state, `${action.authoring?.schemaLabel || 'Artifact'} cannot be created because its exact Artifact Creation Contract is not ready.`);
|
|
28
|
+
|
|
29
|
+
const titleBinding = (contract.creation?.inputBindings || []).find((binding) => binding?.kind === 'root-current-summary-body-title');
|
|
30
|
+
const outputTitle = String(titleBinding ? values?.[titleBinding.input] : `${contract.target?.label || 'Artifact'} Draft`).trim() || `${contract.target?.label || 'Artifact'} Draft`;
|
|
31
|
+
const automaticAllocation = allocateRootArtifactPath({ targetId: schemaId, targetLabel: contract.target?.label || schemaId, title: outputTitle }, { workspaceRecords: workspace.records || [] });
|
|
32
|
+
const placementFolder = String(input.placementFolder || '').trim();
|
|
33
|
+
const requestedPath = placementFolder ? explicitPlacementPath(automaticAllocation.path, placementFolder) : '';
|
|
34
|
+
const allocation = requestedPath
|
|
35
|
+
? allocateRootArtifactPath({ targetId: schemaId, targetLabel: contract.target?.label || schemaId, title: outputTitle }, { workspaceRecords: workspace.records || [], path: requestedPath })
|
|
36
|
+
: automaticAllocation;
|
|
37
|
+
const concretePath = allocation.path || '';
|
|
38
|
+
if (!concretePath) return refusal('schema-factory-path-allocation-unavailable', state, `${contract.target?.label || 'Artifact'} cannot be created because its browser-local path could not be allocated.`);
|
|
39
|
+
|
|
40
|
+
const createdAt = input.createdAt !== undefined ? input.createdAt : (typeof input.clock === 'function' ? input.clock() : new Date());
|
|
41
|
+
let markdown = '';
|
|
42
|
+
try {
|
|
43
|
+
markdown = createArtifactDraftMarkdown(contract, { values, childPath: concretePath, createdAt });
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return refusal('schema-factory-render-failed', state, `${contract.target?.label || 'Artifact'} could not be rendered from its qualified creation contract.`, { exception: String(error?.message || error || '') });
|
|
46
|
+
}
|
|
47
|
+
if (!markdown) return refusal('schema-factory-render-unqualified', state, `${contract.target?.label || 'Artifact'} could not be rendered and validated from its qualified creation contract.`);
|
|
48
|
+
|
|
49
|
+
const artifactValidation = validateArtifactCreationResult({ schemaId, status: 'local', sourceMode: 'local-schema-factory-create', path: concretePath, markdown }, {}, { contract, childPath: concretePath });
|
|
50
|
+
if (!artifactValidation.ok) return refusal('schema-factory-validation-failed', state, `${contract.target?.label || 'Artifact'} was not committed because shared schema validation did not qualify the rendered result.`, { artifactValidation });
|
|
51
|
+
|
|
52
|
+
const authority = durableLocalMutationDecision(input.persistenceOwnership, DurableLocalMutationOperation.localDraftCreate);
|
|
53
|
+
if (!authority.ok) return refusal(authority.error || 'local-mutation-not-authorized', state, authority.notice || `Local ${contract.target?.label || 'artifact'} creation is not available in this session.`, { authority, artifactValidation });
|
|
54
|
+
if (!input.lifecycle?.addWorkspaceRecord) return refusal('workspace-lifecycle-unavailable', state, `${contract.target?.label || 'Artifact'} cannot be created because the local workspace lifecycle is unavailable.`, { artifactValidation });
|
|
55
|
+
|
|
56
|
+
const parsedRecord = createRecordFromMarkdown(markdown, { path: concretePath, sourceMode: 'local-schema-factory-create' });
|
|
57
|
+
const candidate = Object.freeze({
|
|
58
|
+
...parsedRecord,
|
|
59
|
+
sourceMode: 'local-schema-factory-create',
|
|
60
|
+
path: concretePath,
|
|
61
|
+
factoryMaterialization: Object.freeze({
|
|
62
|
+
schema: SCHEMA_FACTORY_LOCAL_CREATE_COMMAND_SCHEMA_ID,
|
|
63
|
+
descriptorSchema: action.authoring.factoryDescriptorSchema,
|
|
64
|
+
creationContractId: contract.id,
|
|
65
|
+
schemaId,
|
|
66
|
+
transitionAuthority: 'not-invoked',
|
|
67
|
+
remoteWrite: false,
|
|
68
|
+
sourceMutation: false,
|
|
69
|
+
placement: Object.freeze({ mode: placementFolder ? 'explicit-same-workspace-folder' : 'automatic', folder: placementFolder, path: concretePath })
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
const committed = input.lifecycle.addWorkspaceRecord(state, workspace.id, candidate, { clock: input.clock });
|
|
73
|
+
if (!committed?.ok) return refusal(committed?.error || 'workspace-mutation-failed', state, `${contract.target?.label || 'Artifact'} could not be added to the browser-local workspace.`, { artifactValidation });
|
|
74
|
+
|
|
75
|
+
const createdSource = committed.record?.source || {};
|
|
76
|
+
if (createdSource.adapterId === 'github' || createdSource.repository || createdSource.repo || createdSource.ref || committed.record?.sourceTarget) {
|
|
77
|
+
return refusal('post-mutation-source-boundary-violation', state, `${contract.target?.label || 'Artifact'} creation was refused because the browser-local artifact inherited source provenance.`, { artifactValidation });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return Object.freeze({
|
|
81
|
+
ok: true,
|
|
82
|
+
schema: SCHEMA_FACTORY_LOCAL_CREATE_COMMAND_SCHEMA_ID,
|
|
83
|
+
state: committed.state,
|
|
84
|
+
workspace: committed.workspace,
|
|
85
|
+
record: committed.record,
|
|
86
|
+
artifactValidation,
|
|
87
|
+
factoryDescriptor: action.authoring.builderDescriptor,
|
|
88
|
+
creationContract: contract,
|
|
89
|
+
remoteWrite: false,
|
|
90
|
+
sourceMutation: false,
|
|
91
|
+
transitionAuthority: 'not-invoked',
|
|
92
|
+
concretePath,
|
|
93
|
+
continuityMode: 'root',
|
|
94
|
+
placement: Object.freeze({ mode: placementFolder ? 'explicit-same-workspace-folder' : 'automatic', folder: placementFolder, path: concretePath }),
|
|
95
|
+
notice: `Created and schema-validated standalone local ${contract.target?.label || 'artifact'} in ${workspace.name || workspace.title || 'workspace'}.`
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function refusal(error, state, notice, extra = {}) {
|
|
100
|
+
return Object.freeze({ ok: false, schema: SCHEMA_FACTORY_LOCAL_CREATE_COMMAND_SCHEMA_ID, error, state, notice, ...extra, remoteWrite: false, sourceMutation: false, transitionAuthority: 'not-invoked', concretePath: null });
|
|
101
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { schemaFactoryViewerProofActions, schemaFactoryViewerProofCapabilities, SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS } from './schemaFactoryViewerProof.js';
|
|
4
|
+
import { buildArtifactCreationContract, renderArtifactCreationCandidateMarkdown, validateArtifactCreationResult } from '@tiinex/core/schemas/creation.contracts.js';
|
|
5
|
+
import { GENERIC_ARTIFACT_CREATION_RENDERER_ID } from '@tiinex/core/schemas/creation.renderer.js';
|
|
6
|
+
import { resolveSchemaCapabilities } from '@tiinex/core/schemas/capability.registry.js';
|
|
7
|
+
|
|
8
|
+
const projections = schemaFactoryViewerProofCapabilities();
|
|
9
|
+
assert.equal(projections.length, 6);
|
|
10
|
+
assert.deepEqual(projections.map((item) => item.authoring.schemaId), SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS);
|
|
11
|
+
assert.equal(schemaFactoryViewerProofActions().length, 0, 'No factory projection may become an invocable Create action without separately qualified Transition Definition applicability.');
|
|
12
|
+
|
|
13
|
+
for (const projection of projections) {
|
|
14
|
+
const descriptor = resolveSchemaCapabilities({ schemaId: projection.authoring.schemaId }).descriptor;
|
|
15
|
+
assert.equal(descriptor.actions.read.status, 'implemented', `${projection.authoring.schemaId} must remain readable`);
|
|
16
|
+
assert.equal(descriptor.actions.validate.status, 'implemented', `${projection.authoring.schemaId} must remain validatable`);
|
|
17
|
+
assert.equal(projection.transitionAuthority.authority, 'canonical-transition-definition');
|
|
18
|
+
assert.equal(projection.capability.invocableCreate, 'unavailable');
|
|
19
|
+
assert.equal(projection.productCapable, false);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const byId = Object.fromEntries(projections.map((item) => [item.authoring.schemaId, item]));
|
|
23
|
+
for (const schemaId of ['tiinex.decision.v1', 'tiinex.evidence.v1', 'tiinex.handoff.v1', 'tiinex.validation.finding.v1', 'tiinex.validation.report.v1']) {
|
|
24
|
+
const projection = byId[schemaId];
|
|
25
|
+
assert.equal(projection.capability.generationReady, true, `${schemaId} must retain qualified shared generation`);
|
|
26
|
+
assert.equal(projection.capability.state, 'generation-qualified-transition-unavailable');
|
|
27
|
+
assert.equal(resolveSchemaCapabilities({ schemaId }).descriptor.factory.generation.ready, true);
|
|
28
|
+
assert.equal(resolveSchemaCapabilities({ schemaId }).descriptor.factory.capabilities.generation.implementation.renderer.id, GENERIC_ARTIFACT_CREATION_RENDERER_ID);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const method = byId['tiinex.validation.method.v1'];
|
|
32
|
+
assert.equal(method.capability.generationReady, false);
|
|
33
|
+
assert.equal(method.capability.generationAuthority, 'unavailable');
|
|
34
|
+
assert.equal(method.authoring.requiredInputs.length, 0);
|
|
35
|
+
assert.equal(buildArtifactCreationContract({ schemaId: 'tiinex.validation.method.v1' }).status, 'blocked');
|
|
36
|
+
|
|
37
|
+
const report = byId['tiinex.validation.report.v1'];
|
|
38
|
+
assert.equal(report.authoring.requiredInputs.length, 11);
|
|
39
|
+
assert.ok(report.authoring.inputDescriptors.every((item) => item.kind === 'ordinary-field'));
|
|
40
|
+
const reportSummary = report.authoring.inputDescriptors.find((item) => item.name === 'Summary');
|
|
41
|
+
assert.deepEqual({ section: reportSummary.section, group: reportSummary.group, field: reportSummary.field }, { section: 'Findings Summary', group: 'Findings Summary', field: 'Summary' });
|
|
42
|
+
|
|
43
|
+
const samples = {
|
|
44
|
+
'tiinex.decision.v1': {
|
|
45
|
+
Summary: 'Viewer factory decision proof',
|
|
46
|
+
Decision: 'Use the shared schema factory rendering path.',
|
|
47
|
+
Basis: 'The Artifact Creation Contract and factory descriptor are qualified.',
|
|
48
|
+
Consequences: 'Generation remains separate from transition invocation.'
|
|
49
|
+
},
|
|
50
|
+
'tiinex.evidence.v1': {
|
|
51
|
+
'Supported Claim Or Question': 'whether Viewer generation consumes the shared factory',
|
|
52
|
+
'Evidence Role': 'supports the bounded product proof',
|
|
53
|
+
'Known Source': 'browser-local proof fixture',
|
|
54
|
+
'Preservation Basis': 'rendered through the qualified Artifact Creation Contract',
|
|
55
|
+
'Provenance Limits': 'local product proof only',
|
|
56
|
+
Material: 'factory-generated Viewer artifact',
|
|
57
|
+
'Material Kind': 'local proof record',
|
|
58
|
+
'Preservation State': 'preserved in local proof output',
|
|
59
|
+
'Fidelity Notes': 'required structured values are retained exactly',
|
|
60
|
+
'Known Losses': 'remote publication state not tested',
|
|
61
|
+
'Does Not Prove': 'invocable transition authority',
|
|
62
|
+
'Must Not Be Treated As': 'remote canonical publication proof'
|
|
63
|
+
},
|
|
64
|
+
'tiinex.handoff.v1': {
|
|
65
|
+
Purpose: 'Return bounded Viewer factory proof.',
|
|
66
|
+
From: 'Kodax',
|
|
67
|
+
'From Kind': 'role',
|
|
68
|
+
To: 'Anchor',
|
|
69
|
+
'To Kind': 'role',
|
|
70
|
+
Transfers: [{ name: 'viewer-proof', fields: { 'Transfer Kind': 'work-and-responsibility', Description: 'Exercise shared generation and validation.', Boundary: 'No synthetic transition.' } }],
|
|
71
|
+
'Required Context': 'none',
|
|
72
|
+
'Reference Context': 'none',
|
|
73
|
+
'Retained Responsibilities': [{ name: 'acceptance', fields: { 'Retained By': 'Sigma', Responsibility: 'Accept or reject the factory pattern.' } }],
|
|
74
|
+
'Exclusions And Dependencies': [{ name: 'remote-publication', fields: { Kind: 'excluded-scope', Description: 'No remote Docs publication in this proof.' } }],
|
|
75
|
+
'Completion Expectation': { 'Signal Kind': 'return', 'Signal Meaning': 'Return qualified local factory evidence.', 'Return To': 'Anchor' },
|
|
76
|
+
'Interpretation Limits': { 'Does Not Mean': 'This does not authorize broad schema fan-out.', 'Must Not Be Used To Claim': 'This does not prove transition applicability.', 'Authority Limits': 'Schema semantics remain factory/canonical-material owned.' }
|
|
77
|
+
},
|
|
78
|
+
'tiinex.validation.finding.v1': {
|
|
79
|
+
Target: 'Viewer schema factory proof',
|
|
80
|
+
'Target Kind': 'browser-local product path',
|
|
81
|
+
Method: 'shared contract-driven generation and validation',
|
|
82
|
+
'Method Scope': 'Decision Evidence Handoff Validation Finding',
|
|
83
|
+
Status: 'pass',
|
|
84
|
+
Observation: 'shared factory output validated without transition invocation',
|
|
85
|
+
'What Was Checked': 'factory descriptor generation read projection and validation',
|
|
86
|
+
'What Was Not Checked': 'remote publication or transition applicability',
|
|
87
|
+
'Recommended Response': 'retain the shared generic path',
|
|
88
|
+
'Does Not Prove': 'catalog-wide schema readiness',
|
|
89
|
+
'Must Not Be Treated As': 'semantic acceptance'
|
|
90
|
+
},
|
|
91
|
+
'tiinex.validation.report.v1': {
|
|
92
|
+
Scope: 'bounded Viewer factory scale proof',
|
|
93
|
+
Targets: 'Validation Method and Validation Report',
|
|
94
|
+
'Methods Used': 'shared descriptor renderer and validator',
|
|
95
|
+
'Method Boundaries': 'local proof only',
|
|
96
|
+
Summary: 'Generation is qualified while invocable Create remains unavailable.',
|
|
97
|
+
'Overall State': 'generation-qualified-transition-unavailable',
|
|
98
|
+
Findings: 'all eleven required inputs use ordinary-field bindings',
|
|
99
|
+
'Run Context': 'bounded Viewer proof',
|
|
100
|
+
'What Was Not Checked': 'future canonical Transition Definition applicability',
|
|
101
|
+
'Does Not Prove': 'an invocable Create action exists',
|
|
102
|
+
'Must Not Hide': 'generation and invocation are independent capability dimensions'
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const generated = [];
|
|
107
|
+
for (const schemaId of Object.keys(samples)) {
|
|
108
|
+
const contract = buildArtifactCreationContract({ schemaId });
|
|
109
|
+
assert.equal(contract.status, 'ready', `${schemaId} generation contract must remain ready`);
|
|
110
|
+
assert.equal(contract.capabilities.create, 'implemented');
|
|
111
|
+
const markdown = renderArtifactCreationCandidateMarkdown(contract, { values: samples[schemaId], createdAt: '2026-09-04T13:00:00.000Z' });
|
|
112
|
+
assert.ok(markdown, `${schemaId} must render through the shared generic generation path`);
|
|
113
|
+
const validation = validateArtifactCreationResult({ schemaId, status: 'local', sourceMode: 'local-factory-proof', path: `${schemaId}.viewer-proof.trace.md`, markdown }, {}, { contract, childPath: `${schemaId}.viewer-proof.trace.md` });
|
|
114
|
+
assert.equal(validation.counts.errors, 0, `${schemaId}: ${JSON.stringify(validation.findings, null, 2)}`);
|
|
115
|
+
generated.push({ schemaId, status: validation.status });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const reportMarkdown = renderArtifactCreationCandidateMarkdown(buildArtifactCreationContract({ schemaId: 'tiinex.validation.report.v1' }), { values: samples['tiinex.validation.report.v1'], createdAt: '2026-09-04T13:00:00.000Z' });
|
|
119
|
+
assert.ok(reportMarkdown.includes('## Findings Summary\n\n- Summary: Generation is qualified while invocable Create remains unavailable.'));
|
|
120
|
+
|
|
121
|
+
const appSource = fs.readFileSync(new URL('./TiinexApp.jsx', import.meta.url), 'utf8');
|
|
122
|
+
assert.ok(appSource.includes('schemaFactoryViewerProofActions()'), 'Workspace Create continues to consume only product-capable factory actions; unqualified generation descriptors are filtered before UI invocation.');
|
|
123
|
+
|
|
124
|
+
console.log(JSON.stringify({
|
|
125
|
+
schema: 'tiinex.site.schema-factory-viewer-proof.v2',
|
|
126
|
+
schemas: SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS,
|
|
127
|
+
generated,
|
|
128
|
+
generationQualified: projections.filter((item) => item.capability.generationReady).map((item) => item.authoring.schemaId),
|
|
129
|
+
generationUnavailable: projections.filter((item) => !item.capability.generationReady).map((item) => item.authoring.schemaId),
|
|
130
|
+
invocableCreateActions: schemaFactoryViewerProofActions().length,
|
|
131
|
+
validationErrors: 0,
|
|
132
|
+
renderer: GENERIC_ARTIFACT_CREATION_RENDERER_ID,
|
|
133
|
+
boundary: 'Viewer/Builder capability proof: read/validate, generation authority, and invocable Transition authority remain independent.'
|
|
134
|
+
}, null, 2));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { projectSchemaFactoryViewerCreateAction, projectSchemaFactoryViewerCreateActions } from '../schemas/schema.factory.viewerProjection.js';
|
|
2
|
+
|
|
3
|
+
export const SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS = Object.freeze([
|
|
4
|
+
'tiinex.decision.v1',
|
|
5
|
+
'tiinex.evidence.v1',
|
|
6
|
+
'tiinex.handoff.v1',
|
|
7
|
+
'tiinex.validation.finding.v1',
|
|
8
|
+
'tiinex.validation.method.v1',
|
|
9
|
+
'tiinex.validation.report.v1'
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export function schemaFactoryViewerProofCapabilities() {
|
|
13
|
+
return Object.freeze(SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS.map(projectSchemaFactoryViewerCreateAction));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function schemaFactoryViewerProofActions() {
|
|
17
|
+
return projectSchemaFactoryViewerCreateActions(SCHEMA_FACTORY_VIEWER_PROOF_SCHEMA_IDS);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const SCHEMA_FACTORY_VIEWER_PROOF_BOUNDARY = 'Task-bounded Viewer qualification set only. Membership is product-proof scope, not schema semantics, transition applicability, companion policy, or catalog-wide creatability authority. Generation descriptors remain visible even when no invocable Create transition is qualified.';
|