Skip to content

reference: ai fix of regression in main#205

Closed
consideRatio wants to merge 2 commits intomainfrom
ai-suggestion-on-fix-to-regression
Closed

reference: ai fix of regression in main#205
consideRatio wants to merge 2 commits intomainfrom
ai-suggestion-on-fix-to-regression

Conversation

@consideRatio
Copy link
Collaborator

@consideRatio consideRatio commented Mar 12, 2026

Observed regression in main branch, mentioned in #206, is potentially fixed by these changes, generated by codex GPT 5.4. The text below is AI generated, and the changes are as well. I haven't looked into this myself. I have only verified that this change does unbreak sysand add urn:kpar:sysmod specifically.


The regression was in the lock path, not in add itself. The latest commit made lock generation require project.sources(), and embedded InMemoryProject instances for stdlib dependencies still hard-panicked there. I fixed that in memory.rs and populated concrete RemoteKpar sources for embedded stdlib projects in stdlib.rs.

Verification:

  • cargo test -p sysand-core stdlib_projects_have_nominal_sources
  • Exact repro, with network enabled for the index lookup:
    d=$(mktemp -d) && cd "$d" && cargo run --manifest-path /home/erik/dev/sensmetry/sysand/Cargo.toml init && cargo run --manifest-path /home/erik/dev/sensmetry/sysand/Cargo.toml add urn:kpar:sysmod
    

That flow now succeeds, creates sysand-lock.toml, and installs urn:kpar:sysmod 5.0.0-alpha.2 instead of panicking.

• The regression was in the lock path, not in add itself. The latest commit made lock generation require project.sources(), and
  embedded InMemoryProject instances for stdlib dependencies still hard-panicked there. I fixed that in memory.rs and populated
  concrete RemoteKpar sources for embedded stdlib projects in stdlib.rs.

  Verification:

  - cargo test -p sysand-core stdlib_projects_have_nominal_sources
  - Exact repro, with network enabled for the index lookup:
    d=$(mktemp -d) && cd "$d" && cargo run --manifest-path /home/erik/dev/sensmetry/sysand/Cargo.toml init && cargo run --manifest-
    path /home/erik/dev/sensmetry/sysand/Cargo.toml add urn:kpar:sysmod

  That flow now succeeds, creates sysand-lock.toml, and installs urn:kpar:sysmod 5.0.0-alpha.2 instead of panicking.

Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
• Updated the failing follow-up test to match the new InMemoryProject::sources() behavior.

  I changed project_derive.rs so test_macro_sources now asserts vec![] instead of expecting a panic. That was the concrete failure
  caused by the previous fix.

on-behalf-of: @sensmetry <erik.sundell+2025@sensmetry.com>

Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
Comment on lines +137 to 138
"https://www.omg.org/spec/SysML/20250201/Quantities-and-Units-Domain-Library.kpar",
"https://www.omg.org/spec/SysML/20250201/Quantities-and-Units-Domain-Library.kpar",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplicates

Copy link
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry left a comment

Choose a reason for hiding this comment

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

Ok, except duplicates have to be cleaned up.

@andrius-puksta-sensmetry
Copy link
Collaborator

andrius-puksta-sensmetry commented Mar 12, 2026

After thinking a bit, in my opinion it would be better to not even try including sources for provided_iris, which would avoid this problem.

But InMemoryProject should indeed return its nominal_sources.

@consideRatio
Copy link
Collaborator Author

@victor-linroth-sensmetry @andrius-puksta-sensmetry this is out my comfort zone to pick up - in order to ensure we don't let this fall between the chairs, who works it?

@consideRatio
Copy link
Collaborator Author

Just for reference, closing to clarify I'm not actively working it.

@andrius-puksta-sensmetry
Copy link
Collaborator

Fix included in #154, since it already touched sources(), so wanted to avoid conflicts here.

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.

2 participants