Skip to content

Formatting and debugging improvements#1114

Closed
keyboardDrummer wants to merge 5 commits intostrata-org:mainfrom
keyboardDrummer:formatting-and-debugging-improvements
Closed

Formatting and debugging improvements#1114
keyboardDrummer wants to merge 5 commits intostrata-org:mainfrom
keyboardDrummer:formatting-and-debugging-improvements

Conversation

@keyboardDrummer
Copy link
Copy Markdown
Contributor

Summary

Extracts the formatting and debugging improvements from #34 into a standalone PR.

Formatting improvements

  • Block formatting: Changes block output from single-line { stmt1; stmt2 } to vertical layout with indent(2):
    {
      stmt1;
      stmt2
    }
    
  • Semicolon separator: Uses newlines instead of spaces between semicolon-separated items in the formatter.

Debugging improvements

  • Better diagnostic reporting: Replaces the boolean coreProgramHasSuperfluousErrors with a coreDiagnostics : List DiagnosticModel that records why the Core program was suppressed. When no other diagnostics explain the suppression, these are surfaced to the user.
  • Informative invalidCoreType: Adds source and reason parameters so each suppression site provides context about what went wrong.
  • Intermediate file output: Adds processLaurelFileKeepIntermediates test helper that writes pipeline intermediate files to Build/ for debugging.
  • .gitignore: Adds Build/ directory.

Test updates

  • All expected outputs updated to match the new block formatting.
  • Minor #guard_msgs whitespace fixes.
  • Some test inputs updated to use opaque keyword where needed for the new formatting to apply correctly.

Formatting improvements:
- Change block formatting to use indent(2) with newlines for vertical layout
  instead of single-line '{ ... }' format
- Update semicolon separator to use newlines instead of spaces

Debugging improvements:
- Replace boolean 'coreProgramHasSuperfluousErrors' with 'coreDiagnostics' list
  that records why the Core program was suppressed, enabling better error surfacing
- Add source location and reason parameters to 'invalidCoreType' for more
  informative diagnostics
- Surface core diagnostics when no other diagnostics explain program suppression
- Add 'processLaurelFileKeepIntermediates' test helper for writing intermediate
  pipeline files to Build/ directory
- Add Build/ to .gitignore

Test updates:
- Update all expected outputs to match new block formatting
- Add 'opaque' keyword to test procedures that need it for the new formatting
- Fix #guard_msgs whitespace formatting
Diagnostics with FileRange.unknown are not actionable for users and
can arise from pre-existing resolution limitations (e.g., variables
in multi-assign with field targets losing their uniqueId). Filter
these out when surfacing suppression reasons to avoid spurious errors.
The CodeBuild source location was hardcoded to strata-org/Strata.git,
which fails when the commit only exists in keyboardDrummer/Strata.
Use github.server_url/github.repository so it resolves to the correct
repo dynamically.
The CodeBuild project has credentials for strata-org/Strata only.
On forks like keyboardDrummer/Strata, the job cannot access the source.
Add an 'if' condition to skip the benchmark on non-upstream repos,
and restore the hardcoded source URL that CodeBuild expects.
@keyboardDrummer keyboardDrummer requested a review from a team May 5, 2026 16:18
@keyboardDrummer
Copy link
Copy Markdown
Contributor Author

@keyboardDrummer-bot please resolve conflicts

…gging-improvements

# Conflicts:
#	Strata/Languages/Laurel/LaurelToCoreTranslator.lean
@keyboardDrummer
Copy link
Copy Markdown
Contributor Author

@keyboardDrummer-bot please create the branch of this PR in the strata-org/strata repo, and then recut this PR

@keyboardDrummer-bot
Copy link
Copy Markdown
Collaborator

Done. Created the branch in strata-org/Strata and opened a new PR: #1115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code Laurel Python Waiting-For-Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants