Skip to content

Commit c939107

Browse files
authored
Unify workspace config paths, adopt XDG defaults, and standardize runtime as mas-runtime-py. (#2)
Centralize filenames and runtime id in mas.runtime.constants; add CI literal check; migrate all docs to $XDG_* path variables with user-config.md as canonical reference. Signed-off-by: Jordan Augé <augjorda@cisco.com>
1 parent a3b16b5 commit c939107

189 files changed

Lines changed: 2102 additions & 2011 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- "examples/**"
1717
- "Taskfile.yml"
1818
- "pyproject.toml"
19+
- "scripts/**"
1920
- ".github/workflows/test.yml"
2021
push:
2122
branches: [ main ]
@@ -48,7 +49,7 @@ jobs:
4849
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b "${{ runner.temp }}/bin"
4950
echo "${{ runner.temp }}/bin" >> "$GITHUB_PATH"
5051
51-
- name: CI gates (Taskfile ci = verify-unit + verify-functional + validate)
52+
- name: CI gates (Taskfile ci = verify:literals + verify-unit + verify-functional + validate)
5253
run: task ci
5354

5455
- name: Coverage gate (kernel, ctl.workspace, bench pipeline)

Taskfile.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ tasks:
3434
- uv pip install -e library-samples
3535
- uv pip install pytest pytest-asyncio pytest-cov pytest-timeout import-linter pyyaml click python-dotenv jsonschema httpx certifi truststore pyarrow
3636

37+
verify:literals:
38+
desc: "Forbidden path/id literal gate (scripts/check_literals.py)"
39+
cmds:
40+
- python3 scripts/check_literals.py
41+
3742
verify-unit:
3843
desc: "Unit tests — repo gates + v2 lab/bench/core packages"
3944
deps: [install-dev]
@@ -112,6 +117,7 @@ tasks:
112117
desc: "CI parity — same gates as .github/workflows/test.yml (unit + functional + dry-run)"
113118
deps: [install-dev]
114119
cmds:
120+
- task: verify:literals
115121
- task: verify-unit
116122
- task: verify-functional
117123
- task: validate
@@ -163,6 +169,7 @@ tasks:
163169
cmds:
164170
- python3 scripts/version_manager.py check
165171
- task: verify-ctl-env
172+
- task: verify:literals
166173
- task: verify-unit
167174
- task: verify-functional
168175
- task: verify-chat-smoke
@@ -185,13 +192,15 @@ tasks:
185192
- uv pip install -e runtime -e ctl -e library-standard -e lab -e library-eval -e library-lab -e library-samples
186193

187194
docs-gen:
188-
desc: "Regenerate docs/packages-reference.md and docs/plugins-reference.md from manifests."
195+
desc: "Regenerate docs/packages-reference.md, docs/plugins-reference.md, and path snippets."
189196
summary: |
190-
Reads pyproject.toml files and library.yaml manifests to regenerate two
191-
reference pages under docs/. Run after adding, removing, or renaming
192-
any package or plugin. The generated files are checked-in — commit them
193-
together with your manifest changes (required for every PR that touches
194-
packages or plugins).
197+
Reads pyproject.toml files and library.yaml manifests to regenerate reference
198+
pages under docs/, and writes docs/includes/mas-paths.md from runtime path
199+
constants (MkDocs pymdownx.snippets).
200+
Run after adding, removing, or renaming any package or plugin, or after
201+
changing canonical path defaults. The generated files are checked-in —
202+
commit them together with your manifest changes (required for every PR that
203+
touches packages, plugins, or path constants).
195204
Use `python3 scripts/gen_docs.py --check` (or task verify-reproduce) in CI.
196205
cmds:
197206
- python3 scripts/gen_docs.py --root . --output-dir docs

ctl/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Named overlay for A/B configuration without duplicating manifests.
7373

7474
### Workspace
7575

76-
`~/.mas/config.yaml` and optional `mas-workspace.yaml` — see
77-
[docs/user-config.md](../docs/user-config.md).
76+
`$XDG_CONFIG_HOME/mas/config.yaml` and optional project `config.yaml` — see
77+
[docs/user-config.md](../docs/user-config.md) for the full XDG layout.
7878

7979
---
8080

@@ -140,7 +140,6 @@ Flavours ship in **`library-standard`** and resolve by name:
140140
|----------|--------|
141141
| [docs/user-guide.md](docs/user-guide.md) | Operational guide |
142142
| [docs/developer-guide.md](docs/developer-guide.md) | Manifest and compose extensions |
143-
| [docs/architecture-v2-compose.md](docs/architecture-v2-compose.md) | Compose pipeline |
144143
| [../docs/manifests/](../docs/manifests/README.md) | YAML reference |
145144
| [../docs/libraries.md](../docs/libraries.md) | Package matrix |
146145
| [../docs/cli/observability.md](../docs/cli/observability.md) | Trace emission and event artifacts |

ctl/docs/architecture-v2-compose.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

ctl/docs/schemas/component-registry.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ metadata:
1010

1111
spec:
1212
runtimes:
13-
- id: python-v2
13+
- id: mas-runtime-py
1414
layer: ctl.runtime
15-
module: mas.ctl.compose.backends.python_v2.PythonV2KernelBackend
16-
description: Python Mealy kernel v2 (OSS)
15+
module: mas.ctl.compose.backends.mas_runtime_py.MasRuntimePyKernelBackend
16+
description: Python Mealy kernel (OSS default)
1717
status: available
1818

1919
placement:

ctl/src/mas/ctl/adapters/memory_seed.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,20 @@ def index_seeds_in_semantic_memory(
7575
seeds: list[MemorySeed],
7676
*,
7777
agent_id: str = "default",
78-
db_path: str = "~/.mas/memory/{agent_id}.sqlite",
78+
db_path: str | None = None,
7979
) -> None:
8080
"""Index memory_seed entries into SemanticMemoryPlugin's SQLite store."""
8181
if not seeds:
8282
return
8383
try:
8484
from mas.library.standard.plugins.memory.memory_semantic import SemanticMemoryPlugin
85+
from mas.runtime.boundary.memory.semantic import default_store_path
8586
except ImportError:
8687
logger.debug("SemanticMemoryPlugin unavailable — skipping seed indexing")
8788
return
8889

89-
mem = SemanticMemoryPlugin(db_path=db_path, context_inject=False)
90+
resolved = db_path or str(default_store_path(agent_id))
91+
mem = SemanticMemoryPlugin(db_path=resolved, context_inject=False)
9092
mem.agent_id = agent_id
9193
for seed in seeds:
9294
payload: dict[str, Any] = {

ctl/src/mas/ctl/benchmark/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
22
# SPDX-License-Identifier: Apache-2.0
3-
"""Bench runner for python-v2 kernel."""
3+
"""Bench runner for the default ctl runtime."""
44

55
from __future__ import annotations
66

ctl/src/mas/ctl/benchmark/runner.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
22
# SPDX-License-Identifier: Apache-2.0
3-
"""MAS bench integration — python-v2 kernel path for mas-lab benchmark."""
3+
"""MAS bench integration — default ctl runtime path for mas-lab benchmark."""
44

55
from __future__ import annotations
66

@@ -16,6 +16,8 @@
1616
from mas.ctl.ui.stdout import StdoutConversationDisplay
1717
from mas.ctl.workspace.config import UserConfig, WorkspaceConfig, collect_mas_infra_refs, merge_infra_refs
1818

19+
from mas.lab.runners.constants import DEFAULT_LAB_RUNNER_ID
20+
1921
logger = logging.getLogger(__name__)
2022

2123

@@ -56,7 +58,7 @@ def _memory_seeds_from_run_input(
5658
class MasBenchRunner:
5759
"""Execute agent prompts via v2 SessionController (bench harness integration)."""
5860

59-
runner_id: str = "mas-v2"
61+
runner_id: str = DEFAULT_LAB_RUNNER_ID
6062

6163
def run(
6264
self,
@@ -171,11 +173,11 @@ def run(
171173
content=text,
172174
status="ok",
173175
artifacts=artifacts,
174-
metadata={"run_seed": run_seed, "kernel": "python-v2", "turns": len(queries)},
176+
metadata={"run_seed": run_seed, "turns": len(queries)},
175177
)
176178

177179

178180
def select_mas_runner(*, runtime_id: str | None = None) -> MasBenchRunner:
179-
"""Return the v2 bench runner."""
181+
"""Return the default MAS bench runner."""
180182
_ = runtime_id
181183
return MasBenchRunner()

ctl/src/mas/ctl/cli/commands/compose.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import click
1010
import yaml
1111

12+
from mas.ctl.cli.runtime_flags import runtime_id_choice
1213
from mas.ctl.compose.runner import ComposeRequest, compose_run
14+
from mas.ctl.deployment.runtime_id import DEFAULT_RUNTIME_ID
1315
from mas.ctl.paths import manifest_cwd, resolve_overlay_path
1416

1517

@@ -56,8 +58,8 @@ def _compose_run(
5658
@click.option(
5759
"--kernel",
5860
"kernel_backend",
59-
default="python-v2",
60-
type=click.Choice(["python-v2"], case_sensitive=False),
61+
default=DEFAULT_RUNTIME_ID,
62+
type=runtime_id_choice(),
6163
)
6264
@click.option("--output", "-O", "output_path", default=None, type=click.Path())
6365
@click.option("--no-validate", is_flag=True, help="Skip manifest validation")
@@ -90,7 +92,7 @@ def compose_cmd(
9092
@click.command("plan")
9193
@click.argument("manifest", type=click.Path())
9294
@click.option("--deployment", "-d", "deployment_path", default=None, type=click.Path())
93-
@click.option("--kernel", "kernel_backend", default="python-v2")
95+
@click.option("--kernel", "kernel_backend", default=DEFAULT_RUNTIME_ID, type=runtime_id_choice())
9496
@click.option("--no-validate", is_flag=True)
9597
def plan_cmd(
9698
manifest: str,

ctl/src/mas/ctl/cli/commands/run_mas.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import yaml
1111

1212
from mas.ctl.cli.obs_flags import observability_options, resolve_observability_config
13+
from mas.ctl.cli.runtime_flags import runtime_id_choice
14+
from mas.ctl.deployment.runtime_id import DEFAULT_RUNTIME_ID
1315
from mas.ctl.executor.run_mas import execute_run_mas
1416

1517

@@ -22,8 +24,8 @@
2224
@click.option("--infra-ref", "infra_refs", multiple=True)
2325
@click.option(
2426
"--kernel",
25-
default="python-v2",
26-
type=click.Choice(["python-v2"], case_sensitive=False),
27+
default=DEFAULT_RUNTIME_ID,
28+
type=runtime_id_choice(),
2729
)
2830
@click.option("-i", "--interactive", is_flag=True)
2931
@click.option(

0 commit comments

Comments
 (0)