Skip to content

Comments

refactor(ghjson): externalize GhJSON libraries to ghjson-dotnet NuGet packages#379

Merged
marc-romu merged 45 commits intomainfrom
dev
Feb 8, 2026
Merged

refactor(ghjson): externalize GhJSON libraries to ghjson-dotnet NuGet packages#379
marc-romu merged 45 commits intomainfrom
dev

Conversation

@marc-romu
Copy link
Member

Description

This release migrates all GhJSON-related code to external NuGet packages (ghjson-dotnet), simplifying the SmartHopper codebase and enabling independent development and versioning of the GhJSON library. The migration includes comprehensive API refactoring to use organized façade classes exclusively.

Highlights

  • GhJSON API Simplification: All SmartHopper code now imports only GhJSON.Core and GhJSON.Grasshopper namespaces, removing deep namespace dependencies
  • Façade Pattern: Unified access points via GhJson.* and GhJsonGrasshopper.* static methods
  • Serialization Options: New factory methods GhJsonGrasshopper.Options.Standard(), .Optimized(), and .Lite()
  • Script Components: Centralized via GhJsonGrasshopper.Script.* methods
  • Document Operations: Unified via GhJson.CreateDocument(), .Merge(), .Parse(), .Fix(), .IsValid(), .Serialize()

Tool-Specific Updates

  • gh_get: Delegates to GhJsonGrasshopper.GetWithOptions() with options factories and ExtractRuntimeData()
  • gh_put: Uses GhJsonGrasshopper.Put() with PutOptions.PreserveExternalConnections
  • gh_merge: Uses GhJson.Merge() façade
  • gh_tidy_up: Uses GhJsonGrasshopper.Options.Standard()
  • gh_connect: Delegates to GhJsonGrasshopper.ConnectComponents()
  • script_edit, script_generate: Use GhJsonGrasshopper.Script.* façade methods

Additional Changes

  • Added annual automation to update copyright years in src/**/*.csproj and normalize C# license headers
  • Changed ISelectingComponent to use IGH_DocumentObject instead of IGH_ActiveObject to support scribble selection
  • Removed legacy ScriptParameterSettingsParser.cs (now in ghjson-dotnet façade)
  • Updated documentation and version to 1.3.0-dev

Breaking Changes

  • Internal refactoring only: No public API changes for plugin consumers
  • Code that directly referenced internal GhJSON namespaces (e.g., GhJSON.Core.Models.*, GhJSON.Grasshopper.Serialization.*) must update to use façade methods

Testing Done

  • Verified all AI tools function correctly with the new ghjson-dotnet integration
  • Tested serialization/deserialization round-trips via façade methods
  • Confirmed script component handling works with new GhJsonGrasshopper.Script.* API
  • Validated connection depth expansion and external connection preservation in gh_get/gh_put

Checklist

  • This PR is focused on a single feature or bug fix
  • Version in Solution.props was updated, if necessary, and follows semantic versioning
  • CHANGELOG.md has been updated
  • PR title follows Conventional Commits format
  • PR description follows Pull Request Description Template

…lization APIs

- Updated using statements to use GhJSON.Core.Serialization namespace
- Replaced GHJsonConverter with GhJsonConverter (casing change)
- Replaced GHJsonAnalyzer with GhJsonValidator for validation
- Updated ComponentPlacer.PlaceComponents to use new signature with guidMapping parameter
- Updated ConnectionManager.CreateConnections to use new signature with document and guidMapping
- Updated GroupManager.CreateGroups to use new signature
…obsolete serialization utilities

- Set IncludePersistentData to false in all SerializationOptions instances in gh_get.cs to reduce token usage
- Updated serialization logic to use SerializationOptions.Optimized consistently
- Changed IncludePersistentData flag to be controlled by includeRuntimeData parameter instead of using Standard/Optimized presets
- Removed obsolete DataTreeConverter.cs utility class
- Removed obsolete Property
… and consolidate helper methods

- Updated using statements across AITools to use GhJSON.Core and GhJSON.Grasshopper namespaces
- Removed obsolete SmartHopper.Core.Grasshopper.Utils.Serialization namespace references
- Added ScriptComponentHelper.ConvertToParameterSettings method to convert JArray parameters to ParameterSettings
- Updated script_edit and script_generate to use new ParameterSettings conversion approach
- Changed script_generate
- Changed trailing spaces to consistent format in license headers
- Updated all DataProcessor test components
- Updated all Badges test components
- No functional changes, whitespace-only formatting
… into refactor/1.3.0-externalizing-ghjson-libraries
… into refactor/1.3.0-externalizing-ghjson-libraries
- Updated all AI tools to import only `GhJSON.Core` and `GhJSON.Grasshopper` namespaces
- Replaced direct serialization API calls with organized façade methods:
  - `GhJsonGrasshopper.Options.*()` factory methods for serialization options
  - `GhJsonGrasshopper.Serialize()` and `GhJsonGrasshopper.ExtractRuntimeData()` for serialization
…er.cs encoding

- Added CopyLocalLockFileAssemblies property to Core.Grasshopper project to ensure dependency assemblies are copied to output
- Changed FilterParser.cs file encoding from ASCII to UTF-8 with BOM
…n-dotnet integration

- Removed ghjson-dotnet façade dependency from `_gh_connect` and implemented direct Grasshopper wiring logic
- Updated `_gh_generate` to use GhJSON schema models directly instead of ComponentSpecBuilder
- Refactored `gh_get` to serialize selected objects directly, removing GetWithOptions pipeline (connection depth expansion not yet implemented)
- Updated `gh_merge` and `gh_put` to use renamed ghjson-dotnet methods
…Keys.cs encoding

- Updated version badge in README.md from 1.3.0-dev to 1.3.0-dev.260207
- Updated SolutionVersion in Solution.props to 1.3.0-dev.260207
- Changed GhJsonExtensionKeys.cs file encoding from ASCII to UTF-8 with BOM
…ve obsolete utility classes

- Updated gh_get to use CanvasSelector query API for filtering objects instead of manual filtering
- Implemented connection depth expansion via CanvasSelector.WithConnected()
- Removed obsolete ConnectionGraphUtils class (graph traversal now handled by ghjson-dotnet)
- Removed obsolete ComponentRetriever class (filtering logic moved to FilterParser in ghjson-dotnet)
- Updated gh_list_components to use Filter
…l connection handling in gh_get and gh_put

- gh_get: Restored full filter pipeline (attribute, type, and category filters) and connection depth expansion using ConnectionGraphUtils.ExpandByDepth()
- gh_get: Added includeMetadata parameter support to serialization options
- gh_put: Restored external connection capture and reconnection in edit mode, preserving component integration when replacing components
…d of IGH_ActiveObject to support scribbles

- Updated ISelectingComponent.SelectedObjects property type from List<IGH_ActiveObject> to List<IGH_DocumentObject>
- Applied change across SelectingComponentBase, AISelectingStatefulAsyncComponentBase, and SelectingComponentCore
- Removed type filtering in SelectingComponentCore.OnSelectionChanged() since scribbles (GH_Scribble) implement IGH_DocumentObject but not IGH_ActiveObject
…tructure

- Removed legacy "id" field handling from mcneel_forum_post tool (now only uses "ids" array)
- Removed unused ToLegacyString() method from AIRuntimeMessage
- Removed legacy references from code comments in AIBodyBuilder, AIBodyExtensions, and ContextInjectionRequestPolicy
…orkflow

- Removed header-fixer action and all references from code-style workflows
- Deleted .github/actions/code-style/header-fixer/action.yml
- Removed header-fixer job from user-code-style.yml workflow
- Removed header-fixer validation step from pr-validation.yml
- Updated commit-changes job dependencies to exclude header-fixer
- Fixed line ending normalization in Update-LicenseHeaders.ps1 to prevent false positives when comparing file
… references

- Changed GhJSON.Core and GhJSON.Grasshopper from local project references to NuGet package references (version 1.0.0)
- Updated SmartHopper.Core.Grasshopper.csproj to use PackageReference for both GhJSON packages
- Updated SmartHopper.Core.csproj to use PackageReference for GhJSON.Core
…header comparison

- Changed backtick-escaped sequences (`r`n, `r?`n) to properly escaped regex patterns ("\r\n", "\r?\n")
- Fixes false positive detection when comparing normalized content with original content
…ge (#374)

## Description

This PR completes the migration of all GhJSON functionality from the
SmartHopper monolith to the external `ghjson-dotnet` library. The
refactoring centralizes JSON serialization/deserialization, canvas
operations, and document manipulation into a clean façade API that can
be maintained and versioned independently.

**Key Architectural Changes:**
- **API Consolidation**: All SmartHopper code now imports only
`GhJSON.Core` and `GhJSON.Grasshopper` top-level namespaces—no deep
dependencies on `GhJSON.Core.Models.*` or internal serialization classes
- **Façade Pattern**: Canvas operations (Put, Get, Merge, Connect) and
script component utilities are now accessed through
`GhJsonGrasshopper.*` static methods instead of direct serializer
instantiation
- **Factory-Based Options**: Serialization contexts standardized to
`GhJsonGrasshopper.Options.Standard()`, `.Optimized()`, and `.Lite()`
factory methods
- **Code Removal**: Eliminated ~15,000 lines of redundant code including
legacy `ScriptParameterSettingsParser`, obsolete serialization
utilities, and duplicated canvas helpers

**Tool-Specific Updates:**
- `gh_get` / `gh_put` / `gh_merge` / `gh_tidy_up` / `gh_connect` /
`script_edit` / `script_generate` — all migrated to façade APIs
- Persistent data serialization disabled in `gh_get` by default (runtime
data still available via `ExtractRuntimeData` for `_with_data` variants)

## Breaking Changes

None for end-users. All changes are internal refactoring; public
Grasshopper component APIs remain unchanged.

## Testing Done

- [x] Verified `gh_get` filter pipeline restoration (attribute, type,
category filters)
- [x] Verified `gh_get` connection depth expansion functionality
- [x] Verified `gh_put` external connection preservation in edit mode
- [x] Validated script component serialization/deserialization
round-trips
- [x] Checked AI tool orchestration with new façade methods

## Checklist

- [x] This PR is focused on a single feature (GhJSON externalization)
- [x] Version bumped to 1.3.0-dev in Solution.props
- [x] CHANGELOG.md updated with [Unreleased] changes
- [x] PR title follows Conventional Commits format
- [x] PR description follows the template
actions-user and others added 12 commits February 8, 2026 01:34
This PR updates the development version date in Solution.props to
reflect the latest changes.

This is an automated PR created by the Update Development Version Date
workflow.
…tadata in Directory.Build.props

- Added GitHub Actions workflow to automatically update copyright years on January 1st each year
- Created Update-CopyrightYear.ps1 script to update <Copyright> metadata in Directory.Build.props
- Centralized Version, Company, Authors, and Copyright metadata in Directory.Build.props
- Removed duplicate metadata properties from all project files (*.csproj)
- Added LGPL license headers to all project
…ve license header tooling

- Removed <?xml version="1.0" encoding="utf-8"?> declarations from all .csproj files (SDK-style projects don't require them)
- Updated Update-InternalsVisibleTo.ps1 to use regex instead of XML parsing to avoid failures when license comments precede <Project> element
- Enhanced Update-LicenseHeaders.ps1 to strip XML declarations before and after license comments in .csproj files
- Added build artifact directory
…tadata in Directory.Build.props (#376)

## Description

Added GitHub Actions workflow to automatically update copyright years on
January 1st each year and centralized project metadata in
Directory.Build.props to eliminate duplication across all project files.

- Created `chore-update-copyright-year.yml` workflow that runs annually
on January 1st to update copyright years
- Added `Update-CopyrightYear.ps1` script to update `<Copyright>`
metadata in Directory.Build.props
- Centralized Version, Company, Authors, and Copyright metadata in
Directory.Build.props
- Removed duplicate metadata properties from all project files
(*.csproj)
- Added LGPL license headers to all project files

## Breaking Changes

No breaking changes.

## Testing Done

- Verified GitHub Actions workflow syntax and configuration
- Tested PowerShell script for updating copyright years
- Confirmed all project files inherit metadata from
Directory.Build.props
- Validated that solution builds successfully with centralized metadata

## Checklist

- [x] This PR is focused on a single feature or bug fix
- [x] Version in Solution.props was updated, if necessary, and follows
semantic versioning
- [x] CHANGELOG.md has been updated
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/en/v1.1.0/) format
- [x] PR description follows [Pull Request Description
Template](https://github.com/architects-toolkit/SmartHopper/blob/main/CONTRIBUTING.md#pull-request-description-template)
…nd ghjson-dotnet references

- Added Category column to Components table organizing by Grasshopper, AI, Text, Img, Script, List, Knowledge, and Misc
- Added Category column to AI Tools table organizing by DataProcessing, Script, NotTested, Instructions, Knowledge, Components, Parameters, and Rhino
- Updated component descriptions for clarity (e.g., "Get GhJSON" instead of "Get Components", expanded filter descriptions)
…sion-specific release notes

- Added dev-update-manifest.yml workflow to automatically update manifest.yml text based on version type (alpha/beta/stable) when Solution.props changes in dev branch
- Added pr-manifest-validation.yml workflow to validate manifest text matches version type before merging to main
- Added pr-dependency-validation.yml workflow to enforce PackageReference usage for GhJSON dependencies instead of ProjectReferences
…n AboutDialog

- Updated copyright year from 2024-2025 to 2024-2026 in AboutDialog.cs
- Modified AboutDialog to only display development warning for prerelease versions (versions containing "-")
- Enhanced Update-CopyrightYear.ps1 to update copyright in both Directory.Build.props and AboutDialog.cs
- Refactored AboutDialog layout construction to use dynamic item addition instead of static declaration
…n AboutMenuItem

- Removed System.Reflection using statement from AboutMenuItem.cs
- Replaced Assembly.GetExecutingAssembly() runtime version retrieval with compile-time SOLUTION_VERSION constant
- Added DefineConstants in SmartHopper.Menu.csproj to inject SolutionVersion as SOLUTION_VERSION preprocessor definition
…tribute in AboutMenuItem

- Added System.Reflection using statement to AboutMenuItem.cs
- Replaced SOLUTION_VERSION compile-time constant with runtime retrieval of AssemblyInformationalVersionAttribute
- Removed DefineConstants preprocessor definition from SmartHopper.Menu.csproj
- Added InformationalVersion property in SmartHopper.Menu.csproj to inject SolutionVersion into assembly metadata
@marc-romu marc-romu added this to the 1.3.0-alpha milestone Feb 8, 2026
Copilot AI review requested due to automatic review settings February 8, 2026 15:15
@marc-romu marc-romu added component: GhGet Issues related to the Grasshopper Get Components component component: GhPut Issues related to the Grasshopper Put Components component labels Feb 8, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates SmartHopper’s GhJSON integration from in-repo implementations to external ghjson-dotnet NuGet packages, consolidating usage behind façade APIs and reducing SmartHopper’s internal GhJSON surface area.

Changes:

  • Removed internal GhJSON models/utilities and updated tools/graph code to use GhJSON.Core / GhJSON.Grasshopper façade APIs.
  • Updated selection infrastructure to store IGH_DocumentObject (enabling scribble selection).
  • Normalized LGPL headers + centralized .NET project metadata and added CI/workflows for license header + dependency/manifest validation.

Reviewed changes

Copilot reviewed 205 out of 388 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/SmartHopper.Core/Models/Document/NodeGrid.cs Removed internal GhJSON-era model (moved to external packages / new graph namespace).
src/SmartHopper.Core/Models/Document/GroupInfo.cs Removed internal GhJSON-era model (externalized).
src/SmartHopper.Core/Models/Document/GrasshopperDocument.cs Removed internal GhJSON document model in favor of GhJSON.Core.SchemaModels.
src/SmartHopper.Core/Models/Document/DocumentMetadata.cs Removed internal GhJSON metadata model (externalized).
src/SmartHopper.Core/Models/Connections/ConnectionPairing.cs Removed internal GhJSON connection model (externalized).
src/SmartHopper.Core/Models/Connections/Connection.cs Removed internal GhJSON connection endpoint model (externalized).
src/SmartHopper.Core/Models/Components/VBScriptCode.cs Removed internal GhJSON script model (externalized).
src/SmartHopper.Core/Models/Components/ParameterSettings.cs Removed internal GhJSON parameter settings model (externalized).
src/SmartHopper.Core/Models/Components/ComponentProperty.cs Removed internal GhJSON property wrapper/converter (externalized).
src/SmartHopper.Core/Models/Components/ComponentProperties.cs Removed internal GhJSON component model (externalized).
src/SmartHopper.Core/Models/Components/AdditionalParameterSettings.cs Removed internal GhJSON parameter settings model (externalized).
src/SmartHopper.Core/IO/SafeStructureCodec.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/IO/SafeGooCodec.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/IO/PersistenceConstants.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/IO/IPersistenceService.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/IO/GHPersistenceService.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/DataTree/DataTreeProcessor.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/StatefulComponentBase.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/StateManager.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/SelectingComponentCore.cs Selection now tracks IGH_DocumentObject; updated selection filtering/restoration logic.
src/SmartHopper.Core/ComponentBase/SelectingComponentBase.cs Switched selected-object storage type to IGH_DocumentObject.
src/SmartHopper.Core/ComponentBase/ProgressInfo.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/InlineLabelRenderer.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/ISelectingComponent.cs Interface now exposes List<IGH_DocumentObject> to support scribbles.
src/SmartHopper.Core/ComponentBase/ComponentStateManager.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/ComponentBadgesAttributes.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/AsyncWorkerBase.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/AsyncComponentBase.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/AIStatefulAsyncComponentBase.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/AISelectingStatefulAsyncComponentBase.cs Selection now tracks IGH_DocumentObject; added XML doc.
src/SmartHopper.Core/ComponentBase/AIProviderComponentBase.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/ComponentBase/AIProviderComponentAttributes.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/AIContext/TimeContextProvider.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/AIContext/FileContextProvider.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/AIContext/EnvironmentContextProvider.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core/AIContext/AIContextBootstrapper.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Tests/SmartHopper.Core.Tests.csproj Added license header comment to project file.
src/SmartHopper.Core.Tests/ComponentBase/ComponentStateManagerTests.cs Normalized LGPL header; minor formatting-only change.
src/SmartHopper.Core.Grasshopper/Utils/Serialization/DataTreeConverter.cs Removed internal GhJSON serialization utility (externalized).
src/SmartHopper.Core.Grasshopper/Utils/Serialization/ComponentSpecBuilder.cs Removed internal GhJSON component spec helper (replaced by facade/builder).
src/SmartHopper.Core.Grasshopper/Utils/Rhino/File3dmReader.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Rhino/DocumentGeometryExtractor.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Parsing/AIResponseParser.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/McNeelForumUtils.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Internal/WebUtilities.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Internal/CSharpIdentifierHelper.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Constants/GhJsonExtensionKeys.cs New centralized constants for GhJSON extension keys.
src/SmartHopper.Core.Grasshopper/Utils/Components/ParameterModifier.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Canvas/ParameterAccess.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Canvas/ObjectFactory.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Canvas/ConnectionBuilder.cs Removed internal canvas wiring helper (replaced by local wiring code / facade).
src/SmartHopper.Core.Grasshopper/Utils/Canvas/ComponentManipulation.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Utils/Canvas/CanvasAccess.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/SmartHopper.Core.Grasshopper.csproj Added GhJSON NuGet deps + additional packages; enabled CopyLocalLockFileAssemblies.
src/SmartHopper.Core.Grasshopper/Serialization/GhJson/Shared/TypeHintMapper.cs Removed internal mapper (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/GhJson/Shared/AccessModeMapper.cs Removed internal mapper (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/GhJson/SerializationOptions.cs Removed internal options model (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/GhJson/GhJsonHelpers.cs Removed internal helpers (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/GhJson/DeserializationOptions.cs Removed internal options model (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/Canvas/GroupManager.cs Removed internal placement utility (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/Canvas/ConnectionManager.cs Removed internal placement utility (externalized).
src/SmartHopper.Core.Grasshopper/Serialization/Canvas/CanvasUtilities.cs Removed internal placement utility (externalized).
src/SmartHopper.Core.Grasshopper/Models/SupportedDataTypes.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Graph/NodeGridComponent.cs Reintroduced NodeGridComponent under Grasshopper graph namespace with new fields.
src/SmartHopper.Core.Grasshopper/Graph/DependencyGraphUtils.cs Updated to consume GhJsonDocument from external GhJSON package.
src/SmartHopper.Core.Grasshopper/Graph/ConnectionGraphUtils.cs Removed internal graph helper (likely provided elsewhere now).
src/SmartHopper.Core.Grasshopper/Converters/StringConverter.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/Converters/IntConverter.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/web_generic_page_read.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/text_generate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/text_evaluate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/mcneel_forum_topic.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/mcneel_forum_search.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/mcneel_forum_post.cs Dropped legacy single-id arg parsing; clarified comment.
src/SmartHopper.Core.Grasshopper/AITools/list_generate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/list_filter.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/list_evaluate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/instruction_get.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/img_generate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/gh_tidy_up.cs Switched serialization call to GhJSON facade; updated imports.
src/SmartHopper.Core.Grasshopper/AITools/gh_move.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/gh_merge.cs Refactored merge/validate/serialize to GhJSON facade API.
src/SmartHopper.Core.Grasshopper/AITools/gh_list_components.cs Switched category filter parsing to GhJSON Query filter parser.
src/SmartHopper.Core.Grasshopper/AITools/gh_list_categories.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/gh_group.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/gh_component_preview.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/gh_component_lock.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/_script_parameter_modifier.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/_rhino_read_3dm.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/_rhino_get_geometry_3dm.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/_gh_parameter_modifier.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper/AITools/_gh_generate.cs Replaced in-repo component spec generation with GhJSON document builder; output key renamed.
src/SmartHopper.Core.Grasshopper/AITools/_gh_connect.cs Replaced ConnectionBuilder usage with local wiring helpers.
src/SmartHopper.Core.Grasshopper/AITools/ScriptCodeValidator.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper.Tests/Utils/Parsing/AIResponseParserTests.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper.Tests/Utils/CSharpIdentifierHelperTests.cs Normalized LGPL header / copyright years.
src/SmartHopper.Core.Grasshopper.Tests/SmartHopper.Core.Grasshopper.Tests.csproj Added license header comment to project file.
src/SmartHopper.Components/Text/AITextListGenerate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Text/AITextGenerate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Text/AITextEvaluate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/SmartHopperAssemblyPriority.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/SmartHopper.Components.csproj Removed per-project metadata (now centralized in Directory.Build.props).
src/SmartHopper.Components/Script/AIScriptReviewComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Script/AIScriptGeneratorComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Misc/DeconstructMetricsComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/List/AIListFilter.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/List/AIListEvaluate.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/WebPageReadComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/McNeelForumSearchComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/McNeelForumPostOpenComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/McNeelForumPostGetComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/McNeelForumDeconstructPostComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/AIMcNeelForumTopicSummarizeComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Knowledge/AIMcNeelForumPostSummarizeComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Img/ImageViewerComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Img/ImageViewerAttributes.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Img/AIImgGenerateComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Grasshopper/GhTidyUpComponents.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Grasshopper/GhRetrieveComponents.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Grasshopper/GhPutComponents.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Grasshopper/GhMergeComponents.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/Grasshopper/GhGetComponents.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/AI/AIModelsComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/AI/AIFileContextComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components/AI/AIChatComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/SmartHopper.Components.Test.csproj Removed per-project metadata (now centralized) + license comment header.
src/SmartHopper.Components.Test/Misc/TestStatefulTreePrimeCalculatorComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Misc/TestStatefulPrimeCalculatorComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Misc/TestStateManagerRestorationComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Misc/TestStateManagerDebounceComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Misc/TestAsyncPrimeCalculatorComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Misc/TestAIStatefulTreePrimeCalculatorComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorRule2OverrideTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorMixedDepthsTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorItemToItemTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorItemGraftTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorGroupIdenticalTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorEqualPathsThreeItemsTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorEqualPathsTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorEqualPathsFirstThreeSecondOneTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorEqualPathsFirstOneSecondThreeTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorDirectMatchPrecedenceTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorDifferentPathsThreeItemsEachTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorDifferentPathsOneItemEachTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorDifferentPathsFirstThreeSecondOneTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorDifferentPathsFirstOneSecondThreeTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBroadcastMultipleTopLevelTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBroadcastMultipleNoZeroTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBroadcastDeeperSameRootTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBroadcastDeeperDiffRootTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBranchToBranchTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/DataProcessor/DataTreeProcessorBranchFlattenTestComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Badges/TestBadgesTwoComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Badges/TestBadgesThreeComponent.cs Normalized LGPL header / copyright years.
src/SmartHopper.Components.Test/Badges/TestBadgesOneComponent.cs Normalized LGPL header / copyright years.
docs/index.md Updated GhJSON docs link to external ghjson-dotnet repo.
docs/Tools/instruction_get.md Added reference link to ghjson-dotnet for format details.
docs/Reviews/index.md Removed reviews index page.
docs/GhJSON/index.md Removed in-repo GhJSON docs (externalized).
docs/GhJSON/format-specification.md Removed in-repo GhJSON spec (externalized).
docs/Components/Modifiers/index.md Updated GhJSON format link to external repo.
Solution.props Bumped solution version to 1.3.0-dev.260208.
README.md Updated badges to reflect dev/unstable version and status.
Directory.Build.props Centralized assembly/package metadata (Version/Company/Authors/Copyright).
CHANGELOG.md Documented GhJSON externalization + selection type change + automation/workflows.
.windsurf/workflows/review.md Added workflow guidance doc (repo tooling).
.github/workflows/user-code-style.yml Removed header-fixer job from code-style workflow.
.github/workflows/release-1-milestone.yml Added license header normalization step; expanded git add scope.
.github/workflows/pr-validation.yml Replaced header check with Windows license header check job.
.github/workflows/pr-manifest-validation.yml New workflow validating yak manifest text vs Solution.props version type.
.github/workflows/pr-dependency-validation.yml New workflow ensuring GhJSON deps are PackageReferences (not ProjectReferences).
.github/workflows/dev-update-manifest.yml New workflow auto-updating manifest text in dev branch based on version type.
.github/workflows/chore-update-copyright-year.yml New scheduled workflow to update year across headers/project metadata and open PR.
.github/actions/code-style/action.yml Removed header-fixer step from shared code-style action.
Files not reviewed (1)
  • src/SmartHopper.Components/Properties/Resources.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +231 to +232
// Wire: add src as source for dst.
dst.AddSource(src);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new implementation always calls dst.AddSource(src) without checking whether the connection already exists. This can create duplicate wires (and potentially change downstream behavior if Grasshopper allows duplicates). Add a guard (e.g., check dst.Sources.Contains(src)) before adding the source, matching the previous behavior in ConnectionBuilder.

Suggested change
// Wire: add src as source for dst.
dst.AddSource(src);
// Wire: add src as source for dst, avoiding duplicate connections.
if (!dst.Sources.Contains(src))
{
dst.AddSource(src);
}

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +214
var sourceObj = doc.Objects.FirstOrDefault(o => o.InstanceGuid == sourceGuid);
var targetObj = doc.Objects.FirstOrDefault(o => o.InstanceGuid == targetGuid);

Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking up objects via doc.Objects.FirstOrDefault for every connection is O(N) per lookup, which can become expensive when many connections are created. Consider building a Dictionary<Guid, IGH_DocumentObject> once per tool execution (outside TryConnect) so each lookup is O(1).

Suggested change
var sourceObj = doc.Objects.FirstOrDefault(o => o.InstanceGuid == sourceGuid);
var targetObj = doc.Objects.FirstOrDefault(o => o.InstanceGuid == targetGuid);
var objectsById = doc.Objects.ToDictionary(o => o.InstanceGuid);
objectsById.TryGetValue(sourceGuid, out var sourceObj);
objectsById.TryGetValue(targetGuid, out var targetObj);

Copilot uses AI. Check for mistakes.
obj is Grasshopper.Kernel.Special.GH_Group ||
obj.GetType().Name.Contains("Scribble", StringComparison.Ordinal) ||
obj.GetType().Name.Contains("Panel", StringComparison.Ordinal)));
obj is Grasshopper.Kernel.Special.GH_Scribble));
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change drops the prior inclusion of Panels (previously matched by type name containing "Panel"). If panels are intended to remain selectable, they should be explicitly included (e.g., GH_Panel) alongside GH_Scribble, rather than relying on the old string match.

Suggested change
obj is Grasshopper.Kernel.Special.GH_Scribble));
obj is Grasshopper.Kernel.Special.GH_Scribble ||
obj is Grasshopper.Kernel.Special.GH_Panel));

Copilot uses AI. Check for mistakes.
Comment on lines 143 to 149
var grid = doc.Components.Select(c => new NodeGridComponent
{
ComponentId = c.InstanceGuid,
Pivot = c.Pivot,
ComponentId = c.InstanceGuid.GetValueOrDefault(),
Pivot = c.Pivot?.ToPointF() ?? PointF.Empty,
Parents = new Dictionary<Guid, int>(),
Children = new Dictionary<Guid, int>(),
}).ToList();
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GetValueOrDefault() will assign Guid.Empty when InstanceGuid is missing, which can create multiple nodes with the same ComponentId and break downstream node lookup/graph integrity. Prefer filtering out components without InstanceGuid (or throwing) so ComponentId is always a real unique identifier.

Copilot uses AI. Check for mistakes.
Comment on lines +162 to 166
grid.Any(n => n.ComponentId == toGuid) &&
grid.Any(n => n.ComponentId == fromGuid))
{
var toNode = grid.First(n => n.ComponentId == toGuid);
var fromNode = grid.First(n => n.ComponentId == fromGuid);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does multiple linear scans over grid per connection (two Any + two First), which can become costly on larger documents. Consider indexing nodes once (e.g., Dictionary<Guid, NodeGridComponent>) and using TryGetValue for O(1) lookups.

Copilot uses AI. Check for mistakes.
}

