Skip to content

Commit 92dcb1f

Browse files
committed
🔧 Switch to mise for ENV management
- with direnvy crate
1 parent 22ff0db commit 92dcb1f

File tree

6 files changed

+76
-106
lines changed

6 files changed

+76
-106
lines changed

.env.local.example

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,30 @@
33
#
44
# COPY THIS FILE TO .env.local
55
#
6-
# That file is ignored by .gitignore. This file is not.
6+
# That file is ignored by .gitignore. This file is not.
7+
# mise loads .env.local via dotenvy, so use KEY=value lines (not shell `export` statements).
78
#
8-
export DEBUG=false # do not allow byebug statements (override in .env.local)
9-
export FLOSS_FUNDING_DEBUG=false # extra logging to help diagnose issues (override in .env.local)
10-
export AUTOGEN_FIXTURE_CLEANUP=false # autogenerated gem fixture cleanup after every RSpec run
11-
export GIT_HOOK_FOOTER_APPEND=false
12-
export GIT_HOOK_FOOTER_APPEND_DEBUG=false
13-
export GIT_HOOK_FOOTER_SENTINEL="⚡️ A message from a fellow meat-based-AI"
9+
DEBUG=false # do not allow byebug statements (override in .env.local)
10+
FLOSS_FUNDING_DEBUG=false # extra logging to help diagnose issues (override in .env.local)
11+
AUTOGEN_FIXTURE_CLEANUP=false # autogenerated gem fixture cleanup after every RSpec run
12+
GIT_HOOK_FOOTER_APPEND=false
13+
GIT_HOOK_FOOTER_APPEND_DEBUG=false
14+
GIT_HOOK_FOOTER_SENTINEL="⚡️ A message from a fellow meat-based-AI"
1415

1516
# Tokens used by ci:act and CI helpers for reading workflow/pipeline status via APIs
1617
# GitHub (either GITHUB_TOKEN or GH_TOKEN will be used; fine-grained recommended)
1718
# - Scope/permissions: For fine-grained tokens, grant repository access (Read) and Actions: Read
1819
# - For classic tokens, public repos need no scopes; private repos typically require repo
19-
export GITHUB_TOKEN=<your GH token for GHA status; NEVER COMMIT>
20+
GITHUB_TOKEN="<your GH token for GHA status; NEVER COMMIT>"
2021
# Alternatively:
21-
# export GH_TOKEN=<your GH token>
22+
# GH_TOKEN="<your GH token>"
2223

2324
# GitLab (either GITLAB_TOKEN or GL_TOKEN will be used)
2425
# - Scope: read_api is sufficient to read pipelines
25-
export GITLAB_TOKEN=<your GitLab token for pipeline status; NEVER COMMIT>
26+
GITLAB_TOKEN="<your GitLab token for pipeline status; NEVER COMMIT>"
2627
# Alternatively:
27-
# export GL_TOKEN=<your GitLab token>
28+
# GL_TOKEN="<your GitLab token>"
2829

2930
# If this gem does not have an open source collective uncomment and set these to false.
30-
# export OPENCOLLECTIVE_HANDLE=false
31-
# export FUNDING_ORG=false
31+
# OPENCOLLECTIVE_HANDLE=false
32+
# FUNDING_ORG=false

