Infer --commit-scope from a path arg when unambiguous, followup to #104 #105

Open
opened 2026-05-27 00:40:04 +00:00 by coilysiren · 0 comments
Owner

Problem

Followup to coilysiren/coily#104 (sticky scope). Even with sticky scope, there's a class of one-off cross-repo calls where Kai knows the target repo from the command itself - she's passing a path inside it. Today she still has to type --commit-scope=<that-same-repo> alongside the path.

Proposal

When --commit-scope is not passed and sticky scope is unset, look at the command's positional path arguments. If exactly one resolves to a path inside a known ~/projects/coilysiren/* repo, use that repo as the scope. If zero or more than one match, fall through to the current scope_unresolved error.

Audit log

Audit row records the resolved scope plus the source (flag / sticky / inferred-from-arg / env). Adding the source field is a small schema bump but makes "why did this call attribute to repo X" debuggable later.

Risk

Magic. A command that happens to mention a path in repo Y when Kai meant repo Z attributes to Y silently. Mitigations:

  • Only infer when exactly one repo matches across all path args (no ambiguity).
  • Print [scope: <name> (inferred from <arg>)] so the inference is visible.
  • Treat sticky scope as higher priority than inference, so scope use is the way to lock attribution.

Sequencing

Land coilysiren/coily#104 (sticky scope) first. Sticky handles the 95% case. This issue handles the residual cross-repo one-offs and is only worth doing if that residual still feels annoying after sticky ships.

Origin

Chat with Kai 2026-05-26, deferred from coilysiren/coily#104 as out-of-scope.

**Problem** Followup to coilysiren/coily#104 (sticky scope). Even with sticky scope, there's a class of one-off cross-repo calls where Kai knows the target repo from the command itself - she's passing a path inside it. Today she still has to type `--commit-scope=<that-same-repo>` alongside the path. **Proposal** When `--commit-scope` is not passed and sticky scope is unset, look at the command's positional path arguments. If exactly one resolves to a path inside a known `~/projects/coilysiren/*` repo, use that repo as the scope. If zero or more than one match, fall through to the current `scope_unresolved` error. **Audit log** Audit row records the resolved scope plus the source (`flag` / `sticky` / `inferred-from-arg` / `env`). Adding the source field is a small schema bump but makes "why did this call attribute to repo X" debuggable later. **Risk** Magic. A command that happens to mention a path in repo Y when Kai meant repo Z attributes to Y silently. Mitigations: - Only infer when exactly one repo matches across all path args (no ambiguity). - Print `[scope: <name> (inferred from <arg>)]` so the inference is visible. - Treat sticky scope as higher priority than inference, so `scope use` is the way to lock attribution. **Sequencing** Land coilysiren/coily#104 (sticky scope) first. Sticky handles the 95% case. This issue handles the residual cross-repo one-offs and is only worth doing if that residual still feels annoying after sticky ships. **Origin** Chat with Kai 2026-05-26, deferred from coilysiren/coily#104 as out-of-scope.
coilysiren added
P4
and removed
P3
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#105
No description provided.