vault: session notes 2026-07-13
This commit is contained in:
parent
5e70d4a9bb
commit
83842089aa
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue