Repository navigation
Add shareable orchestration templates (cmux orchestration): package format, store, trust-gated runs #8032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add shareable orchestration templates (cmux orchestration): package format, store, trust-gated runs #8032
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d57a96c
Add CmuxOrchestration package: manifest schema, validation, store, ru…
austinywang 83ae706
Add orchestration.* socket domain and app-side run actuation
austinywang e7d968c
Add cmux orchestration CLI namespace
austinywang ece9874
Add issue-fleet example template and docs/orchestrations.md
austinywang b5ee79f
Polish orchestration CLI JSON output and store reuse
austinywang d48a0d9
Extract CLI option-parsing helpers into CMUXCLI+OptionParsing.swift
austinywang 26521cf
Satisfy namespace-type conventions in CmuxOrchestration
austinywang dd75e89
Address review: trust fingerprint, symlink rejection, quoted prompt_f…
austinywang 7db5a6c
Split validator filesystem scans to stay under the 500-line file thre…
austinywang 49873fa
Address review: unbounded symlink scan, content digest in trust finge…
austinywang 52cfccd
Harden trust checks: unbounded symlink scan, content digest in finger…
austinywang a7a419c
Merge branch 'main' of https://github.com/manaflow-ai/cmux into feat-…
austinywang 253d246
Merge remote-tracking branch 'origin/main' into feat-orchestration-te…
austinywang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import Foundation | ||
|
|
||
| /// Shared per-command flag/option parsing helpers, extracted verbatim from | ||
| /// `cmux.swift` (which may not grow). All of them stop interpreting flags at | ||
| /// the `--` terminator so forwarded arguments pass through untouched. | ||
| extension CMUXCLI { | ||
| func parseOption(_ args: [String], name: String) -> (String?, [String]) { | ||
| var remaining: [String] = [] | ||
| var value: String? | ||
| var skipNext = false | ||
| var pastTerminator = false | ||
| for (idx, arg) in args.enumerated() { | ||
| if skipNext { | ||
| skipNext = false | ||
| continue | ||
| } | ||
| if arg == "--" { | ||
| pastTerminator = true | ||
| remaining.append(arg) | ||
| continue | ||
| } | ||
| if !pastTerminator, arg.hasPrefix("\(name)=") { | ||
| value = String(arg.dropFirst(name.count + 1)) | ||
| continue | ||
| } | ||
| if !pastTerminator, arg == name, idx + 1 < args.count { | ||
| value = args[idx + 1] | ||
| skipNext = true | ||
| continue | ||
| } | ||
| remaining.append(arg) | ||
| } | ||
| return (value, remaining) | ||
| } | ||
|
|
||
| func parseRepeatedOption(_ args: [String], name: String) -> ([String], [String]) { | ||
| var remaining: [String] = [] | ||
| var values: [String] = [] | ||
| var skipNext = false | ||
| var pastTerminator = false | ||
| for (idx, arg) in args.enumerated() { | ||
| if skipNext { | ||
| skipNext = false | ||
| continue | ||
| } | ||
| if arg == "--" { | ||
| pastTerminator = true | ||
| remaining.append(arg) | ||
| continue | ||
| } | ||
| if !pastTerminator, arg == name, idx + 1 < args.count { | ||
| values.append(args[idx + 1]) | ||
| skipNext = true | ||
| continue | ||
| } | ||
| remaining.append(arg) | ||
| } | ||
| return (values, remaining) | ||
| } | ||
|
|
||
| func optionValue(_ args: [String], name: String) -> String? { | ||
| for (index, arg) in args.enumerated() { | ||
| if arg == "--" { return nil } | ||
| if arg == name, index + 1 < args.count { | ||
| return args[index + 1] | ||
| } | ||
| if arg.hasPrefix("\(name)=") { | ||
| return String(arg.dropFirst(name.count + 1)) | ||
| } | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| func hasFlag(_ args: [String], name: String) -> Bool { | ||
| args.contains(name) | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Stop flag detection at the
--terminator.hasFlagcontradicts the documented parser contract and treats forwarded arguments as cmux flags. For example, a post-terminator--yesstill bypasses the orchestration trust prompt.Proposed fix
func hasFlag(_ args: [String], name: String) -> Bool { - args.contains(name) + args.prefix { $0 != "--" }.contains(name) }📝 Committable suggestion
🤖 Prompt for AI Agents