Commit aeee5944 authored by Vacaliuc, Bogdan's avatar Vacaliuc, Bogdan
Browse files

pre-commit: prepare project files after clone from other branch

parent 0481db52
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
# bl4b-alignment-integration instructions
# css-archiver-query-tool-development instructions

This project contains correspondence, screenshots and log files developed during the course
of development of scripts and to automate sample alignment using the instrument control system.
This project contains plans and artifacts gathered during the course
of the development of a capability to interrogate the EPICS archiver detabase directly by agent(s).
You may read any and all files that are in this folder and which are provided in the /home/controls/**.
There are also files that may be referenced from the read-only experiment filesystem mounts at /SNS/REF_L/**.
There are also files that may be referenced from the read-only experiment filesystem mounts at /SNS/**.
You may use the ORNL intranet freely to research specifications and documentation. If there is information
that you require that references the public internet and are blocked from access, ask for help to obtain the file.

## Capabilites and Role

You are an EPICS automation specialist who is expert at Python. You are familiar with both pyepics and pydevice uses,
You are a EPICS automation specialist who is expert at Python and Java. You are familiar with SQL query,
as well as EPICS database record syntax, and have a deep understanding of scan server and scantools modules used at the ORNL instrument suite.
You are able to direct agent teams who are system programmers and software developers who are also expert at using Phoebus (the UI system) and how to diagnose and fix memory, concurrency and file system errors.

## Problem specific files

There are many files that have been collected during previous investigations. These are noted in the following files and folders:

* /SNS/users/6ov/BL4B/2026/02/07/
* /SNS/users/6ov/BL4B/2026/03/26/
* /home/controls/var/tmp/ScriptScan/2026A/
* /home/controls/var/tmp/ScriptScan/scripts/
* /home/controls/var/tmp/PYTHON/2025-B/
* /home/controls/var/tmp/PYTHON/2026-A/

## Secure Temporary Files

When a task requires writing a temporary script or data file (e.g. to work around

README.md

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
# Tasks for Bogdan Vacaliuc

This is a gitlab repo that exists to manage todo-lists that do not exist on other systems listed below

## [Redmine (IDAC support)](https://idac.ornl.gov/projects/idac/issues?query_id=83)

This is the issue tracker for DAQ support issues.  The link above takes me to the query page where all of my open issues are rendered in a table.

## [Atlassian Confluence](https://ornl-neutrons.atlassian.net/wiki/home)

These are pages operating as a wiki/knowledge base.  There are serval sections:

* [Neutron DevOps](https://ornl-neutrons.atlassian.net/wiki/spaces/NDEVOPS/overview?homepageId=2621501)
* [Neutron CIS](https://ornl-neutrons.atlassian.net/wiki/spaces/NCIS/overview)

## IBM Workflow System

This is the system that is used to track CMSD support staff projects.
(I have to add the link, but I have forgotten the password that I setup and changing it is a royal PITA, so I have to try and remember the algorithm I used...)
 No newline at end of file

analysis-chis-scan-integration.md

deleted100644 → 0
+0 −1019

File deleted.

Preview size limit exceeded, changes collapsed.

+6 −29
Original line number Diff line number Diff line
# bl4b-alignment-integration
# css-archiver-query-tool-development

Using the [Claude](https://code.ornl.gov/6ov/claude) agentic-engineering knowledge transfer workflow, I gathered information regarding the integration of Spyder scripts at BL4b into the scantools module. This is a module that uses several python modules, two IOCs and CSS UIs to generate scans that are processed by the scan server. The challenge ( *as described in [Redmine 4850](https://idac.ornl.gov/issues/4850)* ) is that integration into the existing workflow requires adjustment to several codes and IOCs.
Using the [Claude](https://code.ornl.gov/6ov/claude) agentic-engineering knowledge transfer workflow, I would like to add an enduring capability to allow the agent(s) to query the archiver database *directly* as a capability/skill/whatever. This transcript details the steps taken towards that goal.

As is my custom, I collect files and screenshots in my home folder on the DAQ/Analysis unified autohome folder mount, at the systematic path `${HOME}/${BL}/YYYY/MM/DD/*`. The agent runs on a machine that has the `/SNS/REF_L/` and `/SNS/users/${USER}/` mounted via an sshfs filesystem mount ( *which is setup easily by the workflow via `setup/mount-sshfs.sh`* ). The [architecture](https://code.ornl.gov/6ov/claude/-/blob/main/setup/docs/architecture.md?ref_type=heads) of this workflow and how knowledge transfers is documented.
As is my custom, I collect files and screenshots in my home folder on the DAQ/Analysis unified autohome folder mount, at the systematic path `${HOME}/analysis/${BL}/YYYY/MM/DD/*`. The agent runs on a machine that has the `/SNS/REF_L/` and `/SNS/users/${USER}/` mounted via an sshfs filesystem mount ( *which is setup easily by the workflow via `setup/mount-sshfs.sh`* ). The [architecture](https://code.ornl.gov/6ov/claude/-/blob/main/setup/docs/architecture.md?ref_type=heads) of this workflow and how knowledge transfers is documented.

## Progress on 2026-03-31
## Progress on 2026-04-11

I spent time integrating into [bl4b:issue/4850](https://code.ornl.gov/idac/cs/legacy/bl4b/-/tree/issue/4850) and [scantools:issue/4850](https://code.ornl.gov/idac/cs/common/scantools/-/tree/issue/4850). I got pretty far, in so much as I could select 'xy' or 'xprofile' as the detector, choose 'chis' as the motor and the scan would invoke the alternate handling required to compute the needed statistics. There are some discrepancies, however, that prevent it from being ready to use in production.

## Progress on 2026-04-06

Under this environment, I created an initial [commit](https://code.ornl.gov/6ov/tasking/-/commit/64b5e508fcf7f977ecfb50eebe06c90be72550fd) to prepare for this investigation, based on previous work and an understanding of how to prompt the AI assistant to produce high quality results. From that step, I engaged in a the dialog that is captured below:
In a different project's transcript [epilogue](https://code.ornl.gov/6ov/tasking/-/blob/bl4a-DANGLE-investigation/transcript.md?ref_type=heads#epilogue), I had an idea that the agent(s) would be able to query the main archiver database. Within that sessions context ( *which was a diversion after the core work was completed* ), a [plan](https://code.ornl.gov/6ov/claude/-/blob/uvdl3/plan/archiver-query-tool.md?ref_type=heads) was developed.

## Prompt 1

You are working in the tasking project, bl4b-alignment-integration branch. The code uses the Experimental Physics Industrial Control System (EPICS) as its basis. The task is to analyze the implementation of the 'chis' motor scan enhancements. These enhancements are present in the `/home/controls/bl4b` folder, issue/4850 branch, and `/home/controls/common/scantools/issue/4850/` folder (scantools issue/4850 branch). Please read any git log that are appropriate. The effort is a work in progress to integrate the function of the Spyder environment scripts that are contained in `/home/controls/var/tmp/PYTHON/2026-A/*`. First with the `CHI_scan.py` script, and then progressing onward `startup/Solid_theta_alignment_low_angle_2gauss.py` under the same model. Work done in 3/31 to 4/1 made some progress. There are some observed discrepancies. I would like you to perform a thorough review of the code to gain an understanding of how the various pieces fit together. Please produce a document that explains in full detail your understanding of the project in a way that can be given to future agents to perform a series of tasks. You and I will iterate on this document until we are both satisfied that it captures the full scope of how the instrument automation performs such alignment scanning. This is a cruical step because a lot of work is planned to improve this mechanism and a good foundational understanding of the process is key. If you need a tool to analyze the code or artifacts so far, please install it yourself according to the instructions in the cross-project layer (use pixi or uv with venv). If you are missing a log file or piece of information, please ask me to fetch it for you. If you run into an issue where you need sudo, ask me to execute the line in a separate terminal.

Claude produced [analysis-chis-scan-integration.md](analysis-chis-scan-integration.md) with some uncertainties.

### Prompt 1.1

Thank you. I have made `/home/controls/scantools/main/` and `/home/controls/scantools/issue/4850/` paths available to you. The latter is the branch in question; my apology for missing it earlier. I have also cloned the repository used by the scan server at `/home/controls/css/`. On REF_L, the active scan server has this execution pattern:
```
$ ps aux | grep java
controls    2232 71.6  2.8 5274864 914004 pts/1  Sl+  Mar24 15423:21 java -jar service-scan-server-4.6.4.jar -settings /home/controls/css/phoebus.ini -settings /home/controls/bl4b/css/phoebus.ini -config /home/controls/bl4b/scan_config.xml
$ sudo file /proc/2232/cwd
/proc/2232/cwd: symbolic link to /home/controls/css/scan-server-2021-01-15
```
So I have made the `/home/controls/css/scan-server-2021-01-15/` available to you on this machine as well. Since this machine is not part of the instrument control system, the scan server cannot be run here, but perhaps you may be able to inspect the .jar files to gain an understaing. If it helps you, I have cloned the source code to "Phoebus" at '/home/controls/src/phoebus/' where the scan server source code is located in that repository at '/home/controls/src/phoebus/services/scan-server/src/main/java/org/csstudio/scan/server/'. You may continue your analysis with a more complete source code to fill in the uncertainties that you remarked about.

Claude updated [analysis-chis-scan-integration.md](analysis-chis-scan-integration.md)

### Prompt 1.2

Excellent. Would you consider 6.4 and explain why the scan server does not deliver the complete waveform of Data:XPROFILE or Data:XY to the FittingIOC? Also, would you consider 6.6 and suggest an edit to the calls to matplotlib such that the images are rendered in the 640x480 dimensions?
You are working in the cross-project layer, using the tasking project's 'css-archiver-query-tool-development' branch to capture progress. The subject is the use of the Experimental Physics Industrial Control System (EPICS) system as it is implemented at the Spallation Neutron Source (SNS). The goal of this session is to add the capability of agent(s) to make queries directly to the PV archive database directly whenever they need to interrogate the current or historical state of a real instrument that they are investigating or performing an analysis for. This has proven effective in the 'bl4a-DANGLE-investigation' branch (you may read the git log). On this machine, an "office" version of CSS/Phoebus runs in ~/opt/css/ (via ~/opt/css/product-sns-4.7.4-SNAPSHOT/phoebus.sh). This program is able to access the archive database without authorization (whatever credentials are needed are embedded in the configuration files). Please study this code carefully. Review the plan that was developed earlier to see if any refinements are needed after gaining an understanding of the CSS/Phoebus code. If it helps you, I have cloned the source code to "Phoebus" at '/home/controls/src/phoebus/' where the scan server source code is located in that repository at '/home/controls/src/phoebus/services/scan-server/src/main/java/org/csstudio/scan/server/'. Be thorough and systematic, using all the cross-project knowledge we have gained so far. If you are missing an item of information, please ask me to fetch it for you. If you run into an issue where you need sudo, please ask me to execute the line in a separate terminal.