Feat: trunk-law extension scopes fleet git rules to ~/Projects #9

Closed
dank wants to merge 1 commits from feat/trunk-law-extension into main
Owner

Global-ish rule without touching the 7 repos: agent/extensions/trunk-law.js appends the trunk-based git law to the system prompt only when session cwd is under ~/Projects/ (before_agent_start handler, hard cwd scope).

Why an extension: every context-file provider (AGENTS.md walk-up, .omp dirs, CLAUDE.md) resolves at or below repo root — a ~/Projects/AGENTS.md would never load. APPEND_SYSTEM.md loads but broadcasts to ALL sessions.

Verified live with quote-the-prompt probes on frank-zealot:

  • cwd=~/Projects/serverAppConfig -> bullet quoted verbatim
  • cwd=/tmp and cwd=~/.omp -> MISSING

Rides git pull to every workstation (agent/extensions/ is tracked, not gitignored). Subagents inherit it via cwd.

Known contradiction: serverAppConfigs repo AGENTS.md still preaches git-flow; injected law declares precedence until that repo is updated (its own PR, its own flow).

bats 27/27.

Global-ish rule without touching the 7 repos: `agent/extensions/trunk-law.js` appends the trunk-based git law to the system prompt **only when session cwd is under `~/Projects/`** (before_agent_start handler, hard cwd scope). Why an extension: every context-file provider (AGENTS.md walk-up, .omp dirs, CLAUDE.md) resolves at or below repo root — a `~/Projects/AGENTS.md` would never load. APPEND_SYSTEM.md loads but broadcasts to ALL sessions. Verified live with quote-the-prompt probes on frank-zealot: - cwd=~/Projects/serverAppConfig -> bullet quoted verbatim - cwd=/tmp and cwd=~/.omp -> MISSING Rides git pull to every workstation (agent/extensions/ is tracked, not gitignored). Subagents inherit it via cwd. Known contradiction: serverAppConfigs repo AGENTS.md still preaches git-flow; injected law declares precedence until that repo is updated (its own PR, its own flow). bats 27/27.
dank added 1 commit 2026-10-18 14:43:11 -07:00
before_agent_start handler appends the trunk-based git law to the system
prompt only when cwd is under ~/Projects/. Hard cwd scope because every
context-file provider resolves at or below the repo root - an ancestor
AGENTS.md is never loaded by descendant repos. Verified live: quote probe
fires under serverAppConfig, silent in /tmp and ~/.omp. Fires for subagent
sessions too (shared cwd). Changelog entry added.
dank closed this pull request 2026-10-18 15:18:17 -07:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dank/command-center#9