Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
cab38a1
Refactor and enhance quantity classes and tests
matt-edmondson Aug 3, 2025
face658
Add new quantity classes and methods for acoustic, chemical, electric…
matt-edmondson Aug 3, 2025
1cdb2da
Implement static factory methods for quantity classes in acoustic, ch…
matt-edmondson Aug 3, 2025
5da8804
Add extension methods for double and float physical quantities
matt-edmondson Aug 4, 2025
b0fb1eb
Implement static factory methods for float quantity classes across va…
matt-edmondson Aug 4, 2025
f933271
Enhance quantity classes with additional static factory methods for c…
matt-edmondson Aug 4, 2025
a41a623
Add new static factory methods for length and position quantities in …
matt-edmondson Aug 4, 2025
fb7d7f5
Code generation
matt-edmondson Aug 5, 2025
fbc5c61
Enhance project configuration and code generation capabilities
matt-edmondson Aug 6, 2025
08d29f0
Refactor project configuration and enhance SDK management
matt-edmondson Aug 16, 2025
fb333ec
Sync .gitattributes
Feb 14, 2026
92d26fc
Sync global.json
Feb 14, 2026
052b4db
Sync .github\workflows\dotnet.yml
Feb 14, 2026
403a24c
Sync .github\workflows\update-sdks.yml
Feb 14, 2026
4bfaf7a
Sync .runsettings
Feb 14, 2026
41a8e8d
Remove legacy build scripts
matt-edmondson Feb 14, 2026
e81d852
Sync .github\workflows\dotnet.yml
Feb 16, 2026
64bfe18
Sync .github\workflows\dotnet.yml
Feb 16, 2026
b1b76ec
Sync .github\workflows\dotnet.yml
Feb 16, 2026
11eb010
Sync .github\workflows\dotnet.yml
Feb 16, 2026
c785a45
Update project file to target .NET 10.0 and remove obsolete configura…
matt-edmondson Feb 16, 2026
0c6c573
Remove .cursorindexingignore to eliminate unnecessary indexing rules
matt-edmondson Feb 16, 2026
d213e18
Remove obsolete validation attributes and related files for path and …
matt-edmondson Feb 16, 2026
cc288ac
feat: Add Microsoft.Bcl.AsyncInterfaces package and refactor path han…
matt-edmondson Feb 17, 2026
0644d86
refactor: Remove unused using directives for ktsu.Semantics.Strings i…
matt-edmondson Feb 17, 2026
053b472
feat: Implement QuantitiesGenerator for generating scalar and vector …
matt-edmondson Feb 17, 2026
bb2fe18
refactor: Simplify vector method implementations by removing unnecess…
matt-edmondson Feb 17, 2026
7655b10
feat: Add strategy document for unified vector representation of quan…
matt-edmondson Feb 17, 2026
728f951
feat: Define proposed base types and naming patterns for unified vect…
matt-edmondson Feb 17, 2026
fedacc4
feat: Enhance cross-dimensional operations and relationships in unifi…
matt-edmondson Feb 17, 2026
8be0bd5
feat: Update dimensions.json schema to unify vector representation an…
matt-edmondson Feb 17, 2026
22cbe7b
Refactor dimensions metadata structure and enhance vector form defini…
matt-edmondson Feb 17, 2026
11ba4c5
Sync .github\workflows\dotnet.yml
Feb 17, 2026
5ec52ca
feat: Update CodeBlocker package version and refactor scope usage in …
matt-edmondson Feb 17, 2026
d82c44b
feat: Enhance dimensions and units metadata with additional overloads…
matt-edmondson Feb 17, 2026
03e6ded
feat: Add new unit categories and conversion factors for fluid mechan…
matt-edmondson Feb 17, 2026
e034c71
Enhance project configuration: enable compiler-generated files and se…
matt-edmondson Feb 17, 2026
3a4982a
feat: Add new skill for creating physics quantity types with metadata…
matt-edmondson Feb 18, 2026
fc15095
docs: align docs with unified vector model and current API
claude May 9, 2026
cff3b99
Merge main into vectors (structural reconciliation)
claude May 9, 2026
20b4460
Pass 2: drop main-imported tests that reference removed hand-written …
claude May 9, 2026
cce26b5
Merge pull request #64 from ktsu-dev/reconcile/main-into-vectors
matt-edmondson May 9, 2026
5452dba
Merge pull request #62 from ktsu-dev/claude/analyze-and-log-issues-C93Xf
matt-edmondson May 9, 2026
c74f567
feat(generator): emit SEM001 when relationship references unknown dim…
claude May 9, 2026
f7b4ad7
test: cover IVector*/Magnitude/Dot/Cross and overload conversions
claude May 9, 2026
85e6b25
Merge pull request #65 from ktsu-dev/work/issue-56
matt-edmondson May 9, 2026
22991ee
feat(generator): emit From{Unit} factory for every availableUnit
claude May 9, 2026
039afc4
feat(quantities): enforce V0 non-negativity and absolute V0-V0 subtra…
claude May 9, 2026
7440cfb
Merge pull request #66 from ktsu-dev/work/issue-54-55
matt-edmondson May 9, 2026
abfc114
Merge remote-tracking branch 'origin/vectors' into work/issue-48
claude May 9, 2026
0ee52bd
Merge pull request #68 from ktsu-dev/work/issue-50-52
matt-edmondson May 9, 2026
6806b63
feat(generator): add SEM002 metadata validation; refresh stale genera…
claude May 9, 2026
fd95ac0
Merge vectors into work/issue-48: combine multi-unit factories with V…
claude May 9, 2026
6eaf12f
Merge pull request #70 from ktsu-dev/claude/fix-vectors-issues-sHLUx
matt-edmondson May 9, 2026
78938de
Merge vectors (post #70) into rebase-issue-48: combine multi-unit fac…
claude May 9, 2026
e55b50f
Merge pull request #71 from ktsu-dev/claude/rebase-issue-48
matt-edmondson May 9, 2026
77422b6
feat(generator): plural From{Unit} factory naming + form matrix docs …
claude May 10, 2026
1cc44e2
Merge pull request #72 from ktsu-dev/claude/issue-49-plural-units
matt-edmondson May 10, 2026
ee06839
feat(generator): SEM003 diagnostic + form-specific relationships (clo…
claude May 10, 2026
415c6ba
test(quantities): generator-output invariants — no duplicate signatur…
claude May 10, 2026
21d6ad8
Merge pull request #74 from ktsu-dev/claude/issue-57-no-duplicates
matt-edmondson May 10, 2026
f41624b
Merge pull request #73 from ktsu-dev/claude/issue-58-sem003
matt-edmondson May 10, 2026
17a5c24
feat(quantities): per-overload physicalConstraints + EnsurePositive g…
claude May 10, 2026
ba9d770
docs: fix stale README + guides — plural factories, V3 object-init, r…
claude May 10, 2026
fffc635
Merge pull request #76 from ktsu-dev/claude/docs-fix-vector-examples
matt-edmondson May 10, 2026
d81c5e0
Merge pull request #75 from ktsu-dev/claude/issue-51-strict-positive
matt-edmondson May 10, 2026
2ba315b
feat(generator): SEM004 — flag dimensions.json units missing from uni…
claude May 10, 2026
3ac249f
Merge pull request #77 from ktsu-dev/claude/sem004-unknown-unit
matt-edmondson May 10, 2026
00ac9c3
docs(architecture): document physics generator pipeline (closes #61)
claude May 12, 2026
8cb35c7
Merge pull request #79 from ktsu-dev/claude/review-vectors-branch-pgIZG
matt-edmondson May 12, 2026
0e09585
feat(quantities): canonical IPhysicalQuantity surface + typed In() (c…
claude May 13, 2026
d629c82
chore: drop unnecessary null-forgiving operators + silence coverage w…
claude May 13, 2026
d0d9012
Merge pull request #80 from ktsu-dev/claude/review-vectors-branch-pgIZG
matt-edmondson May 13, 2026
3cfabf7
Merge remote-tracking branch 'origin/main' into claude/vectors-sync-p…
claude Jun 12, 2026
3a1d197
fix(quantities): add comparison operators to PhysicalQuantity (CA1036)
claude Jun 12, 2026
8b8f3b1
feat(generator): declare Frequency x Length = Velocity wave relationship
claude Jun 12, 2026
3c6c6b8
chore: refresh generated snapshots
claude Jun 12, 2026
715fff6
Merge pull request #89 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 12, 2026
c4f964c
fix(generator): materialise Generic constants via PreciseNumber.To<T>()
claude Jun 12, 2026
a422e50
feat(quantities): backfill unit catalog and constants domains from main
claude Jun 12, 2026
f08bee5
Merge pull request #90 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 12, 2026
99e670e
Update NuGet package versions in Directory.Packages.props
matt-edmondson Jun 12, 2026
323c537
feat(quantities): backfill missing dimensions and acoustic overloads …
claude Jun 12, 2026
6a725a7
feat(quantities): hand-written logarithmic-scale companions
claude Jun 12, 2026
cdc48ee
test(quantities): cover backfilled dimensions and log-scale companions
claude Jun 12, 2026
33a28d3
Merge pull request #92 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 12, 2026
2e9ef29
docs: add 1.x → 2.0 migration guide
claude Jun 12, 2026
275b7b6
Merge pull request #93 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 13, 2026
77d7001
refactor(quantities): align audio-engineering types with the vectors …
claude Jun 13, 2026
936b222
Merge pull request #94 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 13, 2026
cfe710c
feat(generator): LogarithmicScalesGenerator — log scales from logarit…
claude Jun 13, 2026
f44a78d
refactor(quantities): converge log scales and audio types on metadata
claude Jun 13, 2026
734006e
docs: log scales are metadata-generated; Percent/Gain convergence
claude Jun 13, 2026
b3aeb41
Merge pull request #95 from ktsu-dev/claude/vectors-sync-progress-ofoith
matt-edmondson Jun 13, 2026
f6dd158
refactor(generator): use singular-lemma factory names, drop factoryName
claude Jun 13, 2026
60fe190
Merge pull request #96 from ktsu-dev/claude/inspiring-ride-kyvbij
matt-edmondson Jun 13, 2026
b73915f
Merge remote-tracking branch 'origin/main' into vectors-merge-trial
matt-edmondson Jun 25, 2026
84f4e87
fix(build): make vectors build under .NET 10 SDK
matt-edmondson Jun 25, 2026
62df286
Merge pull request #100 from ktsu-dev/fix/vectors-sync-main-net10-build
matt-edmondson Jun 25, 2026
c00fc08
fix: close V0 release blockers and drop out-of-support TFMs
matt-edmondson Jun 25, 2026
793315b
chore: sync stale Units.g.cs and add generated-files CI guard
matt-edmondson Jun 25, 2026
8327fe1
Merge pull request #101 from ktsu-dev/fix/vectors-release-blockers
matt-edmondson Jun 25, 2026
40a2dfa
feat: storage-type alias packages for ktsu.Semantics.Quantities
matt-edmondson Jun 25, 2026
d640ff6
docs: reflect 2.0 state, rebrand to 'semantic quantities', document a…
matt-edmondson Jun 25, 2026
c45191b
fix(generator): annotate nullable referenceExpr to clear CS8600
matt-edmondson Jun 27, 2026
09c3e69
Merge remote-tracking branch 'origin/main' into vectors
matt-edmondson Jun 27, 2026
d9f8180
fix: restore icon.png as LFS pointer after main merge
matt-edmondson Jun 27, 2026
4230820
fix: drop unreferenced SourceLink package versions (KTSU0005 under kt…
matt-edmondson Jun 27, 2026
f80e9a8
release: ktsu.Semantics 2.0.0 — unified vector quantities [major]
matt-edmondson Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
93 changes: 93 additions & 0 deletions .claude/skills/add-physics-quantity/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
name: add-physics-quantity
description: Add a new physics quantity type with units, dimensions, operators, and tests to the source-generated system
disable-model-invocation: true
---

# Add Physics Quantity

Add a new physics quantity to the source-generated physics system. This is a fully metadata-driven process - no C# code needs to be written manually.

## Required Information

Before starting, gather from the user:
1. **Quantity name** (e.g., "Viscosity", "MagneticFlux")
2. **Physical dimension symbol** (e.g., "M L⁻¹ T⁻¹")
3. **Dimensional formula** (exponents for mass, length, time, temperature, current, amount, luminosity)
4. **SI unit name and symbol** (e.g., "Pascal" / "Pa")
5. **Which vector forms** are needed (magnitude only, or 1D/2D/3D/4D)
6. **Physics relationships** - what other quantities multiply/divide to produce this one
7. **Any semantic overloads** (named aliases like Weight for ForceMagnitude)

## Steps

### Step 1: Add Dimension to dimensions.json

**File**: `Semantics.SourceGenerators/Metadata/dimensions.json`

Add a new entry to the `physicalDimensions` array following the existing pattern. Each dimension needs:
- `name`: PascalCase dimension name
- `symbol`: Unicode dimension symbol
- `dimensionalFormula`: object with exponents for base dimensions
- `availableUnits`: array of unit names (must match units.json entries)
- `quantities`: object defining vector forms (vector0 = magnitude, vector1-4 = directional)
- `integrals`: array of `{other, result}` pairs where `Self * Other = Result`
- `derivatives`: array of `{other, result}` pairs where `Self / Other = Result`
- `dotProducts`: array for dot product relationships (vector forms only)
- `crossProducts`: array for cross product relationships (vector3 forms only)

**Important**: The generator automatically creates inverse operators. If you define `Force * Length = Energy` on Force, the generator also creates `Energy / Length = Force` and `Energy / Force = Length` on Energy.

### Step 2: Add Units to units.json (if new units needed)

**File**: `Semantics.SourceGenerators/Metadata/units.json`

Add unit entries to the appropriate `unitCategories` entry, or create a new category. Each unit needs:
- `name`: PascalCase unit name
- `symbol`: unit symbol string
- `description`: brief description
- `system`: one of "SIBase", "SIDerived", "Imperial", "USCustomary", "CGS", "Other"

### Step 3: Add Conversions to conversions.json (if non-SI units exist)

**File**: `Semantics.SourceGenerators/Metadata/conversions.json`

Add conversion factor entries for converting between unit systems. Each factor needs:
- `name`: descriptive PascalCase name (e.g., "CalorieToJoules")
- `description`: includes the exact numeric value
- `value`: string representation of the conversion factor

### Step 4: Add Physical Constants to domains.json (if applicable)

**File**: `Semantics.SourceGenerators/Metadata/domains.json`

If the quantity involves physical constants, add them to the relevant domain entry.

### Step 5: Build and Verify

```bash
cd Semantics.Quantities && dotnet build
```

The source generator will create:
- Quantity classes for each vector form in `Generated/`
- Updated `PhysicalDimensions.g.cs` with dimension metadata
- Updated `Units.g.cs` with unit definitions
- Operator overloads for all defined physics relationships

### Step 6: Run Tests

```bash
dotnet test
```

Verify all existing tests still pass and the new quantity types are correctly generated.

## Validation Checklist

- [ ] Dimensional formula exponents sum correctly for the physical dimension
- [ ] Physics relationships are dimensionally consistent (check both sides of equations)
- [ ] Inverse operators are NOT manually added (generator handles them automatically)
- [ ] Unit symbols follow standard conventions
- [ ] `availableUnits` entries match `units.json` unit names exactly
- [ ] No circular dependencies in physics relationships
1 change: 1 addition & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ jobs:
path: |
./coverage/*
retention-days: 7
if-no-files-found: ignore

winget:
name: Update Winget Manifests
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/verify-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Verify Generated Files

# Two kinds of generated artifacts are committed to this repo:
# 1. Source-generator output under Semantics.Quantities/Generated/ (EmitCompilerGeneratedFiles=true).
# 2. The storage-type alias props under Semantics.Quantities.<T>/buildTransitive/, produced by
# scripts/Generate-AliasProps.ps1 from the quantity catalogue.
# This job rebuilds and regenerates both, then fails if anything drifts from its source — so a
# committed generated file or alias-props file can never go stale.
#
# NOTE: this is a standalone workflow on purpose — dotnet.yml is centrally synced from a
# shared template across ktsu repos, so a step added there would be overwritten. If this
# check belongs in the shared KtsuBuild pipeline long-term, move it there and delete this.

on:
pull_request:
paths-ignore: ["**.md"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: verify-generated-${{ github.ref }}
cancel-in-progress: true

jobs:
verify-generated:
name: Generated files up to date
# windows-latest so git's autocrlf matches the committed CRLF line endings and the
# diff doesn't flag end-of-line differences.
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"

- name: Build (regenerates source-generator output into Generated/)
run: dotnet build Semantics.Quantities/Semantics.Quantities.csproj -c Release

- name: Regenerate storage-type alias props
shell: pwsh
run: ./scripts/Generate-AliasProps.ps1

- name: Fail if generated files or alias props are stale
shell: bash
run: |
if ! git diff --exit-code; then
echo "::error::Committed generated files or alias props are out of date. Run 'dotnet build Semantics.Quantities/Semantics.Quantities.csproj -c Release' then 'pwsh scripts/Generate-AliasProps.ps1', and commit the changes."
exit 1
fi
1 change: 1 addition & 0 deletions .serena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cache
113 changes: 113 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# the name by which the project can be referenced within Serena
project_name: "Semantics"


# list of languages for which language servers are started; choose from:
# al bash clojure cpp csharp
# csharp_omnisharp dart elixir elm erlang
# fortran fsharp go groovy haskell
# java julia kotlin lua markdown
# matlab nix pascal perl php
# php_phpactor powershell python python_jedi r
# rego ruby ruby_solargraph rust scala
# swift terraform toml typescript typescript_vts
# vue yaml zig
# (This list may be outdated. For the current list, see values of Language enum here:
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
# Note:
# - For C, use cpp
# - For JavaScript, use typescript
# - For Free Pascal/Lazarus, use pascal
# Special requirements:
# Some languages require additional setup/installations.
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
# When using multiple languages, the first language server that supports a given file will be used for that file.
# The first language is the default language and the respective language server will be used as a fallback.
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- csharp

# the encoding used by text files in the project
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
encoding: "utf-8"

# whether to use project's .gitignore files to ignore files
ignore_all_files_in_gitignore: true

# list of additional paths to ignore in this project.
# Same syntax as gitignore, so you can use * and **.
# Note: global ignored_paths from serena_config.yml are also applied additively.
ignored_paths: []

# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false

# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []

# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default)
included_optional_tools: []

# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
fixed_tools: []

# list of mode names to that are always to be included in the set of active modes
# The full set of modes to be activated is base_modes + default_modes.
# If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
# Otherwise, this setting overrides the global configuration.
# Set this to [] to disable base modes for this project.
# Set this to a list of mode names to always include the respective modes for this project.
base_modes:

# list of mode names that are to be activated by default.
# The full set of modes to be activated is base_modes + default_modes.
# If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
# This setting can, in turn, be overridden by CLI parameters (--mode).
default_modes:

# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""
Loading
Loading