.envrc

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,4 @@
1-
# Run any command in this library's bin/ without the bin/ prefix!
2-
3-
# Prefer exe version over binstub
4-
5-
PATH_add exe
6-
PATH_add bin
7-
8-
# Only add things to this file that should be shared with the team.
9-
10-
# **dotenv** (See end of file for .env.local integration)
11-
12-
# .env would override anything in this file, if enabled.
13-
14-
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments.
15-
16-
# Override and customize anything below in your own .env.local
17-
18-
# If you are using dotenv and not direnv,
19-
20-
# copy the following `export` statements to your own .env file.
21-
22-
### General Ruby ###
23-
24-
# Turn off Ruby Warnings about deprecated code
25-
26-
# export RUBYOPT="-W0"
27-
28-
### External Testing Controls
29-
30-
export K_SOUP_COV_DO=true # Means you want code coverage
31-
export K_SOUP_COV_COMMAND_NAME="Test Coverage"
32-
33-
# Available formats are html, xml, rcov, lcov, json, tty
34-
35-
export K_SOUP_COV_FORMATTERS="html,xml,rcov,lcov,json,tty"
36-
export K_SOUP_COV_MIN_BRANCH=76 # Means you want to enforce X% branch coverage
37-
export K_SOUP_COV_MIN_LINE=92 # Means you want to enforce X% line coverage
38-
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
39-
export K_SOUP_COV_MULTI_FORMATTERS=true
40-
export K_SOUP_COV_OPEN_BIN= # Means don't try to open coverage results in browser
41-
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
42-
export KETTLE_TEST_SILENT=true
43-
export KETTLE_DEV_DEBUG=false
44-
45-
# Internal Debugging Controls
46-
47-
export DEBUG=false # do not allow byebug statements (override in .env.local)
48-
export FLOSS_CFG_FUND_DEBUG=false # extra logging to help diagnose issues (override in .env.local)
49-
export FLOSS_CFG_FUND_LOGFILE=tmp/log/debug.log
50-
51-
# Concurrently developing the rubocop-lts suite?
52-
53-
export RUBOCOP_LTS_LOCAL=false
54-
55-
# If token-resolver does not have an open source collective set these to false.
56-
57-
export OPENCOLLECTIVE_HANDLE=kettle-rb
58-
export FUNDING_ORG=kettle-rb
59-
60-
# .env would override anything in this file, if `dotenv` is uncommented below.
61-
62-
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
63-
64-
# and that is why we generally want to leave it commented out.
65-
66-
# dotenv
67-
68-
# .env.local will override anything in this file.
69-
70-
dotenv_if_exists .env.local
1+
# Deprecated: this project uses mise.toml for environment management.
2+
# Install/activate mise, or run commands with:
3+
# mise exec -C /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver -- <command>
4+
true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Appraisal.*.gemfile.lock
3737
# Debugger detritus
3838
.byebug_history
3939

40-
# direnv - brew install direnv
40+
# Local environment overrides (loaded by mise and passed off to the direnvy crate)
4141
.env.local
4242

4343
# OS Detritus

