Skip to content

Add Phase 2 end-to-end integration test for native SPDX 3 constructs - #111

Closed
bact with Copilot wants to merge 7 commits into
mainfrom
copilot/add-integration-test
Closed

bact with Copilot wants to merge 7 commits into
mainfrom
copilot/add-integration-test

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Adds a single combined test for the five recently merged native SPDX 3 features (N1 fragment origin, N2 declared/concluded license, N4 external identifiers/refs, N5 base-model lineage, N6 dataset creator/publishedBy) to catch interaction bugs and residual-annotation duplication.

Changes:

  • New tests/test_phase2_integration.py exercising all five constructs on one AI-model input.
  • Assertions that native fields are present and correct:
    • ExternalMap round-trips through spdx-python-model.
    • hasConcludedLicense relationship and simpleLicensingText for a scanner-detected license.
    • DOI ExternalIdentifier, arXiv and model-page ExternalRef.
    • descendantOf relationship with stub base-model package.
    • Agent creator and publishedBy relationship from dataset.
  • Checks that provenance Annotations do not duplicate values now covered natively (DOI, arXiv, URL, creator, license value).
  • Verifies byte-identical determinism across two generation runs.
  • Validates the combined document via spdx-python-model deserialization.

Example:

model = AiModelMetadata(
    name="phase2-integrated-model",
    license="mit",
    doi="10.1234/example.doi",
    arxiv_ids=["2301.12345"],
    url="https://huggingface.co/example/phase2-integrated-model",
    base_model="openai-community/gpt2",
    base_model_relation="finetune",
    datasets=[DatasetReference(role="trainedOn", metadata=DatasetMetadata(
        name="ai-training-data",
        creator="Example Research Group",
    ))],
)
exporter = build_model(model, CreationMetadata())

Co-authored-by: bact <128572+bact@users.noreply.github.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Copilot AI requested a review from bact August 8, 2026 01:36
Copilot finished work on behalf of bact August 8, 2026 01:36
@bact bact added the tests label Aug 8, 2026
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Copilot finished work on behalf of bact August 8, 2026 02:14
bact added 2 commits August 8, 2026 03:16
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
@bact

bact commented Aug 8, 2026

Copy link
Copy Markdown
Owner

dup of #112

@bact
bact deleted the copilot/add-integration-test branch August 8, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants