Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
8f86c4a
feat: add Dash + Plotly UI layer (Phase 1 MVP)
utkuvibing Apr 13, 2026
8b9c0d9
fix(dash): harden startup verification and sample loading
utkuvibing Apr 13, 2026
994346b
feat(dash): complete stable workspace parity
utkuvibing Apr 13, 2026
4f91ad3
feat(dash): add DSC analysis page and fix stale workspace / import er…
utkuvibing Apr 13, 2026
e54b4ca
feat(dash): enrich DSC result views and workspace refresh
utkuvibing Apr 13, 2026
5e18359
feat(dash): add TGA analysis page (Phase 1) with backend-driven execu…
utkuvibing Apr 13, 2026
b280c35
refactor(dash): extract shared analysis-page primitives from DSC/TGA
utkuvibing Apr 13, 2026
db28824
fix(dash): sample name propagation and plot annotation declutter
utkuvibing Apr 13, 2026
4b01082
Fix FTIR axis validation and update sidebar tagline
utkuvibing Apr 14, 2026
d67efcf
Improve FTIR figure readability
utkuvibing Apr 14, 2026
6abfc40
feat(dash): add DTA analysis page (Phase 1) with backend-driven execu…
utkuvibing Apr 14, 2026
353b5ae
fix(dash): harden DTA result presentation and summary signals
utkuvibing Apr 14, 2026
a932e18
feat(dash): add Raman Phase 1 page and navigation
utkuvibing Apr 14, 2026
18fbbcb
feat(dash): add XRD phase 1 page and navigation
utkuvibing Apr 14, 2026
fa00112
test(dash): add workflow regression coverage for combined app
utkuvibing Apr 15, 2026
7948c68
Dash Compare Phase 2: best-vs-raw overlay, batch run, tests
utkuvibing Apr 15, 2026
fb8864e
dash: dark-mode controls, i18n chrome, and theme-aware figures
utkuvibing Apr 15, 2026
9654ad8
fix(dash): harden dark dropdown selectors for non-analysis controls
utkuvibing Apr 15, 2026
f738eff
Made-with:
utkuvibing Apr 15, 2026
f6772b5
Made-with:
utkuvibing Apr 15, 2026
be3dc6e
fix(dash): remount themed dropdowns and style guidance callouts
utkuvibing Apr 15, 2026
5c9a51d
feat(import): modality-first import pipeline with 6-step wizard
utkuvibing Apr 15, 2026
bb61501
feat(sidebar): move recent history from project page to sidebar under…
utkuvibing Apr 15, 2026
5130fa6
fix(dash): target Dash 4 dropdown DOM for dark sidebar locale
utkuvibing Apr 15, 2026
5daef9c
fix(dash): scope sidebar locale dropdown styles by theme
utkuvibing Apr 15, 2026
94fca3e
fix(sidebar): prevent spurious theme toggle on sidebar re-render
utkuvibing Apr 15, 2026
fb45a74
Dash i18n: wire home, export, compare, project to ui-locale
utkuvibing Apr 16, 2026
10ff745
Dash analysis i18n: wire modality pages and shared analysis_page to u…
utkuvibing Apr 16, 2026
4c8e24c
Dash Report Center: license gating, batch preview, support snapshot, …
utkuvibing Apr 16, 2026
5ff2f7d
Add agent workflow and context continuity guide
utkuvibing Apr 16, 2026
00cee54
fix(dash): DTA sample name prefers workspace display for file-like su…
utkuvibing Apr 16, 2026
040f31d
feat(dash): DTA smoothing controls + processing_overrides channel (Ph…
utkuvibing Apr 16, 2026
0993218
docs(.ai): record Phase 1 commit + push 040f31d in SESSION/TASK
utkuvibing Apr 16, 2026
d1a154c
feat(dash,backend): DTA Phase 2a+2b (baseline/peak overrides, literat…
utkuvibing Apr 16, 2026
279604b
feat(dash,backend): DTA Phase 3 - stepwise tabs + processing-preset C…
utkuvibing Apr 16, 2026
7bc063a
docs(.ai): record Phase 3 commit + push 279604b in SESSION/TASK
utkuvibing Apr 16, 2026
a014981
feat(dash): finish DTA Phase 4 result UX polish
utkuvibing Apr 17, 2026
d7d3c4d
docs(readme): update to Dash-first runtime and roadmap
utkuvibing Apr 17, 2026
3659afc
fix(dash): align DTA literature status with retained evidence
utkuvibing Apr 17, 2026
93c0aa7
fix(dash): curate DTA literature panel user experience
utkuvibing Apr 17, 2026
652120d
fix(literature): exclude placeholder subjects from DTA queries
utkuvibing Apr 17, 2026
d6719f8
feat(thermal): add behavior-first/known-material search semantics
utkuvibing Apr 17, 2026
be37810
Polish Dash DTA result/debug figure annotations and hover UX
utkuvibing Apr 18, 2026
3f3e583
Polish DTA results surface hierarchy and figure presentation
utkuvibing Apr 18, 2026
028c5f9
Refine DTA result surface and figure polish
utkuvibing Apr 18, 2026
db5ab3d
Persist result figures across all analysis modalities
utkuvibing Apr 18, 2026
5d95123
Persist analysis figures and add branding upload preview
utkuvibing Apr 18, 2026
7231b93
feat(dsc): upgrade Dash page to DTA-level parity
utkuvibing Apr 18, 2026
3b5450d
docs(ai): figure persistence slice; add RTK Cursor rule
utkuvibing Apr 18, 2026
0ff062c
feat(dash): DSC maturity — literature compare, prerun info, baseline …
utkuvibing Apr 19, 2026
a232d6d
chore(.ai): close session after DSC maturity slice; clear active task
utkuvibing Apr 19, 2026
7d06d7d
feat(dsc): tighten peak detection, reorder layout, expand literature …
utkuvibing Apr 19, 2026
2b33d49
chore(.ai): close session after DSC stabilization slice
utkuvibing Apr 19, 2026
c5233d9
fix(dsc): add missing i18n key for metadata technical-details; harden…
utkuvibing Apr 19, 2026
c0c9673
feat: literature provider fallback, DSC export figures, and capture d…
utkuvibing Apr 19, 2026
41ae13f
docs: update README for current release (v2.0) and latest capabilities
utkuvibing Apr 19, 2026
615c3e7
Dash TGA: DSC-parity layout, panels, literature, tests
utkuvibing Apr 19, 2026
c0b219b
docs(.ai): note TGA slice pushed in SESSION
utkuvibing Apr 19, 2026
e9170b2
Polish TGA Dash results UX without layout rework
utkuvibing Apr 20, 2026
49a3d8a
TGA Dash UX: readable validation, aligned steps, tighter literature
utkuvibing Apr 20, 2026
5e57a91
docs(.ai): note rtk pytest verification and pushed branch state
utkuvibing Apr 20, 2026
f785012
feat(dash): clickable DOI/URL links in shared literature compare UI
utkuvibing Apr 20, 2026
8ccaeae
feat(dash): TGA presets, processing overrides, and .ai updates
utkuvibing Apr 20, 2026
951a2de
refactor(dash): TGA left column Setup / Processing / Run tabs
utkuvibing Apr 20, 2026
49c2f40
Dash: literature compare card on all analysis pages
utkuvibing Apr 20, 2026
075b191
Dash TGA: exploration parity (undo, raw quality, refs, guide)
utkuvibing Apr 20, 2026
bbf45d5
feat(dash): DSC/DTA processing history; align reset button theme
utkuvibing Apr 20, 2026
3cb389e
fix(dash): remove Run-tab keyboard shortcut hint copy
utkuvibing Apr 20, 2026
5f238c6
feat(dash): FTIR analysis page full product-grade implementation
utkuvibing Apr 20, 2026
6f5c4c5
docs(.ai): update SESSION, TASK, DECISIONS after FTIR full product-gr…
utkuvibing Apr 20, 2026
89f4e12
fix(ftir): stabilize science chain — signal role, baseline, normaliza…
utkuvibing Apr 20, 2026
991aebe
FTIR follow-up: peak retention, plot gating, library_unavailable, i18n
utkuvibing Apr 20, 2026
ce037d9
feat(ftir): remove raw-quality panel; thermal-style literature compare
utkuvibing Apr 20, 2026
390b9a7
docs(.ai): record FTIR slice commit hash in SESSION
utkuvibing Apr 20, 2026
feac858
fix(dash): FTIR page modality copy, validation counts, library UX
utkuvibing Apr 21, 2026
03ad6f2
docs(.ai): record FTIR Dash UI slice commit in SESSION
utkuvibing Apr 21, 2026
5cadf22
fix(dev): WSL library cloud URL bootstrap and Windows path env sanita…
utkuvibing Apr 21, 2026
361dfc9
docs: reorder .env.example for combined Dash vs split backend
utkuvibing Apr 21, 2026
711451a
feat(raman): complete dash migration and specialize literature reasoning
utkuvibing Apr 21, 2026
b167057
feat(xrd): Dash parity shell, figure gallery, and preview PNG downscale
utkuvibing Apr 21, 2026
652f3a1
fix(xrd): hierarchy, progressive disclosure, and calmer plot defaults
utkuvibing Apr 21, 2026
1e6956a
polish(xrd): final layout, CSS rhythm, and i18n copy
utkuvibing Apr 22, 2026
3ed79a1
docs(.ai): record XRD polish push in SESSION
utkuvibing Apr 22, 2026
09b968f
fix(i18n): eliminate cross-namespace key leakage in DSC, DTA, TGA pages
utkuvibing Apr 22, 2026
96f1d29
P1-1: CSS class namespace cleanup — hybrid-generic ms-* prefix
utkuvibing Apr 22, 2026
d4d1ba1
Complete P0-1 DSC/DTA baseline method parity
utkuvibing Apr 22, 2026
86a976b
Complete P0-4 similarity metric selector for FTIR and Raman
utkuvibing Apr 22, 2026
258e047
Fix Turkish FTIR Raman similarity i18n text
utkuvibing Apr 22, 2026
5275a49
Complete DSC mass normalization parity
utkuvibing Apr 22, 2026
5e839a3
Standardize figure capture toolbars across Dash pages
utkuvibing Apr 23, 2026
975c9d4
Extract shared analysis page boilerplate
utkuvibing Apr 23, 2026
842ea41
Complete P2 Dash polish consistency
utkuvibing Apr 23, 2026
9fda677
Localize spectral plot settings UI
utkuvibing Apr 24, 2026
b3ac9b6
Update README for Dash parity remediation
utkuvibing Apr 24, 2026
c2d7472
Stabilize library runtime tests
utkuvibing Apr 24, 2026
8e9d5a9
Remove generated test artifacts from PR
utkuvibing Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .ai/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Agent Workflow Guide

This repository uses a context-first vibecoding workflow.

## Primary operating model

- Prefer one primary agent per task.
- Do not simulate a company org chart such as PM -> Architect -> Developer -> QA handoffs.
- If parallel exploration is needed, use it only to gather alternatives or inspect different parts of the codebase, then merge the findings back into one implementation path.
- Preserve continuity through repository files, not chat memory.

## Files to read before making changes

Read these before planning or editing code:

1. `README.md`
2. `AGENTS.md`
3. `.ai/SESSION.md`
4. `.ai/TASK.md`
5. `.ai/DECISIONS.md`
6. `Cursor.md`

If one of these files is missing or clearly stale, say so explicitly.

## Required pre-change behavior

Before changing code:

1. Read the relevant context files.
2. Inspect the files most likely involved in the task.
3. Summarize your understanding in 5 bullets.
4. State assumptions, risks, and missing information.
5. Propose the smallest useful next step.

Do not start with a broad rewrite when a smaller validated slice is possible.

## Implementation rules

- Prefer small, testable patches over large rewrites.
- Reuse existing patterns before inventing new abstractions.
- Keep functions and modules focused.
- Avoid touching unrelated modalities unless the task requires it.
- Explain why a structural change is necessary before making it.
- Preserve working flows while extending unfinished ones.

## Verification rules

After a meaningful code change:

- Check for import errors.
- Check the directly affected execution path.
- Note likely regressions or edge cases.
- Report what was verified and what was not verified.

## Handoff rules

At the end of a meaningful work session, update:

- `.ai/SESSION.md` with current status, blockers, next step, and touched files.
- `.ai/DECISIONS.md` with any durable technical decision and the reason for it.

Keep those files short, current, and specific.

## Task sizing

Break work into slices with clear acceptance criteria.

Good:
- add DTA page shell
- wire upload flow
- render first valid plot
- add invalid-file error path

Bad:
- finish entire Dash migration

## Review mode

When asked to review, critique, or verify:

- look for broken assumptions
- identify edge cases
- name regression risks
- suggest the smallest correction first

Do not default to rewriting everything.
285 changes: 285 additions & 0 deletions .ai/BUGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
# Bugs — MaterialScope

Tracked defects and suspected problems. **Root cause is never “proven” here without evidence**—update fields as facts change.

## Status definitions (use exactly these meanings)


| Status | Meaning |
| ------------- | -------------------------------------------------------------------------------------------- |
| **Suspected** | Not yet reproduced or otherwise confirmed; hypothesis or report only. |
| **Open** | Reproduced **or** otherwise confirmed; **not fixed** yet. |
| **Fixed** | A fix **was applied**; still **needs verification** (tests and/or agreed manual check). |
| **Closed** | Fix **verified**; no further work on this entry unless it regresses (then open a new entry). |


Do **not** use alternate labels (e.g. “mitigated”, “in progress”) in new entries—fold that into **Open** or **Fixed** per the table.

**Workflow / verification discipline:** `**.cursor/rules/00-workflow.mdc`**.

---

## Entry template (copy below the line)

```
### Title
<short name>

### Status
Suspected | Open | Fixed | Closed

### Symptoms
Observable facts only.

### Repro steps
Numbered steps; note branch/environment/data when relevant.

### Likely cause
Hypotheses; update after evidence.

### Files involved
Known paths, or “unknown until traced”.

### Next check
Smallest test, log, or experiment to advance status.
```

---

## BUG-006 — i18n key namespace leakage across DSC, DTA, TGA Dash pages

### Title

DSC/DTA processing history labels borrowed TGA i18n keys; TGA quality/metadata/summary labels borrowed DSC keys

### Status

**Closed**

### Symptoms

- DSC processing history card showed TGA-namespaced keys (`dash.analysis.tga.processing.*`) for history title, undo button, status text.
- DTA processing history card used the same TGA-namespaced keys.
- TGA quality card, raw metadata panel, and analysis summary used DSC-namespaced keys (`dash.analysis.dsc.quality.*`, `dash.analysis.dsc.raw_metadata.*`, `dash.analysis.dsc.summary.*`).
- TR locale users would see correct translations only if the borrowed namespace happened to have the same values; semantically incorrect ownership.

### Repro steps

1. Open DSC analysis page; switch locale to TR; observe processing history labels.
2. Check source: `rg "dash.analysis.tga.processing." dash_app/pages/dsc.py dash_app/pages/dta.py`.
3. Open TGA analysis page; observe quality card and metadata labels.
4. Check source: `rg "dash.analysis.dsc.quality." dash_app/pages/tga.py`.

### Likely cause

During initial DSC/DTA history card implementation, TGA processing history i18n keys were reused as a shortcut. During TGA page buildout, DSC quality/metadata/summary keys were reused similarly. No regression tests existed to catch cross-namespace borrowing.

### Files involved

- `utils/i18n.py` — 28 new keys added (7 DSC, 7 DTA, 5 TGA quality, 3 TGA raw metadata, 6 TGA summary)
- `dash_app/pages/dsc.py` — 7 key references swapped
- `dash_app/pages/dta.py` — 7 key references swapped
- `dash_app/pages/tga.py` — 18 key references swapped
- `tests/test_dsc_dash_page.py` — 2 new regression tests
- `tests/test_dta_dash_page.py` — 2 new regression tests
- `tests/test_tga_dash_page.py` — 2 new regression tests

### Next check

Regression tests now guard against re-introduction: source-grep tests assert no leaked namespace literals; monkeypatch tests assert correct namespace in rendered output.

---

## BUG-001 — Possible parity gaps during Streamlit → Dash migration

### Title

Possible parity / behavior gaps between legacy Streamlit flows and Dash + Plotly surfaces

### Status

**Suspected**

### Symptoms

Users **may** see mismatches (missing views, different defaults, divergent plots/metrics, inconsistent file/workspace handling) **if** Streamlit and Dash paths diverge. No specific workflow is confirmed in this entry.

### Repro steps

1. Pick a workflow that **actually exists** on both paths (verify in app/docs).
2. Same inputs (project, files, settings); compare outputs/affordances; record differences.

*(If no dual path exists, note that—do not force a repro.)*

### Likely cause

**Unknown** until a concrete case exists; candidates include UI duplication, incomplete callbacks, API differences, or intentionally deferred features.

### Files involved

**Unknown** until traced; usual suspects live under `dash_app/`, `backend/`, `core/`, and any remaining Streamlit entrypoints—confirm, do not guess.

### Next check

One workflow: document parity with evidence, **or** promote a **narrow** child entry to **Open** with a confirmed repro and file pointers.

---

## BUG-002 — Saved analysis figures missing in exports/project persistence

### Title

Saved results intermittently lacked persisted analysis figures in shared state

### Status

**Closed**

### Symptoms

- Graph visible in Dash analysis page but missing in exported PDF/DOCX.
- Saved result artifacts lacked reliable figure linkage.
- Project save/load did not consistently carry figure payloads forward.

### Repro steps

1. Run real Dash app (`python -m dash_app.server`) on branch `web-dash-plotly-migration`.
2. Execute analysis and save result.
3. Export report (DOCX/PDF) and inspect figure presence.
4. Save/load project and check `figure_count` + result artifacts linkage.

### Likely cause

Shared figure persistence depended too heavily on UI capture callback success; backend save path did not guarantee figure registration at result-save time.

### Files involved

- `backend/app.py`
- `core/figure_render.py`
- `dash_app/components/analysis_page.py`
- `dash_app/pages/dta.py`

### Next check

Monitor for regressions in additional modalities during future Dash slices.

---

## BUG-003 — Branding logo upload lacked immediate pre-save feedback

### Title

No immediate UI confirmation after logo selection before Save Branding

### Status

**Closed**

### Symptoms

- Selecting a logo file showed no visible uploaded/selected state until Save Branding completed.

### Repro steps

1. Open Export page branding panel.
2. Select a logo file in upload control.
3. Observe no pending selection indicator before saving.

### Likely cause

Preview area was populated only by backend-loaded persisted branding state; no callback rendered pending upload contents.

### Files involved

- `dash_app/pages/export.py`

### Next check

Keep pending/saved branding distinction consistent if additional branding fields get staged UI behavior.

---

## BUG-004 — FTIR science chain produced misleading baseline, flat normalized trace, and silent zero peaks

### Title

FTIR preprocessing / peak detection / matching produced scientifically misleading results without diagnostic context

### Status

**Closed**

### Symptoms

- Baseline was a straight line between first and last data points even for `asls`/`rubberband` methods, producing obviously wrong sloped baselines.
- Normalization could collapse into a near-flat line around zero with no explanation.
- Peak count was 0 for transmittance data because troughs were never inverted.
- Query / smoothed / normalized traces were semantically misaligned (peak detection ran on normalized even when it was broken).
- No diagnostic context when preprocessing failed; "No Match" hid deeper science problems.

### Repro steps

1. Import FTIR dataset with transmittance unit or with strong spectral features.
2. Run analysis with default `ftir.general` template.
3. Observe baseline overlay, normalized trace, and peak count in results.

### Likely cause

- `_estimate_spectral_baseline` claimed to support `asls`/`rubberband` but only drew a linear line.
- `_normalize_spectral_signal` had no guard-rails for zero-range or near-flat input.
- No absorbance/transmittance role detection; pipeline always looked for positive maxima.
- `_detect_spectral_peaks` used a hand-rolled local-maximum scanner instead of `scipy.signal.find_peaks`.
- Failure modes were silent; no diagnostics propagated to validation or UI.

### Files involved

- `core/batch_runner.py`
- `backend/library_cloud_service.py`
- `backend/models.py`
- `backend/app.py`
- `dash_app/pages/ftir.py`

### Next check

Monitor for regressions in Raman (shares `_execute_spectral_batch`) and future peak-detector extensions.

---

## BUG-005 — Raman Dash inherited generic literature/reasoning path and FTIR warning wording

### Title

Raman used generic scientific-context path and could surface FTIR-labelled spectral warnings

### Status

**Closed**

### Symptoms

- Raman literature compare path did not use Raman-specialized query/compare semantics.
- Raman scientific context could fall back to generic placeholder reasoning.
- Shared spectral warnings could contain FTIR-prefixed wording on Raman runs.

### Repro steps

1. Run Raman analysis and inspect literature context/reasoning payload outputs.
2. Trigger warning-producing Raman spectral conditions (e.g., baseline suppression / normalization skip).
3. Observe terminology and dispatch behavior.

### Likely cause

Raman was still wired through generic literature/reasoning branches in core logic, and shared spectral warning strings were hardcoded with FTIR label text.

### Files involved

- `core/raman_literature_query_builder.py`
- `core/literature_compare.py`
- `core/scientific_reasoning.py`
- `core/batch_runner.py`
- `dash_app/pages/raman.py`
- `utils/i18n.py`

### Next check

Covered by targeted tests for Raman Dash page, literature compare, and scientific reasoning; watch for regressions when shared spectral helpers change.
Loading
Loading