Skip to content

feat: compose inherited arrays explicitly - #103

Merged
dakusui merged 2 commits into
mainfrom
codex/super-pair-91
Sep 22, 2026
Merged

dakusui merged 2 commits into
mainfrom
codex/super-pair-91

Conversation

@dakusui

@dakusui dakusui commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Resolves #91.

  • adds $super* index-wise pairing for inherited arrays
  • preserves replacement for unmarked arrays and rejects ambiguous or cross-kind compositions
  • adds focused positive and negative autotests

Verification

  • make test
  • tools/bin/autotest (186 passed)

Documentation, changelog, and OpenSpec completion are in the stacked follow-up PR.

@dakusui
dakusui force-pushed the codex/super-pair-91 branch from e50609d to a3e9af5 Compare September 20, 2026 17:10
@dakusui
dakusui added this pull request to stack #106 September 20, 2026 17:16

@dakusui dakusui left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review feedback: one diagnostic-path issue found. The implementation and autotest suites otherwise passed locally.

Comment thread internal/json.go Outdated
case i >= len(queue):
out = append(out, inherited[i])
default:
paired, err := pairValues(inherited[i], queue[i], policy, appendPathSegment(path, i))

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The recursive merge path uses the pairing offset i, although paired elements are emitted after the literal prefix. For example, a nested composition failure under ["p", "$super*", {...}] reports .m[0] even though the paired result slot is .m[1]. Please use len(prefix)+i for the structural path, or keep the pair offset separate from the output path.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Also, please ensure the error message is correct when the mentioned error happens.

@dakusui
dakusui merged commit ec3513b into main Sep 22, 2026
2 checks passed
@dakusui
dakusui deleted the codex/super-pair-91 branch September 22, 2026 07:06
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.

Inheritance always replaces arrays, so per-site choice between replacing and extending is impossible

1 participant