agentme 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,11 +53,10 @@ This keeps the user-facing command predictable while preserving a clean library
53
53
  #### Configuration
54
54
 
55
55
  - Prefer flags and positional arguments for simple inputs.
56
- - When configuration becomes long, nested, or repetitive, support a config file instead of pushing all values into flags.
56
+ - When configuration becomes long, nested, or repetitive, use a YAML config file instead of pushing all values into flags. See [agentme-edr-027](../devops/027-environment-variable-configuration.md) for when `.env` values should be referenced from within that file.
57
57
  - By default, config-file discovery and loading must happen in the CLI layer, not in the application layer.
58
- - When a config file is supported, the CLI should try to load a JSON config file from `[cwd]/.[cli-name]rc` by default.
59
- - The CLI should also support an explicit config path flag such as `--config`.
60
- - For JavaScript tools, `cosmiconfig` is an acceptable implementation. Equivalent discovery libraries are acceptable in other ecosystems.
58
+ - When a config file is supported, the CLI must try to load a YAML file from `[cwd]/[tool-name].yml` by default.
59
+ - The CLI must also support an explicit config path flag such as `--config`.
61
60
  - The application layer must not depend on the presence of the config file; it should receive parsed configuration values from the CLI layer.
62
61
  - The application layer may load or parse config files only when that behavior is an explicit requirement of the application contract for non-CLI consumers as well.
63
62
 
@@ -106,4 +105,4 @@ This keeps the user-facing command predictable while preserving a clean library
106
105
  - [agentme-edr-009](../principles/009-error-handling.md) - Process error signaling and error handling expectations
107
106
  - [agentme-edr-010](010-golang-project-tooling.md) - Go CLI structure and verbose logging baseline
108
107
  - [agentme-edr-014](014-python-project-tooling.md) - Python packaging and CLI entry-point guidance
