feat: add p-rec-update plant 3d 2026 slice

This commit is contained in:
codex
2026-08-06 16:40:38 +03:00
parent c3ac183fff
commit ca0f49ee5a
165 changed files with 8530 additions and 0 deletions
@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Deterministic>true</Deterministic>
<DebugType>portable</DebugType>
<AutoCAD2026ManagedDir Condition="'$(AutoCAD2026ManagedDir)' == '' and '$(Plant3D2026InstallDir)' != ''">$(Plant3D2026InstallDir)</AutoCAD2026ManagedDir>
<Plant3D2026ManagedDir Condition="'$(Plant3D2026ManagedDir)' == '' and '$(Plant3D2026InstallDir)' != ''">$(Plant3D2026InstallDir)\PLNT3D</Plant3D2026ManagedDir>
<Plant3D2026InstallDir Condition="'$(Plant3D2026InstallDir)' == '' and '$(AutoCAD2026ManagedDir)' != ''">$(AutoCAD2026ManagedDir)</Plant3D2026InstallDir>
</PropertyGroup>
</Project>
@@ -0,0 +1,30 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PRecUpdate.Core", "src\PRecUpdate.Core\PRecUpdate.Core.csproj", "{20000000-0000-0000-0000-000000000001}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PRecUpdate.Plant3D2026", "src\PRecUpdate.Plant3D2026\PRecUpdate.Plant3D2026.csproj", "{20000000-0000-0000-0000-000000000002}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PRecUpdate.Core.Tests", "tests\PRecUpdate.Core.Tests\PRecUpdate.Core.Tests.csproj", "{20000000-0000-0000-0000-000000000003}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{20000000-0000-0000-0000-000000000001}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000001}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000001}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000001}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000002}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000002}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000002}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000003}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000003}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000003}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
@@ -0,0 +1,27 @@
# P_Rec_Update capability contract
Selected legacy provenance is `\\phpsrv03\NBIM\code\CS\P_Rec_Update\P_Rec_Update\P_Rec_Update.csproj`
(SHA-256 `1945B572CEE3A308320C164549D38C95C4ED40183347CE341ACD481ED3895BFD`). It is the
expanded successor to the 2023 `_v2.1` line: it exposes `P-R-UPD`, initializes an
Update ribbon panel, and presents four selectable operations in `Main_Form`.
| Source-backed operation | Legacy effects | 2026 status |
|---|---|---|
| Project NKR | reads project XML and `Settings_NKR.xml`; updates NKR-related project data | DryRun plan and preconditions implemented; Apply blocked |
| Flanges | reads Piping DataLinks and geometry; may update support/flange-related data | DryRun plan and preconditions implemented; Apply blocked |
| Fasteners | reads EngineeringItems and may update ItemCode values | DryRun plan and preconditions implemented; Apply blocked |
| Project Spec | reads spec/project database and may update `LinearWeight` | DryRun plan and preconditions implemented; Apply blocked |
The 2026 entry assembly preserves `P-R-UPD` and adds `P-R-UPD-STATUS` for a
non-mutating controlled registration check. It is deterministic and refuses an
Apply-capable plan without an explicit controlled-fixture permit.
## Exact dependency blocker for domain Apply
The legacy code directly binds Plant 2019 DataLinks/SQLite schemas, the external
`GetComponentGeometryDescription.dll`, package-local `Settings_Flanges.xml` /
`Settings_NKR.xml`, and a hard-coded legacy template path. No controlled Plant 2026
fixture containing the required Piping rows, EngineeringItems/spec records and
expected post-state has been supplied. Therefore domain mutation is intentionally
not attempted. This is `EXACT_DEPENDENCY_BLOCKER`, not a claim of completed Apply
parity. Assembly load and command registration remain independently verifiable.
@@ -0,0 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><TargetFramework>net8.0</TargetFramework></PropertyGroup>
</Project>
@@ -0,0 +1,63 @@
namespace PRecUpdate.Core;
public enum UpdateOperation
{
ProjectNkr,
Flanges,
Fasteners,
ProjectSpec
}
public enum UpdateExecutionMode
{
DryRun,
Apply
}
public sealed record UpdateRequest(
bool HasActiveDocument,
bool HasPlantProject,
bool HasPipingProjectPart,
IReadOnlySet<UpdateOperation> SelectedOperations,
UpdateExecutionMode Mode,
bool ControlledFixturePermit);
public sealed record UpdatePlan(
bool Accepted,
IReadOnlyList<UpdateOperation> Operations,
IReadOnlyList<string> Diagnostics,
bool MayWriteDrawing,
bool MayWriteProjectData);
/// <summary>
/// Source-backed planner for the four operations exposed by legacy P_Rec_Update.
/// It intentionally contains no Autodesk calls or file writes, which makes the
/// safety decision deterministic before a Plant transaction can be opened.
/// </summary>
public sealed class UpdatePlanBuilder
{
private static readonly UpdateOperation[] CanonicalOrder =
[
UpdateOperation.ProjectNkr,
UpdateOperation.Flanges,
UpdateOperation.Fasteners,
UpdateOperation.ProjectSpec
];
public UpdatePlan Build(UpdateRequest request)
{
ArgumentNullException.ThrowIfNull(request);
var diagnostics = new List<string>();
if (!request.HasActiveDocument) diagnostics.Add("ACTIVE_DOCUMENT_REQUIRED");
if (!request.HasPlantProject) diagnostics.Add("PLANT_PROJECT_REQUIRED");
if (!request.HasPipingProjectPart) diagnostics.Add("PIPING_PROJECT_PART_REQUIRED");
if (request.SelectedOperations.Count == 0) diagnostics.Add("UPDATE_OPERATION_REQUIRED");
if (request.Mode == UpdateExecutionMode.Apply && !request.ControlledFixturePermit)
diagnostics.Add("CONTROLLED_FIXTURE_PERMIT_REQUIRED");
var ordered = CanonicalOrder.Where(request.SelectedOperations.Contains).ToArray();
var accepted = diagnostics.Count == 0;
var apply = accepted && request.Mode == UpdateExecutionMode.Apply;
return new UpdatePlan(accepted, ordered, diagnostics, apply, apply);
}
}
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"PRecUpdate.Core/1.0.0": {
"runtime": {
"PRecUpdate.Core.dll": {}
}
}
}
},
"libraries": {
"PRecUpdate.Core/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
@@ -0,0 +1,67 @@
{
"format": 1,
"restore": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj": {}
},
"projects": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"projectName": "PRecUpdate.Core",
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"packagesPath": "C:\\Users\\codex\\.nuget\\packages\\",
"outputPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\codex\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.423/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\codex\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\codex\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("PRecUpdate.Core")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c3ac183fffdbd353bfd96d3e55dfff47a661ec3a")]
[assembly: System.Reflection.AssemblyProductAttribute("PRecUpdate.Core")]
[assembly: System.Reflection.AssemblyTitleAttribute("PRecUpdate.Core")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.
@@ -0,0 +1 @@
b1da87f62c7b368fff25a5954a14ff14663487226d61f622919049edf0e601a6
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = PRecUpdate.Core
build_property.ProjectDir = C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
@@ -0,0 +1 @@
931d275faafb744847074b374703e1d3240d36011f3689a71b6a95fc5a6a0502
@@ -0,0 +1,11 @@
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\bin\Release\net8.0\PRecUpdate.Core.deps.json
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\bin\Release\net8.0\PRecUpdate.Core.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\bin\Release\net8.0\PRecUpdate.Core.pdb
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.GeneratedMSBuildEditorConfig.editorconfig
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.AssemblyInfoInputs.cache
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.AssemblyInfo.cs
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.csproj.CoreCompileInputs.cache
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\refint\PRecUpdate.Core.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\PRecUpdate.Core.pdb
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Core\obj\Release\net8.0\ref\PRecUpdate.Core.dll
@@ -0,0 +1,72 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\codex\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"projectName": "PRecUpdate.Core",
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"packagesPath": "C:\\Users\\codex\\.nuget\\packages\\",
"outputPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\codex\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.423/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "BnSucAuYJHU=",
"success": true,
"projectFilePath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"expectedPackageFiles": [],
"logs": []
}
@@ -0,0 +1,3 @@
using Autodesk.AutoCAD.Runtime;
[assembly: CommandClass(typeof(PRecUpdate.Plant3D2026.EntryPoint))]
@@ -0,0 +1,49 @@
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Runtime;
using PRecUpdate.Core;
using AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application;
namespace PRecUpdate.Plant3D2026;
public sealed class EntryPoint : IExtensionApplication
{
public void Initialize()
{
RuntimeMarker.Write("AssemblyInitializeStarted");
RuntimeMarker.Write("AssemblyInitializeCompleted");
}
public void Terminate() => RuntimeMarker.Write("AssemblyTerminateCompleted");
// Preserves the legacy command name. Apply remains denied unless a future
// controlled fixture adapter proves the legacy Plant/DataLinks semantics.
[CommandMethod("P-R-UPD", CommandFlags.Session)]
public void UpdateCommand() => ReportPlan("P-R-UPD");
[CommandMethod("P-R-UPD-STATUS", CommandFlags.Session)]
public void StatusCommand() => ReportPlan("P-R-UPD-STATUS");
private static void ReportPlan(string command)
{
var document = AcadApplication.DocumentManager.MdiActiveDocument;
var plan = new UpdatePlanBuilder().Build(new UpdateRequest(
document is not null,
HasPlantProject(),
HasPlantProject(),
new HashSet<UpdateOperation>
{
UpdateOperation.ProjectNkr, UpdateOperation.Flanges,
UpdateOperation.Fasteners, UpdateOperation.ProjectSpec
},
UpdateExecutionMode.DryRun,
ControlledFixturePermit: false));
document?.Editor.WriteMessage($"\nP_Rec_Update {command}: {(plan.Accepted ? "DryRun planned; no project data changed." : string.Join(", ", plan.Diagnostics))}");
RuntimeMarker.Write(plan.Accepted ? "CommandRegistrationVerified" : "CommandPreflightRejected");
}
private static bool HasPlantProject()
{
try { return Autodesk.ProcessPower.PlantInstance.PlantApplication.CurrentProject is not null; }
catch { return false; }
}
}
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework><PlatformTarget>x64</PlatformTarget>
<AssemblyName>PRecUpdate.Plant3D2026</AssemblyName>
</PropertyGroup>
<ItemGroup><ProjectReference Include="..\PRecUpdate.Core\PRecUpdate.Core.csproj" /></ItemGroup>
<ItemGroup Condition="Exists('$(AutoCAD2026ManagedDir)')">
<Reference Include="AcMgd"><HintPath>$(AutoCAD2026ManagedDir)\AcMgd.dll</HintPath><Private>false</Private><CopyLocal>false</CopyLocal></Reference>
<Reference Include="AcDbMgd"><HintPath>$(AutoCAD2026ManagedDir)\AcDbMgd.dll</HintPath><Private>false</Private><CopyLocal>false</CopyLocal></Reference>
<Reference Include="AcCoreMgd"><HintPath>$(AutoCAD2026ManagedDir)\AcCoreMgd.dll</HintPath><Private>false</Private><CopyLocal>false</CopyLocal></Reference>
<Reference Include="PnPProjectManagerMgd" Condition="Exists('$(Plant3D2026ManagedDir)\PnPProjectManagerMgd.dll')"><HintPath>$(Plant3D2026ManagedDir)\PnPProjectManagerMgd.dll</HintPath><Private>false</Private><CopyLocal>false</CopyLocal></Reference>
</ItemGroup>
</Project>
@@ -0,0 +1,27 @@
using System.Security.Cryptography;
using System.Text;
namespace PRecUpdate.Plant3D2026;
internal static class RuntimeMarker
{
internal static void Write(string state)
{
var root = Environment.GetEnvironmentVariable("P_REC_UPDATE_MARKER_ROOT");
if (string.IsNullOrWhiteSpace(root)) return;
try
{
Directory.CreateDirectory(root);
var payload = $"{DateTimeOffset.UtcNow:O}|{state}|{typeof(EntryPoint).Assembly.GetName().Name}";
File.WriteAllText(Path.Combine(root, state + ".marker"), payload, new UTF8Encoding(false));
}
catch { /* Evidence cannot make Plant initialization fail. */ }
}
internal static string AssemblySha256()
{
var location = typeof(EntryPoint).Assembly.Location;
using var stream = File.OpenRead(location);
return Convert.ToHexString(SHA256.HashData(stream));
}
}
@@ -0,0 +1,39 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"PRecUpdate.Plant3D2026/1.0.0": {
"dependencies": {
"PRecUpdate.Core": "1.0.0"
},
"runtime": {
"PRecUpdate.Plant3D2026.dll": {}
}
},
"PRecUpdate.Core/1.0.0": {
"runtime": {
"PRecUpdate.Core.dll": {
"assemblyVersion": "1.0.0",
"fileVersion": "1.0.0.0"
}
}
}
}
},
"libraries": {
"PRecUpdate.Plant3D2026/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"PRecUpdate.Core/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
@@ -0,0 +1,130 @@
{
"format": 1,
"restore": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj": {}
},
"projects": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"projectName": "PRecUpdate.Core",
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj",
"packagesPath": "C:\\Users\\codex\\.nuget\\packages\\",
"outputPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\codex\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.423/PortableRuntimeIdentifierGraph.json"
}
}
},
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj",
"projectName": "PRecUpdate.Plant3D2026",
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj",
"packagesPath": "C:\\Users\\codex\\.nuget\\packages\\",
"outputPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\codex\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0-windows7.0": {
"targetAlias": "net8.0-windows",
"projectReferences": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj": {
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj"
}
}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0-windows7.0": {
"targetAlias": "net8.0-windows",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.423/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\codex\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\codex\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("PRecUpdate.Plant3D2026")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c3ac183fffdbd353bfd96d3e55dfff47a661ec3a")]
[assembly: System.Reflection.AssemblyProductAttribute("PRecUpdate.Plant3D2026")]
[assembly: System.Reflection.AssemblyTitleAttribute("PRecUpdate.Plant3D2026")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Создано классом WriteCodeFragment MSBuild.
@@ -0,0 +1 @@
682b6989a687db82779b40f415b89b18ed3478f81acc7b20af0606373c276e10
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = PRecUpdate.Plant3D2026
build_property.ProjectDir = C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
@@ -0,0 +1 @@
ade5d91c57cf0f5fd89f1f07c0955959365678d4f89462207c831dd45b20ab2d
@@ -0,0 +1,15 @@
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.csproj.AssemblyReference.cache
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.GeneratedMSBuildEditorConfig.editorconfig
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.AssemblyInfoInputs.cache
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.AssemblyInfo.cs
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.csproj.CoreCompileInputs.cache
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\bin\Release\net8.0-windows\PRecUpdate.Plant3D2026.deps.json
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\bin\Release\net8.0-windows\PRecUpdate.Plant3D2026.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\bin\Release\net8.0-windows\PRecUpdate.Plant3D2026.pdb
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\bin\Release\net8.0-windows\PRecUpdate.Core.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\bin\Release\net8.0-windows\PRecUpdate.Core.pdb
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpda.65EEC080.Up2Date
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\refint\PRecUpdate.Plant3D2026.dll
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\PRecUpdate.Plant3D2026.pdb
C:\dev\worktrees\autodesk-plant3d-2026-integration\Plant3D2026\P_Rec_Update\src\PRecUpdate.Plant3D2026\obj\Release\net8.0-windows\ref\PRecUpdate.Plant3D2026.dll
@@ -0,0 +1,95 @@
{
"version": 3,
"targets": {
"net8.0-windows7.0": {
"PRecUpdate.Core/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"compile": {
"bin/placeholder/PRecUpdate.Core.dll": {}
},
"runtime": {
"bin/placeholder/PRecUpdate.Core.dll": {}
}
}
}
},
"libraries": {
"PRecUpdate.Core/1.0.0": {
"type": "project",
"path": "../PRecUpdate.Core/PRecUpdate.Core.csproj",
"msbuildProject": "../PRecUpdate.Core/PRecUpdate.Core.csproj"
}
},
"projectFileDependencyGroups": {
"net8.0-windows7.0": [
"PRecUpdate.Core >= 1.0.0"
]
},
"packageFolders": {
"C:\\Users\\codex\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj",
"projectName": "PRecUpdate.Plant3D2026",
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj",
"packagesPath": "C:\\Users\\codex\\.nuget\\packages\\",
"outputPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\codex\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0-windows7.0": {
"targetAlias": "net8.0-windows",
"projectReferences": {
"C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj": {
"projectPath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Core\\PRecUpdate.Core.csproj"
}
}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0-windows7.0": {
"targetAlias": "net8.0-windows",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.423/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "mjO3sU71BBQ=",
"success": true,
"projectFilePath": "C:\\dev\\worktrees\\autodesk-plant3d-2026-integration\\Plant3D2026\\P_Rec_Update\\src\\PRecUpdate.Plant3D2026\\PRecUpdate.Plant3D2026.csproj",
"expectedPackageFiles": [],
"logs": []
}
@@ -0,0 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><TargetFramework>net8.0</TargetFramework><IsPackable>false</IsPackable><IsTestProject>true</IsTestProject></PropertyGroup>
<ItemGroup><ProjectReference Include="..\..\src\PRecUpdate.Core\PRecUpdate.Core.csproj" /></ItemGroup>
<ItemGroup><PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /><PackageReference Include="xunit" Version="2.5.3" /><PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" /></ItemGroup>
<ItemGroup><Using Include="Xunit" /></ItemGroup>
</Project>
@@ -0,0 +1,49 @@
using PRecUpdate.Core;
namespace PRecUpdate.Core.Tests;
public sealed class UpdatePlanBuilderTests
{
private readonly UpdatePlanBuilder builder = new();
[Fact]
public void DryRun_orders_selected_operations_without_writes()
{
var plan = builder.Build(new UpdateRequest(true, true, true,
new HashSet<UpdateOperation> { UpdateOperation.Fasteners, UpdateOperation.ProjectNkr }, UpdateExecutionMode.DryRun, false));
Assert.True(plan.Accepted);
Assert.Equal(new[] { UpdateOperation.ProjectNkr, UpdateOperation.Fasteners }, plan.Operations);
Assert.False(plan.MayWriteDrawing);
Assert.False(plan.MayWriteProjectData);
}
[Fact]
public void Rejects_missing_project_and_empty_selection()
{
var plan = builder.Build(new UpdateRequest(false, false, false, new HashSet<UpdateOperation>(), UpdateExecutionMode.DryRun, false));
Assert.False(plan.Accepted);
Assert.Contains("ACTIVE_DOCUMENT_REQUIRED", plan.Diagnostics);
Assert.Contains("PLANT_PROJECT_REQUIRED", plan.Diagnostics);
Assert.Contains("PIPING_PROJECT_PART_REQUIRED", plan.Diagnostics);
Assert.Contains("UPDATE_OPERATION_REQUIRED", plan.Diagnostics);
}
[Fact]
public void Apply_requires_explicit_controlled_fixture_permit()
{
var plan = builder.Build(new UpdateRequest(true, true, true,
new HashSet<UpdateOperation> { UpdateOperation.ProjectSpec }, UpdateExecutionMode.Apply, false));
Assert.False(plan.Accepted);
Assert.Contains("CONTROLLED_FIXTURE_PERMIT_REQUIRED", plan.Diagnostics);
}
[Fact]
public void Permitted_apply_is_the_only_write_capable_plan()
{
var plan = builder.Build(new UpdateRequest(true, true, true,
new HashSet<UpdateOperation> { UpdateOperation.ProjectSpec }, UpdateExecutionMode.Apply, true));
Assert.True(plan.Accepted);
Assert.True(plan.MayWriteDrawing);
Assert.True(plan.MayWriteProjectData);
}
}
@@ -0,0 +1,13 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Some files were not shown because too many files have changed in this diff Show More