Skip to content

feat(figma): drift detection and mapping cache reuse (Phase E — T2F.10) - #2

Open
canonical-muhammadbassiony wants to merge 1 commit into
feat/figma-phase-d-clifrom
feat/figma-phase-e-drift
Open

feat(figma): drift detection and mapping cache reuse (Phase E — T2F.10)#2
canonical-muhammadbassiony wants to merge 1 commit into
feat/figma-phase-d-clifrom
feat/figma-phase-e-drift

Conversation

@canonical-muhammadbassiony

Copy link
Copy Markdown
Owner

Summary

Implements drift detection for Figma-backed runs, allowing Bauer to skip expensive API calls when the design file has not changed since the last run.

Tasks Implemented

  • T2F.10: When running with --figma-url, Bauer now calls GetMeta first to retrieve the file version. If unchanged versus the previous run, stored mappings are reused and GetNodes/screenshot downloads are skipped. If changed, a warning is logged and a full re-fetch proceeds. Resolver.Build was hardened with post-process normalization that marks any chunk with Confidence < 0.5, Method == "fallback", or Method == "none" as Status: "unresolved".

Files Changed

  • internal/artifacts/manager.goFigmaVersion field; LoadPreviousMeta, LoadMappings, UpdateRunFigmaVersion methods
  • internal/orchestrator/orchestrator.go — drift detection in generateChunksWithFigma; cache-hit early-return
  • internal/source/mapping/resolver.go — post-process normalization loop for low-confidence mappings

How to Review

git diff feat/figma-phase-d-cli..feat/figma-phase-e-drift -- .

Part of the Bauer v2 stacked PR series (Branch 8 of 12).

T2F.10: LoadPreviousMeta looks up most recent matching run by docID + figmaFileKey
T2F.10: LoadMappings reads mappings.json from a previous run artifact
T2F.10: generateChunksWithFigma checks Figma version before re-fetching
T2F.10: version unchanged => reuse stored mappings (skips GetNodes + screenshot DL)
T2F.10: version changed => warn + full re-fetch
T2F.10: RunMetadata.FigmaVersion stored after each figma fetch
T2F.10: low-confidence/fallback mappings flagged with status: unresolved
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