Skip to content

Define Copilot host mapping and skill discovery - #192

Open
peaceful-weapon wants to merge 1 commit into
openprose:mainfrom
peaceful-weapon:peaceful-weapon-openprose-copilot-conformance-pr2
Open

peaceful-weapon wants to merge 1 commit into
openprose:mainfrom
peaceful-weapon:peaceful-weapon-openprose-copilot-conformance-pr2

Conversation

@peaceful-weapon

Copy link
Copy Markdown

Summary

  • Map Copilot CLI/SDK isolated renders to task with
    agent_type: "general-purpose", same-turn concurrency, and SDK questions to
    onUserInputRequest. Define blocked headless input without waiving the
    durable envelope for inline fallbacks.
  • Add Copilot project and personal skill roots to the compiler, Contract
    Markdown rules and language spec, with deterministic precedence and
    fail-closed unresolved declarations, backed by 14 conformance assertions.
  • Define Copilot MCP presence through the active session's advertised server
    registry, without executing declared CLIs or contacting MCP servers.
  • Separate function bindings/ from responsibility world-model/ plus receipts
    in the SKILL.md copy_binding row, aligning publication with prose.md's
    commit_world_model instead of treating both kinds as file copies.
  • Add check_tool rows to the SKILL.md adapter and spec/01-Language.md
    Prose Complete tables, making existing presence-only preflight requirements
    explicit in both host-capability summaries.

Refs #190

Use Case / Run Evidence

A caller has a document-skills:pdf skill installed where Copilot expects it,
but OpenProse rejects the declaration. In an isolated home,
copilot skill list sees ~\.copilot\skills\pdf, while the unmodified
declared-skills example produces skill_unresolved because OpenProse's
enumerated search roots omit that location.

Baseline: OpenProse 0ab7237, skill 0.18.1, runtime contract 2; Windows,
Copilot CLI 1.0.99-2 and @github/copilot-sdk 1.0.25 explicitly connected to
that same runtime. Twelve baseline model-backed probes cover a called
function, a Forme fan-in, skills, CLI/MCP tools, missing input, SDK callbacks
and prompt-mode autopilot. Two post-patch runs verify the discovery fix.
Each probe used a separate temporary project and home, without installing
anything into the user's personal configuration.

Representative observations:

  • A called function starts one isolated render and publishes its declared return.
  • Two producer task calls start 2 ms apart, overlap, and feed one join;
    all three canonical world-model hashes and receipt digest attestations verify.
  • SDK ask_user reaches onUserInputRequest, resumes with a supplied value,
    starts a real task, and writes the required basic function envelope.
  • The patched compiler resolves a formerly rejected Copilot-personal-only PDF
    skill and emits valid function-only IR.

The verdict remains partial conformance, not a claim that plugin loading
makes every Copilot surface Prose Complete. A default-model SDK run omitted
required activation/source artifacts, and a separate CLI run omitted its
completion marker despite a correct answer. The patch documents existing
obligations rather than claiming those execution-adherence problems are solved.

Design Boundary

The skill and interpreter documents are the executable language surface in
this repository. Host spellings belong in the Host Primitive Adapter; declared
skill resolution belongs in the pinned compiler and Contract Markdown rules.
This changes discovery semantics, not only installation documentation; the
umbrella issue records that boundary.

The root order is project skills, .github/skills, .agents/skills,
.claude/skills, then personal .claude/skills, .codex/skills,
.copilot/skills, .agents/skills. The old roots retain their relative order;
project roots precede personal roots. Within each root, flat layout precedes
namespaced layout, and the first matching directory wins. Existing additive
scope, skill_unresolved, and the no-install invariant remain unchanged.

For declarations that already resolved, configurations without duplicate skill
names select the same copy as before. Newly searched roots can resolve
previously missing declarations. With duplicate names, a matching copy in a
new project .github/skills, .agents/skills or .claude/skills root takes
precedence over any personal copy; ~/.copilot/skills also takes precedence
over ~/.agents/skills. Existing declarations can therefore select a different
copy when a duplicate exists in one of those newly searched, earlier roots.

MCP checks use exact advertised server registration for the active session,
including plugin and session-scoped configuration when advertised. Merely
finding a name in a configuration file is insufficient. Preflight does not
connect to servers or execute CLI tools.

No new VM, SDK dependency, wrapper binary, installer, plugin envelope, CI job,
served harness, or provider connector is added. Plugin delivery and install
documentation belong to the sibling contribution, Add native Copilot plugin
packaging
.

Examples

The existing declaration is unchanged:

### Skills

- document-skills:pdf

Before, a skill present only in ~\.copilot\skills\pdf was visible to Copilot
but produced skill_unresolved. After, the same isolated setup compiles the
unmodified example. Removing the skill still produces skill_unresolved and
writes no manifest.

Supply required inputs for prompt mode:

copilot -p "prose run entry.prose.md --topic copilot-smoke" `
  --plugin-dir <openprose-checkout> --allow-all-tools

An SDK host can collect an omitted input without changing the OpenProse source:

const session = await client.createSession({
  pluginDirectories: [openproseCheckout],
  onPermissionRequest: approveAll,
  onUserInputRequest: async (request) => ({
    answer: await collectAnswer(request),
    wasFreeform: true
  })
});
await session.sendAndWait({ prompt: "prose run entry.prose.md" });

approveAll is the probe's isolated-workspace permission policy, not a
recommended default for arbitrary SDK applications. Production hosts choose
their own permission handler and enable the required tools.

Testing

  • Linux: WSL Ubuntu, Node 22.16.0, pnpm 10.34.5, LF clone of the contribution
    branch. pnpm install --frozen-lockfile succeeds, then pnpm test passes
    all 318 tests in 20 suites, including all 14 new host-adapter assertions.
  • npx -y [email protected] install --frozen-lockfile succeeds on Windows;
    no dependency or lockfile changes.
  • npx -y [email protected] exec vitest run tests/open-prose/host-adapter/copilot.test.ts:
    14 passed. Before the interpreter changes, 12 of these assertions failed;
    the two existing-invariant checks already passed.
  • Windows npx -y [email protected] test: baseline 293 passed / 11 failed;
    patched 307 passed / the same 11 failed. The existing Windows failures are
    seven CRLF-sensitive facet lookups and four path-separator checks.
    All of those tests pass on the LF Linux clone.
  • Model-backed positive rerun: the personal-only PDF skill resolves at the
    thirteenth concrete candidate, and the compiler emits a 419-byte IR v2
    manifest with no diagnostics.
  • Model-backed negative rerun: all 16 flat/namespaced candidates are absent;
    the compiler reports skill_unresolved and emits no manifest.
  • git diff --check passes. Document/compiler assertions normalize CRLF
    locally rather than changing the existing corpus or unrelated tests.

No complete interactive UI certification is claimed.

Residual Risk / Follow-ups

  • Instruction-driven VM adherence remains model-dependent. Required envelopes,
    source isolation, portable IR paths and completion markers need separate
    deterministic enforcement or eval coverage.
  • Headless copilot -p exits 0 even when the embodied VM reports blocked
    input or failed compilation. Automation must inspect the semantic result
    and required artifacts; this patch does not change Copilot process status.
  • Background task handling and declared-model forwarding are conditional host
    guidance, not exercised conformance claims. VS Code runSubagent, cloud
    execution and desktop UI interactions were not tested or added here.
  • The new project roots are documented by this CLI's own skill help; the
    model-backed regression exercises the personal root. The deterministic
    suite prevents root-order drift across the three language surfaces.
  • Already-resolved names without duplicates retain their selected copy.
    Duplicate names can now select project .github/skills, .agents/skills
    or .claude/skills before any personal root, or ~/.copilot/skills before
    ~/.agents/skills; review those duplicates before adopting the new roots.
  • This contribution and Add native Copilot plugin packaging both insert
    below Unreleased; whichever lands second needs a trivial changelog rebase.
  • Arbitrary SDK skillDirectories, provider-only skills, custom plugin skill
    locations, disabled/missing MCP servers, repeated activations and alternate
    state backends remain outside the measured coverage.
  • The DAG receipts omit numeric per-render cost attribution even though the
    host's final usage export includes per-agent metrics. No telemetry bridge
    is introduced.

Prepared with GitHub Copilot agent sessions; publication approved by @peaceful-weapon.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 09c87812-17e2-4a02-99a5-f8661a013238
@josemontesdeoca

josemontesdeoca commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Hey @peaceful-weapon thanks for this contribution, and apologies for the slow response!

I appreciate how you’ve split the packaging work in #191 from the host mapping and skill discovery changes here, and clearly documented what you tested and the remaining limitations.

I’m picking up the maintainer review and will work with you on getting this ready to land. I’ll follow up here with any concrete findings.

I’d also be interested to hear what you’re building with OpenProse and Copilot, if you’d like to share.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants