Add a file mission input type#112
Open
mlund01 wants to merge 1 commit into
Open
Conversation
Add a `file` mission input so a mission can be handed a document to work
on. The file is exposed to agents as a read-only, text-only `input.<name>`
slot — a runtime-supplied, single-file analog of a packet — rather than
inlined into objectives.
Two supply forms, both flowing through the existing map[string]string input
plumbing and converging on the same isolated, materialized slot:
- path: a project-relative path (CLI / schedule), containment-checked
- base64: a {filename, content_base64} envelope (command center,
webhooks, MCP run_mission) for callers with no host path
Each input is materialized into its own per-run directory under
<squadron_home>/inputs/<mission>/<run_id>/<name>/, so the slot has no
sibling leak without pinned-file machinery. Path forms are copied
(10 MB cap); base64 forms are decoded with a sanitized basename. Staging
reuses the scratchpad sidecar + sweep model (SweepExpiredInputs). Raw
values are persisted and already-staged dirs are reused, so resume works
without the original source path.
File inputs are always required and reject default/protected. The MCP
host's run_mission now JSON-encodes structured input values instead of
fmt.Sprintf("%v", ...), so base64 envelopes (and list/object/map inputs)
round-trip intact.
Implements #111.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements #111.
Summary
Adds a new
filemission input type. A mission can declare an input as a file, and the caller supplies it at run time as either a project-relative path or a base64{filename, content_base64}upload. The file is exposed to agents as a read-only, text-onlyinput.<name>slot — a runtime-supplied, single-file analog of a packet — read via the existingfile_read/file_grep/file_searchtools, rather than inlined into objectives.Design
A file input reuses the packet slot machinery instead of inventing a parallel one. Both supply forms flow through the existing
map[string]stringinput plumbing and converge on the same materialized slot:run_mission). Decoded in, with the filename sanitized to a bare basename.Each input is materialized into its own per-run directory under
<squadron_home>/inputs/<mission>/<run_id>/<name>/, so the slot has no sibling leak without any pinned-file machinery. Single-file size is capped at 10 MB. Staging reuses the scratchpad sidecar + sweep model (SweepExpiredInputs, sharing asweepExpiredRunscore). Raw values are persisted and an already-staged dir is reused, so resume works without the original source path.File inputs are always required and reject
default/protected. They interpolate into objectives as their slot name (input.<name>), not their contents.The MCP host's
run_missionnow JSON-encodes structured input values instead offmt.Sprintf("%v", …), so a base64 envelope (and any list/object/map input) round-trips intact — fixing a latent bug for structured inputs generally.Tests
go build,go vet, and the fullgo test ./...pass. New coverage: materialization (both forms), filename sanitization, path-escape rejection, bad base64, size cap, missing-required, resume reuse, read-only/text-only slot enforcement, the input sweep, plus config-layer schema-parse / validation /ResolveInputValuestests. Also smoke-tested viasquadron verifyon a real file-input config.Docs
Updated
docs/content/missions/overview.mdx,docs/content/config/functions.mdx, andCLAUDE.md.🤖 Generated with Claude Code