AGENTS.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,49 @@ lib/token/resolver/
2525
└── version.rb — Version information
2626
```
2727

28-
## Key Design Decisions
29-
30-
1. **Grammar never fails** — Any input is valid. Unrecognized content becomes text nodes.
31-
2. **Single-pass resolution** — Replacement values are NOT re-scanned for tokens.
32-
3. **Config is frozen and hashable** — Grammar classes are cached per config.
33-
4. **Fast-path** — If input doesn't contain the `pre` delimiter, no parslet invocation.
34-
3528
## Running Tests
3629

3730
```bash
38-
bundle exec rspec
31+
mise exec -C /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver -- bundle exec rspec
3932
```
4033

41-
## Critical AI Agent Terminal Limitations
34+
## Critical AI Agent Terminal Guidance
35+
36+
### Terminal Output Is Available, but Each Command Is Isolated
37+
38+
**IMPORTANT**: AI agents can reliably read terminal output when commands run in the background and the output is polled afterward. However, every terminal command should be treated as a fresh shell with no shared state.
4239

43-
**IMPORTANT**: AI agents (Copilot, etc.) almost never can see terminal output from `run_in_terminal`.
40+
### Use `mise` for Project Environment
4441

45-
**Workarounds:**
46-
1. **ALWAYS redirect output to a file** in the project's local `tmp/` directory, then read it back:
47-
```bash
48-
bundle exec rspec 2>&1 > tmp/rspec-output.txt
49-
```
50-
Then use `read_file` tool on `tmp/rspec-output.txt`.
42+
**IMPORTANT**: The canonical project environment now lives in `mise.toml`, with local overrides in `.env.local` loaded via `dotenvy`.
5143

52-
2. **NEVER chain `cd` with other commands via `&&`**`direnv` won't initialize until after
53-
all commands finish. Run `cd` alone first, then run subsequent commands separately.
44+
**CORRECT**:
45+
```bash
46+
mise exec -C /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver -- bundle exec rspec
47+
```
48+
49+
**CORRECT**:
50+
```bash
51+
eval "$(mise env -C /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver -s bash)" && bundle exec rspec
52+
```
53+
54+
**WRONG**:
55+
```bash
56+
cd /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver
57+
bundle exec rspec
58+
```
59+
60+
**WRONG**:
61+
```bash
62+
cd /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver && bundle exec rspec
63+
```
5464

55-
3. **NEVER use `head`, `tail`, or any output truncation** with test commands.
65+
### Additional Rules
5666

57-
4. **Use internal tools** (`grep_search`, `read_file`, `list_dir`) instead of terminal for
67+
1. **NEVER use `head`, `tail`, or any output truncation** with test commands.
68+
2. **Use internal tools** (`grep_search`, `read_file`, `list_dir`) instead of terminal for
5869
information gathering whenever possible.
70+
3. **Do NOT rely on prior shell state** — Previous `cd`, `export`, aliases, and functions are not available to the next command.
5971

6072
## API Conventions
6173

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ General/runtime
5252
- CI: When set to true, adjusts default rake tasks toward CI behavior
5353

5454
Coverage (kettle-soup-cover / SimpleCov)
55-
- K_SOUP_COV_DO: Enable coverage collection (default: true in .envrc)
55+
- K_SOUP_COV_DO: Enable coverage collection (default: true in `mise.toml`)
5656
- K_SOUP_COV_FORMATTERS: Comma-separated list of formatters (html, xml, rcov, lcov, json, tty)
5757
- K_SOUP_COV_MIN_LINE: Minimum line coverage threshold (integer, e.g., 100)
5858
- K_SOUP_COV_MIN_BRANCH: Minimum branch coverage threshold (integer, e.g., 100)
@@ -78,7 +78,7 @@ Git hooks and commit message helpers (exe/kettle-commit-msg)
7878
- GIT_HOOK_FOOTER_SENTINEL: Required when footer append is enabled — a unique first-line sentinel to prevent duplicates
7979
- GIT_HOOK_FOOTER_APPEND_DEBUG: Extra debug output in the footer template (true/false)
8080

81-
For a quick starting point, this repository’s `.envrc` shows sane defaults, and `.env.local` can override them locally.
81+
For a quick starting point, this repository’s `mise.toml` defines the shared defaults, and `.env.local` can override them locally. Copy `.env.local.example` to `.env.local`, use `KEY=value` lines, and either activate `mise` in your shell or run commands through `mise exec -C /home/pboling/src/kettle-rb/ast-merge/vendor/token-resolver -- ...`.
8282

8383
## Appraisals
8484

mise.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Shared development environment for token-resolver.
2+
# Local overrides belong in .env.local (loaded via dotenvy through mise).
3+
4+
[env]
5+
K_SOUP_COV_DO = "true"
6+
K_SOUP_COV_COMMAND_NAME = "Test Coverage"
7+
K_SOUP_COV_FORMATTERS = "html,xml,rcov,lcov,json,tty"
8+
K_SOUP_COV_MIN_BRANCH = "76"
9+
K_SOUP_COV_MIN_LINE = "92"
10+
K_SOUP_COV_MIN_HARD = "true"
11+
K_SOUP_COV_MULTI_FORMATTERS = "true"
12+
K_SOUP_COV_OPEN_BIN = ""
13+
MAX_ROWS = "1"
14+
KETTLE_TEST_SILENT = "true"
15+
KETTLE_DEV_DEBUG = "false"
16+
DEBUG = "false"
17+
FLOSS_CFG_FUND_DEBUG = "false"
18+
FLOSS_CFG_FUND_LOGFILE = "tmp/log/debug.log"
19+
RUBOCOP_LTS_LOCAL = "false"
20+
OPENCOLLECTIVE_HANDLE = "kettle-rb"
21+
FUNDING_ORG = "kettle-rb"
22+
_.path = ["exe", "bin"]
23+
_.file = { path = ".env.local", redact = true }

0 commit comments

Comments
 (0)