From 83842089aa80f84184d47d35d499b5e2bb899ca7 Mon Sep 17 00:00:00 2001 From: jared Date: Mon, 13 Jul 2026 16:39:01 -0400 Subject: [PATCH] vault: session notes 2026-07-13 --- convention/ai-agent-rules.md | 2 +- convention/phlex-component-design.md | 2 +- convention/tdd-methodology.md | 12 +++++++++++- howto/devcontainer-sandbox-setup.md | 2 +- journal/2026-07-13.md | 7 +++++++ reference/design-color-rules.md | 2 +- reference/state-machine-pattern.md | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/convention/ai-agent-rules.md b/convention/ai-agent-rules.md index 14e61f8..549c9fe 100644 --- a/convention/ai-agent-rules.md +++ b/convention/ai-agent-rules.md @@ -10,7 +10,7 @@ last_updated: 2026-07-13 date: 2026-07-13 related: - tdd-methodology -source: hyperthrive_dev +source: hyperthrive_dev/conventions/ai-rules.md --- # AI Agent Operating Rules diff --git a/convention/phlex-component-design.md b/convention/phlex-component-design.md index 9ebe502..a02ccbf 100644 --- a/convention/phlex-component-design.md +++ b/convention/phlex-component-design.md @@ -13,7 +13,7 @@ date: 2026-07-13 related: - sandi-metz-code-philosophy - tdd-methodology -source: hyperthrive_dev +source: hyperthrive_dev/conventions/phlex.md --- # Phlex Component Design diff --git a/convention/tdd-methodology.md b/convention/tdd-methodology.md index 48363cd..468b447 100644 --- a/convention/tdd-methodology.md +++ b/convention/tdd-methodology.md @@ -11,7 +11,7 @@ date: 2026-07-13 related: - phlex-component-design - ai-agent-rules -source: hyperthrive_dev +source: hyperthrive_dev/conventions/testing.md --- # TDD and Test Isolation Methodology @@ -57,8 +57,18 @@ end def self.company_name = ENV.fetch("COMPANY_NAME", "Default") ``` +**4. CLI-contract tests that shell out inherit the workstation's live env — blank service credentials in the subprocess env.** +A test that runs a binary via `system`/backticks/`Open3` passes the parent process's full ENV through, including any live service credentials on the machine (`PLANKA_*`, API keys, etc.). If the CLI under test talks to a service, the test can silently mutate live infrastructure. Discovered 2026-07-13: an os-backlog CLI test invoked `board-ensure` with live `PLANKA_BASE_URL`/`PLANKA_USERNAME`/`PLANKA_PASSWORD` set and created a real board on the production Planka instance. Build the subprocess env explicitly, blanking every service variable: + +```ruby +# GOOD — subprocess can never reach the live service +CLEAN_ENV = { "PLANKA_BASE_URL" => nil, "PLANKA_USERNAME" => nil, "PLANKA_PASSWORD" => nil } +def run_cli(*args) = Open3.capture3(CLEAN_ENV, BIN, *args) +``` + ## Anti-Patterns +- **Shelling out to a CLI under test without a scrubbed env** → live credentials leak into the subprocess; the test can mutate real infrastructure - **Fixture files for test data** → hidden coupling across tests; use `setup` blocks instead - **`CONST = ENV.fetch(...).freeze` in a service/class body** → frozen at load time, untestable; wrap in a method - **ENV mutation without `ensure`** → leaks into parallel test runs, causes flaky failures unrelated to the actual change diff --git a/howto/devcontainer-sandbox-setup.md b/howto/devcontainer-sandbox-setup.md index 65c943d..b38289b 100644 --- a/howto/devcontainer-sandbox-setup.md +++ b/howto/devcontainer-sandbox-setup.md @@ -12,7 +12,7 @@ last_updated: 2026-07-13 date: 2026-07-13 update_note: experience-driven related: [] -source: design-mode +source: design-mode/docs/devcontainer-guide.md --- # Set Up a DevContainer Sandbox for Autonomous Claude Code diff --git a/journal/2026-07-13.md b/journal/2026-07-13.md index 9edce64..085b797 100644 --- a/journal/2026-07-13.md +++ b/journal/2026-07-13.md @@ -1831,3 +1831,10 @@ tags: [scope/global, type/log] **Reason:** other **Vault notes touched:** (none) + +## Session — 2026-07-13T20:35:03Z + +**Project:** /home/jared/dev/cc-os +**Reason:** other +**Vault notes touched:** +(none) diff --git a/reference/design-color-rules.md b/reference/design-color-rules.md index 95f7bc7..2c2810d 100644 --- a/reference/design-color-rules.md +++ b/reference/design-color-rules.md @@ -10,7 +10,7 @@ scope: global last_updated: 2026-07-13 date: 2026-07-13 related: [] -source: design-mode +source: design-mode/guides/design-color-rules.md --- # UI Color Rules for Functional Interfaces diff --git a/reference/state-machine-pattern.md b/reference/state-machine-pattern.md index 5788a8c..f779c6f 100644 --- a/reference/state-machine-pattern.md +++ b/reference/state-machine-pattern.md @@ -11,7 +11,7 @@ last_updated: 2026-07-13 date: 2026-07-13 related: - sandi-metz-code-philosophy -source: delta-refinery +source: delta-refinery/docs/state_machine_reference.md --- # State Machine Pattern — Transition Ownership