109
- - [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig) - Example JSON configuration discovery library for JavaScript CLIs
108
+ - [agentme-edr-027](../devops/027-environment-variable-configuration.md) - Environment variable configuration files; defines how `.env` values are referenced from YAML config files
@@ -71,6 +71,7 @@ llm = ChatOpenAI(
71
71
  Enable LangChain auto-tracing at every application entry point by calling `mlflow.langchain.autolog()` during startup, before any LLM call is made.
72
72
 
73
73
  - This captures inputs, outputs, token counts, and latency for every LangChain chain or runnable automatically.
74
+ - The project Makefile MUST expose a `dev-mlflow` target to start a local MLflow tracking server for development inspection, per [agentme-edr-008](../devops/008-common-targets.md) rule `09-ai-project-dev-targets`.
74
75
 
75
76
  #### 04-unit-test-mocking
76
77
 
@@ -50,6 +50,7 @@ Use deepagents sandbox whenever ANY of the following is true:
50
50
 
51
51
  **Integration requirements:**
52
52
 
53
+ - The sandbox MUST always be initialized with `virtual_mode=True` to prevent the agent from reading or writing files outside the mounted workspace. Omitting this flag allows the agent unrestricted host filesystem access, which is a security violation.
53
54
  - Initialize the sandbox at the start of the agent run and shut it down in the same `try/finally` block.
54
55
  - Pass the sandbox handle into the agent's state so all tool calls share the same sandbox instance.
55
56
  - If the host-side code needs to pass files into the sandbox (e.g. generated config or input data), create a temporary directory with `tempfile.mkdtemp()`, write the files there, and mount it into the sandbox. Clean it up in the `finally` block.
@@ -69,7 +70,7 @@ def run_file_analysis_agent(input_files: List[Path]) -> AnalysisResult:
69
70
  shutil.copy(f, tmp_dir)
70
71
 
71
72
  # Initialize sandbox with mounted directory
72
- sandbox = Sandbox(mount_paths={tmp_dir: "/workspace"})
73
+ sandbox = Sandbox(mount_paths={tmp_dir: "/workspace"}, virtual_mode=True)
73
74
 
74
75
  # Run agent with sandbox
75
76
  agent = FileAnalysisAgent(sandbox=sandbox)
@@ -188,6 +189,7 @@ Agent execution MUST be observable through logging and tracing:
188
189
  - Use structured logging (JSON) with fields: `iteration`, `tool_selected`, `tool_result_status`, `decision`.
189
190
  - For LLM calls within agents, follow [agentme-edr-018](018-ai-llm-development-standards.md) rule `03-llm-observability`.
190
191
  - When agents run as workflow nodes, MLflow tracking from the parent workflow automatically captures agent-level traces.
192
+ - The project Makefile MUST expose a `dev-mlflow` target to start a local MLflow tracking server for development inspection, per [agentme-edr-008](../devops/008-common-targets.md) rule `09-ai-project-dev-targets`.
191
193
 
192
194
  **Example structured log entry:**
193
195
 
@@ -33,6 +33,7 @@ Use **MLflow** for all workflow observability and evaluation:
33
33
  - **LLM-level auto-tracing:** Enable LangChain auto-tracing per [agentme-edr-018](018-ai-llm-development-standards.md) rule `03-llm-observability` by calling `mlflow.langchain.autolog()` during application startup. This captures inputs, outputs, token counts, and latency for every LangChain call within workflow nodes.
34
34
  - Log run parameters (model name, temperature, prompt version) and output metrics (accuracy, latency, token counts) using `mlflow.log_param` / `mlflow.log_metric`.
35
35
  - Run a local MLflow tracking server with `mlflow ui` to inspect runs during development. Do not require a remote MLflow server for local development.
36
+ - The project Makefile MUST expose a `dev-mlflow` target to start the local MLflow tracking server, per [agentme-edr-008](../devops/008-common-targets.md) rule `09-ai-project-dev-targets`.
36
37
 
37
38
  #### 04-dataset-driven-accuracy-measurement
38
39
 
@@ -73,7 +73,7 @@ Targets are organized into five lifecycle groups. Projects must use these names
73
73
  | Target | Purpose |
74
74
  |--------|---------|
75
75
  | `setup` | Run `mise install` and any small project bootstrap needed before normal targets work. This is the first command after checkout. |
76
- | `all` | Alias that runs `build`, `lint`, and `test` in sequence. Must be the default target (i.e., running `make` or the runner with no arguments invokes `all`). Used by developers as a fast pre-push check to verify the software meets minimum quality standards in one command. |
76
+ | `all` | Alias that runs `build`, `lint`, and `test` in sequence. Must be the default target (i.e., running `make` or the runner with no arguments invokes `all`). Used by developers as a fast pre-push check to verify the software meets minimum quality standards in one command. Must only invoke targets that run **offline** — no external credentials, running servers, paid APIs, or environment-specific configuration outside the repository. |
77
77
  | `clean` | Remove all temporary or generated files created during build, lint, or test (e.g., `node_modules`, virtual environments, compiled binaries, generated files). Used both locally and in CI for a clean slate. |
78
78
  | `dev` | Run the software locally for development (e.g., start a Node.js API server, open a Jupyter notebook, launch a React dev server). May have debugging tools, verbose logging, or hot reloading features enabled. |
79
79
  | `run` | Run the software in production mode (e.g., start a compiled binary, launch a production server). No debugging or development-only features should be enabled. |
@@ -93,13 +93,13 @@ Targets are organized into five lifecycle groups. Projects must use these names
93
93
 
94
94
  | Target | Purpose |
95
95
  |--------|---------|
96
- | `lint` | Run **all static quality checks** outside of tests. This MUST include: code formatting validation, code style enforcement, code smell detection, static analysis, dependency audits for known CVEs, security vulnerability scans (e.g., SAST), and project/configuration structure checks. All checks must be non-destructive (read-only); fixes are handled by `lint-fix`. |
96
+ | `lint` | Run **all static quality checks** outside of tests. This MUST include: code formatting validation, code style enforcement, code smell detection, static analysis, dependency audits for known CVEs, security vulnerability scans (e.g., SAST), and project/configuration structure checks. All checks must be non-destructive (read-only); fixes are handled by `lint-fix`. Must only invoke subtargets that run **offline** (no external credentials or services). |
97
97
  | `lint-fix` | Automatically fix linting and formatting issues where possible. || `lint-format` | *(Optional)* Check code formatting only (e.g., Prettier, gofmt, Black). |
98
98
  ##### Test group
99
99
 
100
100
  | Target | Purpose |
101
101
  |--------|---------|
102
- | `test` | Run **all tests** required for the project. This MUST include unit tests (with coverage enforcement — the build MUST fail if coverage thresholds are not met) and integration/end-to-end tests. Normally delegates to `test-unit` and `test-integration` in sequence. |
102
+ | `test` | Run **all offline tests** required for the project. This MUST include unit tests (with coverage enforcement — the build MUST fail if coverage thresholds are not met) and any integration or end-to-end tests that run **offline** (no external servers, credentials, or paid APIs). Normally delegates to `test-unit` and, when offline, `test-integration` in sequence. Suffixed targets that require external dependencies must not be invoked automatically — see rule 08. |
103
103
  | `test-unit` | Run unit tests only, including coverage report generation and coverage threshold enforcement. |
104
104
  | `test-integration` | *(Optional)* Run integration and end-to-end tests only. Projects without integration tests may omit this target. |
105
105
  | `test-smoke` | *(Optional)* Run a fast, minimal subset of tests to verify the software is basically functional. Useful as a post-deploy health check. |
@@ -150,6 +150,28 @@ The prefix convention ensures developers can infer the purpose of any target wit
150
150
 
151
151
  ---
152
152
 
153
+ #### 09-ai-project-dev-targets
154
+
155
+ AI-based projects (LLM, Agent, and Workflow tiers as defined in [agentme-edr-018](../application/018-ai-llm-development-standards.md)) MUST expose a `dev-mlflow` target that starts a local MLflow tracking server for development inspection.
156
+
157
+ **Example implementation:**
158
+
159
+ ```makefile
160
+ dev-mlflow:
161
+ mise exec -- mlflow ui --host 0.0.0.0 --port 5000
162
+ open http://localhost:5000/
163
+ ```
164
+
165
+ ---
166
+
167
+ #### 08-default-targets-must-only-include-offline-subtargets
168
+
169
+ `make all`, `make test`, and `make lint` must include every subtarget that runs **offline** — meaning it requires no external credentials, no running servers, no paid APIs, and no environment-specific configuration outside the repository.
170
+
171
+ Subtargets that require external dependencies (e.g., `test-integration` against a live database, `test-e2e` against a staging environment, `lint-api` against a remote schema registry) **must** exist as named targets so developers can invoke them explicitly, but **must not** be invoked from `all`, `test`, or `lint`.
172
+
173
+ ---
174
+
153
175
  #### 06-monorepo-usage
154
176
 
155
177
  In a monorepo, each module has its own `Makefile` with its own `build`, `lint`, `test`, and `deploy` targets scoped to that module. Parent-level Makefiles (at the application or repo root) delegate to child Makefiles in sequence. The parent Makefile should call `$(MAKE) -C <child> <target>` directly, while each child `Makefile` runs its actual tool commands through `mise exec --`.
@@ -194,6 +216,9 @@ make lint-fix
194
216
  # run the software in dev mode (may have hot reload, debug tools enabled, verbose logging etc)
195
217
  make dev
196
218
 
219
+ # [AI projects only] start a local MLflow tracking server for development inspection
220
+ make dev-mlflow
221
+
197
222
  # run the software in production mode
198
223
  make run
199
224
 
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: agentme-edr-policy-027-environment-variable-configuration-files
3
+ description: Defines when to use YAML config files versus .env files for configuration, how to combine them, and how .env is loaded for spawned processes. Use when setting up project configuration for any application, CLI, or library.
4
+ apply-to: All projects that use environment variables for configuration
5
+ valid-from: 2026-06-09
6
+ ---
7
+
8
+ # agentme-edr-policy-027: Environment variable configuration files
9
+
10
+ ## Context and Problem Statement
11
+
12
+ Projects need a consistent way to define non-secret configuration — service URLs, feature flags, port numbers, runtime modes — that varies across environments. Ad-hoc approaches (hardcoded defaults, scattered exports, application-level dotenv loaders, and flat env-var-only configs) lead to inconsistent behavior and unclear ownership of configuration.
13
+
14
+ CLI tools additionally need to handle multi-attribute invocation configuration without forcing users to provide every value as a flag. At the same time, some of those values may be environment-specific and must not be committed to the repository.
15
+
16
+ How should projects manage environment variable configuration and CLI invocation configuration across local development, deployment stages, and Makefiles?
17
+
18
+ ## Decision Outcome
19
+
20
+ **Use YAML config files for CLI invocation configuration with multiple attributes; use `.env` files to supply environment variables to spawned processes and to hold uncommitted values referenced by config files. Load `.env` exclusively at process launch time — never inside application code.**
21
+
22
+ Secrets (API keys, passwords, tokens) must never be placed in `.env` files. Those are handled by [agentme-edr-022](../principles/022-secrets-management.md).
23
+
24
+ ### Details
25
+
26
+ #### 01-when-to-use-dotenv
27
+
28
+ Use a `.env` file when either of the following is true:
29
+
30
+ 1. **Spawned process needs env vars** — the project launches a process (a deployable service, background worker, or shell script) that reads configuration from OS environment variables such as port numbers or API endpoint URLs.
31
+ 2. **Value must not be committed** — a configuration value used in a YAML config file (see rule 07) is environment-specific or sensitive enough to exclude from version control. In that case, store the value in `.env` and reference it from the YAML file using env var substitution (see rule 08).
32
+
33
+ Do not use `.env` as a general-purpose configuration store when a YAML config file is the right tool (see rule 07).
34
+
35
+ Example `.env` for a service with process-level env vars:
36
+ ```
37
+ SERVER_URL=http://localhost:8080
38
+ LOG_LEVEL=debug
39
+ FEATURE_FLAG_NEW_UI=false
40
+ ```
41
+
42
+ ---
43
+
44
+ #### 02-dotenv-not-committed
45
+
46
+ `.env` must be listed in `.gitignore` and must never be committed to the repository. It is intended for local use in standalone projects and libraries that do not have a formal deployment pipeline.
47
+
48
+ ---
49
+
50
+ #### 03-dotenv-example-committed
51
+
52
+ A `.env.example` file must be committed alongside `.env`. It contains all the same variable names with placeholder or illustrative values — no real URLs, credentials, or server names. This file documents what configuration is expected without exposing real values.
53
+
54
+ Example `.env.example`:
55
+ ```
56
+ SERVER_URL=http://localhost:8080
57
+ LOG_LEVEL=debug
58
+ FEATURE_FLAG_NEW_UI=false
59
+ ```
60
+
61
+ ---
62
+
63
+ #### 04-stage-specific-dotenv-committed
64
+
65
+ Stage-specific overrides must use the naming convention `.env.[stage]` (e.g., `.env.production`, `.env.staging`, `.env.test`). These files may be committed to the repository because they carry deployment-stage configuration rather than local developer configuration. They are used during deployment pipelines where the stage is known and explicit.
66
+
67
+ The generic `.env` must still not be committed. The distinction is: `.env` is for local, ad-hoc, standalone use; `.env.[stage]` is for deployment pipelines with a defined environment identity.
68
+
69
+ ---
70
+
71
+ #### 05-load-in-makefile-before-processes
72
+
73
+ When `.env` defines variables consumed by shell scripts or spawned processes, the Makefile must load and export them before invoking those processes. Use the following pattern at the top of the relevant Makefile or in a shared include:
74
+
75
+ ```makefile
76
+ ifneq (,$(wildcard .env))
77
+ include .env
78
+ export
79
+ endif
80
+ ```
81
+
82
+ This ensures all variables in `.env` are available as environment variables to every child process spawned by `make`. The `ifneq` guard prevents errors when `.env` does not exist (e.g., in CI or fresh checkouts).
83
+
84
+ ---
85
+
86
+ #### 06-no-application-level-dotenv-loading
87
+
88
+ Applications must not load `.env` files directly inside their own code using dotenv libraries or equivalent mechanisms. Configuration must enter the process exclusively as OS-level environment variables, set before the process is launched (by the Makefile, a shell script, CI, or a container runtime).
89
+
90
+ Prohibited patterns:
91
+
92
+ ```python
93
+ # Python — disallowed
94
+ from dotenv import load_dotenv
95
+ load_dotenv()
96
+ ```
97
+
98
+ ```typescript
99
+ // TypeScript — disallowed
100
+ import dotenv from "dotenv";
101
+ dotenv.config();
102
+ ```
103
+
104
+ ```go
105
+ // Go — disallowed
106
+ godotenv.Load()
107
+ ```
108
+
109
+ Permitted pattern: set env vars in the Makefile (see rule 05), then launch the application normally. Inside application code, read configuration only from `os.environ`, `process.env`, or the standard OS environment API for the language.
110
+
111
+ This rule prevents two parallel loading paths — OS env and file-based env — from coexisting invisibly in the same process.
112
+
113
+ ---
114
+
115
+ #### 07-cli-adapters-use-yaml-config
116
+
117
+ CLI adapters with multiple configuration attributes must use a YAML config file rather than env vars or flags for those attributes. This applies whenever configuration is nested, repetitive, or too verbose for flags alone.
118
+
119
+ The CLI layer is responsible for loading and parsing the YAML file and passing the resolved values to the application layer. The application layer must not read the config file directly.
120
+
121
+ Default config file discovery should follow the pattern defined in [agentme-edr-015](../application/015-cli-tool-standards.md): load `[cwd]/[tool-name].yml` by default, or an explicit path provided via `--config`.
122
+
123
+ Example `myconfig.yml`:
124
+ ```yaml
125
+ openapi_endpoint: https://example.com/openapi
126
+ log_level: debug
127
+ max_retries: 3
128
+ ```
129
+
130
+ ---
131
+
132
+ #### 08-env-var-substitution-in-config-files
133
+
134
+ When a YAML config file contains a value that must not be committed (such as a real endpoint URL, a username, or any other environment-specific value), that value must be expressed as an environment variable reference using `${VAR_NAME}` syntax, and the actual value must be defined in `.env`.
135
+
136
+ This keeps the YAML file committable while keeping the environment-specific value out of the repository.
137
+
138
+ Example:
139
+
140
+ `.env` (not committed):
141
+ ```
142
+ OPENAPI_ENDPOINT=https://real-server.example.com/openapi
143
+ ```
144
+
145
+ `myconfig.yml` (committed):
146
+ ```yaml
147
+ openapi_endpoint: ${OPENAPI_ENDPOINT}
148
+ log_level: debug
149
+ ```
150
+
151
+ The `.env` file must be loaded in the Makefile before launching the process (see rule 05) so the variable is available when the CLI or process reads the config file.
152
+
153
+ ## References
154
+
155
+ - [agentme-edr-022](../principles/022-secrets-management.md) - Secrets must use OS keychains or cloud secret managers, not `.env` files
156
+ - [agentme-edr-017](017-tool-execution-and-scripting.md) - Makefiles are the authoritative command entry point; rule 05 above integrates with that standard
157
+ - [agentme-edr-008](008-common-targets.md) - Standard Makefile target names
158
+ - [agentme-edr-015](../application/015-cli-tool-standards.md) - CLI config file discovery and CLI-to-application separation
@@ -48,6 +48,7 @@ Repository structure, build conventions, and CI/CD pipelines.
48
48
  - [agentme-edr-006](devops/006-github-pipelines.md) - **GitHub CI/CD pipelines** - Define required CI stages and workflow structure
49
49
  - [agentme-edr-008](devops/008-common-targets.md) - **Common development script names** - Reuse standard build, lint, and test target names
50
50
  - [agentme-edr-017](devops/017-tool-execution-and-scripting.md) - **Tool execution and scripting** - Run tools consistently across shells, Makefiles, and CI
51
+ - [agentme-edr-027](devops/027-environment-variable-configuration.md) - **Environment variable configuration files** - Manage non-secret configuration with `.env` files, `.gitignore` rules, stage variants, and Makefile loading
51
52
 
52
53
  ## Governance
53
54
 
@@ -145,6 +145,7 @@ Projects that are libraries or shared utilities must include an `examples/` dire
145
145
  **Root Makefile:**
146
146
 
147
147
  ```makefile
148
+ # test-examples runs the examples offline (no external services) → include in test
148
149
  test: test-unit test-examples
149
150
 
150
151
  test-unit:
@@ -154,6 +155,8 @@ test-examples:
154
155
  $(MAKE) -C examples
155
156
  ```
156
157
 
158
+ If examples require live services or credentials, remove `test-examples` from the `test` dependency list and keep it as a standalone named target only. See [agentme-edr-008](../devops/008-common-targets.md) rule 08 for the full offline/online decision table.
159
+
157
160
  **Examples Makefile:**
158
161
 
159
162
  ```makefile
@@ -96,6 +96,26 @@ $ make run
96
96
  # Application starts successfully
97
97
  ```
98
98
 
99
+ #### 05a-makefile-uses-security-utility
100
+
101
+ Makefile targets (e.g., `setup-secrets`) must use the macOS native `security` CLI to store and retrieve secrets from the keychain. This restricts Makefile-based secret management to macOS developer machines, which is acceptable since all contributors are expected to use macOS.
102
+
103
+ Do **not** use `keyring` or other cross-platform libraries in Makefiles — `security` is simpler to invoke from shell and requires no additional dependencies.
104
+
105
+ Storing a secret:
106
+ ```makefile
107
+ security add-generic-password -a "$(USER)" -s "mymodule/api-key" -w "$(SECRET_VALUE)" -U
108
+ ```
109
+
110
+ Retrieving a secret (e.g., to pass to a command):
111
+ ```makefile
112
+ SECRET_VALUE := $(shell security find-generic-password -a "$(USER)" -s "mymodule/api-key" -w 2>/dev/null)
113
+ ```
114
+
115
+ The `-U` flag updates the entry if it already exists. Use the format `<group>/<secret-id>` as the service name (`-s`) to mirror the module name and cloud secret manager ID convention defined in rule 02 and 05.
116
+
117
+ In library code (Python, JS/TS, Go), continue using the cross-platform libraries defined in rule 02 (`keyring`, `cross-keychain`, `go-keyring`). The `security` utility is only for Makefile scripts.
118
+
99
119
  ---
100
120
 
101
121
  #### 06-never-log-or-leak-secrets
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "agentme",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
- "filedist": "^0.34.2"
6
+ "filedist": "^0.35.0"
7
7
  },
8
8
  "bin": "bin/filedist.js",
9
9
  "files": [