Skip to content

fix(resource): preserve pre-enqueue semantic update mode#2071

Open
myysy wants to merge 2 commits into
mainfrom
fix/resource-preenqueue-update-mode
Open

fix(resource): preserve pre-enqueue semantic update mode#2071
myysy wants to merge 2 commits into
mainfrom
fix/resource-preenqueue-update-mode

Conversation

@myysy
Copy link
Copy Markdown
Collaborator

@myysy myysy commented May 15, 2026

Description

Fix resource semantic update mode detection so new add-resource imports are not misclassified as incremental updates after internal lifecycle lock setup creates the target directory.

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Preserve the target's pre-enqueue existence state before lifecycle lock acquisition and pass it through semantic queue messages.
  • Restrict resource incremental semantic updates to targets that already existed before enqueue time, avoiding false incremental mode for newly added resources.
  • Silence expected "directory not found" cases during incremental target-side directory comparison in the semantic DAG.
  • Add unit coverage for viking://resources root splitting and explicit pre-enqueue existence overrides.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows
      Notes:
  • Verified from runtime logs that a new ov add-resource tt_a --wait import now enqueues SemanticMsg(... target_exists_before_enqueue=False ...) and no longer logs Target URI exists, using incremental update: viking://resources/tt_a.
  • Verified that the previous semantic_dag.py "Failed to list directory ... Directory not found" warnings no longer appear for this flow.
  • Full local pytest execution is currently blocked by missing environment dependencies (_sqlite3, pathspec).

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

This PR intentionally keeps the existing semantic processor structure and applies the smallest safe fix:

  • decide whether the target originally existed before enqueue-side state is mutated by lifecycle locking
  • carry that fact through SemanticMsg
  • keep parent refresh behavior unchanged (viking://resources still performs direct incremental refresh when child content changes)

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 Score: 95
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

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

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants