Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d92c7a2
docs: add MatCreator agent and run guidance
Zikkying Oct 3, 2026
c59aa54
feat(aidb): preflight silicon tasks before calculation preparation (#2)
Shik-Utau Oct 7, 2026
071cfab
fix(aidb): preserve task authorization and close preflight bypasses
Shik-Utau Oct 7, 2026
db7904a
feat: verify tracked silicon VASP outputs for T2
Shik-Utau Oct 7, 2026
3c742de
fix: bind silicon handoff to submitted VASP inputs
Shik-Utau Oct 7, 2026
1397059
docs: record T2 review and blocked real acceptance
Shik-Utau Oct 7, 2026
f4b52f5
fix: preserve MatCreator subprocess Python environment
Shik-Utau Oct 7, 2026
b01acaa
fix: preserve authorization and default PBE evidence in silicon workflow
Shik-Utau Oct 7, 2026
67777e6
docs: explain verified PBE potential setup for Bohrium VASP
Shik-Utau Oct 7, 2026
c0169fe
docs: record verified real silicon relaxation and static acceptance
Shik-Utau Oct 7, 2026
a1e7499
feat: archive verified silicon outputs through public aidb round trip
Shik-Utau Oct 7, 2026
7ea0698
docs: record silicon archive standards and spec review
Shik-Utau Oct 7, 2026
8351169
Implement verified silicon result reuse (Ai-ready_Database #5)
Shik-Utau Oct 7, 2026
19d37b8
Respect matching KPOINTS constraints during Si reuse
Shik-Utau Oct 7, 2026
100b17a
Keep all recognized k-mesh syntax separate from INCAR
Shik-Utau Oct 7, 2026
df6116d
Record T4 independent-session acceptance and final reviews
Shik-Utau Oct 7, 2026
587becd
Implement final B lookup-failure consent (Ai-ready_Database #6)
Shik-Utau Oct 7, 2026
4dc04d3
Invalidate stale consent after standalone task updates
Shik-Utau Oct 7, 2026
5f88f95
Record verified A-to-B switch and final dual-axis review
Shik-Utau Oct 7, 2026
a79fd4e
Make silicon loop checks repeatable and fail on missing integration
Shik-Utau Oct 7, 2026
fb6f474
Record published CI bridge dependency and T5 compatibility
Shik-Utau Oct 7, 2026
692bf7c
Retain T5 retro regression proof for silicon delivery
Shik-Utau Oct 8, 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
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,45 @@ jobs:

- name: Run frontend checks
run: npm run check

silicon-local-loop:
name: Silicon local loop (public aidb bridge)
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
path: MatCreator
- name: Checkout pinned aidb integration dependency
uses: actions/checkout@v4
with:
repository: Zikkying/Ai-ready_Database
# Public bridge contract verified at this immutable integration commit.
# Published on codex/matcreator-ci-bridge; never use latest.
ref: 87148777fc9995a6d2e3bd85571ee8e20ff53181
path: Ai-ready_Database
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install both public packages
run: |
python -m pip install --upgrade pip
python -m venv Ai-ready_Database/.venv
Ai-ready_Database/.venv/bin/python -m pip install -e ./Ai-ready_Database
python -m pip install -e ./MatCreator pytest
- name: Run isolated loop tests with zero skips
working-directory: MatCreator
env:
AI_READY_DB_ROOT: ${{ github.workspace }}/Ai-ready_Database
AI_READY_DB_PYTHON: ${{ github.workspace }}/Ai-ready_Database/.venv/bin/python
run: python script/check_silicon_loop.py tests --output .workspace/ci/silicon-check.json
- name: Retain failure and test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: silicon-local-loop-results
path: MatCreator/.workspace/ci/
if-no-files-found: warn
107 changes: 107 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# AGENTS.md

This file provides guidance to Qoder (qoder.com) when working with code in this repository.

## Project Overview

MatCreator is an agentic AI platform for computational materials science, built as an agent harness around the Google ADK runtime, a markdown-based skill library, a workspace, and a persistent knowledge graph. It offers CLI, API, and Web interfaces.

## Commands

### Environment setup

```bash
pip install uv
uv venv .venv --python 3.12 # Python 3.12+ required (.python-version pins 3.12)
source .venv/bin/activate
uv pip install -e . # includes git deps (mat-bench, mat-know-base) — needs network
```

Frontend (only needed for Web UI development):

```bash
cd web/vite-frontend
npm ci # Node.js >= 24.14.1 required (.nvmrc pins 24.14.1)
```

### Tests

Backend (pytest; no pytest config file — run against `tests/` directly):

```bash
python -m pytest tests/ -v # full suite
python -m pytest tests/test_ports_config.py -v # single file
python -m pytest tests/test_ports_config.py -k "name_pattern" -v # single test
```

Note: CI (`.github/workflows/test.yml`) runs only a subset of test files plus the frontend check.

Frontend:

```bash
cd web/vite-frontend
npm run check # runs node --test + vite build (this is what CI enforces)
npm test # node --test only
npm run build # vite build only
```

### Running

```bash
bash script/start_matcreator.sh # Web UI: starts ADK API (:8000) + FastAPI (:8001) + Vite (:5173)
matcreator chat --workspace . # CLI, Flash mode (direct interaction)
matcreator chat --workspace . --plan # CLI, Plan mode (thinking agent -> execution graph -> execution agent)
```

The start script writes logs to `~/.matcreator/logs/{api-server,web-main,vite}.log` and resolves hosts/ports with precedence: environment variable > `~/.matcreator/config.yaml` > built-in default (logic in `src/matcreator/ports.py`).

### Configuration

Persistent settings live in `~/.matcreator/config.yaml` (relocatable via `MATCREATOR_HOME` or `MATCREATOR_CONFIG_PATH`):

```bash
matcreator config set llm.model=openai/qwen3-plus
matcreator config set llm.api_key=your-api-key
matcreator config set llm.base_url=https://api.example.com/v1
matcreator config show
```

Precedence rule: in local mode pre-existing environment variables win over `config.yaml`; in server mode (`MATCREATOR_MODE=server`) `config.yaml` wins. Full reference including multi-model `llm.executor_cards`: `docs/configuration.md`.

## Architecture

Request flow (see `docs/architecture_components.md` for details):

```
Vite frontend (web/vite-frontend) -> FastAPI middleware (web/main.py) -> ADK API server -> MatCreator agent (src/matcreator)
```

### Layers

- **Frontend** (`web/vite-frontend`): Vite app (Svelte + React mix, Ketcher, vis-network). Owns UI state, SSE consumption, and browser-reload reconnect to managed runs. Entry: `src/main.js`.
- **FastAPI middleware** (`web/main.py`): the application backend. Two roles: (1) ADK protocol proxy (`/run_sse`, `/apps/*`, `/list-apps`); (2) MatCreator-specific APIs (sessions, workspace files, structures, skills, settings, cancellation). In server mode it also acts as a Docker worker control plane (one worker container per user). Managed runs are process-local — execution does not survive a middleware restart.
- **Agent runtime** (`src/matcreator`): hosted on Google ADK. Entry `src/matcreator/agent.py`; CLI/API-server startup in `src/matcreator/scripts/start_agent.py`.

### Agent internals

- **Orchestrator** (`src/matcreator/agents/orchestrator/agent.py`): every turn starts with planning; if the planning agent approves an execution graph, control moves to the execution agent, which can return to planning within the same ADK invocation. Flash mode bypasses this loop.
- **Thinking/execution agents** (`src/matcreator/agents/thinking_agent/`, `src/matcreator/agents/execution_agent/`): graph planning vs. step executors running tools/skills/remote jobs.
- **Skills** (`src/matcreator/skills/`): modular markdown capabilities. Each skill is a directory with a `SKILL.md` carrying YAML frontmatter (`name`, `description`, `metadata.tools`, `metadata.dependent_skills`, `metadata.tags`). Skills declare dependencies on each other (e.g. `eos` depends on `ase`, `deepmd`, `bohrium`, ...).
- **Knowledge** (`src/matcreator/knowledge/`): self-improving Know-Do Graph (extraction, review, migration, query) that accumulates experience across executions. Extraction/review frequency is configurable (`MATCREATOR_MEMORIZATION_FREQUENCY`, `MATCREATOR_REVIEW_FREQUENCY`; `0` disables).
- **Control plane** (`src/matcreator/control_plane/`): durable remote-job store/service/monitor (E2B sandboxes), benchmark/evaluation runtime, worker supervisor.
- **Workspace** (`src/matcreator/workspace.py`): sessions and artifacts live under the `--workspace` directory; ADK session state under `~/.matcreator/.adk/session.db`.

### Source layout conventions

- Python packages live under `src/matcreator` (`[tool.setuptools.packages.find] where = ["src"]`) — the import root is `src/`, not the repo root. `script/start_matcreator.sh` sets `PYTHONPATH` to `src/` so the checkout, not site-packages, is executed.
- Skill files (`.md`, `.py`, `.yaml` under `skills/`) are shipped via `[tool.setuptools.package-data]` — new skill assets in those formats are packaged automatically.
- Port/host resolution for all services is centralized in `src/matcreator/ports.py`.

## Testing conventions

- `tests/conftest.py` maintains `ALL_CONFIG_ENV_VARS`, the canonical list of configuration environment variables. When adding a new config env var to `src/matcreator/ports.py`, add it there so config-cleanup tests clear it automatically.
- Frontend tests live in `web/vite-frontend/test/` and use the Node built-in test runner (`node --test`).

## Docker

Multi-stage build (`Dockerfile`): `worker` (API only, :8000), `control-plane` (API + built frontend, :8001), `local` (full dev image incl. Node, :8000/:8001/:5173). Port configuration via `.env` (see `.env.example`; copy to `.env` before `docker compose up`). Deployment docs: `docs/deployment/`.
10 changes: 10 additions & 0 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Scientific result review

Review scientific feedback against the current structured tool receipt and retained calculation evidence. Automated receipt checks establish provenance and consistency; they do not establish the scientific accuracy of a narrative.

- Check that the selected structures, calculation stages, methods, parameters, completion status and source jobs support the requested reuse. Explain material compatibility limits when they affect the answer.
- Keep relaxation and static results distinct. State energy units and basis (for example eV per cell), and do not infer comparative physical meaning solely from a numerical difference between stages.
- Assess accuracy and precision claims from convergence evidence, the model and method, and the intended use. Printed decimal places, a successful job, or a verified archive alone do not justify a claim such as “high precision.”
- Keep retrieval defaults distinct from user requirements. A successful lookup is not permission to submit a calculation, and historical development policy A is not the current final B policy.

The repeatable checks and evidence navigation are documented in [the silicon local-loop guide](docs/testing/silicon-local-loop.md).
108 changes: 108 additions & 0 deletions docs/aidb_preflight_test_results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"date": "2026-10-07",
"stage": "T1 development A",
"baseline_commit": "d92c7a2973831d5da5214befbc888e8587387eb4",
"baseline": {
"summary": "39 failed, 710 passed, 578 warnings in 41.51s",
"failures": [
"tests/test_benchmark_config.py::test_benchmark_client_registers_and_persists_missing_development_token",
"tests/test_disabled_skills.py::test_set_disabled_skill_names_updates_graph_nodes",
"tests/test_evaluation_routes.py::test_toggle_skill_graph_node_updates_and_reports_graph_state",
"tests/test_kdg_extractor.py::test_extractor_advances_cursor_for_empty_valid_response",
"tests/test_kdg_extractor.py::test_extractor_migrates_legacy_extracted_session",
"tests/test_kdg_extractor.py::test_extractor_skips_unchanged_session_and_processes_only_delta",
"tests/test_kdg_progressive_retrieval.py::test_graph_agent_tool_routes_through_protected_reviewer_policy",
"tests/test_kdg_progressive_retrieval.py::test_graph_agent_tool_scopes_memory_review_to_current_session",
"tests/test_kdg_progressive_retrieval.py::test_graph_disabled_skills_are_hidden_from_discovery_and_reads",
"tests/test_skill_graph_seed.py::test_seed_removes_stale_managed_skill_and_uses_virtual_dependency",
"tests/test_skill_graph_seed.py::test_seed_reuses_disabled_skill_node_and_merges_legacy_duplicate",
"tests/test_step_executor_runner.py::test_step_executor_retries_only_malformed_streamed_tool_arguments",
"tests/test_structure_modeling.py::test_crystal_is_created_through_matcraft_bulk_builder",
"tests/test_structure_modeling.py::test_matcraft_perturbation_is_seeded_and_changes_positions",
"tests/test_structure_modeling.py::test_molecule_can_be_created_or_appended",
"tests/test_structure_modeling.py::test_smiles_molecule_can_be_appended_at_requested_center",
"tests/test_structure_modeling.py::test_supercell_supports_general_integer_matrix",
"tests/test_web_concurrent_sessions.py::test_active_session_transitions_recompute_composer_state",
"tests/test_web_concurrent_sessions.py::test_all_chat_disclosures_share_the_reading_position_controller",
"tests/test_web_concurrent_sessions.py::test_bottom_attachment_and_node_toggle_use_one_scroll_policy",
"tests/test_web_concurrent_sessions.py::test_chat_messages_use_one_model_scheduler_and_stable_regions",
"tests/test_web_concurrent_sessions.py::test_completed_request_handoffs_live_turn_before_durable_refresh",
"tests/test_web_concurrent_sessions.py::test_frontend_tracks_requests_per_session",
"tests/test_web_concurrent_sessions.py::test_image_and_all_timeline_updates_preserve_node_disclosures",
"tests/test_web_concurrent_sessions.py::test_new_session_ids_are_not_limited_to_one_second_resolution",
"tests/test_web_concurrent_sessions.py::test_plain_text_blocks_keep_history_order_and_stable_identity",
"tests/test_web_concurrent_sessions.py::test_remote_job_polling_is_scoped_to_the_active_session",
"tests/test_web_concurrent_sessions.py::test_remote_jobs_are_collapsed_and_keep_lifecycle_status_visible",
"tests/test_web_concurrent_sessions.py::test_reselecting_the_active_session_does_not_rebuild_the_view",
"tests/test_web_concurrent_sessions.py::test_roadmap_fits_after_the_popup_has_a_stable_layout",
"tests/test_web_concurrent_sessions.py::test_running_session_switch_discovers_and_reconnects_managed_run",
"tests/test_web_concurrent_sessions.py::test_session_creation_does_not_start_knowledge_review",
"tests/test_web_concurrent_sessions.py::test_session_switch_loads_page_scoped_graph_after_the_transcript_page",
"tests/test_web_concurrent_sessions.py::test_session_switch_renders_cached_snapshot_immediately",
"tests/test_web_concurrent_sessions.py::test_sse_request_uses_captured_session_context",
"tests/test_web_concurrent_sessions.py::test_startup_keeps_session_api_ready_while_maintenance_runs_in_background",
"tests/test_web_concurrent_sessions.py::test_startup_restores_only_an_accessible_session_owner_tuple",
"tests/test_web_concurrent_sessions.py::test_step_cancellation_identifies_the_active_session_owner",
"tests/test_web_concurrent_sessions.py::test_stop_and_plan_refreshes_preserve_open_node_dialogs"
]
},
"final": {
"summary": "39 failed, 743 passed, 585 warnings in 61.57s (0:01:01)",
"failures": [
"tests/test_benchmark_config.py::test_benchmark_client_registers_and_persists_missing_development_token",
"tests/test_disabled_skills.py::test_set_disabled_skill_names_updates_graph_nodes",
"tests/test_evaluation_routes.py::test_toggle_skill_graph_node_updates_and_reports_graph_state",
"tests/test_kdg_extractor.py::test_extractor_advances_cursor_for_empty_valid_response",
"tests/test_kdg_extractor.py::test_extractor_migrates_legacy_extracted_session",
"tests/test_kdg_extractor.py::test_extractor_skips_unchanged_session_and_processes_only_delta",
"tests/test_kdg_progressive_retrieval.py::test_graph_agent_tool_routes_through_protected_reviewer_policy",
"tests/test_kdg_progressive_retrieval.py::test_graph_agent_tool_scopes_memory_review_to_current_session",
"tests/test_kdg_progressive_retrieval.py::test_graph_disabled_skills_are_hidden_from_discovery_and_reads",
"tests/test_skill_graph_seed.py::test_seed_removes_stale_managed_skill_and_uses_virtual_dependency",
"tests/test_skill_graph_seed.py::test_seed_reuses_disabled_skill_node_and_merges_legacy_duplicate",
"tests/test_step_executor_runner.py::test_step_executor_retries_only_malformed_streamed_tool_arguments",
"tests/test_structure_modeling.py::test_crystal_is_created_through_matcraft_bulk_builder",
"tests/test_structure_modeling.py::test_matcraft_perturbation_is_seeded_and_changes_positions",
"tests/test_structure_modeling.py::test_molecule_can_be_created_or_appended",
"tests/test_structure_modeling.py::test_smiles_molecule_can_be_appended_at_requested_center",
"tests/test_structure_modeling.py::test_supercell_supports_general_integer_matrix",
"tests/test_web_concurrent_sessions.py::test_active_session_transitions_recompute_composer_state",
"tests/test_web_concurrent_sessions.py::test_all_chat_disclosures_share_the_reading_position_controller",
"tests/test_web_concurrent_sessions.py::test_bottom_attachment_and_node_toggle_use_one_scroll_policy",
"tests/test_web_concurrent_sessions.py::test_chat_messages_use_one_model_scheduler_and_stable_regions",
"tests/test_web_concurrent_sessions.py::test_completed_request_handoffs_live_turn_before_durable_refresh",
"tests/test_web_concurrent_sessions.py::test_frontend_tracks_requests_per_session",
"tests/test_web_concurrent_sessions.py::test_image_and_all_timeline_updates_preserve_node_disclosures",
"tests/test_web_concurrent_sessions.py::test_new_session_ids_are_not_limited_to_one_second_resolution",
"tests/test_web_concurrent_sessions.py::test_plain_text_blocks_keep_history_order_and_stable_identity",
"tests/test_web_concurrent_sessions.py::test_remote_job_polling_is_scoped_to_the_active_session",
"tests/test_web_concurrent_sessions.py::test_remote_jobs_are_collapsed_and_keep_lifecycle_status_visible",
"tests/test_web_concurrent_sessions.py::test_reselecting_the_active_session_does_not_rebuild_the_view",
"tests/test_web_concurrent_sessions.py::test_roadmap_fits_after_the_popup_has_a_stable_layout",
"tests/test_web_concurrent_sessions.py::test_running_session_switch_discovers_and_reconnects_managed_run",
"tests/test_web_concurrent_sessions.py::test_session_creation_does_not_start_knowledge_review",
"tests/test_web_concurrent_sessions.py::test_session_switch_loads_page_scoped_graph_after_the_transcript_page",
"tests/test_web_concurrent_sessions.py::test_session_switch_renders_cached_snapshot_immediately",
"tests/test_web_concurrent_sessions.py::test_sse_request_uses_captured_session_context",
"tests/test_web_concurrent_sessions.py::test_startup_keeps_session_api_ready_while_maintenance_runs_in_background",
"tests/test_web_concurrent_sessions.py::test_startup_restores_only_an_accessible_session_owner_tuple",
"tests/test_web_concurrent_sessions.py::test_step_cancellation_identifies_the_active_session_owner",
"tests/test_web_concurrent_sessions.py::test_stop_and_plan_refreshes_preserve_open_node_dialogs"
]
},
"new_failures": [],
"resolved_baseline_failures": [],
"collection_errors_reproduced_at_baseline": [
"tests/test_execution_grouping.py",
"tests/test_matcreator_phase_and_skills.py"
],
"focused_tests": {
"passed": 40,
"failed": 0
},
"aidb_bridge_tests": {
"passed": 14,
"failed": 0
},
"real_calculation_submitted": false
}
Loading
Loading