Skip to content

kraft calibration reference - #639

Closed
Cathyhjj wants to merge 372 commits into
xraypy:masterfrom
Dr-XAS:codex/kraft-calibration-reference
Closed

Cathyhjj wants to merge 372 commits into
xraypy:masterfrom
Dr-XAS:codex/kraft-calibration-reference

Conversation

@Cathyhjj

@Cathyhjj Cathyhjj commented Oct 6, 2026

Copy link
Copy Markdown

No description provided.

jhuang165 and others added 30 commits September 15, 2026 17:44
Integrate Larch fitting, AMCSD structure search, project CIF attachments, and bounded FEFF path generation into the Athena workspace. Add the frontend workflow, persistence, tests, and documentation, with private temporary job storage and expiry cleanup.
Raise text in the data-group and processing panes by two pixels while preserving the existing layout and controls.
Dr.XAS can reserve an export of selected Athena groups but has no way to
read what it selected: nothing in the v2 contract carries a group's
science, and nothing in Athena records which project version a single
group last changed in, so a selection could not be pinned even if the
science travelled.

Close both gaps at their existing chokepoints. `save` is the only writer
of a project, so it stamps a per-group revision map beside the groups —
outside the group payload, which every stored project, native export and
editor view already depends on the exact shape of. `process` is the only
writer of a cached result, so it stamps the Larch version that computed
it; unattributed science is refused rather than credited to a later
upgrade.

On top of that, a selected-group export carries each group's authoritative
axis, its provenance and its processing. Processing crosses as
recomputable only when the portable recipe really describes the spectrum
and the cached result is complete; a difference, a non-mu(E) data type, an
incomplete result or a recipe this contract rejects travels as computed
arrays under xraylarch-web's own authority, naming which shortfall it hit,
so an importer can never mistake exported arrays for its own replay.
Provenance maps onto a Dr.XAS seed or a column-mapped upload when it has a
portable identity, and otherwise stays internal, naming only its parents.

The reservation was recording project_version 0 for every project and
never checking that its selections existed, so it bound nothing; it now
resolves the same revisions the export does.

Read-only, and authorized exactly like the project summary: the HMAC
signature authenticates Dr.XAS and the per-project capability authorizes
the one project.
- Return per-path k and complex R contributions evaluated at the final
  fitted parameters, and plot them with optional curve offsets
- Add "Sync parameters" to reconcile the GDS table with path expressions
- Default new fits and the example to k-weights 0, 1, 2, 3
- Add a shared ParameterHelp component for field descriptions

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Reorder data groups by drag handle with keyboard support and
  announcements, replacing the up/down buttons
- Show help text for processing parameters
- Default q-space to the real part with the k-space overlay, and keep
  separate R and q component selections
- Add grid and data-point display toggles; tidy the import toolbar and
  sticky column-selection header
- Update e2e specs for the new defaults

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A group's revision only moves when that group changes, and the export
reservation resolves a selection against the exact revision it names, so
claiming the project version for every marked group made any ordinary
multi-group "Import into Dr.XAS" fail as a changed selection. The browser
already receives the authoritative map - GET /api/athena/projects/{ident}
returns the stored project whole - it simply was not read; AthenaProject now
declares group_versions and the return selection uses each group's own entry.

Found by Dr.XAS's cross-application acceptance test, which drives this
repository's mounted frontend through the Dr.XAS ingress; the README and the
deployment manifest now state the three seam contracts that test depends on.
…button

Moving the test server under the /advanced-xas/app mount proved the mounted
deployment but broke all 38 pre-existing specs, which navigate to plain / and
404 under a mount - the suite could not run at all. Run two test servers instead
of rewriting 38 files, so standalone and mounted serving both stay proven.

Underneath that, 50 queries looked for download links. The project capability now
travels in a header rather than a URL, so downloads are buttons; the queries follow.

Verification: 48 passed / 50 failed. Every one of the 50 failures is pre-existing.
A fork-point control tree built from 6917adb - untouched code, untouched tests -
fails on the identical set (47 passed / 50 failed), so this branch introduces no
regression and fixes none. The only delta is the added mounted spec, which passes.
The dominant failure mode is upstream markup: athena-workbench nests a ContextLabel
inside the data-groups heading, so its accessible name is "Data groups N Actions for
current group" and the exact-match heading queries cannot match. Not a green suite.
Brings the capability-gated Dr.XAS integration session into the Athena
workbench and extends the gating pass over the control surface master
added in parallel (menu-command registry, group drag reorder, Help
command search, Artemis EXAFS fitting, plot refinements).

athena-workbench.tsx took master's version wholesale and had the
branch's gating delta re-applied onto it, so every new control names the
project operation it submits:

- the MenuCommand registry is now the single gating point for the main
  menus and the Help command search: local-workspace commands (new/open
  project, plugin registry, beamline identification) are hidden in a
  linked session, and every other entry carries can()/canOpen().
- command("reorder") mutates project state, so the drag handle, the
  pointer-drag start, and submitGroupOrder are all gated; bulk and
  per-group marking are gated as metadata writes.
- project exports moved from <a href> to transport downloads, because a
  plain href cannot carry the X-XrayLarch-Project-Capability header.
- the Artemis fitting tab is dropped entirely in a linked session: the
  backend already refuses integration drafts on both the fit and the
  CIF-attachment routes, so the tab could only produce errors. Its panel
  mounts eagerly behind the tab strip, hence the hide rather than a
  disable.
- api/artemis keeps master's prefix-only proxy gate rather than a guessed
  method table; narrowing it is a follow-up, not part of this merge.

Verified in the merge worktree: tsc --noEmit clean, 1037 frontend unit
tests pass, and a nine-mutant sweep of the new gates left no survivors.
The backend suite shows 330 pre-existing environment failures on this
host; a fork-point set-diff against both parents (master 330, branch 327)
confirms zero regressions.
Persist light and dark appearance, theme all scientific plots and dialogs, and keep fitting panes scrollable with residual traces hidden initially.

Preserve native Athena integration controls after syncing master and verify download bytes across Node and jsdom Blob implementations.
Add selectable shared colormaps for spectrum and wavelet plots, including Coolwarm, reverse ordering, and persisted viewer preferences. Resolved against current master.
Restore the PR's original spectrum-only colormap controls and decouple the wavelet subplot.
Centralize interface and Plotly typography, improve control readability,
and keep fitting panels usable in constrained layouts.

Add theme-aware Dr.XAS logo assets with deployment-prefix-safe paths.
Document the typography scale and logo provenance.
Retain palette indices from the full plot group list before filtering out
unavailable traces, matching AthenaPlot in every plot space.

Add Classic and Viridis regressions for a missing first R-space group.
Document the independent spectrum color legend and wavelet color scale.
Introduce the Dr.XAS-style heatmap and surface viewer with draggable
k-range controls, windowed chi(k), Fourier magnitude previews, and CSV export.
Keep viewer transforms read-only and retain the applied scientific settings.

Validate versioned range overrides against measured support and handle
floating-point minimum-width boundaries without altering requested limits.
Cover range interactions, stale responses, scientific equivalence, and resizing.
Measure drag deltas in viewport coordinates so scroll clamping cannot
amplify a resize gesture as the document shrinks.

Add a regression that preserves the requested height while scrollY changes,
and persists the final height only when the drag completes.
Import transmission and fluorescence together with independent detector
settings and shared preprocessing, saved atomically in one revision.
Preserve both mappings in column memory and preview both signals.

Ask whether to share reviewed parameters before a multi-file import.
Reuse compatible column positions, pause for incompatible or mandatory
reviews, and retain pending files on failure without duplicating imports.

Cover validation, scientific values, persistence, and end-to-end file,
SPEC, ZIP, and Athena project workflows.
Cathyhjj and others added 28 commits October 6, 2026 15:14
The XRF fit started every detector at 10 eV per channel, so a 20-BM
detector binned to about 30 eV per channel had its automatic windows on
empty channels and returned noise without a warning.

- Infer a starting calibration per detector element from the beamline's
  line windows, the target line turning on at the scan's edge, and the
  elastic peak; leave the calibration fields empty to use it.
- Show where the calibration came from, warn when it is a guess or rests
  on one scatter peak, and use it for the raw viewer's energy axis.
- Open detector HDF5 files met in Import spectra in the XRF panels with
  the file loaded; batches list them with their own button.
Say the QA fixes are live on port 3004, not undeployed
Check watcher bootstrap refusals by message and run real flock in CI
…nifest

CLAUDE.md is the shared-memory bridge guide for Claude, Codex and Pi; AGENTS.md
points to it. .codex/config.toml turns off native Codex memory for this project
only, and .agents/skills links to .claude/skills. .claude/settings.local.json and
.claude/worktrees/ stay local.

The manifest now names drxas as the deploy host (since 2026-09-16), moves the
frontend listener from 3004 to 3006, documents the separate public instance on
3004/8007, replaces the Goldendale cron example with the drxas entries, and
notes that /local/drxas-ops/gate-f/xraylarch-web-liveness.sh still probes 3004.
Reuse exact XRF basis pieces across calibration evaluations
Read the XRF detector calibration from the scan file
tests/test_watcher.sh requires README.md and the manifest to name
XRAYLARCH_WEB_SIBLING_PROFILE=goldendale; the drxas rewrite had dropped it.
Add shared-memory adapters and record the drxas deploy host in the manifest
The drxas sibling profile required every Dr.XAS service to answer, so a
Dr.XAS new-features deploy restarting dev :3001 failed the mounted
activation of 1c12cd1 on 2026-10-06 until the next watcher poll.

Production (3000, 8000) still gates activation, rollback and the checker.
The dev pair (3001, 8001) and dev bot backends (8002, 8003) are probed as
before, but an unhealthy one now prints a WARNING line instead of failing.
The goldendale profile is unchanged.
Stop a Dr.XAS dev restart from failing XrayLarch deploys
@Cathyhjj Cathyhjj closed this Oct 6, 2026
@Cathyhjj
Cathyhjj deleted the codex/kraft-calibration-reference branch October 6, 2026 23:29
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.

3 participants