var doc = GhJsonSerializer.Serialize(selected, SerializationOptions.Standard);
var doc = GhJsonGrasshopper.Serialize(selected, SerializationOptions.Default);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call uses SerializationOptions.Default, but the PR description/CHANGELOG emphasizes using the new options factories (GhJsonGrasshopper.Options.Standard()/Optimized()/Lite()). If the intended behavior is 'standard', consider switching this to the new factory-based API for consistency across tools (and to avoid confusion about what 'Default' means).

Suggested change
var doc = GhJsonGrasshopper.Serialize(selected, SerializationOptions.Default);
var doc = GhJsonGrasshopper.Serialize(selected, GhJsonGrasshopper.Options.Standard());

Copilot uses AI. Check for mistakes.
var toolResult = new JObject
{
["ghJson"] = ghJsonString,
["ghjson"] = ghJsonString,
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output property name was changed from ghJson to ghjson. If any downstream consumer/tool schema expects the old casing, this becomes a breaking change. Consider keeping the old key for backward compatibility (e.g., emit both keys) or ensure the tool schema and all callers are updated in the same PR.

Suggested change
["ghjson"] = ghJsonString,
["ghjson"] = ghJsonString,
["ghJson"] = ghJsonString, // backward compatibility with older schema

Copilot uses AI. Check for mistakes.
Comment on lines 108 to 115
var toolResult = new JObject
{
["ghjson"] = mergedJson,
["componentsAdded"] = mergeResult.ComponentsAdded,
["componentsDuplicated"] = mergeResult.ComponentsDuplicated,
["connectionsAdded"] = mergeResult.ConnectionsAdded,
["connectionsDuplicated"] = mergeResult.ConnectionsDuplicated,
["groupsAdded"] = mergeResult.GroupsAdded,
["totalComponents"] = mergeResult.Document?.Components?.Count ?? 0,
["totalConnections"] = mergeResult.Document?.Connections?.Count ?? 0,
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes previously returned fields like componentsDuplicated / connectionsDuplicated. If the AI tool contract (schema/docs) included them, callers may rely on those fields. Consider preserving them (if the new merge result still exposes equivalents), or emitting them as 0/nullable with a deprecation plan.

Copilot uses AI. Check for mistakes.
- Updated CHANGELOG.md to add 1.3.0-alpha section with existing changes
- Corrected 1.2.4 release date from 2026 to 2024
- Added alpha warning back to yak package manifest description
@marc-romu marc-romu merged commit 93ce051 into main Feb 8, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: GhGet Issues related to the Grasshopper Get Components component component: GhPut Issues related to the Grasshopper Put Components component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants