Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude/rules/metaschema-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ When modifying Metapath functions or Metaschema features, update the correspondi
| New exception type | Add to `.claude/skills/metaschema-java-library.md` exception hierarchy |
| New key interface | Add to `.claude/skills/metaschema-java-library.md` |

**Function location:** `core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/`
**Function location:** `core/src/main/java/dev/metaschema/core/metapath/function/library/`

## Related Skills

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/metapath-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ $config/@value
**Note on function variants:** Many functions have multiple signatures with different argument counts. Optional parameters are shown with `?`. For the authoritative list of all function signatures, see the source code in:

```text
core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/
core/src/main/java/dev/metaschema/core/metapath/function/library/
```

### String Functions
Expand Down
58 changes: 29 additions & 29 deletions .claude/skills/metaschema-java-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ metaschema-framework (parent)

| Package | Purpose |
|---------|---------|
| `gov.nist.secauto.metaschema.core.model` | Model interfaces (`IModule`, `IAssemblyDefinition`, etc.) |
| `gov.nist.secauto.metaschema.core.metapath` | Metapath expression engine |
| `gov.nist.secauto.metaschema.core.metapath.function` | Function library |
| `gov.nist.secauto.metaschema.core.metapath.item` | Item types (nodes, atomics) |
| `gov.nist.secauto.metaschema.core.model.constraint` | Constraint validation |
| `gov.nist.secauto.metaschema.databind` | Data binding context |
| `gov.nist.secauto.metaschema.databind.io` | Serialization/deserialization |
| `gov.nist.secauto.metaschema.databind.model.annotations` | Binding annotations (`@BoundField`, `@BoundChoice`, etc.) |
| `gov.nist.secauto.metaschema.databind.codegen` | Code generation from Metaschema modules |
| `dev.metaschema.core.model` | Model interfaces (`IModule`, `IAssemblyDefinition`, etc.) |
| `dev.metaschema.core.metapath` | Metapath expression engine |
| `dev.metaschema.core.metapath.function` | Function library |
| `dev.metaschema.core.metapath.item` | Item types (nodes, atomics) |
| `dev.metaschema.core.model.constraint` | Constraint validation |
| `dev.metaschema.databind` | Data binding context |
| `dev.metaschema.databind.io` | Serialization/deserialization |
| `dev.metaschema.databind.model.annotations` | Binding annotations (`@BoundField`, `@BoundChoice`, etc.) |
| `dev.metaschema.databind.codegen` | Code generation from Metaschema modules |

## Annotation-Based Binding Model

Expand Down Expand Up @@ -113,8 +113,8 @@ For annotation-based bindings, choices are optional by default (`minOccurs = 0`)
### Using IBindingContext

```java
import gov.nist.secauto.metaschema.databind.IBindingContext;
import gov.nist.secauto.metaschema.databind.model.IBoundModule;
import dev.metaschema.databind.IBindingContext;
import dev.metaschema.databind.model.IBoundModule;

// Create binding context
IBindingContext bindingContext = IBindingContext.newInstance();
Expand All @@ -131,7 +131,7 @@ IBindingContext context = IBindingContext.builder()
### Loading Module Files

```java
import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingModuleLoader;
import dev.metaschema.databind.model.metaschema.IBindingModuleLoader;

IBindingContext bindingContext = IBindingContext.newInstance();
IBindingModuleLoader loader = bindingContext.newModuleLoader();
Expand All @@ -145,10 +145,10 @@ IBindingMetaschemaModule module = loader.load(moduleUri);
### Compiling and Evaluating Expressions

```java
import gov.nist.secauto.metaschema.core.metapath.MetapathExpression;
import gov.nist.secauto.metaschema.core.metapath.StaticContext;
import gov.nist.secauto.metaschema.core.metapath.DynamicContext;
import gov.nist.secauto.metaschema.core.metapath.item.ISequence;
import dev.metaschema.core.metapath.MetapathExpression;
import dev.metaschema.core.metapath.StaticContext;
import dev.metaschema.core.metapath.DynamicContext;
import dev.metaschema.core.metapath.item.ISequence;

// Compile expression with static context
StaticContext staticContext = StaticContext.builder()
Expand Down Expand Up @@ -270,7 +270,7 @@ Add dependencies to the `metaschema-maven-plugin` configuration to ensure classe

```xml
<plugin>
<groupId>gov.nist.secauto.metaschema</groupId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-maven-plugin</artifactId>
<dependencies>
<!-- Add dependency containing custom interfaces/base classes -->
Expand Down Expand Up @@ -298,8 +298,8 @@ Add dependencies to the `metaschema-maven-plugin` configuration to ensure classe
### Deserializing Content

```java
import gov.nist.secauto.metaschema.databind.io.IBoundLoader;
import gov.nist.secauto.metaschema.databind.io.Format;
import dev.metaschema.databind.io.IBoundLoader;
import dev.metaschema.databind.io.Format;

IBindingContext bindingContext = IBindingContext.newInstance();
IBoundLoader loader = bindingContext.newBoundLoader();
Expand All @@ -316,7 +316,7 @@ MyRootClass object = deserializer.deserialize(inputStream);
### Serializing Content

```java
import gov.nist.secauto.metaschema.databind.io.ISerializer;
import dev.metaschema.databind.io.ISerializer;

ISerializer<MyRootClass> serializer = bindingContext.newSerializer(
Format.JSON, MyRootClass.class);
Expand Down Expand Up @@ -368,9 +368,9 @@ MyClass obj = deserializer.deserialize(inputStream);
### Basic Validation

```java
import gov.nist.secauto.metaschema.core.model.constraint.IConstraintValidator;
import gov.nist.secauto.metaschema.core.model.constraint.DefaultConstraintValidator;
import gov.nist.secauto.metaschema.core.model.constraint.FindingCollectingConstraintValidationHandler;
import dev.metaschema.core.model.constraint.IConstraintValidator;
import dev.metaschema.core.model.constraint.DefaultConstraintValidator;
import dev.metaschema.core.model.constraint.FindingCollectingConstraintValidationHandler;

// Create handler to collect findings
FindingCollectingConstraintValidationHandler handler =
Expand All @@ -395,8 +395,8 @@ if (!result.isPassing()) {
### Loading External Constraints

```java
import gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet;
import gov.nist.secauto.metaschema.databind.model.metaschema.BindingConstraintLoader;
import dev.metaschema.core.model.constraint.IConstraintSet;
import dev.metaschema.databind.model.metaschema.BindingConstraintLoader;

BindingConstraintLoader constraintLoader = new BindingConstraintLoader(bindingContext);
IConstraintSet constraintSet = constraintLoader.load(constraintUri);
Expand Down Expand Up @@ -482,9 +482,9 @@ NegativeLengthArrayMetapathException
### Function Structure

```java
import gov.nist.secauto.metaschema.core.metapath.function.IFunction;
import gov.nist.secauto.metaschema.core.metapath.function.IArgument;
import gov.nist.secauto.metaschema.core.metapath.MetapathConstants;
import dev.metaschema.core.metapath.function.IFunction;
import dev.metaschema.core.metapath.function.IArgument;
import dev.metaschema.core.metapath.MetapathConstants;

public final class FnMyFunction {
private static final String NAME = "my-function";
Expand Down Expand Up @@ -590,7 +590,7 @@ IItem (base)
### Working with Sequences

```java
import gov.nist.secauto.metaschema.core.metapath.item.ISequence;
import dev.metaschema.core.metapath.item.ISequence;

// Create sequences
ISequence<IStringItem> seq = ISequence.of(item1, item2);
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
# -------------------------
# Maven Build
# -------------------------
- name: Build Maven Plugin First
run: |
# Build and install the maven-plugin and its dependencies first.
# This ensures the local plugin is used instead of a potentially stale remote SNAPSHOT.
mvn -B -e -pl metaschema-maven-plugin -am install -DskipTests
- name: Build and Test Code
run: |
mvn -B -e -Prelease -Psnapshots -DaltDeploymentRepository=repo-snapshot::file://${GITHUB_WORKSPACE}/maven2/ -DaltSnapshotDeploymentRepository=repo-snapshot::file://${GITHUB_WORKSPACE}/maven2/ -DrepositoryId=repo-snapshot deploy
Expand Down Expand Up @@ -229,6 +234,11 @@ jobs:
# -------------------------
# Maven Build
# -------------------------
- name: Build Maven Plugin First
run: |
# Build and install the maven-plugin and its dependencies first.
# This ensures the local plugin is used instead of a potentially stale remote SNAPSHOT.
mvn -B -e -pl metaschema-maven-plugin -am install -DskipTests
- name: Build and Test Website
run: |
mvn -B -e -PCI -Prelease install site site:stage -Dmaven.test.skip=true
Expand Down Expand Up @@ -263,12 +273,15 @@ jobs:
if [ -f "html-link-report.md" ]; then
# Extract summary stats from the report
ERRORS=$(grep -c "^\[ERR\]" html-link-report.md 2>/dev/null || echo "0")
TIMEOUTS=$(grep -c "^\[TIMEOUT\]" html-link-report.md 2>/dev/null || echo "0")
if [ "$ERRORS" -gt 0 ]; then
echo ":x: **Found $ERRORS broken link(s)**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
grep "^\[ERR\]" html-link-report.md >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
elif [ "$TIMEOUTS" -gt 0 ]; then
echo ":warning: **$TIMEOUTS link(s) timed out** (external sites may be slow)" >> $GITHUB_STEP_SUMMARY
else
echo ":white_check_mark: **All links valid**" >> $GITHUB_STEP_SUMMARY
fi
Expand All @@ -284,7 +297,8 @@ jobs:
path: html-link-report.md
retention-days: 5
- name: Create issue if bad links detected
if: ${{ !cancelled() && steps.linkchecker.outputs.exit_code != 0 && env.INPUT_ISSUE_ON_ERROR == 'true' }}
# Only create issues for actual broken links (exit code 2), not timeouts (exit code 1)
if: ${{ !cancelled() && steps.linkchecker.outputs.exit_code == 2 && env.INPUT_ISSUE_ON_ERROR == 'true' }}
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710
with:
title: Scheduled Check of Website Content Found Bad Hyperlinks
Expand All @@ -293,7 +307,9 @@ jobs:
bug
documentation
- name: Fail on link check error
if: ${{ !cancelled() && steps.linkchecker.outputs.exit_code != 0 && env.INPUT_FAIL_ON_ERROR == 'true' }}
# Exit codes: 0=success, 1=runtime errors/timeouts, 2=broken links found
# Only fail on actual broken links (exit code 2), not timeouts (exit code 1)
if: ${{ !cancelled() && steps.linkchecker.outputs.exit_code == 2 && env.INPUT_FAIL_ON_ERROR == 'true' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ metaschema-framework (parent)
└── metaschema-cli - Command-line interface
```

### Core Module Structure (gov.nist.secauto.metaschema.core)
### Core Module Structure (dev.metaschema.core)

- **model/** - Metaschema model interfaces (`IModule`, `IAssemblyDefinition`, `IFieldDefinition`, `IFlagDefinition`)
- **metapath/** - Metapath query language implementation
Expand Down Expand Up @@ -182,7 +182,7 @@ mvn -pl core test -Dtest=FnCountTest#testCount

- Java 11 target
- Uses SpotBugs annotations (`@NonNull`, `@Nullable`) for null safety
- Package structure follows `gov.nist.secauto.metaschema.*` convention
- Package structure follows `dev.metaschema.*` convention

### Javadoc Requirements (BLOCKING)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ This project enforces code style through static analysis tools. Contributors sho

### Core Metaschema functions

The Metaschema [specification](https://pages.nist.gov/metaschema/specification/syntax/metapath/) and [this conformant library](https://github.com/metaschema-framework/metaschema-java) library implement the Metapath functions required by the specification. See the library's [registry class with an inventory listing of the functions](https://github.com/metaschema-framework/metaschema-java/blob/main/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java) supported in the most current release.
The Metaschema [specification](https://pages.nist.gov/metaschema/specification/syntax/metapath/) and [this conformant library](https://github.com/metaschema-framework/metaschema-java) library implement the Metapath functions required by the specification. See the library's [registry class with an inventory listing of the functions](https://github.com/metaschema-framework/metaschema-java/blob/main/core/src/main/java/dev/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java) supported in the most current release.

# Licenses and attribution

Expand Down
16 changes: 8 additions & 8 deletions PRDs/20251206-build-cleanup/implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ This ensures behavioral equivalence is verified, not assumed.

#### Files Modified

1. `core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractContainerModelSupport.java`
1. `core/src/main/java/dev/metaschema/core/model/AbstractContainerModelSupport.java`
- **Removed** empty `finalize()` method - abstract class with non-throwing constructor doesn't need finalizer attack protection
2. `databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java`
2. `databind/src/main/java/dev/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java`
- **Removed** empty `finalize()` method and unused `@SuppressFBWarnings` import - abstract class with non-throwing constructor doesn't need finalizer attack protection

#### Files NOT Modified (intentionally kept)

1. `databind/src/main/java/gov/nist/secauto/metaschema/databind/DefaultBindingContext.java`
1. `databind/src/main/java/dev/metaschema/databind/DefaultBindingContext.java`
- **Kept** empty `finalize()` method - this is a non-final concrete class with a constructor that can throw, so the finalize() is required to prevent SEI CERT OBJ-11 finalizer attacks. Updated Javadoc to clarify this.

#### Implementation Findings
Expand Down Expand Up @@ -75,7 +75,7 @@ The original code used empty `finalize()` methods to prevent finalizer attacks (

#### Files Modified

1. `metaschema-maven-plugin/src/main/java/gov/nist/secauto/metaschema/maven/plugin/AbstractMetaschemaMojo.java`
1. `metaschema-maven-plugin/src/main/java/dev/metaschema/maven/plugin/AbstractMetaschemaMojo.java`
- Replaced deprecated `@Component` annotation with JSR-330 `@Inject` annotation for `BuildContext` injection
- Updated import from `org.apache.maven.plugins.annotations.Component` to `javax.inject.Inject`

Expand Down Expand Up @@ -283,7 +283,7 @@ Type requirement methods and remaining usages.
| **Target Branch** | develop |

#### Scope
`core/src/main/java/gov/nist/secauto/metaschema/core/model/`
`core/src/main/java/dev/metaschema/core/model/`

#### Key Files
- Interface definitions for metaschema model elements
Expand All @@ -308,7 +308,7 @@ Type requirement methods and remaining usages.
| **Target Branch** | develop |

#### Scope
`core/src/main/java/gov/nist/secauto/metaschema/core/metapath/`
`core/src/main/java/dev/metaschema/core/metapath/`

#### Key Files
- Expression interfaces
Expand Down Expand Up @@ -359,7 +359,7 @@ Type requirement methods and remaining usages.
| **Target Branch** | develop |

#### Scope
`databind/src/main/java/gov/nist/secauto/metaschema/databind/`
`databind/src/main/java/dev/metaschema/databind/`

#### Key Files
- `binding/AssemblyModel.java` (72 warnings - highest priority)
Expand All @@ -384,7 +384,7 @@ Type requirement methods and remaining usages.
| **Target Branch** | develop |

#### Scope
`schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/`
`schemagen/src/main/java/dev/metaschema/schemagen/`

#### Key Files
- `ModuleIndex.java` (23 warnings - highest priority)
Expand Down
8 changes: 4 additions & 4 deletions PRDs/20251206-build-cleanup/warning-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ This document provides a detailed analysis of warnings from the build output.

| File | Line | Context |
|------|------|---------|
| `core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractContainerModelSupport.java` | 89 | Resource cleanup |
| `databind/src/main/java/gov/nist/secauto/metaschema/databind/DefaultBindingContext.java` | 268 | Binding context cleanup |
| `databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java` | 223 | Generator cleanup |
| `core/src/main/java/dev/metaschema/core/model/AbstractContainerModelSupport.java` | 89 | Resource cleanup |
| `databind/src/main/java/dev/metaschema/databind/DefaultBindingContext.java` | 268 | Binding context cleanup |
| `databind/src/main/java/dev/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java` | 223 | Generator cleanup |

**Recommended Fix**: Replace with `java.lang.ref.Cleaner` API or remove if unnecessary.

Expand All @@ -43,7 +43,7 @@ This document provides a detailed analysis of warnings from the build output.

| File | Line | Field |
|------|------|-------|
| `metaschema-maven-plugin/src/main/java/gov/nist/secauto/metaschema/maven/plugin/AbstractMetaschemaMojo.java` | 102 | Multiple `@Component` fields |
| `metaschema-maven-plugin/src/main/java/dev/metaschema/maven/plugin/AbstractMetaschemaMojo.java` | 102 | Multiple `@Component` fields |

**Recommended Fix**: Replace `@Component` with `@Inject` from JSR-330.

Expand Down
4 changes: 2 additions & 2 deletions PRDs/20251208-constraint-builder/PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Additional constraint types (for future extensibility):
#### FR4: Integration with Test Support Infrastructure
- Integrate with `IModuleMockFactory` interface
- Follow the same patterns as `IModuleBuilder`
- Place in `gov.nist.secauto.metaschema.core.testsupport.builder` package
- Place in `dev.metaschema.core.testsupport.builder` package

### Test Migration Requirements

Expand Down Expand Up @@ -113,7 +113,7 @@ IConstraintSet constraints = mocking.constraintSet()

### Package Structure
```
gov.nist.secauto.metaschema.core.testsupport.builder/
dev.metaschema.core.testsupport.builder/
├── IConstraintSetBuilder.java # Main builder interface
├── ConstraintSetBuilder.java # Implementation
├── IContextBuilder.java # Context builder interface
Expand Down
Loading
Loading