Sticky --commit-scope so the flag isn't required on every call #104

Open
opened 2026-05-27 00:39:19 +00:00 by coilysiren · 0 comments
Owner

Problem

coily --commit-scope=<repo-path> is required on every invocation when working from ~/projects/coilysiren/ (the parent cwd, which is 95% of Kai's workflow). Auto-resolving scope from cwd doesn't help here - cwd is the parent, not a repo. The flag is friction Kai pays on nearly every coily call.

Proposal

Sticky scope, modeled after kubectl config use-context:

  • coily scope use <repo> - write active scope to a per-shell or per-tty state file. Subsequent coily ... calls inherit it.
  • coily scope - print the active scope (no args).
  • coily scope clear - drop the active scope, require the flag again.
  • --commit-scope=<path> - still works, overrides sticky for that one call.

State location: per-tty so concurrent terminals don't fight (e.g. $XDG_RUNTIME_DIR/coily/scope-$(tty | tr / _) or similar). Falls back to a single global file if tty-keying is awkward.

Audit log

Audit log records the resolved scope at call time, not the source (flag vs sticky vs default). Attribution stays honest. The whole point of this feature is to not lose the audit log while removing the per-call typing.

Mitigation for context-shift mistakes

The risk is that Kai switches mental context between repos and forgets to switch scope. Mitigations:

  • coily scope with no args prints the active scope.
  • Coily prepends [scope: <name>] to its own output on every call, so the active scope is visible without asking.
  • Optional: warn if the active scope hasn't been touched in N hours (stale-scope hint).

Out of scope

  • Inferring scope from the first path argument in the command. Worth exploring later, but adds magic that's harder to reason about than sticky state.
  • Per-cwd scope (direnv-style). Doesn't help when cwd is always the parent.

Origin

Chat with Kai 2026-05-26. Quote: "the commit scope arg is super annoying to actually work with... I don't want to lose the entire audit log."

**Problem** `coily --commit-scope=<repo-path>` is required on every invocation when working from `~/projects/coilysiren/` (the parent cwd, which is 95% of Kai's workflow). Auto-resolving scope from cwd doesn't help here - cwd is the parent, not a repo. The flag is friction Kai pays on nearly every coily call. **Proposal** Sticky scope, modeled after `kubectl config use-context`: - `coily scope use <repo>` - write active scope to a per-shell or per-tty state file. Subsequent `coily ...` calls inherit it. - `coily scope` - print the active scope (no args). - `coily scope clear` - drop the active scope, require the flag again. - `--commit-scope=<path>` - still works, overrides sticky for that one call. State location: per-tty so concurrent terminals don't fight (e.g. `$XDG_RUNTIME_DIR/coily/scope-$(tty | tr / _)` or similar). Falls back to a single global file if tty-keying is awkward. **Audit log** Audit log records the *resolved* scope at call time, not the source (flag vs sticky vs default). Attribution stays honest. The whole point of this feature is to not lose the audit log while removing the per-call typing. **Mitigation for context-shift mistakes** The risk is that Kai switches mental context between repos and forgets to switch scope. Mitigations: - `coily scope` with no args prints the active scope. - Coily prepends `[scope: <name>]` to its own output on every call, so the active scope is visible without asking. - Optional: warn if the active scope hasn't been touched in N hours (stale-scope hint). **Out of scope** - Inferring scope from the first path argument in the command. Worth exploring later, but adds magic that's harder to reason about than sticky state. - Per-cwd scope (direnv-style). Doesn't help when cwd is always the parent. **Origin** Chat with Kai 2026-05-26. Quote: "the commit scope arg is super annoying to actually work with... I don't want to lose the entire audit log."
coilysiren added
P3
and removed
P2
labels 2026-05-31 06:59:43 +00:00
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-bridge/coily#104
No description provided.