feat(passthrough): generic RewriteFileFlag - gate-safe --X-file to --X off-argv spill #97
Labels
No labels
burndown-2026-06
sunday-sprint
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/cli-guard#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sources (one pattern, multiple copies):
cmd/coily/mcporter_rewrite.go- rewrites--args-file <path>->--args <json-content>.cmd/coily/gh_jq_inline.go(splitGHJQFlag,spillJQExpr) +rewriteJQFileingh_rest_rewrite.go- spills inline--jq <expr>/-qto a temp--jq-file <path>before the metachar gate, expands it back after.denial_reason.goenumerates a third instance (--change-batch).What it does: the same security primitive in three places - route a metachar-heavy flag value off-argv past the shell-metachar gate (read the file named by
--X-file, inline its trimmed contents under--X), so JSON/jq metacharacters don't trip the gate.Proposal: one generic
RewriteFileFlag(argv, fileFlag, targetFlag string)(plus the temp-spill + cleanup counterpart for the inline->file direction) that subsumes the mcporter, gh-jq, and change-batch cases.Consumer seams to parameterize: the flag-name pairs; the temp-file name prefix; the command-position start index (coily's
opsGHArgStart/ops ghhardcode).Suggested home (pre-refactor):
passthrough(it owns the metachar-gate boundary).Done when:
godoc-current.txtregenerated (scripts/check-godoc-current.sh --update)make testgreen both sidesclosesthis issueNote: the gh-jq half lives next to the GitHub-specific
gh_rest_rewrite.go(deliberately not extracted, too gh-specific) - lift only the generic file-flag-spill mechanism, not the gh REST rewriting.Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag:
burndown-2026-06.