Skip to content

Expose source annotations and canonicalize the frontend - #26

Merged
softmarshmallow merged 2 commits into
mainfrom
feature/source-annotations-and-canonical-frontend
Jul 22, 2026
Merged

Expose source annotations and canonicalize the frontend#26
softmarshmallow merged 2 commits into
mainfrom
feature/source-annotations-and-canonical-frontend

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

Summary

  • Parse reserved markup annotations such as <!-- @annotation ... --> as checked source metadata and attach them deterministically to supported UI targets.
  • Publish those annotations through the Editor authoring projection, preserve them across source refreshes, and demonstrate the feature in the Instagram corpus.
  • Remove internal v04 generation naming from syntax, checking, compilation, provenance, consumers, tests, fixtures, and public Rust APIs.
  • Keep intentional external Uhura 0.4 identities unchanged, including manifest values, wire language identity, diagnostic rules, versioned specifications, resources, and harness answers.

Why

Source annotations are authoring information: the Editor needs their exact source attachment, but they must not enter machine behavior, program identity, or rendered document semantics. The checked frontend now owns that attachment and exposes a deterministic authoring sidecar.

Separately, Uhura has only one admitted frontend. Internal v04 modules and helper names implied a compatibility layer that does not exist and made the implementation topology harder to understand. The frontend now uses canonical, unversioned internal names.

Impact

  • Annotation metadata is available to Editor consumers with stable target IDs, source spans, ordering, and ownership.
  • Ordinary markup comments remain inert.
  • Malformed reserved annotations receive structured diagnostics.
  • Internal Rust APIs are intentionally renamed without compatibility aliases.
  • User-facing Uhura 0.4 source and protocol identities do not change.

Validation

  • cargo fmt --all -- --check
  • cargo test --locked --workspace --all-targets
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • pnpm check
  • cargo run --locked -q -p uhura-cli -- check examples/instagram/client --deny-warnings
    • 4 modules and 91 examples clean
  • Residue audit for internal v04, v0.4, and 0_4 names
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@softmarshmallow, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa176bbc-e6f2-43df-9125-df61048eb601

📥 Commits

Reviewing files that changed from the base of the PR and between 7e81306 and fc869d1.

📒 Files selected for processing (5)
  • crates/uhura-check/src/provenance.rs
  • crates/uhura-syntax/src/format.rs
  • crates/uhura-syntax/src/lib.rs
  • crates/uhura-syntax/src/markup.rs
  • crates/uhura-syntax/src/ui.rs

Walkthrough

The change replaces version-specific syntax and checking APIs with canonical interfaces, adds structured UI markup annotations and authoring projections, integrates them into provenance and editor rendering, and strengthens CLI/CI coverage for authoring, previews, and provenance.

Changes

Canonical Uhura frontend

Layer / File(s) Summary
Canonical syntax and checking APIs
crates/uhura-syntax/src/*, crates/uhura-check/src/*, crates/uhura-core/src/ir.rs
Versioned v04 parser, checker, compiler, provenance, topology, update-lowering, and identity APIs are replaced with canonical interfaces and AST types.
Markup annotations and authoring projection
crates/uhura-syntax/src/ast.rs, crates/uhura-syntax/src/ui.rs, crates/uhura-syntax/src/format.rs, crates/uhura-check/src/authoring.rs, crates/uhura-check/src/provenance.rs
UI comments can carry validated annotations targeting elements, if blocks, and each blocks; checked authoring targets and entries are canonicalized and validated.
Host and editor integration
crates/uhura-host/src/lib.rs, crates/uhura-host/src/source.rs, web/src/editor/*
Checked authoring metadata and structural provenance anchors are passed into editor rendering, while preview reuse compares semantic documents independently of authoring metadata.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • gridaco/uhura#5: Both changes update the packaged native host CI smoke test and editor-state validation flow.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 32.74% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: source annotations and frontend canonicalization.
Description check ✅ Passed The description is clearly related to the changeset and matches the annotation and v04 cleanup work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/source-annotations-and-canonical-frontend

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
crates/uhura-syntax/src/ui.rs (1)

1039-1077: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Deduplicate normalize_markup_text into one shared crate-internal helper. The function is implemented byte-for-byte identically in both files. Since the parser (ui.rs) normalizes annotation/comment text and the formatter (format.rs) re-normalizes it on output, the two copies must stay in lockstep or parse→format→reparse idempotency (asserted in tests/annotations.rs) silently breaks. Extract once and reuse to make that invariant structural rather than convention.

  • crates/uhura-syntax/src/ui.rs#L1039-L1077: keep this as the single definition (or move it to a shared module) and expose it pub(crate).
  • crates/uhura-syntax/src/format.rs#L1549-L1586: remove the duplicate and call the shared helper.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-syntax/src/ui.rs` around lines 1039 - 1077, Deduplicate
normalize_markup_text by making the definition in
crates/uhura-syntax/src/ui.rs#L1039-L1077 pub(crate), or moving it to an
appropriate shared module, while preserving its behavior. Remove the duplicate
implementation in crates/uhura-syntax/src/format.rs#L1549-L1586 and update
formatter call sites to use the shared helper.
crates/uhura-check/src/provenance.rs (1)

1053-1095: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicated "invisible node" logic vs. ui_node_is_source_only.

The inner merge loop re-derives which nodes are invisible (comments, whitespace-only text) instead of delegating to ui_node_is_source_only, which the outer loop already uses for the same purpose (Line 1060-1063). If that helper's semantics change, this loop can silently diverge and coalesce a different set of nodes into the merged text span.

♻️ Suggested consolidation
                     while let Some(candidate) = nodes.get(next) {
                         match &candidate.kind {
-                            ast::UiNodeKind::Comment(_) => next += 1,
-                            ast::UiNodeKind::Text(value)
-                                if value.raw.chars().all(char::is_whitespace) =>
-                            {
-                                next += 1;
-                            }
                             ast::UiNodeKind::Text(_) => {
-                                span = span.through(candidate.span);
-                                next += 1;
+                                if !ui_node_is_source_only(candidate) {
+                                    span = span.through(candidate.span);
+                                }
+                                next += 1;
                             }
+                            _ if ui_node_is_source_only(candidate) => next += 1,
                             _ => break,
                         }
                     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-check/src/provenance.rs` around lines 1053 - 1095, Update the
text-merging loop in the provenance-building method to use
ui_node_is_source_only(candidate) for invisible-node detection, while preserving
the existing behavior of merging non-whitespace text nodes and stopping at other
semantic nodes. Remove the duplicated comment/whitespace classification so the
outer traversal and inner merge loop share the same helper semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/uhura-check/src/parts.rs`:
- Around line 1887-1896: Populate the unit-update map before constructing
MachinePlan, using the existing unit-update collection produced during machine
planning rather than BTreeMap::new(). Pass that populated map into
MachinePlan.unit_updates so reject_unit_update_cycles and downstream unit-update
inlining receive the collected updates.

In `@crates/uhura-check/src/provenance.rs`:
- Around line 200-220: Remove the eager lowering-name lookup loop that populates
lowering_names, and instead resolve a declaration’s lowered name inside
visit_declaration only when handling private UI declarations. Preserve direct
name.text usage for public declarations, while retaining the existing error when
a private declaration lacks a lowering-name binding.

---

Nitpick comments:
In `@crates/uhura-check/src/provenance.rs`:
- Around line 1053-1095: Update the text-merging loop in the provenance-building
method to use ui_node_is_source_only(candidate) for invisible-node detection,
while preserving the existing behavior of merging non-whitespace text nodes and
stopping at other semantic nodes. Remove the duplicated comment/whitespace
classification so the outer traversal and inner merge loop share the same helper
semantics.

In `@crates/uhura-syntax/src/ui.rs`:
- Around line 1039-1077: Deduplicate normalize_markup_text by making the
definition in crates/uhura-syntax/src/ui.rs#L1039-L1077 pub(crate), or moving it
to an appropriate shared module, while preserving its behavior. Remove the
duplicate implementation in crates/uhura-syntax/src/format.rs#L1549-L1586 and
update formatter call sites to use the shared helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0da37ca-f892-4603-8834-e9a43fcc3f12

📥 Commits

Reviewing files that changed from the base of the PR and between 896aa6b and 7e81306.

📒 Files selected for processing (72)
  • .github/workflows/ci.yml
  • crates/uhura-base/src/codes.rs
  • crates/uhura-check/src/authoring.rs
  • crates/uhura-check/src/checker.rs
  • crates/uhura-check/src/compile.rs
  • crates/uhura-check/src/evidence.rs
  • crates/uhura-check/src/lib.rs
  • crates/uhura-check/src/parts.rs
  • crates/uhura-check/src/project_manifest.rs
  • crates/uhura-check/src/provenance.rs
  • crates/uhura-check/src/source.rs
  • crates/uhura-check/src/source/references.rs
  • crates/uhura-check/src/source/ui.rs
  • crates/uhura-check/src/topology.rs
  • crates/uhura-check/src/updates.rs
  • crates/uhura-check/tests/application_bridges.rs
  • crates/uhura-check/tests/comments.rs
  • crates/uhura-check/tests/compile.rs
  • crates/uhura-check/tests/evidence.rs
  • crates/uhura-check/tests/instagram.rs
  • crates/uhura-check/tests/modules.rs
  • crates/uhura-check/tests/packages.rs
  • crates/uhura-check/tests/parts.rs
  • crates/uhura-check/tests/programs.rs
  • crates/uhura-check/tests/project_lock.rs
  • crates/uhura-check/tests/project_manifest.rs
  • crates/uhura-check/tests/provenance.rs
  • crates/uhura-check/tests/returns.rs
  • crates/uhura-check/tests/standard.rs
  • crates/uhura-check/tests/ui.rs
  • crates/uhura-cli/src/cmd/fmt.rs
  • crates/uhura-cli/src/cmd/project.rs
  • crates/uhura-core/src/ir.rs
  • crates/uhura-core/src/runtime.rs
  • crates/uhura-host/src/lib.rs
  • crates/uhura-host/src/source.rs
  • crates/uhura-syntax/src/ast.rs
  • crates/uhura-syntax/src/format.rs
  • crates/uhura-syntax/src/lexer.rs
  • crates/uhura-syntax/src/lib.rs
  • crates/uhura-syntax/src/parser.rs
  • crates/uhura-syntax/src/ui.rs
  • crates/uhura-syntax/src/v04/mod.rs
  • crates/uhura-syntax/tests/annotations.rs
  • crates/uhura-syntax/tests/fixtures/feed-ui.uhura
  • crates/uhura-syntax/tests/format.rs
  • crates/uhura-syntax/tests/instagram.rs
  • crates/uhura-syntax/tests/lexer.rs
  • crates/uhura-syntax/tests/parser.rs
  • crates/uhura-syntax/tests/programs.rs
  • crates/uhura-syntax/tests/ui.rs
  • crates/uhura-tests/tests/a0.rs
  • crates/uhura-tests/tests/diagnostic_goldens.rs
  • crates/uhura-tests/tests/fixtures/diagnostics/name-resolution.json
  • crates/uhura-tests/tests/fixtures/diagnostics/name-resolution.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-fix-declaration-typo.json
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-fix-declaration-typo.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-invalid-expression.json
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-invalid-expression.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/type-mismatch.json
  • crates/uhura-tests/tests/fixtures/diagnostics/type-mismatch.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/ui-content.json
  • crates/uhura-tests/tests/fixtures/diagnostics/ui-content.uhura
  • crates/uhura-tests/tests/instagram.rs
  • crates/uhura-wasm/tests/dispatch_scaling.rs
  • docs/implementation/README.md
  • docs/rfcs/0003-source-comments-docs-and-annotations.md
  • docs/spec/drafts/0.4/source.md
  • examples/instagram/client/styles/theme.css
  • examples/instagram/client/ui.uhura
  • web/src/editor/editor-updates.ts
  • web/src/editor/tests/editor-updates.test.ts
💤 Files with no reviewable changes (1)
  • crates/uhura-syntax/src/v04/mod.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🧹 Nitpick comments (2)
crates/uhura-syntax/src/ui.rs (1)

1039-1077: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Deduplicate normalize_markup_text into one shared crate-internal helper. The function is implemented byte-for-byte identically in both files. Since the parser (ui.rs) normalizes annotation/comment text and the formatter (format.rs) re-normalizes it on output, the two copies must stay in lockstep or parse→format→reparse idempotency (asserted in tests/annotations.rs) silently breaks. Extract once and reuse to make that invariant structural rather than convention.

  • crates/uhura-syntax/src/ui.rs#L1039-L1077: keep this as the single definition (or move it to a shared module) and expose it pub(crate).
  • crates/uhura-syntax/src/format.rs#L1549-L1586: remove the duplicate and call the shared helper.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-syntax/src/ui.rs` around lines 1039 - 1077, Deduplicate
normalize_markup_text by making the definition in
crates/uhura-syntax/src/ui.rs#L1039-L1077 pub(crate), or moving it to an
appropriate shared module, while preserving its behavior. Remove the duplicate
implementation in crates/uhura-syntax/src/format.rs#L1549-L1586 and update
formatter call sites to use the shared helper.
crates/uhura-check/src/provenance.rs (1)

1053-1095: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicated "invisible node" logic vs. ui_node_is_source_only.

The inner merge loop re-derives which nodes are invisible (comments, whitespace-only text) instead of delegating to ui_node_is_source_only, which the outer loop already uses for the same purpose (Line 1060-1063). If that helper's semantics change, this loop can silently diverge and coalesce a different set of nodes into the merged text span.

♻️ Suggested consolidation
                     while let Some(candidate) = nodes.get(next) {
                         match &candidate.kind {
-                            ast::UiNodeKind::Comment(_) => next += 1,
-                            ast::UiNodeKind::Text(value)
-                                if value.raw.chars().all(char::is_whitespace) =>
-                            {
-                                next += 1;
-                            }
                             ast::UiNodeKind::Text(_) => {
-                                span = span.through(candidate.span);
-                                next += 1;
+                                if !ui_node_is_source_only(candidate) {
+                                    span = span.through(candidate.span);
+                                }
+                                next += 1;
                             }
+                            _ if ui_node_is_source_only(candidate) => next += 1,
                             _ => break,
                         }
                     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-check/src/provenance.rs` around lines 1053 - 1095, Update the
text-merging loop in the provenance-building method to use
ui_node_is_source_only(candidate) for invisible-node detection, while preserving
the existing behavior of merging non-whitespace text nodes and stopping at other
semantic nodes. Remove the duplicated comment/whitespace classification so the
outer traversal and inner merge loop share the same helper semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/uhura-check/src/parts.rs`:
- Around line 1887-1896: Populate the unit-update map before constructing
MachinePlan, using the existing unit-update collection produced during machine
planning rather than BTreeMap::new(). Pass that populated map into
MachinePlan.unit_updates so reject_unit_update_cycles and downstream unit-update
inlining receive the collected updates.

In `@crates/uhura-check/src/provenance.rs`:
- Around line 200-220: Remove the eager lowering-name lookup loop that populates
lowering_names, and instead resolve a declaration’s lowered name inside
visit_declaration only when handling private UI declarations. Preserve direct
name.text usage for public declarations, while retaining the existing error when
a private declaration lacks a lowering-name binding.

---

Nitpick comments:
In `@crates/uhura-check/src/provenance.rs`:
- Around line 1053-1095: Update the text-merging loop in the provenance-building
method to use ui_node_is_source_only(candidate) for invisible-node detection,
while preserving the existing behavior of merging non-whitespace text nodes and
stopping at other semantic nodes. Remove the duplicated comment/whitespace
classification so the outer traversal and inner merge loop share the same helper
semantics.

In `@crates/uhura-syntax/src/ui.rs`:
- Around line 1039-1077: Deduplicate normalize_markup_text by making the
definition in crates/uhura-syntax/src/ui.rs#L1039-L1077 pub(crate), or moving it
to an appropriate shared module, while preserving its behavior. Remove the
duplicate implementation in crates/uhura-syntax/src/format.rs#L1549-L1586 and
update formatter call sites to use the shared helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0da37ca-f892-4603-8834-e9a43fcc3f12

📥 Commits

Reviewing files that changed from the base of the PR and between 896aa6b and 7e81306.

📒 Files selected for processing (72)
  • .github/workflows/ci.yml
  • crates/uhura-base/src/codes.rs
  • crates/uhura-check/src/authoring.rs
  • crates/uhura-check/src/checker.rs
  • crates/uhura-check/src/compile.rs
  • crates/uhura-check/src/evidence.rs
  • crates/uhura-check/src/lib.rs
  • crates/uhura-check/src/parts.rs
  • crates/uhura-check/src/project_manifest.rs
  • crates/uhura-check/src/provenance.rs
  • crates/uhura-check/src/source.rs
  • crates/uhura-check/src/source/references.rs
  • crates/uhura-check/src/source/ui.rs
  • crates/uhura-check/src/topology.rs
  • crates/uhura-check/src/updates.rs
  • crates/uhura-check/tests/application_bridges.rs
  • crates/uhura-check/tests/comments.rs
  • crates/uhura-check/tests/compile.rs
  • crates/uhura-check/tests/evidence.rs
  • crates/uhura-check/tests/instagram.rs
  • crates/uhura-check/tests/modules.rs
  • crates/uhura-check/tests/packages.rs
  • crates/uhura-check/tests/parts.rs
  • crates/uhura-check/tests/programs.rs
  • crates/uhura-check/tests/project_lock.rs
  • crates/uhura-check/tests/project_manifest.rs
  • crates/uhura-check/tests/provenance.rs
  • crates/uhura-check/tests/returns.rs
  • crates/uhura-check/tests/standard.rs
  • crates/uhura-check/tests/ui.rs
  • crates/uhura-cli/src/cmd/fmt.rs
  • crates/uhura-cli/src/cmd/project.rs
  • crates/uhura-core/src/ir.rs
  • crates/uhura-core/src/runtime.rs
  • crates/uhura-host/src/lib.rs
  • crates/uhura-host/src/source.rs
  • crates/uhura-syntax/src/ast.rs
  • crates/uhura-syntax/src/format.rs
  • crates/uhura-syntax/src/lexer.rs
  • crates/uhura-syntax/src/lib.rs
  • crates/uhura-syntax/src/parser.rs
  • crates/uhura-syntax/src/ui.rs
  • crates/uhura-syntax/src/v04/mod.rs
  • crates/uhura-syntax/tests/annotations.rs
  • crates/uhura-syntax/tests/fixtures/feed-ui.uhura
  • crates/uhura-syntax/tests/format.rs
  • crates/uhura-syntax/tests/instagram.rs
  • crates/uhura-syntax/tests/lexer.rs
  • crates/uhura-syntax/tests/parser.rs
  • crates/uhura-syntax/tests/programs.rs
  • crates/uhura-syntax/tests/ui.rs
  • crates/uhura-tests/tests/a0.rs
  • crates/uhura-tests/tests/diagnostic_goldens.rs
  • crates/uhura-tests/tests/fixtures/diagnostics/name-resolution.json
  • crates/uhura-tests/tests/fixtures/diagnostics/name-resolution.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-fix-declaration-typo.json
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-fix-declaration-typo.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-invalid-expression.json
  • crates/uhura-tests/tests/fixtures/diagnostics/parse-invalid-expression.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/type-mismatch.json
  • crates/uhura-tests/tests/fixtures/diagnostics/type-mismatch.uhura
  • crates/uhura-tests/tests/fixtures/diagnostics/ui-content.json
  • crates/uhura-tests/tests/fixtures/diagnostics/ui-content.uhura
  • crates/uhura-tests/tests/instagram.rs
  • crates/uhura-wasm/tests/dispatch_scaling.rs
  • docs/implementation/README.md
  • docs/rfcs/0003-source-comments-docs-and-annotations.md
  • docs/spec/drafts/0.4/source.md
  • examples/instagram/client/styles/theme.css
  • examples/instagram/client/ui.uhura
  • web/src/editor/editor-updates.ts
  • web/src/editor/tests/editor-updates.test.ts
💤 Files with no reviewable changes (1)
  • crates/uhura-syntax/src/v04/mod.rs
🛑 Comments failed to post (2)
crates/uhura-check/src/parts.rs (1)

1887-1896: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find any writes to MachinePlan.unit_updates / UnitUpdate construction across the crate.
rg -nP 'unit_updates\s*[:=.]|UnitUpdate\s*\{' crates/uhura-check/src

Repository: gridaco/uhura

Length of output: 903


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate all reads/writes of the MachinePlan.unit_updates field and inspect the
# surrounding code paths that should populate it.
rg -n --context 3 '\.unit_updates\b|unit_updates\s*:' crates/uhura-check/src/parts.rs

Repository: gridaco/uhura

Length of output: 2611


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search the whole repository for any writes/population of unit_updates.
rg -n --context 2 '\bunit_updates\b' . \
  | rg -n 'insert|extend|push|clear|remove|entry|BTreeMap::new|UnitUpdate'

Repository: gridaco/uhura

Length of output: 1058


Populate unit_updates before constructing MachinePlan
MachinePlan.unit_updates is always empty here, and there’s no write to it anywhere in crates/uhura-check/src/parts.rs, so reject_unit_update_cycles and the unit-update inlining path never run.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-check/src/parts.rs` around lines 1887 - 1896, Populate the
unit-update map before constructing MachinePlan, using the existing unit-update
collection produced during machine planning rather than BTreeMap::new(). Pass
that populated map into MachinePlan.unit_updates so reject_unit_update_cycles
and downstream unit-update inlining receive the collected updates.
crates/uhura-check/src/provenance.rs (1)

200-220: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate the definition and contract of lowered_declaration_name / lowered_declaration_name_mut
rg -n -B2 -A15 'fn lowered_declaration_name\b' crates/uhura-check/src
rg -n -B2 -A10 'fn lowered_declaration_name_mut\b' crates/uhura-check/src

Repository: gridaco/uhura

Length of output: 2408


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the lowering/metadata flow around bindings and declaration consumption.
sed -n '1,140p' crates/uhura-check/src/source.rs
printf '\n----\n'
sed -n '300,380p' crates/uhura-check/src/provenance.rs
printf '\n----\n'
rg -n -A4 -B4 'bindings|lowered_declaration_name\(' crates/uhura-check/src

Repository: gridaco/uhura

Length of output: 50370


Defer the lowering-name lookup to the private UI path The eager loop in crates/uhura-check/src/provenance.rs:200-220 hard-fails on any declaration without a binding entry, but visit_declaration only reads lowering_names for Visibility::Private UI declarations; public declarations use name.text directly, so valid public items can fail provenance building unnecessarily.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/uhura-check/src/provenance.rs` around lines 200 - 220, Remove the
eager lowering-name lookup loop that populates lowering_names, and instead
resolve a declaration’s lowered name inside visit_declaration only when handling
private UI declarations. Preserve direct name.text usage for public
declarations, while retaining the existing error when a private declaration
lacks a lowering-name binding.

@softmarshmallow
softmarshmallow merged commit 673ff7b into main Jul 22, 2026
2 checks passed
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