Skip to content

fix(record): keep mixed-unit sequences as text and refuse repeats into a unique member - #610

Merged
HuiJun merged 3 commits into
developfrom
fix/record-sequence-compat
Sep 26, 2026
Merged

HuiJun merged 3 commits into
developfrom
fix/record-sequence-compat

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Two gaps in how a sequence-valued tool output fits a record definition, found after #580 landed:

  • classifySequence settled a quantity element and a plain Integer element to one Real member through numericPair, so (300 [K], 301) recorded as (300, 301) with no tempsUnit companion — the measured element lost its unit. A sequence carries one shared unit, so a mixed quantity/plain sequence has no faithful typed list literal: it now falls back to the String text spelling, as a sequence of mixed enumeration types already does.
  • An existing record definition whose multi-valued member is unique (the default) passed checkExisting for a sequence with repeated values, and the generated record then failed validation against that member. record.Feature gains Unique (read through semantics.IsUnique, which follows an inherited nonunique), classifySequence notes a repeated element literal, and checkExisting refuses f.multi && f.repeated && decl.Unique with the usual into remedy. Generated definitions are ordered nonunique and keep admitting repeats.

How it was verified

  • internal/exec/analysis/record/sequence_compat_test.go: quantity+Integer sequence records as ScalarValues::String with no unit companion; unique [0..*] existing member + repeated sequence → refusal naming into; [0..*] ordered nonunique + repeated → accepted and parses; unique member + non-repeating sequence → accepted.
  • internal/frontend/repl/record_sequence_compat_test.go: recordAttributes reports Unique for Real[0..*], not for nonunique, and follows nonunique through :>>.
  • gofmt -l ., go build ./..., go vet, go test -count=1 ./internal/exec/analysis/record ./internal/frontend/repl ./cmd/sysml, scripts/changelog.py check.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

devin-ai-integration Bot and others added 2 commits September 26, 2026 03:21
Mixed quantity and plain-number sequences now record as text instead of losing a shared unit, and repeated values are rejected against existing unique members while remaining valid for nonunique ones.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ragment

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review September 26, 2026 04:09
devin-ai-integration[bot]

This comment was marked as resolved.

Element repeats are detected with runtime Set membership — an Integer and
the equal Real are one value to a unique member — and a repeat in any run
marks the member even when the shape merge settles over runs that did not
repeat.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun merged commit c38f36a into develop Sep 26, 2026
18 checks passed
@HuiJun
HuiJun deleted the fix/record-sequence-compat branch September 26, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant