Skip to content

Need to bring the latest change from main to trajectory_refactor#222

Merged
nianjunz merged 50 commits intotrajectory_refactorfrom
main
Mar 19, 2026
Merged

Need to bring the latest change from main to trajectory_refactor#222
nianjunz merged 50 commits intotrajectory_refactorfrom
main

Conversation

@nianjunz
Copy link
Collaborator

No description provided.

jdsheehan and others added 30 commits February 4, 2026 11:54
issue #133

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
issue #133

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
issue #133

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Adding a pointer to the utterance guideline and ground truth guideline
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
…ation

- Add src/servers/wo/main.py: FastMCP server with 3 tools (list_equipment,
  get_work_orders, summarize_work_orders) backed by the sample CSV dataset
- Add src/servers/wo/tests/: conftest with mock_df fixture and 12 unit tests
  covering all tools; integration tests gated by requires_wo_data marker
- Add src/tmp/agent_hive/tools/wo.py: agent_hive tool registration module
  (mirrors fmsr.py / tsfm.py pattern) referencing external woagent package
- Add src/tmp/agent_hive/agents/wo_agent.py: WorderOrderAgent class backed
  by ReactReflectXenAgent, matching the interface expected by run_track tests
- Register wo-mcp-server CLI entry point in pyproject.toml

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…on_cbm

Port all @validate_inputs functions from
src/tmp/workorder_agent/event_forecasting/apis/api_implementation_cbm.py
to FastMCP tools, replacing the earlier placeholder stub.

Tools (8 total):
- get_work_orders          — all WOs for equipment in date range
- get_preventive_work_orders — preventive WOs only
- get_corrective_work_orders — corrective WOs only
- get_events               — all events (WO / alert / anomaly)
- get_failure_codes        — full failure code catalogue
- get_work_order_distribution — counts per (primary, secondary) code pair
- predict_next_work_order  — Markov-chain transition probability
- analyze_alert_to_failure — alert-rule → maintenance transition stats

Key structural changes vs. original:
- Equipment/DateRange/Date objects → flat string parameters (MCP-friendly)
- importlib.resources.path() → configurable WO_DATA_DIR env var
  (defaults to src/tmp/assetopsbench/sample_data/)
- All data loaded lazily, missing files degrade gracefully
- Pickle-file return values → typed Pydantic BaseModel responses
- analyze_alert_to_failure now returns the computed transition result
  instead of None
- validate_inputs decorator removed (MCP enforces types)
- Tests updated: 23 unit tests + 8 integration tests (requires_wo_data)

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
- Add src/couchdb/init_wo.py: loads all WO CSVs into a CouchDB
  `workorder` database with _dataset discriminator field and Mango indexes
- Rewrite src/servers/wo/data.py: lazy couchdb3 connection, load() queries
  via Mango find instead of reading CSVs
- Fix src/servers/wo/tools.py: use rule_id column (was rule) for alert_events
- Update tests: mock_data patches servers.wo.tools.load directly; replace
  requires_wo_data marker with requires_couchdb; all 23 unit tests pass

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…ompose

- Add src/couchdb/init_asset_data.py: loads IoT sensor JSON into CouchDB
  (decouples data loading from couchdb_setup.sh)
- Simplify couchdb_setup.sh: only writes local.ini and starts CouchDB
- Add db-init service to docker-compose.yaml: python:3.12-slim container
  that runs after couchdb is healthy, calling both init_asset_data.py
  and init_wo.py

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…ontainer

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…derAgent

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…check connectivity, fix history date validation order

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…ver and tests

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
CouchDB rejects document fields starting with '_' (reserved for _id,
_rev, etc.). Rename the collection discriminator field from _dataset
to dataset in both init_wo.py and data.py.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Add wo-mcp-server to DEFAULT_SERVER_PATHS so WorkOrderAgent tools are
available to plan-execute without requiring --server overrides.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…UCTIONS.md

- Add WorkOrder query examples (work order count, PM vs CM split,
  alert-to-failure probability, multi-step distribution + prediction)
- Clarify that plan-execute spawns MCP servers on-demand; no manual
  server startup required
- Fix .env.public: replace COUCHDB_DBNAME with IOT_DBNAME + WO_DBNAME
- Add src/tmp/ to .gitignore

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: ChathurangiShyalika <chathurangijks@gmail.com>
Signed-off-by: ChathurangiShyalika <chathurangijks@gmail.com>
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
issue #133

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Can be set by env variable `SCENARIO_CLIENT_TIMEOUT`

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
jdsheehan and others added 20 commits March 6, 2026 14:13
Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
updates to scenario-client
issue #193

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
Issue193 - replace mlflow with mlflow.MLflowClient in scenario server
issue #201

Signed-off-by: John D Sheehan <john.d.sheehan@ie.ibm.com>
add build-date endpoint to scenario-server
Update couchdb Docker tag to v3.5
Debian 12 (Bookworm) enforces PEP 668 and blocks system-wide pip installs
without an explicit opt-in flag, causing ModuleNotFoundError for requests
and pandas during CouchDB container initialisation.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
refactor: implement Work Order Agent MCP server and agent_hive integration
Replace all uses of "agent" terminology with "server" in models, planner,
executor, runner, CLI, and tests to match MCP architecture where servers
expose tools and the plan-execute runner is the actual agent.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
IoTAgent → iot, FMSRAgent → fmsr, TSFMAgent → tsfm,
WorkOrderAgent → wo, Utilities → utilities.

Updates FastMCP() names in all server main.py files, DEFAULT_SERVER_PATHS
keys in executor.py, all test fixtures and plan strings, and INSTRUCTIONS.md.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
When execute_step encounters a tool=none step that has prior-step
dependencies, it was returning the static expected_output description
instead of deriving the actual value from the dependency context.
Downstream steps depending on that result would receive the description
string (e.g. "The name and id of a chiller asset...") and fail to
resolve their {step_N} placeholders correctly.

Fix: for tool=none steps with dependencies present in context, call the
LLM with a short extraction prompt to derive the concrete value.  Steps
with no dependencies retain the previous behaviour (return expected_output).

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
A LLM Notebook revising the dependnecy for tutorial
…erver

refactor: rename "agent" to "server" throughout workflow/ (#170)
@nianjunz nianjunz merged commit bb2f916 into trajectory_refactor Mar 19, 2026
3 of 4 checks passed
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.

6 participants